private void UpdateConfigT() { if (RequestTimerTemp != null) { StopTimerTemp(); } if (RequestTimerPress != null) { StopTimerPress(); } if (RequestTimerHumid != null) { StopTimerHumid(); } config = new ConfigParams(ipAddress, sampleTime, maxSampleNumber); Server = new IoTServer(IpAddress); if (RequestTimerTemp != null) { StartTimerTemp(); } if (RequestTimerPress != null) { StartTimerPress(); } if (RequestTimerHumid != null) { StartTimerHumid(); } }
private void UpdateConfigOrT() { if (RequestTimerRPY != null) { StopTimerRPY(); } if (RequestTimerRPY1 != null) { StopTimerRPY1(); } if (RequestTimerRPY2 != null) { StopTimerRPY2(); } config = new ConfigParams(ipAddress, sampleTime, maxSampleNumber); Server = new IoTServer(IpAddress); if (RequestTimerRPY != null) { StartTimerRPY(); } if (RequestTimerRPY1 != null) { StartTimerRPY1(); } if (RequestTimerRPY2 != null) { StartTimerRPY2(); } }
/** * @brief Configuration parameters defualt values */ private void DefaultConfig() { config = new ConfigParams(); IpAddress = config.IpAddress; SampleTime = config.SampleTime.ToString(); MaxSampleNumber = config.MaxSampleNumber.ToString(); Server = new IoTServer(IpAddress); }
public DataListViewModel() { _config = new ConfigParams(); _server = new IoTServer(_config.IpAddress, _config.IpPort); _dataList = null; StartCommand = new ConfigButtonCommand(StartTransfer); StopCommand = new ConfigButtonCommand(StopTransfer); }
private void PrepareServer() { this.IoTDev01 = new IoTDevice("IoT - 01"); this.IoTDev02 = new IoTDevice("IoT - 02"); this.IoTDev01.ChannelChangedEvent += this.OnChannelDataChanged; this.server01 = CreateServer(this.IoTDev01); this.server02 = CreateServer(this.IoTDev02); }
public ConfigViewModel() { UpdateConfigButton = new ButtonCommand(UpdateConfig); DefaultConfigButton = new ButtonCommand(DefaultConfig); ipAddress = config.IpAddress; sampleTime = config.SampleTime; maxSampleNumber = config.MaxSampleNumber; Server = new IoTServer(IpAddress); }
static void Main(string[] args) { Console.Title = "HuaWei OPC_UA Server"; isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); IoTServer server = new IoTServer(true, 5000); server.Run(); int exitCode = (int)IoTServer.ExitCode; Console.Write($"退出代码: {exitCode.ToString()}"); Console.ReadLine(); }
public LedViewModel() { this.LedMatrixInit(); rBrush = this.IntToRgb(initialColor)[0]; gBrush = this.IntToRgb(initialColor)[1]; bBrush = this.IntToRgb(initialColor)[2]; ClearButton = new LedButtonCommand(ClearLed); SendButton = new LedButtonCommand(SendLed); currentColor = new SolidColorBrush(Color.FromArgb(153, rBrush, gBrush, bBrush)); Config = new ConfigParams(); Server = new IoTServer(Config.IpAddress, Config.IpPort); }
public LEDViewModel() { ipAddress = config.IpAddress; sampleTime = config.SampleTime; maxSampleNumber = config.MaxSampleNumber; UpdateConfigLED = new ButtonCommand(UpdateLED); DefaultConfigLED = new ButtonCommand(DefaultLED); Server = new IoTServer(IpAddress); SendData = new ButtonCommand(sendControlRequest); }
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; }
/** * @brief Configuration parameters update */ private void UpdateConfig() { bool restartTimer = (RequestTimer != null); if (restartTimer) { StopTimer(); } config = new ConfigParams(ipAddress, sampleTime); Server = new IoTServer(IpAddress); if (restartTimer) { StartTimer(); } }
/** * @brief Configuration parameters defualt values */ private void DefaultConfig() { bool restartTimer = (RequestTimer != null); if (restartTimer) { StopTimer(); } config = new ConfigParams(); IpAddress = config.IpAddress; SampleTime = config.SampleTime.ToString(); Server = new IoTServer(IpAddress); if (restartTimer) { StartTimer(); } }
public JoyViewModel() { Joy = new PlotModel { Title = "Joystick Data" }; Joy.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = -xMax, Maximum = xMax, Key = "Horizontal", MajorGridlineStyle = LineStyle.Dot, //Unit = "sec", //Title = "Time" }); Joy.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = -yMax, Maximum = yMax, Key = "Vertical", MajorGridlineStyle = LineStyle.Dot //Unit = "*C", //Title = "Temperature" }); Reset = new ButtonCommand(ResetGraph); UpdateConfigJoy = new ButtonCommand(UpdateJoy); DefaultConfigJoy = new ButtonCommand(DefaultJoy); Server = new IoTServer(ipAddress); ipAddress = config.IpAddress; sampleTime = config.SampleTime; maxSampleNumber = config.MaxSampleNumber; RequestTimerJoy = new Timer(100); RequestTimerJoy.Elapsed += new ElapsedEventHandler(RequestTimerElapsedJoy); RequestTimerJoy.Enabled = true; }
/** * @brief Configuration parameters defualt values */ private void DefaultConfigG() { if (RequestTimerTemp != null) { StopTimerTemp(); } if (RequestTimerPress != null) { StopTimerPress(); } if (RequestTimerHumid != null) { StopTimerHumid(); } config = new ConfigParams(); IpAddress = config.IpAddress; SampleTime = config.SampleTime.ToString(); MaxSampleNumber = config.MaxSampleNumber.ToString(); Server = new IoTServer(IpAddress); if (RequestTimerTemp != null) { StartTimerTemp(); } if (RequestTimerPress != null) { StartTimerPress(); } if (RequestTimerHumid != null) { StartTimerHumid(); } }
/** * @brief Configuration parameters defualt values */ private void DefaultConfigOrG() { if (RequestTimerRPY != null) { StopTimerRPY(); } if (RequestTimerRPY1 != null) { StopTimerRPY1(); } if (RequestTimerRPY2 != null) { StopTimerRPY2(); } config = new ConfigParams(); IpAddress = config.IpAddress; SampleTime = config.SampleTime.ToString(); MaxSampleNumber = config.MaxSampleNumber.ToString(); Server = new IoTServer(IpAddress); if (RequestTimerRPY != null) { StartTimerRPY(); } if (RequestTimerRPY1 != null) { StartTimerRPY1(); } if (RequestTimerRPY2 != null) { StartTimerRPY2(); } }
private void DefaultLED() { config = new ConfigParams(); IpAddress = config.IpAddress; Server = new IoTServer(IpAddress); }
private void UpdateLED() { config = new ConfigParams(ipAddress, sampleTime, maxSampleNumber); Server = new IoTServer(IpAddress); }
public EnvViewModel() { Temp = new PlotModel { Title = "Temperature" }; Press = new PlotModel { Title = "Pressure" }; Humid = new PlotModel { Title = "Humidity" }; Temp.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); Temp.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = -40, Maximum = 150, Key = "Vertical", Unit = "*C", Title = "Temperature" }); Press.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); Press.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 200, Maximum = 1600, Key = "Vertical", Unit = "mbar", Title = "Pressure" }); Humid.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); Humid.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 0, Maximum = 100, Key = "Vertical", Unit = "%", Title = "Humidity" }); Temp.Series.Add(new LineSeries() { Title = "Temperature measurements", Color = OxyColor.Parse("#FFFF0000") }); Press.Series.Add(new LineSeries() { Title = "Pressure measurements", Color = OxyColor.Parse("#FFFF0000") }); Humid.Series.Add(new LineSeries() { Title = "Humidity measurements", Color = OxyColor.Parse("#FFFF0000") }); StartButtonTemp = new ButtonCommand(StartTimerTemp); StopButtonTemp = new ButtonCommand(StopTimerTemp); StartButtonPress = new ButtonCommand(StartTimerPress); StopButtonPress = new ButtonCommand(StopTimerPress); StartButtonHumid = new ButtonCommand(StartTimerHumid); StopButtonHumid = new ButtonCommand(StopTimerHumid); UpdateConfigEnvG = new ButtonCommand(UpdateConfigG); UpdateConfigEnvT = new ButtonCommand(UpdateConfigT); DefaultConfigEnvG = new ButtonCommand(DefaultConfigG); DefaultConfigEnvT = new ButtonCommand(DefaultConfigT); EnvMeasurements = new ObservableCollection <TableViewModel>(); Refresh = new ButtonCommand(RefreshHandler); ipAddress = config.IpAddress; sampleTime = config.SampleTime; maxSampleNumber = config.MaxSampleNumber; Server = new IoTServer(IpAddress); }
//MainView model, contains declarations of charts and buttons, their attributes and assigned functions public MainViewModel() { DataTable = new ObservableCollection <TablesViewModel>(); ChartTemp = new PlotModel { Title = "Temperature" }; ChartPress = new PlotModel { Title = "Pressure" }; ChartHumid = new PlotModel { Title = "Humidity" }; ChartRPY = new PlotModel { Title = "Roll, Pitch, Yaw angles" }; ChartJOY = new PlotModel { Title = "Joystick" }; ChartTemp.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); ChartTemp.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 30, Maximum = -20, Key = "Vertical", Unit = "C", Title = "Temperature" }); ChartPress.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); ChartPress.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 0, Maximum = 1200, Key = "Vertical", Unit = "mbar", Title = "Pressure" }); ChartHumid.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); ChartHumid.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 0, Maximum = 100, Key = "Vertical", Unit = "%", Title = "Humidity" }); ChartRPY.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "s", Title = "Time" }); ChartRPY.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 0, Maximum = 360, Key = "Vertical", Unit = "Degrees", Title = "Angle value" }); ChartJOY.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = -30, Maximum = 30, Key = "Horizontal", Unit = "x", }); ChartJOY.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = -30, Maximum = 30, Key = "Vertical", Unit = "y", }); ChartHumid.Series.Add(new LineSeries() { Title = "Humidity", Color = OxyColor.Parse("#FFFF0000") }); ChartPress.Series.Add(new LineSeries() { Title = "Pressure", Color = OxyColor.Parse("#FFFF0000") }); ChartTemp.Series.Add(new LineSeries() { Title = "Temperature", Color = OxyColor.Parse("#FFFF0000") }); ChartRPY.Series.Add(new LineSeries() { Title = "Roll", Color = OxyColor.Parse("#FFFF0000") }); ChartRPY.Series.Add(new LineSeries() { Title = "Pitch", Color = OxyColor.Parse("#0000FF") }); ChartRPY.Series.Add(new LineSeries() { Title = "Yaw", Color = OxyColor.Parse("#ffff00") }); ChartJOY.Series.Add(new LineSeries() { Title = "Point placement", Color = OxyColor.Parse("#FFFF0000"), MarkerFill = OxyColors.Blue, MarkerStroke = OxyColors.Red, MarkerType = MarkerType.Circle, StrokeThickness = 0, MarkerSize = 4, }); StartButton = new ButtonCommand(StartTimer); StopButton = new ButtonCommand(StopTimer); UpdateConfigButton = new ButtonCommand(UpdateConfig); DefaultConfigButton = new ButtonCommand(DefaultConfig); SendLed = new ButtonCommand(SendLedData); ClearLed = new ButtonCommand(ClearLedData); ipAddress = config.IpAddress; sampleTime = config.SampleTime; maxSampleNumber = config.MaxSampleNumber; Server = new IoTServer(IpAddress); }
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); }
public MainViewModel() { Measurements = new ObservableCollection <MeasurementViewModel>(); IMUChart = new PlotModel { Title = "IMU data" }; ENVChart_temp = new PlotModel { Title = "Temperature" }; ENVChart_press = new PlotModel { Title = "Pressure" }; ENVChart_humid = new PlotModel { Title = "Humidity" }; IMUChart.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); ENVChart_temp.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); ENVChart_press.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); ENVChart_humid.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); IMUChart.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = -190, Maximum = 190, Key = "Vertical", Unit = "deg", Title = "IMU values" }); ENVChart_temp.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 0, Maximum = 100, Key = "Vertical", Unit = "°C", Title = "Temperature" }); ENVChart_press.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 250, Maximum = 1270, Key = "Vertical", Unit = "hPa", Title = "Pressure" }); ENVChart_humid.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 0, Maximum = 100, Key = "Vertical", Unit = "g/m3", Title = "Humidity" }); IMUChart.Series.Add(new LineSeries() { Title = "roll", Color = OxyColor.Parse("#FFFF0000") }); IMUChart.Series.Add(new LineSeries() { Title = "pitch", Color = OxyColor.Parse("#0000FF") }); IMUChart.Series.Add(new LineSeries() { Title = "yaw", Color = OxyColor.Parse("#ffff00") }); ENVChart_temp.Series.Add(new LineSeries() { Title = "temperature", Color = OxyColor.Parse("#FFFF0000") }); ENVChart_press.Series.Add(new LineSeries() { Title = "pressure", Color = OxyColor.Parse("#0000FF") }); ENVChart_humid.Series.Add(new LineSeries() { Title = "humidity", Color = OxyColor.Parse("#ffff00") }); StartButton = new ButtonCommand(StartTimer); StopButton = new ButtonCommand(StopTimer); UpdateConfigButton = new ButtonCommand(UpdateConfig); DefaultConfigButton = new ButtonCommand(DefaultConfig); Send_Led = new ButtonCommand(Send_Led_Data); Send_Text = new ButtonCommand(Send_Led_Text); ipAddress = config.IpAddress; sampleTime = config.SampleTime; Server = new IoTServer(IpAddress); }
public AnglesViewModel() { RPY = new PlotModel { Title = "RPY Accelerometer" }; RPY1 = new PlotModel { Title = "xyz Magnetic" }; RPY2 = new PlotModel { Title = "RPY Gyroscope" }; RPY.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); RPY.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 0, Maximum = 360, Key = "Vertical", Unit = "degrees", Title = "RPY" }); RPY1.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); RPY1.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = -50, Maximum = 50, Key = "Vertical", Unit = "degrees", Title = "RPY1" }); RPY2.Axes.Add(new LinearAxis() { Position = AxisPosition.Bottom, Minimum = 0, Maximum = config.XAxisMax, Key = "Horizontal", Unit = "sec", Title = "Time" }); RPY2.Axes.Add(new LinearAxis() { Position = AxisPosition.Left, Minimum = 0, Maximum = 360, Key = "Vertical", Unit = "degrees", Title = "RPY2" }); RPY.Series.Add(new LineSeries() { Title = "R", Color = OxyColor.Parse("#0000FF") }); RPY.Series.Add(new LineSeries() { Title = "P", Color = OxyColor.Parse("#FFFF0000") }); RPY.Series.Add(new LineSeries() { Title = "Y", Color = OxyColor.Parse("#00FF00") }); RPY1.Series.Add(new LineSeries() { Title = "x", Color = OxyColor.Parse("#0000FF") }); RPY1.Series.Add(new LineSeries() { Title = "y", Color = OxyColor.Parse("#FFFF0000") }); RPY1.Series.Add(new LineSeries() { Title = "z", Color = OxyColor.Parse("#00FF00") }); RPY2.Series.Add(new LineSeries() { Title = "R", Color = OxyColor.Parse("#0000FF") }); RPY2.Series.Add(new LineSeries() { Title = "P", Color = OxyColor.Parse("#FFFF0000") }); RPY2.Series.Add(new LineSeries() { Title = "Y", Color = OxyColor.Parse("#00FF00") }); StartButtonRPY = new ButtonCommand(StartTimerRPY); StopButtonRPY = new ButtonCommand(StopTimerRPY); StartButtonRPY1 = new ButtonCommand(StartTimerRPY1); StopButtonRPY1 = new ButtonCommand(StopTimerRPY1); StartButtonRPY2 = new ButtonCommand(StartTimerRPY2); StopButtonRPY2 = new ButtonCommand(StopTimerRPY2); UpdateConfigOriG = new ButtonCommand(UpdateConfigOrG); UpdateConfigOriT = new ButtonCommand(UpdateConfigOrT); DefaultConfigOriG = new ButtonCommand(DefaultConfigOrG); DefaultConfigOriT = new ButtonCommand(DefaultConfigOrT); OriMeasurements = new ObservableCollection <TableViewModelOri>(); RefreshOri = new ButtonCommand(RefreshHandlerOri); ipAddress = config.IpAddress; sampleTime = config.SampleTime; maxSampleNumber = config.MaxSampleNumber; Server = new IoTServer(ipAddress); }