# # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see http://www.gnu.org/licenses/. # from redhawk.codegen.utils import strenum, parseBoolean from ossie.utils.prop_helpers import parseComplexString from ossie import properties from idl import CorbaTypes NULL = 'null' TRUE = 'true' FALSE = 'false' Types = strenum('boolean', 'char', 'byte', 'short', 'int', 'long', 'float', 'double') BoxTypes = strenum('Boolean', 'Character', 'Byte', 'Short', 'Integer', 'Long', 'Float', 'Double') _reservedKeywords = set(("abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "default", "do", "double", "else", "enum", "extends", "final", "finally", "float", "for", "if", "goto", "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "package", "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "void", "volatile", "while", "true", "false", "null")) _boxMap = { Types.BOOLEAN: BoxTypes.BOOLEAN, Types.CHAR: BoxTypes.CHARACTER,
# # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see http://www.gnu.org/licenses/. # from redhawk.codegen.utils import strenum, parseBoolean from ossie.utils.prop_helpers import parseComplexString from ossie import properties from idl import CorbaTypes NULL = 'null' TRUE = 'true' FALSE = 'false' Types = strenum('boolean', 'char', 'byte', 'short', 'int', 'long', 'float', 'double', 'utctime') BoxTypes = strenum('Boolean', 'Character', 'Byte', 'Short', 'Integer', 'Long', 'Float', 'Double', 'UTCTime') _reservedKeywords = set(("abstract", "assert", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "default", "do", "double", "else", "enum", "extends", "final", "finally", "float", "for", "if", "goto", "implements", "import", "instanceof", "int", "interface", "long", "native", "new", "package", "private", "protected", "public", "return", "short", "static", "strictfp", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "try", "void", "volatile", "while", "true", "false", "null")) _boxMap = { Types.BOOLEAN: BoxTypes.BOOLEAN, Types.CHAR: BoxTypes.CHARACTER,
# later version. # # REDHAWK core is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see http://www.gnu.org/licenses/. # import ossie.parsers.prf from redhawk.codegen.utils import strenum Kinds = strenum('execparam', 'configure', 'allocation', 'factoryparam', 'test', 'event', 'message') Modes = strenum('writeonly', 'readonly', 'readwrite') Actions = strenum('external', 'eq', 'ge', 'gt', 'le', 'lt', 'ne') class Property(object): def __init__(self, xml): self.xml = xml def kinds(self): kinds = self.kinds_() if len(kinds) > 0: return set(str(k.kindtype) for k in kinds) else: return set((Kinds.CONFIGURE,))
# # REDHAWK core is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see http://www.gnu.org/licenses/. # import os from ossie.utils.sca import importIDL from redhawk.codegen.utils import strenum CorbaTypes = strenum('octet','boolean','char','short','ushort','long','ulong', 'longlong','ulonglong','float','double','string','objref') # Cached mapping of IDL repository IDs to interfaces idlRepo = {} class IDLInterface(object): def __init__(self, repid): self.__repid = repid self.__namespace, self.__interface = self.__repid.split(':')[1].rsplit('/', 1) self.__idl = None def repid(self): return self.__repid def namespace(self): return self.__namespace
# REDHAWK core is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see http://www.gnu.org/licenses/. # import os from ossie.utils.sca import importIDL from ossie.utils.idllib import IDLLibrary from redhawk.codegen.utils import strenum CorbaTypes = strenum('octet','boolean','char','short','ushort','long','ulong', 'longlong','ulonglong','float','double','string','objref', 'utctime') idlRepo = IDLLibrary() idlRepo.addSearchPath(os.path.join(os.environ['OSSIEHOME'], 'share/idl')) class IDLInterface(object): def __init__(self, repid): self.__repid = repid interface = self.__repid.split(':')[1] if '/' in interface: self.__namespace, self.__interface = interface.rsplit('/', 1) else: self.__namespace = '' self.__interface = interface self.__idl = None
# later version. # # REDHAWK core is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see http://www.gnu.org/licenses/. # import ossie.parsers.scd from redhawk.codegen.utils import strenum ComponentTypes = strenum('resource', 'device', 'loadabledevice', 'executabledevice', 'service') PortTypes = strenum('data', 'control', 'responses', 'test', 'virtual') class SoftwareComponent(object): def __init__(self, scdFile): self.__scd = ossie.parsers.scd.parse(scdFile) # Start with the provides ports. self.__ports = [ProvidesPort(p) for p in self.__scd.componentfeatures.ports.provides] # For each uses port, check if it is really intended to be a "bidirectional" port. # If it is, merge with the existing provides port, otherwise make a new port. for uses in self.__scd.componentfeatures.ports.uses: port = self._findPort(uses.usesname) if port is not None:
# later version. # # REDHAWK core is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see http://www.gnu.org/licenses/. # import ossie.parsers.scd from redhawk.codegen.utils import strenum ComponentTypes = strenum('resource', 'device', 'loadabledevice', 'executabledevice', 'service', 'sharedpackage') PortTypes = strenum('data', 'control', 'responses', 'test', 'virtual') class SoftwareComponent(object): def __init__(self, scdFile): self.__scd = ossie.parsers.scd.parse(scdFile) if not self.__scd.componentfeatures.ports: self.__ports = [] return # Start with the provides ports. self.__ports = [ ProvidesPort(p) for p in self.__scd.componentfeatures.ports.provides