本文整理汇总了C++中FileManager::GetAbsPathname方法的典型用法代码示例。如果您正苦于以下问题:C++ FileManager::GetAbsPathname方法的具体用法?C++ FileManager::GetAbsPathname怎么用?C++ FileManager::GetAbsPathname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileManager
的用法示例。
在下文中一共展示了FileManager::GetAbsPathname方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//------------------------------------------------------------------------------
HarmonicField::HarmonicField(const std::string &name, const std::string &typeName,
Integer maxDeg, Integer maxOrd) :
GravityBase (typeName, name),
hMinitialized (false),
maxDegree (maxDeg),
maxOrder (maxOrd),
degree (4),
order (4),
filename (""),
fileRead (false),
usingDefaultFile (false),
isFirstTimeDefault (true),
inputCSName ("EarthMJ2000Eq"),
fixedCSName ("EarthFixed"),
targetCSName ("EarthMJ2000Eq"),
potPath (""),
inputCS (NULL),
fixedCS (NULL),
targetCS (NULL),
eop (NULL)
{
objectTypeNames.push_back("HarmonicField");
parameterCount = HarmonicFieldParamCount;
r = s = t = u = 0.0;
FileManager *fm = FileManager::Instance();
potPath = fm->GetAbsPathname(bodyName + "_POT_PATH");
}
示例2:
//------------------------------------------------------------------------------
HarmonicField::HarmonicField(const std::string &name, const std::string &typeName,
Integer maxDeg, Integer maxOrd) :
GravityBase (typeName, name),
hMinitialized (false),
maxDegree (maxDeg),
maxOrder (maxOrd),
degree (4),
order (4),
filename (""),
filenameFullPath (""),
fileRead (false),
usingDefaultFile (false),
isFirstTimeDefault (true),
inputCSName ("EarthMJ2000Eq"),
fixedCSName ("EarthFixed"),
targetCSName ("EarthMJ2000Eq"),
potPath (""),
inputCS (NULL),
fixedCS (NULL),
targetCS (NULL),
eop (NULL)
{
objectTypeNames.push_back("HarmonicField");
parameterCount = HarmonicFieldParamCount;
r = s = t = u = 0.0;
FileManager *fm = FileManager::Instance();
potPath = fm->GetAbsPathname(bodyName + "_POT_PATH");
#ifdef DEBUG_EOP_FILE
MessageInterface::ShowMessage
("HarmonicField() constructor, this=<%p>, name='%s'\n", this, name.c_str());
#endif
}
示例3: LoadData
//------------------------------------------------------------------------------
// virtual void LoadData()
//------------------------------------------------------------------------------
void TextEphemFileDialog::LoadData()
{
// Get default path for ephemeris file
FileManager *fm = FileManager::Instance();
mEphemDirectory = fm->GetAbsPathname(FileManager::OUTPUT_PATH).c_str();
// Append first spacecraft to selected listbox
int scCount = mSpacecraftListBox->GetCount();
if (scCount > 0)
{
wxString scName = mSpacecraftListBox->GetStringSelection();
mSelectedScListBox->Append(scName);
mSelectedScListBox->SetStringSelection(scName);
// set default ephemeris file using spacecraft name
wxString fname = scName + "_Ephem.txt";
mEphemFileTextCtrl->SetValue(mEphemDirectory + fname);
theOkButton->Enable();
}
else
{
mEphemFileTextCtrl->SetValue(mEphemDirectory +
wxString("/TextEphemHeader.txt"));
theOkButton->Disable();
}
// Show last position
mEphemFileTextCtrl->SetInsertionPointEnd();
mCoordSysComboBox->SetSelection(0);
// Load the epoch formats
StringArray reps = TimeConverterUtil::GetValidTimeRepresentations();
for (unsigned int i = 0; i < reps.size(); i++)
mEpochFormatComboBox->Append(reps[i].c_str());
mEpochFormatComboBox->SetSelection(0);
// Change label
theOkButton->SetLabel("Run and Create Ephemeris File");
}
示例4: SetStringParameter
//------------------------------------------------------------------------------
bool HarmonicField::SetStringParameter(const Integer id,
const std::string &value)
{
if (id == FILENAME)
{
if (GmatStringUtil::IsBlank(value))
{
ODEModelException ome;
ome.SetDetails(errorMessageFormatUnnamed.c_str(),
value.c_str(), "PotentialFile", "non-blank file name");
throw ome;
}
std::string newValue = value;
// if value has no file extension, add .cof as default (loj: 2008.10.14)
if (value.find(".") == value.npos)
newValue = value + ".cof";
return SetFilename(newValue);
}
if (id == INPUT_COORD_SYSTEM)
{
#ifdef DEBUG_HARMONIC_FIELD
char str[1024];
strcpy(str, value.c_str());
MessageInterface::ShowMessage(
"Setting input coordinate system name to \"%s\"\n", str);
#endif
inputCSName = value;
return true;
}
if (id == FIXED_COORD_SYSTEM)
{
#ifdef DEBUG_HARMONIC_FIELD
char str[1024];
strcpy(str, value.c_str());
MessageInterface::ShowMessage(
"Setting fixed coordinate system name to \"%s\"\n", str);
#endif
fixedCSName = value;
return true;
}
if (id == TARGET_COORD_SYSTEM)
{
#ifdef DEBUG_HARMONIC_FIELD
char str[1024];
strcpy(str, value.c_str());
MessageInterface::ShowMessage(
"Setting target coordinate system name to \"%s\"\n", str);
#endif
targetCSName = value;
return true;
}
if (id == BODY_NAME)
{
if (GravityBase::SetStringParameter(id, value))
{
// set default potential file path for the body
FileManager *fm = FileManager::Instance();
try
{
potPath = fm->GetAbsPathname(bodyName + "_POT_PATH");
}
catch (BaseException &ex)
{
// MessageInterface::ShowMessage("**** WARNING ****: %s\n",
// ex.GetFullMessage().c_str());
; // ignore this for now - GMT-2873
}
#ifdef DEBUG_HARMONIC_FIELD
MessageInterface::ShowMessage
("Setting potential file path to \"%s\"\n", potPath.c_str());
#endif
fixedCSName = value + "Fixed";
return true;
}
return false;
}
return GravityBase::SetStringParameter(id, value);
}
示例5: LoadFluxData
//------------------------------------------------------------------------------
bool SolarFluxReader::LoadFluxData(const std::string &obsFile, const std::string &predictFile)
{
std::string theLine;
if (!obsFile.empty())
obsFileName = obsFile;
if (!predictFile.empty())
predictFileName = predictFile;
obsFluxData.clear();
predictFluxData.clear();
FileManager *fm = FileManager::Instance();
if (obsFileName != "")
{
std::string weatherfile = obsFileName;
if (fm->DoesFileExist(weatherfile) == false)
weatherfile = fm->GetAbsPathname("ATMOSPHERE_PATH") + weatherfile;
if (fm->DoesFileExist(weatherfile) == false)
throw SolarSystemException("Cannot open the historic space weather file " +
obsFileName + ", nor the file at the location " + weatherfile);
obsFileName = weatherfile;
}
if (predictFileName != "")
{
std::string weatherfile = predictFileName;
if (fm->DoesFileExist(weatherfile) == false)
weatherfile = fm->GetAbsPathname("ATMOSPHERE_PATH") + weatherfile;
if (fm->DoesFileExist(weatherfile) == false)
throw SolarSystemException("Cannot open the predicted space weather file " +
predictFileName + ", nor the file at the location " + weatherfile);
predictFileName = weatherfile;
}
// Open the files to load
Open();
if (obsFileName != "")
{
if (inObs.is_open())
{
inObs.seekg(0, std::ios_base::beg);
while (!inObs.eof())
{
GmatFileUtil::GetLine(&inObs, theLine);
if (theLine.find(beg_ObsTag) != std::string::npos)
{
begObs = inObs.tellg();
}
else if (theLine.find(end_ObsTag) != std::string::npos)
{
endObs = inObs.tellg();
endObs = endObs - theLine.length() - 2;
break;
}
}
LoadObsData();
}
else
{
//throw an exception
throw SolarSystemException("SolarFluxReader: Historic/Observed File " +
obsFileName + " could not be opened.\n");
}
}
if (predictFileName != "")
{
if (inPredict.is_open())
{
inPredict.seekg(0, std::ios_base::beg);
while (!inPredict.eof())
{
GmatFileUtil::GetLine(&inPredict, theLine);
if ((theLine.find("NOMINAL TIMING") != std::string::npos) &&
(theLine.find("EARLY TIMING") != std::string::npos))
{
GmatFileUtil::GetLine(&inPredict, theLine);
break;
}
}
LoadPredictData();
}
else
{
//throw an exception
throw SolarSystemException("SolarFluxReader: The Schatten predict "
"file " + predictFileName + " could not be opened.\n");
}
}
#ifdef DEBUG_INITIALIZATION
//.........这里部分代码省略.........