Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions Software/LMSourceCode/ImageProcessing/gs_ipc_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace golf_sim {
GolfSimMessageProducer* GolfSimIpcSystem::producer_ = nullptr;

std::string GolfSimIpcSystem::kActiveMQLMIdProperty = "LM_System_ID";

bool GolfSimIpcSystem::active_mqlibrary_initialized_ = false;

cv::Mat GolfSimIpcSystem::last_received_image_;
std::mutex GolfSimIpcSystem::last_received_image_mutex_;
Expand All @@ -102,7 +102,7 @@ namespace golf_sim {
}

activemq::library::ActiveMQCPP::initializeLibrary();

active_mqlibrary_initialized_ = true;

// Set the URI to point to the IP Address of your broker.
// add any optional params to the url to enable things like
Expand Down Expand Up @@ -198,17 +198,26 @@ namespace golf_sim {
consumer_->Shutdown();
}

producer_->Shutdown();
if (producer_ != nullptr) {
producer_->Shutdown();
}

// TBD - Give other threads a moment to shut down
sleep(4);

if (consumer_ != nullptr) {
delete consumer_;
consumer_ = nullptr;
}
if (producer_ != nullptr) {
delete producer_;
producer_ = nullptr;
}
delete producer_;

activemq::library::ActiveMQCPP::shutdownLibrary();
if (active_mqlibrary_initialized_ == true) {
activemq::library::ActiveMQCPP::shutdownLibrary();
active_mqlibrary_initialized_ = false;
}

return true;
}
Expand Down
1 change: 1 addition & 0 deletions Software/LMSourceCode/ImageProcessing/gs_ipc_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ namespace golf_sim {
private:
static GolfSimMessageConsumer* consumer_;
static GolfSimMessageProducer* producer_;
static bool active_mqlibrary_initialized_;
};

}
Expand Down
7 changes: 6 additions & 1 deletion Software/web-server/static/js/testing.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* globals setTheme, closeModal */
/* globals setTheme */

let runningTools = new Set();
let outputBuffer = [];
Expand Down Expand Up @@ -248,6 +248,11 @@ function showImageResult(toolId, imageUrl) {
modal.style.display = 'block';
}

function closeTestModal() {
modal = document.getElementById('testModal');
modal.style.display = 'none';
}

function showError(message) {
appendOutput(`[ERROR] ${message}`, 'error');
}
Expand Down
2 changes: 1 addition & 1 deletion Software/web-server/templates/testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h3>Test Output</h3>
<!-- Test Result Modal -->
<div id="testModal" class="modal" style="display: none;">
<div class="modal-content">
<span class="modal-close" onclick="closeModal()">&times;</span>
<span class="modal-close" onclick="closeTestModal()">&times;</span>
<h2 id="modalTitle">Test Result</h2>
<div id="modalBody"></div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions Software/web-server/testing_tools_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, config_manager):
"category": "camera",
"args": ["--system_mode", "camera1", "--cam_still_mode", "--output_filename=cam1_still_picture.png"],
"requires_sudo": False,
"timeout": 10,
"timeout": 20,
},
"camera2_still": {
"name": "Camera 2 Still Image",
Expand Down Expand Up @@ -197,7 +197,7 @@ async def run_tool(self, tool_id: str) -> Dict[str, Any]:
cmd.append(f"--web_server_share_dir={expanded_web_dir}")

base_image_dir = str(Path.home() / "LM_Shares/Images")
cmd.append(f"--base_image_logging_dir={base_image_dir}")
cmd.append(f"--base_image_logging_dir={base_image_dir}/")

cmd.append("--logging_level=trace")

Expand Down Expand Up @@ -277,7 +277,7 @@ async def run_tool(self, tool_id: str) -> Dict[str, Any]:
}

if "still" in tool_id:
if "cam1" in tool_id:
if "camera1" in tool_id:
image_path = Path.home() / "LM_Shares/Images/cam1_still_picture.png"
else:
image_path = Path.home() / "LM_Shares/Images/cam2_still_picture.png"
Expand Down