etherlab/EtherCATManagementEditor.py
branchwxPython4
changeset 3572 b46af5b80c7d
parent 3303 0ffb41625592
child 3750 f62625418bff
equal deleted inserted replaced
3571:fdd4b171ac6c 3572:b46af5b80c7d
  1495         # Check whether beremiz connected or not, and whether status is "Started" or not.
  1495         # Check whether beremiz connected or not, and whether status is "Started" or not.
  1496         check_connect_flag = self.Controler.CommonMethod.CheckConnect(False)
  1496         check_connect_flag = self.Controler.CommonMethod.CheckConnect(False)
  1497         if check_connect_flag:
  1497         if check_connect_flag:
  1498             status, _log_count = self.Controler.GetCTRoot()._connector.GetPLCstatus()
  1498             status, _log_count = self.Controler.GetCTRoot()._connector.GetPLCstatus()
  1499             if status is not PlcStatus.Started:
  1499             if status is not PlcStatus.Started:
  1500                 dialog = wx.FileDialog(self, _("Choose a binary file"), os.getcwd(), "",  _("bin files (*.bin)|*.bin"), wx.OPEN)
  1500                 dialog = wx.FileDialog(self, _("Choose a binary file"), os.getcwd(), "",  _("bin files (*.bin)|*.bin"), wx.FD_OPEN)
  1501 
  1501 
  1502                 if dialog.ShowModal() == wx.ID_OK:
  1502                 if dialog.ShowModal() == wx.ID_OK:
  1503                     filepath = dialog.GetPath()
  1503                     filepath = dialog.GetPath()
  1504                     try:
  1504                     try:
  1505                         binfile = open(filepath, "rb")
  1505                         binfile = open(filepath, "rb")
  1894         Load binary file through FileDialog
  1894         Load binary file through FileDialog
  1895         Binded to 'Read from File' button.
  1895         Binded to 'Read from File' button.
  1896         @param event : wx.EVT_BUTTON object
  1896         @param event : wx.EVT_BUTTON object
  1897         """
  1897         """
  1898         dialog = wx.FileDialog(self, _("Choose a binary file"), os.getcwd(), "",
  1898         dialog = wx.FileDialog(self, _("Choose a binary file"), os.getcwd(), "",
  1899                                _("bin files (*.bin)|*.bin"), wx.OPEN)
  1899                                _("bin files (*.bin)|*.bin"), wx.FD_OPEN)
  1900 
  1900 
  1901         if dialog.ShowModal() == wx.ID_OK:
  1901         if dialog.ShowModal() == wx.ID_OK:
  1902             filepath = dialog.GetPath()
  1902             filepath = dialog.GetPath()
  1903 
  1903 
  1904             try:
  1904             try: