Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

StkVisualization Class Reference

#include <stkvisualization.h>

List of all members.


Detailed Description

Visualize satellite position and attitude using STK.

Author:
: spikeinferno
Version:
Revision
1.8
Date:
Date
2006/07/31 19:07:53

Definition at line 24 of file stkvisualization.h.

Public Member Functions

 StkVisualization (double offset=0.0)
 Constructor.
 ~StkVisualization ()
 Destructor.
bool ConnectStk (const char *stkHostAddress, const char *stkHostPort="5001")
 stkHostAddress is the IP address of the computer running STK
bool SetUpScenario ()
 Sets up the scenario.
bool SetUpNumberOfSatellites ()
 Creates array of satellite names.
bool SetUpSatellite ()
 Creates the satellites as specified by user.
bool StartAnimation ()
 Starts the animation in STK.
bool SetWindows ()
 Divides the screen into 2D and 3D windows.
bool Update (int satelliteNumber, int rotationSequence, double angle1, double angle2, double angle3)
 Updates attitude using Euler angles.
bool Update (int satelliteNumber, double Q1, double Q2, double Q3, double Q4)
 Updates attitude using quaternions.
bool Update (int satelliteNumber, double latitude, double longitude, double altitude, double latitudeRate, double longitudeRate, double altitudeRate)
 Updates the animation with new orbit information using latitude, longitude, altitude, latitude and longitude rates, and altitude rate.
Latitude and longitude are in degrees.
const char * GetLastError (char *buffer)
 Returns the errors.
bool ShutDownStk ()
 Closes connection to STK and frees memory.

Public Attributes

int NumberOfSatellites
 Number of Satellites in Visualization.
string ScenarioName
 Name of STK scenario specified by user.
string * SatelliteName
 Name of satellites to be stored in an array of strings.

Private Member Functions

double GetOffsetTime ()
 Returns current time in seconds (provided by gettimeofday) + input Offset.
void ClearError ()
 Resets error flag and cleans up ReturnInfo.
bool SendCommand (ostringstream &commandLine)
 Sends command to STK of type ostringstream.
bool SendCommand (string commandLine)
 Member function overload: reads in command line of type string.
 StkVisualization (const StkVisualization &)
 :^)
StkVisualizationoperator= (const StkVisualization &)
 :^)

Private Attributes

double Offset
 Offset in seconds from current time.
char * ConID
 STK connection ID.
bool ErrorExists
 Are we storing an error message?
char CommandBuffer [512]
 UGLY HACK -- JRS -- AgConInit takes a char* for hostname, so copying string to buffer.
bool * SatellitePositionUpdate
 Used to determine if all satellites have a position so 3D.
bool AllSatellitesUpdated
 animation windows can be centered about the satellites
bool WindowsSet
 Used to determine if the animation windows have been set.
AgTConReturnInfo * ReturnInfo
 Pointer to AgTConReturnInfo to get results from STK.


Constructor & Destructor Documentation

StkVisualization::StkVisualization const StkVisualization  )  [inline, private]
 

:^)

Definition at line 46 of file stkvisualization.h.

StkVisualization::StkVisualization double  offset = 0.0  ) 
 

Constructor.

Definition at line 87 of file stkvisualization.cpp.

References CommandBuffer, and ReturnInfo.

StkVisualization::~StkVisualization  ) 
 

Destructor.

Definition at line 97 of file stkvisualization.cpp.

References ClearError().


Member Function Documentation

void StkVisualization::ClearError  )  [private]
 

Resets error flag and cleans up ReturnInfo.

Definition at line 43 of file stkvisualization.cpp.

References ErrorExists, and ReturnInfo.

Referenced by ConnectStk(), SetUpSatellite(), SetUpScenario(), ShutDownStk(), StartAnimation(), Update(), and ~StkVisualization().

bool StkVisualization::ConnectStk const char *  stkHostAddress,
const char *  stkHostPort = "5001"
 

stkHostAddress is the IP address of the computer running STK

Definition at line 105 of file stkvisualization.cpp.

References ClearError(), CommandBuffer, and ConID.

const char * StkVisualization::GetLastError char *  buffer  ) 
 

Returns the errors.

Definition at line 550 of file stkvisualization.cpp.

References ReturnInfo.

double StkVisualization::GetOffsetTime  )  [private]
 

Returns current time in seconds (provided by gettimeofday) + input Offset.

Definition at line 33 of file stkvisualization.cpp.

Referenced by StartAnimation(), and Update().

StkVisualization& StkVisualization::operator= const StkVisualization  )  [inline, private]
 

:^)

Definition at line 47 of file stkvisualization.h.

bool StkVisualization::SendCommand string  commandLine  )  [private]
 

Member function overload: reads in command line of type string.

Definition at line 71 of file stkvisualization.cpp.

References CommandBuffer, ConID, ErrorExists, and ReturnInfo.

bool StkVisualization::SendCommand ostringstream &  commandLine  )  [private]
 

Sends command to STK of type ostringstream.

Definition at line 54 of file stkvisualization.cpp.

References CommandBuffer, ConID, ErrorExists, and ReturnInfo.

Referenced by SetUpSatellite(), SetUpScenario(), SetWindows(), ShutDownStk(), StartAnimation(), and Update().

bool StkVisualization::SetUpNumberOfSatellites  ) 
 

Creates array of satellite names.

Definition at line 178 of file stkvisualization.cpp.

References AllSatellitesUpdated, SatelliteName, SatellitePositionUpdate, and WindowsSet.

bool StkVisualization::SetUpSatellite  ) 
 

Creates the satellites as specified by user.

Definition at line 211 of file stkvisualization.cpp.

References ClearError(), SatelliteName, ScenarioName, and SendCommand().

bool StkVisualization::SetUpScenario  ) 
 

Sets up the scenario.

Set Start and Stop times for the scenario

Definition at line 129 of file stkvisualization.cpp.

References ClearError(), ConID, ErrorExists, ReturnInfo, and SendCommand().

bool StkVisualization::SetWindows  ) 
 

Divides the screen into 2D and 3D windows.

Definition at line 322 of file stkvisualization.cpp.

References NumberOfSatellites, SatelliteName, and SendCommand().

Referenced by Update().

bool StkVisualization::ShutDownStk  ) 
 

Closes connection to STK and frees memory.

Definition at line 571 of file stkvisualization.cpp.

References ClearError(), ConID, and SendCommand().

bool StkVisualization::StartAnimation  ) 
 

Starts the animation in STK.

Definition at line 278 of file stkvisualization.cpp.

References ClearError(), GetOffsetTime(), SatelliteName, and SendCommand().

StkVisualization::Update int  satelliteNumber,
double  latitude,
double  longitude,
double  altitude,
double  latitudeRate,
double  longitudeRate,
double  altitudeRate
 

Updates the animation with new orbit information using latitude, longitude, altitude, latitude and longitude rates, and altitude rate.
Latitude and longitude are in degrees.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
[in] satelliteNumber an integer corresponding to one greater than the index number of the satellite's name, as stored in the string array SatelliteName
[in] latitude a double storing the latitude of the subsatellite point in degrees
[in] longitude a double storing the longitude of the subsatellite point in degrees
[in] altitude a double storing the altitude of the satellite in kilometers (as specified in the function SetUpScenario()
[in] latitudeRate a double storing the rate of change of latitude, in degrees per second
[in] longitudeRate a double storing the rate of change of longitude, in degrees per second
[in] altitudeRate a double storing the rate of change in altitude, in kilometers per second

Definition at line 487 of file stkvisualization.cpp.

References AllSatellitesUpdated, ClearError(), GetOffsetTime(), SatelliteName, SatellitePositionUpdate, SendCommand(), SetWindows(), and WindowsSet.

StkVisualization::Update int  satelliteNumber,
double  Q1,
double  Q2,
double  Q3,
double  Q4
 

Updates attitude using quaternions.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
[in] satelliteNumber an integer corresponding to one greater than the index number of the satellite's name, as stored in the string array SatelliteName
[in] Q1 a double storing the first quaternion component
[in] Q2 a double storing the second quaternion component
[in] Q3 a double storing the third quaternion component
[in] Q4 a double storing the fourth, scalar quaternion component

Definition at line 456 of file stkvisualization.cpp.

References ClearError(), GetOffsetTime(), SatelliteName, and SendCommand().

bool StkVisualization::Update int  satelliteNumber,
int  rotationSequence,
double  angle1,
double  angle2,
double  angle3
 

Updates attitude using Euler angles.

Parameters:
[in] satelliteNumber an integer corresponding to one greater than the index number of the satellite's name, as stored in the string array SatelliteName
[in] rotationSequence an integer storing the Euler angle rotation sequence (ex: 321, 212, 123)
[in] angle1 a double storing the first rotation in the sequence
[in] angle2 a double storing the second rotation in the sequence
[in] angle3 a double storing the third rotation in the sequence

Definition at line 425 of file stkvisualization.cpp.

References ClearError(), GetOffsetTime(), SatelliteName, and SendCommand().


Member Data Documentation

bool StkVisualization::AllSatellitesUpdated [private]
 

animation windows can be centered about the satellites

Definition at line 34 of file stkvisualization.h.

Referenced by SetUpNumberOfSatellites(), and Update().

char StkVisualization::CommandBuffer[512] [private]
 

UGLY HACK -- JRS -- AgConInit takes a char* for hostname, so copying string to buffer.

Definition at line 31 of file stkvisualization.h.

Referenced by ConnectStk(), SendCommand(), and StkVisualization().

char* StkVisualization::ConID [private]
 

STK connection ID.

Definition at line 29 of file stkvisualization.h.

Referenced by ConnectStk(), SendCommand(), SetUpScenario(), and ShutDownStk().

bool StkVisualization::ErrorExists [private]
 

Are we storing an error message?

Definition at line 30 of file stkvisualization.h.

Referenced by ClearError(), SendCommand(), and SetUpScenario().

int StkVisualization::NumberOfSatellites
 

Number of Satellites in Visualization.

Definition at line 51 of file stkvisualization.h.

Referenced by SetWindows().

double StkVisualization::Offset [private]
 

Offset in seconds from current time.

Definition at line 28 of file stkvisualization.h.

AgTConReturnInfo* StkVisualization::ReturnInfo [private]
 

Pointer to AgTConReturnInfo to get results from STK.

Definition at line 36 of file stkvisualization.h.

Referenced by ClearError(), GetLastError(), SendCommand(), SetUpScenario(), and StkVisualization().

string* StkVisualization::SatelliteName
 

Name of satellites to be stored in an array of strings.

Definition at line 53 of file stkvisualization.h.

Referenced by SetUpNumberOfSatellites(), SetUpSatellite(), SetWindows(), StartAnimation(), and Update().

bool* StkVisualization::SatellitePositionUpdate [private]
 

Used to determine if all satellites have a position so 3D.

Definition at line 33 of file stkvisualization.h.

Referenced by SetUpNumberOfSatellites(), and Update().

string StkVisualization::ScenarioName
 

Name of STK scenario specified by user.

Definition at line 52 of file stkvisualization.h.

Referenced by SetUpSatellite().

bool StkVisualization::WindowsSet [private]
 

Used to determine if the animation windows have been set.

Definition at line 35 of file stkvisualization.h.

Referenced by SetUpNumberOfSatellites(), and Update().


The documentation for this class was generated from the following files:
Generated on Wed Sep 5 12:54:43 2007 for DSACSS Operational Code by  doxygen 1.3.9.1