Exemplo n.º 1
0
 public static bool IsEqualTo(this IPsnChannel channel1, IPsnChannel channel2)
 {
     if (channel1.CanBeFaultSign != channel2.CanBeFaultSign)
     {
         return(false);
     }
     //if (channel1.End != channel2.End) return false;
     if (channel1.IsEnabled != channel2.IsEnabled)
     {
         return(false);
     }
     if (channel1.IsFaultSign != channel2.IsFaultSign)
     {
         return(false);
     }
     if (channel1.IsInput != channel2.IsInput)
     {
         return(false);
     }
     if (channel1.Name != channel2.Name)
     {
         return(false);
     }
     //if (channel1.Start != channel2.Start) return false;
     if (channel1.Type != channel2.Type)
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 2
0
        public PsnSignalViewModel(IPsnChannel model)
        {
            _model = model;
            _isTrendLoadInProgress = false;

            _cmdLoadTrend = new DependedCommand(() =>
            {
                IsTrendLoadInProgress = true;

                _model.LoadTrendAsync(ea => {
                    MessageSystem.ShowMessage(ea.Message);

                    switch (ea.ResultCode)
                    {
                    case OnCompleteEventArgs.CompleteResult.Ok:
                        MessageSystem.ShowMessage("DataPoints count: " + _model.Trend.Count);
                        IsTrendLoadInProgress = false;
                        return;

                    case OnCompleteEventArgs.CompleteResult.Error:
                        IsTrendLoadInProgress = false;
                        return;
                    }
                });
            }, () => !IsTrendLoadInProgress);
            _cmdLoadTrend.AddDependOnProp(this, "IsTrendLoadInProgress");


            _cmdUnloadTrend = new DependedCommand(() => _model.FreeTrend(), () => true);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Создаёт новый экземпляр класса
 /// </summary>
 /// <param name="channel">Ассоциируемый канал</param>
 /// <param name="data">Данные канала</param>
 public PsnChannelCurrentData(IPsnChannel channel, double data)
 {
     _channel = channel;
     Data     = data;
 }
Exemplo n.º 4
0
 public PsnChannelViewModel(IPsnChannel psnChannel, TrendChartType trendChartType)
 {
     _psnChannel    = psnChannel;
     TrendChartType = trendChartType;
 }
Exemplo n.º 5
0
 public PsnChannelViewModel(IPsnChannel psnChannel, PsnMeterViewModel parentMeter)
 {
     this.psnChannel = psnChannel;
     ParentMeter     = parentMeter;
 }