-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
62 lines (54 loc) · 1.28 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import '@kor-ui/kor';
import { init3D } from './earth_3d.js';
import { createGUI } from './ui.js';
const app_state = {};
const default_free_text = `date: 2018-11-15
eye height: 2 meter
index error: 0.3'
star: Regulus
alt: 70° 48.7' 0"
time: 08:28:15
star: Arcturus
alt: 27° 9.0' 0"
time: 08:30:30
star: Dubhe
alt: 55° 18.4' 0"
time: 08:32:15`;
function reset_app() {
const d = new Date();
app_state.data = {
date: { y: d.getFullYear(), m: 1 + d.getMonth(), d: d.getDay() },
timezone: 0,
watch_error: 0,
method: 'sextant',
index_error: 0,
observer_height_meter: 0,
temperature_celsius: 10,
pressure_mbar: 1010,
has_dr: false,
dr: { lat: 0, lon: 0, name: '', distance: 0 },
heading: 0,
speed_knots: 0,
compare_location: false,
actual_location: { lat: 0, lon: 0 },
stars: [],
};
app_state.worksheet = [];
app_state.fix = { gha: 0 };
app_state.constellations_visible = true;
app_state.sky_rotation = 0;
app_state.latlon_lines_visible = false;
app_state.water_opacity = 0.666;
app_state.default_free_text = default_free_text;
}
reset_app();
window.main = function (almanac) {
app_state.almanac = almanac;
window.app_state = app_state;
reset_app();
init3D(app_state);
createGUI(app_state);
};
export {
reset_app,
};