Merge branch 'feature/sottocofano' into develop
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { TimeLineChartHeader } from "@/components/timeline-chart";
|
||||
import { debounce } from "@/_base/debounce";
|
||||
import Vue from "vue";
|
||||
import Component from "vue-class-component";
|
||||
@@ -103,6 +104,8 @@ export default class Numeric extends Vue {
|
||||
this.focused = false;
|
||||
this.value.setpointHMI = this.setPoint.setpointHMI;
|
||||
})
|
||||
|
||||
this.$emit("update", this.setPoint.setpointHMI);
|
||||
}
|
||||
|
||||
}
|
||||
+17
-1
@@ -1,6 +1,7 @@
|
||||
import Component from "vue-class-component";
|
||||
import Vue from "vue";
|
||||
import { Prop } from "vue-property-decorator";
|
||||
import { Prop, Watch } from "vue-property-decorator";
|
||||
import { underTheHoodService } from "@/services/underTheHoodService";
|
||||
|
||||
@Component({})
|
||||
export default class outputRow extends Vue {
|
||||
@@ -14,4 +15,19 @@ export default class outputRow extends Vue {
|
||||
@Prop()
|
||||
group: string;
|
||||
|
||||
|
||||
get forcedValue() { return { setpointHMI: this.item.forcedValue, range: { min: -32768, max: 32767 } }; }
|
||||
|
||||
|
||||
forceValueChanged(n) {
|
||||
this.force(n);
|
||||
}
|
||||
|
||||
async force(value: number) {
|
||||
await underTheHoodService.forceChannel(this.group, this.item, value);
|
||||
}
|
||||
|
||||
async reset() {
|
||||
await underTheHoodService.resetChannel(this.group, this.item);
|
||||
}
|
||||
}
|
||||
+22
-14
@@ -38,21 +38,29 @@
|
||||
<span v-if="item.value == 0" class="value-button-input-container-off-label">OFF</span>
|
||||
</span>
|
||||
</td>
|
||||
<td v-if="group=='ao'" class="ao">
|
||||
<span>{{item.value}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="do-container">
|
||||
<div class="io-buttons" v-if="group=='do'">
|
||||
<button :class="{forced: item.forceZero}">0</button>
|
||||
<button :class="{forced: item.forceOne}">1</button>
|
||||
<template v-if="item.forceEnabled">
|
||||
<td v-if="group=='ao'" class="ao">
|
||||
<span>{{item.value}}</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="do-container">
|
||||
<div class="io-buttons" v-if="group=='do'">
|
||||
<button :class="{forced: item.forceZero}" @click="force( 0)">0</button>
|
||||
<button :class="{forced: item.forceOne}" @click="force( 1)">1</button>
|
||||
</div>
|
||||
<numeric
|
||||
v-model="forcedValue"
|
||||
v-if="group=='ao'"
|
||||
keyboard-position="left"
|
||||
@update="forceValueChanged"
|
||||
/>
|
||||
<button class="btn-force" v-if="item.isForced" @click="reset()">
|
||||
<i class="fa fa-times" />
|
||||
</button>
|
||||
</div>
|
||||
<numeric v-model="item.forcedValue" v-if="group=='ao'" keyboard-position="left" />
|
||||
<button class="btn-force" v-if="item.isForced">
|
||||
<i class="fa fa-times" />
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</td>
|
||||
</template>
|
||||
<td v-else></td>
|
||||
</tr>
|
||||
</template>
|
||||
<script src="./output-row-item.ts" lang="ts">
|
||||
|
||||
@@ -6,6 +6,9 @@ import logCicloAutomatico from "./LogCicloAutomatico/components/log-ciclo-automa
|
||||
import logMisurazioni from "./LogMisurazioni/components/log-misurazioni/log-misurazioni.vue";
|
||||
import assi from "./Assi/components/assi/assi.vue";
|
||||
import riscaldi from "./Riscaldi/components/riscaldi/riscaldi.vue";
|
||||
import { store } from "@/store";
|
||||
import { Watch } from "vue-property-decorator";
|
||||
import { underTheHoodService } from "@/services/underTheHoodService";
|
||||
|
||||
@Component({
|
||||
components: { menuSx, io, logCicloAutomatico, logMisurazioni, assi, riscaldi }
|
||||
@@ -14,4 +17,12 @@ export default class Sottocofano extends Vue {
|
||||
|
||||
panel: string = 'io';
|
||||
|
||||
get isLifted(): boolean {
|
||||
return store.state.isMainViewLiftedUp;
|
||||
}
|
||||
|
||||
@Watch("isLifted")
|
||||
async liftedChanged() {
|
||||
await underTheHoodService.setFastSample(this.isLifted)
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,19 @@ export class UnderTheHoodService extends baseRestService {
|
||||
underTheHoodActions.SetIOChannelsConfig(store, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
async forceChannel(group: string, item: server.channel, value: number) {
|
||||
await this.Put((await this.BASE_URL()) + `/api/underthehood/io_force_ch_${group}`, [{ id: item.id, value }]);
|
||||
}
|
||||
|
||||
async resetChannel(group: string, item: server.channel) {
|
||||
await this.Put((await this.BASE_URL()) + `/api/underthehood/io_reset_ch_${group}`, [item.id]);
|
||||
}
|
||||
|
||||
async setFastSample(value: boolean) {
|
||||
await this.Put((await this.BASE_URL()) + `/api/underthehood/io_sample_fast?value=${value}`, {});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const underTheHoodService = new UnderTheHoodService();
|
||||
@@ -78,7 +78,7 @@ const _store = {
|
||||
|
||||
state: {
|
||||
currentUser: null,
|
||||
isMainViewLiftedUp: true,
|
||||
isMainViewLiftedUp: false,
|
||||
isFavSoftkeySelection: false,
|
||||
isShowDashboard: false,
|
||||
isShowPreDashboard: false
|
||||
|
||||
Reference in New Issue
Block a user