Beispiel #1
0
 public override void StopWithStatus(MEASURE_STATUS status)
 {
     this.teraDevice.setVoltage(0);
     base.StopWithStatus(status);
     if (DischargeDelay > 0)
     {
         resetTime();
         this.measureThread = new Thread(discharge);
         this.measureThread.Start();
         MeasureTimer.Start();
     }
 }
Beispiel #2
0
 public virtual void StopWithStatus(MEASURE_STATUS status)
 {
     if (Properties.Settings.Default.IsTestApp)
     {
         if (this.stop())
         {
             this.MeasureStatus = status;
         }
         else
         {
             this.MeasureStatus = status;
         }
     }
 }
Beispiel #3
0
        public void updateMeasureStatus(MEASURE_STATUS status) //Для обновления поля результата из другого потока в котором проходит испытание
        {
            if (InvokeRequired)
            {
                BeginInvoke(new updateMeasureStatusDelegate(updateMeasureStatus), new object[] { status });
                return;
            }
            else
            {
                bool isActive = status != MEASURE_STATUS.NOT_STARTED && status != MEASURE_STATUS.FINISHED && status != MEASURE_STATUS.STOPED;
                this.measureStatus.Text           = TeraMeasure.StatusString(status);
                this.startHandMeasureBut.Enabled  = !(status == MEASURE_STATUS.DISCHARGE);
                this.measureIsActive              = isActive;
                this.measureSettingsGroup.Enabled = !isActive;
                autoCorrCb.Enabled = this.comboBoxResistance.Enabled = this.teraEtalonMapComboBox.Enabled = this.comboBoxMode.Enabled = !isActive;

                startHandMeasureBut.Text = !isActive ? "ПУСК ИЗМЕРЕНИЯ" : "ОСТАНОВИТЬ ИЗМЕРЕНИЯ";
            }
        }
Beispiel #4
0
        public static string StatusString(MEASURE_STATUS sts)
        {
            switch (sts)
            {
            case MEASURE_STATUS.POLAR:
                return("Поляризация");

            case MEASURE_STATUS.DISCHARGE:
                return("Деполяризация");

            case MEASURE_STATUS.FINISHED:
                return("Измерение завершено");

            case MEASURE_STATUS.IS_GOING:
                return("Идёт измерение");

            case MEASURE_STATUS.STOPED:
                return("Остановлено");

            case MEASURE_STATUS.NOT_STARTED:
            default:
                return("Не начато");
            }
        }
Beispiel #5
0
        private void discharge()
        {
            this.teraDevice.setVoltage(0);
            if (this.DischargeDelay == 0)
            {
                return;
            }
            resetTime();
            MEASURE_STATUS was = MeasureStatus;

            this.MeasureStatus = MEASURE_STATUS.DISCHARGE;
            do
            {
            } while (DischargeDelay > measSeconds);
            resetTime();
            if (was == MEASURE_STATUS.STOPED)
            {
                this.MeasureStatus = MEASURE_STATUS.STOPED;
            }
            else if (was == MEASURE_STATUS.DISCHARGE)
            {
                this.MeasureStatus = MEASURE_STATUS.FINISHED;
            }
        }