Skip to content

Commit

Permalink
Add CLASP water chiller.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote committed Apr 8, 2024
1 parent 6527621 commit 053e495
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
6 changes: 5 additions & 1 deletion 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: 156px" data-index='["clasp_ops", "telescope"]' data-notify="opsActionsQueue">
<div class="list-group-item overflow-y-scroll" style="height: 189px" data-index='["clasp_ops", "telescope"]' data-notify="opsActionsQueue">
</div>
</div>
</div>
Expand Down Expand Up @@ -100,6 +100,10 @@
<td data-focuser-index='["clasp_focus"]' data-power-index='["clasp_power", "focuser"]' data-temperature-index='["clasp_focus", "temperature", "rasa1"]' data-focuser="1" data-generator="focusState"></td>
<td data-focuser-index='["clasp_focus"]' data-power-index='["clasp_power", "focuser"]' data-temperature-index='["clasp_focus", "temperature", "rasa2"]' data-focuser="2" data-generator="focusState"></td>
</tr>
<tr>
<td>Chiller</td>
<td colspan="2" data-index='["clasp_chiller"]' data-generator="chillerState"></td>
</tr>
</tbody>
</table>
</div>
Expand Down
32 changes: 31 additions & 1 deletion static/rockit-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ function focusState(row, cell, data) {
const current_steps = getData(focuser_data, ['current_steps_' + focuser]);
const moving = getData(focuser_data, ['moving_' + focuser]);

console.log('powered', powered);
let label, style;
if (powered === 0) {
label = 'POWER OFF';
Expand Down Expand Up @@ -661,6 +660,37 @@ function lensTemperature(row, cell, data) {
}
}

function chillerState(row, cell, data) {
const mode = getData(data, ["mode"]);
const status = getData(data, ["status"]);
const tec_power = getData(data, ["tec_power"]);
const water_temp = getData(data, ["water_temp"]);

let mode_label;
if (mode === 1) {
mode_label = '<span class="text-success">AUTO</span>';
} else {
mode_label = '<span class="text-warning">MANUAL</span>';
}

let status_label;
if (status === 1) {
status_label = '<span>IDLE</span>';
} else if (status === 2) {
status_label = '<span class="text-info">COOLING</span>&nbsp;(' + tec_power.toFixed(0) + '%)';
} else if (status === 3) {
status_label = '<span class="text-warning">HEATING</span>&nbsp;(' + tec_power.toFixed(0) + '%)';
} else {
status_label = '<span class="text-danger">OFFLINE</span>';
}

let label = mode_label + '&nbsp;/&nbsp;' + status_label;
if (water_temp !== undefined)
label += '&nbsp;/&nbsp;' + water_temp.toFixed(1) + '&deg;C';

cell.html(label);
}

function roofBattery(row, cell, data) {
if (data != null) {
let display = data.toFixed(2);
Expand Down
3 changes: 2 additions & 1 deletion update-dashboard-data
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ def generate_clasp_json(output_path, date, environment, status):
(daemons.clasp_camvirt_1, 'clasp_cam1', lambda d: d.report_camera_status('cam1')),
(daemons.clasp_camera_2, 'clasp_cam2', lambda d: d.report_status()),
(daemons.clasp_power, 'clasp_power', lambda d: d.last_measurement()),
(daemons.clasp_dehumidifier, 'clasp_dehumidifier', lambda d: d.status())
(daemons.clasp_dehumidifier, 'clasp_dehumidifier', lambda d: d.status()),
(daemons.clasp_chiller, 'clasp_chiller', lambda d: d.report_status())
], status))

output.update(extract_preview_data({
Expand Down

0 comments on commit 053e495

Please sign in to comment.