private bool IsListReady(uint count) { if (this.CtlGetStatus(RtcStatus.Aborted)) { return(false); } const uint RTC6_LIST_BUFFER_MAX = 4000; if ((this.listCount + count) >= RTC6_LIST_BUFFER_MAX) { uint busy, position; busy = position = 0; RTC6Wrap.n_get_status(this.Index + 1, out busy, out position); if (0 != busy) { RTC6Wrap.n_set_end_of_list(this.Index + 1); RTC6Wrap.n_execute_list(this.Index + 1, this.listIndex); this.listIndex = this.listIndex ^ 0x03; RTC6Wrap.n_set_start_list(this.Index + 1, this.listIndex); } else { RTC6Wrap.n_set_end_of_list(this.Index + 1); if (this.CtlGetStatus(RtcStatus.Aborted)) { return(false); } RTC6Wrap.n_auto_change(this.Index + 1); uint readStatus = 0; switch (this.listIndex) { case 1: do { readStatus = RTC6Wrap.n_read_status(this.Index + 1); System.Threading.Thread.Sleep(1); }while (Convert.ToBoolean(readStatus & 0x20)); break; case 2: do { readStatus = RTC6Wrap.n_read_status(this.Index + 1); System.Threading.Thread.Sleep(1); }while (Convert.ToBoolean(readStatus & 0x10)); break; } if (this.CtlGetStatus(RtcStatus.Aborted)) { return(false); } this.listIndex = this.listIndex ^ 0x03; RTC6Wrap.n_set_start_list(this.Index + 1, this.listIndex); } this.listCount = count; } this.listCount += count; return(true); }
public bool CtlFrequency(double frequency, double pulseWidth) { if (this.CtlGetStatus(RtcStatus.Busy)) { return(false); } double period = 1.0f / frequency * (double)1.0e6; double halfPeriod = period / 2.0f; RTC6Wrap.n_set_start_list(this.Index + 1, 1); RTC6Wrap.n_set_laser_timing(this.Index + 1, (uint)(halfPeriod * 64.0), (uint)(pulseWidth * 64.0), 0, 0); RTC6Wrap.n_set_end_of_list(this.Index + 1); RTC6Wrap.n_execute_list(this.Index + 1, 1); this.CtlBusyWait(); return(true); }
public bool CtlDelay(double laserOn, double laserOff, double scannerJump, double scannerMark, double scannerPolygon) { if (this.CtlGetStatus(RtcStatus.Busy)) { return(false); } RTC6Wrap.n_set_start_list(this.Index + 1, 1); RTC6Wrap.n_set_scanner_delays(this.Index + 1, (uint)(scannerJump / 10.0), (uint)(scannerMark / 10.0), (uint)(scannerPolygon / 10.0) ); RTC6Wrap.n_set_laser_delays(this.Index + 1, (int)(laserOn * 64.0), (uint)(laserOff * 64.0) ); RTC6Wrap.n_set_end_of_list(this.Index + 1); RTC6Wrap.n_execute_list(this.Index + 1, 1); this.CtlBusyWait(); return(true); }