Add new
@@ -64,25 +61,19 @@ function min_to_str(min) {
return `${Math.floor(min / 60)}h ${min % 60}m`
}
-let initrecs = function () {
- let out = [], rec;
+function event_str(v) {
+ return `${Math.floor(min / 60)}h ${min % 60}m`
+}
+
+function initrecs() {
+ let out = [], rec, i;
for (i = 1; i <= 16; i++) {
rec = {
- num: i,
- del: 1,
- enab: 1,
- rise: 1,
- sensor_enab: 0,
- sensor_angle: 0,
- sensor_time: 0,
- main_angle: 0,
- main_time: 0,
- name: "",
- exec: "",
+ num: i, del: 1, enab: 1, rise: 1, sensor_enab: 0, sensor_angle: 0,
+ sensor_time: 0, main_angle: 0, main_time: 0, name: "", exec: "",
}
out.push(rec);
}
- console.log(JSON.stringify(out));
return out;
};
@@ -91,30 +82,12 @@ const init = {
astrorecs: {
lat: 0,
lon: 0,
- records: initrecs
+ records: initrecs()
}
}
-function ApplyAstroRecord(num) {
- PostData({
- astrorecs: {
- lat: data.astrorecs.lat,
- lon: data.astrorecs.lon,
- records: [
- {
- num: data.astrorecs.records[num - 1].num,
- del: data.astrorecs.records[num - 1].del,
- enab: data.astrorecs.records[num - 1].enab,
- rise: data.astrorecs.records[num - 1].rise,
- sensor_enab: data.astrorecs.records[num - 1].sensor_enab,
- sensor_angle: data.astrorecs.records[num - 1].sensor_angle,
- main_angle: data.astrorecs.records[num - 1].main_angle,
- name: data.astrorecs.records[num - 1].name,
- exec: data.astrorecs.records[num - 1].exec
- }
- ]
- }
- }, 1, 1, ShowDelayDialog('Data applying...', 250, PostData(data, 2, 0, null)));
+function ApplyAstroRecord() {
+ PostData(data, 1, 1, null);
}
function DeleteAstroRecord(num) {
@@ -133,15 +106,6 @@ function AddAstroRecord() {
}
}
-
-const scrollHeight = computed(() => {
- let num = 0;
- for (let i = 0; i < 16; i++) if (!data.astrorecs.records[i].del) ++num;
- return (num <= 2) ? num * 400 : 800;
-});
-
-
-
const data = reactive(init);
PostData(data, 2, 0, null);