Skip to content

Commit

Permalink
Check for robots or users
Browse files Browse the repository at this point in the history
Need to read users for scenario's saved pre 0.7.0 but also need to read robots for scenarios saved post 0.7.1
This resolves Issue #88
  • Loading branch information
damies13 committed May 20, 2021
1 parent 38c25c6 commit 1d4ca51
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions rfswarm_manager/rfswarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2340,12 +2340,17 @@ def OpenFile(self, ScenarioFile):
else:
base.addScriptRow()
# users = 13
if "users" in filedata[istr]:
base.debugmsg(8, "filedata[", istr, "][users]:", filedata[istr]["users"])
# base.scriptlist[ii]["users"] = filedata[istr]["users"]
self.sr_users_validate(rowcount, int(filedata[istr]["users"]))
# delay = 0
if "robots" in filedata[istr] or "users" in filedata[istr]:
if "robots" in filedata[istr]:
base.debugmsg(8, "filedata[", istr, "][robots]:", filedata[istr]["robots"])
self.sr_users_validate(rowcount, int(filedata[istr]["robots"]))
else:
base.debugmsg(8, "filedata[", istr, "][users]:", filedata[istr]["users"])
# base.scriptlist[ii]["users"] = filedata[istr]["users"]
self.sr_users_validate(rowcount, int(filedata[istr]["users"]))
# delay = 0
else:
base.debugmsg(3, "robots missing [",istr,"]")
fileok = False
if "delay" in filedata[istr]:
base.debugmsg(8, "filedata[", istr, "][delay]:", filedata[istr]["delay"])
Expand Down

0 comments on commit 1d4ca51

Please sign in to comment.