Skip to content

Commit

Permalink
Update CLASP QHY temp/cooling to match SWASP.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote committed Dec 22, 2023
1 parent 7de09bb commit 810bdeb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
9 changes: 7 additions & 2 deletions dashboard/templates/clasp.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="col-12 g-2">
<div class="list-group rounded-0">
<span class="list-group-item text-center fw-bold">Action Queue</span>
<div class="list-group-item overflow-y-scroll" style="height: 123px" data-index='["clasp_ops", "telescope"]' data-notify="opsActionsQueue">
<div class="list-group-item overflow-y-scroll" style="height: 156px" data-index='["clasp_ops", "telescope"]' data-notify="opsActionsQueue">
</div>
</div>
</div>
Expand Down Expand Up @@ -81,7 +81,12 @@
<td data-index='["clasp_cam2"]' data-generator="swirExposure"></td>
</tr>
<tr>
<td>Temperature</td>
<td>Cooling</td>
<td data-index='["clasp_cam1"]' data-generator="qhyCooling"></td>
<td data-index='["clasp_cam2"]' data-generator="swirCooling"></td>
</tr>
<tr>
<td>Temp.&nbsp;/&nbsp;RH.</td>
<td data-index='["clasp_cam1"]' data-generator="qhyTemperature"></td>
<td data-index='["clasp_cam2"]' data-generator="swirTemperature"></td>
</tr>
Expand Down
21 changes: 19 additions & 2 deletions static/rockit-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,24 @@ function swirExposure(row, cell, data) {
function swirTemperature(row, cell, data) {
const state = getData(data, ["state"]);
const temperature = getData(data, ["sensor_temperature"]);

let label = 'ERROR';
let style = 'text-danger';
if (state === 0) {
label = 'N/A';
style = '';
} else if (temperature !== undefined) {
label = temperature.toFixed(0) + '&nbsp;&deg;C';
style = '';
}

cell.html(label);
cell.addClass(style);
}

function swirCooling(row, cell, data) {
const state = getData(data, ["state"]);
const temperature = getData(data, ["sensor_temperature"]);
const cooler_mode = getData(data, ["cooler_mode"]);

const cooler_labels = [
Expand All @@ -525,9 +543,8 @@ function swirTemperature(row, cell, data) {
if (state === 0) {
label = 'N/A';
style = '';
} else if (cooler_mode !== undefined && temperature !== undefined) {
} else if (cooler_mode !== undefined) {
label = '<span class="' + cooler_labels[cooler_mode][1] + '">' + cooler_labels[cooler_mode][0] + '</span>'
label += ' (' + temperature.toFixed(0) + '&nbsp;&deg;C)';
style = '';
}

Expand Down

0 comments on commit 810bdeb

Please sign in to comment.