本文整理汇总了C++中ArgParser::GetOptionValue方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgParser::GetOptionValue方法的具体用法?C++ ArgParser::GetOptionValue怎么用?C++ ArgParser::GetOptionValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArgParser
的用法示例。
在下文中一共展示了ArgParser::GetOptionValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _tmain
int _tmain(int argc, _TCHAR* argv[])
{
VectorReader myVectorReader;
VectorRecord_t currentVector;
ArgParser myArgParser;
unsigned long seconds_counter = 0;
unsigned long steps_counter = 0;
bool update_vector = false;
bool update_PID_control = false;
bool last_iteration = false;
float plantState;
float processF;
uint16_t processValue;
float setPointF;
uint16_t setPoint;
uint16_t setPoint_old = 0;
float effect = 0;
float k_norm = 0.446f;
float offset_norm = 48.144f;
float tempSetting; // Temperature setting
bool reg_enabled; // Heater ON/OFF
uint8_t pid_mode;
char *input_fname;
char *output_dir;
char *tmp_arg_str;
int simulation_mode;
char tmp_buf_char[100];
//--------------------------------------------//
// Command line arguments parsing
myArgParser.Parse(argc, (char **)argv);
//myArgParser.PrintOptions();
//std::cin.get();
//return 0;
if (!(input_fname = myArgParser.GetOptionValue("-input")))
{
std::cout << "Expected test vector file (-input <file>)" << std::endl;
std::cin.get();
return 0;
}
if (!(output_dir = myArgParser.GetOptionValue("-outdir")))
{
std::cout << "Expected output directory (-outdir <directory>)" << std::endl;
std::cin.get();
return 0;
}
if (!(tmp_arg_str = myArgParser.GetOptionValue("-mode")))
{
std::cout << "Expected simulation mode (-mode <PLANT_STEP / NORMAL>)" << std::endl;
std::cin.get();
return 0;
}
simulation_mode = (strcmp(tmp_arg_str, "PLANT_STEP") == 0) ? SIM_PLANT_STEP_RESPONSE : SIM_NORMAL;
//--------------------------------------------//
//-----------------------------//
// Reading test vector file
if (myVectorReader.ReadVectorFile(input_fname) == false)
{
std::cout << "Cannot read test vector file. Press any key to exit." << std::endl;
std::cin.get();
return 0;
}
std::cout << "Test vector file OK. Starting simulation." << std::endl;
//-----------------------------//
// Initializing simulation
if (!CreateDirectory(output_dir,NULL))
{
if (GetLastError() != ERROR_ALREADY_EXISTS)
{
std::cout << "Cannot create output log directory" << std::endl;
std::cin.get();
return 0;
}
}
// Open LOG files
FILE *f_state_float;
FILE *f_state_int;
FILE *f_setting;
FILE *f_p_term;
FILE *f_d_term;
FILE *f_i_term;
//.........这里部分代码省略.........