Skip to content

Commit

Permalink
Bug: redundant check before sim start
Browse files Browse the repository at this point in the history
Signed-off-by: SystemsPurge <[email protected]>
  • Loading branch information
SystemsPurge committed Nov 7, 2024
1 parent 65bd910 commit 412be7b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions villas/controller/components/simulators/dpsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,18 @@ def start(self, payload):
if fp:
self.load_cim(fp)

if self.change_state('starting'):
try:
self.change_state('starting')
self.logger.info('Starting simulation...')

self.logger.info(self.sim)
check = self.sim.start()
self.logger.info(f"+++++{check}+++++")
if check is None:
if self.sim.start() is None:
self.change_state('running')
else:
self.change_to_error('failed to start simulation')
self.logger.warn('Attempt to start simulator failed.'
'State is %s', self._state)
else:
except Exception as e:
self.logger.warn('Attempted to start non-stopped simulator.'
'State is %s', self._state)

Expand Down

0 comments on commit 412be7b

Please sign in to comment.