def on_enableAxis_click(self): if not self.axis_enabled: self.axis_enabled = True acsc.enable(self.hcomm, self.axis, acsc.SYNCHRONOUS) self.ui.enableAxis.setText("Disable") else: self.axis_enabled = False acsc.disable(self.hcomm, self.axis, acsc.SYNCHRONOUS) self.ui.enableAxis.setText("Enable")
def run(self): """Start the run. Comms should be open already with the controller.""" if acsc.getOutput(self.hc, 1, 16): acsc.setOutput(self.hc, 1, 16, 0) if self.vectrino: acsc.enable(self.hc, 0) acsc.enable(self.hc, 1) while not acsc.getMotorState(self.hc, 0)["enabled"] or not \ acsc.getMotorState(self.hc, 1)["enabled"]: self.msleep(100) acsc.toPoint(self.hc, None, 0, self.y_R * self.R) acsc.toPoint(self.hc, None, 1, self.z_H * self.H) while not acsc.getMotorState(self.hc, 0)["in position"] or not \ acsc.getMotorState(self.hc, 1)["in position"]: self.msleep(300) print("y- and z-axes in position") acsc.disable(self.hc, 0) acsc.disable(self.hc, 1) self.vec.serial_port = "COM2" self.vec.connect() tstart = time.time() self.timeout = False self.vecstatus = "Connecting to Vectrino..." while not self.vec.connected: self.msleep(300) if time.time() - tstart > 10: print("Vectrino timed out") self.timeout = True break if not self.timeout: self.vec.stop() self.setvecconfig() if self.recordvno: self.vec.start_disk_recording(self.vecsavepath) self.vec.start() self.vecstatus = "Vectrino connected " while self.vec.state != "Confirmation mode": self.msleep(100) print("Vectrino in data collection mode") print("Waiting 6 seconds") self.sleep(6) self.daqthread.start() if self.fbg: self.fbgthread.start() self.start_motion() elif self.nidaq: self.daqthread.start() if self.fbg: self.fbgthread.start() self.start_motion() else: # Start motion self.start_motion()
def run(self): """Start the run. Comms should be open already with the controller.""" if acsc.getOutput(self.hc, 1, 16): acsc.setOutput(self.hc, 1, 16, 0) if self.vectrino: acsc.enable(self.hc, 0) acsc.enable(self.hc, 1) while not acsc.getMotorState(self.hc, 0)["enabled"] or not \ acsc.getMotorState(self.hc, 1)["enabled"]: self.msleep(100) acsc.toPoint(self.hc, None, 0, self.y_R*self.R) acsc.toPoint(self.hc, None, 1, self.z_H*self.H) while not acsc.getMotorState(self.hc, 0)["in position"] or not \ acsc.getMotorState(self.hc, 1)["in position"]: self.msleep(300) print("y- and z-axes in position") acsc.disable(self.hc, 0) acsc.disable(self.hc, 1) self.vec.serial_port = "COM2" self.vec.connect() tstart = time.time() self.timeout = False self.vecstatus = "Connecting to Vectrino..." while not self.vec.connected: self.msleep(300) if time.time() - tstart > 10: print("Vectrino timed out") self.timeout = True break if not self.timeout: self.vec.stop() self.setvecconfig() if self.recordvno: self.vec.start_disk_recording(self.vecsavepath) self.vec.start() self.vecstatus = "Vectrino connected " while self.vec.state != "Confirmation mode": self.msleep(100) print("Vectrino in data collection mode") print("Waiting 6 seconds") self.sleep(6) self.daqthread.start() if self.fbg: self.fbgthread.start() self.start_motion() elif self.nidaq: self.daqthread.start() if self.fbg: self.fbgthread.start() self.start_motion() else: # Start motion self.start_motion()
def disable_axis(self, axis, wait=acsc.SYNCHRONOUS): if axis in self.axisdefs: axis = self.axisdefs[axis] acsc.disable(self.hc, axis, wait)
def disable(self, wait=acsc.SYNCHRONOUS): acsc.disable(self.controller.hc, self.axisno, wait)