LPCBeremiz.py
changeset 560 681fe60443fc
parent 559 0f5544587037
child 561 4cc6eef4778f
equal deleted inserted replaced
559:0f5544587037 560:681fe60443fc
   597             simulating = self.CurrentMode == SIMULATION_MODE
   597             simulating = self.CurrentMode == SIMULATION_MODE
   598             for args in {
   598             for args in {
   599                      "Started" :     [("_Simulate", False),
   599                      "Started" :     [("_Simulate", False),
   600                                       ("_Run", False),
   600                                       ("_Run", False),
   601                                       ("_Stop", True),
   601                                       ("_Stop", True),
   602                                       ("_build", False),
   602                                       ("_build", True),
   603                                       ("_Transfer", True)],
   603                                       ("_Transfer", True)],
   604                      "Stopped" :     [("_Simulate", False),
   604                      "Stopped" :     [("_Simulate", False),
   605                                       ("_Run", True),
   605                                       ("_Run", True),
   606                                       ("_Stop", False),
   606                                       ("_Stop", False),
   607                                       ("_build", False),
   607                                       ("_build", True),
   608                                       ("_Transfer", True)],
   608                                       ("_Transfer", True)],
   609                      "Connected" :   [("_Simulate", not simulating),
   609                      "Connected" :   [("_Simulate", not simulating),
   610                                       ("_Run", False),
   610                                       ("_Run", False),
   611                                       ("_Stop", simulating),
   611                                       ("_Stop", simulating),
   612                                       ("_build", False),
   612                                       ("_build", True),
   613                                       ("_Transfer", True)],
   613                                       ("_Transfer", True)],
   614                      "Disconnected" :[("_Simulate", not simulating),
   614                      "Disconnected" :[("_Simulate", not simulating),
   615                                       ("_Run", False),
   615                                       ("_Run", False),
   616                                       ("_Stop", simulating),
   616                                       ("_Stop", simulating),
   617                                       ("_build", True),
   617                                       ("_build", True),
   767     def _Stop(self):
   767     def _Stop(self):
   768         PluginsRoot._Stop(self)
   768         PluginsRoot._Stop(self)
   769         
   769         
   770         if self.CurrentMode == SIMULATION_MODE:
   770         if self.CurrentMode == SIMULATION_MODE:
   771             self.StopSimulation()
   771             self.StopSimulation()
       
   772 
       
   773     def CompareLocalAndRemotePLC(self):
       
   774         if self.LPCConnector is None:
       
   775             return
       
   776         # We are now connected. Update button status
       
   777         MD5 = self.GetLastBuildMD5()
       
   778         # Check remote target PLC correspondance to that md5
       
   779         if MD5 is not None and self.LPCConnector.MatchMD5(MD5):
       
   780             # warns controller that program match
       
   781             self.ProgramTransferred()
   772 
   782 
   773     def _Transfer(self):
   783     def _Transfer(self):
   774         if self.CurrentMode is None and self.OnlineMode != "OFF":
   784         if self.CurrentMode is None and self.OnlineMode != "OFF":
   775             self.CurrentMode = TRANSFER_MODE
   785             self.CurrentMode = TRANSFER_MODE
   776             
   786