diff -r c4199b88cf60 -r 6cf858411d3a plcopen/structures.py --- a/plcopen/structures.py Fri Oct 17 16:22:15 2008 +0200 +++ b/plcopen/structures.py Fri Oct 24 16:39:32 2008 +0200 @@ -409,44 +409,44 @@ ANY_TO_ANY_LIST=[ # simple type conv are let as C cast - (("ANY_NUM","ANY_BIT"),("ANY_NUM","ANY_BIT"), "(%(return_type)s)%(IN_value)s"), + (("ANY_NUM","ANY_BIT"),("ANY_NUM","ANY_BIT"), ("return_type", None, None)), # TO_TIME - (("ANY_INT","ANY_BIT"),("ANY_DATE","TIME"), "(%(return_type)s)__int_to_time(%(IN_value)s)"), - (("ANY_REAL",),("ANY_DATE","TIME"), "(%(return_type)s)__real_to_time(%(IN_value)s)"), - (("ANY_STRING",), ("ANY_DATE","TIME"), "(%(return_type)s)__string_to_time(%(IN_value)s)"), + (("ANY_INT","ANY_BIT"),("ANY_DATE","TIME"), ("return_type", "__int_to_time", None)), + (("ANY_REAL",),("ANY_DATE","TIME"), ("return_type", "__real_to_time", None)), + (("ANY_STRING",), ("ANY_DATE","TIME"), ("return_type", "__string_to_time", None)), # FROM_TIME - (("ANY_DATE","TIME"), ("ANY_REAL",), "(%(return_type)s)__time_to_real(%(IN_value)s)"), - (("ANY_DATE","TIME"), ("ANY_INT","ANY_NBIT"), "(%(return_type)s)__time_to_int(%(IN_value)s)"), - (("TIME",), ("ANY_STRING",), "(%(return_type)s)__time_to_string(%(IN_value)s)"), - (("DATE",), ("ANY_STRING",), "(%(return_type)s)__date_to_string(%(IN_value)s)"), - (("TOD",), ("ANY_STRING",), "(%(return_type)s)__tod_to_string(%(IN_value)s)"), - (("DT",), ("ANY_STRING",), "(%(return_type)s)__dt_to_string(%(IN_value)s)"), + (("ANY_DATE","TIME"), ("ANY_REAL",), ("return_type", "__time_to_real", None)), + (("ANY_DATE","TIME"), ("ANY_INT","ANY_NBIT"), ("return_type", "__time_to_int", None)), + (("TIME",), ("ANY_STRING",), ("return_type", "__time_to_string", None)), + (("DATE",), ("ANY_STRING",), ("return_type", "__date_to_string", None)), + (("TOD",), ("ANY_STRING",), ("return_type", "__tod_to_string", None)), + (("DT",), ("ANY_STRING",), ("return_type", "__dt_to_string", None)), # TO_STRING - (("BOOL",), ("ANY_STRING",), "(%(return_type)s)__bool_to_string(%(IN_value)s)"), - (("ANY_BIT",), ("ANY_STRING",), "(%(return_type)s)__bit_to_string(%(IN_value)s)"), - (("ANY_REAL",), ("ANY_STRING",), "(%(return_type)s)__real_to_string(%(IN_value)s)"), - (("ANY_SINT",), ("ANY_STRING",), "(%(return_type)s)__sint_to_string(%(IN_value)s)"), - (("ANY_UINT",), ("ANY_STRING",), "(%(return_type)s)__uint_to_string(%(IN_value)s)"), + (("BOOL",), ("ANY_STRING",), ("return_type", "__bool_to_string", None)), + (("ANY_BIT",), ("ANY_STRING",), ("return_type", "__bit_to_string", None)), + (("ANY_REAL",), ("ANY_STRING",), ("return_type", "__real_to_string", None)), + (("ANY_SINT",), ("ANY_STRING",), ("return_type", "__sint_to_string", None)), + (("ANY_UINT",), ("ANY_STRING",), ("return_type", "__uint_to_string", None)), # FROM_STRING - (("ANY_STRING",), ("BOOL",), "(%(return_type)s)__string_to_bool(%(IN_value)s)"), - (("ANY_STRING",), ("ANY_BIT",), "(%(return_type)s)__string_to_bit(%(IN_value)s)"), - (("ANY_STRING",), ("ANY_SINT",), "(%(return_type)s)__string_to_sint(%(IN_value)s)"), - (("ANY_STRING",), ("ANY_UINT",), "(%(return_type)s)__string_to_uint(%(IN_value)s)"), - (("ANY_STRING",), ("ANY_REAL",), "(%(return_type)s)__string_to_real(%(IN_value)s)")] + (("ANY_STRING",), ("BOOL",), ("return_type", "__string_to_bool", None)), + (("ANY_STRING",), ("ANY_BIT",), ("return_type", "__string_to_bit", None)), + (("ANY_STRING",), ("ANY_SINT",), ("return_type", "__string_to_sint", None)), + (("ANY_STRING",), ("ANY_UINT",), ("return_type", "__string_to_uint", None)), + (("ANY_STRING",), ("ANY_REAL",), ("return_type", "__string_to_real", None))] BCD_TO_ANY_LIST=[ - (("BYTE",),("USINT",), "(%(return_type)s)__bcd_to_uint(%(IN_value)s)"), - (("WORD",),("UINT",), "(%(return_type)s)__bcd_to_uint(%(IN_value)s)"), - (("DWORD",),("UDINT",), "(%(return_type)s)__bcd_to_uint(%(IN_value)s)"), - (("LWORD",),("ULINT",), "(%(return_type)s)__bcd_to_uint(%(IN_value)s)")] + (("BYTE",),("USINT",), ("return_type", "__bcd_to_uint", None)), + (("WORD",),("UINT",), ("return_type", "__bcd_to_uint", None)), + (("DWORD",),("UDINT",), ("return_type", "__bcd_to_uint", None)), + (("LWORD",),("ULINT",), ("return_type", "__bcd_to_uint", None))] ANY_TO_BCD_LIST=[ - (("USINT",),("BYTE",), "(%(return_type)s)__uint_to_bcd(%(IN_value)s)"), - (("UINT",),("WORD",), "(%(return_type)s)__uint_to_bcd(%(IN_value)s)"), - (("UDINT",),("DWORD",), "(%(return_type)s)__uint_to_bcd(%(IN_value)s)"), - (("ULINT",),("LWORD",), "(%(return_type)s)__uint_to_bcd(%(IN_value)s)")] + (("USINT",),("BYTE",), ("return_type", "__uint_to_bcd", None)), + (("UINT",),("WORD",), ("return_type", "__uint_to_bcd", None)), + (("UDINT",),("DWORD",), ("return_type", "__uint_to_bcd", None)), + (("ULINT",),("LWORD",), ("return_type", "__uint_to_bcd", None))] def ANY_TO_ANY_FORMAT_GEN(any_to_any_list, fdecl):