Skip to content

Commit

Permalink
Merge pull request #3337 from AllskyTeam/3237-bug-roi-module-is-hard-…
Browse files Browse the repository at this point in the history
…coded-to-look-for-the-last-captured-image-as-a-jpg

#3237 Ensure the ROI editor uses the correct image
  • Loading branch information
Alex-developer authored Jan 22, 2024
2 parents 23efd89 + a5c3cc9 commit 9471a3e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions html/includes/moduleutil.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ public function getModuleBaseData() {

$result['lat'] = $lat;
$result['lon'] = $lon;
$imageDir = get_variable(ALLSKY_CONFIG . '/config.sh', 'IMG_DIR=', 'current/tmp');
$result['filename'] = $imageDir . '/' . $settings_array['filename'];

exec("sunwait poll exit set angle $angle $lat $lon", $return, $retval);
if ($retval == 2) {
Expand Down
4 changes: 3 additions & 1 deletion html/js/jquery-roi/jquery-roi.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
fallbackValue: 5,
dirty: false,
roi: null,
imageFile: '',
roiSelected: function (roi) { }
}

Expand Down Expand Up @@ -212,7 +213,8 @@
}

};
imageObj.src = 'current/tmp/image.jpg?_ts=1662585950244';
let srcImage = plugin.settings.imageFile + '?_ts=' + Date.now();
imageObj.src = srcImage;

$('#' + plugin.rioId).modal({
keyboard: false
Expand Down
2 changes: 2 additions & 0 deletions html/js/modules/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,12 @@ class MODULESEDITOR {
if (fallbackValue === undefined) {
fallbackValue = 5;
}

$.allskyROI({
id: key,
roi: roi,
fallbackValue: fallbackValue,
imageFile : this.#settings.filename,
roiSelected: function(roi) {
$('#' + key).val(roi.x1 + ',' + roi.y1 + ',' + roi.x2 + ',' + roi.y2)
}
Expand Down

0 comments on commit 9471a3e

Please sign in to comment.