示例#1
0
 public RCLBLAReceivedEventArgs(uLBLBaseIDs bID, double bLat, double bLon, double bDpt, double bBat, uLBLPingerDataIDs pDataID, double pData, double toaSec)
 {
     BaseID       = bID;
     BaseLat      = bLat;
     BaseLon      = bLon;
     BaseDpt      = bDpt;
     BaseBat      = bBat;
     PingerDataID = pDataID;
     PingerData   = pData;
     TOASecond    = toaSec;
 }
示例#2
0
        private void RC_LBLA_Parse(object[] parameters)
        {
            try
            {
                // IC_D2H_LBLA           $PUWVA,baseID,baseLat,baseLon,baseDpt,baseBat,pingerData,TOAsecond
                uLBLBaseIDs baseID     = (uLBLBaseIDs)(int)parameters[0];
                double      baseLat    = doubleNullChecker(parameters[1]);
                double      baseLon    = doubleNullChecker(parameters[2]);
                double      baseDpt    = doubleNullChecker(parameters[3]);
                double      baseBat    = doubleNullChecker(parameters[4]);
                int         pingerData = (int)parameters[5];
                double      TOASecond  = doubleNullChecker(parameters[6]);

                double            pValue  = 0.0;
                uLBLPingerDataIDs pDataID = PingerDataDecode(pingerData, out pValue);

                RCLBLAReceived.Rise(this, new RCLBLAReceivedEventArgs(baseID, baseLat, baseLon, baseDpt, baseBat, pDataID, pValue, TOASecond));
            }
            catch (Exception ex)
            {
                OnInfoEvent(ex);
            }
        }
示例#3
0
        private uLBLPingerDataIDs PingerDataDecode(int data, out double value)
        {
            uLBLPingerDataIDs result = uLBLPingerDataIDs.Invalid;

            value = double.NaN;

            if (data < uWAVE.CR_TMP_OFFSET)
            {
                value  = (data - uWAVE.CR_DPT_OFFSET) * uWAVE.CR_DPT_SCALE + uWAVE.MIN_DEPTH_M;
                result = uLBLPingerDataIDs.DPT;
            }
            else if (data < uWAVE.CR_BAT_OFFSET)
            {
                value  = (data - uWAVE.CR_TMP_OFFSET) * uWAVE.CR_TMP_SCALE + uWAVE.MIN_TEMPERATURE_C;
                result = uLBLPingerDataIDs.TMP;
            }
            else if (data < uWAVE.CR_BAT_OFFSET + uWAVE.CR_BAT_CRANGE)
            {
                value  = (data - uWAVE.CR_BAT_OFFSET) * uWAVE.CR_BAT_SCALE + uWAVE.MIN_BAT_VOLTAGE;
                result = uLBLPingerDataIDs.BAT;
            }

            return(result);
        }