/** * Pass input arguments, note that argv[0] from the command line should be removed */ bool ConfigIO :: parseArgs (int nArgs, const char **argv) { if (nArgs > 0) if (_strcmpi(argv [0], "help") == 0 || _strcmpi(argv [0], "?") == 0 || _strcmpi(argv [0], "/h") == 0 || _strcmpi(argv [0], "/?") == 0) { std::cout << "------------------------------------------" << std::endl; std::cout << "Valid parameters for this application: " << std::endl; for (size_t f = 0; f < parameters.size (); f ++) std::cout << " * " << getTypeAsString(parameters[f]) << " " << parameters[f].name << " [" << getValueAsString(parameters[f]) << "]" << std::endl; std::cout << "------------------------------------------" << std::endl; exit(0); } for (int i = 0; i < nArgs; i ++) loadParam (argv [i]); return true; }
void main( int argc, char *argv[] ) { Parameters param; ExeFile exeFile; bool ret; ret = true; defaultParam( ¶m ); exeFile.file = NULL; exeFile.tabEnt = NULL; printBanner(); if( argc > 1 ) { ret = loadParam( ¶m, argc, argv ); } else { printHelp(); ret = false; } if( ret ) ret = openExeFile( &exeFile, ¶m ); if( ret ) ret = readExeHeaders( &exeFile ); if( ret ) { printDosHeader( &exeFile, ¶m ); printPeHeader( &exeFile, ¶m ); ret = findResourceObject( &exeFile ); } if( ret ) ret = loadAllResources( &exeFile ); if( ret ) { printResObject( &exeFile, ¶m ); printTableContents( exeFile.tabEnt, &exeFile, ¶m, exeFile.resObj.physical_offset, 0 ); } freeAllResources( &exeFile ); }
CameraHandler::CameraHandler(const std::string ¶m_path) : _is_sampled(false), _sphLUT_init(false), _wrapLUT_init(false), _sampling_ratio(1.) { _init = loadParam(param_path); }
Configuration configFromMap(const std::map<std::string, std::string> &map, const Configuration &defaults) { Configuration config(defaults); loadParam(map, "seed", config.testParams.seed, "'seed' must be a valid integer", anything<uint64_t>); loadParam(map, "max_success", config.testParams.maxSuccess, "'max_success' must be a valid non-negative integer", isNonNegative<int>); loadParam(map, "max_size", config.testParams.maxSize, "'max_size' must be a valid non-negative integer", isNonNegative<int>); loadParam(map, "max_discard_ratio", config.testParams.maxDiscardRatio, "'max_discard_ratio' must be a valid non-negative integer", isNonNegative<int>); loadParam(map, "noshrink", config.testParams.disableShrinking, "'noshrink' must be either '1' or '0'", anything<bool>); loadParam(map, "verbose_progress", config.verboseProgress, "'verbose_progress' must be either '1' or '0'", anything<bool>); loadParam(map, "verbose_shrinking", config.verboseShrinking, "'verbose_shrinking' must be either '1' or '0'", anything<bool>); loadParam(map, "reproduce", config.reproduce, "'reproduce' string has invalid format", anything<decltype(config.reproduce)>); return config; }
static BOOL getServer(HWND hwndDlg) { // HAB hab = WinQueryAnchorBlock(hwndDlg) ; HWND hwnd = WinWindowFromID(hwndDlg, IDD_SHOST) ; UCHAR server[128] ; WinQueryWindowText(hwnd, 128, server) ; if (strlen(server) == 0) { return FALSE ; } if (strchr(server, ':') == NULL) { return FALSE ; } loadParam(server) ; return TRUE ; }
Manager::Manager(const char* pFilename,Eigen::Vector3d (*f)(Eigen::Matrix<double,LSE_DOF_LEG,1>,int),Eigen::Matrix<double,3,LSE_DOF_LEG> (*J)(Eigen::Matrix<double,LSE_DOF_LEG,1>,int)): legKin(f),legKinJac(J),g_(0.0,0.0,-9.81){ tImu_ = 0; tEnc_ = 0; tPos_ = 0; // Init all parameters B_r_BI_.setZero(); q_IB_ = Rotations::quatIdentity(); B_r_BK_.setZero(); q_KB_ = Rotations::quatIdentity(); Rf_ = 0.002*Eigen::Matrix3d::Identity(); Rw_ = 0.000873*Eigen::Matrix3d::Identity(); Rs_ = 0.01*Eigen::Matrix3d::Identity(); Ra_ = 0.001*Eigen::Matrix<double,LSE_DOF_LEG,LSE_DOF_LEG>::Identity(); loadParam(pFilename); // Initialize filter pFilterOCEKF_ = new FilterOCEKF(this,pFilename); pDelayCalibration_ = new DelayCalibration(this,pFilename); }
bool ConfigIO :: load (const char *filename) { ifstream stream (filename); if (!stream) return false; char line [10240]; while (!stream.eof ()) { stream.getline (line, sizeof (line)); trimWhiteSpace (line); if (line [0] == '\0') continue; if (line [0] == '#') continue; if (line [0] == '%') continue; if (line [0] == ';') continue; const char *div = strchr (line, '='); if (div == NULL) continue; loadParam (line); } return true; }
RunParameter::RunParameter() { // TODO Auto-generated constructor stub loadParam(); }
RectifyStereo::RectifyStereo(string fileName, int _r){ rectified = _r; loadParam(fileName.c_str()); }
RectifyStereo::RectifyStereo(const char* fileName, int _r) { rectified = _r; loadParam(fileName); }
void RectifyStereo::loadParam(string fileName){ loadParam(fileName.c_str()); }