Пример #1
0
    def setUp(self):
        yield self._start_container()

        services = [{
            'name': 'instreg',
            'module': 'ion.services.coi.agent_registry',
            'class': 'AgentRegistryService'
        }, {
            'name': 'instreg',
            'module': 'ion.services.sa.instrument_registry',
            'class': 'InstrumentRegistryService'
        }, {
            'name': 'dprodreg',
            'module': 'ion.services.sa.data_product_registry',
            'class': 'DataProductRegistryService'
        }, {
            'name': 'instmgmt',
            'module': 'ion.services.sa.instrument_management',
            'class': 'InstrumentManagementService'
        }]

        sup = yield self._spawn_processes(services)

        self.imc = InstrumentManagementClient(proc=sup)
Пример #2
0
    def setUp(self):
        yield self._start_container()

        services = [
            {
                'name': 'instreg',
                'module': 'ion.services.coi.agent_registry',
                'class': 'AgentRegistryService'
            },
            {
                'name': 'instreg',
                'module': 'ion.services.sa.instrument_registry',
                'class': 'InstrumentRegistryService'
            },
            {
                'name': 'pubsub_registry',
                'module': 'ion.services.dm.distribution.pubsub_registry',
                'class': 'DataPubSubRegistryService'
            },
            {
                'name': 'pubsub_service',
                'module': 'ion.services.dm.distribution.pubsub_service',
                'class': 'DataPubsubService'
            },
            {
                'name': 'dprodreg',
                'module': 'ion.services.sa.data_product_registry',
                'class': 'DataProductRegistryService'
            },
            {
                'name': 'instmgmt',
                'module': 'ion.services.sa.instrument_management',
                'class': 'InstrumentManagementService'
            },
            {
                'name': 'SBE49IA',
                'module': 'ion.agents.instrumentagents.SBE49_IA',
                'class': 'SBE49InstrumentAgent'
            },
        ]

        sup = yield self._spawn_processes(services)

        #self.agreg_client = AgentRegistryClient(proc=sup)
        #yield self.agreg_client.clear_registry()

        self.ia_pid = sup.get_child_id('SBE49IA')
        self.iaclient = InstrumentAgentClient(proc=sup, target=self.ia_pid)

        self.imc = InstrumentManagementClient(proc=sup)

        self.newInstrument = {
            'manufacturer': "SeaBird Electronics",
            'model': "unknown model",
            'serial_num': "1234",
            'fw_version': "1"
        }

        instrument = yield self.imc.create_new_instrument(self.newInstrument)
        self.inst_id = instrument.RegistryIdentity
        logging.info("*** Instrument created with ID=" + str(self.inst_id))

        self.simulator = Simulator(self.inst_id, 9000)
        self.simulator.start()

        yield self.iaclient.register_resource(self.inst_id)