juliencegarra / OpenMATB

OpenMATB: A Multi-Attribute Task Battery promoting task customization, software extendability and experiment replicability
Other
45 stars 33 forks source link

Error in OpenMATB-master on "default.txt" scenario #44

Open sinisapopovic opened 20 hours ago

sinisapopovic commented 20 hours ago

Hi, After downloading the zip of the OpenMATB master version and successfully starting the "default.txt" scenario on Windows 10 (using Python 3.9.13), I get an error around 10 seconds into the scenario, immediately upon pressing "space" after which SYSMON should be displayed alone. The scenario terminates at that moment and I get the folowing console output:

PS D:\Deployed\OpenMATB-master> python main.py
Traceback (most recent call last):
  File "D:\Deployed\OpenMATB-master\main.py", line 40, in <module>
    app = OpenMATB()
  File "D:\Deployed\OpenMATB-master\main.py", line 37, in __init__
    Scheduler()
  File "D:\Deployed\OpenMATB-master\core\scheduler.py", line 36, in __init__
    self.event_loop.run()
  File "D:\Program Files\Python\Python39\lib\site-packages\pyglet\app\base.py", line 169, in run
    timeout = self.idle()
  File "D:\Program Files\Python\Python39\lib\site-packages\pyglet\app\base.py", line 239, in idle
    redraw_all = self.clock.call_scheduled_functions(dt)
  File "D:\Program Files\Python\Python39\lib\site-packages\pyglet\clock.py", line 255, in call_scheduled_functions
    item.func(dt, *item.args, **item.kwargs)
  File "D:\Deployed\OpenMATB-master\core\clock.py", line 31, in advance
    self.tick()
  File "D:\Program Files\Python\Python39\lib\site-packages\pyglet\clock.py", line 348, in tick
    self.call_scheduled_functions(delta_t)
  File "D:\Program Files\Python\Python39\lib\site-packages\pyglet\clock.py", line 255, in call_scheduled_functions
    item.func(dt, *item.args, **item.kwargs)
  File "D:\Deployed\OpenMATB-master\core\scheduler.py", line 73, in update
    self.update_active_plugins()
  File "D:\Deployed\OpenMATB-master\core\scheduler.py", line 89, in update_active_plugins
    [p.update(self.scenario_time) for p in self.get_active_plugins()]
  File "D:\Deployed\OpenMATB-master\core\scheduler.py", line 89, in <listcomp>
    [p.update(self.scenario_time) for p in self.get_active_plugins()]
  File "D:\Deployed\OpenMATB-master\plugins\abstractplugin.py", line 60, in update
    self.refresh_widgets()
  File "D:\Deployed\OpenMATB-master\plugins\sysmon.py", line 183, in refresh_widgets
    if not super().refresh_widgets():
  File "D:\Deployed\OpenMATB-master\plugins\abstractplugin.py", line 243, in refresh_widgets
    self.get_widget('task_title').set_text(self.parameters['title'].upper())
  File "D:\Deployed\OpenMATB-master\core\widgets\simpletext.py", line 29, in set_text
    if text == self.get_text():
  File "D:\Deployed\OpenMATB-master\core\widgets\simpletext.py", line 36, in get_text
    return self.vertex['text'].text
KeyError: 'text'

I was able to make the "default.txt" scenario in master version run successfully to completion by commenting out the following two lines in "abstractwidget.py" (lines 99-100), which were introduced from version 1.3.0 to master version:

self.vertex = dict()
self.on_batch = dict()

I am not sure if this is the right way to approach solving this matter, as I get a bunch of unintended console output (below) that does not happen when running 1.3.0, but I hope it might be a helpful start. Best regards, Sinisa

PS D:\Deployed\OpenMATB-1.3.0> python main.py
PS D:\Deployed\OpenMATB-1.3.0> cd ..\OpenMATB-master\
PS D:\Deployed\OpenMATB-master> python main.py
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
t
i
x
5
8
0
t
i
x
5
8
0
radio
com_1
frequency
1
3
1
point
8
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
empty
t
i
x
5
8
0
t
i
x
5
8
0
radio
com_1
frequency
1
2
0
point
9
empty
benoitvalery commented 19 hours ago

Thanks @sinisapopovic for the feedback. We are currently working on this. It comes from a delicate merge we made earlier. Is it possible for you to use the last released version (1.3.0) or you were interested in some other features ? Thank for your response.

sinisapopovic commented 19 hours ago

Sure, using 1.3.0 is fine for me. Thank you and all the contributors for the work you have put into OpenMATB.