Ejemplo n.º 1
0
        public static MPCObsLine Parse(string asciiLine)
        {
            if (asciiLine.Length != 80)
            {
                return(null);
            }

            MPCObsLine instance = new MPCObsLine();

            instance.m_Designation_1_12    = asciiLine.Substring(0, 12);
            instance.m_NewDiscoveryFlag_13 = asciiLine.Substring(12, 1);
            instance.m_Note1_14            = asciiLine.Substring(13, 1);
            instance.m_Note2_15            = asciiLine.Substring(14, 1);
            instance.m_TimeString_16_32    = asciiLine.Substring(15, 32 - 16 + 1);
            instance.m_RAString_33_44      = asciiLine.Substring(32, 44 - 33 + 1);
            instance.m_DEString_45_56      = asciiLine.Substring(44, 56 - 45 + 1);
            instance.m_Reserved_57_64      = asciiLine.Substring(56, 64 - 57 + 1);
            instance.m_Magnitude_65_70     = asciiLine.Substring(64, 70 - 65 + 1);
            instance.m_MagnitudeBand_71    = asciiLine.Substring(70, 1);
            instance.m_Reserved_72_77      = asciiLine.Substring(71, 77 - 72 + 1);
            instance.m_ObsCode_78_80       = asciiLine.Substring(77, 3);

            return(instance);
        }
Ejemplo n.º 2
0
        public static MPCObsLine Parse(string asciiLine)
        {
            if (asciiLine.Length != 80) return null;

            MPCObsLine instance = new MPCObsLine();
            instance.m_Designation_1_12 = asciiLine.Substring(0, 12);
            instance.m_NewDiscoveryFlag_13 = asciiLine.Substring(12, 1);
            instance.m_Note1_14 = asciiLine.Substring(13, 1);
            instance.m_Note2_15 = asciiLine.Substring(14, 1);
            instance.m_TimeString_16_32 = asciiLine.Substring(15, 32 - 16 + 1);
            instance.m_RAString_33_44 = asciiLine.Substring(32, 44 - 33 + 1);
            instance.m_DEString_45_56 = asciiLine.Substring(44, 56 - 45 + 1);
            instance.m_Reserved_57_64 = asciiLine.Substring(56, 64 - 57 + 1);
            instance.m_Magnitude_65_70 = asciiLine.Substring(64, 70 - 65 + 1);
            instance.m_MagnitudeBand_71 = asciiLine.Substring(70, 1);
            instance.m_Reserved_72_77 = asciiLine.Substring(71, 77 - 72 + 1);
            instance.m_ObsCode_78_80 = asciiLine.Substring(77, 3);

            return instance;
        }
Ejemplo n.º 3
0
        public bool AddObservation(
			string designation, double raHours, double deDeg, 
			DateTime utcTime, TimeSpan timePrecision, double mag,
            MagnitudeBand band, bool isVideoNormalPosition, double? raUncertaintyArcSec, double? deUncertaintyArcSec)
        {
            lastObjectDesignation = designation;

            MPCObsLine obsLine = new MPCObsLine(Header.COD);
            obsLine.SetObject(designation);
            obsLine.SetPosition(raHours, deDeg, utcTime, isVideoNormalPosition);
            obsLine.SetMagnitude(mag, band);
            obsLine.SetUncertainty(raUncertaintyArcSec, deUncertaintyArcSec);

            string newLine = obsLine.BuildObservationASCIILine();
            if (ObsLines.Exists(l => newLine.Equals(l.BuildObservationASCIILine(), StringComparison.Ordinal)))
                return false;

            ObsLines.Add(obsLine);
            return true;
        }