--- a/objdictgen/gen_cfile.py Thu Jun 21 17:03:33 2007 +0200
+++ b/objdictgen/gen_cfile.py Thu Jun 21 17:08:43 2007 +0200
@@ -164,6 +164,9 @@
if typeinfos[2] == "visible_string":
texts["value"] = "\"%s\""%values
texts["comment"] = ""
+ elif typeinfos[2] == "domain":
+ texts["value"] = "\"%s\""%''.join(["\\x%2.2x"%ord(char) for char in value])
+ texts["comment"] = ""
else:
texts["value"] = "0x%X"%values
texts["comment"] = "\t/* %s */"%str(values)
@@ -206,7 +209,9 @@
sep = ""
if typeinfos[2] == "visible_string":
value = "\"%s\""%value
- else:
+ elif typeinfos[2] == "domain":
+ value = "\"%s\""%''.join(["\\x%2.2x"%ord(char) for char in value])
+ else:
comment = "\t/* %s */"%str(value)
value = "0x%X"%value
mappedVariableContent += " %s%s%s\n"%(value, sep, comment)
@@ -243,7 +248,10 @@
if typeinfos[2] == "visible_string":
texts["value"] = "\"%s\""%value
texts["comment"] = ""
- else:
+ elif typeinfos[2] == "domain":
+ texts["value"] = "\"%s\""%''.join(["\\x%2.2x"%ord(char) for char in value])
+ texts["comment"] = ""
+ else:
texts["value"] = "0x%X"%value
texts["comment"] = "\t/* %s */"%str(value)
texts["name"] = FormatName(subentry_infos["name"])
@@ -463,7 +471,11 @@
# Write Header File Content
#-------------------------------------------------------------------------------
+ texts["file_include_name"] = headerfilepath.replace(".", "_").upper()
HeaderFileContent = generated_tag + """
+#ifdef %(file_include_name)s
+#define %(file_include_name)s
+
#include "data.h"
/* Prototypes of function provided by object dictionnary */
@@ -472,10 +484,11 @@
/* Master node data struct */
extern CO_Data %(NodeName)s_Data;
-
"""%texts
HeaderFileContent += strDeclareHeader
+ HeaderFileContent += "\n#endif // %(file_include_name)s\n"%texts
+
return fileContent,HeaderFileContent
#-------------------------------------------------------------------------------
--- a/objdictgen/nodemanager.py Thu Jun 21 17:03:33 2007 +0200
+++ b/objdictgen/nodemanager.py Thu Jun 21 17:08:43 2007 +0200
@@ -306,9 +306,8 @@
result = eds_utils.GenerateNode(filepath, self.ScriptDirectory)
if isinstance(result, Node):
self.CurrentNode = result
- if len(self.UndoBuffers) == 0:
- index = self.AddNodeBuffer()
- self.SetCurrentFilePath("")
+ index = self.AddNodeBuffer()
+ self.SetCurrentFilePath("")
self.BufferCurrentNode()
return index
else:
--- a/objdictgen/objdictedit.py Thu Jun 21 17:03:33 2007 +0200
+++ b/objdictgen/objdictedit.py Thu Jun 21 17:08:43 2007 +0200
@@ -395,10 +395,11 @@
# At init selected = -1
if selected >= 0:
window = self.FileOpened.GetPage(selected)
- self.Manager.ChangeCurrentNode(window.GetIndex())
- self.RefreshBufferState()
- self.RefreshStatusBar()
- self.RefreshProfileMenu()
+ if window:
+ self.Manager.ChangeCurrentNode(window.GetIndex())
+ self.RefreshBufferState()
+ self.RefreshStatusBar()
+ self.RefreshProfileMenu()
event.Skip()
def OnHelpDS301Menu(self, event):
@@ -453,6 +454,8 @@
if answer == wxID_YES:
self.Manager.ChangeCurrentNode(0)
for i in xrange(self.FileOpened.GetPageCount()):
+ window = self.FileOpened.GetPage(i)
+ self.Manager.ChangeCurrentNode(window.GetIndex())
if self.Manager.CurrentIsSaved():
self.Manager.CloseCurrent()
else: