Initial commit

This commit is contained in:
Anthony Hinsinger
2020-06-15 09:15:22 +02:00
parent b1973cd2ba
commit 1177ac1c61
19 changed files with 1206 additions and 37 deletions
+44
View File
@@ -0,0 +1,44 @@
const INTERFACES = {
GENERAL: 0,
TELESCOPE: 1 << 0,
CCD: 1 << 1,
GUIDER: 1 << 2,
FOCUSER: 1 << 3,
};
/*
FILTER
DOME
GPS
WEATHER
AO
DUSTCAP
LIGHTBOX
DETECTOR
ROTATOR
SPECTROGRAPH
CORRELATOR
AUX
}
*/
export function driversToInterfaces(drivers) {
const ret = [];
for (const iface in INTERFACES) {
if (INTERFACES[iface] & drivers) {
ret.push(iface);
}
}
return ret;
}
export function stateToEmoji(state) {
switch (state) {
case 0:
return "⚪";
case 1:
return "🟢";
case 2:
return "🟡";
case 3:
return "🔴";
}
}