Merge commit '78e7af66e23a53306157b708ce994240a752da00' into new/ThermoCamManager

This commit is contained in:
Samuele E. Locatelli
2021-02-19 19:11:32 +01:00
12 changed files with 132 additions and 54 deletions
@@ -15,6 +15,10 @@
stroke: 1px solid blue;
}
.thermoImage {
pointer-events: none;
}
.resistance {
width: calc(100% - 4px);
height: calc(100% - 4px);
@@ -4799,6 +4799,9 @@ article .box .body {
fill: none;
stroke: 1px solid blue;
}
.warmers svg .thermoImage {
pointer-events: none;
}
.warmers svg .resistance {
width: calc(100% - 4px);
height: calc(100% - 4px);
+1
View File
@@ -31,6 +31,7 @@
<button class="gray square close" @click="sendMessage('close')">&times;</button>
</div>
<modal-container name="modal" :class="{'blur':applyBlurNc}"></modal-container>
<modal-container name="modal2" :class="{'blur':applyBlurNc}"></modal-container>
<modal-nc-container name="modal-nc"></modal-nc-container>
</div>
</template>
@@ -39,7 +39,11 @@ export default class Resistance extends Vue {
@Prop({ default: 0 })
mode: number;
@Prop({ default: false })
isThermoProphet: boolean;
click() {
console.log('click')
if (this.editable)
this.$emit('click');
}
@@ -90,21 +94,24 @@ export default class Resistance extends Vue {
}
get currentColor() {
if (this.selected) return this.currentSelectedColor;
return this.currentStandardColor;
}
get currentColorTemp() {
if (this.selected) return this.currentSelectedTempColor;
return this.currentStandardTempColor;
if(!this.isThermoProphet)
{
if (this.selected) return this.currentSelectedColor;
return this.currentStandardColor;
}
else
{
if (this.selected) return this.currentSelectedTempColor;
return this.currentStandardTempColor;
}
}
getBoard(id) {
return Math.floor((id - 1) / 16);
return Math.floor((id - 1) / 16) + 1;
}
getOutput(id) {
return Math.floor((id - 1) % 16);
return Math.floor((id - 1) % 16) + 1;
}
get currentSelectedColor() {
@@ -15,6 +15,14 @@
v-on:touchend="click"
:style="{backgroundColor:`rgb(${currentColor})`}"
>{{channel.tCamTempSet}}&nbsp;°C</div>
<div
class="resistance"
:key="selected"
v-else-if="mode == 4"
@click="click"
v-on:touchend="click"
:style="{backgroundColor:`rgb(${currentColor})`}"
>{{channel.actualCurrent}}&nbsp;W</div>
<div
class="resistance id"
:class="{'disabled':!editable}"
@@ -22,7 +30,7 @@
@click="click"
v-on:touchend="click"
v-else
:style="{backgroundColor:`rgb(${currentColorTemp})`}"
:style="{backgroundColor:`rgb(${currentColor})`}"
>
<span>ID: {{getOutput(channel.idChannel)}}</span>
<small>Bo: {{getBoard(channel.idChannel)}}</small>
@@ -17,8 +17,9 @@ export default class RiscaldiInferiori extends Vue {
selectedChannelIds: number[] = [];
uniformChannelValue = 0;
resistanceMode = 1;
beforeMount(){
beforeMount() {
this.uniformChannelValue = -1;
}
@@ -28,8 +29,8 @@ export default class RiscaldiInferiori extends Vue {
selectionMethod = "none";
changedSelectValue(v){
if(this.uniformChannelValue>=0)
changedSelectValue(v) {
if (this.uniformChannelValue >= 0)
for (const c of this.selectedChannels) c.setpointHMI = this.uniformChannelValue;
this.$emit("warmersChanged");
}
@@ -45,7 +46,7 @@ export default class RiscaldiInferiori extends Vue {
(this.$refs.warmers as any).zoomReset();
}
autocomposite(){
autocomposite() {
(this.$refs.warmers as any).automate();
this.$emit("warmersChanged");
}
@@ -56,7 +57,7 @@ export default class RiscaldiInferiori extends Vue {
}
remove5() {
for (const c of this.selectedChannels) c.setpointHMI = Math.min(Math.max(parseFloat(c.setpointHMI.toString()) - 5, 0), 100);
for (const c of this.selectedChannels) c.setpointHMI = Math.min(Math.max(parseFloat(c.setpointHMI.toString()) - 5, 0), 100);
this.$emit("warmersChanged");
}
@@ -98,20 +98,39 @@
<warmers
ref="warmers"
:recipe="recipe"
:resistanceMode="resistanceMode"
:id-reflector="1"
@select="selectionChanged"
@methodChanged="m => selectionMethod = m"
:isThermoProphet="false"
></warmers>
<div class="absolute bottom right">
<button class="btn btn-info square icon" @click="zoomIn()">
<i class="fa fa-search-plus" ></i>
</button>
<button class="btn btn-info square icon" @click="zoomOut()">
<i class="fa fa-search-minus" ></i>
</button>
<button class="btn btn-info square icon" @click="zoomReset()">
<i class="fa fa-square-o" ></i>
</button>
<div class="right-controls">
<div class="um-buttons">
<button
@click="resistanceMode=1"
:class="{selected: resistanceMode ==1}"
>%</button>
<button
@click="resistanceMode=4"
:class="{selected: resistanceMode ==4}"
>W</button>
<button
@click="resistanceMode=2"
:class="{selected: resistanceMode ==2}"
>ID</button>
</div>
<div class="buttons">
<button class="btn btn-info square icon" @click="zoomIn()">
<i class="fa fa-search-plus"></i>
</button>
<button class="btn btn-info square icon" @click="zoomReset()">
<i class="fa fa-square-o"></i>
</button>
<button class="btn btn-info square icon" @click="zoomOut()">
<i class="fa fa-search-minus"></i>
</button>
</div>
</div>
</article>
</section>
@@ -16,8 +16,9 @@ export default class RiscaldiSuperiori extends Vue {
selectedChannelIds: number[] = [];
uniformChannelValue: number = -1;
resistanceMode = 1;
beforeMount(){
beforeMount() {
this.uniformChannelValue = -1;
}
@@ -25,20 +26,20 @@ export default class RiscaldiSuperiori extends Vue {
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"
changedSelectValue(v){
if(this.uniformChannelValue>=0)
changedSelectValue(v) {
if (this.uniformChannelValue >= 0)
for (const c of this.selectedChannels) c.setpointHMI = this.uniformChannelValue;
this.$emit("warmersChanged");
}
zoomIn() {
(this.$refs.warmers as any).zoomIn();
}
@@ -50,7 +51,7 @@ export default class RiscaldiSuperiori extends Vue {
(this.$refs.warmers as any).zoomReset();
}
autocomposite(){
autocomposite() {
(this.$refs.warmers as any).automate();
this.$emit("warmersChanged");
}
@@ -1,7 +1,7 @@
<template>
<section>
<aside class="scrollable auto" v-if="recipe">
<div v-if="thermoCamModeEnabled" class="notEnabled">&nbsp;</div>
<div v-if="thermoCamModeEnabled" class="notEnabled">&nbsp;</div>
<div class="box transparent">
<div class="body">
<template v-if="recipe.heats_upperheaters_movement_enabled.status.visible">
@@ -94,24 +94,46 @@
</aside>
<hr />
<article class="warmers">
<div v-if="thermoCamModeEnabled" class="notEnabled">{{'heats_alert_thermocamera_enabled'|localize('Thermoprophet Enabled')}}</div>
<div
v-if="thermoCamModeEnabled"
class="notEnabled"
>{{'heats_alert_thermocamera_enabled'|localize('Thermoprophet Enabled')}}</div>
<warmers
ref="warmers"
:resistanceMode="resistanceMode"
@select="selectionChanged"
@methodChanged="m => selectionMethod = m"
:recipe="recipe"
:isThermoProphet="false"
></warmers>
<div class="absolute bottom right">
<button class="btn btn-info square icon" @click="zoomIn()">
<i class="fa fa-search-plus" ></i>
</button>
<button class="btn btn-info square icon" @click="zoomOut()">
<i class="fa fa-search-minus" ></i>
</button>
<button class="btn btn-info square icon" @click="zoomReset()">
<i class="fa fa-square-o" ></i>
</button>
<div class="right-controls">
<div class="um-buttons">
<button
@click="resistanceMode=1"
:class="{selected: resistanceMode ==1}"
>%</button>
<button
@click="resistanceMode=4"
:class="{selected: resistanceMode ==4}"
>W</button>
<button
@click="resistanceMode=2"
:class="{selected: resistanceMode ==2}"
>ID</button>
</div>
<div class="buttons">
<button class="btn btn-info square icon" @click="zoomIn()">
<i class="fa fa-search-plus"></i>
</button>
<button class="btn btn-info square icon" @click="zoomReset()">
<i class="fa fa-square-o"></i>
</button>
<button class="btn btn-info square icon" @click="zoomOut()">
<i class="fa fa-search-minus"></i>
</button>
</div>
</div>
</article>
</section>
@@ -3,7 +3,7 @@
<aside class="scrollable auto" v-if="recipe">
<div class="box transparent">
<div class="body">
<div v-if="thermoCamModeNotEnabled" class="notEnabled small">&nbsp;</div>
<!-- <div v-if="thermoCamModeNotEnabled" class="notEnabled small">&nbsp;</div> -->
<div class="input-area">
<label>{{'tem_fix' | localize('Fix temperatures')}}</label>
@@ -101,10 +101,10 @@
</aside>
<hr />
<article class="warmers">
<div
<!-- <div
v-if="thermoCamModeNotEnabled"
class="notEnabled"
>{{'heats_alert_thermocamera_not_enabled'|localize('Thermoprophet Not enabled')}}</div>
>{{'heats_alert_thermocamera_not_enabled'|localize('Thermoprophet Not enabled')}}</div>-->
<warmers
ref="warmers"
@select="selectionChanged"
@@ -114,6 +114,7 @@
thermoImage="/thermoprophet/colored/_last.jpg"
:thermoImageVisible="thermocameraModeBTN"
:thermoImageOpacity="thermoImageOpacity"
:isThermoProphet="true"
></warmers>
<div class="right-controls">
@@ -121,15 +122,15 @@
<button
@click="resistanceMode=0"
:class="{selected: resistanceMode ==0}"
>{{'um-c' | localize('°C')}}</button>
>°C</button>
<button
@click="resistanceMode=1"
:class="{selected: resistanceMode ==1}"
>{{'um-perc' | localize('%%')}}</button>
>%</button>
<button
@click="resistanceMode=2"
:class="{selected: resistanceMode ==2}"
>{{'um-id' | localize('ID')}}</button>
>ID</button>
</div>
<div class="tm-controls">
@@ -35,6 +35,9 @@ export default class Warmers extends Vue {
@Prop({ default: null })
thermoImage: string;
@Prop({ default: false })
isThermoProphet: boolean;
@Prop({ default: false })
thermoImageVisible: boolean
@@ -242,7 +245,8 @@ export default class Warmers extends Vue {
}
isdisabled(id) {
if (this.resistanceMode != 0) return false;
// x NICOLA: io non ho capito se la selezione deve essere disattivata con il prophet acceso oppure no.
if (!this.isThermoProphet) return false;
let channel = this.channels.find(c => c.idChannel == id);
return channel.setpointHMI == 0;
}
@@ -20,6 +20,7 @@
:rx="4"
>
<resistance
:isThermoProphet="isThermoProphet"
:mode="resistanceMode"
:res="cell"
:channel="getChannel(cell.idChannel)"
@@ -46,9 +47,7 @@
fill="rgba(0,0,0,0.1)"
/>
</g>
<g v-if="thermoImage && thermoImageVisible && thermoImageOpacity">
<image :href="thermoImage" :height="rows.length * height" :opacity="thermoImageOpacity" />
</g>
<g v-if="selectionMethod == 'rect' && selectionPoints.length>1">
<rect
ref="lazo"
@@ -70,7 +69,15 @@
:d="`M ${selectionPoints[0].x} ${selectionPoints[0].y} L ${selectionPoints.slice(1).map(i => [i.x,i.y]).join(' ')} Z`"
/>
</g>
<g v-if="thermoImage && thermoImageVisible && thermoImageOpacity">
<image
:href="thermoImage"
:height="rows.length * height"
:opacity="thermoImageOpacity"
class="thermoImage"
/>
</g>
</g>
</svg>
</template>
<script src="./warmers.ts" lang="ts"></script>
<script src="./warmers.ts" lang="ts"></script>