Exemple #1
0
def main():
    try:
        py = PyTango.Util(sys.argv)
        py.add_class(WeightTransmitterClass, WeightTransmitter,
                     'WeightTransmitter')
        #----- PROTECTED REGION ID(WeightTransmitter.add_classes) ENABLED START -----#

        #----- PROTECTED REGION END -----#	//	WeightTransmitter.add_classes

        U = PyTango.Util.instance()
        U.server_init()
        U.server_run()

    except PyTango.DevFailed as e:
        print('-------> Received a DevFailed exception:', e)
    except Exception as e:
        print('-------> An unforeseen exception occured....', e)
def main():
    try:
        py = PyTango.Util(sys.argv)
        py.add_class(EventsHandlerSrvClass, EventsHandlerSrv,
                     'EventsHandlerSrv')
        #----- PROTECTED REGION ID(EventsHandlerSrv.add_classes) ENABLED START -----#

        #----- PROTECTED REGION END -----#	//	EventsHandlerSrv.add_classes

        U = PyTango.Util.instance()
        U.server_init()
        U.server_run()

    except PyTango.DevFailed as e:
        print('-------> Received a DevFailed exception:', e)
    except Exception as e:
        print('-------> An unforeseen exception occured....', e)
Exemple #3
0
def main():
    try:
        py = PyTango.Util(sys.argv)
        py.add_class(Prisma_EventCaptureClass, Prisma_EventCapture,
                     'Prisma_EventCapture')
        #----- PROTECTED REGION ID(Prisma_EventCapture.add_classes) ENABLED START -----#

        #----- PROTECTED REGION END -----#	//	Prisma_EventCapture.add_classes

        U = PyTango.Util.instance()
        U.server_init()
        U.server_run()

    except PyTango.DevFailed as e:
        print('-------> Received a DevFailed exception:', e)
    except Exception as e:
        print('-------> An unforeseen exception occured....', e)
def main():
    try:
        py = PyTango.Util(sys.argv)
        py.add_class(PILCPICOLASTriggerGeneratorClass,
                     PILCPICOLASTriggerGenerator,
                     'PILCPICOLASTriggerGenerator')
        #----- PROTECTED REGION ID(PILCPICOLASTriggerGenerator.add_classes) ENABLED START -----#

        #----- PROTECTED REGION END -----#	//	PILCPICOLASTriggerGenerator.add_classes

        U = PyTango.Util.instance()
        U.server_init()
        U.server_run()

    except PyTango.DevFailed as e:
        print('-------> Received a DevFailed exception:', e)
    except Exception as e:
        print('-------> An unforeseen exception occured....', e)
def main():
    try:
        py = PyTango.Util(sys.argv)
        py.add_class(IA_VentilationDeviceServer_02Class,
                     IA_VentilationDeviceServer_02,
                     'IA_VentilationDeviceServer_02')
        #----- PROTECTED REGION ID(IA_VentilationDeviceServer_02.add_classes) ENABLED START -----#

        #----- PROTECTED REGION END -----#	//	IA_VentilationDeviceServer_02.add_classes

        U = PyTango.Util.instance()
        U.server_init()
        U.server_run()

    except PyTango.DevFailed as e:
        print('-------> Received a DevFailed exception:', e)
    except Exception as e:
        print('-------> An unforeseen exception occured....', e)
Exemple #6
0
def main(args=None):
    args = args or sys.argv
    try:
        py = PyTango.Util(args)
        # Adding all commands/properties from fandango.DynamicDS
        from fandango.device.WorkerDS import WorkerDS, WorkerDSClass
        WorkerDS, WorkerDSClass = FullTangoInheritance('WorkerDS',
                                                       WorkerDS,
                                                       WorkerDSClass,
                                                       DynamicDS,
                                                       DynamicDSClass,
                                                       ForceDevImpl=True)
        py.add_TgClass(WorkerDSClass, WorkerDS, 'WorkerDS')
        U = PyTango.Util.instance()
        U.server_init()
        U.server_run()

    except PyTango.DevFailed, e:
        print '-------> Received a DevFailed exception:', e
Exemple #7
0
def run(argv):
    """ runs the TANGO server

    :param argv: command-line arguments
    :type argv: :obj:`list` <:obj:`str`>
    """
    import PyTango
    from .NXSConfig import NXSRecSelector as NXSRecConfig
    from .NXSConfig import NXSRecSelectorClass as NXSRecConfigClass
    try:
        py = PyTango.Util(argv)
        py.add_class(NXSRecConfigClass, NXSRecConfig)

        U = PyTango.Util.instance()
        U.server_init()
        U.server_run()

    except PyTango.DevFailed as e:
        print('-------> Received a DevFailed exception: %s' % e)
    except Exception as e:
        print('-------> An unforeseen exception occured.... %s' % e)
Exemple #8
0
def run(argv):
    """ runs the Configuration TANGO server

    :param argv: command-line arguments
    :type argv: :obj:`list` <:obj:`str`>
    """
    import PyTango
    from .NXSConfigServer import NXSConfigServer as NXSCnfSrv
    from .NXSConfigServer import NXSConfigServerClass as NXSCnfSrvClass
    try:
        pyutil = PyTango.Util(argv)
        pyutil.add_class(NXSCnfSrvClass, NXSCnfSrv)

        util = PyTango.Util.instance()
        util.server_init()
        util.server_run()

    except PyTango.DevFailed as ex:
        print('-------> Received a DevFailed exception: %s' % ex)
    except Exception as ex:
        print('-------> An unforeseen exception occured.... %s' % ex)
Exemple #9
0
def main(args=None):
    try:
        py = PyTango.Util(args or sys.argv)
        db = py.get_database()
        ds = py.get_ds_name()
        klasses = db.get_server_class_list(py.get_ds_name())
        for k in klasses:
            d = locals()[k] = type(k, (SimulatorDS, ), {})
            dc = locals()[k + 'Class'] = type(k + 'Class',
                                              (SimulatorDSClass, ), {})
            py.add_TgClass(dc, d, k)

        if 'SimulatorDS' not in klasses:
            py.add_TgClass(SimulatorDSClass, SimulatorDS, 'SimulatorDS')
        #py.add_TgClass(PySignalSimulatorClass,PySignalSimulator,'PySignalSimulator')

        U = PyTango.Util.instance()
        fandango.dynamic.CreateDynamicCommands(SimulatorDS, SimulatorDSClass)
        U.server_init()
        U.server_run()

    except PyTango.DevFailed, e:
        print('-------> Received a DevFailed exception:',
              traceback.format_exc())
Exemple #10
0
            'unit': "cm",
            'format': "%8.3f",
            'max value': 100,
            'min value': 0,
            'max alarm': 90,
            'min alarm': 10,
            'max warning': 80,
            'min warning': 20,
        }],
    }

    def __init__(self, name):
        PyTango.DeviceClass.__init__(self, name)
        self.set_type(name)
        print "In TaurusTestClass  constructor"


if __name__ == '__main__':
    try:
        py = PyTango.Util(sys.argv)
        py.add_TgClass(TaurusTestClass, TaurusTest, 'TaurusTest')

        U = PyTango.Util.instance()
        U.server_init()
        U.server_run()

    except PyTango.DevFailed, e:
        print '-------> Received a DevFailed exception:', e
    except Exception, e:
        print '-------> An unforeseen exception occured....', e
Exemple #11
0
    # -----------------------------------------------------------------
    #    PoolClass Constructor
    # -----------------------------------------------------------------
    def __init__(self, name):
        PyTango.DeviceClass.__init__(self, name)
        self.set_type(name)
        # print "In TestPoolClass  constructor"


# =================================================================
#
#    Pool class main method
#
# =================================================================
if __name__ == '__main__':
    try:
        argv = list(sys.argv)
        argv[0] = "Pool"
        py = PyTango.Util(argv)
        py.add_class(PoolClass, Pool)

        U = PyTango.Util.instance()
        U.server_init()
        U.server_run()

    except PyTango.DevFailed as e:
        print('-------> Received a DevFailed exception: %s' % e)
    except Exception as e:
        print('-------> An unforeseen exception occured.... %s' % e)
Exemple #12
0
    return buttons[command]


app = taurus.qt.qtgui.application.TaurusApplication(['Component_2'])


def start_taurus_app():
    for command in commands:
        create_button(command)
    panel = taurus.qt.qtgui.panel.TaurusCommandsForm()
    panel.setModel(model)

    def command_filter(command):
        return command.cmd_name in commands

    panel.setViewFilters([command_filter])
    #do Not show while running nose plugin
    #panel.show()
    app.exec_()


if __name__ == '__main__':
    py = PyTango.Util(['component_2', 'C2'])
    py.add_class(C2Interface, Component_2, 'Component_2')
    U = PyTango.Util.instance()
    U.server_init()
    #wait for server initializing completed
    time.sleep(0.2)
    start_taurus_app()
    U.server_run()
Exemple #13
0
        "--debug",
        action="store_true",
        dest="verbose",
        default=False,
        help="switch to verbose/debug mode into python (-v for the tango part)"
    )
    #    parser.add_argument("-n","--ncpu", dest="ncpu", type=int, default=1,
    #                        help="number of worker to use in parallel" )
    parser.add_argument("to_tango", nargs='*')
    args = parser.parse_args()
    if args.verbose:
        logger.setLevel(logging.DEBUG)
    else:
        logger.setLevel(logging.INFO)

    ltangoParam += args.to_tango
    try:
        logger.debug("Tango parameters: %s" % ltangoParam)
        py = PyTango.Util(ltangoParam)
        py.add_TgClass(DistortionDSClass, DistortionDS, 'DistortionDS')
        U = py.instance()  #PyTango.Util.instance()
        U.server_init()
        U.server_run()
    except PyTango.DevFailed as e:
        EDVerbose.ERROR('PyTango --> Received a DevFailed exception: %s' % e)
        sys.exit(-1)
    except Exception as e:
        EDVerbose.ERROR('PyTango --> An unforeseen exception occurred....%s' %
                        e)
        sys.exit(-1)
Exemple #14
0
    attr_list = {
        }


#------------------------------------------------------------------
#    SimulatorDSClass Constructor
#------------------------------------------------------------------
    def __init__(self, name):
        PyTango.DeviceClass.__init__(self, name)
        self.set_type(name);
        print "In SimulatorDSClass  constructor"

#==================================================================
#
#    SimulatorDS class main method
#
#==================================================================
if __name__ == '__main__':
    try:
        #py = PyTango.Util(sys.argv) #Rewritten because name of file doesnt match servers name
        py = PyTango.Util(['SimulatorDS',[a for a in sys.argv if not a.startswith('-')][-1]])
        py.add_TgClass(SimulatorDSClass,SimulatorDS,'SimulatorDS')
        U = PyTango.Util.instance()
        U.server_init()
        U.server_run()

    except PyTango.DevFailed,e:
        print '-------> Received a DevFailed exception:',traceback.format_exc()
    except Exception,e:
        print '-------> An unforeseen exception occured....',traceback.format_exc()