/// <summary> /// Set the default values for all the options. /// /// Try to use the last ADCP/GPS serial option. If the /// last option was never set, then the default settings will /// still be used for the serial options. /// </summary> private void SetDefaults() { Revision = ProjectManagerDatabaseWriter.PULSE_TABLE_REVISION; PrjFolderPath = Pulse.Commons.GetProjectDefaultFolderPath(); FontSize = DEFAULT_FONT_SIZE; MaxFileSize = 1048576 * 50; // 50 MegaBytes AdcpCommType = AdcpConnection.AdcpCommTypes.Serial; AdcpSerialOptions = new SerialOptions(); Gps1SerialOptions = new SerialOptions(); Gps2SerialOptions = new SerialOptions(); Nmea1SerialOptions = new SerialOptions(); Nmea2SerialOptions = new SerialOptions(); IsGps1SerialEnabled = false; IsGps2SerialEnabled = false; IsNmea1SerialEnabled = false; IsNmea2SerialEnabled = false; EthernetOptions = new AdcpEthernetOptions(); PredictorUserInput = new PredictionModelInput(); SelectedProjectID = 0; ValidationViewOptions = new ValidationTestViewOptions(); GraphicalViewOptions = new ViewDataGraphicalOptions(); BackscatterOptions = new BackscatterOptions(); AverageOptions = new AverageOptions(); TankTestOptions = new TankTestOptions(); ViewDataWavesOptions = new ViewDataWavesOptions(); AdcpConfig = new AdcpConfiguration(); RecoverDataOptions = new RecoverDataOptions(); DataOutputOptions = new DataOutputViewOptions(); WpMagDirOutputOptions = new WpMagDirOutputViewOptions(); DataFormatOptions = new DataFormatOptions(); LastViewedPage = ViewNavEvent.ViewId.HomeView; }
/// <summary> /// Set the Pulse options. /// </summary> /// <param name="prjFolderPath">Project folder path.</param> /// <param name="fontSize">Font Size.</param> /// <param name="maxFileSize">Max file size.</param> /// <param name="adcpCommType">ADCP Communication type.</param> /// <param name="adcpOptions">Adcp Serial Options.</param> /// <param name="isGps1Enabled">Flag if GPS 1 serial port is enabled.</param> /// <param name="isGps2Enabled">Flag if GPS 2 serial port is enabled.</param> /// <param name="isNmea1Enabled">Flag if NMEA 1 serial port is enabled.</param> /// <param name="isNmea2Enabled">Flag if NMEA 2 serial port is enabled.</param> /// <param name="gps1Options">Gps 1 Serial options.</param> /// <param name="gps2Options">Gps 2 Serial options.</param> /// <param name="nmea1Options">NMEA 1 Serial options.</param> /// <param name="nmea2Options">NMEA 2 Serial options.</param> /// <param name="ethernetOption">Ethernet options.</param> /// <param name="predictorUserInput">ADCP Predictor User Input.</param> /// <param name="selectedProjectID">Selected Project ID.</param> /// <param name="validationViewOptions">Validation View Options.</param> /// <param name="graphicalViewOptions">Graphical View Options.</param> /// <param name="backscatterOptions">Backscatter options.</param> /// <param name="averageOptions">Average Options.</param> /// <param name="tankTestOptions">Tank Test Options.</param> /// <param name="viewDataWavesOptions">Waves options.</param> /// <param name="adcpConfig">ADCP Config.</param> /// <param name="recoverDataOptions">Recover Data Options.</param> /// <param name="dataOutputOptions">Data Ouput Options.</param> /// <param name="wpMagDirOutputOptions">Water Profile Magnitude and Direction Output Options.</param> /// <param name="dataFormatOptions">Data Format Options.</param> /// <param name="lastViewedPage">Last paged view.</param> public PulseOptions(string prjFolderPath, int fontSize, int maxFileSize, AdcpConnection.AdcpCommTypes adcpCommType, SerialOptions adcpOptions, bool isGps1Enabled, bool isGps2Enabled, bool isNmea1Enabled, bool isNmea2Enabled, SerialOptions gps1Options, SerialOptions gps2Options, SerialOptions nmea1Options, SerialOptions nmea2Options, AdcpEthernetOptions ethernetOption, PredictionModelInput predictorUserInput, int selectedProjectID, ValidationTestViewOptions validationViewOptions, ViewDataGraphicalOptions graphicalViewOptions, BackscatterOptions backscatterOptions, AverageOptions averageOptions, TankTestOptions tankTestOptions, ViewDataWavesOptions viewDataWavesOptions, AdcpConfiguration adcpConfig, RecoverDataOptions recoverDataOptions, DataOutputViewOptions dataOutputOptions, WpMagDirOutputViewOptions wpMagDirOutputOptions, DataFormatOptions dataFormatOptions, ViewNavEvent.ViewId lastViewedPage) { PrjFolderPath = prjFolderPath; FontSize = fontSize; MaxFileSize = maxFileSize; AdcpCommType = adcpCommType; AdcpSerialOptions = adcpOptions; IsGps1SerialEnabled = isGps1Enabled; IsGps2SerialEnabled = isGps2Enabled; IsNmea1SerialEnabled = isNmea1Enabled; IsNmea2SerialEnabled = isNmea2Enabled; Gps1SerialOptions = gps1Options; Gps2SerialOptions = gps2Options; Nmea1SerialOptions = nmea1Options; Nmea2SerialOptions = nmea2Options; EthernetOptions = ethernetOption; PredictorUserInput = predictorUserInput; SelectedProjectID = selectedProjectID; ValidationViewOptions = validationViewOptions; GraphicalViewOptions = graphicalViewOptions; BackscatterOptions = backscatterOptions; AverageOptions = averageOptions; TankTestOptions = tankTestOptions; ViewDataWavesOptions = viewDataWavesOptions; AdcpConfig = adcpConfig; RecoverDataOptions = recoverDataOptions; DataOutputOptions = dataOutputOptions; WpMagDirOutputOptions = wpMagDirOutputOptions; DataFormatOptions = dataFormatOptions; LastViewedPage = lastViewedPage; }
/// <summary> /// Initialize. /// </summary> public DataFormatViewModel(IEventAggregator eventAggregator) { _eventAggregator = eventAggregator; _options = new DataFormatOptions(); // Initialize the codec _codec = new AdcpCodec(); // Init values _curProjectName = ""; _currEnsCount = 0; IsRtb = _options.IsRTB; _RtbDataCount = 0; _RtbDataBytes = 0; IsRtd = _options.IsRTD; _RtdDataCount = 0; _RtdDataBytes = 0; IsPd0 = _options.IsPD0; _Pd0DataCount = 0; _Pd0DataBytes = 0; IsPd6_13 = _options.IsPD6_13; _Pd6_13DataCount = 0; _Pd6_13DataBytes = 0; IsPd4_5 = _options.IsPD4_5; _Pd4_5DataCount = 0; _Pd4_5DataBytes = 0; // Setup event handlers _codec.ProcessDataEvent += _codec_ProcessDataEvent; // Update the display _displayTimer = new System.Timers.Timer(1000); _displayTimer.Elapsed += _displayTimer_Elapsed; _displayTimer.AutoReset = true; _displayTimer.Enabled = true; }
/// <summary> /// Get the options from the database. /// </summary> private void GetOptionsFromDatabase() { _Options = _pm.GetDataFormatOptions(); }