private void RefreshViewPoint_Click(object sender, EventArgs e) { int windowId = SmartViewFunctions.GetWindowId(WindowSelect.Text, 1); if (ViewName3D.Text != null && ViewName3D.Text != "") { try { CommonData.StkRoot.ExecuteCommand("VO * SaveStoredView \"" + ViewName3D.Text + "\" " + windowId.ToString()); } catch (Exception) { MessageBox.Show("Could not refresh viewpoint"); } } }
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 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(); }
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(); } }
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(); } }
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(); }