--- a/LPCManager.py Thu Jun 14 15:04:08 2012 +0200
+++ b/LPCManager.py Thu Jun 14 15:24:12 2012 +0200
@@ -72,7 +72,7 @@
import targets
from LPCtarget import LPC_target
targets.targets["LPC"] = {"xsd": os.path.join(_base_path, "LPCtarget", "XSD"),
- "class": lambda:LPC_target,
+ "class": lambda: LPC_target,
"code": os.path.join(_base_path,"LPCtarget","plc_LPC_main.c")}
targets.toolchains["makefile"] = os.path.join(_base_path, "LPCtarget", "XSD_toolchain_makefile")
@@ -81,6 +81,17 @@
misc.opjimg = lambda imgname: os.path.join(_base_folder, "beremiz", "images", imgname+".png")
from Beremiz import *
+
+import features
+from POULibrary import POULibrary
+
+class PLCLibrary(POULibrary):
+ def GetLibraryPath(self):
+ return os.path.join(_base_path, "pous.xml")
+
+features.libraries.append(
+ ('LPC', lambda: PLCLibrary))
+
from ProjectController import ProjectController
from ConfigTreeNode import ConfigTreeNode
from ProjectNodeEditor import ProjectNodeEditor
@@ -585,12 +596,12 @@
if self.GetChildByName("Master") is None:
master = self.CTNAddChild("Master", "CanOpenNode", 0)
- master.BaseParams.setEnabled(False)
+ #master.BaseParams.setEnabled(False)
master.CTNRequestSave()
if self.GetChildByName("Slave") is None:
slave = self.CTNAddChild("Slave", "CanOpenSlave", 1)
- slave.BaseParams.setEnabled(False)
+ #slave.BaseParams.setEnabled(False)
slave.CTNRequestSave()
@@ -605,7 +616,7 @@
@param dst: destination directory
"""
for i in os.listdir(src):
- if not i.startswith('.') and i != "pous.xml":
+ if not i.startswith('.'):
srcpath = os.path.join(src,i)
dstpath = os.path.join(dst,i)
if os.path.isdir(srcpath):
@@ -688,12 +699,6 @@
infos["values"].append(resources)
return infos
- def ConfNodeLibraryFilePath(self):
- if self.OrigBuildPath is not None:
- return os.path.join(self.OrigBuildPath, "pous.xml")
- else:
- return ProjectController.ConfNodeLibraryFilePath(self)
-
def GetProjectName(self):
return self.Project.getname()
@@ -856,7 +861,7 @@
if havecanfestival and self.GetChildByName("CanOpen") is None:
canopen = self.CTNAddChild("CanOpen", "CanOpen", 0)
- canopen.BaseParams.setEnabled(False)
+ #canopen.BaseParams.setEnabled(False)
canopen.LoadChildren()
canopen.CTNRequestSave()
@@ -1491,12 +1496,12 @@
leftwindowsizer = wx.BoxSizer(wx.HORIZONTAL)
leftwindowvsizer.AddSizer(leftwindowsizer, 0, border=0, flag=0)
- self.GenerateEnableButton(leftwindow, leftwindowsizer, confnode)
+ #self.GenerateEnableButton(leftwindow, leftwindowsizer, confnode)
st = wx.StaticText(leftwindow, -1)
st.SetFont(wx.Font(faces["size"], wx.DEFAULT, wx.NORMAL, wx.BOLD, faceName = faces["helv"]))
st.SetLabel(confnode.GetFullIEC_Channel())
- leftwindowsizer.AddWindow(st, 0, border=5, flag=wx.RIGHT)
+ leftwindowsizer.AddWindow(st, 0, border=5, flag=wx.LEFT|wx.RIGHT)
expandbutton_id = wx.NewId()
expandbutton = wx.lib.buttons.GenBitmapToggleButton(id=expandbutton_id, bitmap=wx.Bitmap(Bpath( 'images', 'plus.png')),