Merged
authorLaurent Bessard
Mon, 11 Mar 2013 12:54:25 +0100
changeset 804 7898ba56c7cf
parent 801 8255f1a371d7 (current diff)
parent 803 36ac3a58be39 (diff)
child 813 0630cc31569f
Merged
--- a/lib/iec_std_lib.h	Fri Mar 08 11:38:26 2013 +0900
+++ b/lib/iec_std_lib.h	Mon Mar 11 12:54:25 2013 +0100
@@ -604,7 +604,7 @@
                  broken_down_time.tm_min,
                  broken_down_time.tm_sec);
     }else{
-        res.len = snprintf((char*)&res.body, STR_MAX_LEN, "TOD#%2.2d:%2.2d:%09.6g",
+        res.len = snprintf((char*)&res.body, STR_MAX_LEN, "TOD#%2.2d:%2.2d:%09.6f",
                  broken_down_time.tm_hour,
                  broken_down_time.tm_min,
                  (LREAL)broken_down_time.tm_sec + (LREAL)IN.tv_nsec / 1e9);
@@ -626,7 +626,7 @@
                  broken_down_time.tm_min,
                  broken_down_time.tm_sec);
     }else{
-        res.len = snprintf((char*)&res.body, STR_MAX_LEN, "DT#%d-%2.2d-%2.2d-%2.2d:%2.2d:%09.6g",
+        res.len = snprintf((char*)&res.body, STR_MAX_LEN, "DT#%d-%2.2d-%2.2d-%2.2d:%2.2d:%09.6f",
                  broken_down_time.tm_year,
                  broken_down_time.tm_mon,
                  broken_down_time.tm_day,
--- a/stage3/fill_candidate_datatypes.cc	Fri Mar 08 11:38:26 2013 +0900
+++ b/stage3/fill_candidate_datatypes.cc	Mon Mar 11 12:54:25 2013 +0100
@@ -1270,7 +1270,31 @@
 	return NULL;
 }
 
-
+/********************************************/
+/* B 1.6 Sequential function chart elements */
+/********************************************/
+
+void *fill_candidate_datatypes_c::visit(transition_condition_c *symbol) {
+	symbol_c *condition_type;
+
+	if (symbol->transition_condition_il != NULL) {
+		symbol->transition_condition_il->accept(*this);
+		for (unsigned int i = 0; i < symbol->transition_condition_il->candidate_datatypes.size(); i++) {
+			condition_type = symbol->transition_condition_il->candidate_datatypes[i];
+			if (get_datatype_info_c::is_BOOL_compatible(condition_type))
+				add_datatype_to_candidate_list(symbol, condition_type);
+		}
+	}
+	if (symbol->transition_condition_st != NULL) {
+		symbol->transition_condition_st->accept(*this);
+		for (unsigned int i = 0; i < symbol->transition_condition_st->candidate_datatypes.size(); i++) {
+			condition_type = symbol->transition_condition_st->candidate_datatypes[i];
+			if (get_datatype_info_c::is_BOOL_compatible(condition_type))
+				add_datatype_to_candidate_list(symbol, condition_type);
+		}
+	}
+	return NULL;
+}
 
 /********************************/
 /* B 1.7 Configuration elements */
--- a/stage3/fill_candidate_datatypes.hh	Fri Mar 08 11:38:26 2013 +0900
+++ b/stage3/fill_candidate_datatypes.hh	Mon Mar 11 12:54:25 2013 +0100
@@ -236,6 +236,12 @@
     /**********************/
     void *visit(program_declaration_c *symbol);
 
+    /********************************************/
+    /* B 1.6 Sequential function chart elements */
+    /********************************************/
+
+    void *visit(transition_condition_c *symbol);
+
     /********************************/
     /* B 1.7 Configuration elements */
     /********************************/
--- a/stage3/narrow_candidate_datatypes.cc	Fri Mar 08 11:38:26 2013 +0900
+++ b/stage3/narrow_candidate_datatypes.cc	Mon Mar 11 12:54:25 2013 +0100
@@ -755,6 +755,24 @@
 	return NULL;
 }
 
+/********************************************/
+/* B 1.6 Sequential function chart elements */
+/********************************************/
+
+void *narrow_candidate_datatypes_c::visit(transition_condition_c *symbol) {
+	if (symbol->candidate_datatypes.size() != 1)
+		return NULL;
+	symbol->datatype = symbol->candidate_datatypes[0];
+	if (symbol->transition_condition_il != NULL) {
+		symbol->transition_condition_il->datatype = symbol->datatype;
+		symbol->transition_condition_il->accept(*this);
+	}
+	if (symbol->transition_condition_st != NULL) {
+		symbol->transition_condition_st->datatype = symbol->datatype;
+		symbol->transition_condition_st->accept(*this);
+	}
+	return NULL;
+}
 
 /********************************/
 /* B 1.7 Configuration elements */
--- a/stage3/narrow_candidate_datatypes.hh	Fri Mar 08 11:38:26 2013 +0900
+++ b/stage3/narrow_candidate_datatypes.hh	Mon Mar 11 12:54:25 2013 +0100
@@ -211,6 +211,12 @@
     /**********************/
     void *visit(program_declaration_c *symbol);
 
+    /********************************************/
+    /* B 1.6 Sequential function chart elements */
+    /********************************************/
+
+    void *visit(transition_condition_c *symbol);
+
     /********************************/
     /* B 1.7 Configuration elements */
     /********************************/