Skip to content

Commit

Permalink
ACU: add "Go to named" Action, with drop-down
Browse files Browse the repository at this point in the history
  • Loading branch information
mhasself committed Sep 26, 2024
1 parent e459beb commit 260a719
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
12 changes: 12 additions & 0 deletions agent/acuagent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ processes:
}
data: {
"PlatformType": 'satp',
"DefaultScanParams": {
"az_speed": 1,
"az_accel": 1
},
"StatusResponseRate": 19.567672060689702,
"IgnoredAxes": [
"third"
],
"NamedPositions": {
"home": [180, 40]
},
"StatusDetailed": {
"Time": 51.709323698652,
"Year": 2023,
Expand Down Expand Up @@ -190,6 +201,7 @@ processes:

tasks:
go_to: {}
go_to_named: {}
set_boresight: {}
stop_and_clear: {}
clear_faults: {}
52 changes: 52 additions & 0 deletions src/panels/ACUAgent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,30 @@
</div>
</form>

<form v-on:submit.prevent
v-if="motion_control.type == 'goto_named'">
<OpDropdown
caption="Position"
:options="namedPositionsArray"
options_style="object"
v-model="motion_control.goto_target"
/>
<div class="ocs_row">
<label>Set mode=Stop at end?</label>
<input type="checkbox" id="checkbox" v-model="motion_control.goto_target_stop"
class="ocs_double" />
</div>
<div class="ocs_row">
<label />
<button
:disabled="accessLevel < 1"
@click="startMotion">Start</button>
<button
:disabled="accessLevel < 1"
@click="stopMotion">Abort</button>
</div>
</form>

<form v-on:submit.prevent
v-if="motion_control.type == 'sun_stuff'">
<OpReading
Expand Down Expand Up @@ -460,6 +484,7 @@
broadcast: {
params: {},
},
go_to_named: {},
restart_idle: {},
clear_faults: {},
monitor_sun: {},
Expand All @@ -469,6 +494,7 @@
motion_types: {
const_el: "Constant el scan",
goto: "Go to position",
goto_named: "Go to named",
sun_stuff: "Sun Avoidance",
},
motion_control: {
Expand All @@ -481,6 +507,9 @@
goto_az: 180,
goto_el: 60,
goto_target: null,
goto_target_stop: true,
},
start_types: ["end", "mid"],
speed_modes: ["high", "low"],
Expand Down Expand Up @@ -532,6 +561,17 @@
this.ops.go_to.params);
break;
}
case "goto_named": {
// Update the parameters of the generate_scan process.
let gs = this.ops.go_to_named.params;
gs['target'] = p.goto_target;
gs['end_stop'] = p.goto_target_stop;
window.ocs_bundle.ui_run_task(this.address, 'go_to_named',
this.ops.go_to_named.params);
break;
}
}
},
stopMotion() {
Expand Down Expand Up @@ -726,6 +766,7 @@
let activities = {
"Scanning": this.ops.generate_scan.session,
"Moving": this.ops.go_to.session,
"Moving (Named)": this.ops.go_to_named.session,
"Setting Boresight": this.ops.set_boresight.session,
"Escaping the Sun": this.ops.escape_sun_now.session,
};
Expand Down Expand Up @@ -887,6 +928,17 @@
active,
];
},
namedPositionsArray() {
let pos_list = this.ops.monitor.session?.data?.NamedPositions;
if (!pos_list)
return [];
let names = {};
Object.entries(pos_list).forEach(([k, v]) => {
let [az, el] = v;
names[k] = `${k} (az=${az},el=${el})`;
});
return names;
},
},
}
</script>
Expand Down

0 comments on commit 260a719

Please sign in to comment.