Преглед на файлове

NodesetCompiler: Remove numeric NodeClass representation; Remove constants.py

Julius Pfrommer преди 6 години
родител
ревизия
043a151047
променени са 4 файла, в които са добавени 0 реда и са изтрити 47 реда
  1. 0 1
      tools/nodeset_compiler/backend_open62541.py
  2. 0 35
      tools/nodeset_compiler/constants.py
  3. 0 1
      tools/nodeset_compiler/datatypes.py
  4. 0 10
      tools/nodeset_compiler/nodes.py

+ 0 - 1
tools/nodeset_compiler/backend_open62541.py

@@ -30,7 +30,6 @@ except ImportError:
 
 logger = logging.getLogger(__name__)
 
-from constants import *
 from nodes import *
 from nodeset import *
 from backend_open62541_nodes import generateNodeCode_begin, generateNodeCode_finish, generateReferenceCode

+ 0 - 35
tools/nodeset_compiler/constants.py

@@ -1,35 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-###
-### Author:  Chris Iatrou (ichrispa@core-vector.net)
-### Version: rev 13
-###
-### This program was created for educational purposes and has been
-### contributed to the open62541 project by the author. All licensing
-### terms for this source is inherited by the terms and conditions
-### specified for by the open62541 project (see the projects readme
-### file for more information on the MPLv2 terms and restrictions).
-###
-### This program is not meant to be used in a production environment. The
-### author is not liable for any complications arising due to the use of
-### this program.
-###
-
-NODE_CLASS_GENERERIC = 0
-NODE_CLASS_OBJECT = 1
-NODE_CLASS_VARIABLE = 2
-NODE_CLASS_METHOD = 4
-NODE_CLASS_OBJECTTYPE = 8
-NODE_CLASS_VARIABLETYPE = 16
-NODE_CLASS_REFERENCETYPE = 32
-NODE_CLASS_DATATYPE = 64
-NODE_CLASS_VIEW = 128
-
-# Not in OPC-UA, but exists in XML
-NODE_CLASS_METHODTYPE = 256
-

+ 0 - 1
tools/nodeset_compiler/datatypes.py

@@ -23,7 +23,6 @@ from datetime import datetime
 logger = logging.getLogger(__name__)
 import xml.dom.minidom as dom
 
-from constants import *
 from base64 import *
 
 import six

+ 0 - 10
tools/nodeset_compiler/nodes.py

@@ -19,7 +19,6 @@
 import sys
 import logging
 from datatypes import *
-from constants import *
 
 logger = logging.getLogger(__name__)
 
@@ -63,7 +62,6 @@ def RefOrAlias(s):
 class Node(object):
     def __init__(self):
         self.id = NodeId()
-        self.nodeClass = NODE_CLASS_GENERERIC
         self.browseName = QualifiedName()
         self.displayName = LocalizedText()
         self.description = LocalizedText()
@@ -188,7 +186,6 @@ class Node(object):
 class ReferenceTypeNode(Node):
     def __init__(self, xmlelement=None):
         Node.__init__(self)
-        self.nodeClass = NODE_CLASS_REFERENCETYPE
         self.isAbstract = False
         self.symmetric = False
         self.inverseName = ""
@@ -213,7 +210,6 @@ class ReferenceTypeNode(Node):
 class ObjectNode(Node):
     def __init__(self, xmlelement=None):
         Node.__init__(self)
-        self.nodeClass = NODE_CLASS_OBJECT
         self.eventNotifier = 0
         if xmlelement:
             self.parseXML(xmlelement)
@@ -227,7 +223,6 @@ class ObjectNode(Node):
 class VariableNode(Node):
     def __init__(self, xmlelement=None):
         Node.__init__(self)
-        self.nodeClass = NODE_CLASS_VARIABLE
         self.dataType = NodeId()
         self.valueRank = -2
         self.arrayDimensions = []
@@ -303,7 +298,6 @@ class VariableNode(Node):
 class VariableTypeNode(VariableNode):
     def __init__(self, xmlelement=None):
         VariableNode.__init__(self)
-        self.nodeClass = NODE_CLASS_VARIABLETYPE
         self.isAbstract = False
         if xmlelement:
             self.parseXML(xmlelement)
@@ -317,7 +311,6 @@ class VariableTypeNode(VariableNode):
 class MethodNode(Node):
     def __init__(self, xmlelement=None):
         Node.__init__(self)
-        self.nodeClass = NODE_CLASS_METHOD
         self.executable = True
         self.userExecutable = True
         self.methodDecalaration = None
@@ -337,7 +330,6 @@ class MethodNode(Node):
 class ObjectTypeNode(Node):
     def __init__(self, xmlelement=None):
         Node.__init__(self)
-        self.nodeClass = NODE_CLASS_OBJECTTYPE
         self.isAbstract = False
         if xmlelement:
             self.parseXML(xmlelement)
@@ -382,7 +374,6 @@ class DataTypeNode(Node):
 
     def __init__(self, xmlelement=None):
         Node.__init__(self)
-        self.nodeClass = NODE_CLASS_DATATYPE
         self.isAbstract = False
         self.__xmlDefinition__ = None
         self.__baseTypeEncoding__ = []
@@ -615,7 +606,6 @@ class DataTypeNode(Node):
 class ViewNode(Node):
     def __init__(self, xmlelement=None):
         Node.__init__(self)
-        self.nodeClass = NODE_CLASS_VIEW
         self.containsNoLoops == False
         self.eventNotifier == False
         if xmlelement: