Skip to content

Commit

Permalink
Fix for bug-fix Issue damies13#241
Browse files Browse the repository at this point in the history
  • Loading branch information
ArekKuczynski committed May 24, 2024
1 parent 618ac57 commit 6c032f0
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions rfswarm_manager/rfswarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2704,8 +2704,7 @@ def OpenFile(self, ScenarioFile):
base.debugmsg(7, "combined:", combined)
scriptname = os.path.abspath(combined)
base.debugmsg(7, "scriptname:", scriptname)
if not self.sr_file_validate(rowcount, scriptname):
break
self.sr_file_validate(rowcount, scriptname)
else:
base.debugmsg(3, "script missing [", istr, "]")
fileok = False
Expand Down Expand Up @@ -3213,24 +3212,18 @@ def sr_file_validate(self, r, *args):
scriptfile = ""

if not os.path.exists(scriptfile):
msg = "The referenced file:\n" + scriptfile + "\n\ncannot be found by RFSwarm Manager."
if not base.args.nogui:
msg = "File:\n" + scriptfile + "\n\nwhich is saved in the scenaro file as a script cannot be found by RFSwarm Manager."
msg += "\n\nScenario dir:\n" + base.config['Plan']['ScenarioDir']
tkm.showwarning("RFSwarm - Warning", msg)
else:
base.debugmsg(0, "File:", scriptfile, "cannot be found in", base.config['Plan']['ScenarioDir'])
base.config['Plan']['ScenarioFile'] = base.inisafevalue("")
base.saveini()
base.debugmsg(0, msg)
return False
elif not os.path.isfile(scriptfile):
msg = "The referenced file:\n" + scriptfile + "\n\nis a directory, not a file."
if not base.args.nogui:
msg = "Path:\n" + scriptfile + "\n\nwhich is saved in the scenaro file as a script is not a file."
msg += "\n\nScenario dir:\n" + base.config['Plan']['ScenarioDir']
tkm.showwarning("RFSwarm - Warning", msg)
else:
base.debugmsg(0, "Path:", scriptfile, "is not a file!")
base.config['Plan']['ScenarioFile'] = base.inisafevalue("")
base.saveini()
base.debugmsg(0, msg)
return False

base.debugmsg(7, "scriptfile:", scriptfile)
Expand Down Expand Up @@ -5846,6 +5839,7 @@ def pln_update_graph(self):

totalcalc = {}

base.debugmsg(6, "Scriptlist:", base.scriptlist)
for grp in base.scriptlist:
base.debugmsg(6, "grp:", grp)
if 'Index' in grp:
Expand Down Expand Up @@ -5967,7 +5961,10 @@ def pln_update_graph(self):
self.axis.xaxis.set_major_formatter(xformatter)
self.fig.autofmt_xdate(bottom=0.2, rotation=30, ha='right')

self.canvas.draw()
try:
self.canvas.draw()
except Exception as e:
base.debugmsg(9, "Graphdata:", graphdata, "Exception:", e)

self.pln_graph_update = False

Expand Down

0 comments on commit 6c032f0

Please sign in to comment.