Пример #1
0
 /// <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>
 /// Initialize the object.
 /// </summary>
 /// <param name="ssConfig">Set the Subsystem Configuration.</param>
 public SubsystemOptions(SubsystemConfiguration ssConfig)
 {
     TextOptions           = new TextSubsystemConfigOptions(ssConfig);
     GraphicalOptions      = new ViewDataGraphicalOptions(ssConfig);
     ScreenOptions         = new ScreenSubsystemConfigOptions(ssConfig);
     AverageOptions        = new AverageSubsystemConfigOptions(ssConfig);
     ValidationViewOptions = new ValidationTestViewOptions(ssConfig);
 }
Пример #3
0
        /// <summary>
        /// Get the options for this subsystem display
        /// from the database.  If the options have not
        /// been set to the database yet, default values
        /// will be used.
        /// </summary>
        private void GetOptionsFromDatabase()
        {
            //var ssConfig = new SubsystemConfiguration(_Config.SubSystem, _Config.CepoIndex, _Config.SubsystemConfigIndex);
            //_options = _pm.AppConfiguration.GetGraphicalOptions(ssConfig);

            //// Notify all the properties
            //NotifyOptionPropertyChange();

            _options = _pm.GetGraphicalViewOptions();

            // Notify all the properties
            NotifyOptionPropertyChange();
        }
        /// <summary>
        /// Get the Graphical options from the dictionary.  This will
        /// check if the subsystem configuration is in the hashset.
        /// If it is in the hashset, it will get the Graphical options.
        /// If it is not, it will return a default configuration.
        /// </summary>
        /// <param name="ssConfig">Subsystem configuration to check.</param>
        /// <returns>Graphical options.</returns>
        public ViewDataGraphicalOptions GetGraphicalOptions(SubsystemConfiguration ssConfig)
        {
            ViewDataGraphicalOptions options = null;

            if (SubsystemConfigList.Contains(ssConfig))
            {
                options = SubsysOptions[ssConfig.IndexCodeString()].GraphicalOptions;
            }
            else
            {
                options = new ViewDataGraphicalOptions();
            }

            return(options);
        }
Пример #5
0
 /// <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>
        /// Save the Graphical SubsystemConfiguration options to the project database.
        /// This will store the options so the user can retreive them when the project
        /// is loaded again.
        /// </summary>
        /// <param name="ssConfig">Subsystem Configuration.</param>
        /// <param name="options">Graphical SubsystemConfiguration options.</param>
        public void SaveGraphicalOptions(SubsystemConfiguration ssConfig, ViewDataGraphicalOptions options)
        {
            // Check if the subsystem exist in the dictionary
            if (SubsystemConfigList.Contains(ssConfig))
            {
                // Store the graphical options to the SubsystemConfig entry
                SubsysOptions[ssConfig.IndexCodeString()].GraphicalOptions = options;
            }
            else
            {
                // Add new subsystem configuration
                AddConfiguration(ssConfig);

                // Store the new options if the entry could be made
                if (SubsystemConfigList.Contains(ssConfig))
                {
                    // Store the graphical options to the SubsystemConfig entry
                    SubsysOptions[ssConfig.IndexCodeString()].GraphicalOptions = options;
                }
            }

            // Store the new options to the project DB
            SaveOptions();
        }