OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Functions
atp-config-test.cpp File Reference
#include "../src/AtpConfig.h"
#include <ossim/init/ossimInit.h>

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 20 of file atp-config-test.cpp.

References ossim::JsonConfig::diagnosticLevel(), ossimInit::initialize(), ossimInit::instance(), ossim::JsonConfig::loadJSON(), and ATP::AtpConfig::readConfig().

21 {
22  clog << "ATP Config Test" << endl;
23  ossimInit::instance()->initialize(argc, argv);
24 
25  // Initialize correlation parameters:
26  AtpConfig& atpConfig = AtpConfig::instance();
27  clog << "\nDump of default common ATP params:"<<endl;
28  clog << atpConfig << endl;
29 
30  if (!atpConfig.readConfig("crosscorr"))
31  {
32  clog <<"\nError reading testConfig!"<<endl;
33  return 1;
34  }
35  clog << "\n******************************************************************"<<endl;
36  clog << "\nDump of crosscorr ATP params:"<<endl;
37  clog << atpConfig << endl;
38 
39  if (!atpConfig.readConfig("testConfig"))
40  {
41  clog <<"\nError reading testConfig!"<<endl;
42  return 1;
43  }
44  clog << "\n******************************************************************"<<endl;
45  clog << "\nDump of testConfig ATP params:"<<endl;
46  clog << atpConfig << endl;
47 
48  Json::Value shortForm;
49  shortForm["myCustomParam"] = false;
50  shortForm["peakThreshold"] = 0.8;
51  shortForm["algorithm"] = "override-test";
52  shortForm["newParam"] = "oops";
53  shortForm["diagnosticLevel"] = 3;
54  atpConfig.loadJSON(shortForm);
55  clog << "\n******************************************************************"<<endl;
56  clog << "\nDump of short-form ATP params override:"<<endl;
57  clog << atpConfig << endl;
58 
59  if (atpConfig.diagnosticLevel(2) && !atpConfig.diagnosticLevel(4))
60  clog<<"\nCorrectly processed diagnostic level."<<endl;
61  else
62  clog<<"\nDiagnostic level test failed."<<endl;
63 
64  return 0;
65 }
void initialize(int &argc, char **argv)
Definition: ossimInit.cpp:119
bool diagnosticLevel(unsigned int level) const
Convenience method returns TRUE if the currently set diagnostic level is <= level.
Definition: JsonConfig.cpp:461
static ossimInit * instance()
Definition: ossimInit.cpp:89
virtual void loadJSON(const Json::Value &params_json_node)
Reads the params controlling the process from the JSON node named "parameters".
Definition: JsonConfig.cpp:403
bool readConfig(const std::string &configName="")
Definition: AtpConfig.cpp:38
Singleton class maintaining parameters affecting the automatic tie point generation.
Definition: AtpConfig.h:24