Skip to content

Commit

Permalink
Update example code to 2022r1 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
shunter committed Jun 3, 2022
1 parent c7d2539 commit 50c87d6
Show file tree
Hide file tree
Showing 76 changed files with 437 additions and 955 deletions.
2 changes: 1 addition & 1 deletion DotNet/CesiumDemo/Cesium/README.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Unpack the contents of the Build\Cesium from the STK Web Visualization Library
Unpack the contents of the Build\Cesium from the Cesium Analytics SDK
package into this directory, so that Cesium.js is next to this README file.
10 changes: 5 additions & 5 deletions DotNet/CesiumDemo/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Cesium Demo

This application demonstrates a client-server web application which uses STK Components on the server to perform analysis, and [STK Web Visualization Library](http://help.agi.com/AGIComponents/html/StkWebVisualization.htm) on the client (in a web browser) to visualize the results of that analysis using CZML. It also includes demonstrations of each of the specialized graphical features available in STK Web Visualization Library.
This application demonstrates a client-server web application which uses STK Components on the server to perform analysis, and [Cesium Analytics SDK](https://help.agi.com/AGIComponents/html/CesiumAnalyticsSdk.htm) on the client (in a web browser) to visualize the results of that analysis using CZML. It also includes demonstrations of each of the specialized graphical features available in Cesium Analytics SDK.

To simplify the application and minimize dependencies, this application uses ASP.NET Web Forms to create a simple web service. Please note that use of STK Components, and the capabilities being demonstrated, are not specific to ASP.NET. STK Components can be integrated with STK Web Visualization Library using any web application framework.
To simplify the application and minimize dependencies, this application uses ASP.NET Web Forms to create a simple web service. Please note that use of STK Components, and the capabilities being demonstrated, are not specific to ASP.NET. STK Components can be integrated with Cesium Analytics SDK using any web application framework.

The application also contains a small custom user interface to make it easier to explore the visualizations. This user interface is built using [Knockout.js](https://knockoutjs.com/) because it is already included in Cesium. As above, note that the capabilities being demonstrated can be used in any front-end framework.

## Features

This example demonstrates visualizing various types of Components objects and analysis, and the advanced graphical capabilities of STK Web Visualization Library, including:
This example demonstrates visualizing various types of Components objects and analysis, and the advanced graphical capabilities of Cesium Analytics SDK, including:

* A satellite propagated from a TLE
* Access between a satellite and a ground station
Expand All @@ -28,6 +28,6 @@ This example demonstrates visualizing various types of Components objects and an

## Installation

This example requires STK Web Visualization Library, which is included with an STK Components license, and can be downloaded from [AGI's download site](https://support.agi.com/downloads/).
This example requires Cesium Analytics SDK, which is included with an STK Components license, and can be downloaded from [AGI's download site](https://support.agi.com/downloads/).

Unpack the contents of the `Build\Cesium` directory from the STK Web Visualization Library package into the `CesiumDemo\Cesium` directory before building and running the example.
Unpack the contents of the `Build\Cesium` directory from the Cesium Analytics SDK package into the `CesiumDemo\Cesium` directory before building and running the example.
8 changes: 4 additions & 4 deletions DotNet/Common/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
// </auto-generated>
//------------------------------------------------------------------------------

[assembly: AssemblyCompany("Analytical Graphics, Inc.")]
[assembly: AssemblyCompany("AGI, an Ansys Company")]
[assembly: AssemblyProduct("STK Components")]
[assembly: AssemblyCopyright("Copyright © 2007-2019 Analytical Graphics, Inc.")]
[assembly: AssemblyCopyright("Copyright © 2007-2022 Analytical Graphics, Inc.")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("19.3.400.0")]
[assembly: AssemblyFileVersion("19.3.400.0")]
[assembly: AssemblyVersion("22.1.413.0")]
[assembly: AssemblyFileVersion("22.1.413.0")]
[assembly: NeutralResourcesLanguage("en-US")]

2 changes: 1 addition & 1 deletion DotNet/Communications/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Communications Demo

This application uses the **Communications Library** to setup a call between two locations and visualize the scenario and link budget results. Using [SimpleDigitalTransmitter](http://help.agi.com/AGIComponents/html/T_AGI_Foundation_Communications_SimpleDigitalTransmitter.htm), [Transceiver](http://help.agi.com/AGIComponents/html/T_AGI_Foundation_Communications_Transceiver.htm) and [SimpleReceiver](http://help.agi.com/AGIComponents/html/T_AGI_Foundation_Communications_SimpleReceiver.htm), the application looks at the link budget for the call, allowing the user to vary the transmission power of the calling phone, and on which links to report the link budget parameters. The application also shows how visualization can be incorporated into an analysis scenario, bringing in Insight3D and its various platforms, markers and models. For more information on the Communications Library, see the [Communications](http://help.agi.com/AGIComponents/html/Communications.htm) topic.
This application uses the **Communications Library** to setup a call between two locations and visualize the scenario and link budget results. Using [SimpleDigitalTransmitter](https://help.agi.com/AGIComponents/html/T_AGI_Foundation_Communications_SimpleDigitalTransmitter.htm), [Transceiver](https://help.agi.com/AGIComponents/html/T_AGI_Foundation_Communications_Transceiver.htm) and [SimpleReceiver](https://help.agi.com/AGIComponents/html/T_AGI_Foundation_Communications_SimpleReceiver.htm), the application looks at the link budget for the call, allowing the user to vary the transmission power of the calling phone, and on which links to report the link budget parameters. The application also shows how visualization can be incorporated into an analysis scenario, bringing in Insight3D and its various platforms, markers and models. For more information on the Communications Library, see the [Communications](https://help.agi.com/AGIComponents/html/Communications.htm) topic.

![Communications Demo](Images/ExampleCommunicationsDemo.jpg)
4 changes: 2 additions & 2 deletions DotNet/GpsCommunications/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GPS Communications Analysis

This application uses the **Communications Library**, the **Navigation Accuracy Library**, and the **Navigation Advanced Library** to model GPS communications at a site for a single time. You can select from nine different GPS signal configurations, and show four different communications metrics for GPS signals received by a [GpsReceiver](http://help.agi.com/AGIComponents/html/T_AGI_Foundation_Navigation_GpsReceiver.htm). Additionally, you can add jammers on either L1, L2 or L5 frequencies.
This application uses the **Communications Library**, the **Navigation Accuracy Library**, and the **Navigation Advanced Library** to model GPS communications at a site for a single time. You can select from nine different GPS signal configurations, and show four different communications metrics for GPS signals received by a [GpsReceiver](https://help.agi.com/AGIComponents/html/T_AGI_Foundation_Navigation_GpsReceiver.htm). Additionally, you can add jammers on either L1, L2 or L5 frequencies.

This example provides a good starting point for understanding the setup of a [GpsCommunicationsFrontEnd](http://help.agi.com/AGIComponents/html/T_AGI_Foundation_Navigation_Advanced_GpsCommunicationsFrontEnd.htm), configuring interference sources and retrieving link budgets for analysis. The [Navigation Communications](http://help.agi.com/AGIComponents/html/NavigationCommunications.htm) topic has more information on how this system works.
This example provides a good starting point for understanding the setup of a [GpsCommunicationsFrontEnd](https://help.agi.com/AGIComponents/html/T_AGI_Foundation_Navigation_Advanced_GpsCommunicationsFrontEnd.htm), configuring interference sources and retrieving link budgets for analysis. The [Navigation Communications](https://help.agi.com/AGIComponents/html/NavigationCommunications.htm) topic has more information on how this system works.

![GPS Communications Analysis](Images/ExampleGPSCommunicationsAnalysis.jpg)
2 changes: 1 addition & 1 deletion DotNet/LotsOfSatellites/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Lots of Satellites

This application uses [Sgp4Propagator](http://help.agi.com/AGIComponents/html/T_AGI_Foundation_Propagators_Sgp4Propagator.htm) to propagate up to 10,000 satellites, which are visualized in Insight3D using [MarkerBatchPrimitive](http://help.agi.com/AGIComponents/html/T_AGI_Foundation_Graphics_MarkerBatchPrimitive.htm). Satellites shown in red have access to a ground station located in Australia.
This application uses [Sgp4Propagator](https://help.agi.com/AGIComponents/html/T_AGI_Foundation_Propagators_Sgp4Propagator.htm) to propagate up to 10,000 satellites, which are visualized in Insight3D using [MarkerBatchPrimitive](https://help.agi.com/AGIComponents/html/T_AGI_Foundation_Graphics_MarkerBatchPrimitive.htm). Satellites shown in red have access to a ground station located in Australia.

![Lots of Satellites](Images/ExampleLotsOfSatellites.jpg)
4 changes: 2 additions & 2 deletions DotNet/NavAnalyst/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NavAnalyst

This reference application shows how many of the [AGI.Foundation.Navigation](http://help.agi.com/AGIComponents/html/N_AGI_Foundation_Navigation.htm) types and methods can be used. This application is designed to show a navigation analyst a quick-look picture of the Dilution of Precision (DOP) for a site, which satellites are in view of that site, and the azimuth and elevation of the satellites at that site. An open-source charting package called [ZedGraph](http://sourceforge.net/projects/zedgraph/) is used to draw the graphs in the application.
This reference application shows how many of the [AGI.Foundation.Navigation](https://help.agi.com/AGIComponents/html/N_AGI_Foundation_Navigation.htm) types and methods can be used. This application is designed to show a navigation analyst a quick-look picture of the Dilution of Precision (DOP) for a site, which satellites are in view of that site, and the azimuth and elevation of the satellites at that site. An open-source charting package called [ZedGraph](http://sourceforge.net/projects/zedgraph/) is used to draw the graphs in the application.

For more information on the application, see [the topic for this example](http://help.agi.com/AGIComponents/html/ExampleNavAnalyst.htm) in the STK Components documentation.
For more information on the application, see [the topic for this example](https://help.agi.com/AGIComponents/html/ExampleNavAnalyst.htm) in the STK Components documentation.
83 changes: 57 additions & 26 deletions DotNet/NumericalPropagationDemo/ForceModelSettings.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Windows.Forms;
using AGI.Foundation;
using AGI.Foundation.Celestial;
using AGI.Foundation.Geometry;
using AGI.Foundation.Propagators;
Expand Down Expand Up @@ -58,6 +60,7 @@ public ForceModelSettings(JplDE jplInfo, string gravityFile)
m_gravFile.Text = gravityFile;
m_tides.Items.Add(PERMANENTTIDES);
m_tides.Items.Add(NOTIDES);
m_tides.Items.Add(TIMEVARYINGTIDES);
m_tides.SelectedIndex = 0;
m_tides.DropDownStyle = ComboBoxStyle.DropDownList;

Expand All @@ -68,6 +71,7 @@ public ForceModelSettings(JplDE jplInfo, string gravityFile)
m_lastCB = EARTH;
CurrentCentralBody = CentralBodiesFacet.GetFromContext().Earth;
m_primaryCB.SelectedItem = EARTH;
CurrentCentralBodysGravitationalParameter = m_gravConstants[m_primaryCB.SelectedItem.ToString()];

// adding all of the possible third bodies
foreach (KeyValuePair<string, double> pair in m_gravConstants)
Expand Down Expand Up @@ -195,17 +199,40 @@ public void SetForceModelsOnPoint(PropagationNewtonianPoint point, Scalar area)
}
else
{
SphericalHarmonicsTideType tideType = SphericalHarmonicsTideType.None;
if (m_tides.SelectedItem.ToString() == NOTIDES)
tideType = SphericalHarmonicsTideType.None;
else if (m_tides.SelectedItem.ToString() == PERMANENTTIDES)
tideType = SphericalHarmonicsTideType.PermanentTideOnly;

int order = int.Parse(m_order.Text);
int degree = int.Parse(m_degree.Text);
SphericalHarmonicGravityModel model = SphericalHarmonicGravityModel.ReadFrom(m_gravFile.Text);
SolidTideModel tideModel;
if (m_tides.Enabled)
{
// Only enabled if Earth is selected as central body.
switch (m_tides.SelectedItem.ToString())
{
case NOTIDES:
if (model.IncludesPermanentTides)
model = model.WithoutEarthPermanentTides();
tideModel = null;
break;
case PERMANENTTIDES:
tideModel = model.IncludesPermanentTides ? null : new PermanentSolidTideModel();
break;
case TIMEVARYINGTIDES:
if (model.IncludesPermanentTides)
model = model.WithoutEarthPermanentTides();
tideModel = new Iers2003SolidTideModel(((EarthCentralBody)m_centralBody).OrientationParameters);
break;
default:
throw new UnsupportedCaseException("Invalid tide parameter selection.");
}
}
else
{
// For other central bodies, tides will be automatically inherited from the .grv files based on whether they include permanent tides or not.
tideModel = null;
}

SphericalHarmonicGravity gravity = new SphericalHarmonicGravity(point.IntegrationPoint,
new SphericalHarmonicGravityField(model, degree, order, true, tideType));
new SphericalHarmonicGravityField(model, degree, order, true, tideModel));
point.AppliedForces.Add(gravity);

if (gravity.GravityField.CentralBody.Name != primaryCB)
Expand Down Expand Up @@ -258,26 +285,29 @@ private void OnDoneClick(object sender, EventArgs e)
/// <param name="e">Additional information about this event.</param>
private void OnPrimaryCBSelectedIndexChanged(object sender, EventArgs e)
{
if (m_primaryCB.SelectedItem.ToString() != m_lastCB)
if (m_primaryCB.SelectedItem.ToString() == m_lastCB)
return;

m_thirdBodies.Items.Remove(m_primaryCB.SelectedItem.ToString());
m_thirdBodies.Items.Add(m_lastCB);
m_lastCB = m_primaryCB.SelectedItem.ToString();
if (m_primaryCB.SelectedItem.ToString() != EARTH)
{
m_thirdBodies.Items.Remove(m_primaryCB.SelectedItem.ToString());
m_thirdBodies.Items.Add(m_lastCB);
m_lastCB = m_primaryCB.SelectedItem.ToString();
if (m_primaryCB.SelectedItem.ToString() != EARTH)
{
// we only have drag models for the earth
m_lastDragChecked = m_useDrag.Checked;
m_useDrag.Checked = false;
m_useDrag.Enabled = false;
}
else
{
m_useDrag.Checked = m_lastDragChecked;
m_useDrag.Enabled = true;
}
CurrentCentralBodysGravitationalParameter = m_gravConstants[m_primaryCB.SelectedItem.ToString()];
CurrentCentralBody = CentralBodiesFacet.GetFromContext().GetByName(m_primaryCB.SelectedItem.ToString());
// we only have drag models for the earth
m_lastDragChecked = m_useDrag.Checked;
m_useDrag.Checked = false;
m_useDrag.Enabled = false;
// We only have default permanent and time-varying tides for Earth.
m_tides.Enabled = false;
}
else
{
m_useDrag.Checked = m_lastDragChecked;
m_useDrag.Enabled = true;
m_tides.Enabled = true;
}
CurrentCentralBodysGravitationalParameter = m_gravConstants[m_primaryCB.SelectedItem.ToString()];
CurrentCentralBody = CentralBodiesFacet.GetFromContext().GetByName(m_primaryCB.SelectedItem.ToString());
}

/// <summary>
Expand Down Expand Up @@ -355,7 +385,8 @@ private void OnUseSRPCheckedChanged(object sender, EventArgs e)
private const string DUALCONE = "Dual Cone";
private const string CYLINDRICAL = "Cylindrical";

private const string TIMEVARYINGTIDES = "TimeVarying";
private const string PERMANENTTIDES = "Permanent";
private const string NOTIDES = "None";
}
}
}
Loading

0 comments on commit 50c87d6

Please sign in to comment.