Beispiel #1
0
        public static List <GroundLocation> PopulateGroundObjectList(string className)
        {
            List <GroundLocation> locations          = new List <GroundLocation>();
            StkObjectsLibrary     mStkObjectsLibrary = new StkObjectsLibrary();
            string           simpleName;
            string           classNameTemp;
            StringCollection objectNames = mStkObjectsLibrary.GetObjectPathListFromInstanceNamesXml(CommonData.StkRoot.AllInstanceNamesToXML(), "");

            foreach (string objectName in objectNames)
            {
                classNameTemp = mStkObjectsLibrary.ClassNameFromObjectPath(objectName);
                if (classNameTemp == className)
                {
                    GroundLocation current = new GroundLocation();
                    simpleName           = mStkObjectsLibrary.ObjectName(objectName);
                    current.LocationName = simpleName;
                    string simplePath = mStkObjectsLibrary.SimplifiedObjectPath(objectName);
                    current.SimplePath = simplePath;
                    List <double> location = GetGroundLocation(current.SimplePath);
                    current.Latitude  = location[0];
                    current.Longitude = location[1];
                    current.Altitude  = location[2];
                    locations.Add(current);
                }
            }
            return(locations);
        }
Beispiel #2
0
        public void SetSite(IAgUiPluginEmbeddedControlSite site)
        {
            _mPEmbeddedControlSite = site;
            _mUiPlugin             = _mPEmbeddedControlSite.Plugin as Setup;
            _mStkObjectsLibrary    = new StkObjectsLibrary();

            //EXAMPLE: Hooking to STK Exents
            CommonData.StkRoot.OnStkObjectAdded   += new IAgStkObjectRootEvents_OnStkObjectAddedEventHandler(m_root_OnStkObjectAdded);
            CommonData.StkRoot.OnStkObjectDeleted += new IAgStkObjectRootEvents_OnStkObjectDeletedEventHandler(m_root_OnStkObjectDeleted);

            CommonData.DirectoryStr = _mStkObjectsLibrary.GetScenarioDirectory();

            CommonData.SavedViewList     = new List <ViewData>();
            CommonData.InitialObjectData = SmartViewFunctions.GetObjectData();

            PopulateContextViews();
            _mPEmbeddedControlSite.Window.Width = _toolbarWidth + 5;
        }
        public void SetSite(IAgUiPluginEmbeddedControlSite site)
        {
            _mPEmbeddedControlSite = site;
            _mUiPlugin             = _mPEmbeddedControlSite.Plugin as Setup;
            _mStkObjectsLibrary    = new StkObjectsLibrary();

            //EXAMPLE: Hooking to STK Exents
            CommonData.StkRoot.OnStkObjectAdded      += new IAgStkObjectRootEvents_OnStkObjectAddedEventHandler(m_root_OnStkObjectAdded);
            CommonData.StkRoot.OnStkObjectDeleted    += new IAgStkObjectRootEvents_OnStkObjectDeletedEventHandler(m_root_OnStkObjectDeleted);
            CommonData.StkRoot.OnScenarioSave        += new IAgStkObjectRootEvents_OnScenarioSaveEventHandler(m_root_OnStkSave);
            CommonData.StkRoot.OnScenarioBeforeClose += new IAgStkObjectRootEvents_OnScenarioBeforeCloseEventHandler(m_root_OnStkScenarioClose);
            CommonData.StkRoot.OnAnimationPlayback   += new IAgStkObjectRootEvents_OnAnimationPlaybackEventHandler(m_root_OnStkAnimationPlayback);
            CommonData.StkRoot.OnAnimationPause      += new IAgStkObjectRootEvents_OnAnimationPauseEventHandler(m_root_OnStkAnimationPause);

            CommonData.DirectoryStr = _mStkObjectsLibrary.GetScenarioDirectory();

            CommonData.SavedViewList     = new List <ViewData>();
            CommonData.InitialObjectData = SmartViewFunctions.GetObjectData();

            PopulateContextViews();
            AutoSize();
        }
Beispiel #4
0
        public static List <string> PopulateListByClass(string className)
        {
            //Returning full object path for each object
            List <string>     objectPaths = new List <string>();
            StkObjectsLibrary library     = new StkObjectsLibrary();
            IAgExecCmdResult  result;

            if (className == "Satellite")
            {
                result = CommonData.StkRoot.ExecuteCommand("ShowNames * Class Satellite");
                if (result[0] != "None")
                {
                    string[] facArray = result[0].Split(null);
                    foreach (var item in facArray)
                    {
                        if (item != null && item != "")
                        {
                            objectPaths.Add(library.TruncatedObjectPath(item));
                        }
                    }
                }
            }
            else if (className == "Facility")
            {
                result = CommonData.StkRoot.ExecuteCommand("ShowNames * Class Facility");
                if (result[0] != "None")
                {
                    string[] facArray = result[0].Split(null);
                    foreach (var item in facArray)
                    {
                        if (item != null && item != "")
                        {
                            objectPaths.Add(library.TruncatedObjectPath(item));
                        }
                    }
                }
            }
            else if (className == "Place")
            {
                result = CommonData.StkRoot.ExecuteCommand("ShowNames * Class Place");
                if (result[0] != "None")
                {
                    string[] facArray = result[0].Split(null);
                    foreach (var item in facArray)
                    {
                        if (item != null && item != "")
                        {
                            objectPaths.Add(library.TruncatedObjectPath(item));
                        }
                    }
                }
            }
            else if (className == "Target")
            {
                result = CommonData.StkRoot.ExecuteCommand("ShowNames * Class Target");
                if (result[0] != "None")
                {
                    string[] facArray = result[0].Split(null);
                    foreach (var item in facArray)
                    {
                        if (item != null && item != "")
                        {
                            objectPaths.Add(library.TruncatedObjectPath(item));
                        }
                    }
                }
            }
            else if (className == "Aircraft")
            {
                result = CommonData.StkRoot.ExecuteCommand("ShowNames * Class Aircraft");
                if (result[0] != "None")
                {
                    string[] facArray = result[0].Split(null);
                    foreach (var item in facArray)
                    {
                        if (item != null && item != "")
                        {
                            objectPaths.Add(library.TruncatedObjectPath(item));
                        }
                    }
                }
            }
            else if (className == "Missile")
            {
                result = CommonData.StkRoot.ExecuteCommand("ShowNames * Class Missile");
                if (result[0] != "None")
                {
                    string[] facArray = result[0].Split(null);
                    foreach (var item in facArray)
                    {
                        if (item != null && item != "")
                        {
                            objectPaths.Add(library.TruncatedObjectPath(item));
                        }
                    }
                }
            }
            else if (className == "Sensor")
            {
                result = CommonData.StkRoot.ExecuteCommand("ShowNames * Class Sensor");
                if (result[0] != "None")
                {
                    string[] sensorArray = result[0].Split(null);
                    foreach (var item in sensorArray)
                    {
                        if (item != null && item != "")
                        {
                            objectPaths.Add(library.TruncatedObjectPath(item));
                        }
                    }
                }
            }
            else if (className == "Receiver")
            {
                result = CommonData.StkRoot.ExecuteCommand("ShowNames * Class Receiver");
                if (result[0] != "None")
                {
                    string[] sensorArray = result[0].Split(null);
                    foreach (var item in sensorArray)
                    {
                        if (item != null && item != "")
                        {
                            objectPaths.Add(library.TruncatedObjectPath(item));
                        }
                    }
                }
            }
            else if (className == "Transmitter")
            {
                result = CommonData.StkRoot.ExecuteCommand("ShowNames * Class Transmitter");
                if (result[0] != "None")
                {
                    string[] sensorArray = result[0].Split(null);
                    foreach (var item in sensorArray)
                    {
                        if (item != null && item != "")
                        {
                            objectPaths.Add(library.TruncatedObjectPath(item));
                        }
                    }
                }
            }
            return(objectPaths);
        }