MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / DebugParams

Class DebugParams

tools/openpgl_debug/openpgl_debug.cpp:33–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33struct DebugParams
34{
35 DebugType type{HELP};
36 std::string field_file_name{""};
37 std::string field_file_name_comp{""};
38 std::string field_file_name_out{""};
39 // std::string samples_file_name{""};
40 std::vector<std::string> samples_file_names;
41 std::string samples_file_name_comp{""};
42 std::string samples_out_file_name{""};
43 std::string dump_file_name{""};
44 std::string obj_out_file_name{""};
45
46 PGL_DEVICE_TYPE device_type{PGL_DEVICE_TYPE_NONE};
47
48 bool validate()
49 {
50 bool valid = true;
51 switch (type)
52 {
53 case HELP:
54 break;
55
56 case FIT_FIELD:
57 if(samples_file_names.size() == 0 /*||
58 !file_exists(samples_file_name)*/)
59 {
60 std::cout << "ERROR: Samples file not set" << std::endl;
61 valid = false;
62 }
63 else
64 {
65 for (int i = 0; i < samples_file_names.size(); i++)
66 {
67 if (!file_exists(samples_file_names[i]))
68 {
69 std::cout << "ERROR: Samples file does not exists: " << samples_file_names[i] << std::endl;
70 valid = false;
71 }
72 }
73 }
74 if (device_type == PGL_DEVICE_TYPE_NONE)
75 {
76 std::cout << "ERROR: Device type not set." << std::endl;
77 valid = false;
78 }
79 break;
80 case UPDATE_FIELD:
81 if (field_file_name == "" || !file_exists(field_file_name))
82 {
83 std::cout << "ERROR: Field file not set or does not exists: " << field_file_name << std::endl;
84 valid = false;
85 }
86 if(samples_file_names.size() == 0 /*||
87 !file_exists(samples_file_name)*/)
88 {
89 std::cout << "ERROR: Samples file not set" << std::endl;
90 valid = false;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected