#include "aircraft.h"
Aircraft::Aircraft()
{
longitude="";
latitude="";
altitude="";
country="";
flight="";
code="";
earliestTime="";
latestTime="";
isOnGround=true;
speed=0.0;
track=0.0;
verticalRate=0.0;
}
Aircraft::Aircraft(string& newLongitude, string& newLatitude, string& newAltitude,string& newCountry, string& newFlight, string& newCode, string& newEarliestTime, string& newLatestTime, bool& newBool, double& newSpeed, double& newTrack, double& newRate)
{
longitude=newLongitude;
latitude=newLatitude;
altitude=newAltitude;
country=newCountry;
flight=newFlight;
code=newCode;
earliestTime=newEarliestTime;
latestTime=newLatestTime;
isOnGround= newBool;
speed= newSpeed;
track= newTrack;
verticalRate= newRate;
}
Aircraft::Aircraft(string newLongitude, string newLatitude, string newAltitude,
string newCountry, string newFlight, string newCode, string newEarliestTime, string newLatestTime, bool newBool, double newSpeed, double newTrack, double newRate)
{
longitude=newLongitude;
latitude=newLatitude;
altitude=newAltitude;
country=newCountry;
flight=newFlight;
code=newCode;
earliestTime=newEarliestTime;
latestTime=newLatestTime;
isOnGround= newBool;
speed= newSpeed;
track= newTrack;
verticalRate= newRate;
}
void Aircraft::setAll(string newLongitude, string newLatitude, string newAltitude,
string newCountry, string newFlight, string newCode, string newEarliestTime, string newLatestTime, bool newBool, double newSpeed, double newTrack, double newRate)
{
longitude=newLongitude;
latitude=newLatitude;
altitude=newAltitude;
country=newCountry;
flight=newFlight;
code=newCode;
earliestTime=newEarliestTime;
latestTime=newLatestTime;
isOnGround= newBool;
speed= newSpeed;
track= newTrack;
verticalRate= newRate;
}
Aircraft::Aircraft(const Aircraft& orig) {
}
Aircraft::~Aircraft() {
}
//set methods
void Aircraft::setCoords(string newLong, string newLat, string newAlt )
{
longitude= newLong;
latitude= newLat;
altitude= newAlt;
}
void Aircraft::setEarliestTime(string newTime)//the time that the aircraft was first detected
{
earliestTime=newTime;
}
void Aircraft::setLatestTime(string newTime)
{
latestTime = newTime;
}
void Aircraft::setCode(string newCode)//this is the uniques aircraft ID, column 3 in the bst file
{
code=newCode;
}
void Aircraft::setFlight(string newFlight)// column 5
{
flight = newFlight;
}
void Aircraft::setCountry(string newCountry)//column 6
{
country=newCountry;
}
void Aircraft::setLong(string newLong) //column 11 in the bst file
{
longitude = newLong;
}
void Aircraft::setLat(string newLat) // column 10 in the bst file
{
latitude = newLat;
}
void Aircraft::setAlt(string newAlt) // column 8 and 9 in the bst file (in feet)
{
altitude= newAlt;
}
void Aircraft::setIsOnGround(bool newBool)
{
isOnGround=newBool;
}
void Aircraft::setTrack(double newTrack)
{
track=newTrack;
}
void Aircraft::setSpeed(double newSpeed)
{
speed=newSpeed;
}
void Aircraft::setVerticalRate(double newRate)
{
verticalRate=newRate;
}
//get methods
string Aircraft::getCode()
{
return code;
}
string Aircraft::getFlight()
{
return flight;
}
string Aircraft::getCountry()
{
return country;
}
string Aircraft::getLong()
{
return longitude;
}
string Aircraft::getLat()
{
return latitude;
}
string Aircraft::getAlt()
{
return altitude;
}
string Aircraft::getEarliestTime()
{
return earliestTime;
}
string Aircraft::getLatestTime()
{
return latestTime;
}
bool Aircraft::getIsOnGround()
{
return isOnGround;
}
double Aircraft::getTrack()
{
return track;
}
double Aircraft::getSpeed()
{
return speed;
}
double Aircraft::getVerticalRate()
{
return verticalRate;
}
/* OPERATIONS */
void Aircraft::displayInfo()
{
std::cout << "Displaying Aircraft Information\n";
std::cout << "-------------------------------\n";
std::cout << "Longitude:\t" << longitude << "\n";
std::cout << "Latitude:\t" << latitude << "\n";
std::cout << "Altitude:\t" << altitude << "\n";
std::cout << "Country:\t" << country << "\n";
std::cout << "Callsign:\t" << flight << "\n";
std::cout << "ModeS add:\t" << code << "\n";
std::cout << "Earliest Time:\t" << earliestTime << "\n";
std::cout << "Latest Time:\t" << latestTime << "\n";
std::cout << "Landed:\t\t" << isOnGround << "\n";
std::cout << "Speed:\t\t" << speed << "\n";
std::cout << "Track:\t\t" << track << "\n";
std::cout << "Vertical Rate:\t" << verticalRate << "\n";
std::cout << "\n\n\n";
}