--- a/plugins/canfestival/canfestival.py Mon Jan 19 08:40:09 2009 +0100
+++ b/plugins/canfestival/canfestival.py Mon Jan 19 10:08:45 2009 +0100
@@ -234,8 +234,6 @@
Gen_OD_path = os.path.join(buildpath, "OD_%s.c"%prefix )
# Create a new copy of the model with DCF loaded with PDO mappings for desired location
master, pointers = config_utils.GenerateConciseDCF(locations, current_location, self, self.CanFestivalNode.getSync_TPDOs(),"OD_%s"%prefix)
- # allow access to local OD from Master PLC
- pointers.update(config_utils.LocalODPointers(locations, current_location, master))
res = gen_cfile.GenerateFile(Gen_OD_path, master, pointers)
--- a/plugins/canfestival/config_utils.py Mon Jan 19 08:40:09 2009 +0100
+++ b/plugins/canfestival/config_utils.py Mon Jan 19 10:08:45 2009 +0100
@@ -595,7 +595,10 @@
dcfgenerator = ConciseDCFGenerator(nodelist, nodename)
dcfgenerator.GenerateDCF(locations, current_location, sync_TPDOs)
- return dcfgenerator.GetMasterNode(), dcfgenerator.GetPointedVariables()
+ masternode,pointers = dcfgenerator.GetMasterNode(), dcfgenerator.GetPointedVariables() + # allow access to local OD from Master PLC + pointers.update(LocalODPointers(locations, current_location, masternode)) + return masternode,pointers def LocalODPointers(locations, current_location, slave):
@@ -693,32 +696,36 @@
{"IEC_TYPE":"UDINT","NAME":"__ID0_1_64_25638_1","DIR":"I","SIZE":"D","LOC":(0,1,64,25638,1)},
{"IEC_TYPE":"UDINT","NAME":"__ID0_1_64_25638_2","DIR":"I","SIZE":"D","LOC":(0,1,64,25638,2)},
{"IEC_TYPE":"UDINT","NAME":"__ID0_1_64_25638_3","DIR":"I","SIZE":"D","LOC":(0,1,64,25638,3)},
- {"IEC_TYPE":"UDINT","NAME":"__ID0_1_64_25638_4","DIR":"I","SIZE":"D","LOC":(0,1,64,25638,4)}]
+ {"IEC_TYPE":"UDINT","NAME":"__ID0_1_64_25638_4","DIR":"I","SIZE":"D","LOC":(0,1,64,25638,4)}, + {"IEC_TYPE":"UDINT","NAME":"__ID0_1_4096_0","DIR":"I","SIZE":"D","LOC":(0,1,4096,0)}] # Generate MasterNode configuration
- masternode = GenerateConciseDCF(locations, (0, 1), nodelist, True, "TestNode")
+ masternode, pointedvariables = GenerateConciseDCF(locations, (0, 1), nodelist, True, "TestNode") except ValueError, message:
print "%s\nTest Failed!"%message
# Get Text corresponding to MasterNode
- result = masternode.PrintString()
+ result_node = masternode.PrintString() + result_vars = pprint.pformat(pointedvariables) + result = result_node + "\n********POINTERS*********\n" + result_vars + "\n" # If reset has been choosen
# Write Text into reference result file
- file = open("test_config/result.txt", "w")
+ testfile = open("test_config/result.txt", "w") print "Reset Successful!"
- file = open("test_config/result_tmp.txt", "w")
+ testfile = open("test_config/result_tmp.txt", "w") os.system("diff test_config/result.txt test_config/result_tmp.txt")
os.remove("test_config/result_tmp.txt")
--- a/plugins/canfestival/test_config/result.txt Mon Jan 19 08:40:09 2009 +0100
+++ b/plugins/canfestival/test_config/result.txt Mon Jan 19 10:08:45 2009 +0100
@@ -230,16 +230,28 @@
1F22 7E (Concise DCF for Node 126):
1F22 7F (Concise DCF for Node 127):
+2240 (beremiz__IB0_1_64):
+2340 (beremiz__IW0_1_64):
+2440 (beremiz__ID0_1_64):
+4340 (beremiz__QW0_1_64): +********POINTERS********* +{(4096, 0): '__ID0_1_4096_0', + (8768, 1): '__IB0_1_64_24576_1', + (8768, 2): '__IB0_1_64_24578_1', + (9024, 1): '__IW0_1_64_25601_2', + (9024, 2): '__IW0_1_64_25601_3', + (9280, 1): '__ID0_1_64_25638_2', + (9280, 2): '__ID0_1_64_25638_3', + (9280, 3): '__ID0_1_64_25638_4', + (9280, 4): '__ID0_1_64_25638_1', + (17216, 1): '__QW0_1_64_25617_1'}