AsterixDisplayAnalyser.CAT34.Intitialize C# (CSharp) Метод

Intitialize() публичный статический Метод

public static Intitialize ( bool Hard_Reset ) : void
Hard_Reset bool
Результат void
        public static void Intitialize(bool Hard_Reset)
        {
            if (!Hard_Reset)
                foreach (CAT34.CAT34DataItem Item in CAT34.I034DataItems)
                    Item.value = null;
            else
            {
                I034DataItems.Clear();

                // 1 I034/010 Data Source Identifier
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("010")].ID = "010";
                I034DataItems[ItemIDToIndex("010")].Description = "Data Source Identifier";

                I034DataItems[ItemIDToIndex("010")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("010")].CurrentlyPresent = false;

                // 2 I034/000 Message Type
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("000")].ID = "000";
                I034DataItems[ItemIDToIndex("000")].Description = "Message Type";

                I034DataItems[ItemIDToIndex("000")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("000")].CurrentlyPresent = false;

                // 3 I034/030 Time-of-Day
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("030")].ID = "030";
                I034DataItems[ItemIDToIndex("030")].Description = "Time-of-Day";

                I034DataItems[ItemIDToIndex("030")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("030")].CurrentlyPresent = false;

                // 4 I034/020 Sector Number
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("020")].ID = "020";
                I034DataItems[ItemIDToIndex("020")].Description = "Sector Number";

                I034DataItems[ItemIDToIndex("020")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("020")].CurrentlyPresent = false;

                // 5 I034/041 Antenna Rotation Period
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("041")].ID = "041";
                I034DataItems[ItemIDToIndex("041")].Description = "Antenna Rotation Period ";

                I034DataItems[ItemIDToIndex("041")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("041")].CurrentlyPresent = false;

                // 6 I034/050 System Configuration and Status
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("050")].ID = "050";
                I034DataItems[ItemIDToIndex("050")].Description = "System Configuration and Status";

                I034DataItems[ItemIDToIndex("050")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("050")].CurrentlyPresent = false;

                // 7 I034/060 System Processing Mode
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("060")].ID = "060";
                I034DataItems[ItemIDToIndex("060")].Description = "System Processing Mode";

                I034DataItems[ItemIDToIndex("060")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("060")].CurrentlyPresent = false;

                // 8 I034/070 Message Count Values
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("070")].ID = "070";
                I034DataItems[ItemIDToIndex("070")].Description = "Message Count Values";

                I034DataItems[ItemIDToIndex("070")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("070")].CurrentlyPresent = false;

                // 9 I034/100 Generic Polar Window
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("100")].ID = "100";
                I034DataItems[ItemIDToIndex("100")].Description = "Generic Polar Window";

                I034DataItems[ItemIDToIndex("100")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("100")].CurrentlyPresent = false;

                // 10 I034/110 Data Filter
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("110")].ID = "110";
                I034DataItems[ItemIDToIndex("110")].Description = "Data Filter";

                I034DataItems[ItemIDToIndex("110")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("110")].CurrentlyPresent = false;

                // 11 I034/120 3D-Position of Data Source
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("120")].ID = "120";
                I034DataItems[ItemIDToIndex("120")].Description = "3D-Position of Data Source ";

                I034DataItems[ItemIDToIndex("120")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("120")].CurrentlyPresent = false;

                // 12 I034/090 Collimation Error
                I034DataItems.Add(new CAT34DataItem());
                I034DataItems[ItemIDToIndex("090")].ID = "090";
                I034DataItems[ItemIDToIndex("090")].Description = "Collimation Error";

                I034DataItems[ItemIDToIndex("090")].HasBeenPresent = false;
                I034DataItems[ItemIDToIndex("090")].CurrentlyPresent = false;
            }
        }

Usage Example

Пример #1
0
        // This method will accept a buffer of data with the assumption that
        // category has been determined. It will then decode the data and save
        // it in the shared buffer. Everry time a message is passed in the data
        // will be appended to the buffer. This means that each line will contain
        // data for one message. For data items which are not in the message,
        // indicated by the FSPEC field, N/A will be inserted instead. The shared
        // buffer is loacted in the SharedData and will not be saved. It is responsibility
        // of the user to save the data in a file it desired.
        public static void Do(byte[] Data)
        {
            /////////////////////////////////////////////////////////////////////////
            //
            // Next version of Category 002: PSR Radar, M-SSR Radar, Mode-S Station
            //                                               Length in bytes
            //

            // I002/000, Message Type                        1
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("000")].CurrentlyPresent == true)
            {
                CAT34I000UserData.DecodeCAT34I000(Data);
            }

            // 3 I034/030 Time-of-Day                           3
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("030")].CurrentlyPresent == true)
            {
                CAT34I030UserData.DecodeCAT34I030(Data);
            }
            // 4 I034/020 Sector Number                         1
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("020")].CurrentlyPresent == true)
            {
                CAT34I020UserData.DecodeCAT34I020(Data);
            }
            // 5 I034/041 Antenna Rotation Period               2
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("041")].CurrentlyPresent == true)
            {
                CAT34I041UserData.DecodeCAT34I041(Data);
            }
            // 6 I034/050 System Configuration and Status       1+
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("050")].CurrentlyPresent == true)
            {
                CAT34I050UserData.DecodeCAT34I050(Data);
            }
            // 7 I034/060 System Processing Mode                1+
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("060")].CurrentlyPresent == true)
            {
                CAT34I060UserData.DecodeCAT34I060(Data);
            }
            // FX

            // 8 I034/070 Message Count Values                  1+2N
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("070")].CurrentlyPresent == true)
            {
                CAT34I070UserData.DecodeCAT34I070(Data);
            }
            // 9 I034/100 Generic Polar Window                  8
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("100")].CurrentlyPresent == true)
            {
                CAT34I100UserData.DecodeCAT34I100(Data);
            }
            // 10 I034/110 Data Filter                          1
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("110")].CurrentlyPresent == true)
            {
                CAT34I110UserData.DecodeCAT34I110(Data);
            }
            // 11 I034/120 3D-Position of Data Source           8
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("120")].CurrentlyPresent == true)
            {
                CAT34I120UserData.DecodeCAT34I120(Data);
            }
            // 12 I034/090 Collimation Error                    2
            if (CAT34.I034DataItems[CAT34.ItemIDToIndex("090")].CurrentlyPresent == true)
            {
                CAT34I090UserData.DecodeCAT34I090(Data);
            }

            ////////////////////////////////////////////////////////////////////////////////////
            // All CAT34 data has been decoded, so lets save off the message data to the global
            // storage for latter usage

            MainASTERIXDataStorage.CAT34Data CAT34MessageData = new MainASTERIXDataStorage.CAT34Data();
            foreach (CAT34.CAT34DataItem Item in CAT34.I034DataItems)
            {
                CAT34.CAT34DataItem MyItem = new CAT34.CAT34DataItem();
                MyItem.CurrentlyPresent = Item.CurrentlyPresent;
                MyItem.Description      = Item.Description;
                MyItem.HasBeenPresent   = Item.HasBeenPresent;
                MyItem.ID    = Item.ID;
                MyItem.value = Item.value;
                CAT34MessageData.CAT34DataItems.Add(MyItem);
            }
            MainASTERIXDataStorage.CAT34Message.Add(CAT34MessageData);
            CAT34.Intitialize(false);
        }