Beremiz_service.py
changeset 1593 6a27490fed96
parent 1592 c40355f450a5
child 1594 049b7144a710
equal deleted inserted replaced
1592:c40355f450a5 1593:6a27490fed96
   284                         Thread(target=self.pyroserver.plcobj.StopPLC).start()
   284                         Thread(target=self.pyroserver.plcobj.StopPLC).start()
   285                     else:
   285                     else:
   286                         print _("PLC is not started.")
   286                         print _("PLC is not started.")
   287 
   287 
   288             def OnTaskBarChangeInterface(self, evt):
   288             def OnTaskBarChangeInterface(self, evt):
   289                 dlg = ParamsEntryDialog(None, _("Enter the IP of the interface to bind"), defaultValue=self.pyroserver.ip_addr)
   289                 ip_addr = self.pyroserver.ip_addr
       
   290                 ip_addr = '' if ip_addr is None else ip_addr
       
   291                 dlg = ParamsEntryDialog(None, _("Enter the IP of the interface to bind"), defaultValue=ip_addr)                
   290                 dlg.SetTests([(re.compile('\d{1,3}(?:\.\d{1,3}){3}$').match, _("IP is not valid!")),
   292                 dlg.SetTests([(re.compile('\d{1,3}(?:\.\d{1,3}){3}$').match, _("IP is not valid!")),
   291                                ( lambda x :len([x for x in x.split(".") if 0 <= int(x) <= 255]) == 4, _("IP is not valid!"))
   293                                ( lambda x :len([x for x in x.split(".") if 0 <= int(x) <= 255]) == 4, _("IP is not valid!"))
   292                                ])
   294                                ])
   293                 if dlg.ShowModal() == wx.ID_OK:
   295                 if dlg.ShowModal() == wx.ID_OK:
   294                     self.pyroserver.ip_addr = dlg.GetValue()
   296                     self.pyroserver.ip_addr = dlg.GetValue()