public ClientDialogModelBase(ISensorHistoryConnector connector, MonitoringSensorViewModel sensor)
 {
     _path      = sensor.Path;
     _connector = connector;
     _name      = sensor.Name;
     _product   = sensor.Product;
 }
Exemplo n.º 2
0
 protected ClientBarSensorModel(ISensorHistoryConnector connector, MonitoringSensorViewModel sensor) : base(connector, sensor)
 {
     Items = new Collection <BoxPlotItem>();
     //Points = new Collection<OhlcPoint>();
     Labels = new Collection <string>();
     Count  = 5;
     Title  = _path;
 }
 protected ClientDialogTimerModel(ISensorHistoryConnector connector, MonitoringSensorViewModel sensor,
                                  int timerInterval = 5000) : base(connector, sensor)
 {
     _interval          = timerInterval;
     _continue          = true;
     _dialogTimerThread = new Thread(Timer_Loop);
     _dialogTimerThread.Start();
 }
Exemplo n.º 4
0
 public ISensorDialogModel ConstructModel(MonitoringSensorViewModel sensor)
 {
     try
     {
         if (_sensorModelType.ContainsKey(sensor.SensorType))
         {
             if (_sensorModelType[sensor.SensorType] != typeof(object))
             {
                 return(Activator.CreateInstance(_sensorModelType[sensor.SensorType], _connector, sensor) as ISensorDialogModel);
             }
         }
     }
     catch (Exception e)
     {
         Logger.Error($"Failed to create model instance: {e}");
     }
     return(new ClientDefaultValuesListSensorModel(_connector, sensor));
 }
        public void Expand(MonitoringSensorViewModel sensor)
        {
            SensorControl         view     = null;
            DialogSensorViewTypes VVMTypes = _typeToDialogDictionary[sensor.SensorType];

            object viewObj = Activator.CreateInstance(VVMTypes.ViewType);

            view = viewObj as SensorControl;

            ISensorDialogModel model     = _factory.ConstructModel(sensor);
            DialogViewModel    viewModel = null;

            if (view != null)
            {
                if (VVMTypes.ViewModelType != null)
                {
                    object viewModelObj = Activator.CreateInstance(VVMTypes.ViewModelType, model);
                    viewModel = viewModelObj as DialogViewModel;
                }
                else
                {
                    viewModel = view.ConstructDefaultViewModel(model);
                }
            }
            else
            {
                view      = new DefaultValuesListSensorView();
                viewModel = new DefaultValuesListSensorViewModel(model);
            }

            if (VVMTypes.ViewType != typeof(object))
            {
                string       title = $"{sensor.Product}/{sensor.Path}";
                DialogWindow dw    = new DialogWindow(view, viewModel, title);
                dw.Show();
            }
        }
 public ClientDefaultValuesListSensorModel(ISensorHistoryConnector connector,
                                           MonitoringSensorViewModel sensor) : base(connector, sensor)
 {
     List = new ObservableCollection <DefaultSensorModel>();
     List.CollectionChanged += List_CollectionChanged;
 }
 public ClientFileSensorModel(ISensorHistoryConnector connector, MonitoringSensorViewModel sensor) : base(connector, sensor)
 {
     _folderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, _filesFolderName);
     _viewModel  = sensor;
     ThreadPool.QueueUserWorkItem(_ => ExpandValue());
 }
 public ClientIntBarSensorModel(ISensorHistoryConnector connector, MonitoringSensorViewModel sensor) : base(connector, sensor)
 {
 }
 public ClientDoubleTimeValueModel(ISensorHistoryConnector connector, MonitoringSensorViewModel sensor)
     : base(connector, sensor)
 {
 }