コード例 #1
0
    def _subscribe(self):

        self._depGraph = rospy.Subscriber(
            "dependency_graph", String,
            lambda data: self.emit(QtCore.SIGNAL("onDepGraph"), data.data))
        self._pnGraph = rospy.Subscriber(
            "petri_net_graph", String,
            lambda data: self.emit(QtCore.SIGNAL("onPNGraph"), data.data))
        pass
コード例 #2
0
    def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.setWindowTitle('Select Binary')
        self.verticalLayout = QtGui.QVBoxLayout(self)
        self.verticalLayout.setObjectName("verticalLayout")

        self.content = QtGui.QWidget()
        self.contentLayout = QtGui.QFormLayout(self.content)
        self.contentLayout.setVerticalSpacing(0)
        self.verticalLayout.addWidget(self.content)

        self.packages = None

        package_label = QtGui.QLabel("Package:", self.content)
        self.package_field = QtGui.QComboBox(self.content)
        self.package_field.setInsertPolicy(
            QtGui.QComboBox.InsertAlphabetically)
        self.package_field.setSizePolicy(
            QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Fixed))
        self.package_field.setEditable(True)
        self.contentLayout.addRow(package_label, self.package_field)
        binary_label = QtGui.QLabel("Binary:", self.content)
        self.binary_field = QtGui.QComboBox(self.content)
        #    self.binary_field.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
        self.binary_field.setSizePolicy(
            QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Fixed))
        self.binary_field.setEditable(True)
        self.contentLayout.addRow(binary_label, self.binary_field)

        self.buttonBox = QtGui.QDialogButtonBox(self)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok
                                          | QtGui.QDialogButtonBox.Cancel)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)

        self.package_field.setFocus(QtCore.Qt.TabFocusReason)
        self.package = ''
        self.binary = ''

        if self.packages is None:
            self.package_field.addItems(['packages searching...'])
            self.package_field.setCurrentIndex(0)
            self._fill_packages_thread = PackagesThread()
            self._fill_packages_thread.packages.connect(self._fill_packages)
            self._fill_packages_thread.start()

        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"),
                               self.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"),
                               self.reject)
        QtCore.QMetaObject.connectSlotsByName(self)
        self.package_field.activated[str].connect(self.on_package_selected)
        self.package_field.textChanged.connect(self.on_package_selected)
コード例 #3
0
 def _onJoystickRadio(self):
     if self.tauRadio.isChecked(): self.manualSelection = 0;
     if self.nuRadio.isChecked(): self.manualSelection = 1;
     if self.relRadio.isChecked(): self.manualSelection = 2;
     self.emit(QtCore.SIGNAL("onManualEnable"), 
               self.manualEnable.isChecked(), 
               self.manualSelection)
コード例 #4
0
 def _onMoveBaseRadio(self):
     if self.absRadio.isChecked(): self.movebaseSelection = 0;
     if self.nePosRadio.isChecked(): self.movebaseSelection = 1;
     if self.relPosRadio.isChecked(): self.movebaseSelection = 2;
     self.emit(QtCore.SIGNAL("onMoveBaseRef"), 
               self.northRef.value(), 
               self.eastRef.value(),
               self.movebaseSelection)
コード例 #5
0
  def __init__(self, parent=None):
    QtGui.QDialog.__init__(self, parent)
    self.setObjectName('FindDialog')
    self.setWindowTitle('Search')
    self.verticalLayout = QtGui.QVBoxLayout(self)
    self.verticalLayout.setObjectName("verticalLayout")

    self.content = QtGui.QWidget(self)
    self.contentLayout = QtGui.QFormLayout(self.content)
#    self.contentLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
#    self.contentLayout.setVerticalSpacing(0)
    self.contentLayout.setContentsMargins(0, 0, 0, 0)
    self.verticalLayout.addWidget(self.content)

    label = QtGui.QLabel("Find:", self.content)
    self.search_field = QtGui.QLineEdit(self.content)
    self.contentLayout.addRow(label, self.search_field)
    replace_label = QtGui.QLabel("Replace:", self.content)
    self.replace_field = QtGui.QLineEdit(self.content)
    self.contentLayout.addRow(replace_label, self.replace_field)
    self.recursive = QtGui.QCheckBox("recursive search")
    self.contentLayout.addRow(self.recursive)
    self.result_label = QtGui.QLabel("")
    self.verticalLayout.addWidget(self.result_label)
    self.found_files = QtGui.QListWidget()
    self.found_files.setVisible(False)
    self.found_files.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
    self.verticalLayout.addWidget(self.found_files)

    self.buttonBox = QtGui.QDialogButtonBox(self)
    self.find_button = QtGui.QPushButton(self.tr("&Find"))
    self.find_button.setDefault(True)
    self.buttonBox.addButton(self.find_button, QtGui.QDialogButtonBox.ActionRole)
    self.replace_button = QtGui.QPushButton(self.tr("&Replace/Find"))
    self.buttonBox.addButton(self.replace_button, QtGui.QDialogButtonBox.ActionRole)
    self.buttonBox.addButton(QtGui.QDialogButtonBox.Close)
    self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
    self.buttonBox.setObjectName("buttonBox")
    self.verticalLayout.addWidget(self.buttonBox)

#    QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), self.accept)
    QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), self.reject)
    QtCore.QMetaObject.connectSlotsByName(self)

    self.search_text = ''
    self.search_pos = QtGui.QTextCursor()
コード例 #6
0
def _on_figure_window_close(figure, function):
    """Connects a close figure signal to a given function.

    Parameters
    ----------

    figure : mpl figure instance
    function : function

    """
    window = figure.canvas.manager.window
    if not hasattr(figure, '_on_window_close'):
        figure._on_window_close = list()
    if function not in figure._on_window_close:
        figure._on_window_close.append(function)

    # PyQt
    # In PyQt window.connect supports multiple funtions
    window.connect(window, QtCore.SIGNAL('closing()'), function)
コード例 #7
0
def create_add_component_actions(parent, callback, prefix="", postfix=""):
    actions = {}
    compnames = [
        'Arctan', 'Bleasdale', 'DoubleOffset', 'DoublePowerLaw', 'Erf',
        'Exponential', 'Gaussian', 'GaussianHF', 'Logistic', 'Lorentzian',
        'Offset', 'PowerLaw', 'SEE', 'RC', 'Vignetting', 'Voigt', 'Polynomial',
        'PESCoreLineShape', 'Expression', 'VolumePlasmonDrude'
    ]
    for name in compnames:
        try:
            t = getattr(hyperspy.components1d, name)
        except AttributeError:
            continue
        ac_name = 'add_component_' + name
        f = partial(callback, t)
        ac = QtGui.QAction(prefix + name + postfix, parent)
        ac.setStatusTip(tr("Add a component of type ") + name)
        ac.connect(ac, QtCore.SIGNAL('triggered()'), f)
        actions[ac_name] = ac
    return actions
コード例 #8
0
    def __init__(self, context):
        """
        Constructor of the class.
        """

        super(MyPlugin, self).__init__(context)

        # give QObjects reasonable names
        self.setObjectName('TelepresencePlugin')

        # create QWidget
        self._widget = QWidget()

        # get path to UI file which should be in the "resource" folder of this
        # package
        ui_file = os.path.join(
            rospkg.RosPack().get_path('rqt_servo'), 'resource', 'view.ui')

        # extend the widget with all attributes and children from UI file
        loadUi(ui_file, self._widget)

        # give QObjects reasonable names
        self._widget.setObjectName('TelepresencePlugin')
        
        # set fixed height
        self._widget.setFixedHeight(164)

        # add widget to the user interface
        context.add_widget(self._widget)
        
        # create a timer
        self.timer = QtCore.QTimer()
        self.timer.start(40)
        
        # class variables
        self.i = 0
        
        # publishers and subscribers
        self.pub_pitch_oculus = rospy.Publisher('pitch_controller/command',
                                                Float32, queue_size=100)
        self.pub_yaw_oculus = rospy.Publisher('yaw_controller/command',
                                              Float32, queue_size=100)

        # events
        QtCore.QObject.connect(self._widget.CheckManual,
                               QtCore.SIGNAL('toggled(bool)'),
                               self.on_CheckManual_toggled)

        QtCore.QObject.connect(self._widget.PitchSlider,
                               QtCore.SIGNAL('valueChanged(int)'),
                               self.on_PitchSlider_valueChanged)
        QtCore.QObject.connect(self._widget.PitchSpin,
                               QtCore.SIGNAL('valueChanged(int)'),
                               self.on_PitchSpin_valueChanged)

        QtCore.QObject.connect(self._widget.YawSlider,
                               QtCore.SIGNAL('valueChanged(int)'),
                               self.on_YawSlider_valueChanged)
        QtCore.QObject.connect(self._widget.YawSpin,
                               QtCore.SIGNAL('valueChanged(int)'),
                               self.on_YawSpin_valueChanged)
        
        QtCore.QObject.connect(self.timer,
                               QtCore.SIGNAL('timeout()'),
                               self.auto_update)

        # set manual box unnactive
        self._widget.CheckManual.setChecked(False)
コード例 #9
0
    def __init__(self, context):
        super(HalloweenGUI, self).__init__(context)
        self.setObjectName('HalloweenGUI')
        self._widget = QWidget()
        self._widget.setFixedSize(525, 300)
        self.arm_db = ArmDB()
        self._tf_listener = TransformListener()

        # Action/service/message clients or servers

        switch_srv_name = 'pr2_controller_manager/switch_controller'
        rospy.loginfo('Waiting for switch controller service...')
        rospy.wait_for_service(switch_srv_name)
        self.switch_service_client = rospy.ServiceProxy(
            switch_srv_name, SwitchController)

        self.r_joint_names = [
            'r_shoulder_pan_joint', 'r_shoulder_lift_joint',
            'r_upper_arm_roll_joint', 'r_elbow_flex_joint',
            'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint'
        ]
        self.l_joint_names = [
            'l_shoulder_pan_joint', 'l_shoulder_lift_joint',
            'l_upper_arm_roll_joint', 'l_elbow_flex_joint',
            'l_forearm_roll_joint', 'l_wrist_flex_joint', 'l_wrist_roll_joint'
        ]

        self.all_joint_names = []
        self.all_joint_poses = []

        self.saved_r_arm_pose = None
        self.saved_l_arm_pose = None

        self.lock = threading.Lock()
        rospy.Subscriber('joint_states', JointState, self.joint_states_cb)

        # Create a trajectory action client
        r_traj_controller_name = '/r_arm_controller/joint_trajectory_action'
        self.r_traj_action_client = SimpleActionClient(r_traj_controller_name,
                                                       JointTrajectoryAction)
        rospy.loginfo(
            'Waiting for a response from the trajectory action server for RIGHT arm...'
        )
        self.r_traj_action_client.wait_for_server()

        l_traj_controller_name = '/l_arm_controller/joint_trajectory_action'
        self.l_traj_action_client = SimpleActionClient(l_traj_controller_name,
                                                       JointTrajectoryAction)
        rospy.loginfo(
            'Waiting for a response from the trajectory action server for LEFT arm...'
        )
        self.l_traj_action_client.wait_for_server()

        QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
        self.joint_sig.connect(self.joint_sig_cb)

        large_box = QtGui.QVBoxLayout()

        arm_box = QtGui.QHBoxLayout()
        right_arm_box = QtGui.QVBoxLayout()
        left_arm_box = QtGui.QVBoxLayout()

        left_arm_box.addItem(QtGui.QSpacerItem(50, 50))
        right_arm_box.addItem(QtGui.QSpacerItem(50, 50))
        right_arm_box.addWidget(self.create_button('Relax right arm'))
        right_arm_box.addWidget(self.create_button('Freeze right arm'))
        left_arm_box.addWidget(self.create_button('Relax left arm'))
        left_arm_box.addWidget(self.create_button('Freeze left arm'))
        left_arm_box.addItem(QtGui.QSpacerItem(50, 20))
        right_arm_box.addItem(QtGui.QSpacerItem(50, 20))

        left_pose_saver = PoseSaver(PoseSaver.LEFT, self)
        right_pose_saver = PoseSaver(PoseSaver.RIGHT, self)
        left_arm_box.addWidget(
            self.create_button("Create left arm pose",
                               left_pose_saver.create_closure()))
        right_arm_box.addWidget(
            self.create_button("Create right arm pose",
                               right_pose_saver.create_closure()))
        left_arm_box.addItem(QtGui.QSpacerItem(50, 20))
        right_arm_box.addItem(QtGui.QSpacerItem(50, 20))

        # Dropdown boxes for saved poses
        left_pose_loader = PoseLoader(PoseLoader.LEFT, self)
        right_pose_loader = PoseLoader(PoseLoader.RIGHT, self)
        self.combo_box_left = left_pose_loader.create_button()
        self.combo_box_right = right_pose_loader.create_button()
        left_arm_box.addWidget(self.combo_box_left)
        right_arm_box.addWidget(self.combo_box_right)

        left_pose_option_box = QtGui.QHBoxLayout()
        right_pose_option_box = QtGui.QHBoxLayout()
        right_pose_option_box.addWidget(self.create_button('Move to pose (R)'))
        left_pose_option_box.addWidget(self.create_button('Move to pose (L)'))

        # Buttons for deleting poses for left/right arms
        left_pose_option_box.addWidget(self.create_button('Delete pose (L)'))
        right_pose_option_box.addWidget(self.create_button('Delete pose (R)'))

        left_arm_box.addLayout(left_pose_option_box)
        right_arm_box.addLayout(right_pose_option_box)
        left_arm_box.addItem(QtGui.QSpacerItem(50, 50))
        right_arm_box.addItem(QtGui.QSpacerItem(50, 50))

        arm_box.addLayout(left_arm_box)
        arm_box.addItem(QtGui.QSpacerItem(20, 20))
        arm_box.addLayout(right_arm_box)
        large_box.addLayout(arm_box)

        # Initialize state of saved arm poses for selected dropdowns
        self.update_saved_l_arm_pose()
        self.update_saved_r_arm_pose()

        # Update saved arm pose data on the changing of selected pose
        self.combo_box_left.connect(
            self.combo_box_left, QtCore.SIGNAL("currentIndexChanged(QString)"),
            self.update_saved_l_arm_pose)
        self.combo_box_right.connect(
            self.combo_box_right,
            QtCore.SIGNAL("currentIndexChanged(QString)"),
            self.update_saved_r_arm_pose)

        self._widget.setObjectName('HalloweenGUI')
        self._widget.setLayout(large_box)
        context.add_widget(self._widget)
        self._widget.setStyleSheet(
            "QWidget { image: url(%s) }" %
            (str(os.path.dirname(os.path.realpath(__file__))) +
             "/../../arm_gui_bg_large.png"))
        rospy.loginfo('GUI initialization complete.')
コード例 #10
0
 def _onDpEnable(self, state):
     self.emit(QtCore.SIGNAL("onDPEnable"), state)
     self.emit(QtCore.SIGNAL("onMoveBaseRef"),
               self.northRef.value(),
               self.eastRef.value(),
               self.movebaseSelection)
コード例 #11
0
 def _connect_signals(self, gui):
     QtCore.QObject.connect(self, QtCore.SIGNAL("onDepGraph"),
                            gui.drawDepGraph)
     QtCore.QObject.connect(self, QtCore.SIGNAL("onPNGraph"),
                            gui.drawPNGraph)
コード例 #12
0
ファイル: pbd_gui.py プロジェクト: christophersu/pr2_pbd
 def mousePressEvent(self, event):
     self.emit(QtCore.SIGNAL('clicked()'), "Label pressed")
     self.clickCallback(self.index)
コード例 #13
0
    def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, parent)
        #    self.host = host
        self.setWindowIcon(QtGui.QIcon(":/icons/irondevil_sync.png"))
        self.setWindowTitle('Sync')
        self.verticalLayout = QtGui.QVBoxLayout(self)
        self.verticalLayout.setObjectName("verticalLayout")
        self.resize(350, 190)

        self.toolButton_SyncAll = QtGui.QToolButton(self)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(2)
        sizePolicy.setHeightForWidth(
            self.toolButton_SyncAll.sizePolicy().hasHeightForWidth())
        self.toolButton_SyncAll.setSizePolicy(sizePolicy)
        self.toolButton_SyncAll.setObjectName("toolButton_SyncAll")
        self.verticalLayout.addWidget(self.toolButton_SyncAll)
        self.toolButton_SyncAll.setText(
            QtGui.QApplication.translate("Form", "Sync All", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.toolButton_SyncAll.clicked.connect(self._on_sync_all_clicked)

        self.toolButton_SyncAllAnyMsg = QtGui.QToolButton(self)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.toolButton_SyncAllAnyMsg.sizePolicy().hasHeightForWidth())
        self.toolButton_SyncAllAnyMsg.setSizePolicy(sizePolicy)
        self.toolButton_SyncAllAnyMsg.setObjectName("toolButton_SyncAllAnyMsg")
        self.verticalLayout.addWidget(self.toolButton_SyncAllAnyMsg)
        self.toolButton_SyncAllAnyMsg.setText(
            QtGui.QApplication.translate("Form", "Sync all (+AnyMsg)", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.toolButton_SyncAllAnyMsg.clicked.connect(
            self._on_sync_all_anymsg_clicked)

        self.toolButton_SyncTopicOnDemand = QtGui.QToolButton(self)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.toolButton_SyncTopicOnDemand.sizePolicy().hasHeightForWidth())
        self.toolButton_SyncTopicOnDemand.setSizePolicy(sizePolicy)
        self.toolButton_SyncTopicOnDemand.setObjectName(
            "toolButton_SyncTopicOnDemand")
        self.verticalLayout.addWidget(self.toolButton_SyncTopicOnDemand)
        self.toolButton_SyncTopicOnDemand.setText(
            QtGui.QApplication.translate("Form", "Sync only topics on demand",
                                         None, QtGui.QApplication.UnicodeUTF8))
        self.toolButton_SyncTopicOnDemand.clicked.connect(
            self._on_sync_topics_on_demand_clicked)

        self.toolButton_SelectInterface = QtGui.QToolButton(self)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.toolButton_SelectInterface.sizePolicy().hasHeightForWidth())
        self.toolButton_SelectInterface.setSizePolicy(sizePolicy)
        self.toolButton_SelectInterface.setObjectName(
            "toolButton_SelectInterface")
        self.verticalLayout.addWidget(self.toolButton_SelectInterface)
        self.toolButton_SelectInterface.setText(
            QtGui.QApplication.translate("Form", "Select an interface", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.toolButton_SelectInterface.clicked.connect(
            self._on_select_interface_clicked)

        self.interface_field = QtGui.QComboBox(self)
        self.interface_field.setInsertPolicy(
            QtGui.QComboBox.InsertAlphabetically)
        self.interface_field.setSizePolicy(
            QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Fixed))
        self.interface_field.setEditable(True)
        self.interface_field.setVisible(False)
        self.interface_field.setObjectName("interface_field")
        self.verticalLayout.addWidget(self.interface_field)
        self.interface_field.currentIndexChanged[str].connect(
            self._on_interface_selected)

        self.toolButton_EditInterface = QtGui.QToolButton(self)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.toolButton_EditInterface.sizePolicy().hasHeightForWidth())
        self.toolButton_EditInterface.setSizePolicy(sizePolicy)
        self.toolButton_EditInterface.setObjectName("toolButton_EditInterface")
        self.verticalLayout.addWidget(self.toolButton_EditInterface)
        self.toolButton_EditInterface.setText(
            QtGui.QApplication.translate("Form", "Edit selected interface",
                                         None, QtGui.QApplication.UnicodeUTF8))
        self.toolButton_EditInterface.clicked.connect(
            self._on_edit_interface_clicked)
        self.toolButton_EditInterface.setVisible(False)

        self.toolButton_CreateInterface = QtGui.QToolButton(self)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(1)
        sizePolicy.setHeightForWidth(
            self.toolButton_CreateInterface.sizePolicy().hasHeightForWidth())
        self.toolButton_CreateInterface.setSizePolicy(sizePolicy)
        self.toolButton_CreateInterface.setObjectName(
            "toolButton_CreateInterface")
        self.verticalLayout.addWidget(self.toolButton_CreateInterface)
        self.toolButton_CreateInterface.setText(
            QtGui.QApplication.translate("Form", "Create an interface", None,
                                         QtGui.QApplication.UnicodeUTF8))
        self.toolButton_CreateInterface.clicked.connect(
            self._on_create_interface_clicked)
        self.toolButton_CreateInterface.setVisible(False)

        self.textedit = Editor('', self)
        self.hl = SyncHighlighter(self.textedit.document())
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Expanding)
        self.textedit.setSizePolicy(sizePolicy)
        self.textedit.setObjectName("syncedit")
        self.verticalLayout.addWidget(self.textedit)
        self.textedit.setVisible(False)

        self._fill_interface_thread = None
        self._interfaces_files = None
        self._sync_args = []
        self._interface_filename = None

        self.buttonBox = QtGui.QDialogButtonBox(self)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"),
                               self.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"),
                               self.reject)

        self._new_iface = True
コード例 #14
0
 def add_action(self, key, title, on_trig):
     ac = QtGui.QAction(title, self)  # TODO: tr()?
     self.connect(ac, QtCore.SIGNAL('triggered()'), on_trig)
     self.actions[key] = ac
コード例 #15
0
 def _connect_signals(self, ros):
     QtCore.QObject.connect(self, QtCore.SIGNAL("onHeadingEnable"), ros.onHeadingEnable)  
     self.headingEnable.toggled.connect(lambda state: 
                                        self.emit(QtCore.SIGNAL("onHeadingEnable"), 
                                                  state, 
                                                  self.headingRef.value()))
     QtCore.QObject.connect(self, QtCore.SIGNAL("onManualEnable"), ros.onManualEnable)  
     self.manualEnable.toggled.connect(lambda state: 
                                         self.emit(QtCore.SIGNAL("onManualEnable"), 
                                                   state, self.manualSelection))
     QtCore.QObject.connect(self, QtCore.SIGNAL("onDepthEnable"), ros.onDepthEnable)  
     self.depthEnable.toggled.connect(self._onDepthEnable)
     QtCore.QObject.connect(self, QtCore.SIGNAL("onAltitudeEnable"), ros.onAltitudeEnable)  
     self.altitudeEnable.toggled.connect(self._onAltitudeEnable) 
     QtCore.QObject.connect(self, QtCore.SIGNAL("onDPEnable"), ros.onDPEnable)  
     self.dpEnable.toggled.connect(self._onDpEnable)
     QtCore.QObject.connect(self, QtCore.SIGNAL("onPitchEnable"), ros.onPitchEnable)
     self.pitchEnable.toggled.connect(lambda state: 
                                        self.emit(QtCore.SIGNAL("onPitchEnable"), 
                                        state, 
                                        self.pitchRef.value()))
                                    
     
     QtCore.QObject.connect(self, QtCore.SIGNAL("onHeadingUpdate"), ros.onHeadingUpdate)
     self.headingRef.editingFinished.connect(lambda: 
                                                 self.emit(QtCore.SIGNAL("onHeadingUpdate"), 
                                                 self.headingRef.value()))
     QtCore.QObject.connect(self, QtCore.SIGNAL("onDepthUpdate"), ros.onDepthUpdate)
     self.depthRef.editingFinished.connect(lambda: 
                                                 self.emit(QtCore.SIGNAL("onDepthUpdate"), 
                                                 self.depthRef.value()))
     QtCore.QObject.connect(self, QtCore.SIGNAL("onAltitudeUpdate"), ros.onAltitudeUpdate)
     self.altitudeRef.editingFinished.connect(lambda: 
                                                 self.emit(QtCore.SIGNAL("onAltitudeUpdate"), 
                                                 self.altitudeRef.value()))
     
     QtCore.QObject.connect(self, QtCore.SIGNAL("onMoveBaseRef"), ros.onMoveBaseRef)
     
     self.Stop.clicked.connect(self._onStop)
    
     self.tauRadio.toggled.connect(self._onJoystickRadio)
     self.nuRadio.toggled.connect(self._onJoystickRadio)
     self.relRadio.toggled.connect(self._onJoystickRadio)
     
     self.absRadio.toggled.connect(self._onMoveBaseRadio)
     self.nePosRadio.toggled.connect(self._onMoveBaseRadio)
     self.relPosRadio.toggled.connect(self._onMoveBaseRadio)
     self.northRef.editingFinished.connect(self._onMoveBaseRadio)
     self.eastRef.editingFinished.connect(self._onMoveBaseRadio)
コード例 #16
0
 def _onStateHat(self, data):
     self._stateHat = data;
     self.emit(QtCore.SIGNAL("onStateHat"), data)
コード例 #17
0
 def _connect_signals(self, gui):
     QtCore.QObject.connect(self, 
         QtCore.SIGNAL("onStateHat"), gui.onStateHat)
コード例 #18
0
 def _onDepthEnable(self, state):
     #disable depth
     if self.altitudeEnable.isChecked():
         self.emit(QtCore.SIGNAL("onAltitudeEnable"), False, 0)
         
     self.emit(QtCore.SIGNAL("onDepthEnable"), state, self.depthRef.value())