/// <summary>
 /// Send the command to zero the pressure sensor
 /// </summary>
 private void ZeroPressureSensor()
 {
     if (_adcpConnection.IsAdcpSerialConnected())
     {
         // Send command to zero the pressure sensor
         _adcpConnection.AdcpSerialPort.SendData(RTI.Commands.AdcpCommands.CMD_CPZ);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Get all the commands that are necessary to configure the
        /// ADCP.  Validate the additional commands given.
        /// Then pass all the commands to the ADCP.
        /// </summary>
        private void ConfigureAdcp()
        {
            if (_adcpConnection.IsAdcpSerialConnected())
            {
                IsLoading = true;

                // Get all the commands
                List <string> commands = GetCommands();

                // Start the ADCP pinging
                //commands.Add(Commands.AdcpCommands.CMD_START_PINGING);

                // Save the commands to the file
                SaveCommandsToFile();

                // Send all the commands to the ADCP
                _adcpConnection.SendCommands(commands);

                // Decode CSHOW again to get all the additional commands given
                //CheckAllOptionsFromAdcp();

                // Start Pinging
                _adcpConnection.StartPinging();

                IsLoading = false;

                // Display message that is is ok to disconnect the ADCP
                MessageBox.Show("It is OK to disconnect the ADCP now.", "Configuration Complete", MessageBoxButton.OK, MessageBoxImage.Information);

                // Change the view to the ViewData view
                //_events.Publish(new ViewNavEvent(ViewNavEvent.ViewId.ViewDataView));
            }
            else
            {
                // Display message that it could not send the commands
                MessageBox.Show("An ADCP is not connected.\nCannot send the commands.", "Configuration Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }