Beispiel #1
0
        public bool Start(object args = null)
        {
            if (Rtc.CtlGetStatus(RtcStatus.Busy))
            {
                Logger.Log(Logger.Type.Error, $"marker [{this.Index}]: busy now !");
                return(false);
            }
            if (!Rtc.CtlGetStatus(RtcStatus.PowerOK))
            {
                Logger.Log(Logger.Type.Error, $"marker [{this.Index}]: rtc scanner supply power is not ok !");
                return(false);
            }
            if (!Rtc.CtlGetStatus(RtcStatus.PositionAckOK))
            {
                Logger.Log(Logger.Type.Error, $"marker [{this.Index}]: rtc scanner position ack is not ok !");
                return(false);
            }
            if (!Rtc.CtlGetStatus(RtcStatus.NoError))
            {
                Logger.Log(Logger.Type.Error, $"marker [{this.Index}]: rtc has a internal problem !");
                return(false);
            }
            if (Laser.IsError)
            {
                Logger.Log(Logger.Type.Error, $"marker [{this.Index}]: laser source has a error status !");
                return(false);
            }
            if (null != this.thread && this.thread.IsAlive)
            {
                return(false);
            }
            if (this.offsets.Count <= 0)
            {
                this.offsets.Add(Offset.Zero);
                Logger.Log(Logger.Type.Warn, $"marker [{this.Index}]: no offset information ...");
            }
            if (null == this.clonedDoc || 0 == this.clonedDoc.Layers.Count)
            {
                Logger.Log(Logger.Type.Error, $"marker [{this.Index}]: document doesn't has any layers");
                return(false);
            }

            timer = Stopwatch.StartNew();
            this.OnProgress?.Invoke(this, 0);
            this.IsFinished      = false;
            this.thread          = new Thread(this.WorkerThread);
            this.thread.Name     = $"Marker: {this.Name}";
            this.thread.Priority = ThreadPriority.AboveNormal;
            this.thread.Start();
            return(true);
        }
Beispiel #2
0
 private bool PostWork()
 {
     Rtc.ListEnd();
     if (!Rtc.CtlGetStatus(RtcStatus.Aborted))
     {
         Rtc.ListExecute(true);
     }
     /// 가공완료
     timer.Stop();
     this.ElaspedTime = timer.Elapsed;
     this.IsFinished  = true;
     this.OnProgress?.Invoke(this, 100);
     this.OnFinished?.Invoke(this, this.ElaspedTime);
     Logger.Log(Logger.Type.Info, $"marker [{this.Index}]: job finished. time= {this.ElaspedTime.TotalSeconds:F3}s");
     return(true);
 }