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


Python plugin_base.PluginBase类代码示例

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


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

示例1: __init__

    def __init__ (self, ipcon, uid):
        PluginBase.__init__(self, ipcon, uid)
        
        self.ai = bricklet_analog_in.AnalogIn(self.uid)
        self.ipcon.add_device(self.ai)
        self.version = '.'.join(map(str, self.ai.get_version()[1]))
        
        self.qtcb_voltage.connect(self.cb_voltage)
        self.ai.register_callback(self.ai.CALLBACK_VOLTAGE,
                                  self.qtcb_voltage.emit) 
        
        self.voltage_label = VoltageLabel('Voltage: ')
        
        self.current_value = 0
        
        plot_list = [['', Qt.red, self.get_current_value]]
        self.plot_widget = PlotWidget('Voltage [mV]', plot_list)
        
        layout_h = QHBoxLayout()
        layout_h.addStretch()
        layout_h.addWidget(self.voltage_label)
        layout_h.addStretch()

        layout = QVBoxLayout(self)
        layout.addLayout(layout_h)
        layout.addWidget(self.plot_widget)
开发者ID:tewdreyer,项目名称:brickv,代码行数:26,代码来源:analog_in.py

示例2: __init__

    def __init__(self, ipcon, uid, version):
        PluginBase.__init__(self, ipcon, uid, 'Linear Poti Bricklet', version)
        
        self.lp = BrickletLinearPoti(uid, ipcon)
        
        self.qtcb_position.connect(self.cb_position)
        self.lp.register_callback(self.lp.CALLBACK_POSITION,
                                  self.qtcb_position.emit) 
        
        self.slider = QSlider(Qt.Horizontal)
        self.slider.setRange(0, 100)
        
        self.position_label = PositionLabel('Position: ')
        
        self.current_value = None

        plot_list = [['', Qt.red, self.get_current_value]]
        self.plot_widget = PlotWidget('Position', plot_list)
        
        layout_h = QHBoxLayout()
        layout_h.addStretch()
        layout_h.addWidget(self.position_label)
        layout_h.addWidget(self.slider)
        layout_h.addStretch()

        layout = QVBoxLayout(self)
        layout.addLayout(layout_h)
        layout.addWidget(self.plot_widget)
开发者ID:NobodysNightmare,项目名称:brickv,代码行数:28,代码来源:linear_poti.py

示例3: __init__

    def __init__ (self, ipcon, uid):
        PluginBase.__init__(self, ipcon, uid)
        
        self.hum = bricklet_humidity.Humidity(self.uid)
        self.ipcon.add_device(self.hum)
        self.version = '.'.join(map(str, self.hum.get_version()[1]))
        
        self.qtcb_humidity.connect(self.cb_humidity)
        self.hum.register_callback(self.hum.CALLBACK_HUMIDITY,
                                   self.qtcb_humidity.emit) 
        
        self.humidity_label = HumidityLabel('Humidity: ')
        
        self.current_value = 0
        
        plot_list = [['', Qt.red, self.get_current_value]]
        self.plot_widget = PlotWidget('Relative Humidity [%RH]', plot_list)
        
        layout_h = QHBoxLayout()
        layout_h.addStretch()
        layout_h.addWidget(self.humidity_label)
        layout_h.addStretch()

        layout = QVBoxLayout(self)
        layout.addLayout(layout_h)
        layout.addWidget(self.plot_widget)
开发者ID:tewdreyer,项目名称:brickv,代码行数:26,代码来源:humidity.py

示例4: __init__

    def __init__(self, ipcon, uid):
        PluginBase.__init__(self, ipcon, uid)

        self.lp = bricklet_linear_poti.LinearPoti(self.uid)
        self.ipcon.add_device(self.lp)
        self.version = ".".join(map(str, self.lp.get_version()[1]))

        self.qtcb_position.connect(self.cb_position)
        self.lp.register_callback(self.lp.CALLBACK_POSITION, self.qtcb_position.emit)

        self.slider = QSlider(Qt.Horizontal)
        self.slider.setRange(0, 100)

        self.position_label = PositionLabel("Position: ")

        self.current_value = 0
        plot_list = [["", Qt.red, self.get_current_value]]
        self.plot_widget = PlotWidget("Position", plot_list)

        layout_h = QHBoxLayout()
        layout_h.addStretch()
        layout_h.addWidget(self.position_label)
        layout_h.addWidget(self.slider)
        layout_h.addStretch()

        layout = QVBoxLayout(self)
        layout.addLayout(layout_h)
        layout.addWidget(self.plot_widget)
开发者ID:smunix,项目名称:brickv,代码行数:28,代码来源:linear_poti.py

示例5: __init__

    def __init__(self, ipcon, uid):
        PluginBase.__init__(self, ipcon, uid)

        self.al = bricklet_ambient_light.AmbientLight(self.uid)
        self.ipcon.add_device(self.al)
        self.version = ".".join(map(str, self.al.get_version()[1]))

        self.qtcb_illuminance.connect(self.cb_illuminance)
        self.al.register_callback(self.al.CALLBACK_ILLUMINANCE, self.qtcb_illuminance.emit)

        self.illuminance_label = IlluminanceLabel("Illuminance: ")
        self.alf = AmbientLightFrame()

        self.current_value = 0
        plot_list = [["", Qt.red, self.get_current_value]]
        self.plot_widget = PlotWidget("Illuminance [lx]", plot_list)

        layout_h = QHBoxLayout()
        layout_h.addStretch()
        layout_h.addWidget(self.illuminance_label)
        layout_h.addWidget(self.alf)
        layout_h.addStretch()

        layout = QVBoxLayout(self)
        layout.addLayout(layout_h)
        layout.addWidget(self.plot_widget)
开发者ID:smunix,项目名称:brickv,代码行数:26,代码来源:ambient_light.py

示例6: __init__

    def __init__(self, ipcon, uid, version):
        PluginBase.__init__(self, ipcon, uid, 'Industrial Digital In 4 Bricklet', version)
        
        self.setupUi(self)
        
        self.idi4 = BrickletIndustrialDigitalIn4(uid, ipcon)
        
        self.gnd_pixmap = bmp_to_pixmap('plugin_system/plugins/industrial_digital_in_4/dio_gnd.bmp')
        self.vcc_pixmap = bmp_to_pixmap('plugin_system/plugins/industrial_digital_in_4/dio_vcc.bmp')
        
        self.pin_buttons = [self.b0, self.b1, self.b2, self.b3, self.b4, self.b5, self.b6, self.b7, self.b8, self.b9, self.b10, self.b11, self.b12, self.b13, self.b14, self.b15]
        self.pin_button_icons = [self.b0_icon, self.b1_icon, self.b2_icon, self.b3_icon, self.b4_icon, self.b5_icon, self.b6_icon, self.b7_icon, self.b8_icon, self.b9_icon, self.b10_icon, self.b11_icon, self.b12_icon, self.b13_icon, self.b14_icon, self.b15_icon]
        self.pin_button_labels = [self.b0_label, self.b1_label, self.b2_label, self.b3_label, self.b4_label, self.b5_label, self.b6_label, self.b7_label, self.b8_label, self.b9_label, self.b10_label, self.b11_label, self.b12_label, self.b13_label, self.b14_label, self.b15_label]
        self.groups = [self.group0, self.group1, self.group2, self.group3]

        self.lines = [[self.line0, self.line0a, self.line0b, self.line0c],
                      [self.line1, self.line1a, self.line1b, self.line1c],
                      [self.line2, self.line2a, self.line2b, self.line2c],
                      [self.line3, self.line3a, self.line3b, self.line3c]]
        for lines in self.lines:
            for line in lines:
                line.setVisible(False)
        
        self.available_ports = 0
        async_call(self.idi4.get_available_for_group, None, self.get_available_for_group_aysnc, self.increase_error_count)
        
        self.qtcb_interrupt.connect(self.cb_interrupt)
        self.idi4.register_callback(self.idi4.CALLBACK_INTERRUPT,
                                    self.qtcb_interrupt.emit)
        
        self.set_group.pressed.connect(self.set_group_pressed)
        
        self.debounce_go.pressed.connect(self.debounce_go_pressed)
        
        self.reconfigure_everything()
开发者ID:NobodysNightmare,项目名称:brickv,代码行数:35,代码来源:industrial_digital_in_4.py

示例7: __init__

 def __init__ (self, ipcon, uid):
     PluginBase.__init__(self, ipcon, uid)
     
     self.dr = bricklet_dual_relay.DualRelay(self.uid)
     self.ipcon.add_device(self.dr)
     self.version = '.'.join(map(str, self.dr.get_version()[1]))
     
     dr1_label = QLabel("Relay 1:")
     self.dr1_button = QPushButton("Off")
     dr1_layout = QHBoxLayout()
     dr1_layout.addStretch()
     dr1_layout.addWidget(dr1_label)
     dr1_layout.addWidget(self.dr1_button)
     dr1_layout.addStretch()
     
     dr2_label = QLabel("Relay 2:")
     self.dr2_button = QPushButton("Off")
     dr2_layout = QHBoxLayout()
     dr2_layout.addStretch()
     dr2_layout.addWidget(dr2_label)
     dr2_layout.addWidget(self.dr2_button)
     dr2_layout.addStretch()
     
     self.dr1_button.pressed.connect(self.dr1_pressed)
     self.dr2_button.pressed.connect(self.dr2_pressed)
     
     layout = QVBoxLayout(self)
     layout.addLayout(dr1_layout)
     layout.addLayout(dr2_layout)
     layout.addStretch()
开发者ID:smunix,项目名称:brickv,代码行数:30,代码来源:dual_relay.py

示例8: __init__

    def __init__ (self, ipcon, uid):
        PluginBase.__init__(self, ipcon, uid)
        self.setupUi(self)

        self.master = brick_master.Master(self.uid)
        self.device = self.master
        self.ipcon.add_device(self.master)
        self.version = '.'.join(map(str, self.master.get_version()[1]))
        
        self.extension_type_button.pressed.connect(self.extension_pressed)
        
        self.update_timer = QTimer()
        self.update_timer.timeout.connect(self.update_data)
        
        num_extensions = 0
        # construct chibi widget
#        if self.master.is_chibi_present():
#            num_extensions += 1
#            chibi = Chibi(self.master)
#            self.extension_layout.addWidget(chibi)
            
        if num_extensions == 0:
            self.extension_label.setText("None Present")
        else:
            self.extension_label.setText("" + str(num_extensions) + " Present")
开发者ID:smunix,项目名称:brickv,代码行数:25,代码来源:master.py

示例9: __init__

    def __init__(self, ipcon, uid, version):
        PluginBase.__init__(self, ipcon, uid, 'Master Brick', version)
        
        self.setupUi(self)

        self.master = BrickMaster(uid, ipcon)
        self.device = self.master
        
        self.update_timer = QTimer()
        self.update_timer.timeout.connect(self.update_data)

        self.extension_type = None

        self.extensions = []
        self.num_extensions = 0

        self.extension_label.setText("None Present")
        
        # Chibi widget
        if self.version >= (1, 1, 0):
            self.extension_type_button.pressed.connect(self.extension_pressed)
            async_call(self.master.is_chibi_present, None, self.is_chibi_present_async, self.increase_error_count)
        else:
            self.extension_type_button.setEnabled(False)
            
        # RS485 widget
        if self.version >= (1, 2, 0):
            async_call(self.master.is_rs485_present, None, self.is_rs485_present_async, self.increase_error_count)
                
        # Wifi widget
        if self.version >= (1, 3, 0):
            async_call(self.master.is_wifi_present, None, self.is_wifi_present_async, self.increase_error_count)
开发者ID:NobodysNightmare,项目名称:brickv,代码行数:32,代码来源:master.py

示例10: __init__

    def __init__ (self, ipcon, uid):
        PluginBase.__init__(self, ipcon, uid)
        
        self.tem = bricklet_temperature.Temperature(self.uid)
        self.ipcon.add_device(self.tem)
        self.version = '.'.join(map(str, self.tem.get_version()[1]))
        
        self.qtcb_temperature.connect(self.cb_temperature)
        self.tem.register_callback(self.tem.CALLBACK_TEMPERATURE,
                                   self.qtcb_temperature.emit) 
        
        self.temperature_label = TemperatureLabel()
        self.cb_temperature(self.tem.get_temperature())
        
        self.current_value = 0
        
        plot_list = [['', Qt.red, self.get_current_value]]
        self.plot_widget = PlotWidget('Temperature [%cC]' % 0xB0, plot_list)
        
        layout_h = QHBoxLayout()
        layout_h.addStretch()
        layout_h.addWidget(self.temperature_label)
        layout_h.addStretch()

        layout = QVBoxLayout(self)
        layout.addLayout(layout_h)
        layout.addWidget(self.plot_widget)
开发者ID:smunix,项目名称:brickv,代码行数:27,代码来源:temperature.py

示例11: __init__

 def __init__ (self, ipcon, uid):
     PluginBase.__init__(self, ipcon, uid)
     
     self.setupUi(self)
     
     self.io = bricklet_io4.IO4(self.uid)
     self.ipcon.add_device(self.io)
     self.version = '.'.join(map(str, self.io.get_version()[1]))
     
     self.qtcb_interrupt.connect(self.cb_interrupt)
     self.io.register_callback(self.io.CALLBACK_INTERRUPT,
                               self.qtcb_interrupt.emit)
     
     self.port_value = [self.av0, self.av1, self.av2, self.av3]
     self.port_direction = [self.ad0, self.ad1, self.ad2, self.ad3]
     self.port_config = [self.ac0, self.ac1, self.ac2, self.ac3]
     
     try:
         value = self.io.get_value()
         dir, config = self.io.get_configuration()
         self.init_values(value, dir, config)
     
         debounce = self.io.get_debounce_period()
         self.debounce_edit.setText(str(debounce))
     except ip_connection.Error:
         pass
     
     self.save_button.pressed.connect(self.save_pressed)
     self.pin_box.currentIndexChanged.connect(self.pin_changed)
     self.direction_box.currentIndexChanged.connect(self.direction_changed)
     self.debounce_save.pressed.connect(self.debounce_save_pressed)
     
     self.pin_changed(0)
开发者ID:smunix,项目名称:brickv,代码行数:33,代码来源:io4.py

示例12: __init__

    def __init__(self, ipcon, uid, version):
        PluginBase.__init__(self, ipcon, uid, 'Ambient Light Bricklet', version)
        
        self.al = BrickletAmbientLight(uid, ipcon)
        
        self.qtcb_illuminance.connect(self.cb_illuminance)
        self.al.register_callback(self.al.CALLBACK_ILLUMINANCE,
                                  self.qtcb_illuminance.emit) 
        
        self.illuminance_label = IlluminanceLabel('Illuminance: ')
        self.alf = AmbientLightFrame()
        
        self.current_value = None

        plot_list = [['', Qt.red, self.get_current_value]]
        self.plot_widget = PlotWidget('Illuminance [lx]', plot_list)
        
        layout_h = QHBoxLayout()
        layout_h.addStretch()
        layout_h.addWidget(self.illuminance_label)
        layout_h.addWidget(self.alf)
        layout_h.addStretch()

        layout = QVBoxLayout(self)
        layout.addLayout(layout_h)
        layout.addWidget(self.plot_widget)
开发者ID:NobodysNightmare,项目名称:brickv,代码行数:26,代码来源:ambient_light.py

示例13: start

 def start(self, device_information):
     self.mw.button_flash.hide()
     PluginBase.start(self, device_information)
     self.mw.set_tool_status_okay("-")
     self.mw.set_uid_status_okay("-")
     self.mw.set_flash_status_okay("-")
     self.mw.set_value_normal('-')
     self.mw.button_continue.hide()
开发者ID:Tinkerforge,项目名称:flash-test,代码行数:8,代码来源:extension_base.py

示例14: __init__

 def __init__(self, ipcon, uid, version):
     PluginBase.__init__(self, ipcon, uid, 'DC Brick', version)
     
     self.setupUi(self)
     
     self.dc = BrickDC(uid, ipcon)
     self.device = self.dc
     
     self.update_timer = QTimer()
     self.update_timer.timeout.connect(self.update_data)
     
     self.speedometer = SpeedoMeter()
     self.vertical_layout_right.insertWidget(4, self.speedometer)
     
     self.new_value = 0
     self.update_counter = 0
     
     self.full_brake_time = 0
     
     self.velocity_slider.sliderReleased.connect(self.velocity_slider_released)
     self.velocity_slider.valueChanged.connect(self.velocity_spin.setValue)
     self.velocity_spin.editingFinished.connect(self.velocity_spin_finished)
     
     self.acceleration_slider.sliderReleased.connect(self.acceleration_slider_released)
     self.acceleration_slider.valueChanged.connect(self.acceleration_spin.setValue)
     self.acceleration_spin.editingFinished.connect(self.acceleration_spin_finished)
     
     self.frequency_slider.sliderReleased.connect(self.frequency_slider_released)
     self.frequency_slider.valueChanged.connect(self.frequency_spin.setValue)
     self.frequency_spin.editingFinished.connect(self.frequency_spin_finished)
     
     self.radio_mode_brake.toggled.connect(self.brake_value_changed)
     self.radio_mode_coast.toggled.connect(self.coast_value_changed)
     
     self.minimum_voltage_button.pressed.connect(self.minimum_voltage_button_pressed)
     self.full_brake_button.pressed.connect(self.full_brake_pressed)
     self.enable_checkbox.stateChanged.connect(self.enable_state_changed)
     
     self.emergency_signal = None
     self.under_signal = None
     self.current_velocity_signal = None
     self.velocity_reached_signal = None
     
     self.qem = QErrorMessage(self)
     
     self.qtcb_under_voltage.connect(self.cb_under_voltage)
     self.dc.register_callback(self.dc.CALLBACK_UNDER_VOLTAGE,
                               self.qtcb_under_voltage.emit) 
     
     self.qtcb_emergency_shutdown.connect(self.cb_emergency_shutdown)
     self.dc.register_callback(self.dc.CALLBACK_EMERGENCY_SHUTDOWN,
                               self.qtcb_emergency_shutdown.emit) 
     
     self.qtcb_position_reached.connect(self.update_velocity)
     self.dc.register_callback(self.dc.CALLBACK_VELOCITY_REACHED,
                               self.qtcb_position_reached.emit) 
     self.dc.register_callback(self.dc.CALLBACK_CURRENT_VELOCITY,
                               self.qtcb_position_reached.emit) 
开发者ID:NobodysNightmare,项目名称:brickv,代码行数:58,代码来源:dc.py

示例15: __init__

    def __init__ (self, ipcon, uid):
        PluginBase.__init__(self, ipcon, uid)

        self.dist = bricklet_distance_ir.DistanceIR(self.uid)
        self.ipcon.add_device(self.dist)
        self.version = '.'.join(map(str, self.dist.get_version()[1]))
        
        self.qtcb_distance.connect(self.cb_distance)
        self.dist.register_callback(self.dist.CALLBACK_DISTANCE,
                                    self.qtcb_distance.emit) 
        
        self.qtcb_analog.connect(self.cb_analog)
        self.dist.register_callback(self.dist.CALLBACK_ANALOG_VALUE,
                                    self.qtcb_analog.emit) 
        
        self.analog_value = 0
        self.counter = 0
        
        self.distance_label = DistanceLabel('Distance: ')
        self.analog_label = AnalogLabel('Analog value: ')
        self.sample_layout = QHBoxLayout()
        self.sample_label = QLabel('Sample Points:')
        self.sample_edit = QLineEdit();
        self.sample_file = QPushButton("File..");
        self.sample_save = QPushButton("Save");
        
        self.sample_file.pressed.connect(self.sample_file_pressed)
        self.sample_save.pressed.connect(self.sample_save_pressed)
        
        self.sample_layout.addWidget(self.sample_label)
        self.sample_layout.addWidget(self.sample_edit)
        self.sample_layout.addWidget(self.sample_file)
        self.sample_layout.addWidget(self.sample_save)
        
        self.current_value = 0
        
        plot_list = [['', Qt.red, self.get_current_value]]
        self.plot_widget = PlotWidget('Distance [cm]', plot_list)
        
        layout_h1 = QHBoxLayout()
        layout_h1.addStretch()
        layout_h1.addWidget(self.distance_label)
        layout_h1.addStretch()
        
        layout_h2 = QHBoxLayout()
        layout_h2.addStretch()
        layout_h2.addWidget(self.analog_label)
        layout_h2.addStretch()

        layout = QVBoxLayout(self)
        layout.addLayout(layout_h1)
        layout.addLayout(layout_h2)
        layout.addWidget(self.plot_widget)
        layout.addLayout(self.sample_layout)
开发者ID:tewdreyer,项目名称:brickv,代码行数:54,代码来源:distance_ir.py


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