Merge remote-tracking branch 'origin/develop' into feature/prodMgmt

This commit is contained in:
Samuele Locatelli
2020-09-08 09:49:07 +02:00
19 changed files with 109 additions and 61 deletions
@@ -2,7 +2,7 @@
"env": "development",
"api": {
"enabled": true,
"apiServerUrl": "http://localhost:9000/"
"apiServerUrl": "http://seriate.steamware.net:9000/"
},
"allUIVisible": true
}
+1 -1
View File
@@ -13,7 +13,7 @@
<script src="Scripts/jquery.mousewheel.js"></script>
<script src="Scripts/jquery.signalR-2.2.2.min.js"></script>
<script src="Scripts/raphael-2.1.4.min.js"></script>
<script src="http://localhost:9000/signalr/hubs" async></script>
<script src="http://seriate.steamware.net:9000/signalr/hubs" async></script>
<link href="assets/styles/style.css" rel="stylesheet" />
</head>
@@ -1,6 +1,10 @@
<template>
<div class="combo">
<div class="form" @click="showList" :class="{'error': value.status && value.status.hasError}">
<div
class="form"
@click="showList"
:class="{'error': value && value.status && value.status.hasError}"
>
{{currentValue}}
<i v-if="opened" class="fa fa-chevron-up" />
<i v-else class="fa fa-chevron-down" />
@@ -18,29 +18,39 @@ export default class Keyboard extends Vue {
@Prop()
value: string;
get Value() {
return this.actualValue.setpointHMI;
}
set Value(v: number) {
let scale = Math.pow(10, this.actualValue.numDec);
this.actualValue.setpointHMI = Math.round(v * scale) / scale;
}
del() {
this.actualValue.setpointHMI = 0;
this.Value = 0;
}
canc() {
let temp = String(this.actualValue.setpointHMI);
this.actualValue.setpointHMI = Number(temp.slice(0, -1))
let temp = String(this.Value);
this.Value = Number(temp.slice(0, -1))
}
add(num: string) {
if (this.point) {
this.point += num;
this.actualValue.setpointHMI = Number(this.point)
this.Value = Number(this.point)
} else {
let temp = String(this.actualValue.setpointHMI);
let temp = String(this.Value);
temp += num;
this.actualValue.setpointHMI = Number(temp)
this.Value = Number(temp)
}
}
addpoint() {
if (!this.point) {
this.point = String(this.actualValue.setpointHMI);
this.point = String(this.Value);
this.point += ".";
}
}
@@ -29,6 +29,15 @@ export default class Numeric extends Vue {
focused: boolean = false;
get Value() {
return this.value.setpointHMI;
}
set Value(v: number) {
let scale = Math.pow(10, this.value.numDec);
this.value.setpointHMI = Math.round(v * scale) / scale;
}
onFocus() {
if (this.value && this.value.status && !this.value.status.enabled) return;
let rect = this.$el.getBoundingClientRect();
@@ -6,7 +6,7 @@
<input
type="number"
ref="input"
v-model.number="value.setpointHMI"
v-model.number="Value"
@focus="onFocus"
@blur="onBlur"
:id="id"
@@ -55,7 +55,7 @@ export default class Dashboard extends Vue {
}
get remainingTime() {
return this.endEstimation.diff(this.now);
return Math.max(this.endEstimation.diff(this.now), 0);
}
get currentUser() {
@@ -96,7 +96,6 @@ export default class Dashboard extends Vue {
}
public get ribbonStatus(): ribbonStatusEnum {
// Controllo se ci sono allarmi
let s = this.$store.state as AppModel;
@@ -104,7 +103,6 @@ export default class Dashboard extends Vue {
if (s.alarms.warnings.length > 0) return ribbonStatusEnum.Warning;
if (s.process.running) return ribbonStatusEnum.Working;
return ribbonStatusEnum.Idle;
}
public get alarmTitle() {
@@ -121,7 +119,6 @@ export default class Dashboard extends Vue {
default:
return "";
}
}
public get alarmCount() {
@@ -4,7 +4,7 @@
<div class="borded_label" id="quota1" v-focus-on:general_sizes_upperplate_max_height>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_upperplate_max_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_upperplate_max_height.valueAct}}</span>
<small>{{recipe.general_sizes_upperplate_max_height.unitMeasure}}</small>
</div>
</div>
@@ -4,14 +4,14 @@
<div class="borded_label" id="quota1" v-focus-on:general_sizes_frame_dim_y>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_frame_dim_y.setpointHMI}}</span>
<span>{{recipe.general_sizes_frame_dim_y.valueAct}}</span>
<small>{{recipe.general_sizes_frame_dim_y.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota2" v-focus-on:general_sizes_frame_dim_x>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_frame_dim_x.setpointHMI}}</span>
<span>{{recipe.general_sizes_frame_dim_x.valueAct}}</span>
<small>{{recipe.general_sizes_frame_dim_x.unitMeasure}}</small>
</div>
</div>
@@ -4,21 +4,21 @@
<div class="borded_label" id="quota1" v-focus-on:general_sizes_sheet_dim_x>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_sheet_dim_x.setpointHMI}}</span>
<span>{{recipe.general_sizes_sheet_dim_x.valueAct}}</span>
<small>{{recipe.general_sizes_sheet_dim_x.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota2" v-focus-on:general_sizes_sheet_dim_y>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_sheet_dim_y.setpointHMI}}</span>
<span>{{recipe.general_sizes_sheet_dim_y.valueAct}}</span>
<small>{{recipe.general_sizes_sheet_dim_y.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota3" v-focus-on:general_sizes_sheet_thickness>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_sheet_thickness.setpointHMI}}</span>
<span>{{recipe.general_sizes_sheet_thickness.valueAct}}</span>
<small>{{recipe.general_sizes_sheet_thickness.unitMeasure}}</small>
</div>
</div>
@@ -4,14 +4,14 @@
<div class="borded_label" id="quota1" v-focus-on:general_sizes_plate_dim_y>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_plate_dim_y.setpointHMI}}</span>
<span>{{recipe.general_sizes_plate_dim_y.valueAct}}</span>
<small>{{recipe.general_sizes_plate_dim_y.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota2" v-focus-on:general_sizes_plate_dim_x>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_plate_dim_x.setpointHMI}}</span>
<span>{{recipe.general_sizes_plate_dim_x.valueAct}}</span>
<small>{{recipe.general_sizes_plate_dim_x.unitMeasure}}</small>
</div>
</div>
@@ -4,35 +4,35 @@
<div class="borded_label" id="quota1" v-focus-on:general_sizes_mould_dim_x>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_dim_x.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_dim_x.valueAct}}</span>
<small>{{recipe.general_sizes_mould_dim_x.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota2" v-focus-on:general_sizes_mould_dim_y>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_dim_y.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_dim_y.valueAct}}</span>
<small>{{recipe.general_sizes_mould_dim_y.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota3" v-focus-on:general_sizes_mould_max_height>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_max_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_max_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_max_height.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota4" v-focus-on:general_sizes_mould_base_height>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_base_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_base_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_base_height.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota5" v-focus-on:general_sizes_mould_min_height>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_min_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_min_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_min_height.unitMeasure}}</small>
</div>
</div>
@@ -4,24 +4,24 @@
<div class="borded_label" id="quota1">
<div v-focus-on:positions_frame_intermediate_position>
<img src="assets/icons/png/salita.png" />
<span>{{recipe.positions_frame_intermediate_position.setpointHMI}}</span>
<span>{{recipe.positions_frame_intermediate_position.valueAct}}</span>
<small>{{recipe.positions_frame_intermediate_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_frame_intermediate_speed>
<img src="assets/icons/png/bassa.png" />
<span>{{recipe.positions_frame_intermediate_speed.setpointHMI}}</span>
<span>{{recipe.positions_frame_intermediate_speed.valueAct}}</span>
<small>{{recipe.positions_frame_intermediate_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota5">
<div v-focus-on:positions_frame_lower_position>
<img src="assets/icons/png/discesa.png" />
<span>{{recipe.positions_frame_lower_position.setpointHMI}}</span>
<span>{{recipe.positions_frame_lower_position.valueAct}}</span>
<small>{{recipe.positions_frame_lower_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_frame_lower_speed>
<img src="assets/icons/png/alta.png" />
<span>{{recipe.positions_frame_lower_speed.setpointHMI}}</span>
<span>{{recipe.positions_frame_lower_speed.valueAct}}</span>
<small>{{recipe.positions_frame_lower_speed.unitMeasure}}</small>
</div>
</div>
@@ -4,7 +4,7 @@
<div class="borded_label" id="quota1" v-focus-on:positions_mould_intermediate_position>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.positions_mould_intermediate_position.setpointHMI}}</span>
<span>{{recipe.positions_mould_intermediate_position.valueAct}}</span>
<small>{{recipe.positions_mould_intermediate_position.unitMeasure}}</small>
</div>
</div>
@@ -18,21 +18,21 @@
<div class="borded_label" id="quota3" v-focus-on>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_min_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_min_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_min_height.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota4" v-focus-on>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_base_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_base_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_base_height.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota5" v-focus-on>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_max_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_max_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_max_height.unitMeasure}}</small>
</div>
</div>
@@ -40,48 +40,48 @@
<div class="borded_label" id="quota6">
<div v-focus-on:positions_mould_upperdeceleration_position>
<img src="assets/icons/png/salita.png" />
<span>{{recipe.positions_mould_upperdeceleration_position.setpointHMI}}</span>
<span>{{recipe.positions_mould_upperdeceleration_position.valueAct}}</span>
<small>{{recipe.positions_mould_upperdeceleration_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_mould_upperdeceleration_speed>
<img src="assets/icons/png/bassa.png" />
<span>{{recipe.positions_mould_upperdeceleration_speed.setpointHMI}}</span>
<span>{{recipe.positions_mould_upperdeceleration_speed.valueAct}}</span>
<small>{{recipe.positions_mould_upperdeceleration_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota7">
<div v-focus-on:positions_mould_upper_position>
<img src="assets/icons/png/salita.png" />
<span>{{recipe.positions_mould_upper_position.setpointHMI}}</span>
<span>{{recipe.positions_mould_upper_position.valueAct}}</span>
<small>{{recipe.positions_mould_upper_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_mould_upper_speed>
<img src="assets/icons/png/alta.png" />
<span>{{recipe.positions_mould_upper_speed.setpointHMI}}</span>
<span>{{recipe.positions_mould_upper_speed.valueAct}}</span>
<small>{{recipe.positions_mould_upper_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota8">
<div v-focus-on:positions_mould_lowerdeceleration_position>
<img src="assets/icons/png/discesa.png" />
<span>{{recipe.positions_mould_lowerdeceleration_position.setpointHMI}}</span>
<span>{{recipe.positions_mould_lowerdeceleration_position.valueAct}}</span>
<small>{{recipe.positions_mould_lowerdeceleration_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_mould_lowerdeceleration_speed>
<img src="assets/icons/png/bassa.png" />
<span>{{recipe.positions_mould_lowerdeceleration_speed.setpointHMI}}</span>
<span>{{recipe.positions_mould_lowerdeceleration_speed.valueAct}}</span>
<small>{{recipe.positions_mould_lowerdeceleration_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota9">
<div v-focus-on:positions_mould_lower_position>
<img src="assets/icons/png/discesa.png" />
<span>{{recipe.positions_mould_lower_position.setpointHMI}}</span>
<span>{{recipe.positions_mould_lower_position.valueAct}}</span>
<small>{{recipe.positions_mould_lower_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_mould_lower_speed>
<img src="assets/icons/png/alta.png" />
<span>{{recipe.positions_mould_lower_speed.setpointHMI}}</span>
<span>{{recipe.positions_mould_lower_speed.valueAct}}</span>
<small>{{recipe.positions_mould_lower_speed.unitMeasure}}</small>
</div>
</div>
@@ -4,55 +4,55 @@ e<template>
<div class="borded_label" id="quota3">
<div v-focus-on:positions_upperplate_lower_position>
<img src="assets/icons/png/discesa.png" />
<span>{{recipe.positions_upperplate_lower_position.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_lower_position.valueAct}}</span>
<small>{{recipe.positions_upperplate_lower_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_upperplate_lower_speed>
<img src="assets/icons/png/alta.png" />
<span>{{recipe.positions_upperplate_lower_speed.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_lower_speed.valueAct}}</span>
<small>{{recipe.positions_upperplate_lower_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota4">
<div v-focus-on:positions_upperplate_lowerdeceleration_position>
<img src="assets/icons/png/discesa.png" />
<span>{{recipe.positions_upperplate_lowerdeceleration_position.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_lowerdeceleration_position.valueAct}}</span>
<small>{{recipe.positions_upperplate_lowerdeceleration_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_upperplate_lowerdeceleration_speed>
<img src="assets/icons/png/bassa.png" />
<span>{{recipe.positions_upperplate_lowerdeceleration_speed.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_lowerdeceleration_speed.valueAct}}</span>
<small>{{recipe.positions_upperplate_lowerdeceleration_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota1">
<div v-focus-on:positions_upperplate_upper_position>
<img src="assets/icons/png/salita.png" />
<span>{{recipe.positions_upperplate_upper_position.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_upper_position.valueAct}}</span>
<small>{{recipe.positions_upperplate_upper_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_upperplate_upper_speed>
<img src="assets/icons/png/alta.png" />
<span>{{recipe.positions_upperplate_upper_speed.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_upper_speed.valueAct}}</span>
<small>{{recipe.positions_upperplate_upper_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota2">
<div v-focus-on:positions_upperplate_upperdeceleration_position>
<img src="assets/icons/png/salita.png" />
<span>{{recipe.positions_upperplate_upperdeceleration_position.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_upperdeceleration_position.valueAct}}</span>
<small>{{recipe.positions_upperplate_upperdeceleration_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_upperplate_upperdeceleration_speed>
<img src="assets/icons/png/bassa.png" />
<span>{{recipe.positions_upperplate_upperdeceleration_speed.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_upperdeceleration_speed.valueAct}}</span>
<small>{{recipe.positions_upperplate_upperdeceleration_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota5">
<div v-focus-on:general_sizes_upperplate_max_height>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_upperplate_max_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_upperplate_max_height.valueAct}}</span>
<small>{{recipe.general_sizes_upperplate_max_height.unitMeasure}}</small>
</div>
</div>
@@ -55,15 +55,15 @@ export default class AppFooter extends Vue {
}
public getUtilities(): Array<Object> {
// if (typeof cmsClient != "undefined")
// return JSON.parse(cmsClient.getConfiguredProcessesInMainMenu());
// else
return new Array<Object>();
if (typeof cmsClient != "undefined")
return JSON.parse(cmsClient.getConfiguredProcessesInMainMenu());
else
return new Array<Object>();
}
public startUtility(id: any) {
// if (typeof cmsClient != "undefined")
// cmsClient.openOrStartProcess(id);
if (typeof cmsClient != "undefined")
cmsClient.openOrStartProcess(id);
}
showDashboard() {
@@ -66,6 +66,23 @@
class="oval clock"
:class="{ big:isInPath('clock') && !state.isMainViewLiftedUp}"
></button>
<div v-if="isAreaVisible('utilities') && getUtilities().length > 0" class="divider">
<i class="fa fa-circle"></i>
</div>
<template v-for="software in getUtilities()">
<button
@click="startUtility(software.id)"
:title="software.longName"
:key="software.id"
:disabled="!isAreaEnabled('utilities')"
v-if="isAreaVisible('utilities')"
class="oval externUtility"
>
<img v-if="software.iconBase64 && software.iconBase64!=''" :src="software.iconBase64" />
<div v-if="!software.iconBase64 || software.iconBase64==''">{{software.shortName}}</div>
</button>
</template>
</div>
<div class="machine-area">
@@ -60,6 +60,7 @@ export class RecipeService extends baseRestService {
}
async Cancel() {
recipeActions.reset(store);
let result = await this.Put<any>((await this.BASE_URL()) + "cancel", null, true);
return result;
}
@@ -8,6 +8,7 @@ export interface RecipeStoreModel {
export interface RecipeActions {
reset(context);
setCurrent(context, model: Recipe.IRecipe, avoidSetpointHMI: boolean);
setOverview(context, model: Overview.IOverview);
}
@@ -35,6 +36,7 @@ export const recipeStore = {
upperPlate: "",
vacuum: ""
},
canUpdateRecipe: true,
_map: new Map<number, Recipe.IValue>()
} as RecipeStoreModel,
@@ -45,7 +47,13 @@ export const recipeStore = {
},
mutations: {
Reset(state) {
for (const key in state.current)
if (state.current.hasOwnProperty(key)) {
let m = state.current[key] as Recipe.IValue;
m.setpointHMI = m.setpointPLC;
}
},
SetCurrent(state, model: { avoidSetpoint: boolean, recipe: Recipe.IRecipe }) {
for (const key in model.recipe) {
if (model.recipe.hasOwnProperty(key)) {
@@ -86,7 +94,9 @@ export const recipeStore = {
},
actions: {
reset(context) {
context.commit("Reset")
},
async setCurrent(context, model: Recipe.IRecipe, avoidSetpointHMI: boolean = false) {
context.commit("SetCurrent", { avoidSetpoint: avoidSetpointHMI, recipe: model });