Ejemplo n.º 1
0
        public void createCycle()
        {
            this.mStepSize = this.mTurnableMonitor.getStep();
            this.mXRayZPos = this.mTurnableMonitor.getXRayZPos();
            this.mDetYPos  = this.mTurnableMonitor.getDetYPos();
            this.mDetZPos  = this.mTurnableMonitor.getDetZPos();


            this.mTotalRotation = this.mTurnableMonitor.getTotalRotation();
            this.mSampleType    = this.mTurnableMonitor.getSampleType();
            if (this.mSampleType != TurnableMonitor.SampleType.SMALL)
            {
                if ((this.mXRayZPos < 0) || (this.mXRayZPos < 0) || (this.mXRayZPos < 0))
                {
                    this.mNotificationManager.ShowError("Không thể khởi tạo chu trình!!! \nVui lòng kiểm tra lại tham số cấu hình chu trình!");
                    return;
                }
            }
            Logger.Info("====>Create Cycle: step size = {0}, XRayZPos = {1}, total rotation = {2}, DetYPos = {3}, mDetZPos = {4} | [{5}]",
                        this.mTurnableMonitor.getStep(), this.mTurnableMonitor.getXRayZPos(), this.mTurnableMonitor.getTotalRotation(),
                        this.mTurnableMonitor.getDetYPos(), this.mTurnableMonitor.getDetZPos(), this.mSampleType);
            var task = Task.Run(() =>
            {
                this.createCycleProcess();
            });
        }
Ejemplo n.º 2
0
        public bool createCycleProcess()
        {
            bool res = false;

            if (this.mState != CycleState.IDILE)
            {
                return(res);
            }
            TurnableMonitor.SampleType sampleType = this.mSampleType;
            this.mState = CycleState.INITIALIZING;


            switch (sampleType)
            {
            case TurnableMonitor.SampleType.SMALL:
            {
                res = this.createCycleProcessForSmallSample();
                break;
            }

            case TurnableMonitor.SampleType.MIDDLE:
            {
                res = this.createCycleProcessForMiddleSample();
                break;
            }

            case TurnableMonitor.SampleType.BIG:
            {
                res = this.createCycleProcessForBigSample();
                break;
            }

            default:
            {
                break;
            }
            }

            if (res == false)
            {
                this.mCycleTasks.Clear();
                this.mState = CycleState.DONE;
            }
            else
            {
                this.mState = CycleState.INITIALIZED;
            }
            this.mNotificationManager.ShowInformation("Finish Init Cycle");
            return(res);
        }