Administrator 7 달 전
부모
커밋
d10f081a56

+ 7 - 182
ipslib/Ips.Library.Entity/Ephs/Tle.cs

@@ -32,104 +32,21 @@ namespace Ips.Library.Entity
         }
 
         private string satName; /*!<Object Name Identifier*/
-
-        private string noradID; /*!< NORAD Identification Number */
-        private Enum.SatClass classification; /*!< NORAD Satellite Classification */
-
-        private int startYear; /*!< International Designator 2 digits StartYear (06)*/
-        private int startNumber; /*!< International Designator 3 digits StartNumber (546)*/
-        private string pieceLaunch; /*!< International Designator 3 symbols Piece of Launch (AAA)*/
-
         private int epochYear;  /*!< Epoch 2 digits StartYear (08)*/
         private double epochDay;  /*!< Epoch fractional portion of the Day (264.51782528)*/
-
-        private double firstMeanMotion; /*!< First Time Derivative of the Mean Motion divided by two (−.00002182)*/
-        private double secondMeanMotion; /*!< Second Time Derivative of Mean Motion divided by six (00000-0)*/
-        private double dragTerm; /*!< BSTAR drag term  (-11606-4)*/
-        private double ephemeris; /*!< Ephemeris type (0 = SGP4-Model)*/
-        private int setNumber; /*!< Element set number. incremented when a new TLE is generated for this object (124)*/
-        private int checksum1; /*!< Checksum for first Line of TLE Modulo 10 (7)*/
-
-
         private int satNumber;  /*!< Satellite Number (25544) */
-        private double inclination; /*!< Inclination in Degrees (51.6416)*/
-        private double rightAscension; /*!< Right Ascension of the Ascending Node ín Degrees (247.4627)*/
-        private double eccentricity; /*!< Eccentricity (0006703) */
-        private double perigee; /*!< Argument of Perigee in degrees (130.5360)*/
-        private double meanAnomoly; /*!< Mean Anomaly in Degrees (325.0288) */
-        private double meanMotion; /*!< Mean Motion Revs per day (15.72125391) */
-        private double relevationNumber; /*!< Revolution number at epoch (56353) */
-        private int checksum2; /*!< Checksum for second Line of TLE Modulo 10 (7)*/
 
         public Tle()
         {
 
         }
 
-        public Tle(string name)
-        {
-
-        }
-        public Tle(string name, string id, Enum.SatClass clas, int startY, int startNr,
-            string piece, int epochY, double epochD, double firstMM, double secondMM,
-            double drag, double ephem, int setNr, int check1, int satNr, double incl,
-            double rightAsc, double ecce, double peri, double meanAn, double meanMo,
-            double relevationNr, int check2)
+        public Tle(string satName, int satNumber, int year, double day)
         {
-            satName = name;
-            noradID = id;
-            classification = clas;
-            startYear = startY;
-            startNumber = startNr;
-            pieceLaunch = piece;
-            epochYear = epochY;
-            epochDay = epochD;
-            firstMeanMotion = firstMM;
-            secondMeanMotion = secondMM;
-            dragTerm = drag;
-            ephemeris = ephem;
-            setNumber = setNr;
-            checksum1 = check1;
-            satNumber = satNr;
-            inclination = incl;
-            rightAscension = rightAsc;
-            eccentricity = ecce;
-            perigee = peri;
-            meanAnomoly = meanAn;
-            meanMotion = meanMo;
-            relevationNumber = relevationNr;
-            checksum2 = check2;
-        }
-
-        public Tle(string name, string id, int clas, int startY, int startNr,
-            string piece, int epochY, double epochD, double firstMM, double secondMM,
-            double drag, double ephem, int setNr, int check1, int satNr, double incl,
-            double rightAsc, double ecce, double peri, double meanAn, double meanMo,
-            double relevationNr, int check2)
-        {
-            satName = name;
-            noradID = id;
-            classification = (Enum.SatClass)clas;
-            startYear = startY;
-            startNumber = startNr;
-            pieceLaunch = piece;
-            epochYear = epochY;
-            epochDay = epochD;
-            firstMeanMotion = firstMM;
-            secondMeanMotion = secondMM;
-            dragTerm = drag;
-            ephemeris = ephem;
-            setNumber = setNr;
-            checksum1 = check1;
-            satNumber = satNr;
-            inclination = incl;
-            rightAscension = rightAsc;
-            eccentricity = ecce;
-            perigee = peri;
-            meanAnomoly = meanAn;
-            meanMotion = meanMo;
-            relevationNumber = relevationNr;
-            checksum2 = check2;
+            this.satName = satName;
+            this.satNumber = satNumber;
+            this.epochYear = year;
+            this.epochDay = day;
         }
 
         public bool isValidData()
@@ -142,34 +59,9 @@ namespace Ips.Library.Entity
             return satName;
         }
 
-        public string getNoradID()
-        {
-            return noradID;
-        }
-
-        public int getStartYear()
-        {
-            return startYear;
-        }
-
-        public int getStartNr()
-        {
-            return startNumber;
-        }
-
-        public string getPice()
-        {
-            return pieceLaunch;
-        }
-
-        public int getEpochYear()
-        {
-            return epochYear;
-        }
-
-        public double getEpochDay()
+        public int getSatNumber()
         {
-            return epochDay;
+            return satNumber;
         }
 
         public DateTime getEpochTime()
@@ -182,73 +74,6 @@ namespace Ips.Library.Entity
             var epoch = new DateTime(year, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddDays(epochDay - 1);
             return epoch.ToLocalTime();
         }
-
-        public double getFirstMeanMotion()
-        {
-            return firstMeanMotion;
-        }
-        public double getSecondMeanMotion()
-        {
-            return secondMeanMotion;
-        }
-        public double getDrag()
-        {
-            return dragTerm;
-        }
-        public double getEphemeris()
-        {
-            return ephemeris;
-        }
-        public double getSetNumber()
-        {
-            return setNumber;
-        }
-        public int getSatNumber()
-        {
-            return satNumber;
-        }
-        public double getInclination()
-        {
-            return inclination;
-        }
-        public double getRightAscendingNode()
-        {
-            return rightAscension;
-        }
-        public double getEccentriciy()
-        {
-            return eccentricity;
-        }
-
-        public double getPerigee()
-        {
-            return perigee;
-        }
-        public double getMeanAnomoly()
-        {
-            return meanAnomoly;
-        }
-        public double getMeanMotion()
-        {
-            return meanMotion;
-        }
-        public double getRelevationNumber()
-        {
-            return relevationNumber;
-        }
-        public int getClassification()
-        {
-            return (int)classification;
-        }
-
-        public int getFirstCheckSum()
-        {
-            return checksum1;
-        }
-        public int getSecCheckSum()
-        {
-            return checksum2;
-        }
     }
 
 

+ 7 - 193
ipsmodule/eph/Ips.Eph.ResolveUtil/TleResolveUtil.cs

@@ -12,37 +12,17 @@ namespace Ips.Eph.ResolveUtil
     {
         public static Tle ParseTle(string tleLine1, string tleLine2, string tleName = null)
         {
-            int satCl = 0;
-            string noradId;
-            int startYear = 0;
-            int startNumber = 0;
-            string intDes = "--";
+            int count = 0;
             int epochYear;
             double epochDay;
 
-            double firstMeanMotion;
-            double secondMeanMotion;
-            double dragTerm;
-            double ephemeris;
-            int setNumber = 0;
-            int checksum1;
-            int count = 0;
-
-            //bool valid1 = isValid(tleLine1);
-            //bool valid2 = isValid(tleLine2);
-
-            //if (!valid1 || !valid2)
-            //{
-            //    throw new InvalidDataException($"The data contained checksum error(s) in {((valid1) ? "" : "line1")} {((valid2) ? "" : "line2")}. ");
-            //}
-
             Tle ret;
             try
             {
+                string[] line1 = new string[9];
                 try
                 {
                     string[] s1 = tleLine1.Split(' ');
-                    string[] line1 = new string[9];
 
                     for (int i = 0; i < s1.Length; i++)
                     {
@@ -52,112 +32,10 @@ namespace Ips.Eph.ResolveUtil
                             count++;
                         }
                     }
-
-                    string sclass = line1[1].Substring(line1[1].Length - 1);
-                    if (sclass == "U")
-                    {
-                        satCl = 0x0;
-                    }
-                    if (sclass == "C")
-                    {
-                        satCl = 0x1;
-                    }
-                    if (sclass == "S")
-                    {
-                        satCl = 0x2;
-                    }
-
-                    noradId = line1[1].Remove(line1[1].Length - 1);
-
                     int noID = 0;
-                    if (count == 8)
-                    {
-                        noID = -1;
-                    }
-                    else
-                    {
-                        startYear = Convert.ToInt32(line1[2].Substring(0, 2));
-                        startNumber = Convert.ToInt32(line1[2].Substring(2, 3));
-                        intDes = line1[2].Substring(5);
-                    }
-
                     epochYear = Convert.ToInt32(line1[3 + noID].Substring(0, 2));
                     string epDay = line1[3 + noID].Substring(2);
                     epochDay = double.Parse(epDay, CultureInfo.GetCultureInfo("en-US"));
-
-                    firstMeanMotion = double.Parse(line1[4 + noID], CultureInfo.GetCultureInfo("en-US"));
-
-                    int zeros = Convert.ToInt32(line1[5 + noID].Substring(line1[5].Length - 1));
-                    if (line1[5 + noID].Equals("00000+0"))
-                    {
-                        line1[5 + noID] = line1[5 + noID].Substring(0, line1[5 + noID].IndexOf('+'));
-                    }
-                    else
-                    {
-                        line1[5 + noID] = line1[5 + noID].Substring(0, line1[5 + noID].IndexOf('-'));
-                    }
-                    if (line1[5 + noID].Length > 0)
-                    {
-                        if (line1[5 + noID][0] == '+' || line1[5 + noID][0] == '-')
-                        {
-                            line1[5 + noID] = line1[5 + noID].Insert(1, ".");
-                            for (int i = 0; i < zeros; i++)
-                                line1[5 + noID] = line1[5 + noID].Insert(2, "0");
-                        }
-                        else
-                        {
-                            line1[5 + noID] = line1[5 + noID].Insert(0, ".");
-                            for (int i = 0; i < zeros; i++)
-                                line1[5 + noID] = line1[5 + noID].Insert(1, "0");
-                        }
-                        secondMeanMotion = double.Parse(line1[5 + noID], CultureInfo.GetCultureInfo("en-US"));
-                    }
-                    else
-                    {
-                        secondMeanMotion = 0.0;
-                    }
-
-                    zeros = Convert.ToInt32(line1[6 + noID].Substring(line1[6 + noID].Length - 1));
-                    if (line1[6 + noID][line1[6 + noID].Length - 2] == '-')
-                    {
-                        line1[6 + noID] = line1[6 + noID].Substring(0, line1[6 + noID].IndexOf('-'));
-                    }
-                    else
-                    {
-                        line1[6 + noID] = line1[6 + noID].Substring(0, line1[6 + noID].IndexOf('+'));
-                    }
-                    if (line1[6 + noID].Length > 0)
-                    {
-                        if (line1[6 + noID][0] == '+' || line1[6 + noID][0] == '-')
-                        {
-                            line1[6 + noID] = line1[6 + noID].Insert(1, ".");
-                            for (int i = 0; i < zeros; i++)
-                                line1[6 + noID] = line1[6 + noID].Insert(2, "0");
-                        }
-                        else
-                        {
-                            line1[6 + noID] = line1[6 + noID].Insert(0, ".");
-                            for (int i = 0; i < zeros; i++)
-                                line1[6 + noID] = line1[6 + noID].Insert(1, "0");
-                        }
-                        dragTerm = double.Parse(line1[6 + noID], CultureInfo.GetCultureInfo("en-US"));
-                    }
-                    else
-                    {
-                        dragTerm = 0.0;
-                    }
-
-                    ephemeris = double.Parse(line1[7 + noID], CultureInfo.GetCultureInfo("en-US"));
-
-                    if (line1[8 + noID].Length > 1)
-                    {
-                        setNumber = Convert.ToInt32(line1[8 + noID].Substring(0, line1[8 + noID].Length - 1));
-                        checksum1 = Convert.ToInt32(line1[8 + noID].Substring(line1[8 + noID].Length - 1));
-                    }
-                    else
-                    {
-                        checksum1 = Convert.ToInt32(line1[8 + noID]);
-                    }
                 }
                 catch (Exception ex)
                 {
@@ -165,15 +43,6 @@ namespace Ips.Eph.ResolveUtil
                 }
 
                 int satNumber = 0;
-                double inclination = 0;
-                double rightAscension = 0;
-                double eccentricity = 0;
-                double perigee = 0;
-                double meanAnomoly = 0;
-                double meanMotion = 0;
-                double relevationNumber = 0;
-                int checksum2 = 0;
-
                 //Start Line2 
                 try
                 {
@@ -190,47 +59,16 @@ namespace Ips.Eph.ResolveUtil
                     }
 
                     satNumber = Convert.ToInt32(line2[1]);
-                    inclination = double.Parse(line2[2], CultureInfo.GetCultureInfo("en-US"));
-                    rightAscension = double.Parse(line2[3], CultureInfo.GetCultureInfo("en-US"));
-                    line2[4] = line2[4].Insert(0, ".");
-                    eccentricity = double.Parse(line2[4], CultureInfo.GetCultureInfo("en-US"));
-                    perigee = double.Parse(line2[5], CultureInfo.GetCultureInfo("en-US"));
-                    meanAnomoly = double.Parse(line2[6], CultureInfo.GetCultureInfo("en-US"));
-                    if (line2[8] != null)
-                    {
-                        meanMotion = double.Parse(line2[7], CultureInfo.GetCultureInfo("en-US"));
-                        checksum2 = Convert.ToInt32(line2[8].Substring(line2[8].Length - 1));
-                        relevationNumber = double.Parse(line2[8].Substring(0, line2[8].Length - 1),
-                            CultureInfo.GetCultureInfo("en-US"));
-                    }
-                    else
-                    {
-                        checksum2 = Convert.ToInt32(line2[7].Substring(line2[7].Length - 1));
-                        meanMotion = double.Parse(line2[7].Substring(0, 11),
-                            CultureInfo.GetCultureInfo("en-US"));
-                        relevationNumber = double.Parse(line2[7].Substring(11, 5),
-                            CultureInfo.GetCultureInfo("en-US"));
-                    }
-
-                    if (tleName == null)
-                    {
-                        tleName = startYear.ToString() + startNumber.ToString() + intDes;
-                    }
-                    if (tleName[0] == '0' && tleName[1] == ' ')
-                    {
-                        tleName = tleName.Remove(0, 2);
-                    }
                 }
                 catch (Exception ex)
                 {
                     throw new InvalidDataException("Could not parse Line 2.", ex);
                 }
 
-                ret = new Tle(tleName, noradId, (Tle.Enum.SatClass)satCl, startYear, startNumber, intDes,
-                epochYear, epochDay, firstMeanMotion, secondMeanMotion, dragTerm,
-                ephemeris, setNumber, checksum1, satNumber, inclination, rightAscension,
-                eccentricity, perigee, meanAnomoly, meanMotion, relevationNumber, checksum2);
-                ret.TleName = tleName;
+                ret = new Tle(tleName, satNumber, epochYear, epochDay);
+                ret.TleName = tleName.Trim();
+                if (ret.TleName.StartsWith("0 "))
+                    ret.TleName = ret.TleName.Substring(2);
                 ret.Line1 = tleLine1;
                 ret.Line2 = tleLine2;
             }
@@ -267,6 +105,7 @@ namespace Ips.Eph.ResolveUtil
                         }
                         if (lineNr == "2" && (line1 != null))
                         {
+                            if (name.Contains("TBA")) continue;//TBA表示还未发射的卫星
                             results.Add(ParseTle(line1, line, name));
                         }
                     }
@@ -274,30 +113,5 @@ namespace Ips.Eph.ResolveUtil
             }
             return results;
         }
-
-        private static bool isValid(string line1)
-        {
-            int sum1 = 0;
-            for (int i = 0; i < line1.Count() - 1; i++)
-            {
-                if (char.IsNumber(line1[i]))
-                {
-                    sum1 = sum1 + (int)Char.GetNumericValue(line1[i]);
-                }
-                else
-                {
-                    if (line1[i] == '-')
-                    {
-                        sum1++;
-                    }
-                }
-            }
-            int result = sum1 % 10;
-            int checksum = (int)Char.GetNumericValue(line1[line1.Count() - 1]);
-            if (result == checksum)
-                return true;
-            else
-                return false;
-        }
     }
 }

+ 6 - 3
ipsservice/Ips.Service.CapServer/Service/AdcService.cs

@@ -104,8 +104,8 @@ namespace Ips.Service.CapServer
             sb.Append($"{DateTimeUtil.To1970s(dto.StartTime)} ");
             sb.Append($"{(int)dto.ClockType} ");
             sb.Append($"{(int)dto.TriggerMode} ");
-            sb.Append($"{dto.DdcFreq/1e6} ");
-            sb.Append($"{dto.ClockFreq/1e6} ");
+            sb.Append($"{dto.DdcFreq / 1e6} ");
+            sb.Append($"{dto.ClockFreq / 1e6} ");
             sb.Append($"{dto.Mutil} ");
             sb.Append($"{dto.Channels.Count} ");
             sb.Append($"{dto.TimeLen} ");
@@ -116,7 +116,10 @@ namespace Ips.Service.CapServer
             p.StartInfo.RedirectStandardOutput = true;
             p.StartInfo.UseShellExecute = false;
             p.Start();
-            var succeed = p.WaitForExit(dto.TimeLen * 2000);
+            var waitSeconds = (dto.StartTime - DateTime.Now).TotalSeconds;
+            if (waitSeconds <= 0)
+                waitSeconds = 0;
+            var succeed = p.WaitForExit(dto.TimeLen * 2000 + (int)waitSeconds + 1);
             if (!succeed)
             {
                 Stop();

+ 1 - 1
ipstool/ipssps2/Ips.Sps.Host.Win/IpsAboutForm.Designer.cs

@@ -70,7 +70,7 @@
             this.labelControl2.Name = "labelControl2";
             this.labelControl2.Size = new System.Drawing.Size(490, 133);
             this.labelControl2.TabIndex = 12;
-            this.labelControl2.Text = "      本软件主要提供对辐射源信号进行侦察定位的功能,包括定位任务、邻星查找任务两种任务模式。\r\n      软件包括任务管理、态势地图、采集数据、参估数据、" +
+            this.labelControl2.Text = "      本软件主要提供对辐射源信号进行三星定位的功能\r\n      软件包括任务管理、态势地图、采集数据、参估数据、" +
     "卫星管理、星历管理、站点管理、采集管理、目标管理、信号管理等功能\r\n      本软件还存在不完善的地方和需要增加的功能,敬请指正和提出宝贵意见\r\n      " +
     "提供系统的技术支持,不断增加更新、更强的功能。";
             //