Initial commit
This commit is contained in:
@@ -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 "🔴";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user