示例#1
0
 private void PopulateDisplayReports(ComboBox box, ComboBox ddObject)
 {
     if (ddObject.SelectedIndex != -1)
     {
         string className = SmartViewFunctions.GetClassName(ddObject.Text);
         IAgVODataDisplayCollection ddCollection = null;
         if (className == "Satellite")
         {
             IAgSatellite myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + ddObject.Text) as IAgSatellite;
             ddCollection = myObject.VO.DataDisplay;
         }
         else if (className == "Aircraft")
         {
             IAgAircraft myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + ddObject.Text) as IAgAircraft;
             ddCollection = myObject.VO.DataDisplay;
         }
         else if (className == "Facility")
         {
             IAgFacility myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + ddObject.Text) as IAgFacility;
             ddCollection = myObject.VO.DataDisplays;
         }
         else if (className == "Missile")
         {
             IAgMissile myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + ddObject.Text) as IAgMissile;
             ddCollection = myObject.VO.DataDisplay;
         }
         else if (className == "GroundVehicle")
         {
             IAgGroundVehicle myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + ddObject.Text) as IAgGroundVehicle;
             ddCollection = myObject.VO.DataDisplay;
         }
         else if (className == "LaunchVehicle")
         {
             IAgLaunchVehicle myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + ddObject.Text) as IAgLaunchVehicle;
             ddCollection = myObject.VO.DataDisplay;
         }
         else if (className == "Place")
         {
             IAgPlace myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + ddObject.Text) as IAgPlace;
             ddCollection = myObject.VO.DataDisplays;
         }
         else if (className == "Target")
         {
             IAgTarget myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + ddObject.Text) as IAgTarget;
             ddCollection = myObject.VO.DataDisplays;
         }
         box.Items.Clear();
         Array reportNames = ddCollection.AvailableData;
         foreach (var name in reportNames)
         {
             box.Items.Add(name);
         }
         box.SelectedIndex = 0;
     }
 }
 private void TTDisplayObject_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (TTDisplayObject.SelectedIndex != -1)
     {
         TTDisplayReport.Items.Clear();
         if (TTDisplayObject.SelectedIndex == 0)
         {
             TTDisplayLocation.Enabled = true;
             TTDisplayReport.Items.Add("LLA Position");
             TTDisplayReport.Items.Add("Classical Orbital Elements");
             TTDisplayReport.Items.Add("Inertial Position Velocity");
             TTDisplayReport.Items.Add("Fixed Position Velocity");
         }
         else if (TTDisplayObject.SelectedIndex == 1)
         {
             TTDisplayLocation.Enabled = false;
             TTDisplayReport.Items.Add("RIC");
             TTDisplayReport.Items.Add("LLA Position");
             TTDisplayReport.Items.Add("Classical Orbital Elements");
             TTDisplayReport.Items.Add("Inertial Position Velocity");
             TTDisplayReport.Items.Add("Fixed Position Velocity");
         }
         else
         {
             TTDisplayLocation.Enabled = true;
             string className = SmartViewFunctions.GetClassName(TTDisplayObject.Text);
             IAgVODataDisplayCollection ddCollection = null;
             if (className == "Satellite")
             {
                 IAgSatellite myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + TTDisplayObject.Text) as IAgSatellite;
                 ddCollection = myObject.VO.DataDisplay;
             }
             Array reportNames = ddCollection.AvailableData;
             foreach (var name in reportNames)
             {
                 TTDisplayReport.Items.Add(name);
                 if (name.ToString() == CommonData.SavedViewList[CommonData.SelectedIndex].TtDataDisplayReportName)
                 {
                     TTDisplayReport.SelectedIndex = TTDisplayReport.Items.Count - 1;
                 }
             }
         }
         if (TTDisplayReport.SelectedIndex == -1)
         {
             TTDisplayReport.SelectedIndex = 0;
         }
     }
 }
示例#3
0
 private void DisplayObject_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (DisplayObject.SelectedIndex != -1)
     {
         string className = SmartViewFunctions.GetClassName(DisplayObject.Text);
         IAgVODataDisplayCollection ddCollection = null;
         if (className == "Satellite")
         {
             IAgSatellite myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + DisplayObject.Text) as IAgSatellite;
             ddCollection = myObject.VO.DataDisplay;
         }
         else if (className == "Aircraft")
         {
             IAgAircraft myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + DisplayObject.Text) as IAgAircraft;
             ddCollection = myObject.VO.DataDisplay;
         }
         else if (className == "Facility")
         {
             IAgFacility myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + DisplayObject.Text) as IAgFacility;
             ddCollection = myObject.VO.DataDisplays;
         }
         else if (className == "Missile")
         {
             IAgMissile myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + DisplayObject.Text) as IAgMissile;
             ddCollection = myObject.VO.DataDisplay;
         }
         else if (className == "GroundVehicle")
         {
             IAgGroundVehicle myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + DisplayObject.Text) as IAgGroundVehicle;
             ddCollection = myObject.VO.DataDisplay;
         }
         DisplayReport.Items.Clear();
         Array reportNames = ddCollection.AvailableData;
         foreach (var name in reportNames)
         {
             DisplayReport.Items.Add(name);
             if (name.ToString() == CommonData.SavedViewList[CommonData.SelectedIndex].DataDisplayReportName)
             {
                 DisplayReport.SelectedIndex = DisplayReport.Items.Count - 1;
             }
         }
         if (DisplayReport.SelectedIndex == -1)
         {
             DisplayReport.SelectedIndex = 0;
         }
     }
 }
        private void Unselect_Click(object sender, EventArgs e)
        {
            string className = null;

            if (ThreatList.FocusedItem != null)
            {
                foreach (int index in ThreatList.SelectedIndices)
                {
                    ThreatList.Items[index].Font = new Font(ThreatList.Items[index].Font, FontStyle.Regular);
                    if (_threatNames.Contains(ThreatList.Items[index].SubItems[0].Text))
                    {
                        className = SmartViewFunctions.GetClassName(ThreatList.Items[index].SubItems[0].Text);
                        _threatNames.Remove(className + "/" + ThreatList.Items[index].SubItems[0].Text);
                    }
                }
            }
        }
示例#5
0
 private void GEODisplayObject_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (GEODisplayObject.SelectedIndex != -1)
     {
         string className = SmartViewFunctions.GetClassName(GEODisplayObject.Text);
         IAgVODataDisplayCollection ddCollection = null;
         IAgSatellite myObject = CommonData.StkRoot.GetObjectFromPath(className + "/" + GEODisplayObject.Text) as IAgSatellite;
         ddCollection = myObject.VO.DataDisplay;
         Array reportNames = ddCollection.AvailableData;
         foreach (var name in reportNames)
         {
             GEODisplayReport.Items.Add(name);
             if (name.ToString() == CommonData.SavedViewList[CommonData.SelectedIndex].GeoDataDisplayReportName)
             {
                 GEODisplayReport.SelectedIndex = GEODisplayReport.Items.Count - 1;
             }
         }
         if (GEODisplayReport.SelectedIndex == -1)
         {
             GEODisplayReport.SelectedIndex = 0;
         }
     }
 }
示例#6
0
        private void Create_Click(object sender, EventArgs e)
        {
            string className;
            int    check;

            if (TypeSelect.SelectedIndex == 0) //3D
            {
                check = FieldCheck3D();
                if (check == 0)
                {
                    current.WindowName     = WindowSelect.Text;
                    current.WindowId       = SmartViewFunctions.GetWindowId(WindowSelect.Text, 1);
                    current.Name           = ViewName3D.Text;
                    current.ViewType       = TypeSelect.Text;
                    current.ViewObjectData = CommonData.CurrentViewObjectData;
                    className          = SmartViewFunctions.GetClassName(FocusedItem.Text);
                    current.ViewTarget = className + "/" + FocusedItem.Text;
                    current.ViewAxes   = "Inertial";

                    if (EnableUniversalOrbitTrack.Checked)
                    {
                        if (UniversalLeadTrail.Checked)
                        {
                            current.EnableUniversalOrbitTrack = true;
                            current.UniqueLeadTrail           = false;
                            if (LeadType3D.Text == "Time")
                            {
                                current.LeadType = LeadType3D.Text;
                                current.LeadTime = OrbitLeadTime.Text;
                            }
                            else
                            {
                                current.LeadType = LeadType3D.Text;
                            }

                            if (TrailType3D.Text == "Time")
                            {
                                current.TrailType = TrailType3D.Text;
                                current.TrailTime = OrbitTrailTime.Text;
                            }
                            else
                            {
                                current.TrailType = TrailType3D.Text;
                            }
                        }
                        else if (UniqueLeadTrail.Checked)
                        {
                            current.UniqueLeadTrail           = true;
                            current.EnableUniversalOrbitTrack = true;
                        }
                    }
                    else
                    {
                        current.EnableUniversalOrbitTrack = false;
                        current.LeadType  = "None";
                        current.TrailType = "None";
                    }

                    //Add required primary data display components
                    if (UseDataDisplay.Checked)
                    {
                        current.PrimaryDataDisplay.DataDisplayActive = true;
                    }
                    else
                    {
                        current.PrimaryDataDisplay.DataDisplayActive = false;
                    }
                    current.PrimaryDataDisplay.DataDisplayLocation = DisplayLocation.Text;
                    className = SmartViewFunctions.GetClassName(DisplayObject.Text);
                    current.PrimaryDataDisplay.DataDisplayObject     = className + "/" + DisplayObject.Text;
                    current.PrimaryDataDisplay.DataDisplayReportName = DisplayReport.Text;
                    className = SmartViewFunctions.GetClassName(PredataObject.Text);
                    current.PrimaryDataDisplay.PredataObject = className + "/" + PredataObject.Text;

                    //Define stored view if required by current view point option
                    if (UseCurrentViewPoint.Checked)
                    {
                        current.UseStoredView  = true;
                        current.StoredViewName = ViewName3D.Text;
                        CommonData.StkRoot.ExecuteCommand("VO * SaveStoredView \"" + ViewName3D.Text + "\" " + current.WindowId);
                    }
                    else
                    {
                        current.UseStoredView  = false;
                        current.StoredViewName = "None";
                    }
                }
            }
            else if (TypeSelect.SelectedIndex == 1) //2D
            {
                check = FieldCheck2D();
                if (check == 0)
                {
                    current.WindowName     = WindowSelect.Text;
                    current.WindowId       = SmartViewFunctions.GetWindowId(WindowSelect.Text, 0);
                    current.ViewObjectData = CommonData.CurrentViewObjectData;
                    current.Name           = ViewName2D.Text;
                    current.ViewType       = TypeSelect.Text;
                    current.ViewType2D     = TypeSelect2D.Text;
                    className               = SmartViewFunctions.GetClassName(ObjectName2D.Text);
                    current.ViewTarget      = className + "/" + ObjectName2D.Text;
                    current.ZoomCenterLat   = ZoomCenterLat.Text;
                    current.ZoomCenterLong  = ZoomCenterLong.Text;
                    current.ZoomCenterDelta = ZoomDelta.Text;

                    if (EnableUniversalGroundTrack.Checked)
                    {
                        if (LeadType2D.Text == "Time")
                        {
                            current.LeadType = LeadType2D.Text + " " + GroundLeadTime.Text;
                            current.LeadTime = GroundLeadTime.Text;
                        }
                        else
                        {
                            current.LeadType = LeadType2D.Text;
                        }

                        if (TrailType2D.Text == "Time")
                        {
                            current.TrailType = TrailType2D.Text + " " + GroundTrailTime.Text;
                            current.TrailTime = GroundTrailTime.Text;
                        }
                        else
                        {
                            current.TrailType = TrailType2D.Text;
                        }
                    }
                    else
                    {
                        current.LeadType  = "None";
                        current.TrailType = "None";
                    }
                }
            }
            if (UseCurrentTime.Checked)
            {
                current.UseAnimationTime = true;
                IAgAnimation animationRoot = (IAgAnimation)CommonData.StkRoot;
                double       currentTime   = animationRoot.CurrentTime;
                string       newTime       = CommonData.StkRoot.ConversionUtility.ConvertDate("EpSec", "UTCG", currentTime.ToString());
                current.AnimationTime = newTime.ToString();
            }
            else
            {
                current.UseAnimationTime = false;
                IAgScenario scenario = (IAgScenario)(CommonData.StkRoot.CurrentScenario);
                current.AnimationTime = scenario.StartTime;
            }
            if (ObjectHideShow.Checked)
            {
                current.ObjectHideShow = true;
                List <ObjectData> data = new List <ObjectData>();
                data = CommonData.CurrentViewObjectData;
                current.ViewObjectData = data;
            }
            else
            {
                current.ObjectHideShow = false;
            }
            if (UseVectorHideShow.Checked)
            {
                current.VectorHideShow = true;
            }
            else
            {
                current.VectorHideShow = false;
            }

            if (UseCameraPath.Checked)
            {
                current.UseCameraPath  = true;
                current.CameraPathName = CameraPathName.Text;
            }
            else
            {
                current.UseCameraPath = false;
            }
            CommonData.SavedViewList.Add(current);
            try
            {
                ReadWrite.WriteSavedViews(CommonData.DirectoryStr + "\\StoredViewData.json");
            }
            catch (Exception)
            {
                MessageBox.Show("Could not Write Stored Views File");
            }

            //try
            //{
            //    ReadWrite.WriteObjectData(CommonData.DirectoryStr + "\\StoredObjectData.txt");
            //}
            //catch (Exception)
            //{

            //    MessageBox.Show("Could not Write Object Data File");
            //}
            CommonData.NewView = true;
            this.Close();
        }
        private void PopulateComboBoxes()
        {
            TTViewName.Text = CommonData.SavedViewList[CommonData.SelectedIndex].Name;
            List <string> windowNames = SmartViewFunctions.GetWindowNames(1);

            foreach (var item in windowNames)
            {
                WindowSelect.Items.Add(item);
                if (item.Contains(CommonData.SavedViewList[CommonData.SelectedIndex].WindowName))
                {
                    WindowSelect.SelectedIndex = WindowSelect.Items.Count - 1;
                }
            }

            foreach (ObjectData item in CommonData.CurrentViewObjectData)
            {
                if (item.ClassName == "Satellite")
                {
                    TargetSatellite.Items.Add(item.SimpleName);
                    if (CommonData.SavedViewList[CommonData.SelectedIndex].TargetSatellite.Contains(item.SimpleName))
                    {
                        TargetSatellite.SelectedItem = item.SimpleName;
                    }
                }
            }
            if (TargetSatellite.SelectedIndex == -1)
            {
                TargetSatellite.SelectedIndex = 0;
            }

            TTDisplayObject.Items.Add("Target Satellite");
            TTDisplayObject.Items.Add("All Threats (Up to 4)");
            if (CommonData.SavedViewList[CommonData.SelectedIndex].TtDataDisplayObject == "AllThreat")
            {
                TTDisplayObject.SelectedIndex = TTDisplayObject.Items.Count - 1;
            }
            foreach (ObjectData item in CommonData.CurrentViewObjectData)
            {
                if (item.ClassName == "Satellite")
                {
                    if (item.SimpleName != TargetSatellite.Text)
                    {
                        TTDisplayObject.Items.Add(item.SimpleName);
                        if (CommonData.SavedViewList[CommonData.SelectedIndex].TtDataDisplayObject.Contains(item.SimpleName))
                        {
                            TTDisplayObject.SelectedIndex = CommonData.CurrentViewObjectData.IndexOf(item);
                        }
                    }
                }
            }
            if (TTDisplayObject.SelectedIndex == -1)
            {
                TTDisplayObject.SelectedIndex = 0;
            }

            ThreatList.Items.Clear();
            foreach (ObjectData item in CommonData.CurrentViewObjectData)
            {
                if (item.ClassName == "Satellite" && item.SimpleName != TargetSatellite.Text)
                {
                    ListViewItem listItem = new ListViewItem();
                    listItem.Text = item.SimpleName;
                    int    index     = ThreatList.Items.IndexOf(listItem);
                    string className = SmartViewFunctions.GetClassName(item.SimpleName);
                    if (index == -1)
                    {
                        if (CommonData.SavedViewList[CommonData.SelectedIndex].ThreatSatNames.Contains(className + "/" + item.SimpleName))
                        {
                            listItem.Font = new Font(listItem.Font, FontStyle.Bold);
                            _threatNames.Add(className + "/" + item.SimpleName);
                        }

                        ThreatList.Items.Add(listItem);
                    }
                }
            }

            TTDisplayLocation.Items.Add("TopLeft");
            TTDisplayLocation.Items.Add("TopCenter");
            TTDisplayLocation.Items.Add("TopRight");
            TTDisplayLocation.Items.Add("CenterLeft");
            TTDisplayLocation.Items.Add("Center");
            TTDisplayLocation.Items.Add("CenterRight");
            TTDisplayLocation.Items.Add("BottomLeft");
            TTDisplayLocation.Items.Add("BottomCenter");
            TTDisplayLocation.Items.Add("BottomRight");
            TTDisplayLocation.SelectedIndex = 0;

            if (CommonData.SavedViewList[CommonData.SelectedIndex].EnableProximityBox)
            {
                UseProxBox.Checked = true;
            }

            if (CommonData.SavedViewList[CommonData.SelectedIndex].TtDataDisplayActive)
            {
                TTDataDisplayOptions.Enabled = true;
                TTUseDataDisplay.Checked     = true;
            }
            else
            {
                TTDataDisplayOptions.Enabled = false;
                TTUseDataDisplay.Checked     = false;
            }

            if (CommonData.SavedViewList[CommonData.SelectedIndex].ObjectHideShow)
            {
                ObjectHideShow.Checked  = true;
                HideShowOptions.Enabled = true;
            }
            else
            {
                HideShowOptions.Enabled = false;
            }

            if (CommonData.SavedViewList[CommonData.SelectedIndex].UseAnimationTime)
            {
                string currentTime = CommonData.SavedViewList[CommonData.SelectedIndex].AnimationTime;
                UseCurrentTime.Checked = true;
                CurrentTime.Text       = currentTime;
            }

            if (CommonData.SavedViewList[CommonData.SelectedIndex].EnableProximityEllipsoid)
            {
                EnableEllipsoid.Checked = true;
                EllipsoidX.Text         = CommonData.SavedViewList[CommonData.SelectedIndex].EllipsoidX;
                EllipsoidY.Text         = CommonData.SavedViewList[CommonData.SelectedIndex].EllipsoidY;
                EllipsoidZ.Text         = CommonData.SavedViewList[CommonData.SelectedIndex].EllipsoidZ;
            }
            else
            {
                EllipsoidDefinition.Enabled = false;
                EllipsoidX.Text             = "100";
                EllipsoidY.Text             = "100";
                EllipsoidZ.Text             = "100";
            }
        }
        private void Apply_Click(object sender, EventArgs e)
        {
            ViewData current = new ViewData();

            current.WindowName     = WindowSelect.Text;
            current.ViewType       = "Target/Threat";
            current.ThreatSatNames = _threatNames;
            string className = SmartViewFunctions.GetClassName(TargetSatellite.Text);

            current.TargetSatellite = className + "/" + TargetSatellite.Text;
            current.Name            = TTViewName.Text;

            if (TTUseDataDisplay.Checked)
            {
                current.TtDataDisplayActive   = true;
                current.TtDataDisplayLocation = TTDisplayLocation.Text;
                if (TTDisplayObject.SelectedIndex == 0)
                {
                    className = SmartViewFunctions.GetClassName(TargetSatellite.Text);
                    current.TtDataDisplayObject     = className + "/" + TargetSatellite.Text;
                    current.TtDataDisplayReportName = TTDisplayReport.Text;
                }
                else if (TTDisplayObject.SelectedIndex == 1)
                {
                    current.TtDataDisplayObject     = "AllThreat";
                    current.TtDataDisplayReportName = TTDisplayReport.Text;
                }
                else
                {
                    className = SmartViewFunctions.GetClassName(TTDisplayObject.Text);
                    current.TtDataDisplayObject     = className + "/" + TTDisplayObject.Text;
                    current.TtDataDisplayReportName = TTDisplayReport.Text;
                }
            }
            else
            {
                current.TtDataDisplayActive   = false;
                current.TtDataDisplayLocation = TTDisplayLocation.Text;
                className = SmartViewFunctions.GetClassName(TTDisplayObject.Text);
                current.TtDataDisplayObject     = className + "/" + TTDisplayObject.Text;
                current.TtDataDisplayReportName = TTDisplayReport.Text;
            }

            if (UseProxBox.Checked)
            {
                current.EnableProximityBox = true;
            }
            else
            {
                current.EnableProximityBox = false;
            }

            if (EnableEllipsoid.Checked)
            {
                current.EnableProximityEllipsoid = true;
                current.EllipsoidX = EllipsoidX.Text;
                current.EllipsoidY = EllipsoidY.Text;
                current.EllipsoidZ = EllipsoidZ.Text;
            }
            else
            {
                current.EnableProximityEllipsoid = false;
                current.EllipsoidX = "100";
                current.EllipsoidY = "100";
                current.EllipsoidZ = "100";
            }

            if (UseCurrentTime.Checked)
            {
                IAgAnimation animationRoot = (IAgAnimation)CommonData.StkRoot;
                double       currentTime   = animationRoot.CurrentTime;
                current.UseAnimationTime = true;
                current.AnimationTime    = CurrentTime.Text;
            }
            else
            {
                current.UseAnimationTime = false;
                IAgScenario scenario = (IAgScenario)(CommonData.StkRoot.CurrentScenario);
                current.AnimationTime = scenario.StartTime;
            }

            if (ObjectHideShow.Checked)
            {
                current.ObjectHideShow = true;
                List <ObjectData> data = new List <ObjectData>();
                data = CommonData.CurrentViewObjectData;
                current.ViewObjectData = data;
            }
            else
            {
                current.ObjectHideShow = false;
            }
            CommonData.SavedViewList[CommonData.SelectedIndex] = current;

            try
            {
                ReadWrite.WriteSavedViews(CommonData.DirectoryStr + "\\StoredViewData.json");
            }
            catch (Exception)
            {
                MessageBox.Show("Could not Write Stored Views File");
            }

            //try
            //{
            //    ReadWrite.WriteObjectData(CommonData.DirectoryStr + "\\StoredObjectData.txt");
            //}
            //catch (Exception)
            //{

            //    MessageBox.Show("Could not Write Object Data File");
            //}
            CommonData.UpdatedView = true;
            this.Close();
        }
示例#9
0
        private void Apply_Click(object sender, EventArgs e)
        {
            ViewData current = new ViewData();

            current.WindowName = WindowSelect.Text;
            current.WindowId   = SmartViewFunctions.GetWindowId(WindowSelect.Text, 0);
            current.Name       = ViewName2D.Text;
            current.ViewType   = "2D";
            current.ViewType2D = TypeSelect2D.Text;
            string className = SmartViewFunctions.GetClassName(ObjectName2D.Text);

            current.ViewTarget      = className + "/" + ObjectName2D.Text;
            current.ZoomCenterLat   = ZoomCenterLat.Text;
            current.ZoomCenterLong  = ZoomCenterLong.Text;
            current.ZoomCenterDelta = ZoomDelta.Text;

            if (EnableUniversalGroundTrack.Checked)
            {
                if (LeadType2D.Text == "Time")
                {
                    current.LeadType = LeadType2D.Text + " " + GroundLeadTime.Text;
                    current.LeadTime = GroundLeadTime.Text;
                }
                else
                {
                    current.LeadType = LeadType2D.Text;
                }

                if (TrailType2D.Text == "Time")
                {
                    current.TrailType = TrailType2D.Text + " " + GroundTrailTime.Text;
                    current.TrailTime = GroundTrailTime.Text;
                }
                else
                {
                    current.TrailType = TrailType2D.Text;
                }
            }
            else
            {
                current.LeadType  = "None";
                current.TrailType = "None";
            }

            if (UseCurrentTime.Checked)
            {
                IAgAnimation animationRoot = (IAgAnimation)CommonData.StkRoot;
                double       currentTime   = animationRoot.CurrentTime;
                current.UseAnimationTime = true;
                current.AnimationTime    = CurrentTime.Text;
            }
            else
            {
                current.UseAnimationTime = false;
                IAgScenario scenario = (IAgScenario)(CommonData.StkRoot.CurrentScenario);
                current.AnimationTime = scenario.StartTime;
            }

            if (ObjectHideShow.Checked)
            {
                current.ObjectHideShow = true;
                List <ObjectData> data = new List <ObjectData>();
                data = CommonData.CurrentViewObjectData;
                current.ViewObjectData = data;
            }
            else
            {
                current.ObjectHideShow = false;
            }

            CommonData.SavedViewList[CommonData.SelectedIndex] = current;
            CommonData.UpdatedView = true;
            try
            {
                ReadWrite.WriteSavedViews(CommonData.DirectoryStr + "\\StoredViewData.json");
            }
            catch (Exception)
            {
                MessageBox.Show("Could not Write Stored Views File");
            }
            this.Close();
        }
示例#10
0
        private void Apply_Click(object sender, EventArgs e)
        {
            int check = FieldCheck3D();

            if (check == 0)
            {
                ViewData current = new ViewData();
                current.WindowName = WindowSelect.Text;
                current.WindowId   = SmartViewFunctions.GetWindowId(WindowSelect.Text, 1);
                current.Name       = ViewName3D.Text;
                current.ViewType   = "3D";
                string className = SmartViewFunctions.GetClassName(FocusedItem.Text);
                current.ViewTarget = className + "/" + FocusedItem.Text;
                current.ViewAxes   = ViewType.Text;

                if (EnableUniversalOrbitTrack.Checked)
                {
                    current.EnableUniversalOrbitTrack = true;
                    if (LeadType3D.Text == "Time")
                    {
                        current.LeadType = LeadType3D.Text + " " + OrbitLeadTime.Text;
                        current.LeadTime = OrbitLeadTime.Text;
                    }
                    else
                    {
                        current.LeadType = LeadType3D.Text;
                    }

                    if (TrailType3D.Text == "Time")
                    {
                        current.TrailType = TrailType3D.Text + " " + OrbitTrailTime.Text;
                        current.TrailTime = OrbitTrailTime.Text;
                    }
                    else
                    {
                        current.TrailType = TrailType3D.Text;
                    }
                }
                else
                {
                    current.LeadType  = "None";
                    current.TrailType = "None";
                }

                if (UseDataDisplay.Checked)
                {
                    current.DataDisplayActive   = true;
                    current.DataDisplayLocation = DisplayLocation.Text;
                    className = SmartViewFunctions.GetClassName(DisplayObject.Text);
                    current.DataDisplayObject     = className + "/" + DisplayObject.Text;
                    current.DataDisplayReportName = DisplayReport.Text;
                }
                else
                {
                    current.DataDisplayActive   = false;
                    current.DataDisplayLocation = DisplayLocation.Text;
                    className = SmartViewFunctions.GetClassName(DisplayObject.Text);
                    current.DataDisplayObject     = className + "/" + DisplayObject.Text;
                    current.DataDisplayReportName = DisplayReport.Text;
                }

                if (UseCurrentTime.Checked)
                {
                    IAgAnimation animationRoot = (IAgAnimation)CommonData.StkRoot;
                    double       currentTime   = animationRoot.CurrentTime;
                    current.UseAnimationTime = true;
                    current.AnimationTime    = CurrentTime.Text;
                }
                else
                {
                    current.UseAnimationTime = false;
                    IAgScenario scenario = (IAgScenario)(CommonData.StkRoot.CurrentScenario);
                    current.AnimationTime = scenario.StartTime;
                }

                if (UseCurrentViewPoint.Checked)
                {
                    current.UseStoredView  = true;
                    current.StoredViewName = ViewName3D.Text;
                    CommonData.StkRoot.ExecuteCommand("VO * SaveStoredView \"" + ViewName3D.Text + "\" " + current.WindowId);
                }
                else
                {
                    current.UseStoredView  = false;
                    current.StoredViewName = "None";
                }

                if (ObjectHideShow.Checked)
                {
                    current.ObjectHideShow = true;
                    List <ObjectData> data = new List <ObjectData>();
                    data = CommonData.CurrentViewObjectData;
                    current.ViewObjectData = data;
                }
                else
                {
                    current.ObjectHideShow = false;
                }

                CommonData.SavedViewList[CommonData.SelectedIndex] = current;
                CommonData.UpdatedView = true;
                try
                {
                    ReadWrite.WriteSavedViews(CommonData.DirectoryStr + "\\StoredViewData.json");
                }
                catch (Exception)
                {
                    MessageBox.Show("Could not Write Stored Views File");
                }
                this.Close();
            }
        }
示例#11
0
        private void Apply_Click(object sender, EventArgs e)
        {
            int check = FieldCheck3D();

            if (check == 0)
            {
                current.WindowName = WindowSelect.Text;
                current.WindowId   = SmartViewFunctions.GetWindowId(WindowSelect.Text, 1);
                current.Name       = ViewName3D.Text;
                current.ViewType   = "3D";
                string className = SmartViewFunctions.GetClassName(FocusedItem.Text);
                current.ViewTarget = className + "/" + FocusedItem.Text;
                current.ViewAxes   = "Inertial";

                if (EnableUniversalOrbitTrack.Checked)
                {
                    if (UniversalLeadTrail.Checked)
                    {
                        current.EnableUniversalOrbitTrack = true;
                        current.UniqueLeadTrail           = false;
                        if (LeadType3D.Text == "Time")
                        {
                            current.LeadType = LeadType3D.Text + " " + OrbitLeadTime.Text;
                            current.LeadTime = OrbitLeadTime.Text;
                        }
                        else
                        {
                            current.LeadType = LeadType3D.Text;
                        }

                        if (TrailType3D.Text == "Time")
                        {
                            current.TrailType = TrailType3D.Text + " " + OrbitTrailTime.Text;
                            current.TrailTime = OrbitTrailTime.Text;
                        }
                        else
                        {
                            current.TrailType = TrailType3D.Text;
                        }
                    }
                    else if (UniqueLeadTrail.Checked)
                    {
                        current.UniqueLeadTrail           = true;
                        current.EnableUniversalOrbitTrack = true;
                    }
                }
                else
                {
                    current.EnableUniversalOrbitTrack = false;
                    current.LeadType  = "None";
                    current.TrailType = "None";
                }

                if (UseDataDisplay.Checked)
                {
                    current.PrimaryDataDisplay.DataDisplayActive   = true;
                    current.PrimaryDataDisplay.DataDisplayLocation = DisplayLocation.Text;
                    className = SmartViewFunctions.GetClassName(DisplayObject.Text);
                    current.PrimaryDataDisplay.DataDisplayObject     = className + "/" + DisplayObject.Text;
                    current.PrimaryDataDisplay.DataDisplayReportName = DisplayReport.Text;
                    className = SmartViewFunctions.GetClassName(PredataObject.Text);
                    current.PrimaryDataDisplay.PredataObject = className + "/" + PredataObject.Text;
                }
                else
                {
                    current.PrimaryDataDisplay.DataDisplayActive   = false;
                    current.PrimaryDataDisplay.DataDisplayLocation = DisplayLocation.Text;
                    className = SmartViewFunctions.GetClassName(DisplayObject.Text);
                    current.PrimaryDataDisplay.DataDisplayObject     = className + "/" + DisplayObject.Text;
                    current.PrimaryDataDisplay.DataDisplayReportName = DisplayReport.Text;
                    current.PrimaryDataDisplay.PredataObject         = PredataObject.Text;
                }

                if (UseCurrentTime.Checked)
                {
                    current.UseAnimationTime = true;
                    current.AnimationTime    = CurrentTime.Text;
                }
                else
                {
                    current.UseAnimationTime = false;
                    IAgScenario scenario = (IAgScenario)(CommonData.StkRoot.CurrentScenario);
                    current.AnimationTime = scenario.StartTime;
                }

                if (UseCurrentViewPoint.Checked)
                {
                    //only refresh view if not previously active. you can also refresh using the 'refresh' button on the screen
                    if (!current.UseStoredView)
                    {
                        current.StoredViewName = ViewName3D.Text;
                        CommonData.StkRoot.ExecuteCommand("VO * SaveStoredView \"" + ViewName3D.Text + "\" " + current.WindowId);
                    }
                    current.UseStoredView = true;
                }
                else
                {
                    current.UseStoredView  = false;
                    current.StoredViewName = "None";
                }

                if (ObjectHideShow.Checked)
                {
                    current.ObjectHideShow = true;
                    List <ObjectData> data = new List <ObjectData>();
                    data = CommonData.CurrentViewObjectData;
                    current.ViewObjectData = data;
                }
                else
                {
                    current.ObjectHideShow = false;
                }

                if (UseVectorHideShow.Checked)
                {
                    current.VectorHideShow = true;
                }
                else
                {
                    current.VectorHideShow = false;
                }

                if (UseCameraPath.Checked)
                {
                    current.UseCameraPath  = true;
                    current.CameraPathName = CameraPathName.Text;
                }
                else
                {
                    current.UseCameraPath = false;
                }

                CommonData.SavedViewList[CommonData.SelectedIndex] = current;
                CommonData.UpdatedView = true;
                try
                {
                    ReadWrite.WriteSavedViews(CommonData.DirectoryStr + "\\StoredViewData.json");
                }
                catch (Exception)
                {
                    MessageBox.Show("Could not Write Stored Views File");
                }
                this.Close();
            }
        }
示例#12
0
        private void Apply_Click(object sender, EventArgs e)
        {
            ViewData current   = new ViewData();
            string   className = null;

            current.WindowName               = WindowSelect.Text;
            current.ViewType                 = "GEODrift";
            current.Name                     = GEOViewName.Text;
            className                        = SmartViewFunctions.GetClassName(GEOViewTarget.Text);
            current.ViewTarget               = className + "/" + GEOViewTarget.Text;
            current.EnableGeoBox             = UseGEOBox.Checked;
            current.GeoLongitude             = GEOLongitude.Text;
            current.GeoNorthSouth            = GeoNorthSouth.Text;
            current.GeoEastWest              = GEOEastWest.Text;
            current.GeoRadius                = GEORadius.Text;
            current.GeoDataDisplayActive     = GEOUseDataDisplay.Checked;
            className                        = SmartViewFunctions.GetClassName(GEODisplayObject.Text);
            current.GeoDataDisplayObject     = className + "/" + GEODisplayObject.Text;
            current.GeoDataDisplayReportName = GEODisplayReport.Text;
            current.GeoDataDisplayLocation   = GEODisplayLocation.Text;

            if (UseCurrentTime.Checked)
            {
                IAgAnimation animationRoot = (IAgAnimation)CommonData.StkRoot;
                double       currentTime   = animationRoot.CurrentTime;
                current.UseAnimationTime = true;
                current.AnimationTime    = CurrentTime.Text;
            }
            else
            {
                current.UseAnimationTime = false;
                IAgScenario scenario = (IAgScenario)(CommonData.StkRoot.CurrentScenario);
                current.AnimationTime = scenario.StartTime;
            }

            if (ObjectHideShow.Checked)
            {
                current.ObjectHideShow = true;
                List <ObjectData> data = new List <ObjectData>();
                data = CommonData.CurrentViewObjectData;
                current.ViewObjectData = data;
            }
            else
            {
                current.ObjectHideShow = false;
            }

            CommonData.SavedViewList[CommonData.SelectedIndex] = current;

            try
            {
                ReadWrite.WriteSavedViews(CommonData.DirectoryStr + "\\StoredViewData.json");
            }
            catch (Exception)
            {
                MessageBox.Show("Could not Write Stored Views File");
            }

            //try
            //{
            //    ReadWrite.WriteObjectData(CommonData.DirectoryStr + "\\StoredObjectData.txt");
            //}
            //catch (Exception)
            //{

            //    MessageBox.Show("Could not Write Object Data File");
            //}
            CommonData.NewView = true;
            this.Close();
        }
示例#13
0
        private void Create_Click(object sender, EventArgs e)
        {
            string   className;
            ViewData current = new ViewData();
            int      check;

            if (TypeSelect.SelectedIndex == 0) //3D
            {
                check = FieldCheck3D();
                if (check == 0)
                {
                    current.WindowName = WindowSelect.Text;
                    current.WindowId   = SmartViewFunctions.GetWindowId(WindowSelect.Text, 1);
                    current.Name       = ViewName3D.Text;
                    current.ViewType   = TypeSelect.Text;
                    className          = SmartViewFunctions.GetClassName(FocusedItem.Text);
                    current.ViewTarget = className + "/" + FocusedItem.Text;
                    current.ViewAxes   = ViewType.Text;

                    if (EnableUniversalOrbitTrack.Checked)
                    {
                        current.EnableUniversalOrbitTrack = true;
                        if (LeadType3D.Text == "Time")
                        {
                            current.LeadType = LeadType3D.Text + " " + OrbitLeadTime.Text;
                            current.LeadTime = OrbitLeadTime.Text;
                        }
                        else
                        {
                            current.LeadType = LeadType3D.Text;
                        }

                        if (TrailType3D.Text == "Time")
                        {
                            current.TrailType = TrailType3D.Text + " " + OrbitTrailTime.Text;
                            current.TrailTime = OrbitTrailTime.Text;
                        }
                        else
                        {
                            current.TrailType = TrailType3D.Text;
                        }
                    }
                    else
                    {
                        current.LeadType  = "None";
                        current.TrailType = "None";
                    }

                    if (UseDataDisplay.Checked)
                    {
                        current.DataDisplayActive   = true;
                        current.DataDisplayLocation = DisplayLocation.Text;
                        className = SmartViewFunctions.GetClassName(DisplayObject.Text);
                        current.DataDisplayObject     = className + "/" + DisplayObject.Text;
                        current.DataDisplayReportName = DisplayReport.Text;
                    }
                    else
                    {
                        current.DataDisplayActive   = false;
                        current.DataDisplayLocation = DisplayLocation.Text;
                        className = SmartViewFunctions.GetClassName(DisplayObject.Text);
                        current.DataDisplayObject     = className + "/" + DisplayObject.Text;
                        current.DataDisplayReportName = DisplayReport.Text;
                    }

                    if (UseCurrentViewPoint.Checked)
                    {
                        current.UseStoredView  = true;
                        current.StoredViewName = ViewName3D.Text;
                        CommonData.StkRoot.ExecuteCommand("VO * SaveStoredView \"" + ViewName3D.Text + "\" " + current.WindowId);
                    }
                    else
                    {
                        current.UseStoredView  = false;
                        current.StoredViewName = "None";
                    }
                }
            }
            else if (TypeSelect.SelectedIndex == 1) //2D
            {
                check = FieldCheck2D();
                if (check == 0)
                {
                    current.WindowName      = WindowSelect.Text;
                    current.WindowId        = SmartViewFunctions.GetWindowId(WindowSelect.Text, 0);
                    current.Name            = ViewName2D.Text;
                    current.ViewType        = TypeSelect.Text;
                    current.ViewType2D      = TypeSelect2D.Text;
                    className               = SmartViewFunctions.GetClassName(ObjectName2D.Text);
                    current.ViewTarget      = className + "/" + ObjectName2D.Text;
                    current.ZoomCenterLat   = ZoomCenterLat.Text;
                    current.ZoomCenterLong  = ZoomCenterLong.Text;
                    current.ZoomCenterDelta = ZoomDelta.Text;

                    if (EnableUniversalGroundTrack.Checked)
                    {
                        if (LeadType2D.Text == "Time")
                        {
                            current.LeadType = LeadType2D.Text + " " + GroundLeadTime.Text;
                            current.LeadTime = GroundLeadTime.Text;
                        }
                        else
                        {
                            current.LeadType = LeadType2D.Text;
                        }

                        if (TrailType2D.Text == "Time")
                        {
                            current.TrailType = TrailType2D.Text + " " + GroundTrailTime.Text;
                            current.TrailTime = GroundTrailTime.Text;
                        }
                        else
                        {
                            current.TrailType = TrailType2D.Text;
                        }
                    }
                    else
                    {
                        current.LeadType  = "None";
                        current.TrailType = "None";
                    }

                    current.ShowAerialSensors = false;

                    current.ShowGroundSensors = false;
                }
            }
            else if (TypeSelect.SelectedIndex == 2) //Target/Threat
            {
                current.WindowName     = WindowSelect.Text;
                current.ViewType       = "Target/Threat";
                current.ThreatSatNames = _threatNames;
                className = SmartViewFunctions.GetClassName(TargetSatellite.Text);
                current.TargetSatellite = className + "/" + TargetSatellite.Text;
                current.Name            = TTViewName.Text;

                if (TTUseDataDisplay.Checked)
                {
                    current.TtDataDisplayActive   = true;
                    current.DataDisplayActive     = true;
                    current.TtDataDisplayLocation = TTDisplayLocation.Text;
                    if (TTDisplayObject.SelectedIndex == 0)
                    {
                        className = SmartViewFunctions.GetClassName(TargetSatellite.Text);
                        current.TtDataDisplayObject     = className + "/" + TargetSatellite.Text;
                        current.TtDataDisplayReportName = TTDisplayReport.Text;
                    }
                    else if (TTDisplayObject.SelectedIndex == 1)
                    {
                        current.TtDataDisplayObject     = "AllThreat";
                        current.TtDataDisplayReportName = TTDisplayReport.Text;
                    }
                    else
                    {
                        className = SmartViewFunctions.GetClassName(TTDisplayObject.Text);
                        current.TtDataDisplayObject     = className + "/" + TTDisplayObject.Text;
                        current.TtDataDisplayReportName = TTDisplayReport.Text;
                    }
                }
                else
                {
                    current.TtDataDisplayActive   = false;
                    current.DataDisplayActive     = false;
                    current.TtDataDisplayLocation = TTDisplayLocation.Text;
                    className = SmartViewFunctions.GetClassName(TTDisplayObject.Text);
                    current.TtDataDisplayObject     = className + "/" + TTDisplayObject.Text;
                    current.TtDataDisplayReportName = TTDisplayReport.Text;
                }

                if (UseProxBox.Checked)
                {
                    current.EnableProximityBox = true;
                }
                else
                {
                    current.EnableProximityBox = false;
                }

                if (EnableEllipsoid.Checked)
                {
                    current.EnableProximityEllipsoid = true;
                    current.EllipsoidX = EllipsoidX.Text;
                    current.EllipsoidY = EllipsoidX.Text;
                    current.EllipsoidZ = EllipsoidX.Text;
                }
                else
                {
                    current.EnableProximityEllipsoid = false;
                    current.EllipsoidX = "100";
                    current.EllipsoidY = "100";
                    current.EllipsoidZ = "100";
                }
            }
            else if (TypeSelect.SelectedIndex == 3) //GEO Drift
            {
                current.WindowName               = WindowSelect.Text;
                current.ViewType                 = "GEODrift";
                current.Name                     = GEOViewName.Text;
                className                        = SmartViewFunctions.GetClassName(GEOViewTarget.Text);
                current.ViewTarget               = className + "/" + GEOViewTarget.Text;
                current.EnableGeoBox             = UseGEOBox.Checked;
                current.GeoLongitude             = GEOLongitude.Text;
                current.GeoNorthSouth            = GeoNorthSouth.Text;
                current.GeoEastWest              = GEOEastWest.Text;
                current.GeoRadius                = GEORadius.Text;
                current.GeoDataDisplayActive     = GEOUseDataDisplay.Checked;
                className                        = SmartViewFunctions.GetClassName(GEODisplayObject.Text);
                current.GeoDataDisplayObject     = className + "/" + GEODisplayObject.Text;
                current.GeoDataDisplayReportName = GEODisplayReport.Text;
                current.GeoDataDisplayLocation   = GEODisplayLocation.Text;
            }

            if (UseCurrentTime.Checked)
            {
                IAgAnimation animationRoot = (IAgAnimation)CommonData.StkRoot;
                double       currentTime   = animationRoot.CurrentTime;
                current.AnimationTime = currentTime.ToString();
            }
            else
            {
                current.UseAnimationTime = false;
                IAgScenario scenario = (IAgScenario)(CommonData.StkRoot.CurrentScenario);
                current.AnimationTime = scenario.StartTime;
            }
            if (ObjectHideShow.Checked)
            {
                current.ObjectHideShow = true;
                List <ObjectData> data = new List <ObjectData>();
                data = CommonData.CurrentViewObjectData;
                current.ViewObjectData = data;
            }
            else
            {
                current.ObjectHideShow = false;
            }
            CommonData.SavedViewList.Add(current);
            try
            {
                ReadWrite.WriteSavedViews(CommonData.DirectoryStr + "\\StoredViewData.json");
            }
            catch (Exception)
            {
                MessageBox.Show("Could not Write Stored Views File");
            }

            //try
            //{
            //    ReadWrite.WriteObjectData(CommonData.DirectoryStr + "\\StoredObjectData.txt");
            //}
            //catch (Exception)
            //{

            //    MessageBox.Show("Could not Write Object Data File");
            //}
            CommonData.NewView = true;
            this.Close();
        }
示例#14
0
        private void Apply_Click(object sender, EventArgs e)
        {
            if (UseVectorScaling.Checked)
            {
                currentView.ApplyVectorScaling = true;
            }
            else
            {
                currentView.ApplyVectorScaling = false;
            }
            currentView.VectorScalingValue = Double.Parse(VectorScalingFactor.Text);

            if (UseProxBox.Checked)
            {
                currentView.EnableProximityBox = true;
            }
            else
            {
                currentView.EnableProximityBox = false;
            }
            currentView.ProxGridSpacing = GridSpacing.Text;

            if (EnableEllipsoid.Checked)
            {
                currentView.EnableProximityEllipsoid = true;
            }
            else
            {
                currentView.EnableProximityEllipsoid = false;
            }
            currentView.EllipsoidX = EllipsoidX.Text;
            currentView.EllipsoidY = EllipsoidY.Text;
            currentView.EllipsoidZ = EllipsoidZ.Text;

            if (UseGEOBox.Checked)
            {
                currentView.EnableGeoBox = true;
            }
            else
            {
                currentView.EnableGeoBox = false;
            }
            currentView.GeoEastWest   = GEOEastWest.Text;
            currentView.GeoNorthSouth = GeoNorthSouth.Text;
            currentView.GeoRadius     = GEORadius.Text;
            currentView.GeoLongitude  = GEOLongitude.Text;

            if (UseSecondaryDataDisplay.Checked)
            {
                string className = null;
                currentView.SecondaryDataDisplay.DataDisplayActive     = true;
                currentView.SecondaryDataDisplay.DataDisplayLocation   = DisplayLocation.Text;
                currentView.SecondaryDataDisplay.DataDisplayReportName = DisplayReport.Text;
                className = SmartViewFunctions.GetClassName(DisplayObject.Text);
                currentView.SecondaryDataDisplay.DataDisplayObject = className + "/" + DisplayObject.Text;
                className = SmartViewFunctions.GetClassName(PredataObject.Text);
                currentView.SecondaryDataDisplay.PredataObject = className + "/" + PredataObject.Text;
            }
            else
            {
                currentView.SecondaryDataDisplay.DataDisplayActive = false;
            }
            if (OverrideTimeStep.Checked)
            {
                currentView.OverrideTimeStep = true;
                currentView.TimeStep         = TimeStep.Text;
            }
            else
            {
                currentView.OverrideTimeStep = false;
            }
            this.DialogResult = DialogResult.Yes;
            this.Close();
        }