Bug not refreshing FileMenu when Undo/Redo fixed
authorlaurent
Tue, 15 Dec 2009 08:53:29 +0100
changeset 488 93bf600bae11
parent 487 580b04db8c65
child 489 0caeaa75dcff
Bug not refreshing FileMenu when Undo/Redo fixed
Bug in matiec generate_c_inlinefcall fixed
PLCOpenEditor.py
dialogs/FBDVariableDialog.py
generate_IEC_std.py
plcopen/plcopen.py
--- a/PLCOpenEditor.py	Mon Dec 14 11:00:56 2009 +0100
+++ b/PLCOpenEditor.py	Tue Dec 15 08:53:29 2009 +0100
@@ -1013,14 +1013,14 @@
         self.Controler.LoadPrevious()
         self.CloseTabsWithoutModel()
         self.RefreshEditor()
-        self._Refresh(TITLE, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE, 
+        self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE, 
                       SCALING)
     
     def OnRedoMenu(self, event):
         self.Controler.LoadNext()
         self.CloseTabsWithoutModel()
         self.RefreshEditor()
-        self._Refresh(TITLE, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE, 
+        self._Refresh(TITLE, FILEMENU, EDITMENU, TYPESTREE, INSTANCESTREE, LIBRARYTREE, 
                       SCALING)
     
     def OnEnableUndoRedoMenu(self, event):
--- a/dialogs/FBDVariableDialog.py	Mon Dec 14 11:00:56 2009 +0100
+++ b/dialogs/FBDVariableDialog.py	Tue Dec 15 08:53:29 2009 +0100
@@ -211,7 +211,7 @@
             self.Expression.Enable(False)
         else:
             self.VariableName.SetStringSelection("")
-            self.Expression.Enable(var_class == INPUT)
+            #self.Expression.Enable(var_class == INPUT)
         self.VariableName.Enable(self.VariableName.GetCount() > 0)
             
     def SetMinVariableSize(self, size):
--- a/generate_IEC_std.py	Mon Dec 14 11:00:56 2009 +0100
+++ b/generate_IEC_std.py	Tue Dec 15 08:53:29 2009 +0100
@@ -138,7 +138,7 @@
 {"""
                 if not do_type_search_only:
                     res += """
-    identifier_c %(input_name)s_param_name("%(input_name)s");
+    symbol_c *%(input_name)s_param_name = (symbol_c *)(new identifier_c("%(input_name)s"));
     /* Get the value from a foo(<param_name> = <param_value>) style call */
     symbol_c *%(input_name)s_param_value = &this->default_variable_name;
 """%{"input_name":Paramname}
@@ -149,9 +149,9 @@
             else:
                 res += """
 {
-    identifier_c %(input_name)s_param_name("%(input_name)s");
+    symbol_c *%(input_name)s_param_name = (symbol_c *)(new identifier_c("%(input_name)s"));
     /* Get the value from a foo(<param_name> = <param_value>) style call */
-    symbol_c *%(input_name)s_param_value = function_call_param_iterator.search_f(&%(input_name)s_param_name);
+    symbol_c *%(input_name)s_param_value = function_call_param_iterator.search_f(%(input_name)s_param_name);
     symbol_c *%(input_name)s_type_symbol = NULL;
     
     /* Get the value from a foo(<param_value>) style call */
@@ -196,26 +196,27 @@
   nb_param = %(min_nb_param)d;
 char* nb_param_str = new char[10];
 sprintf(nb_param_str, "%%d", nb_param);
-identifier_c nb_param_name("nb_param");
-ADD_PARAM_LIST(&nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
+symbol_c * nb_param_name = (symbol_c *)(new identifier_c("nb_param"));
+ADD_PARAM_LIST(nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
 """%{"min_nb_param" : len(fdecl["inputs"])}
             for paramname,paramtype,unused in fdecl["inputs"]:
                 res += """
 if (%(input_name)s_type_symbol == NULL)
   %(input_name)s_type_symbol = last_type_symbol;
-ADD_PARAM_LIST(&%(input_name)s_param_name, %(input_name)s_param_value, %(input_name)s_type_symbol, function_param_iterator_c::direction_in)
+ADD_PARAM_LIST(%(input_name)s_param_name, %(input_name)s_param_value, %(input_name)s_type_symbol, function_param_iterator_c::direction_in)
 """%{"input_name" : paramname}
             if fdecl["extensible"]:
                 res += """
 int base_num = %d;
 symbol_c *param_value = NULL;
+symbol_c *param_name = NULL;
 do{
     char my_name[10];
     sprintf(my_name, "IN%%d", base_num++);
-    identifier_c param_name(my_name);
+    param_name = (symbol_c*)(new identifier_c(my_name));
     
     /* Get the value from a foo(<param_name> = <param_value>) style call */
-    param_value = function_call_param_iterator.search_f(&param_name);
+    param_value = function_call_param_iterator.search_f(param_name);
     
     /* Get the value from a foo(<param_value>) style call */
     if (param_value == NULL)
@@ -225,7 +226,7 @@
         last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
     
         /*Function specific CODE */
-        ADD_PARAM_LIST(&param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in)
+        ADD_PARAM_LIST(param_name, param_value, current_type_symbol, function_param_iterator_c::direction_in)
     }
     
 }while(param_value != NULL);
--- a/plcopen/plcopen.py	Mon Dec 14 11:00:56 2009 +0100
+++ b/plcopen/plcopen.py	Tue Dec 15 08:53:29 2009 +0100
@@ -653,7 +653,7 @@
         customdatatypes = []
         for customdatatype in self.getdataTypes():
             customdatatype_name = customdatatype.getname()
-            if not complextypes and customdatatype.baseType.getcontent()["name"] in ["array", "struct"]:
+            if not complextypes and customdatatype.baseType.getcontent()["name"] in ["array"]:#, "struct"]:
                 continue
             if customdatatype_name != exclude and not self.ElementIsUsedBy(exclude, customdatatype_name):
                 customdatatypes.append(customdatatype_name)