Fix thermocamera
This commit is contained in:
@@ -848,8 +848,12 @@ namespace Client2020
|
||||
LastKeybPositionReopen = new Point() { X = KeybRct.Left, Y = KeybRct.Top };
|
||||
}
|
||||
|
||||
for (int i = 0; i < processes.Length; i++)
|
||||
processes[i].Kill();
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < processes.Length; i++)
|
||||
processes[i].Kill();
|
||||
}
|
||||
catch (Exception ex) { }
|
||||
|
||||
KeyboardPID = 0;
|
||||
KeyboardHandle = IntPtr.Zero;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
.warmers {
|
||||
position: relative;
|
||||
|
||||
|
||||
svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
section {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-flow: row nowrap;
|
||||
padding: 14px;
|
||||
display: flex;
|
||||
@@ -122,6 +123,7 @@
|
||||
flex: 0 0 520px;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px;
|
||||
position: relative;
|
||||
|
||||
hr {
|
||||
flex-shrink: 0;
|
||||
@@ -131,6 +133,25 @@
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.notEnabled{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 200;
|
||||
background-color: #ffffffdd;
|
||||
font-size: 3em;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
&.small{
|
||||
margin-top: 55px;
|
||||
height: 90%;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
article {
|
||||
@@ -140,6 +161,21 @@
|
||||
// align-items: center;
|
||||
position: relative;
|
||||
|
||||
.notEnabled{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 200;
|
||||
background-color: #ffffffdd;
|
||||
font-size: 3em;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&.shrink {
|
||||
flex-shrink: 2;
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
}
|
||||
.setup .modal section.body section {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
flex-flow: row nowrap;
|
||||
padding: 14px;
|
||||
display: flex;
|
||||
@@ -111,6 +112,7 @@
|
||||
flex: 0 0 520px;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px;
|
||||
position: relative;
|
||||
}
|
||||
.setup .modal section.body section aside hr {
|
||||
flex-shrink: 0;
|
||||
@@ -119,12 +121,44 @@
|
||||
height: 2px;
|
||||
margin-left: 0px;
|
||||
}
|
||||
.setup .modal section.body section aside .notEnabled {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 200;
|
||||
background-color: #ffffffdd;
|
||||
font-size: 3em;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.setup .modal section.body section aside .notEnabled.small {
|
||||
margin-top: 55px;
|
||||
height: 90%;
|
||||
}
|
||||
.setup .modal section.body section article {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.setup .modal section.body section article .notEnabled {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 200;
|
||||
background-color: #ffffffdd;
|
||||
font-size: 3em;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.setup .modal section.body section article.shrink {
|
||||
flex-shrink: 2;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,12 @@ declare module Warmers {
|
||||
row: number,
|
||||
dimension: number
|
||||
}
|
||||
|
||||
interface ICamStatus {
|
||||
thermoOptionActive: boolean,
|
||||
thermoCamMode: boolean,
|
||||
thermoCamOnOff: boolean
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+34
-9
@@ -27,18 +27,38 @@ export default class Resistance extends Vue {
|
||||
@Prop({ default: function () { return [63, 164, 255] } })
|
||||
selectedColorFrom: number[];
|
||||
|
||||
@Prop({ default: function () { return [63, 164, 255] } })
|
||||
ColorColdFrom: number[];
|
||||
|
||||
@Prop({ default: function () { return [23, 86, 173] } })
|
||||
colorColdTo: number[];
|
||||
|
||||
@Prop({ default: function () { return [23, 86, 173] } })
|
||||
selectedColorTo: number[];
|
||||
|
||||
get currentStandardTempColor() {
|
||||
//Not linear, but quadratic
|
||||
if(!this.channel.tCamActive)
|
||||
if(!this.channel.tCamActive || this.channel.tCamTempSet==0)
|
||||
return "179, 179, 179";
|
||||
|
||||
var x = 1/100 * this.channel.setpointHMI * this.channel.setpointHMI;
|
||||
return [this.colorFrom[0] - (this.colorFrom[0] - this.colorTo[0]) * x / 100,
|
||||
this.colorFrom[1] - (this.colorFrom[1] - this.colorTo[1]) * x / 100,
|
||||
this.colorFrom[2] - (this.colorFrom[2] - this.colorTo[2]) * x / 100];
|
||||
var delta = this.channel.tCamTempSet - this.channel.tCamTempAct;
|
||||
if(delta=> - 5 && delta<=5)
|
||||
{
|
||||
return "144,191,61";
|
||||
}
|
||||
else if(delta>5){
|
||||
return [this.colorFrom[0] - (this.colorFrom[0] - this.colorTo[0]) * delta / 100,
|
||||
this.colorFrom[1] - (this.colorFrom[1] - this.colorTo[1]) * delta / 100,
|
||||
this.colorFrom[2] - (this.colorFrom[2] - this.colorTo[2]) * delta / 100];
|
||||
}
|
||||
else {
|
||||
return [this.ColorColdFrom[0] - (this.ColorColdFrom[0] - this.colorColdTo[0]) * delta / 100,
|
||||
this.ColorColdFrom[1] - (this.ColorColdFrom[1] - this.colorColdTo[1]) * delta / 100,
|
||||
this.ColorColdFrom[2] - (this.ColorColdFrom[2] - this.colorColdTo[2]) * delta / 100];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
get currentStandardColor() {
|
||||
@@ -62,22 +82,27 @@ export default class Resistance extends Vue {
|
||||
|
||||
|
||||
get currentSelectedColor() {
|
||||
//Not linear, but quadratic
|
||||
|
||||
return "0,38,128"
|
||||
/*
|
||||
var x = 1/100 * this.channel.setpointHMI * this.channel.setpointHMI;
|
||||
return [this.selectedColorFrom[0] - (this.selectedColorFrom[0] - this.selectedColorTo[0]) * x / 100,
|
||||
this.selectedColorFrom[1] - (this.selectedColorFrom[1] - this.selectedColorTo[1]) * x / 100,
|
||||
this.selectedColorFrom[2] - (this.selectedColorFrom[2] - this.selectedColorTo[2]) * x / 100];
|
||||
*/
|
||||
}
|
||||
|
||||
get currentSelectedTempColor() {
|
||||
//Not linear, but quadratic
|
||||
if(!this.channel.tCamActive)
|
||||
return "64, 64, 64";
|
||||
|
||||
return "64, 64, 64";
|
||||
else
|
||||
return "0,38,128"
|
||||
/*
|
||||
var x = 1/100 * this.channel.setpointHMI * this.channel.setpointHMI;
|
||||
return [this.selectedColorFrom[0] - (this.selectedColorFrom[0] - this.selectedColorTo[0]) * x / 100,
|
||||
this.selectedColorFrom[1] - (this.selectedColorFrom[1] - this.selectedColorTo[1]) * x / 100,
|
||||
this.selectedColorFrom[2] - (this.selectedColorFrom[2] - this.selectedColorTo[2]) * x / 100];
|
||||
this.selectedColorFrom[2] - (this.selectedColorFrom[2] - this.selectedColorTo[2]) * x / 100];*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
+5
@@ -20,11 +20,16 @@ export default class RiscaldiSuperiori extends Vue {
|
||||
|
||||
beforeMount(){
|
||||
this.uniformChannelValue = -1;
|
||||
|
||||
}
|
||||
|
||||
get selectedChannels(): Warmers.IChannel[] {
|
||||
return store.state.warmers.channels.filter(i => this.selectedChannelIds.indexOf(i.idChannel) >= 0);
|
||||
}
|
||||
|
||||
get thermoCamModeEnabled(): boolean {
|
||||
return store.state.warmers.tCamStatus.thermoCamMode;
|
||||
}
|
||||
|
||||
selectionMethod = "none"
|
||||
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<section>
|
||||
<aside class="scrollable auto" v-if="recipe">
|
||||
<div v-if="thermoCamModeEnabled" class="notEnabled"> </div>
|
||||
<div class="box transparent">
|
||||
<div class="body">
|
||||
<template v-if="recipe.heats_upperheaters_movement_enabled.status.visible">
|
||||
@@ -20,7 +21,6 @@
|
||||
<slider v-model="recipe.heats_upperheaters_max_time"></slider>
|
||||
</template>
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="input-area">
|
||||
<label>{{'warmers_selection' | localize('Selezione')}}</label>
|
||||
</div>
|
||||
@@ -94,6 +94,7 @@
|
||||
</aside>
|
||||
<hr />
|
||||
<article class="warmers">
|
||||
<div v-if="thermoCamModeEnabled" class="notEnabled">{{'heats_alert_thermocamera_enabled'|localize('Thermoprophet Enabled')}}</div>
|
||||
<warmers
|
||||
ref="warmers"
|
||||
@select="selectionChanged"
|
||||
|
||||
+59
-2
@@ -1,6 +1,6 @@
|
||||
import Vue from 'vue';
|
||||
import Component from 'vue-class-component';
|
||||
import { Prop } from 'vue-property-decorator';
|
||||
import { Prop,Watch } from 'vue-property-decorator';
|
||||
import warmers from "./warmers.vue";
|
||||
import { store } from '@/store';
|
||||
import { thermocameraService } from "@/services/thermocameraService";
|
||||
@@ -19,14 +19,71 @@ export default class Thermocamera extends Vue {
|
||||
selectedChannelIds: number[] = [];
|
||||
uniformChannelValue: number = -1;
|
||||
|
||||
|
||||
modeEnabled: Recipe.IValue = {
|
||||
setpointHMI: this.thermocameraMode,
|
||||
range: { min: 0, max: 999999 },
|
||||
status: {
|
||||
enabled: true,
|
||||
hasError: false,
|
||||
visible: true
|
||||
}
|
||||
} as Recipe.IValue;
|
||||
|
||||
OnOffEnabled: Recipe.IValue = {
|
||||
setpointHMI: this.thermocameraOnOff,
|
||||
range: { min: 0, max: 999999 },
|
||||
status: {
|
||||
enabled: true,
|
||||
hasError: false,
|
||||
visible: true
|
||||
}
|
||||
} as Recipe.IValue;
|
||||
|
||||
|
||||
@Watch("modeEnabled", { deep: true })
|
||||
async ChangedMode(n, o) {
|
||||
this.$emit("enabChanged");
|
||||
if(this.modeEnabled.setpointHMI == 1)
|
||||
store.state.warmers.tCamStatus.thermoCamMode = true;
|
||||
else
|
||||
store.state.warmers.tCamStatus.thermoCamMode = false;
|
||||
}
|
||||
|
||||
@Watch("OnOffEnabled", { deep: true })
|
||||
async ChangedOnOff(n, o) {
|
||||
this.$emit("enabChanged");
|
||||
if(this.OnOffEnabled.setpointHMI == 1)
|
||||
store.state.warmers.tCamStatus.thermoCamOnOff = true;
|
||||
else
|
||||
store.state.warmers.tCamStatus.thermoCamOnOff = false;
|
||||
}
|
||||
|
||||
beforeMount(){
|
||||
this.uniformChannelValue = -1;
|
||||
}
|
||||
|
||||
|
||||
get selectedChannels(): Warmers.IChannel[] {
|
||||
return store.state.warmers.channels.filter(i => this.selectedChannelIds.indexOf(i.idChannel) >= 0);
|
||||
}
|
||||
|
||||
get thermocameraMode(): number {
|
||||
if(store.state.warmers.tCamStatus.thermoCamMode)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
}
|
||||
|
||||
get thermocameraOnOff(): number {
|
||||
if(store.state.warmers.tCamStatus.thermoCamOnOff)
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
}
|
||||
|
||||
get thermoCamModeNotEnabled(): boolean {
|
||||
return !store.state.warmers.tCamStatus.thermoCamMode;
|
||||
}
|
||||
selectionMethod = "none"
|
||||
|
||||
changedSelectValue(v){
|
||||
|
||||
+22
-3
@@ -2,9 +2,27 @@
|
||||
<section>
|
||||
<aside class="scrollable auto" v-if="recipe">
|
||||
<div class="box transparent">
|
||||
<div class="body">
|
||||
<div class="divider"></div>
|
||||
|
||||
<div class="body">
|
||||
<div v-if="thermoCamModeNotEnabled" class="notEnabled small"> </div>
|
||||
<template>
|
||||
<div class="input-area">
|
||||
<label>{{'thermocamera_mode'|localize('Thermoprophet Mode')}}</label>
|
||||
<toggle-button
|
||||
v-model="modeEnabled.setpointHMI"
|
||||
:status="modeEnabled.status"
|
||||
></toggle-button>
|
||||
</div>
|
||||
</template>
|
||||
<template>
|
||||
<div class="input-area">
|
||||
<label>{{'thermocamera_on_off'|localize('Thermoprophet Run')}}</label>
|
||||
<toggle-button
|
||||
v-model="OnOffEnabled.setpointHMI"
|
||||
:status="OnOffEnabled.status"
|
||||
></toggle-button>
|
||||
</div>
|
||||
</template>
|
||||
<div class="divider"></div>
|
||||
<div class="input-area">
|
||||
<label>{{'warmers_selection' | localize('Selezione')}}</label>
|
||||
</div>
|
||||
@@ -82,6 +100,7 @@
|
||||
</aside>
|
||||
<hr />
|
||||
<article class="warmers">
|
||||
<div v-if="thermoCamModeNotEnabled" class="notEnabled">{{'heats_alert_thermocamera_not_enabled'|localize('Thermoprophet Not enabled')}}</div>
|
||||
<warmers
|
||||
ref="warmers"
|
||||
@select="selectionChanged"
|
||||
|
||||
+9
-2
@@ -36,11 +36,15 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue {
|
||||
mounted() {
|
||||
if (this.value)
|
||||
this.show = this.value;
|
||||
|
||||
warmersService.GetThermocameraStatus();
|
||||
|
||||
}
|
||||
|
||||
async annulla() {
|
||||
this.isLoading = true;
|
||||
await recipeService.Cancel();
|
||||
await warmersService.GetThermocameraStatus();
|
||||
this.isLoading = false;
|
||||
this.warmersEdited = false;
|
||||
this.tempsEdited = false;
|
||||
@@ -167,11 +171,14 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue {
|
||||
await warmersService.Update(store.state.warmers.channels.reduce((p, c) => { p[c.idChannel] = c.setpointHMI; return p; }, {}));
|
||||
if(this.tempsEdited)
|
||||
await warmersService.UpdateTemp(store.state.warmers.channels.reduce((p, c) => { p[c.idChannel] = c.tCamTempSet; return p; }, {}));
|
||||
if(this.tempEnabledEdited)
|
||||
if(this.tempEnabledEdited){
|
||||
await warmersService.UpdateEnable(store.state.warmers.channels.reduce((p, c) => { p[c.idChannel] = c.tCamActive; return p; }, {}));
|
||||
|
||||
await warmersService.setTCamMode(store.state.warmers.tCamStatus.thermoCamMode);
|
||||
await warmersService.setTCamOn(store.state.warmers.tCamStatus.thermoCamOnOff);
|
||||
}
|
||||
if(this.warmersEdited || this.tempsEdited || this.tempEnabledEdited)
|
||||
await warmersService.Confirm();
|
||||
|
||||
await recipeService.Confirm('Heats');
|
||||
this.isLoading = false;
|
||||
this.warmersEdited = false;
|
||||
|
||||
@@ -8,6 +8,12 @@ export class WarmersService extends baseRestService {
|
||||
|
||||
BASE_URL = async () => (await CONFIGURATION).api.apiServerUrl + "api/warmers/";
|
||||
|
||||
async GetThermocameraStatus() {
|
||||
let result = await this.Get((await this.BASE_URL()) + "TCamData");
|
||||
warmersActions.setTcamStatus(store, result as Warmers.ICamStatus );
|
||||
return result;
|
||||
}
|
||||
|
||||
async GetChannels() {
|
||||
let result = await this.Get((await this.BASE_URL()) + "channels");
|
||||
warmersActions.setChannels(store, result as { [id: number]: Warmers.IChannel });
|
||||
@@ -35,6 +41,15 @@ export class WarmersService extends baseRestService {
|
||||
return result;
|
||||
}
|
||||
|
||||
async setTCamMode(model: boolean) {
|
||||
let result = await this.Put<any>((await this.BASE_URL()) + "setTCamMode?enableTCam="+model, {}, true);
|
||||
return result;
|
||||
}
|
||||
|
||||
async setTCamOn(model: boolean) {
|
||||
let result = await this.Put<any>((await this.BASE_URL()) + "setTCamOn?setTCamOn="+model,{}, true);
|
||||
return result;
|
||||
}
|
||||
|
||||
async Confirm() {
|
||||
let result = await this.Put<any>((await this.BASE_URL()) + "confirm", null, true);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export interface WarmersStoreModel {
|
||||
channels: Warmers.IChannel[];
|
||||
resistances: Warmers.IResistance[];
|
||||
tCamStatus: Warmers.ICamStatus;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +9,13 @@ export interface WarmersActions {
|
||||
reset(context);
|
||||
setChannels(context, model: { [id: number]: Warmers.IChannel });
|
||||
setResistances(context, model: { [id: number]: Warmers.IResistance });
|
||||
setTcamStatus(context, model: Warmers.ICamStatus);
|
||||
}
|
||||
|
||||
export interface WarmersGetters {
|
||||
getChannels: () => Warmers.IChannel[];
|
||||
getResistances: () => Warmers.IResistance[];
|
||||
getTCamStatus: () => Warmers.ICamStatus;
|
||||
}
|
||||
|
||||
export const warmersStore = {
|
||||
@@ -20,11 +23,13 @@ export const warmersStore = {
|
||||
state: {
|
||||
channels: [],
|
||||
resistances: [],
|
||||
tCamStatus: {},
|
||||
} as WarmersStoreModel,
|
||||
|
||||
getters: {
|
||||
getChannels: (state) => (): Warmers.IChannel[] => (state as WarmersStoreModel).channels,
|
||||
getResistances: (state) => (): Warmers.IResistance[] => (state as WarmersStoreModel).resistances,
|
||||
getTcamStatus: (state) => (): Warmers.ICamStatus => (state as WarmersStoreModel).tCamStatus,
|
||||
},
|
||||
|
||||
mutations: {
|
||||
@@ -62,6 +67,10 @@ export const warmersStore = {
|
||||
}
|
||||
},
|
||||
|
||||
setTcamStatus(state, model: Warmers.ICamStatus){
|
||||
state.tCamStatus = model;
|
||||
}
|
||||
|
||||
},
|
||||
actions: {
|
||||
reset(context) {
|
||||
@@ -73,7 +82,9 @@ export const warmersStore = {
|
||||
setResistances(context, model: { [id: number]: Warmers.IResistance }) {
|
||||
context.commit("SetResistances", model);
|
||||
},
|
||||
|
||||
setTcamStatus(context, model: Warmers.ICamStatus) {
|
||||
context.commit("setTcamStatus", model);
|
||||
}
|
||||
} as WarmersActions
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user