Skip to content

Commit 412be7b

Browse files
committed
Bug: redundant check before sim start
Signed-off-by: SystemsPurge <[email protected]>
1 parent 65bd910 commit 412be7b

File tree

1 file changed

+4
-5
lines changed
  • villas/controller/components/simulators

1 file changed

+4
-5
lines changed

villas/controller/components/simulators/dpsim.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,18 @@ def start(self, payload):
6363
if fp:
6464
self.load_cim(fp)
6565

66-
if self.change_state('starting'):
66+
try:
67+
self.change_state('starting')
6768
self.logger.info('Starting simulation...')
6869

6970
self.logger.info(self.sim)
70-
check = self.sim.start()
71-
self.logger.info(f"+++++{check}+++++")
72-
if check is None:
71+
if self.sim.start() is None:
7372
self.change_state('running')
7473
else:
7574
self.change_to_error('failed to start simulation')
7675
self.logger.warn('Attempt to start simulator failed.'
7776
'State is %s', self._state)
78-
else:
77+
except Exception as e:
7978
self.logger.warn('Attempted to start non-stopped simulator.'
8079
'State is %s', self._state)
8180

0 commit comments

Comments
 (0)