コード例 #1
0
        /// <summary>
        /// Configure the ADCP with the proper commands to do a fresh water lake test.
        /// CDEFAULT            Set default settings
        /// C232B 19200         Change GPS serial port to 19200
        /// CSAVE               Save all settings to SD card
        /// </summary>
        private void On_ConfigureAdcpFresh()
        {
            // Ensure the serial port is open
            if (_adcpConn.IsOpen())
            {
                if (File.Exists(RTI.Pulse.Commons.DEFAULT_CONFIG_DIR + @"\ConfigureFresh.txt"))
                {
                    string[] commands = File.ReadAllLines(RTI.Pulse.Commons.DEFAULT_CONFIG_DIR + @"\ConfigureFresh.txt");

                    _adcpConn.SendCommands(commands.ToList());
                }
                else
                {
                    // List of commands to send to the ADCP
                    List <string> commands = new List <string>();
                    commands.Add(RTI.Commands.AdcpCommands.CMD_STOP_PINGING);                                                           // Stop pinging
                    commands.Add(RTI.Commands.AdcpCommands.CMD_CDEFAULT);                                                               // Set default settings
                    commands.Add(RTI.Commands.AdcpCommands.CMD_C232B + " 19200");                                                       // Set GPS serial port to 19200 baud
                    //commands.Add(RTI.Commands.AdcpCommands.CMD_CHO + " " + Commands.AdcpCommands.DEFAULT_SAN_DIEGO_DECLINATION);        // Add in San Diego Declination
                    commands.Add(RTI.Commands.AdcpCommands.GetLocalSystemTimeCommand());                                                // Set Local Time
                    commands.Add(RTI.Commands.AdcpCommands.CMD_CWS + " 0");                                                             // Salinity set to 0
                    commands.Add(RTI.Commands.AdcpCommands.CMD_CSAVE);                                                                  // Save settings to the SD card
                    commands.Add(RTI.Commands.AdcpCommands.CMD_START_PINGING);                                                          // Start pinging

                    // Send these commands to the ADCP serial port
                    _adcpConn.SendCommands(commands);
                }
            }
        }