Skip to content

Commit

Permalink
Removed some unused configuration parameters
Browse files Browse the repository at this point in the history
kShowDebugImagesDuringExposureSelection was not used and was confusing.
  • Loading branch information
jamespilgrim committed Dec 30, 2024
1 parent befad80 commit b83aa5c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>E:\Dev_Libs\opencv\build\x64\vc16\lib;E:\Dev_Libs\boost_1_81_0\stage\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>opencv_world490d.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>E:\Dev_Libs\opencv\build\x64\vc16\lib\*.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
Expand Down
3 changes: 1 addition & 2 deletions Software/LMSourceCode/ImageProcessing/golf_sim_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"kLogIntermediateSpinImagesToFile": 0,
"kLogWebserverImagesToFile": 1,
"kLogDiagnosticImagesToUniqueFiles": 0,
"kShowDebugImagesDuringExposureSelection": 0,
"kLinuxBaseImageLoggingDir": "/home/PiTracUserName/LM_Shares/Images/",
"kPCBaseImageLoggingDir": "D:\\GolfSim\\LM\\Images\\",
"kPCBaseImageLoggingDir": "D:\\GolfSim\\LM\\Images\\"
},

"modes": {
Expand Down
2 changes: 0 additions & 2 deletions Software/LMSourceCode/ImageProcessing/gs_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace golf_sim {

// Constants used by this class
bool GolfSimCamera::kLogIntermediateExposureImagesToFile = false;
bool GolfSimCamera::kShowDebugImagesDuringExposureSelection = true;
bool GolfSimCamera::kLogWebserverImagesToFile = true;
bool GolfSimCamera::kLogDiagnosticImagesToUniqueFiles = false;

Expand Down Expand Up @@ -121,7 +120,6 @@ namespace golf_sim {
GS_LOG_TRACE_MSG(trace, "GolfSimCamera reading constants from JSON file.");
// The following constants are only used internal to the GolfSimCamera class, and so can be initialized in the constructor
GolfSimConfiguration::SetConstant("gs_config.logging.kLogIntermediateExposureImagesToFile", kLogIntermediateExposureImagesToFile);
GolfSimConfiguration::SetConstant("gs_config.logging.kShowDebugImagesDuringExposureSelection", kShowDebugImagesDuringExposureSelection);
GolfSimConfiguration::SetConstant("gs_config.logging.kLogWebserverImagesToFile", kLogWebserverImagesToFile);
GolfSimConfiguration::SetConstant("gs_config.logging.kLogDiagnosticImagesToUniqueFiles", kLogDiagnosticImagesToUniqueFiles);

Expand Down
1 change: 0 additions & 1 deletion Software/LMSourceCode/ImageProcessing/gs_camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ namespace golf_sim {
// Determines whether and how intermediate processing images (of which there are over a dozen) are logged to the
// file system. Doing so is expensive, time-wise.
static bool kLogIntermediateExposureImagesToFile;
static bool kShowDebugImagesDuringExposureSelection;
static bool kLogWebserverImagesToFile;
static bool kLogDiagnosticImagesToUniqueFiles;

Expand Down
22 changes: 11 additions & 11 deletions Software/LMSourceCode/ImageProcessing/lm_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,9 +1257,12 @@ void test_gspro_communication() {
GS_LOG_MSG(debug, json);
}

void test_function(int argc, char* argv[])
// In Linux, this function will start running the actual LM code.
// In Windoiws, this function will run whatever tests are currently
// commented in to run.
void run_main(int argc, char* argv[])
{
GS_LOG_TRACE_MSG(trace, "Test called");
GS_LOG_TRACE_MSG(trace, "run_main called");

// Start of testing
GS_LOG_TRACE_MSG(trace, "Running on " + GolfSimPlatform); // platform.platform());
Expand All @@ -1269,10 +1272,6 @@ void test_function(int argc, char* argv[])
GolfSimConfiguration::SetConstant("gs_config.modes.kStartInPuttingMode", kStartInPuttingMode);


// test_strobed_balls_detection();
// testBallPosition();
// test_gspro_communication();

#ifdef __unix__

if (GolfSimOptions::GetCommandLineOptions().shutdown_) {
Expand Down Expand Up @@ -1336,8 +1335,6 @@ void test_function(int argc, char* argv[])
if (!GsSimInterface::SendResultsToGolfSims(result)) {
GS_LOG_MSG(error, "Could not SendResultsToGolfSim. Continuing");
}


}

/**** DEPRECATED
Expand Down Expand Up @@ -1652,8 +1649,11 @@ void test_function(int argc, char* argv[])
}



// Comment in whichever tests you want to run in Windows here
testAnalyzeStrobedBalls();
// test_strobed_balls_detection();
// testBallPosition();
// test_gspro_communication();
// testSpinDetection();
#endif

Expand Down Expand Up @@ -1731,15 +1731,15 @@ int main(int argc, char *argv[])
// TBD - consider if there is a better place for this?
GolfSimGlobals::golf_sim_running_ = true;

test_function(argc, argv);
run_main(argc, argv);
}
catch (std::exception const& e)
{
GS_LOG_MSG(error, "Exception occurred. ERROR: *** " + std::string(e.what()) + " ***");
return false;
}

GS_LOG_TRACE_MSG(trace, "Finished test_function.");
GS_LOG_TRACE_MSG(trace, "Finished run_main.");

// GS_LOG_TRACE_MSG(trace, "Waiting for any keypress to end program.");
// cv::waitKey(0);
Expand Down

0 comments on commit b83aa5c

Please sign in to comment.