--- a/controls/DebugVariablePanel.py Mon Nov 05 20:16:45 2012 +0100
+++ b/controls/DebugVariablePanel.py Thu Nov 08 18:23:32 2012 +0100
@@ -69,6 +69,11 @@
self.Parent.HasNewData = True
+ variable_type = self.Parent.GetDataType(self.Variable.upper()) + if variable_type == "STRING": + return "'%s'" % self.Value + elif variable_type == "WSTRING": + return "\"%s\"" % self.Value class DebugVariableTable(CustomTable):
--- a/dialogs/ForceVariableDialog.py Mon Nov 05 20:16:45 2012 +0100
+++ b/dialogs/ForceVariableDialog.py Thu Nov 08 18:23:32 2012 +0100
@@ -44,19 +44,29 @@
+def gen_get_string(delimiter): + STRING_MODEL = re.compile("%(delimiter)s([^%(delimiter)s]*)%(delimiter)s$" % {"delimiter": delimiter}) + result = STRING_MODEL.match(v) getinteger = gen_get_function(int)
getfloat = gen_get_function(float)
-getstring = gen_get_function(str)
+getstring = gen_get_string("'") +getwstring = gen_get_string('"') -IEC_TIME_MODEL = re.compile("(?:(?:T|TIME)#)?(-)?(?:(%(float)s)D_?)?(?:(%(float)s)H_?)?(?:(%(float)s)M(?!S)_?)?(?:(%(float)s)S_?)?(?:(%(float)s)MS)?" % {"float": "[0-9]+(?:\.[0-9]+)?"})
-IEC_DATE_MODEL = re.compile("(?:(?:D|DATE)#)?([0-9]{4})-([0-9]{2})-([0-9]{2})")
-IEC_DATETIME_MODEL = re.compile("(?:(?:DT|DATE_AND_TIME)#)?([0-9]{4})-([0-9]{2})-([0-9]{2})-([0-9]{2}):([0-9]{2}):([0-9]{2}(?:\.[0-9]+)?)")
-IEC_TIMEOFDAY_MODEL = re.compile("(?:(?:TOD|TIME_OF_DAY)#)?([0-9]{2}):([0-9]{2}):([0-9]{2}(?:\.[0-9]+)?)")
+IEC_TIME_MODEL = re.compile("(?:(?:T|TIME)#)?(-)?(?:(%(float)s)D_?)?(?:(%(float)s)H_?)?(?:(%(float)s)M(?!S)_?)?(?:(%(float)s)S_?)?(?:(%(float)s)MS)?$" % {"float": "[0-9]+(?:\.[0-9]+)?"}) +IEC_DATE_MODEL = re.compile("(?:(?:D|DATE)#)?([0-9]{4})-([0-9]{2})-([0-9]{2})$") +IEC_DATETIME_MODEL = re.compile("(?:(?:DT|DATE_AND_TIME)#)?([0-9]{4})-([0-9]{2})-([0-9]{2})-([0-9]{2}):([0-9]{2}):([0-9]{2}(?:\.[0-9]+)?)$") +IEC_TIMEOFDAY_MODEL = re.compile("(?:(?:TOD|TIME_OF_DAY)#)?([0-9]{2}):([0-9]{2}):([0-9]{2}(?:\.[0-9]+)?)$") result = IEC_TIME_MODEL.match(v.upper())
@@ -136,7 +146,7 @@
--- a/graphics/GraphicCommons.py Mon Nov 05 20:16:45 2012 +0100
+++ b/graphics/GraphicCommons.py Thu Nov 08 18:23:32 2012 +0100
@@ -1964,7 +1964,10 @@
def GetToolTipValue(self):
if self.Value is not None and self.Value != "undefined" and not isinstance(self.Value, BooleanType):
- if isinstance(self.Value, StringType) and self.Value.find("#") == -1:
+ wire_type = self.GetEndConnectedType() + if wire_type == "STRING": + return "'%s'"%self.Value + elif wire_type == "WSTRING": return "\"%s\""%self.Value
@@ -2131,7 +2134,10 @@
if value is not None and not isinstance(value, BooleanType):
- if isinstance(value, StringType) and value.find('#') == -1:
+ wire_type = self.GetEndConnectedType() + if wire_type == "STRING": + self.ComputedValue = "'%s'"%value + elif wire_type == "WSTRING": self.ComputedValue = "\"%s\""%value
self.ComputedValue = str(value)