mberntsen
When I generate the program code for the first time, everything works as expected. However, when I generate it a second time, it crashes 100% of the time with the following message:

(PLCOpenEditor.py:9533): Gtk-CRITICAL **: IA__gtk_widget_set_size_request: assertion 'width >= -1' failed
Traceback (most recent call last):
File "PLCOpenEditor.py", line 308, in OnGenerateProgramMenu
dialog = wx.FileDialog(self, _("Choose a file"), os.getcwd(), self.Controler.GetProgramFilePath(), _("ST files (*.st)|*.st|All files|*.*"), wx.SAVE | wx.CHANGE_DIR)
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_windows.py", line 3139, in __init__
_windows_.FileDialog_swiginit(self,_windows_.new_FileDialog(*args, **kwargs))
PyAssertionError: C++ assertion "volDummy.empty() && pathDummy.empty()" failed at ../src/common/filename.cpp(568) in Assign(): the file name shouldn't contain the path

I saw that the item has been discussed more then a year ago, but this is my fix, works like a charm:
        if self.Controler.GetProgramFilePath() <> '':
            path, filename = os.path.split(self.Controler.GetProgramFilePath())
        else:
            path = os.getcwd()
            filename = ''
        dialog = wx.FileDialog(self, _("Choose a file"), path, filename,  _("ST files (*.st)|*.st|All files|*.*"), wx.SAVE | wx.CHANGE_DIR)
Reply 0 0
thiagoralves
Thanks! I'll make sure to include that on the next version
Reply 0 0
skv
Thank you for the report,  the problem is already fixed in PLCOpenEditor/Beremiz repository.
https://bitbucket.org/automforge/beremiz/commits/e04824ad26e4afc46335f2f4c90106c7b0a24461
Reply 0 0
Reply