/// <summary> /// Initialize the view model. /// </summary> public AdcpConfigurationViewModel() : base("Adcp Configuration") { // Initialize values _events = IoC.Get <IEventAggregator>(); _pm = IoC.Get <PulseManager>(); _adcpConnection = IoC.Get <AdcpConnection>(); SubsystemConfigList = new ReactiveList <AdcpSubsystemConfigurationViewModel>(); BatteryTypeList = DeploymentOptions.GetBatteryList(); // Initialize the values InitializeValues(); // Scan ADCP command ScanAdcpCommand = ReactiveCommand.CreateAsyncTask(_ => ScanConfiguration()); // Add Subsystem Configuration AddSubsystemCommand = ReactiveCommand.Create(); AddSubsystemCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.FrequencyView))); // Next command NextCommand = ReactiveCommand.Create(this.WhenAny(x => x.IsScanning, x => !x.Value)); NextCommand.Subscribe(_ => NextPage()); // Back coommand BackCommand = ReactiveCommand.Create(); BackCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.Back))); // Exit coommand ExitCommand = ReactiveCommand.Create(); ExitCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.HomeView))); // Compass Cal coommand CompassCalCommand = ReactiveCommand.Create(); CompassCalCommand.Subscribe(_ => _events.PublishOnUIThread(new ViewNavEvent(ViewNavEvent.ViewId.CompassCalView))); // Edit the configuration command EditCommand = ReactiveCommand.Create(); EditCommand.Subscribe(param => OnEditCommand(param)); // Save the commands to a text file SaveCmdsCommand = ReactiveCommand.CreateAsyncTask(_ => SaveCommandsToFile()); // Get the configuration from the project GetConfiguation(); // Update the deployment duration to include all the new configurations // The duration needs to be divided amoung all the configuration UpdateDeploymentDuration(); // Update the properites UpdateProperties(); }