コード例 #1
0
 public RelayTestTools(IPressSystem psys, int outChannelPsys, IStateRelayReader stateRelayReader,
                       IRelayDevice relayDevice)
 {
     this.psys                        = psys;
     this.outChannelPsys              = outChannelPsys;
     this.stateRelayReader            = stateRelayReader;
     this.relayDevice                 = relayDevice;
     stateRelayReader.StateReadEvent += (o, e) => updateStateRelayAutoReset.Set();
 }
コード例 #2
0
 public DigitalPdSimulator(IPressSystem pressSystem, double rangeMin, double rangeMax, double precision, bool absoluteType)
 {
     this.pressSystem  = pressSystem;
     this.rangeMin     = rangeMin;
     this.rangeMax     = rangeMax;
     this.precision    = precision;
     this.absoluteType = absoluteType;
     random            = new Random();
 }
コード例 #3
0
        public void Init(IDialogService dialogService)
        {
            try
            {
                this.dialogService = dialogService;
                if (!CheckMetrologicPart())
                {
                    this.dialogService.ErrorMessage("Внимание! Метрологически значимая часть была изменена. " +
                                                    "Для получения более подробной информации откройте меню \"О программе\"");
                }
                Exception = null;
                var psysCommands = new PsysCommandSimulator();
                // var psysCommands = new Commands(Settings.PsysSettings.IP, 49002);
                psys = new PressSystem(psysCommands, Settings.PsysSettings.MaxTimeSetPressure);
                SystemStatus.Init(Settings);
                psys.ExceptionEvent    += Exception_psys_event;
                psys.ConnectEvent      += SystemStatus.PressSysten_ConnectEvent;
                psys.DisconnectEvent   += SystemStatus.PressSystemDisconnectEvent;
                psys.BeginConnectEvent += SystemStatus.PressSystem_BeginConnectEvent;
                metrologicGroups        = new MetrologicGroups(Settings.JsonReportSettings.StandId);
                savingResults           = new SavingResults(Settings, SystemStatus);
                remoteControl?.Dispose();

                if (!Settings.UsedRemoteControl)
                {
                    processErrorHandler = new ErrorHandler(Settings, SystemStatus, dialogService);
                    ReadPsysInfo();
                }
                else
                {
                    processErrorHandler = new ErrorHandlerRemoteControlMode(Settings, SystemStatus);
                    if (Settings.RemoteControlVer == "v2.0")
                    {
                        remoteControl = new RemoteControl(this, Settings.RemoteControlIp, 49003, System.Text.Encoding.UTF8, metrologicGroups);
                    }
                    else
                    {
                        remoteControl = new RemoteControl(this, Settings.RemoteControlIp, 49003, System.Text.Encoding.Unicode, metrologicGroups);
                    }
                    remoteControl.StartListening();
                }
                // throw new Exception();
            }
            catch (PressSystemException ex)
            {
                Exception = ex;
                dialogService.ErrorMessage("Не удалось установить связь со стойкой давления по запросу. Проверьте состояние ее готовности  " +
                                           "и нажмите кнопку \"Установить связь со стойкой давления\". Или измените настройки в меню \"Система\"");
            }
            catch (Exception ex)
            {
                Exception = ex;
                dialogService.ErrorMessage(ex.Message);
            }
        }
コード例 #4
0
 public CurrentMeasurmentTools(IPressSystem psys, int outChannelPsys, IAmmetr ammeter) : base(psys, outChannelPsys)
 {
     this.ammeter              = ammeter;
     updCurrentValueAutoReset  = new AutoResetEvent(false);
     ammeter.UpdMeasureResult += (obj, e) => updCurrentValueAutoReset.Set();
 }
コード例 #5
0
 public MeasurmendIndicator(IPressSystem psys, bool absolutePressure)
     : this(null, psys, absolutePressure)
 {
 }
コード例 #6
0
 public MeasurmendIndicator(IAmmetr ammetr, IPressSystem psys, bool absolutePressure)
 {
     this.ammetr           = ammetr;
     this.psys             = psys;
     this.absolutePressure = absolutePressure;
 }
コード例 #7
0
 public AbstractMeasurmentTools(IPressSystem psys, int outChannelPsys)
 {
     this.psys           = psys;
     this.outChannelPsys = outChannelPsys;
 }
コード例 #8
0
 public DigitalMeasurmentTools(IPressSystem psys, int outChannelPsys, IDigitalPort digitalPort) :
     base(psys, outChannelPsys)
 {
     this.digitalPort = digitalPort;
 }