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
31 changes: 31 additions & 0 deletions agent/flsagent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
agent_class: 'FLSAgent'
instance_id: 'fls-1'
processes:
acq:
startup: true
data_settings: {
'timestamp_field': 'timestamp'
}
data: {
"set_frequency": 100,
"actual_frequency": 100.00307263471768,
"photocurrent": -0.2546461127317887,
"bias_voltage": 1.00006103515625,
"bias_offset": -0.4999389573922598,
"lasers_on": true,
"scan_mode": "fast",
"scan_min_frequency": 60,
"scan_max_frequency": 500,
"scan_step": 0.05,
"scan_direction": -1,
"integration_time": 499.9640615384615,
"timestamp": 1778875096.0714755
}
tasks:
initialize: {}
run_frequency_sweeps: {}
set_bias: {}
set_frequency: {}
set_integration_time: {}
stop_frequency_sweep: {}
toggle_laser_power: {}
2 changes: 2 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
import CrateAgent from './panels/CrateAgent.vue';
import DS378Agent from './panels/DS378.vue';
import TauHKAgent from './panels/TauHKAgent.vue';
import FLSAgent from './panels/FLSAgent.vue';

/* Make a map of components to use in activeComp computed property;
see
Expand Down Expand Up @@ -181,6 +182,7 @@
'CrateAgent': CrateAgent,
'DS378Agent': DS378Agent,
'TauHKAgent': TauHKAgent,
'FLSAgent': FLSAgent,

};

Expand Down
157 changes: 157 additions & 0 deletions src/panels/FLSAgent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<template>
<AgentPanelBase />

<div class="block_holder ocs_ui">
<!-- Left block -->
<div class="block_unit">
<div class="box">
<OcsAgentHeader>FLS Agent</OcsAgentHeader>
<h2>Connection</h2>
<OpReading
caption="Address"
v-bind:value="address">
</OpReading>
<OpReading
caption="Connection"
mode="ok"
v-bind:value="panel.connection_ok">
</OpReading>
</div>

<div class="box">
<div v-for="item in statusVars" v-bind:key="item.name">
<OpReading
:caption="item.name"
v-bind:value="item.value"
/>
</div>
</div>
</div>

<!-- Right block -->
<div class="block_unit">

<OcsTask
:op_data="ops.initialize" />

<OcsTask
:op_data="ops.set_bias">
<OpDropdown
caption="Bias"
:options="['default', 'zero']"
v-model.number="ops.set_bias.params.bias" />
</OcsTask>

<OcsTask
:show_abort="true"
:op_data="ops.toggle_laser_power">
<OpDropdown
caption="State"
:options="['on', 'off']"
v-model.number="ops.toggle_laser_power.params.state" />
</OcsTask>

<OcsTask
:op_data="ops.set_frequency">
<OpParam
caption="Frequency (GHz)"
v-model.number="ops.set_frequency.params.frequency" />
</OcsTask>

<OcsTask
:op_data="ops.set_integration_time">
<OpParam
caption="Integration time (ms)"
v-model.number="ops.set_integration_time.params.integration_time" />
</OcsTask>

<OcsTask
:op_data="ops.run_frequency_sweeps">
<OpParam
caption="Min freq. (GHz)"
v-model.number="ops.run_frequency_sweeps.params.min_frequency" />
<OpParam
caption="Max freq. (GHz)"
v-model.number="ops.run_frequency_sweeps.params.max_frequency" />
<OpDropdown
caption="Start Direction"
:options="[1, -1]"
v-model.number="ops.run_frequency_sweeps.params.start_direction" />
<OpParam
caption="Frequency Step"
v-model.number="ops.run_frequency_sweeps.params.frequency_step" />
<OpParam
caption="Integration time (ms)"
v-model.number="ops.run_frequency_sweeps.params.int_time" />
</OcsTask>

<OcsTask
:op_data="ops.stop_frequency_sweep" />

<OcsProcess
:op_data="ops.acq"
/>

<OcsOpAutofill
:ops_parent="ops"
/>
</div>

</div>
</template>

<script>
export default {
name: 'FLSAgent',
props: {
address: String,
},
data: function () {
return {
ops: window.ocs_bundle.web.ops_data_init({
initialize: {},
run_frequency_sweeps: {
params: {min_frequency: 0,
max_frequency: 0,
start_direction: 1,
frequency_step: null,
int_time: null,},
},
set_bias: {
params: {bias: 'zero'},
},
set_frequency: {
params: {frequency: null},
},
set_integration_time: {
params: {integration_time: null},
},
stop_frequency_sweep: {
},
toggle_laser_power: {
params: {state: null},
},
acq: {
},
}),
panel: {},
}
},
computed: {
statusVars() {
let sdata = this.ops.acq.session.data;
let annotated = [];
if (!sdata)
return annotated;
for (const [key, value] of Object.entries(sdata)) {
annotated.push({name: key, value: value});
}
return annotated;
},
},
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
Loading