public DataListViewModel() { _config = new ConfigParams(); _server = new IoTServer(_config.IpAddress, _config.IpPort); _dataList = null; StartCommand = new ConfigButtonCommand(StartTransfer); StopCommand = new ConfigButtonCommand(StopTransfer); }
public ConfigViewModel() { ipAddress = config.IpAddress; ipPort = config.IpPort; sampleTime = config.SampleTime; maxSamples = config.MaxSamples; apiVersion = config.ApiVersion; SaveButton = new ConfigButtonCommand(SaveSettings); DefaultButton = new ConfigButtonCommand(DefaultSettings); }
public JoystickViewModel() { _isListening = false; _config = new ConfigParams(); _server = new IoTServer(_config.IpAddress, _config.IpPort); StartCommand = new ConfigButtonCommand(StartListening); StopCommand = new ConfigButtonCommand(StopListening); UpColor = Brushes.LightGray; LeftColor = Brushes.LightGray; MiddleColor = Brushes.LightGray; RightColor = Brushes.LightGray; DownColor = Brushes.LightGray; }
public ChartsViewModel() { #region ChartsInitialization TemperaturePlotModel = new PlotModel { Title = "Temperature data chart" }; HumidityPlotModel = new PlotModel { Title = "Humidity data chart" }; PressurePlotModel = new PlotModel { Title = "Pressure data chart" }; TemperaturePlotModel.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = Config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); TemperaturePlotModel.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 0, Maximum = 40, Key = "Vertical", Unit = "C", Title = "Temperature Value" }); TemperaturePlotModel.Series.Add(new LineSeries() { Title = "Temperature data series", Color = OxyColor.Parse("#FFFF0000") }); HumidityPlotModel.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = Config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); HumidityPlotModel.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 0, Maximum = 100, Key = "Vertical", Unit = "%", Title = "Humidity Value" }); HumidityPlotModel.Series.Add(new LineSeries() { Title = "Humidity data series", Color = OxyColor.Parse("#FF0000FF") }); PressurePlotModel.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = Config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); PressurePlotModel.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 900, Maximum = 1100, Key = "Vertical", Unit = "hPa", Title = "Pressure Value" }); PressurePlotModel.Series.Add(new LineSeries() { Title = "Pressure data series", Color = OxyColor.Parse("#FF00FF00") }); #endregion StartButton = new ConfigButtonCommand(StartTimer); StopButton = new ConfigButtonCommand(StopTimer); ipAdress = Config.IpAddress; ipPort = Config.IpPort; Server = new IoTServer(ipAdress, ipPort); }