public SmartPageOptions(string ClockStr, long MemoryCardRequired, long MemoryCardCapacity, long MemoryCardUsed, string CompassCalStr, string PressureSensorStr, string SelectedConfiguration, string SelectedAccousticMode, Subsystem SelectedSubsystem, bool IsBurstRecording, string AdditionalCommands, EngConf HdrwConfig) { this.ClockStr = ClockStr; this.MemoryCardRequired = MemoryCardRequired; this.MemoryCardCapacity = MemoryCardCapacity; this.MemoryCardUsed = MemoryCardUsed; this.CompassCalStr = CompassCalStr; this.PressureSensorStr = PressureSensorStr; this.SelectedConfiguration = SelectedConfiguration; this.SelectedAccousticMode = SelectedAccousticMode; this.SelectedSubsystem = SelectedSubsystem; this.IsBurstRecording = IsBurstRecording; this.AdditionalCommands = AdditionalCommands; this.HdrwConfig = HdrwConfig; // If the HdrwConfig is null, then create a default if (this.HdrwConfig == null) { this.HdrwConfig = new EngConf(); } }
/// <summary> /// Initialize values. /// </summary> public AdcpConfiguration() { // Initialize values SubsystemConfigDict = new Dictionary <string, AdcpSubsystemConfig>(); Commands = new AdcpCommands(); _serialNumber = new SerialNumber(); DeploymentOptions = new DeploymentOptions(); AdcpSerialOptions = new AdcpSerialPort.AdcpSerialOptions(); IsGps1SerialEnabled = false; IsGps2SerialEnabled = false; IsNmea1SerialEnabled = false; IsNmea2SerialEnabled = false; Gps1SerialOptions = new SerialOptions(); Gps2SerialOptions = new SerialOptions(); Nmea1SerialOptions = new SerialOptions(); Nmea2SerialOptions = new SerialOptions(); HardwareOptions = new EngConf(); EthernetOptions = new AdcpEthernetOptions(); VesselMountOptions = new VesselMountOptions(); EngPort = ""; AdditionalCommands = ""; }
/// <summary> /// Initialize values. /// </summary> public AdcpConfiguration(SerialNumber serial) { // Initialize values SubsystemConfigDict = new Dictionary <string, AdcpSubsystemConfig>(); Commands = new AdcpCommands(); _serialNumber = serial; SetCepo(_serialNumber.SubsystemsString(), _serialNumber); // Must go after Commands is created DeploymentOptions = new DeploymentOptions(); AdcpSerialOptions = new AdcpSerialPort.AdcpSerialOptions(); IsGps1SerialEnabled = false; IsGps2SerialEnabled = false; IsNmea1SerialEnabled = false; IsNmea2SerialEnabled = false; Gps1SerialOptions = new SerialOptions(); Gps2SerialOptions = new SerialOptions(); Nmea1SerialOptions = new SerialOptions(); Nmea2SerialOptions = new SerialOptions(); HardwareOptions = new EngConf(); EthernetOptions = new AdcpEthernetOptions(); VesselMountOptions = new VesselMountOptions(); EngPort = ""; AdditionalCommands = ""; }
/// <summary> /// Set the default values. /// </summary> public void SetDefaults() { // Initialize the values SelectedConfiguration = null; // By default select nothing SelectedAccousticMode = SmartPageOptions.ACCOUSTIC_MODE_PROFILER; // By default select nothing // Hardware SelectedSubsystem = null; IsBurstRecording = false; // Additional Commands AdditionalCommands = ""; // ADCP ClockStr = ""; MemoryCardRequired = 0; MemoryCardCapacity = 0; MemoryCardUsed = 0; CompassCalStr = ""; PressureSensorStr = ""; // EngConf HdrwConfig = new EngConf(); }
/// <summary> /// Decode the ENGCONF command. This will /// tell you what devices are enabled. /// /// Ex: /// ENGCONF /// Fram 0 /// RTC 0 /// KELLER30 0 /// cd 0 /// EMAC 0 /// A11 RCVR 1 /// SLEEP 0 /// engconf /// </summary> /// <param name="buffer">Buffer to decode.</param> /// <returns>Results of the buffer decoding.</returns> public static EngConf DecodeENGCONF(string buffer) { // Initialize the value EngConf engConf = new EngConf(); // Get each line of the buffer string[] lines = buffer.Split('\n'); foreach (var line in lines) { // Parse the string of all it elements // KELLER30 0 char[] delimiters = { ' ' }; string[] hdwrInfo = line.Split(delimiters, StringSplitOptions.RemoveEmptyEntries); // Ensure it contains a type and value if (hdwrInfo.Length > 1) { int value = 0; // Parse the last value to get the value int.TryParse(hdwrInfo[hdwrInfo.Length-1], out value); bool result = false; if (value >= 1) { result = true; } // Look for each value in the buffer switch (hdwrInfo[0]) { case "Fram": engConf.IsFram = result; break; case "RTC": engConf.IsRtc = result; break; case "KELLER30": engConf.IsPressureSensor = result; break; case "cd": engConf.IsCd = result; break; case "EMAC": engConf.IsEmac = result; break; case "A11": engConf.IsA11Rcvr = result; break; case "SLEEP": engConf.IsSleep = result; break; default: break; } } } return engConf; }
/// <summary> /// Initialize values. /// </summary> public AdcpConfiguration() { // Initialize values SubsystemConfigDict = new Dictionary<string, AdcpSubsystemConfig>(); Commands = new AdcpCommands(); _serialNumber = new SerialNumber(); DeploymentOptions = new DeploymentOptions(); AdcpSerialOptions = new AdcpSerialPort.AdcpSerialOptions(); Gps1SerialOptions = new SerialOptions(); Gps2SerialOptions = new SerialOptions(); Nmea1SerialOptions = new SerialOptions(); Nmea2SerialOptions = new SerialOptions(); HardwareOptions = new EngConf(); EthernetOptions = new AdcpEthernetOptions(); VesselMountOptions = new VesselMountOptions(); }
/// <summary> /// Initialize values. /// </summary> public AdcpConfiguration(SerialNumber serial) { // Initialize values SubsystemConfigDict = new Dictionary<string, AdcpSubsystemConfig>(); Commands = new AdcpCommands(); _serialNumber = serial; SetCepo(_serialNumber.SubsystemsString(), _serialNumber); // Must go after Commands is created DeploymentOptions = new DeploymentOptions(); AdcpSerialOptions = new AdcpSerialPort.AdcpSerialOptions(); Gps1SerialOptions = new SerialOptions(); Gps2SerialOptions = new SerialOptions(); Nmea1SerialOptions = new SerialOptions(); Nmea2SerialOptions = new SerialOptions(); HardwareOptions = new EngConf(); EthernetOptions = new AdcpEthernetOptions(); VesselMountOptions = new VesselMountOptions(); }