本文整理汇总了C++中Station::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ Station::GetName方法的具体用法?C++ Station::GetName怎么用?C++ Station::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Station
的用法示例。
在下文中一共展示了Station::GetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNumStations
/// Converts this object to a valid OIFITSLIB OI_ARRAY struct.
oi_array Array::GetOIArray(void)
{
/// \todo This could be claned up to use datamembers instead of function calls.
// init local vars:
oi_array array;
int nstations = GetNumStations();
string arrname = GetArrayName();
double GeocLat, GeocRadius;
// Allocate room for the station information
array.elem = (element *) malloc(nstations * sizeof(element));
// Set the revision number, array name, and coordiantes.
array.revision = 1;
strncpy(array.arrname, arrname.c_str(), FLEN_VALUE);
strncpy(array.frame, "GEOCENTRIC", FLEN_VALUE);
wgs84_to_geoc(latitude, altitude, &GeocLat, &GeocRadius);
array.arrayx = GeocRadius * cos(GeocLat) * cos(this->longitude);
array.arrayy = GeocRadius * cos(GeocLat) * sin(this->longitude);
array.arrayz = GeocRadius * sin(GeocLat);
array.nelement = nstations;
Station * station;
string station_name;
for (int i = 0; i < nstations; i++)
{
station = this->GetStation(i);
station_name = station->GetName();
station_name.resize(16);
strncpy(array.elem[i].tel_name, station->GetName().c_str(), 16);
strncpy(array.elem[i].sta_name, station->GetName().c_str(), 16);
array.elem[i].sta_index = station->GetIndex();
array.elem[i].diameter = station->diameter;
array.elem[i].staxyz[0] = station->xyz[0];
array.elem[i].staxyz[1] = station->xyz[1];
array.elem[i].staxyz[2] = station->xyz[2];
}
return array;
}