diff -r a7f58414dea0 -r cd90e4c10261 plugger.py --- a/plugger.py Wed Jul 29 10:49:31 2009 +0200 +++ b/plugger.py Wed Jul 29 15:17:10 2009 +0200 @@ -910,14 +910,6 @@ # define name for IEC raw code file return os.path.join(self.PlugPath(), "raw_plc.st") - def _getPYTHONcodepath(self): - # define name for IEC raw code file - return os.path.join(self.PlugPath(), "runtime.py") - - def _getWXGLADEpath(self): - # define name for IEC raw code file - return os.path.join(self.PlugPath(), "hmi.wxg") - def GetLocations(self): locations = [] filepath = os.path.join(self._getBuildPath(),"LOCATED_VARIABLES.h") @@ -1073,15 +1065,6 @@ else: return None - def launch_wxglade(self, options, wait=False): - from wxglade import __file__ as fileName - path = os.path.dirname(fileName) - glade = os.path.join(path, 'wxglade.py') - if wx.Platform == '__WXMSW__': - glade = "\"%s\""%glade - mode = {False:os.P_NOWAIT, True:os.P_WAIT}[wait] - os.spawnv(mode, sys.executable, ["\"%s\""%sys.executable] + [glade] + options) - ####################################################################### # # C CODE GENERATION METHODS @@ -1096,27 +1079,10 @@ @return: [(C_file_name, CFLAGS),...] , LDFLAGS_TO_APPEND """ - res = ([(C_file_name, self.plcCFLAGS) + return ([(C_file_name, self.plcCFLAGS) for C_file_name in self.PLCGeneratedCFiles ], "", # no ldflags False) # do not expose retreive/publish calls - - pyfile=self._getPYTHONcodepath() - if os.path.exists(pyfile): - res += (("runtime.py", file(pyfile,"rb")),) - wxgfile=self._getWXGLADEpath() - if os.path.exists(wxgfile): - hmipyfile=os.path.join(self._getBuildPath(),"hmi.py") - if wx.Platform == '__WXMSW__': - wxgfile = "\"%s\""%wxgfile - _hmipyfile = "\"%s\""%hmipyfile - else: - _hmipyfile = hmipyfile - self.launch_wxglade(['-o', _hmipyfile, '-g', 'python', wxgfile], wait=True) - res += (("hmi.py", file(hmipyfile,"rb")),) - - return res - def ResetIECProgramsAndVariables(self): """ @@ -1211,23 +1177,6 @@ return debug_code - def Generate_plc_python(self): - """ - Generate trace/debug code out of PLC variable list - """ - self.GetIECProgramsAndVariables() - - python_eval_fb_list = [] - for v in self._VariablesList : - if v["vartype"] == "FB" and v["type"] in ["PYTHON_EVAL","PYTHON_POLL"]: - python_eval_fb_list.append(v) - python_eval_fb_count = max(1, len(python_eval_fb_list)) - - # prepare debug code - python_code = targets.code("plc_python") % { - "python_eval_fb_count": python_eval_fb_count} - return python_code - def Generate_plc_common_main(self): """ Use plugins layout given in LocationCFilesAndCFLAGS to @@ -1334,8 +1283,6 @@ for generator, filename, name in [ # debugger code (self.Generate_plc_debugger, "plc_debugger.c", "Debugger"), - # IEC<->python gateway code - (self.Generate_plc_python, "plc_python.c", "IEC-Python gateway"), # init/cleanup/retrieve/publish, run and align code (self.Generate_plc_common_main,"plc_common_main.c","Common runtime")]: try: @@ -1407,32 +1354,6 @@ new_dialog.Show() - def _editPYTHONcode(self): - from PythonSTC import PythonCodePanel - new_dialog = wx.Frame(self.AppFrame) - - PYTHON_viewer = PythonCodePanel(new_dialog, self.AppFrame) - #ST_viewer.Enable(False) - pyfile=self._getPYTHONcodepath() - PYTHON_viewer.LoadSourceFile(pyfile) - - new_dialog.Show() - - def _editWXGLADE(self): - wxg_filename = self._getWXGLADEpath() - if not os.path.exists(wxg_filename): - open(wxg_filename,"w").write(""" - - - - frame_1 - - -""") - if wx.Platform == '__WXMSW__': - wxg_filename = "\"%s\""%wxg_filename - self.launch_wxglade([wxg_filename]) - def _EditPLC(self): if self.PLCEditor is None: self.RefreshPluginsBlockLists() @@ -1873,12 +1794,4 @@ "name" : _("Raw IEC code"), "tooltip" : _("Edit raw IEC code added to code generated by PLCGenerator"), "method" : "_editIECrawcode"}, - {"bitmap" : opjimg("editPYTHONcode"), - "name" : "Python code", - "tooltip" : "Write Python runtime code, for use with python_eval FBs", - "method" : "_editPYTHONcode"}, - {"bitmap" : opjimg("editWXGLADE"), - "name" : "WXGLADE GUI", - "tooltip" : "Edit a WxWidgets GUI with WXGlade", - "method" : "_editWXGLADE"}, ]