Пример #1
0
        private void FireNotificationEvent(HWWarningReason Warning, HWFaultReason Fault, HWDisableReason Disable)
        {
            SystemHost.Journal.AppendLog(ComplexParts.DvDt, LogMessageType.Warning,
                                         string.Format(
                                             "dVdt device notification: problem None, warning {0}, fault {1}, disable {2}",
                                             Warning, Fault, Disable));

            m_Communication.PostdVdtNotificationEvent(Warning, Fault, Disable);
        }
Пример #2
0
        private void MeasurementLogicRoutine(Types.Commutation.TestParameters Commutation)
        {
            try
            {
                _State = DeviceState.InProcess;
                CallAction(ACT_CLEAR_WARNING);
                FireTOUEvent(_State, _Result);

                if (_IsTOUEmulation)
                {
                    Random rand = new Random(DateTime.Now.Millisecond);

                    var randValue = rand.Next(0, 2);

                    //if (randValue == 0)
                    //{
                    //    _State = DeviceState.Problem;
                    //    Thread.Sleep(500);
                    //    //проверяем отображение Problem, Warning, Fault
                    //    FireNotificationEvent(HWProblemReason.None, HWWarningReason.AnperageOutOfRange, HWFaultReason.NoPotensialSignal, HWDisableReason.None);
                    //    Thread.Sleep(500);
                    //    FireTOUEvent(_State, _Result);
                    //}
                    //else
                    //{
                    //Как в RAC проверка ошибок
                    Thread.Sleep(500);
                    FireNotificationEvent(HWProblemReason.None, HWWarningReason.CurrentOutOfRange, HWFaultReason.None, HWDisableReason.None);
                    Thread.Sleep(500);
                    FireNotificationEvent(HWProblemReason.None, HWWarningReason.None, HWFaultReason.Overflow90, HWDisableReason.None);
                    Thread.Sleep(500);
                    _Result.ITM = (float)rand.NextDouble() * 1000;
                    _Result.TGD = (float)rand.NextDouble() * 1000;
                    _Result.TGT = (float)rand.NextDouble() * 1000;
                    _State      = DeviceState.Success;
                    FireTOUEvent(_State, _Result);
                    //}
                }
                else
                {
                    if (ActiveCommutation.Switch(Types.Commutation.CommutationMode.TOU, Commutation.CommutationType, Commutation.Position) == DeviceState.Fault)
                    {
                        _State = DeviceState.Fault;
                        FireTOUEvent(_State, _Result);
                        return;
                    }

                    WriteRegister(REG_CURRENT_VALUE, _Parameters.CurrentAmplitude);
                    CallAction(ACT_START_TEST);
                    WaitState(HWDeviceState.Ready);

                    ushort finish = ReadRegister(REG_TEST_FINISHED);
                    _Result.ITM = ReadRegister(REG_MEAS_CURRENT_VALUE);
                    _Result.TGD = ReadRegister(REG_MEAS_TIME_DELAY);
                    _Result.TGT = ReadRegister(REG_MEAS_TIME_ON);

                    _State = DeviceState.Success;
                    FireTOUEvent(_State, _Result);
                    if (finish != OPRESULT_OK)
                    {
                        HWFaultReason   faultReason   = (HWFaultReason)ReadRegister(REG_PROBLEM);
                        HWWarningReason warningReason = (HWWarningReason)ReadRegister(REG_WARNING);
                        FireNotificationEvent(HWProblemReason.None, warningReason, faultReason, HWDisableReason.None);
                    }

                    //по окончании процесса измерения - отключаем коммутацию
                    if (ActiveCommutation.Switch(Types.Commutation.CommutationMode.None) == DeviceState.Fault)
                    {
                        _State = DeviceState.Fault;
                        FireTOUEvent(_State, _Result);
                        return;
                    }
                }
            }

            catch (Exception ex)
            {
                ActiveCommutation.Switch(Types.Commutation.CommutationMode.None);
                _State = DeviceState.Fault;
                FireTOUEvent(_State, _Result);
                FireExceptionEvent(ex.Message);

                throw;
            }
        }
Пример #3
0
        private void FireNotificationEvent(HWProblemReason problem, HWWarningReason warning, HWFaultReason fault, HWDisableReason disable)
        {
            SystemHost.Journal.AppendLog(ComplexParts.TOU, LogMessageType.Warning,
                                         string.Format(
                                             "TOU device notification: problem None, warning {0}, fault {1}, disable {2}",
                                             warning, fault, disable));

            _Communication.PostTOUNotificationEvent((ushort)problem, (ushort)warning, (ushort)fault, (ushort)disable);
        }
Пример #4
0
        private void FireNotificationEvent(HWWarningReason Warning, HWProblemReason Problem, HWFaultReason Fault)
        {
            SystemHost.Journal.AppendLog(ComplexParts.Clamping, LogMessageType.Warning, string.Format("Clamping device notification: warning {0}, problem {1}, fault {2}", Warning, Problem, Fault));

            m_Communication.PostClampingNotificationEvent(Warning, Problem, Fault);
        }