コード例 #1
0
ファイル: motor_axis.py プロジェクト: H-Y-S/diff_control
    def __init__(self):
        # initialize the axes
        self.mAxRot = MotorAxis(3)
        self.mAxZ = MotorAxis(2)
        self.mAxY = MotorAxis(1)

        # enable motor movement
        can_control.enableMotors()

        self.builder = gtk.Builder()
        self.builder.add_from_file("can_test.glade")
        self.builder.connect_signals(self)        
        self.read_values_from_canbus()
コード例 #2
0
ファイル: motor_axis.py プロジェクト: H-Y-S/diff_control
    def __init__(self):
        # initialize the axes
        self.mAxRot = MotorAxis(3)
        self.mAxZ = MotorAxis(2)
        self.mAxY = MotorAxis(1)

        # enable motor movement
        can_control.enableMotors()

        self.builder = gtk.Builder()
        self.builder.add_from_file("can_test.glade")
        self.builder.connect_signals(self)
        self.read_values_from_canbus()
コード例 #3
0
ファイル: diff_control.py プロジェクト: H-Y-S/diff_control
    def __init__(self):

        if USE_MOTORS:
            self.mZAxis = MotorAxis(2)
            self.mYAxis = MotorAxis(1)
            self.mRotAxis = MotorAxis(3)
            can_control.enableMotors()

        self.MOTOR1_MAPPINGS = [
            self.mZAxis, self.mYAxis, self.mRotAxis, self.mZAxis,
            self.mRotAxis, self.mZAxis
        ]
        self.MOTOR2_MAPPINGS = [
            None, None, None, self.mYAxis, self.mZAxis, self.mRotAxis
        ]

        self.builder = gtk.Builder()
        self.builder.add_from_file("diff_control.glade")
        self.init_values()  # init values before connecting the fields

        self.builder.connect_signals(self)
        self.mScanRunning = False

        for i in NUM_SIGNED_FLOAT_FIELD_NAMES:
            entry = self.builder.get_object(i)
            self.numerify_float_signed(entry)

        for i in NUM_FLOAT_FIELD_NAMES:
            entry = self.builder.get_object(i)
            self.numerify_float(entry)

        for i in NUM_INTEGER_FIELD_NAMES:
            entry = self.builder.get_object(i)
            self.numerify_integer(entry)

        entry = self.builder.get_object('acq_filename_entry')
        self.constrain_filename(entry)
        self.update_view()
        self.mLastLoadedConfigFileName = ''

        # if threads do not wor, pygtk may have been compiled without thread support
        #        gtk.gdk.threads_init() # Needed for pygtk and threads to work and able to touch GUI
        gobject.threads_init()  # Alternatively, threads do not touch GUI
コード例 #4
0
ファイル: diff_control.py プロジェクト: H-Y-S/diff_control
    def __init__(self):

        if USE_MOTORS :
            self.mZAxis = MotorAxis(2)
            self.mYAxis = MotorAxis(1)
            self.mRotAxis = MotorAxis(3)
            can_control.enableMotors()

        self.MOTOR1_MAPPINGS = [self.mZAxis, self.mYAxis, self.mRotAxis, self.mZAxis, self.mRotAxis, self.mZAxis]
        self.MOTOR2_MAPPINGS = [None,None,None,self.mYAxis,self.mZAxis,self.mRotAxis]

        self.builder = gtk.Builder()
        self.builder.add_from_file("diff_control.glade")
        self.init_values() # init values before connecting the fields
        
        self.builder.connect_signals(self)
        self.mScanRunning = False
        
        for i in NUM_SIGNED_FLOAT_FIELD_NAMES:
            entry = self.builder.get_object(i)
            self.numerify_float_signed(entry)

        for i in NUM_FLOAT_FIELD_NAMES:
            entry = self.builder.get_object(i)
            self.numerify_float(entry)

        for i in NUM_INTEGER_FIELD_NAMES:
            entry = self.builder.get_object(i)
            self.numerify_integer(entry)

        entry = self.builder.get_object('acq_filename_entry')
        self.constrain_filename(entry)
        self.update_view()
        self.mLastLoadedConfigFileName = ''
        
        # if threads do not wor, pygtk may have been compiled without thread support
#        gtk.gdk.threads_init() # Needed for pygtk and threads to work and able to touch GUI
        gobject.threads_init() # Alternatively, threads do not touch GUI