Skip to content
Snippets Groups Projects
Commit e474624e authored by Sylvain Fargier's avatar Sylvain Fargier :feet: Committed by Sylvain Fargier
Browse files

:bug: can't rely on "used" flag from EACS

 - used flag applies to live DAQs not configuration being prepared, it
   feels more natural to use configuration being prepared.
parent c489b876
No related branches found
No related tags found
1 merge request!35zsp and acq expand feature
// @ts-check
import Vue from "vue";
import d from 'debug';
import { every, forEach, get, map, toNumber } from 'lodash';
import { every, forEach, get, map, some, toNumber } from 'lodash';
import { mapState } from 'vuex';
import Channel from './Channel.vue';
import {
......@@ -60,7 +60,8 @@ const component = /** @type {V.Constructor<typeof options, Refs>} */ (Vue).exten
* sampleSize: number ,
* delay: number ,
* maxEditTimeWindow: number,
* isLoading: boolean
* isLoading: boolean,
* isUsed: boolean
* }}
*/
data() {
......@@ -69,7 +70,8 @@ const component = /** @type {V.Constructor<typeof options, Refs>} */ (Vue).exten
sampleSize: 0,
delay: 0,
maxEditTimeWindow: 0,
isLoading: true
isLoading: true,
isUsed: false
};
},
computed: {
......@@ -79,11 +81,11 @@ const component = /** @type {V.Constructor<typeof options, Refs>} */ (Vue).exten
})),
/** @return {boolean} */
showAcq() {
return (this.acqExpanded === "all") || (this.acqExpanded && this.card.used);
return (this.acqExpanded === "all") || (!!this.acqExpanded && this.isUsed);
},
/** @return {boolean} */
showZsp() {
return (this.zspExpanded === "all") || (this.zspExpanded && this.card.used);
return (this.zspExpanded === "all") || (!!this.zspExpanded && this.isUsed);
},
/**
* @this {Instance}
......@@ -157,6 +159,7 @@ const component = /** @type {V.Constructor<typeof options, Refs>} */ (Vue).exten
this.isLoading = false;
this.$emit('loaded');
debug('Card loaded %s', this.card.sn);
this.isUsed = some(this.$refs.Channels, 'enabled');
}
},
/** @this {Instance} */
......@@ -173,10 +176,13 @@ const component = /** @type {V.Constructor<typeof options, Refs>} */ (Vue).exten
},
/** @this {Instance} */
async configure() {
let isUsed = false;
forEach(this.$refs.Channels, (chan) => chan.setSending(true));
for (const chan of this.$refs.Channels) {
await (chan).configure();
isUsed = isUsed || chan.enabled;
}
this.isUsed = isUsed;
}
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment