Beispiel #1
0
        public bool ListPower(IRtc rtc, Pen pen)
        {
            if (this.IsError)
            {
                return(false);
            }
            bool success = true;

            if (pen.Power == this.CurrentPowerWatt)
            {
                return(true);
            }
            this.LookUpPowerX(pen.Power, out float powerX);
            success &= rtc.ListLaserControl(powerX);
            if (this.PowerXFactor == PowerXFactor.ByUser)
            {
                //rs-232 or tcp/ip 통신을 사용한다면
                //rtc의 버퍼에 저장된 모든 명령이 실행되기를 기다린후
                //레이저 소스의 출력을 변경하고
                //다시 rtc 명령버퍼를 시작한다.
                // 아래와 같다.


                //success &= rtc.ListEnd();
                //success &= rtc.ListExecute(true);
                //if (!success)
                //    return false;

                //통신 명령을 통한 레이저 소스 출력 변경
                //변경이 완료되기를 대기

                //rtc 버퍼 명령 삽입 시작
                //success &= rtc.ListBegin(this);
            }
            if (success)
            {
                this.CurrentPowerWatt = pen.Power;
                this.CurrentPowerX    = powerX;
                this.CurrentPen       = pen;
            }
            return(success);
        }