示例#1
0
        public void TestC232B_115200_CmdStr()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.C232B = Baudrate.BAUD_115200;

            Assert.AreEqual("C232B 115200", cmd.C232B_CmdStr(), "C232B Command String BAUD_115200 is incorrect.");
        }
示例#2
0
        public void TestC232B_115200()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.C232B = Baudrate.BAUD_115200;

            Assert.AreEqual(Baudrate.BAUD_115200, cmd.C232B, "C232B BAUD_115200 is incorrect.");
        }
示例#3
0
 /// <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 = "";
 }
示例#4
0
 /// <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 = "";
 }
示例#5
0
        public void TestCEI()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CEI = new TimeValue(22,33,44,55);

            Assert.AreEqual(new TimeValue(22, 33, 44, 55), cmd.CEI, "CEI is incorrect.");
        }
示例#6
0
        public void TestCWSSCmdStr()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CWSS = 0.02456456f;

            Assert.AreEqual("CWSS 0.02456456", cmd.CWSS_CmdStr(), "CWSS Command String is incorrect.");
        }
示例#7
0
        public void TestCETFPCmdStr()
        {
            AdcpCommands cmd = new AdcpCommands();

            //cmd.CETFP_Year = 2012;
            //cmd.CETFP_Month = 11;
            //cmd.CETFP_Day = 21;
            //cmd.CETFP_Hour = 12;
            //cmd.CETFP_Minute = 03;
            //cmd.CETFP_Second = 15;
            //cmd.CETFP_HunSec = 67;
            cmd.CETFP = new DateTime(2012, 11, 21, 12, 03, 15, (int)(67 * MathHelper.HUNSEC_TO_MILLISEC));

            Assert.AreEqual("CETFP 2012/11/21,12:03:15.67", cmd.CETFP_CmdStr(), "CETFP Command String is incorrect.");
        }
示例#8
0
        public void TestCEOUTPUTCmdStr3()
        {
            AdcpCommands cmd = new AdcpCommands();

            Assert.AreEqual("CEOUTPUT 1", cmd.CEOUTPUT_CmdStr(), "CEOUTPUT Command String is incorrect.");
        }
示例#9
0
        public void TestCEOUTPUT_CornerMin()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CEOUTPUT = AdcpCommands.AdcpOutputMode.Disable;

            Assert.AreEqual(AdcpCommands.AdcpOutputMode.Disable, cmd.CEOUTPUT, "CEOUTPUT is incorrect.");
        }
示例#10
0
        public void TestMode()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.Mode = AdcpCommands.AdcpMode.PROFILE;

            Assert.AreEqual(AdcpCommands.AdcpMode.PROFILE, cmd.Mode, "Mode is incorrect.");
            Assert.AreEqual("CPROFILE", cmd.Mode_ToString(), "Mode String is incorrect.");
            Assert.AreEqual(AdcpCommands.CMD_CPROFILE, cmd.Mode_ToString(), "Mode String is incorrect.");
        }
示例#11
0
        public void TestCEOUTPUT()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CEOUTPUT = AdcpCommands.AdcpOutputMode.Binary;

            Assert.AreEqual(AdcpCommands.AdcpOutputMode.Binary, cmd.CEOUTPUT, "CEOUTPUT is incorrect.");
        }
示例#12
0
        public void TestCWTCmdStr()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CWT = 0.024564f;

            Assert.AreEqual("CWT 0.024564", cmd.CWT_CmdStr(), "CWT Command String is incorrect.");
        }
示例#13
0
        public void TestEqual_New()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.Mode = AdcpCommands.AdcpMode.DVL;
            cmd.CEI = new TimeValue(1, 2, 3, 4);
            cmd.CEPO = "33";
            //cmd.CETFP_Year = 2022;
            //cmd.CETFP_Month = 4;
            //cmd.CETFP_Day = 20;
            //cmd.CETFP_Hour = 3;
            //cmd.CETFP_Minute = 2;
            //cmd.CETFP_Second = 32;
            //cmd.CETFP_HunSec = 83;
            cmd.CETFP = new DateTime(2022, 4, 20, 3, 2, 32, 83);
            cmd.CERECORD_EnsemblePing = false;
            cmd.CEOUTPUT = AdcpCommands.AdcpOutputMode.Binary;
            cmd.CWS = 23.234f;
            cmd.CWT = 934.123f;
            cmd.CTD = 945.23f;
            cmd.CWSS = 111.345f;
            cmd.CHO = 83.23f;
            cmd.CHS = HeadingSrc.INTERNAL;
            cmd.CVSF = 234.2345f;
            cmd.C232B = Baudrate.BAUD_19200;
            cmd.C485B = Baudrate.BAUD_460800;
            cmd.C422B = Baudrate.BAUD_38400;

            AdcpCommands cmd1 = cmd;

            #region Mode
            Assert.AreEqual(AdcpCommands.AdcpMode.DVL, cmd.Mode, "Mode is incorrect.");
            Assert.AreEqual(AdcpCommands.AdcpMode.DVL, cmd1.Mode, "Mode 1 is incorrect.");
            Assert.AreEqual(cmd.Mode, cmd1.Mode, "Mode equal is incorrect.");
            #endregion

            #region CEI
            Assert.AreEqual(new TimeValue(1, 2, 3, 4), cmd.CEI, "CEI is incorrect.");
            Assert.AreEqual(new TimeValue(1, 2, 3, 4), cmd1.CEI, "CEI 1 is incorrect.");
            Assert.AreEqual(cmd.CEI, cmd1.CEI, "CEI equal is incorrect.");
            #endregion

            #region CEPO
            Assert.AreEqual("33", cmd.CEPO, "CEPO is incorrect.");
            Assert.AreEqual("33", cmd1.CEPO, "CEPO 1 is incorrect.");
            Assert.AreEqual(cmd.CEPO, cmd1.CEPO, "CEPO equal is incorrect.");
            #endregion

            #region CETFP_Year
            Assert.AreEqual(2022, cmd.CETFP.Year, "CETFP_Year is incorrect.");
            Assert.AreEqual(2022, cmd1.CETFP.Year, "CETFP_Year 1 is incorrect.");
            Assert.AreEqual(cmd.CETFP.Year, cmd1.CETFP.Year, "CETFP_Year equal is incorrect.");
            #endregion

            #region CETFP_Month
            Assert.AreEqual(4, cmd.CETFP.Month, "CETFP_Month is incorrect.");
            Assert.AreEqual(4, cmd1.CETFP.Month, "CETFP_Month 1 is incorrect.");
            Assert.AreEqual(cmd.CETFP.Month, cmd1.CETFP.Month, "CETFP_Month equal is incorrect.");
            #endregion

            #region CETFP_Day
            Assert.AreEqual(20, cmd.CETFP.Day, "CETFP_Day is incorrect.");
            Assert.AreEqual(20, cmd1.CETFP.Day, "CETFP_Day 1 is incorrect.");
            Assert.AreEqual(cmd.CETFP.Day, cmd1.CETFP.Day, "CETFP_Day equal is incorrect.");
            #endregion

            #region CETFP_Hour
            Assert.AreEqual(3, cmd.CETFP.Hour, "CETFP_Hour is incorrect.");
            Assert.AreEqual(3, cmd1.CETFP.Hour, "CETFP_Hour 1 is incorrect.");
            Assert.AreEqual(cmd.CETFP.Hour, cmd1.CETFP.Hour, "CETFP_Hour equal is incorrect.");
            #endregion

            #region CETFP_Minute
            Assert.AreEqual(2, cmd.CETFP.Minute, "CETFP_Minute is incorrect.");
            Assert.AreEqual(2, cmd1.CETFP.Minute, "CETFP_Minute 1 is incorrect.");
            Assert.AreEqual(cmd.CETFP.Minute, cmd1.CETFP.Minute, "CETFP_Minute equal is incorrect.");
            #endregion

            #region CETFP_Second
            Assert.AreEqual(32, cmd.CETFP.Second, "CETFP_Second is incorrect.");
            Assert.AreEqual(32, cmd1.CETFP.Second, "CETFP_Second 1 is incorrect.");
            Assert.AreEqual(cmd.CETFP.Second, cmd1.CETFP.Second, "CETFP_Second equal is incorrect.");
            #endregion

            #region CETFP_HunSec
            //Assert.AreEqual(83, cmd.CETFP_HunSec, "CETFP_HunSec is incorrect.");
            //Assert.AreEqual(83, cmd1.CETFP_HunSec, "CETFP_HunSec 1 is incorrect.");
            //Assert.AreEqual(cmd.CETFP_HunSec, cmd1.CETFP_HunSec, "CETFP_HunSec equal is incorrect.");
            #endregion

            #region CERECORD
            Assert.AreEqual(false, cmd.CERECORD_EnsemblePing, "CERECORD is incorrect.");
            Assert.AreEqual(false, cmd1.CERECORD_EnsemblePing, "CERECORD 1 is incorrect.");
            Assert.AreEqual(cmd.CERECORD_EnsemblePing, cmd1.CERECORD_EnsemblePing, "CERECORD equal is incorrect.");
            #endregion

            #region CEOUTPUT
            Assert.AreEqual(AdcpCommands.AdcpOutputMode.Binary, cmd.CEOUTPUT, "CEOUTPUT is incorrect.");
            Assert.AreEqual(AdcpCommands.AdcpOutputMode.Binary, cmd1.CEOUTPUT, "CEOUTPUT 1 is incorrect.");
            Assert.AreEqual(cmd.CEOUTPUT, cmd1.CEOUTPUT, "CEOUTPUT equal is incorrect.");
            #endregion

            #region CWS
            Assert.AreEqual(23.234f, cmd.CWS, "CWS is incorrect.");
            Assert.AreEqual(23.234f, cmd1.CWS, "CWS 1 is incorrect.");
            Assert.AreEqual(cmd.CWS, cmd1.CWS, "CWS equal is incorrect.");
            #endregion

            #region CWT
            Assert.AreEqual(934.123f, cmd.CWT, "CWT is incorrect.");
            Assert.AreEqual(934.123f, cmd1.CWT, "CWT 1 is incorrect.");
            Assert.AreEqual(cmd.CWT, cmd1.CWT, "CWT equal is incorrect.");
            #endregion

            #region CTD
            Assert.AreEqual(945.23f, cmd.CTD, "CTD is incorrect.");
            Assert.AreEqual(945.23f, cmd1.CTD, "CTD 1 is incorrect.");
            Assert.AreEqual(cmd.CTD, cmd1.CTD, "CTD equal is incorrect.");
            #endregion

            #region CWSS
            Assert.AreEqual(111.345f, cmd.CWSS, "CWSS is incorrect.");
            Assert.AreEqual(111.345f, cmd1.CWSS, "CWSS 1 is incorrect.");
            Assert.AreEqual(cmd.CWSS, cmd1.CWSS, "CWSS equal is incorrect.");
            #endregion

            #region CHO
            Assert.AreEqual(83.23f, cmd.CHO, "CHO is incorrect.");
            Assert.AreEqual(83.23f, cmd1.CHO, "CHO 1 is incorrect.");
            Assert.AreEqual(cmd.CHO, cmd1.CHO, "CHO equal is incorrect.");
            #endregion

            #region CHS
            Assert.AreEqual(HeadingSrc.INTERNAL, cmd.CHS, "CHS is incorrect.");
            Assert.AreEqual(HeadingSrc.INTERNAL, cmd1.CHS, "CHS 1 is incorrect.");
            Assert.AreEqual(cmd.CHS, cmd1.CHS, "CHS equal is incorrect.");
            #endregion

            #region CVSF
            Assert.AreEqual(234.2345f, cmd.CVSF, "CVSF is incorrect.");
            Assert.AreEqual(234.2345f, cmd1.CVSF, "CVSF 1 is incorrect.");
            Assert.AreEqual(cmd.CVSF, cmd1.CVSF, "CVSF equal is incorrect.");
            #endregion

            #region C232B
            Assert.AreEqual(Baudrate.BAUD_19200, cmd.C232B, "C232B is incorrect.");
            Assert.AreEqual(Baudrate.BAUD_19200, cmd1.C232B, "C232B 1 is incorrect.");
            Assert.AreEqual(cmd.C232B, cmd1.C232B, "C232B equal is incorrect.");
            #endregion

            #region C485B
            Assert.AreEqual(Baudrate.BAUD_460800, cmd.C485B, "C485B is incorrect.");
            Assert.AreEqual(Baudrate.BAUD_460800, cmd1.C485B, "C485B 1 is incorrect.");
            Assert.AreEqual(cmd.C485B, cmd1.C485B, "C485B equal is incorrect.");
            #endregion

            #region C485B
            Assert.AreEqual(Baudrate.BAUD_38400, cmd.C422B, "C422B is incorrect.");
            Assert.AreEqual(Baudrate.BAUD_38400, cmd1.C422B, "C422B 1 is incorrect.");
            Assert.AreEqual(cmd.C422B, cmd1.C422B, "C422B equal is incorrect.");
            #endregion
        }
示例#14
0
        public void TestCWT()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CWT = 15.006f;

            Assert.AreEqual(15.006f, cmd.CWT, 0.0001, "CWT is incorrect.");
        }
示例#15
0
        public void TestCWS_Min()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CWS = AdcpCommands.MIN_CWS;

            Assert.AreEqual(AdcpCommands.MIN_CWS, cmd.CWS, 0.0001, "CWS is incorrect.");
        }
示例#16
0
        public void TestCWS_Bad()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CWS = -15.004f;

            Assert.AreEqual(AdcpCommands.DEFAULT_CWS, cmd.CWS, 0.0001, "CWS is incorrect.");
        }
示例#17
0
        public void TestCVSFCmdStr()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CVSF = -126.254f;

            Assert.AreEqual("CVSF -126.254", cmd.CVSF_CmdStr(), "CVSF Command String is incorrect.");
        }
示例#18
0
        public void TestModeCmdStr1()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.Mode = AdcpCommands.AdcpMode.DVL;

            Assert.AreEqual(AdcpCommands.AdcpMode.DVL, cmd.Mode, "Mode is incorrect.");
            Assert.AreEqual("CDVL", cmd.Mode_ToString(), "Mode String is incorrect.");
            Assert.AreEqual(AdcpCommands.CMD_CDVL, cmd.Mode_ToString(), "Mode String is incorrect.");
            Assert.AreEqual(AdcpCommands.CMD_CDVL, cmd.Mode_CmdStr(), "Mode Command String is incorrect.");
        }
示例#19
0
        public void TestCEICmdStr()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CEI = new TimeValue(1, 2, 3, 4);

            Assert.AreEqual("CEI 01:02:03.04", cmd.CEI_CmdStr(), "CEI Command String is incorrect.");
        }
示例#20
0
        public void TestUtcTimeCmdStr()
        {
            AdcpCommands cmd = new AdcpCommands();

            string dateTime = DateTime.Now.ToUniversalTime().ToString("yyyy/MM/dd,HH:mm:ss", CultureInfo.CreateSpecificCulture("en-US"));

            Assert.AreEqual(AdcpCommands.CMD_STIME + " " + dateTime, cmd.GmtTime_CmdStr(), "Time Command String is incorrect.");
        }
示例#21
0
        public void TestCEOUTPUTCmdStr2()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CEOUTPUT = AdcpCommands.AdcpOutputMode.ASCII;

            Assert.AreEqual("CEOUTPUT 2", cmd.CEOUTPUT_CmdStr(), "CEOUTPUT Command String is incorrect.");
        }
示例#22
0
        public void TestCEPOCmdStr()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CEPO = "2323";

            Assert.AreEqual("CEPO 2323", cmd.CEPO_CmdStr(), "CEPO Command String is incorrect.");
        }
示例#23
0
        public void TestCEOUTPUT_BadMax()
        {
            AdcpCommands cmd = new AdcpCommands();

            Assert.AreEqual(AdcpCommands.DEFAULT_CEOUTPUT, cmd.CEOUTPUT, "CEOUTPUT is incorrect.");
        }
示例#24
0
        public void TestCERECORD1()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CERECORD_EnsemblePing = false;

            Assert.AreEqual(false, cmd.CERECORD_EnsemblePing, "CERECORD is incorrect.");
        }
示例#25
0
        public void TestCEPO()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CEPO = "333";

            Assert.AreEqual("333", cmd.CEPO, "CEPO is incorrect.");
        }
示例#26
0
        public void TestCWSS()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CWSS = 15.009f;

            Assert.AreEqual(15.009f, cmd.CWSS, 0.0001, "CWSS is incorrect.");
        }
示例#27
0
        public void TestCEPODefault()
        {
            AdcpCommands cmd = new AdcpCommands();

            Assert.AreEqual(AdcpCommands.DEFAULT_CEPO, cmd.CEPO, "CEPO is incorrect.");
        }
示例#28
0
        public void TestC485B_9600()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.C485B = Baudrate.BAUD_9600;

            Assert.AreEqual(Baudrate.BAUD_9600, cmd.C485B, "C485B BAUD_9600 is incorrect.");
        }
示例#29
0
        public void TestCERECORDCmdStr1()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.CERECORD_EnsemblePing = true;
            cmd.CERECORD_SinglePing = true;

            Assert.AreEqual("CERECORD 1,1", cmd.CERECORD_CmdStr(), "CERECORD Command String is incorrect.");
        }
示例#30
0
        public void TestC485B_9600_CmdStr()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.C485B = Baudrate.BAUD_9600;

            Assert.AreEqual("C485B 9600", cmd.C485B_CmdStr(), "C485B Command String BAUD_9600 is incorrect.");
        }
示例#31
0
        public void TestSetAdcpCommands()
        {
            AdcpConfiguration config = new AdcpConfiguration();
            SerialNumber serial = new SerialNumber("01200000000000000000000000000004");
            Dictionary<string, AdcpSubsystemConfig> result = config.SetCepo("2", serial);

            AdcpCommands commands = new AdcpCommands();
            commands.C232B = Baudrate.BAUD_9600;
            config.Commands = commands;

            Assert.AreNotEqual(AdcpCommands.DEFAULT_C232B, config.Commands.C232B, "AdcpCommand Not is incorrect.");
            Assert.AreEqual(Baudrate.BAUD_9600, config.Commands.C232B, "AdcpCommand is incorrect.");
        }
示例#32
0
        public void TestCC422B_230400()
        {
            AdcpCommands cmd = new AdcpCommands();

            cmd.C422B = Baudrate.BAUD_230400;

            Assert.AreEqual(Baudrate.BAUD_230400, cmd.C422B, "C422B BAUD_230400 is incorrect.");
        }