Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 82 additions & 1 deletion agent/acuagent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,78 @@ processes:
"Turnaround acceleration too high": false,
"Turnaround time too short": false
},
"Status3rdAxis": {}
"Status3rdAxis": {},
"Hvac": {
"Time": 140.692723383876,
"Year": 2026,
"Temperature EL Housing 1": -0.9,
"Temperature EL Housing 2": -0.9,
"Temperature EL Housing 3": -0.5,
"Temperature EL Housing 4": -0.5,
"Temperature EL Housing 5": -0.6,
"Temperature EL Housing 6": -0.1,
"Temperature Yoke Arm B 1": -1.6,
"Temperature Yoke Arm B 2": -2.5,
"Temperature Yoke Arm B 3": -2.3,
"Temperature Yoke Arm B 4": -1.9,
"Temperature Yoke Arm A Instrument Space 1": 3.1,
"Temperature Yoke Arm A Instrument Space 2": 0.9,
"Temperature Yoke Arm A Instrument Space 3": 2.6,
"Temperature Yoke Arm A Instrument Space 4": -0.4,
"Temperature Yoke Arm A Instrument Space 5": -0.8,
"Temperature Yoke Arm A Instrument Space 6": 3.1,
"Temperature Yoke Traverse B Process Space 1": 2.9,
"Temperature Yoke Traverse B Process Space 2": 8.4,
"Temperature Yoke Traverse B Process Space 3": 4.7,
"Temperature Yoke Traverse B Process Space 4": 3.4,
"Temperature Yoke Traverse M Servo Space 1": 13,
"Temperature Yoke Traverse M Servo Space 2": 17.3,
"Temperature Yoke Traverse M Servo Space 3": 12.4,
"Temperature Yoke Traverse M Servo Space 4": 7.8,
"Temperature Yoke Traverse A Electronic Space 1": 11.9,
"Temperature Yoke Traverse A Electronic Space 2": 8.6,
"Temperature Yoke Traverse A Electronic Space 3": 6.8,
"Temperature Yoke Traverse A Electronic Space 4": 13.2,
"Temperature MPD Container 1": 8.6,
"Temperature MPD Container 2": 10.6,
"Temperature Ambient 1": -1.2,
"Temperature Ambient 2": -1.1,
"Temperature Average EL Housing": -0.53,
"Temperature Average Yoke Arm B": -2.07,
"Temperature Average Yoke Arm A Instrument Space": 1.45,
"Temperature Average Yoke Traverse B Process Space": 4.82,
"Temperature Average Yoke Traverse M Servo Space": 12.62,
"Temperature Average Yoke Traverse A Electronic Space": 10.12,
"Temperature Average MPD Container": 9.6,
"Temperature Average Ambient": -0.9,
"Setpoint Temperature Yoke Traverse": 10,
"Setpoint Speed Fan Yoke Arm B": 95,
"Setpoint Speed Fan Yoke Arm A Instrument Space": 97,
"Setpoint Speed Fan Yoke Traverse B Process Space": 98,
"Setpoint Speed Fan Yoke Traverse M Servo Space": 100,
"Setpoint Speed Fan Yoke Traverse A Electronic Space": 100,
"Booster EL Housing Failure": false,
"Booster Yoke Traverse B Process Space Failure": false,
"Booster Yoke Traverse M Servo Space Failure": false,
"Booster Yoke Traverse A Electronic Space Failure": false,
"Fan EL Housing Failure": false,
"Fan Yoke Arm B Failure": false,
"Fan Yoke Arm A Instrument Space Failure": false,
"Fan Yoke Traverse B Process Space Failure": false,
"Fan Yoke Traverse M Servo Space Failure": false,
"Fan Yoke Traverse A Electronic Space Failure": false,
"Booster EL Housing on": true,
"Booster Yoke Traverse B Process Space on": true,
"Booster Yoke Traverse M Servo Space on": true,
"Booster Yoke Traverse A Electronic Space on": true,
"Fan EL Housing on": false,
"Fan Yoke Arm B on": false,
"Fan Yoke Arm A Instrument Space on": false,
"Fan Yoke Traverse B Process Space on": false,
"Fan Yoke Traverse M Servo Space on": false,
"Fan Yoke Traverse A Electronic Space on": true,
"Heater on": true,
},
}
generate_scan: {}
broadcast:
Expand All @@ -205,3 +276,13 @@ tasks:
set_boresight: {}
stop_and_clear: {}
clear_faults: {}
special_action: {}

modes:
# Pass --mode platformCcat for better LAT-likeness
platformCcat:
_update:
processes:
monitor:
data:
PlatformType: 'ccat'
22 changes: 20 additions & 2 deletions agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def add_agent_args(parser_in=None):
pgroup.add_argument("--schema-file",
help='YAML file with description of operations '
'to mock')
pgroup.add_argument('--mode', action='append', default=[],
help='Special mode settings to apply (can pass multiple; applied in order)')
return parser_in

def wrap_starter(instance, name, cfg, start_proc):
Expand All @@ -115,7 +117,18 @@ def _f(self, session, params):
func = _f.__get__(instance, instance.__class__)
setattr(instance, proc_name, func)
return func


def apply_config_patch(schema, patch):
def merge_tree(a, patch):
assert (isinstance(a, dict) and isinstance(patch, dict))
for k, v in patch.items():
if isinstance(v, dict) and isinstance(a.get(k), dict):
merge_tree(a[k], v)
else:
a[k] = v
if '_update' in patch:
merge_tree(schema, patch['_update'])


if __name__ == '__main__':
txaio.start_logging(level=os.environ.get("LOGLEVEL", "info"))
Expand All @@ -124,10 +137,15 @@ def _f(self, session, params):
args = site_config.parse_args(agent_class='*host*', parser=parser)

schema = yaml.safe_load(open(args.schema_file, 'rb'))
for mode in args.mode:
if mode not in schema['modes']:
raise ValueError(f"Requested mode '{mode}' not found in available: {schema['modes']}")
apply_config_patch(schema, schema['modes'][mode])

args.agent_class = schema['agent_class']
if args.instance_id is None:
args.instance_id = schema['instance_id']

agent, runner = ocs_agent.init_site_agent(args)
mocker = MockingJaygent(agent)

Expand Down
13 changes: 12 additions & 1 deletion src/components/OpDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
<h2>{{ opDetail.title }}</h2>
<div class="holder ocs_ui">
<div class="tabs">
<div v-for="tab in tabs" v-bind:key="tab" :class="{inactive: detailTab!=tab}">
<div class="filler"/>
<div v-for="tab in tabs" v-bind:key="tab" :class="{inactive: detailTab!=tab}" class="clickable">
<span
@click="setDetailTab(tab)"
:class="{inactive: detailTab!=tab}"
>{{ tab }}</span>
</div>
<div class="filler"/>
</div>
<br />
<div class="scrollableContent">
Expand Down Expand Up @@ -67,15 +69,24 @@
.tabs > div {
display: inline;
border: solid black 1px;
border-bottom: none;
padding: 10px;
width: 50px;
}
.tabs {
margin: 10px 0px;
padding: 10px;
}
.inactive {
background-color: #ddd;
}
div.inactive {
border-bottom: solid black 1px;
}
div.filler {
border: none;
border-bottom: solid black 1px;
}

.holder {
overflow: auto;
Expand Down
46 changes: 42 additions & 4 deletions src/components/OpParam.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,46 @@ OpParam
-------

This component provides user-editable text fields for an Agent Panel.
These can be used to map values into operation start arguments, or for
other stuff. Note checkbox and ride-along buttons are supported.

Usage::

<OpParam
caption="Some param"
v-model="ops.op_name.params.param_name" />

You can apply model value filters -- e.g. use v-model.number. To
force blank values to return null, include::

modelValue="blank_to_null"

To make it a checkbox (which will automatically parse as a bool),
include::

:checkbox="true"

To include both the editable field and a clickable button, pass::

button="Button text"
@click-button="do_click()"

-->

<template>
<div class="ocs_row">
<label>{{ caption }}</label>
<input v-bind:class="{ocs_double: !button}"
<label v-bind:class="{ocs_double: wideLabel}">{{ caption }}</label>
<input v-if="checkbox"
type="checkbox"
v-bind:class="{ocs_double: wideInput}"
:disabled="modelDisabled == true"
id="checkbox"
v-model="value" />
<input v-else
type="text"
v-bind:class="{ocs_double: wideInput}"
:disabled="modelDisabled == true"
v-model="value"
/>
v-model="value" />
<button v-if="button"
:disabled="disabled"
@click="$emit('click-button')">
Expand All @@ -31,6 +60,9 @@ This component provides user-editable text fields for an Agent Panel.
button: {
default: false,
},
checkbox: {
default: false,
},
disabled: {
default: false,
},
Expand All @@ -43,6 +75,12 @@ This component provides user-editable text fields for an Agent Panel.
modelType: {},
},
computed: {
wideLabel() {
return !this.button && this.checkbox;
},
wideInput() {
return !this.button && !this.checkbox;
},
value: {
get() {
return this.modelValue;
Expand Down
Loading
Loading