LPCManager.py
changeset 30 9cd6bc93ed89
parent 28 79ee4178006c
child 32 6942b30d13c4
equal deleted inserted replaced
29:86fb7dc2b54e 30:9cd6bc93ed89
   919             status = "Disconnected"
   919             status = "Disconnected"
   920         elif self.OnlineMode == "BOOTLOADER":
   920         elif self.OnlineMode == "BOOTLOADER":
   921             status = "Connected"
   921             status = "Connected"
   922         else:
   922         else:
   923             if self._connector is not None:
   923             if self._connector is not None:
   924                 status = self._connector.GetPLCstatus()
   924                 status, log_count = self._connector.GetPLCstatus()
       
   925                 self.UpdatePLCLog(log_count)
   925             else:
   926             else:
   926                 status = "Disconnected"
   927                 status = "Disconnected"
   927         if self.previous_plcstate != status or self.previous_mode != self.CurrentMode:
   928         if self.previous_plcstate != status or self.previous_mode != self.CurrentMode:
   928             simulating = self.CurrentMode == SIMULATION_MODE
   929             simulating = self.CurrentMode == SIMULATION_MODE
   929             for args in {
   930             for args in {
   949                                       ("_Transfer", False)],
   950                                       ("_Transfer", False)],
   950                    }.get(status,[]):
   951                    }.get(status,[]):
   951                 self.ShowMethod(*args)
   952                 self.ShowMethod(*args)
   952             self.previous_plcstate = status
   953             self.previous_plcstate = status
   953             self.previous_mode = self.CurrentMode
   954             self.previous_mode = self.CurrentMode
       
   955             if self.AppFrame is not None:
       
   956                 self.AppFrame.RefreshStatusToolBar()
   954             return True
   957             return True
   955         return False
   958         return False
   956 
   959 
   957     def Generate_plc_declare_locations(self):
   960     def Generate_plc_declare_locations(self):
   958         """
   961         """
  1106         # files are stacked at the beginning, as files of confnode tree root
  1109         # files are stacked at the beginning, as files of confnode tree root
  1107         for generator, filename, name in [
  1110         for generator, filename, name in [
  1108            # debugger code
  1111            # debugger code
  1109            (self.Generate_plc_debugger, "plc_debugger.c", "Debugger"),
  1112            (self.Generate_plc_debugger, "plc_debugger.c", "Debugger"),
  1110            # init/cleanup/retrieve/publish, run and align code
  1113            # init/cleanup/retrieve/publish, run and align code
  1111            (self.Generate_plc_common_main,"plc_common_main.c","Common runtime"),
  1114            (self.Generate_plc_main,"plc_main.c","Common runtime"),
  1112            # declare located variables for simulate in a black box
  1115            # declare located variables for simulate in a black box
  1113            (self.Generate_plc_declare_locations,"plc_declare_locations.c","Declare Locations"),
  1116            (self.Generate_plc_declare_locations,"plc_declare_locations.c","Declare Locations"),
  1114            # declare located variables for simulate in a black box
  1117            # declare located variables for simulate in a black box
  1115            (self.Generate_lpc_retain_array_sim,"lpc_retain_array_sim.c","Retain Array for Simulation")]:
  1118            (self.Generate_lpc_retain_array_sim,"lpc_retain_array_sim.c","Retain Array for Simulation")]:
  1116             try:
  1119             try: