/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel( SettingsViewModel settingsViewModel, DevicesViewModel devicesViewModel, InferenceServer inferenceServer) { if (settingsViewModel == null) { throw new ArgumentNullException(nameof(settingsViewModel)); } if (devicesViewModel == null) { throw new ArgumentNullException(nameof(devicesViewModel)); } if (inferenceServer == null) { throw new ArgumentNullException(nameof(inferenceServer)); } SettingsViewModel = settingsViewModel; DevicesViewModel = devicesViewModel; _inferenceServer = inferenceServer; SaveCommand = new RelayCommand(() => SaveAll(), () => !IsBusy); ShowDeviceCommand = new RelayCommand(() => OnShowDevice(), () => !IsBusy); Messenger.Default.Register <NotificationMessage>(this, OnStatusMessage); Messenger.Default.Register <DeviceMessage>(this, OnDeviceMessage); _startupTask = StartupAsync(); }
public Filter(DeviceModel device, InferenceServer inferenceServer) { _device = device; _inferenceServer = inferenceServer; _inferenceChannel = inferenceServer.CreateChannel(); _segmentor = BackgroundSubtractorMOG2.Create(500, 16, true); }
public DevicesViewModel(DevicesModel devices, SettingsModel settings, InferenceServer inferenceServer) { Model = devices; _settings = settings; _inferenceServer = inferenceServer; AddCommand = new RelayCommand(() => DoAddDevice(), () => !IsBusy); DataFromModel(); }
public DeviceViewModel( DevicesViewModel devicesViewModel, DeviceModel deviceModel, SettingsModel settings, InferenceServer inferenceServer) { _parent = devicesViewModel ?? throw new ArgumentNullException(nameof(devicesViewModel)); Model = deviceModel ?? throw new ArgumentNullException(nameof(deviceModel)); if (settings == null) { throw new ArgumentNullException(nameof(devicesViewModel)); } _inferenceServer = inferenceServer ?? throw new ArgumentNullException(nameof(inferenceServer)); DeleteCommand = new RelayCommand(() => _parent?.DoDeleteDevice(this), () => !Active); ActiveCommand = new RelayCommand(() => DoActiveCommand(Model.Active)); StartCommand = new RelayCommand(() => DoStartCommand(), () => !Active); StopCommand = new RelayCommand(() => DoStopCommand(), () => Active); DataFromModel(); DoActiveCommand(Active); }
public void Initialize() { _dut = new InferenceServer(); }