当前位置: 首页>>代码示例>>Python>>正文


Python HardwareRepository.HardwareRepository类代码示例

本文整理汇总了Python中HardwareRepository.HardwareRepository的典型用法代码示例。如果您正苦于以下问题:Python HardwareRepository类的具体用法?Python HardwareRepository怎么用?Python HardwareRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了HardwareRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: init

    def init(self):
        try:
            self.aperture_HO = HardwareRepository.getHardwareRepository().getHardwareObject(
                self.getProperty("aperture")
            )
            self.connect(self.aperture_HO, "apertureChanged", self.aperture_pos_changed)
        except BaseException:
            logging.getLogger("HWR").debug("BeamInfo: aperture not defined correctly")
        try:
            self.slits_HO = HardwareRepository.getHardwareRepository().getHardwareObject(
                self.getProperty("slits")
            )
            self.connect(self.slits_HO, "gapSizeChanged", self.slits_gap_changed)
        except BaseException:
            logging.getLogger("HWR").debug("BeamInfo: slits not defined correctly")
        try:
            self.beam_definer_HO = HardwareRepository.getHardwareRepository().getHardwareObject(
                self.getProperty("definer")
            )
            self.connect(
                self.beam_definer_HO, "definerPosChanged", self.definer_pos_changed
            )
        except BaseException:
            logging.getLogger("HWR").debug(
                "BeamInfo: beam definer not defined correctly"
            )

        self.beam_position_hor = self.getChannelObject("beam_position_hor")
        self.beam_position_hor.connectSignal("update", self.beam_pos_hor_changed)
        self.beam_position_ver = self.getChannelObject("beam_position_ver")
        self.beam_position_ver.connectSignal("update", self.beam_pos_ver_changed)
        self.chan_beam_size_microns = self.getChannelObject("beam_size_microns")
        self.chan_beam_shape_ellipse = self.getChannelObject("beam_shape_ellipse")
开发者ID:IvarsKarpics,项目名称:HardwareRepository,代码行数:33,代码来源:ID231BeamInfo.py

示例2: _connect_hwserver

    def _connect_hwserver(self):
        print self.hwr_directory

        self.hwr_server = HardwareRepository.HardwareRepository(self.hwr_directory)
        self.hwr_server.connect()

        hwo_path = os.path.join(self.mxcube_dir, "HardwareObjects")
        sc_hwo_path = os.path.join(hwo_path, "sample_changer")
        if self.institute:
            inst_hwo_path = os.path.join(hwo_path, self.institute)

        HardwareRepository.addHardwareObjectsDirs([hwo_path, inst_hwo_path, sc_hwo_path])
开发者ID:vrey01,项目名称:mxcube,代码行数:12,代码来源:MXCuBE_Test_Environment.py

示例3: test

def test():
    hwr = HardwareRepository.getHardwareRepository()
    hwr.connect()

    conn = hwr.getHardwareObject("/ldapconnection")
    # conn.login("20141015", "4dBM0lx3pw")

    # ok,name = conn.login("99140198", "5u4Twf70K5")
    # ok,name = conn.login("mx20100023", "tisabet")
    # ok,name = conn.login("anything", "tisabet")

    # info = conn.getinfo("legrand")
    # info = conn.getinfo("20100023")
    # conn.find_groups_for_username('houdusse')

    # grps = conn.find_groups_for_username('houdusse')
    # for grp,users in grps.iteritems():
    # print grp, " :  " , users
    user = "20140088"  # '20100023'
    sess = conn.find_sessions_for_user("%s" % user)
    for onesess in sess:
        print "Session for %s" % user, onesess

    validsess = conn.find_valid_sessions_for_user(user)
    for valid in validsess:
        print "Valid session for today", valid
开发者ID:IvarsKarpics,项目名称:HardwareRepository,代码行数:26,代码来源:SOLEILLdapLogin.py

示例4: get_hardware_object

    def get_hardware_object(self, hardware_object_name, optional=False):
        splash_screen = gui.get_splash_screen()
        if splash_screen:
            splash_screen.set_message(
                "Loading hardware object defined in %s.xml" % hardware_object_name
            )

        if not hardware_object_name in self.__loaded_hardware_objects:
            if splash_screen:
                splash_screen.inc_progress_value()
            self.__loaded_hardware_objects.append(hardware_object_name)

        hwobj = HardwareRepository.getHardwareRepository().getHardwareObject(
            hardware_object_name
        )

        if hwobj is not None:
            self.connect(hwobj, "progressInit", self.progress_init)
            self.connect(hwobj, "progressStep", self.progress_step)
            self.connect(hwobj, "progressStop", self.progress_stop)
            self.connect(hwobj, "statusMessage", self.status_message_changed)

        if hwobj is None and not optional:
            logging.getLogger("GUI").error(
                "%s: Unable to initialize hardware object defined in %s.xml"
                % (self.objectName(), hardware_object_name[1:])
            )
            self.set_background_color(Colors.LIGHT_RED)
            self.__failed_to_load_hwobj = True
            self.setDisabled(True)

        return hwobj
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:32,代码来源:BaseComponents.py

示例5: __init__

    def __init__(self, parent=None, widgetName=""):
        Connectable.Connectable.__init__(self)
        QWidget.__init__(self, parent, widgetName)

        self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)
        self.propertyBag = PropertyBag.PropertyBag()

        self.__enabledState = True  # saved enabled state
        self.__loadedHardwareObjects = []
        self._signalSlotFilters = {}
        self._widgetEvents = []

        #
        # add what's this help
        #
        QWhatsThis.add(self, "%s (%s)\n" % (widgetName, self.__class__.__name__))

        #
        # add properties shared by all BlissWidgets
        #
        self.addProperty("fontSize", "string", str(self.font().pointSize()))
        # self.addProperty("alignment", "combo", ("none", "top center", "top left", "top right", "bottom center", "bottom left", "bottom right", "center", "left", "right"), "none")
        self.addProperty("instanceAllowAlways", "boolean", False)  # , hidden=True)
        self.addProperty("instanceAllowConnected", "boolean", False)  # , hidden=True)

        #
        # connect signals / slots
        #
        dispatcher.connect(
            self.__hardwareObjectDiscarded,
            "hardwareObjectDiscarded",
            HardwareRepository.getHardwareRepository(),
        )

        self.defineSlot("enable_widget", ())
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:35,代码来源:BaseComponents.py

示例6: test

def test():
    hwr = HardwareRepository.getHardwareRepository()
    hwr.connect()

    shut = hwr.getHardwareObject("/fastshutter")

    print("Shutter State is: ", shut.readShutterState())
开发者ID:IvarsKarpics,项目名称:HardwareRepository,代码行数:7,代码来源:TangoShutter.py

示例7: test

def test():
    hwr = HardwareRepository.getHardwareRepository()
    hwr.connect()

    flux = hwr.getHardwareObject("/flux")

    print "PX1 Flux is ", flux.getCurrentFlux()
开发者ID:IvarsKarpics,项目名称:HardwareRepository,代码行数:7,代码来源:SOLEILFlux.py

示例8: __init__

    def __init__(self, parent=None, widget_name=''):
        """
        Descript. :
        """
        Connectable.Connectable.__init__(self)
        QFrame.__init__(self, parent)
        self.setObjectName(widget_name)
        self.property_bag = PropertyBag.PropertyBag()

        self.__enabledState = True
        self.__loaded_hardware_objects = []
        self.__failed_to_load_hwobj = False
        self.__use_progress_dialog = False
        self._signal_slot_filters = {}
        self._widget_events = []

        self.setWhatsThis("%s (%s)\n" % (widget_name, self.__class__.__name__))

        self.addProperty('fontSize',
                         'string',
                         str(self.font().pointSize()))
        self.addProperty('frame',
                         'boolean',
                         False,
                         comment="Draw a frame around the widget")
        self.addProperty('instanceAllowAlways',
                         'boolean',
                         False,
                         comment="Allow to control brick in all modes")
        self.addProperty('instanceAllowConnected',
                         'boolean',
                         False,
                         comment="Allow to control brick in slave mode")
        self.addProperty('fixedWidth',
                         'integer',
                         '-1',
                         comment="Set fixed width in pixels")
        self.addProperty('fixedHeight',
                         'integer',
                         '-1',
                         comment="Set fixed height in pixels")
        self.addProperty('hide',
                         'boolean',
                         False,
                         comment="Hide widget")

        dispatcher.connect(self.__hardwareObjectDiscarded,
                           'hardwareObjectDiscarded',
                           HardwareRepository.getHardwareRepository())
        self.defineSlot('enable_widget', ())
        self.defineSlot('disable_widget', ())

        #If PySide used then connect method was not overriden
        #This solution of redirecting methods works...

        self.connect = self.connect_hwobj
        self.diconnect = self.disconnect_hwobj
开发者ID:vrey01,项目名称:mxcube,代码行数:57,代码来源:Qt4_BaseComponents.py

示例9: hardwareObjectClicked

    def hardwareObjectClicked(self, item):
        _instance = HardwareRepository()

        try:
            #item could be None
            name = str(item.text(2))
        except:
            return
        else:
            if len(name) == 0:
                return
        
        if item.isOn() and not self.itemStates[name]:
            _instance.loadHardwareObject(name)
        elif not item.isOn() and self.itemStates[name]:
            _instance.discardHardwareObject(name)

        self.itemStates[name] = item.isOn()
开发者ID:MAXLABMX,项目名称:HardwareRepository,代码行数:18,代码来源:HardwareRepositoryBrowser.py

示例10: test

def test():
    import sys

    hwr = HardwareRepository.getHardwareRepository()
    hwr.connect()

    ruche = hwr.getHardwareObject("/ruche")
    filename = sys.argv[1]
    ruche.trigger_sync(filename)
开发者ID:IvarsKarpics,项目名称:HardwareRepository,代码行数:9,代码来源:SOLEILRuche.py

示例11: setProcedure

    def setProcedure(self, proc):
        if proc is None:
            self.procedure = None
        else:
            import weakref
        
            self.procedure = weakref.ref(proc)()

            QtCore.QObject.connect(HardwareRepository.emitter(self.procedure), SIGNAL('replyArrived'), self.replyArrived)
开发者ID:douglasbeniz,项目名称:BlissFramework,代码行数:9,代码来源:Qt4_ProcedureWidgets.py

示例12: test

def test():
    hwr = HardwareRepository.getHardwareRepository()
    hwr.connect()

    light = hwr.getHardwareObject("/frontlight")
    print '\nLight control for "%s"\n' % light.getUserName()
    print "   Level limits are:", light.getLimits()
    print "   Current level is:", light.getLevel()
    print "   Current state is:", light.getState()
开发者ID:IvarsKarpics,项目名称:HardwareRepository,代码行数:9,代码来源:ALBAFrontLight.py

示例13: addPage

    def addPage(self, pageName):
        self.__pages.append(ProcedureWidgets.ProcedurePanel(self))

        self.__pages[-1].setProcedure(
            HardwareRepository.getHardwareRepository().getProcedure(self["mnemonic"])
        )
        self.procedureTab.addTab(self.__pages[-1], pageName)

        return self.__pages[-1]
开发者ID:IvarsKarpics,项目名称:mxcube,代码行数:9,代码来源:BaseComponents.py

示例14: setProcedure

    def setProcedure(self, proc):
        if proc is None:
            self.procedure = None
        else:
            import weakref
        
            self.procedure = weakref.ref(proc)()

            self.connect( HardwareRepository.emitter(self.procedure), 'replyArrived', self.replyArrived)
开发者ID:MartinSavko,项目名称:mxcube,代码行数:9,代码来源:Qt4_ProcedureWidgets.py

示例15: init

 def init(self):
     controller = HardwareRepository.getHardwareRepository().getHardwareObject(
         self.getProperty("controller")
     )
     cryostat = self.getProperty("cryostat")
     self.interval = self.getProperty("interval") or 10
     self.ctrl = getattr(controller, cryostat)
     if self.ctrl is not None:
         self.get_params()
         gevent.spawn(self._do_polling)
开发者ID:IvarsKarpics,项目名称:HardwareRepository,代码行数:10,代码来源:Oxford700.py


注:本文中的HardwareRepository.HardwareRepository类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。