plcopen/definitions.py
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 28 Sep 2018 13:07:46 +0300
changeset 2350 9f7028ab8294
parent 1881 091005ec69c4
child 3750 f62625418bff
permissions -rw-r--r--
Use the list of supported by app translations instead of supported translations by wx

This will make possible to translate application into locales, that
are not explicitly supported by wx: for example, 'pl' or 'bn_BD', 'bn_IN'.
1511
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
     1
#!/usr/bin/env python
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
     2
# -*- coding: utf-8 -*-
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
     3
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
     4
# This file is part of Beremiz, a Integrated Development Environment for
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
     5
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
     6
#
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
     7
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD
1680
6db967480b7d make run Beremiz and PLCOpen Editor, if full path contain non-lating
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1625
diff changeset
     8
# Copyright (C) 2017: Andrey Skvortsov
1511
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
     9
#
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    10
# See COPYING file for copyrights details.
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    11
#
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    12
# This program is free software; you can redistribute it and/or
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    13
# modify it under the terms of the GNU General Public License
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    14
# as published by the Free Software Foundation; either version 2
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    15
# of the License, or (at your option) any later version.
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    16
#
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    17
# This program is distributed in the hope that it will be useful,
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    20
# GNU General Public License for more details.
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    21
#
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    22
# You should have received a copy of the GNU General Public License
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    23
# along with this program; if not, write to the Free Software
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    24
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    25
91538d0c242c add copyright notices to python files where there were missing, that
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1412
diff changeset
    26
1881
091005ec69c4 fix pylint py3k conversion warning: "(no-absolute-import) import missing `from __future__ import absolute_import`"
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1850
diff changeset
    27
from __future__ import absolute_import
1850
614396cbffbf fix pylint warning '(unused-import), Unused import connectors'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1837
diff changeset
    28
from os.path import join
1680
6db967480b7d make run Beremiz and PLCOpen Editor, if full path contain non-lating
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1625
diff changeset
    29
import util.paths as paths
1762
fcc406143e5b clean-up: fix PEP8 E731 do not assign a lambda expression, use a def
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1749
diff changeset
    30
from util.TranslationCatalogs import NoTranslate
1680
6db967480b7d make run Beremiz and PLCOpen Editor, if full path contain non-lating
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1625
diff changeset
    31
sd = paths.AbsDir(__file__)
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    32
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    33
# Override gettext _ in this module
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    34
# since we just want string to be added to dictionnary
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    35
# but translation should happen here
1762
fcc406143e5b clean-up: fix PEP8 E731 do not assign a lambda expression, use a def
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1749
diff changeset
    36
_ = NoTranslate
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    37
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
    38
LANGUAGES = ["IL", "ST", "FBD", "LD", "SFC"]
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    39
1739
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1736
diff changeset
    40
LOCATIONDATATYPES = {"X": ["BOOL"],
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1736
diff changeset
    41
                     "B": ["SINT", "USINT", "BYTE", "STRING"],
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1736
diff changeset
    42
                     "W": ["INT", "UINT", "WORD", "WSTRING"],
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1736
diff changeset
    43
                     "D": ["DINT", "UDINT", "REAL", "DWORD"],
ec153828ded2 clean-up: fix PEP8 E203 whitespace before ':' and whitespace before ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1736
diff changeset
    44
                     "L": ["LINT", "ULINT", "LREAL", "LWORD"]}
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    45
1782
5b6ad7a7fd9d clean-up: fix PEP8 E265 block comment should start with '# '
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1762
diff changeset
    46
# -------------------------------------------------------------------------------
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    47
#                        Function Block Types definitions
1782
5b6ad7a7fd9d clean-up: fix PEP8 E265 block comment should start with '# '
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1762
diff changeset
    48
# -------------------------------------------------------------------------------
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    49
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
    50
StdTC6Libs = [(_("Standard function blocks"),   join(sd, "Standard_Function_Blocks.xml")),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
    51
              (_("Additional function blocks"), join(sd, "Additional_Function_Blocks.xml"))]
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    52
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
    53
StdFuncsCSV = join(sd, "iec_std.csv")
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    54
1736
7e61baa047f0 clean-up: fix PEP8 E302 expected 2 blank lines, found 1
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1680
diff changeset
    55
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    56
def GetBlockInfos(pou):
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    57
    infos = pou.getblockInfos()
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    58
    infos["inputs"] = [
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    59
        (var_name, var_type, "rising")
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    60
        if var_name in ["CU", "CD"]
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    61
        else (var_name, var_type, var_modifier)
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    62
        for var_name, var_type, var_modifier in infos["inputs"]]
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    63
    return infos
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    64
1782
5b6ad7a7fd9d clean-up: fix PEP8 E265 block comment should start with '# '
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1762
diff changeset
    65
# -------------------------------------------------------------------------------
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    66
#                           Data Types definitions
1782
5b6ad7a7fd9d clean-up: fix PEP8 E265 block comment should start with '# '
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1762
diff changeset
    67
# -------------------------------------------------------------------------------
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    68
1749
d73b64672238 clean-up: fix PEP8 E305 expected 2 blank lines after class or function definition
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1740
diff changeset
    69
1837
c507c363625e fix pylint warning '(pointless-string-statement) String statement has no effect'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1802
diff changeset
    70
#: Ordored list of common data types defined in the IEC 61131-3
c507c363625e fix pylint warning '(pointless-string-statement) String statement has no effect'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1802
diff changeset
    71
#: Each type is associated to his direct parent type. It defines then a hierarchy
c507c363625e fix pylint warning '(pointless-string-statement) String statement has no effect'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1802
diff changeset
    72
#: between type that permits to make a comparison of two types
c507c363625e fix pylint warning '(pointless-string-statement) String statement has no effect'
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1802
diff changeset
    73
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    74
TypeHierarchy_list = [
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    75
    ("ANY", None),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    76
    ("ANY_DERIVED", "ANY"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    77
    ("ANY_ELEMENTARY", "ANY"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    78
    ("ANY_MAGNITUDE", "ANY_ELEMENTARY"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    79
    ("ANY_BIT", "ANY_ELEMENTARY"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    80
    ("ANY_NBIT", "ANY_BIT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    81
    ("ANY_STRING", "ANY_ELEMENTARY"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    82
    ("ANY_DATE", "ANY_ELEMENTARY"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    83
    ("ANY_NUM", "ANY_MAGNITUDE"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    84
    ("ANY_REAL", "ANY_NUM"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    85
    ("ANY_INT", "ANY_NUM"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    86
    ("ANY_SINT", "ANY_INT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    87
    ("ANY_UINT", "ANY_INT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    88
    ("BOOL", "ANY_BIT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    89
    ("SINT", "ANY_SINT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    90
    ("INT", "ANY_SINT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    91
    ("DINT", "ANY_SINT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    92
    ("LINT", "ANY_SINT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    93
    ("USINT", "ANY_UINT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    94
    ("UINT", "ANY_UINT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    95
    ("UDINT", "ANY_UINT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    96
    ("ULINT", "ANY_UINT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    97
    ("REAL", "ANY_REAL"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    98
    ("LREAL", "ANY_REAL"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
    99
    ("TIME", "ANY_MAGNITUDE"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   100
    ("DATE", "ANY_DATE"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   101
    ("TOD", "ANY_DATE"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   102
    ("DT", "ANY_DATE"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   103
    ("STRING", "ANY_STRING"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   104
    ("BYTE", "ANY_NBIT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   105
    ("WORD", "ANY_NBIT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   106
    ("DWORD", "ANY_NBIT"),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   107
    ("LWORD", "ANY_NBIT")
1782
5b6ad7a7fd9d clean-up: fix PEP8 E265 block comment should start with '# '
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1762
diff changeset
   108
    # ("WSTRING", "ANY_STRING") # TODO
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   109
]
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   110
1412
50192dd2f5ff Added plcopen.definitions.DefaultType, set to INT.
Edouard Tisserant
parents: 1411
diff changeset
   111
DefaultType = "DINT"
50192dd2f5ff Added plcopen.definitions.DefaultType, set to INT.
Edouard Tisserant
parents: 1411
diff changeset
   112
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   113
DataTypeRange_list = [
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   114
    ("SINT",  (-2**7,  2**7 - 1)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   115
    ("INT",   (-2**15, 2**15 - 1)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   116
    ("DINT",  (-2**31, 2**31 - 1)),
1802
74a3f4d5f407 fix LINT and ULINT ranges
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1798
diff changeset
   117
    ("LINT",  (-2**63, 2**63 - 1)),
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   118
    ("USINT", (0,      2**8 - 1)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   119
    ("UINT",  (0,      2**16 - 1)),
1798
7ec48bdc7a57 fix max value for UDINT and ULINT types
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1782
diff changeset
   120
    ("UDINT", (0,      2**32 - 1)),
1802
74a3f4d5f407 fix LINT and ULINT ranges
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1798
diff changeset
   121
    ("ULINT", (0,      2**64 - 1))
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   122
]
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   123
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   124
ANY_TO_ANY_FILTERS = {
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   125
    "ANY_TO_ANY": [
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   126
        # simple type conv are let as C cast
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   127
        (("ANY_INT", "ANY_BIT"), ("ANY_NUM", "ANY_BIT")),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   128
        (("ANY_REAL",), ("ANY_REAL",)),
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   129
        # REAL_TO_INT
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   130
        (("ANY_REAL",), ("ANY_SINT",)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   131
        (("ANY_REAL",), ("ANY_UINT",)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   132
        (("ANY_REAL",), ("ANY_BIT",)),
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   133
        # TO_TIME
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   134
        (("ANY_INT", "ANY_BIT"), ("ANY_DATE", "TIME")),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   135
        (("ANY_REAL",),          ("ANY_DATE", "TIME")),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   136
        (("ANY_STRING",),        ("ANY_DATE", "TIME")),
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   137
        # FROM_TIME
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   138
        (("ANY_DATE", "TIME"), ("ANY_REAL",)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   139
        (("ANY_DATE", "TIME"), ("ANY_INT", "ANY_NBIT")),
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   140
        (("TIME",), ("ANY_STRING",)),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   141
        (("DATE",), ("ANY_STRING",)),
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   142
        (("TOD",),  ("ANY_STRING",)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   143
        (("DT",),   ("ANY_STRING",)),
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   144
        # TO_STRING
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   145
        (("BOOL",),     ("ANY_STRING",)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   146
        (("ANY_BIT",),  ("ANY_STRING",)),
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   147
        (("ANY_REAL",), ("ANY_STRING",)),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   148
        (("ANY_SINT",), ("ANY_STRING",)),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   149
        (("ANY_UINT",), ("ANY_STRING",)),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   150
        # FROM_STRING
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   151
        (("ANY_STRING",), ("BOOL",)),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   152
        (("ANY_STRING",), ("ANY_BIT",)),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   153
        (("ANY_STRING",), ("ANY_SINT",)),
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   154
        (("ANY_STRING",), ("ANY_UINT",)),
1740
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   155
        (("ANY_STRING",), ("ANY_REAL",))
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   156
    ],
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   157
    "BCD_TO_ANY": [
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   158
        (("BYTE",),  ("USINT",)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   159
        (("WORD",),  ("UINT",)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   160
        (("DWORD",), ("UDINT",)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   161
        (("LWORD",), ("ULINT",))
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   162
    ],
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   163
    "ANY_TO_BCD": [
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   164
        (("USINT",), ("BYTE",)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   165
        (("UINT",),  ("WORD",)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   166
        (("UDINT",), ("DWORD",)),
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   167
        (("ULINT",), ("LWORD",))
b789b695b5c6 clean-up: fix PEP8 E231 missing whitespace after ':' or ','
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 1739
diff changeset
   168
    ]
1390
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   169
}
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   170
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   171
# remove gettext override
0f4d32a033e0 Tidy PLCopen definitions
Edouard Tisserant
parents:
diff changeset
   172
del _