plugger.py
changeset 158 771578d7580e
parent 148 8be272b35525
child 173 2a9c4eec8645
equal deleted inserted replaced
157:2e6d52c17cab 158:771578d7580e
    97         self.MandatoryParams = ("BaseParams", self.BaseParams)
    97         self.MandatoryParams = ("BaseParams", self.BaseParams)
    98         self._AddParamsMembers()
    98         self._AddParamsMembers()
    99         self.PluggedChilds = {}
    99         self.PluggedChilds = {}
   100         # copy PluginMethods so that it can be later customized
   100         # copy PluginMethods so that it can be later customized
   101         self.PluginMethods = [dic.copy() for dic in self.PluginMethods]
   101         self.PluginMethods = [dic.copy() for dic in self.PluginMethods]
       
   102 
       
   103     def IsGUIPlugin(self):
       
   104         return False
   102 
   105 
   103     def PluginBaseXmlFilePath(self, PlugName=None):
   106     def PluginBaseXmlFilePath(self, PlugName=None):
   104         return os.path.join(self.PlugPath(PlugName), "baseplugin.xml")
   107         return os.path.join(self.PlugPath(PlugName), "baseplugin.xml")
   105     
   108     
   106     def PluginXmlFilePath(self, PlugName=None):
   109     def PluginXmlFilePath(self, PlugName=None):
  1091         self.EnableMethod("_Run", False)
  1094         self.EnableMethod("_Run", False)
  1092     
  1095     
  1093     def _Run(self, logger):
  1096     def _Run(self, logger):
  1094         command_start_plc = os.path.join(self._getBuildPath(),self.GetProjectName() + exe_ext)
  1097         command_start_plc = os.path.join(self._getBuildPath(),self.GetProjectName() + exe_ext)
  1095         if os.path.isfile(command_start_plc):
  1098         if os.path.isfile(command_start_plc):
       
  1099             has_gui_plugin = False
       
  1100             for PlugChild in self.IterChilds():
       
  1101                 has_gui_plugin |= PlugChild.IsGUIPlugin()
  1096             logger.write("Starting PLC\n")
  1102             logger.write("Starting PLC\n")
  1097             def this_plc_finish_callback(*args):
  1103             def this_plc_finish_callback(*args):
  1098                 if self.runningPLC is not None:
  1104                 if self.runningPLC is not None:
  1099                     self.runningPLC = None
  1105                     self.runningPLC = None
  1100                     self.reset_finished()
  1106                     self.reset_finished()
  1101             self.runningPLC = ProcessLogger(
  1107             self.runningPLC = ProcessLogger(
  1102                logger,
  1108                logger,
  1103                command_start_plc,
  1109                command_start_plc,
  1104                finish_callback = this_plc_finish_callback)
  1110                finish_callback = this_plc_finish_callback,
       
  1111                no_gui=wx.Platform != '__WXMSW__' or not has_gui_plugin)
  1105             self.EnableMethod("_Clean", False)
  1112             self.EnableMethod("_Clean", False)
  1106             self.EnableMethod("_Run", False)
  1113             self.EnableMethod("_Run", False)
  1107             self.EnableMethod("_Stop", True)
  1114             self.EnableMethod("_Stop", True)
  1108             self.EnableMethod("_build", False)
  1115             self.EnableMethod("_build", False)
  1109         else:
  1116         else: