plugger.py
changeset 105 434aed8dc58d
parent 97 9c6fdf60ad2e
child 106 9810689febb0
--- a/plugger.py	Mon Feb 18 18:34:24 2008 +0100
+++ b/plugger.py	Thu Feb 21 11:42:33 2008 +0100
@@ -487,6 +487,10 @@
             
 
     def LoadXMLParams(self, PlugName = None):
+        methode_name = os.path.join(self.PlugPath(PlugName), "methods.py")
+        if os.path.isfile(methode_name):
+            execfile(methode_name)
+
         # Get the base xml tree
         if self.MandatoryParams:
             basexmlfile = open(self.PluginBaseXmlFilePath(PlugName), 'r')
@@ -938,8 +942,6 @@
         
         return True
         
-        
-    # Link object files into something that can be executed on target
 
     def _showIECcode(self, logger):
         plc_file = self._getIECcodepath()
@@ -993,29 +995,36 @@
     def _Run(self, logger):
         logger.write_error("Not impl\n")
 
+    def _Stop(self, logger):
+        logger.write_error("Not impl\n")
+
     PluginMethods = [
         {"bitmap" : os.path.join("images", "editPLC"),
          "name" : "Edit PLC",
          "tooltip" : "Edit PLC program with PLCOpenEditor",
-         "method" : _EditPLC},
+         "method" : "_EditPLC"},
         {"bitmap" : os.path.join("images", "Build"),
          "name" : "Build",
          "tooltip" : "Build project into build folder",
-         "method" : _build},
+         "method" : "_build"},
         {"bitmap" : os.path.join("images", "Clean"),
          "name" : "Clean",
          "tooltip" : "Clean project build folder",
-         "method" : _Clean},
+         "method" : "_Clean"},
         {"bitmap" : os.path.join("images", "Run"),
          "name" : "Run",
          "tooltip" : "Run PLC from build folder",
-         "method" : _Run},
+         "method" : "_Run"},
+        {"bitmap" : os.path.join("images", "Stop"),
+         "name" : "Stop",
+         "tooltip" : "Stop Running PLC",
+         "method" : "_Stop"},
         {"bitmap" : os.path.join("images", "ShowIECcode"),
          "name" : "Show IEC code",
          "tooltip" : "Show IEC code generated by PLCGenerator",
-         "method" : _showIECcode},
+         "method" : "_showIECcode"},
         {"name" : "Edit raw IEC code",
          "tooltip" : "Edit raw IEC code added to code generated by PLCGenerator",
-         "method" : _editIECrawcode}
+         "method" : "_editIECrawcode"}
     ]