Compare commits

...

109 Commits

Author SHA1 Message Date
Samuele Locatelli edfb4c4423 Merge branch 'develop' into feature/add/testing-signalr 2020-05-29 12:20:48 +02:00
Samuele Locatelli 9294cecc15 COmpletata webApi scrittura parametri ricetta 2020-05-29 12:20:34 +02:00
Samuele Locatelli 14ed50b58d WebApi method 4 params update 2020-05-29 11:42:47 +02:00
Samuele Locatelli 3d6e711bf0 Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-05-28 18:51:00 +02:00
Samuele Locatelli 79bf736201 commented signal-r method to review... 2020-05-28 18:36:36 +02:00
Samuele Locatelli 3a39f20b5a Metodo scrittura ricetta da testare 2020-05-28 18:06:51 +02:00
Samuele Locatelli fa77cc11cb Update Adapter 2020-05-28 17:49:25 +02:00
Samuele Locatelli 1a120db9e3 Update conf recipeParams 2020-05-28 17:36:09 +02:00
= d3f6dc4a77 Merge remote-tracking branch 'CMS/develop' into develop 2020-05-28 14:16:31 +02:00
= e216f9597d Merge remote-tracking branch 'CMS/develop' into develop 2020-05-28 14:16:14 +02:00
= d06f36edbe fix signalr hub connection url 2020-05-28 14:15:58 +02:00
Samuele Locatelli b732e1514d typo 2020-05-27 10:31:43 +02:00
Samuele E. Locatelli 2e84a57cfb Added pause after thread start on init (it RUNS!) 2020-05-26 19:16:51 +02:00
Samuele Locatelli 100c030844 Merge branch 'feature/add/recipeModel' into develop 2020-05-26 13:04:21 +02:00
Samuele Locatelli c020a5588b Update vers number 2020-05-26 13:04:10 +02:00
Samuele Locatelli 1532898329 Fix client/server for Signal-r, test OK! 2020-05-26 13:01:37 +02:00
Samuele Locatelli d367532d11 Merge branch 'feature/add/recipeModel' into develop 2020-05-22 18:25:11 +02:00
Samuele Locatelli 302456b21b Vari update x testing client/server 2020-05-22 18:23:25 +02:00
Samuele Locatelli bc0a33cf7f refresh methods signal-r & dobug S7Net 2020-05-19 20:12:34 +02:00
Samuele Locatelli dcb65ad4f3 fix x test locale UI 2020-05-19 20:06:15 +02:00
Samuele Locatelli 117a6288bb Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_thermo_active into develop 2020-05-19 16:27:21 +02:00
Samuele Locatelli 95484c7ee7 Update metodi preliminari signal-r 2020-05-19 16:23:10 +02:00
= 4db37d663f fix caricamento signalr 2020-05-19 15:19:08 +02:00
= bbfe28edc7 log delle chiamate signalr 2020-05-19 15:13:57 +02:00
= 180334822b Merge remote-tracking branch 'teamdev/develop' into develop 2020-05-19 15:04:58 +02:00
Samuele Locatelli 63b09c1dfb OK con S7 il thermo NC!!! 2020-05-19 08:55:40 +02:00
Samuele Locatelli ea32e6b506 Debug on NC continues 2020-05-18 17:54:56 +02:00
Samuele Locatelli e65ba32e09 Start integration for S7Net NC 2020-05-18 17:25:56 +02:00
Samuele Locatelli 426eaeea95 Start update for signal-r THERMO management 2020-05-15 18:38:49 +02:00
Alessio 026a85e5ff Merge branch 'newfeature/processo' into develop 2020-05-07 12:22:32 +02:00
Alessio 85a387cc86 fix merge 2020-05-07 12:22:12 +02:00
Alessio dfcaac23ba Merge branch 'newfeature/paddle' into newfeature/processo 2020-05-07 12:08:08 +02:00
francesco.guerrieri 9c1928c7ae fix button modal and binding for modal options 2020-05-07 11:55:31 +02:00
Alessio 506c14f82a Merge branch 'newfeature/programmazione-preriscaldo' into newfeature/processo 2020-05-07 10:59:09 +02:00
Alessio 10835c555e fix footer buttons 2020-05-07 10:58:56 +02:00
Damiano c1adb138e7 Fix binding 2020-05-07 10:52:21 +02:00
Damiano f06dac3a7b Auto stash before merge of "newfeature/programmazione-preriscaldo" and "origin/newfeature/programmazione-preriscaldo" 2020-05-07 09:37:13 +02:00
Alessio 6545727c2f fix binding and footer buttons 2020-05-07 09:20:29 +02:00
francesco.guerrieri cf240405a5 fix binding for options and vacuum modal 2020-05-06 17:14:52 +02:00
Alessio e377d7ece7 fix prop 2020-05-06 15:36:54 +02:00
Alessio 70011ed571 Merge branch 'newfeature/programmazione-preriscaldo' into newfeature/processo 2020-05-06 15:29:21 +02:00
Alessio e4d3c5559a fix binding 2020-05-06 15:23:42 +02:00
Alessio 7232f63094 Auto stash before merge of "newfeature/programmazione-preriscaldo" and "origin/newfeature/programmazione-preriscaldo" 2020-05-06 15:01:42 +02:00
Damiano 581dade86d add "mock-variables in formato" 2020-05-06 14:57:53 +02:00
Alessio 84033194a6 fix binding quote e velocita 2020-05-06 14:17:59 +02:00
Alessio 0cb7833480 Merge remote-tracking branch 'origin/newfeature/programmazione-preriscaldo' into newfeature/programmazione-preriscaldo 2020-05-06 11:27:35 +02:00
Alessio d9c892cb11 fix binding quote e velocita 2020-05-06 11:27:27 +02:00
Damiano f08b33ebf6 fix "General binding" 2020-05-06 11:23:56 +02:00
Alessio bdbc136638 fix Prop modale ciclo 2020-05-06 10:23:26 +02:00
Alessio 2d4ae4c0cc fix binding modale Ciclo 2020-05-06 10:12:43 +02:00
Alessio 60e8f3da34 add computed for opzioni modal 2020-05-05 16:15:01 +02:00
Damiano a1aed17621 binding "General and Cycle" 2020-05-05 15:34:30 +02:00
francesco.guerrieri add63366a3 recipe cooling, vacuum, extraction, options 2020-05-05 15:15:13 +02:00
Alessio 4f9d26c536 fix paddle 2020-05-05 11:42:03 +02:00
Alessio bfd963f8d7 fix paddle 2020-05-04 16:18:33 +02:00
Alessio 16bda5b2a9 format and binding of the data 2020-05-04 14:28:21 +02:00
francesco.guerrieri c32f50070e Auto stash before merge of "newfeature/paddle" and "origin/develop" 2020-05-04 11:35:13 +02:00
francesco.guerrieri 0c03082ff8 Merge remote-tracking branch 'origin/develop' into newfeature/paddle 2020-05-04 11:34:31 +02:00
Alessio 11928ef3bf Auto stash before merge of "newfeature/processo" and "origin/newfeature/paddle" 2020-05-04 10:08:22 +02:00
Alessio f745084d44 Merge remote-tracking branch 'origin/newfeature/paddle' into newfeature/processo 2020-05-04 10:08:00 +02:00
Alessio ec06bf016d Merge remote-tracking branch 'origin/newfeature/processo' into newfeature/processo 2020-05-04 09:32:18 +02:00
Alessio 7ed09443d9 Merge branch 'newfeature/paddle' into newfeature/processo 2020-05-04 09:31:55 +02:00
Alessio d99c7b52a6 format and binding of the data for riscaldi modal 2020-05-04 09:26:26 +02:00
francesco.guerrieri 6c0cef552c fix styles paddle 2020-05-04 09:02:04 +02:00
Damiano 87976bea45 Fix overview (general,position and cycle). 2020-04-30 17:14:26 +02:00
Alessio 93544b93a7 add format and binding of the data 2020-04-30 16:36:41 +02:00
Damiano 20a059602f Merge remote-tracking branch 'origin/develop' into newfeature/programmazione-preriscaldo 2020-04-30 11:16:32 +02:00
Samuele Locatelli f9586ce949 Fix enum json 2020-04-30 08:38:42 +02:00
Samuele Locatelli 46b715dd3c Merge branch 'feature/add/recipeModel' into develop 2020-04-29 18:33:27 +02:00
Samuele Locatelli d926a504d5 Aggiunto anche metodo x recipe overview 2020-04-29 18:31:20 +02:00
Samuele Locatelli a30e50fe53 Ok demo (SIM) x recipe/current 2020-04-29 18:07:35 +02:00
Samuele Locatelli 4fd3807875 Continuo gestione Recipe 2020-04-29 18:05:26 +02:00
Alessio 7bee0f3e91 Merge branch 'newfeature/processo' into develop 2020-04-29 15:21:12 +02:00
Alessio b55569e608 fix style for disabled components on avvio produzione modal 2020-04-29 11:41:57 +02:00
Alessio 684f595878 fix store 2020-04-29 11:08:24 +02:00
francesco.guerrieri 1ab581bd43 fix store 2020-04-29 10:39:13 +02:00
Alessio fbc6e22bf7 fix avvio produzione modal 2020-04-29 09:46:31 +02:00
francesco.guerrieri b86c338b14 fix store paddle 2020-04-28 17:04:42 +02:00
Alessio ad8681991b add avvio produzione modal 2020-04-28 16:06:36 +02:00
Alessio f018da3a5f fix cicle-gantt positioning 2020-04-28 14:54:39 +02:00
Alessio 440abb4e51 add circles-gantt component 2020-04-28 12:11:25 +02:00
Alessio 8132da127e add header to processo modal 2020-04-28 10:23:36 +02:00
Alessio 2dd6f93bd0 Merge branch 'newfeature/programmazione-preriscaldo' into newfeature/processo 2020-04-28 09:06:08 +02:00
Alessio 2be6c229d7 fix store 2020-04-27 17:08:05 +02:00
Alessio 88257068ae add store 2020-04-27 16:36:31 +02:00
Alessio d4ca3f9f1a Merge branch 'newfeature/programmazione-preriscaldo' into develop 2020-04-27 14:57:12 +02:00
Alessio c2f8441e8b general fixes 2020-04-27 14:49:56 +02:00
francesco.guerrieri 6dfee4a431 first commit paddle. create component 2020-04-27 14:30:15 +02:00
francesco.guerrieri f3c040fb1a first commit paddle. create component 2020-04-27 14:29:58 +02:00
Alessio 67644f38b9 change the inputs 2020-04-27 11:56:57 +02:00
Samuele Locatelli 49d7b45c67 Merge branch 'feature/add/recipeModel' into develop 2020-04-24 17:11:09 +02:00
Samuele Locatelli 189d5e200f Fix naming e ok test webApi x RecipeConf 2020-04-24 17:10:57 +02:00
Samuele Locatelli e99d3bdb0d Inserimento preliminare metodi Recipe 2020-04-24 16:55:02 +02:00
Samuele Locatelli 747fe636be Aggiunta XML e validazione dati Recipe 2020-04-24 16:54:45 +02:00
Samuele Locatelli 6c5d9ce68d Aggiunta preliminare modelli recipe 2020-04-24 16:54:24 +02:00
Alessio 08cecd01f5 fix svg 2020-04-24 14:43:00 +02:00
Alessio fce288f451 minor fix quote velocita modal 2020-04-24 14:22:21 +02:00
Samuele Locatelli 34c5e879a9 Fix Db Name 2020-04-24 13:49:50 +02:00
Samuele Locatelli b35ca55cf9 Merge branch 'feature/FixNamespace' into develop 2020-04-24 13:19:27 +02:00
Samuele Locatelli 2cf4461c77 COmpletato refresh con migrazioen DB 2020-04-24 13:18:51 +02:00
Samuele Locatelli 41558f278e Nuova migratins del DB 2020-04-24 13:18:42 +02:00
Samuele Locatelli ca253a5497 Eliminazione migrations precedenti 2020-04-24 13:17:42 +02:00
Samuele Locatelli 52621883bd Update ancora x naming... 2020-04-24 13:16:53 +02:00
Alessio 2c8227e1c2 add controstampo to quote e velocità modal 2020-04-24 11:37:20 +02:00
Samuele Locatelli 09e079f6f9 Fix namespace definitio (Step --> Thermo.Active) 2020-04-24 10:34:51 +02:00
Alessio f4e9a85e51 Merge branch 'newfeature/programmazione-preriscaldo' into develop 2020-04-24 09:03:06 +02:00
Alessio c8b21095a4 multiple fixes for the tags slider 2020-04-23 09:33:13 +02:00
Alessio cd20b0f117 fix css opzioni di lavorazione modal 2020-04-23 08:53:04 +02:00
francesco.guerrieri d1ddae1f61 Merge remote-tracking branch 'origin/develop' into newfeature/paddle 2020-04-22 16:07:50 +02:00
229 changed files with 10656 additions and 3425 deletions
@@ -0,0 +1,57 @@
declare module Recipe{
interface IRange{
min: number;
max: number;
}
interface IStatus{
visible: boolean;
enabled: boolean;
hasError: boolean;
}
interface IValue{
range:IRange,
status:IStatus,
unitMeasure:string,
valueAct: number
}
interface IRecipe{
vacuum_main_start?:IValue,
vacuum_main_delay?:IValue,
vacuum_main_max_time?:IValue,
vacuum_main_1_chart_setpointx?:IValue,
vacuum_main_1_chart_setpointy?:IValue,
vacuum_main_2_chart_setpointx?:IValue,
vacuum_main_2_chart_setpointy?:IValue,
vacuum_main_3_chart_setpointx?:IValue,
vacuum_main_3_chart_setpointy?:IValue,
vacuum_main_manual?:IValue,
vacuum_direct_enabled?:IValue,
vacuum_direct_delay?:IValue,
vacuum_direct_time?:IValue,
vacuum_aux_enabled?:IValue,
vacuum_aux_delay?:IValue,
vacuum_aux_max_time?:IValue,
vacuum_aux_1_chart_setpointx?:IValue,
vacuum_aux_1_chart_setpointy?:IValue,
vacuum_aux_2_chart_setpointx?:IValue,
vacuum_aux_2_chart_setpointy?:IValue,
vacuum_aux_3_chart_setpointx?:IValue,
vacuum_aux_3_chart_setpointy?:IValue,
vacuum_aux_manual?:IValue,
vacuum_pre_enabled?:IValue,
vacuum_pre_delay?:IValue,
vacuum_pre_max_time?:IValue,
vacuum_pre_1_chart_setpointx?:IValue,
vacuum_pre_1_chart_setpointy?:IValue,
vacuum_pre_2_chart_setpointx?:IValue,
vacuum_pre_2_chart_setpointy?:IValue,
vacuum_pre_3_chart_setpointx?:IValue,
vacuum_pre_3_chart_setpointy?:IValue
}
}
@@ -0,0 +1,57 @@
declare module Recipe{
interface IRange{
min: number;
max: number;
}
interface IStatus{
visible: boolean;
enabled: boolean;
hasError: boolean;
}
interface IValue{
range:IRange,
status:IStatus,
unitMeasure:string,
valueAct: number
}
interface IRecipe{
vacuum_main_start?:IValue,
vacuum_main_delay?:IValue,
vacuum_main_max_time?:IValue,
vacuum_main_1_chart_setpointx?:IValue,
vacuum_main_1_chart_setpointy?:IValue,
vacuum_main_2_chart_setpointx?:IValue,
vacuum_main_2_chart_setpointy?:IValue,
vacuum_main_3_chart_setpointx?:IValue,
vacuum_main_3_chart_setpointy?:IValue,
vacuum_main_manual?:IValue,
vacuum_direct_enabled?:IValue,
vacuum_direct_delay?:IValue,
vacuum_direct_time?:IValue,
vacuum_aux_enabled?:IValue,
vacuum_aux_delay?:IValue,
vacuum_aux_max_time?:IValue,
vacuum_aux_1_chart_setpointx?:IValue,
vacuum_aux_1_chart_setpointy?:IValue,
vacuum_aux_2_chart_setpointx?:IValue,
vacuum_aux_2_chart_setpointy?:IValue,
vacuum_aux_3_chart_setpointx?:IValue,
vacuum_aux_3_chart_setpointy?:IValue,
vacuum_aux_manual?:IValue,
vacuum_pre_enabled?:IValue,
vacuum_pre_delay?:IValue,
vacuum_pre_max_time?:IValue,
vacuum_pre_1_chart_setpointx?:IValue,
vacuum_pre_1_chart_setpointy?:IValue,
vacuum_pre_2_chart_setpointx?:IValue,
vacuum_pre_2_chart_setpointy?:IValue,
vacuum_pre_3_chart_setpointx?:IValue,
vacuum_pre_3_chart_setpointy?:IValue
}
}
@@ -0,0 +1,48 @@
import Vue from 'vue';
import Component from 'vue-class-component';
import {Prop} from 'vue-property-decorator';
import Slider from "@/app_modules_thermo/components/slider.vue"
import Scheda from "@/app_modules_thermo/components/scheda.vue"
@Component({name:'vuotoprincipale', components: { slider:Slider, scheda:Scheda}})
export default class VuotoPrincipale extends Vue{
Recipe:Recipe.IRecipe={
vacuum_main_delay:{
range:{
min:8,
max:105
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:57
},
vacuum_main_max_time:{
range:{
min:9,
max:127
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:30
},
};
@Prop({default:0})
ritardo:number;
@Prop({default:0})
percentuale:number;
@Prop({default:0})
durata:number;
}
@@ -0,0 +1,50 @@
<template>
<section>
<aside class="scrollable auto">
<div class="input-area">
<label>Partenza</label>
<select>
<option value="Label partenza">Label partenza</option>
</select>
</div>
<hr />
<div class="input-area">
<img src="assets/icons/png/clessidra.png" />
<label>Ritardo</label>
<div class="rect">
{{ritardo}} s
</div>
</div>
<slider :min="0" :max="10" v-model="ritardo" unit-of-measure="s"></slider>
<hr />
<div class="input-area">
<label>Portata in manuale</label>
<div class="rect">
{{Recipe.vacuum_main_delay.valueAct}} %
</div>
</div>
<slider :min="Recipe.vacuum_main_delay.range.min" :max="Recipe.vacuum_main_delay.range.max" v-model="Recipe.vacuum_main_delay.valueAct" :unit-of-measure="Recipe.vacuum_main_delay.unitMeasure"></slider>
</aside>
<hr>
<div class="specific">
<scheda></scheda>
<scheda></scheda>
<scheda></scheda>
</div>
<div class="specific">
<div class="input-area">
<label>Durata massima</label>
<div class="rect">
{{Recipe.vacuum_main_max_time.valueAct}} s
</div>
</div>
<slider :min="Recipe.vacuum_main_max_time.range.min" :max="Recipe.vacuum_main_max_time.range.max" v-model="Recipe.vacuum_main_max_time.valueAct" :unit-of-measure="Recipe.vacuum_main_max_time.unitMeasure"></slider>
</div>
</section>
</template>
<script lang="ts" src="./vuoto-principale.ts"></script>
@@ -0,0 +1,50 @@
import Vue from 'vue';
import Component from 'vue-class-component';
import {Prop} from 'vue-property-decorator';
import Slider from "@/app_modules_thermo/components/slider.vue"
import Scheda from "@/app_modules_thermo/components/scheda.vue"
@Component({name:'vuotoprincipale', components: { slider:Slider, scheda:Scheda}})
export default class VuotoPrincipale extends Vue{
Recipe:Recipe.IRecipe={
vacuum_main_delay:{
range:{
min:8,
max:105
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:57
},
vacuum_main_max_time:{
range:{
min:9,
max:127
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:30
},
};
@Prop({default:0})
ritardo:number;
@Prop({default:0})
percentuale:number;
@Prop({default:0})
durata:number;
mock_ritardo:number=this.ritardo;
mock_percentuale:number=this.percentuale;
mock_durata:number=this.durata;
}
@@ -0,0 +1,44 @@
<template>
<section>
<aside class="scrollable auto">
<div class="input-area">
<label>Partenza</label>
<select>
<option value="Label partenza">Label partenza</option>
</select>
</div>
<hr />
<div class="input-area">
<img src="assets/icons/png/clessidra.png" />
<label>Ritardo</label>
<input class="rect" v-model="Recipe.vacuum_main_delay.valueAct">
</div>
<slider :min="Recipe.vacuum_main_delay.range.min" :max="Recipe.vacuum_main_delay.range.max" v-model="Recipe.vacuum_main_delay.valueAct" :unit-of-measure="Recipe.vacuum_main_delay.unitMeasure"></slider>
<hr />
<div class="input-area">
<label>Portata in manuale</label>
<input class="rect" v-model="mock_percentuale">
</div>
<slider :min="0" :max="100" v-model="mock_percentuale" :unit-of-measure="'%'"></slider>
</aside>
<hr>
<div class="specific">
<scheda></scheda>
<scheda></scheda>
<scheda></scheda>
</div>
<div class="specific">
<div class="input-area">
<label>Durata massima</label>
<input class="rect" v-model="Recipe.vacuum_main_max_time.valueAct">
</div>
<slider :min="Recipe.vacuum_main_max_time.range.min" :max="Recipe.vacuum_main_max_time.range.max" v-model="Recipe.vacuum_main_max_time.valueAct" :unit-of-measure="Recipe.vacuum_main_max_time.unitMeasure"></slider>
</div>
</section>
</template>
<script lang="ts" src="./vuoto-principale.ts"></script>
@@ -0,0 +1,63 @@
import Vue from 'vue';
import Component from 'vue-class-component';
import {Prop} from 'vue-property-decorator';
import Slider from "@/app_modules_thermo/components/slider.vue"
import Scheda from "@/app_modules_thermo/components/scheda.vue"
@Component({name:'vuotoprincipale', components: { slider:Slider, scheda:Scheda}})
export default class VuotoPrincipale extends Vue{
Recipe:Recipe.IRecipe={
vacuum_main_delay:{
range:{
min:8,
max:105
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:57
},
vacuum_main_max_time:{
range:{
min:9,
max:127
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:30
},
vacuum_main_manual:{
range:{
min:4,
max:115
},
status:{
visible:true,
enabled:true,
hasError:false
},
unitMeasure:"",
valueAct:8
},
};
@Prop({default:0})
ritardo:number;
@Prop({default:0})
percentuale:number;
@Prop({default:0})
durata:number;
mock_ritardo:number=this.ritardo;
mock_percentuale:number=this.percentuale;
mock_durata:number=this.durata;
}
@@ -0,0 +1,44 @@
<template>
<section>
<aside class="scrollable auto">
<div class="input-area">
<label>Partenza</label>
<select>
<option value="Label partenza">Label partenza</option>
</select>
</div>
<hr />
<div class="input-area">
<img src="assets/icons/png/clessidra.png" />
<label>Ritardo</label>
<input class="rect" v-model="Recipe.vacuum_main_delay.valueAct">
</div>
<slider :min="Recipe.vacuum_main_delay.range.min" :max="Recipe.vacuum_main_delay.range.max" v-model="Recipe.vacuum_main_delay.valueAct" :unit-of-measure="Recipe.vacuum_main_delay.unitMeasure"></slider>
<hr />
<div class="input-area">
<label>Portata in manuale</label>
<input class="rect" v-model="Recipe.vacuum_main_manual.valueAct">
</div>
<slider :min="Recipe.vacuum_main_manual.range.min" :max="Recipe.vacuum_main_manual.range.max" v-model="Recipe.vacuum_main_manual.valueAct" :unit-of-measure="Recipe.vacuum_main_manual.unitMeasure"></slider>
</aside>
<hr>
<div class="specific">
<scheda></scheda>
<scheda></scheda>
<scheda></scheda>
</div>
<div class="specific">
<div class="input-area">
<label>Durata massima</label>
<input class="rect" v-model="Recipe.vacuum_main_max_time.valueAct">
</div>
<slider :min="Recipe.vacuum_main_max_time.range.min" :max="Recipe.vacuum_main_max_time.range.max" v-model="Recipe.vacuum_main_max_time.valueAct" :unit-of-measure="Recipe.vacuum_main_max_time.unitMeasure"></slider>
</div>
</section>
</template>
<script lang="ts" src="./vuoto-principale.ts"></script>
+1 -1
View File
@@ -10,7 +10,7 @@ namespace Client.Config.SubModels
{
public Boolean Enabled { get; set; }
public Boolean FollowNcWindow { get; set; }
public ushort Type { get; set; } /* 0: Demo - 1: Fanuc - 2: Siemens - 3: Osai */
public ushort Type { get; set; } /* 0: Demo - 1: Fanuc - 2: Siemens - 3: Osai - 4: Siemens S7 */
public string IpAddress { get; set; }
public string Port { get; set; }
+15
View File
@@ -1283,6 +1283,21 @@ namespace Active_Client.View
ncWindowHeight = HMI_WINDOW_HEIGHT_OSAI;
ncWindowX = HMI_WINDOW_POS_X_OSAI;
ncWindowY = HMI_WINDOW_POS_Y_OSAI;
}; break;
// 4: Siemens S7
case 4:
{
processname = DemoName;
processpath = @"C:\CMS\ACTIVE\DEMO" + DemoPath;
ncWindowWidth = 0;
ncWindowHeight = 0;
ncWindowX = 0;
ncWindowY = 0; ;
//ncWindowWidth = HMI_WINDOW_WIDTH_SIEMENS;
//ncWindowHeight = HMI_WINDOW_HEIGHT_SIEMENS;
//ncWindowX = HMI_WINDOW_POS_X_SIEMENS;
//ncWindowY = HMI_WINDOW_POS_Y_SIEMENS;
}; break;
}
}
+2
View File
@@ -257,6 +257,8 @@ namespace Active_Client.View
Config.VendorHmiConfig.Type = 2;
else if (ncVendorName.Equals("OSAI"))
Config.VendorHmiConfig.Type = 3;
else if (ncVendorName.Equals("S7NET"))
Config.VendorHmiConfig.Type = 4;
else
{
setStatus("Close the application!", "Errror in configuration, from server");
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="OPENcontrol" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://192.168.20.2:8080" binding="basicHttpBinding"
bindingConfiguration="OPENcontrol" contract="OPENControl.OPENcontrolPortType"
name="OPENcontrol" />
</client>
</system.serviceModel>
</configuration>
Binary file not shown.
@@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("Step.CmsConnect")]
[assembly: AssemblyTitle("Thermo.Active.CmsConnect")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Step.CmsConnect")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyProduct("Thermo.Active.CmsConnect")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="recipe">
<xs:complexType>
<xs:sequence>
<!-- Heads -->
<xs:element name="parameter" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:all>
<xs:element name="id" type="xs:int"/>
<xs:element name="category" type="param_type" />
<xs:element name="subCategory_1" type="xs:string" />
<xs:element name="subCategory_2" type="xs:string" />
<xs:element name="name" type="xs:string" />
<xs:element name="description" type="xs:string" />
<xs:element name="format" type="xs:string" />
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Head Type -->
<xs:simpleType name="param_type" final="restriction">
<xs:restriction base="xs:string">
<xs:enumeration value="General" />
<xs:enumeration value="Positions" />
<xs:enumeration value="Cycle"/>
<xs:enumeration value="Heats"/>
<xs:enumeration value="Pyrometer"/>
<xs:enumeration value="Drawing"/>
<xs:enumeration value="UpperPlate"/>
<xs:enumeration value="Cooling"/>
<xs:enumeration value="Vacuum"/>
<xs:enumeration value="Extraction"/>
<xs:enumeration value="Options"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
+4 -4
View File
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<serverConfig>
<ncConfig>
<ncVendor>DEMO</ncVendor> <!-- NO_NC/DEMO/FANUC/SIEMENS/OSAI -->
<showNcHMI>true</showNcHMI>
<ncIpAddress>localhost</ncIpAddress>
<ncPort>8080</ncPort>
<ncVendor>S7NET</ncVendor> <!-- NO_NC/DEMO/FANUC/SIEMENS/OSAI/S7NET -->
<showNcHMI>false</showNcHMI>
<ncIpAddress>192.168.0.102</ncIpAddress>
<ncPort>102</ncPort>
<machineModel>Ares 37 OF</machineModel>
<sharedPath>C:\PartPrg\</sharedPath>
<sharedName>//PARTPRG:/</sharedName>
@@ -1,78 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="serverConfig">
<xs:complexType>
<xs:all>
<xs:element name="ncConfig">
<xs:complexType>
<xs:element name="serverConfig">
<xs:complexType>
<xs:all>
<xs:element name="ncVendor" type="ncType" minOccurs='1' maxOccurs='1'/>
<xs:element name="showNcHMI" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
<xs:element name="ncIpAddress" minOccurs='1' maxOccurs='1'/>
<xs:element name="ncPort" type="xs:int" minOccurs='1' maxOccurs='1'/>
<xs:element name="machineModel" type="xs:string" minOccurs='1' maxOccurs='1'/>
<xs:element name="sharedPath" type="xs:string" minOccurs='1' maxOccurs='1'/>
<xs:element name="sharedName" type="xs:string" minOccurs='1' maxOccurs='1'/>
<xs:element name="installationDate" type="xs:string" minOccurs='1' maxOccurs='1'/>
<xs:element name="mgiOption" type="xs:boolean" minOccurs='1' maxOccurs='1'/>
<xs:element name="siemensKeyboardOption" type="xs:boolean" minOccurs='1' maxOccurs='1'/>
<xs:element name="machineNumberHasLetters" type="xs:boolean" minOccurs='1' maxOccurs='1'/>
<xs:element name="ncConfig">
<xs:complexType>
<xs:all>
<xs:element name="ncVendor" type="ncType" minOccurs='1' maxOccurs='1'/>
<xs:element name="showNcHMI" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
<xs:element name="ncIpAddress" minOccurs='1' maxOccurs='1'/>
<xs:element name="ncPort" type="xs:int" minOccurs='1' maxOccurs='1'/>
<xs:element name="machineModel" type="xs:string" minOccurs='1' maxOccurs='1'/>
<xs:element name="sharedPath" type="xs:string" minOccurs='1' maxOccurs='1'/>
<xs:element name="sharedName" type="xs:string" minOccurs='1' maxOccurs='1'/>
<xs:element name="installationDate" type="xs:string" minOccurs='1' maxOccurs='1'/>
<xs:element name="mgiOption" type="xs:boolean" minOccurs='1' maxOccurs='1'/>
<xs:element name="siemensKeyboardOption" type="xs:boolean" minOccurs='1' maxOccurs='1'/>
<xs:element name="machineNumberHasLetters" type="xs:boolean" minOccurs='1' maxOccurs='1'/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="softwareProdConfig">
<xs:complexType>
<xs:all>
<xs:element name="enabled" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
<xs:element name="path" type="xs:string" minOccurs='1' maxOccurs='1'/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="serverConfig">
<xs:complexType>
<xs:all>
<xs:element name="serverAddress" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="serverPort" type="xs:int" minOccurs='1' maxOccurs='1'/>
<xs:element name="language" type="xs:language" minOccurs='1' maxOccurs='1' default="en"/>
<xs:element name="enableDirectoryBrowsing" type="xs:boolean" default="false"/>
<xs:element name="databaseAddress" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="autoOpenCmsClient" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
<xs:element name="textEditorPath" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="MTCFolderPath" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="MTCApplicationName" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="maxAlarmsRows" type="xs:int" minOccurs="1" maxOccurs="1"/>
<xs:element name="alarmToDelete" type="xs:int" minOccurs="1" maxOccurs="1"/>
<xs:element name="CMSConnectReady" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="extSoftwares">
<xs:complexType>
<xs:sequence>
<xs:element name="software" minOccurs='0' maxOccurs='15'>
<xs:complexType>
<xs:all>
<xs:element name="path" minOccurs='1' maxOccurs='1'/>
<xs:element name="longName" minOccurs='1' maxOccurs='1'/>
<xs:element name="shortName" minOccurs='1' maxOccurs='1'/>
<xs:element name="arguments" minOccurs='1' maxOccurs='1'/>
<xs:element name="inMainMenuBar" minOccurs='1' maxOccurs='1'/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="softwareProdConfig">
<xs:complexType>
<xs:all>
<xs:element name="enabled" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
<xs:element name="path" type="xs:string" minOccurs='1' maxOccurs='1'/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="serverConfig">
<xs:complexType>
<xs:all>
<xs:element name="serverAddress" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="serverPort" type="xs:int" minOccurs='1' maxOccurs='1'/>
<xs:element name="language" type="xs:language" minOccurs='1' maxOccurs='1' default="en"/>
<xs:element name="enableDirectoryBrowsing" type="xs:boolean" default="false"/>
<xs:element name="databaseAddress" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="autoOpenCmsClient" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
<xs:element name="textEditorPath" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="MTCFolderPath" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="MTCApplicationName" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="maxAlarmsRows" type="xs:int" minOccurs="1" maxOccurs="1"/>
<xs:element name="alarmToDelete" type="xs:int" minOccurs="1" maxOccurs="1"/>
<xs:element name="CMSConnectReady" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="extSoftwares">
<xs:complexType>
<xs:sequence>
<xs:element name="software" minOccurs='0' maxOccurs='15'>
<xs:complexType>
<xs:all>
<xs:element name="path" minOccurs='1' maxOccurs='1'/>
<xs:element name="longName" minOccurs='1' maxOccurs='1'/>
<xs:element name="shortName" minOccurs='1' maxOccurs='1'/>
<xs:element name="arguments" minOccurs='1' maxOccurs='1'/>
<xs:element name="inMainMenuBar" minOccurs='1' maxOccurs='1'/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:complexType>
</xs:element>
<xs:simpleType name="ncType" final="restriction" >
<xs:restriction base="xs:string">
<xs:enumeration value="DEMO" />
<xs:enumeration value="OSAI" />
<xs:enumeration value="FANUC" />
<xs:enumeration value="SIEMENS" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ncType" final="restriction" >
<xs:restriction base="xs:string">
<xs:enumeration value="DEMO" />
<xs:enumeration value="OSAI" />
<xs:enumeration value="FANUC" />
<xs:enumeration value="SIEMENS" />
<xs:enumeration value="S7NET" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("Step.Config")]
[assembly: AssemblyTitle("Thermo.Active.Config")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Step.Config")]
[assembly: AssemblyProduct("Thermo.Active.Config")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
+1
View File
@@ -32,6 +32,7 @@ namespace Thermo.Active.Config
public static List<NcSoftKeysModel> NcSoftKeysConfig;
public static List<AlarmsConfigModel> InitialAlarmsConfig;
public static List<HeadsConfigModel> HeadsConfig;
public static List<RecipeConfigModel> RecipeConfig;
public static CmsConnectConfigModel CmsConnectConfig;
public static AreasConfigModel ProductionConfig;
@@ -33,6 +33,7 @@ namespace Thermo.Active.Config
ReadUserSoftKeysConfig();
ReadAlarmsConfig();
ReadHeadsConfig();
ReadRecipeConfig();
// ReadCMSConnectConfig();
ReadMacros();
ReadScadaFile();
@@ -572,6 +573,26 @@ namespace Thermo.Active.Config
.ToList();
}
private static void ReadRecipeConfig()
{
XDocument xmlConfigFile = GetXmlHandlerWithValidator(RECIPE_CONFIG_SCHEMA_PATH, RECIPE_CONFIG_PATH);
// Read head config from XML file
RecipeConfig = xmlConfigFile
.Root
.Elements()
.Select(x => new RecipeConfigModel()
{
Id = Convert.ToInt16(x.Element("id").Value),
Category = GetTActCategory(x.Element("category").Value),
SubCategory_1 = x.Element("subCategory_1").Value,
SubCategory_2 = x.Element("subCategory_2").Value,
Name = x.Element("name").Value,
Description = x.Element("description").Value,
Format = x.Element("format").Value
})
.ToList();
}
private static void ReadCMSConnectConfig()
{
@@ -69,6 +69,9 @@
<Content Include="Config\customMainProgram.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Config\recipeConfig.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Config\userSoftKeyConfig.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
@@ -83,7 +86,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
<EmbeddedResource Include="Config\headsConfigValidator.xsd">
<EmbeddedResource Include="Config\recipeConfigValidator.xsd">
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Config\maintenancesConfigValidator.xsd">
@@ -151,5 +154,10 @@
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Config\headsConfigValidator.xsd">
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("Step.Core")]
[assembly: AssemblyTitle("Thermo.Active.Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Step.Tasks")]
[assembly: AssemblyProduct("Thermo.Active.Tasks")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
+4 -3
View File
@@ -32,9 +32,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CMS_CORE_Library">
<HintPath>..\Libs\CMS_CORE_Library.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
@@ -63,6 +60,10 @@
<Compile Include="ThreadsSiemensHmi.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\cms_core_library\CMS_CORE_Library\CMS_CORE_Library.csproj">
<Project>{4abf8eef-2b23-483e-acdc-53214fe28681}</Project>
<Name>CMS_CORE_Library</Name>
</ProjectReference>
<ProjectReference Include="..\Thermo.Active.Config\Thermo.Active.Config.csproj">
<Project>{3f5c2483-fc87-43ef-92a8-66ff7d0e440f}</Project>
<Name>Thermo.Active.Config</Name>
+222 -29
View File
@@ -21,20 +21,22 @@ using TeamDev.SDK.MVVM;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Utils.ExceptionManager;
using static Thermo.Active.Utils.ExceptionManager;
using Thermo.Active.Model.DTOModels.Recipe;
public static class ThreadsFunctions
public static class ThreadsFunctions
{
public static int recipeRtCounter = 0;
public static bool reconnectionIsRunning = false;
private static ConcurrentDictionary<string, long> Timers = new ConcurrentDictionary<string, long>();
private static ConcurrentDictionary<string, long> Counter = new ConcurrentDictionary<string, long>();
private static Thread ConnThread;
#region Functions
public static void ManageWatchdog()
public static void ManageWatchdog()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
@@ -47,7 +49,7 @@ public static class ThreadsFunctions
while (true)
{
sw.Restart();
sw.Restart();
//if(errorCounter == MAX_NUM_OF_WATCHDOG_ERROR)
//{
@@ -55,7 +57,7 @@ public static class ThreadsFunctions
//}
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Manage watchdog
libraryError = ncAdapter.ManageWatchdog();
@@ -65,7 +67,7 @@ public static class ThreadsFunctions
errorCounter++;
}
else if (libraryError == NO_ERROR)
errorCounter = 0;
errorCounter = 0;
}
else
RestoreConnection();
@@ -375,6 +377,7 @@ public static class ThreadsFunctions
}
}
#if false
public static void ReadHeadsData()
{
NcAdapter ncAdapter = new NcAdapter();
@@ -417,7 +420,8 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
}
}
#endif
public static void ReadAxesNamesData()
{
@@ -507,6 +511,7 @@ public static class ThreadsFunctions
}
}
#if false
public static void ReadActiveProgramData()
{
NcFileAdapter ncAdapter = new NcFileAdapter();
@@ -550,8 +555,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
}
}
#endif
#if false
public static void ReadPartProgramQueueData()
{
NcFileAdapter ncAdapter = new NcFileAdapter();
@@ -597,9 +604,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
}
}
#endif
public static void ReadScadaData()
public static void ReadScadaData()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
@@ -643,7 +651,192 @@ public static class ThreadsFunctions
ncAdapter.Dispose();
}
}
public static void ReadGaugeData()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Get new data from PLC
libraryError = ncAdapter.ReadGaugeData(out ThermoModels.GaugeModel gaugeData);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_THERMO_GAUGE_DATA, null, gaugeData);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
}
public static void ReadRecipeData()
{
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
// ogni n counter leggo anche dati NON RT
recipeRtCounter--;
bool onlyRt = recipeRtCounter > 0;
//check reset...
recipeRtCounter = recipeRtCounter < 0 ? 5 : recipeRtCounter;
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Get new data from PLC
libraryError = ncAdapter.ReadRecipeData(onlyRt, false, out Dictionary<string, DTORecipeParam> currRecipe);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_THERMO_RECIPE_FULL, null, currRecipe);
}
else
RestoreConnection();
sw.Stop();
// Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(250, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
}
public static void ReadWarmersData()
{
// TODO FIXME
#if false
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
List<ScadaSchemaModel> scadaToRead = ProductionScadaSchema.Concat(SubscribedScada).ToList();
// Get new data from PLC
libraryError = ncAdapter.ReadScadasData(scadaToRead, out List<DTOScadaModel> scadas);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_SCADA_DATA, null, scadas);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
#endif
}
public static void ReadModulesData()
{
// TODO FIXME
#if false
NcAdapter ncAdapter = new NcAdapter();
Stopwatch sw = new Stopwatch();
try
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
List<ScadaSchemaModel> scadaToRead = ProductionScadaSchema.Concat(SubscribedScada).ToList();
// Get new data from PLC
libraryError = ncAdapter.ReadScadasData(scadaToRead, out List<DTOScadaModel> scadas);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_SCADA_DATA, null, scadas);
}
else
RestoreConnection();
sw.Stop();
//Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(500, (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
#endif
}
public static void ReadM154Data()
{
NcAdapter ncAdapter = new NcAdapter();
@@ -698,7 +891,7 @@ public static class ThreadsFunctions
foreach (M154DataModel m154 in data)
{
//if (CmsConnectConfig.Enabled)
if(ServerStartupConfig.CmsConnectReady)
if (ServerStartupConfig.CmsConnectReady)
{
if (m154.Parameters.Count() >= 2 && m154.Parameters[0] == "SOUR")
@@ -827,7 +1020,7 @@ public static class ThreadsFunctions
{
List<DTOLanguageModel> availableLanguages = LanguageController.GetLanguageListFromDirectory();
if (availableLanguages == null)
return ;
return;
ICollection<CultureInfo> cultureInfos = new List<CultureInfo>();
@@ -838,7 +1031,7 @@ public static class ThreadsFunctions
// Filter available language with
availableLanguages = availableLanguages.Where(x => cultureInfos.Any(y => y.TwoLetterISOLanguageName == x.IsoId)).ToList();
// Fill redis DB
int count = 1;
Dictionary<string, string> defAlarmsNamesEn = null;
@@ -847,10 +1040,10 @@ public static class ThreadsFunctions
{
Dictionary<string, string> alarmsNames = GetPlcAlarmsTranslations(lang.IsoId);
if(lang.IsoId.ToLower() == "en")
if (lang.IsoId.ToLower() == "en")
{
defAlarmsNamesEn = alarmsNames;
if(!RedisController.WriteAlarmsConfigEn(alarmsNames))
if (!RedisController.WriteAlarmsConfigEn(alarmsNames))
ManageError(ERROR_LEVEL.FATAL, CMS_CONNECT_SETUP_ALARM_MESSAGE);
}
else if (lang.IsoId.ToLower() == "it")
@@ -861,7 +1054,7 @@ public static class ThreadsFunctions
}
else
if (!RedisController.WriteAlarmsConfigCurr(alarmsNames))
ManageError(ERROR_LEVEL.FATAL, CMS_CONNECT_SETUP_ALARM_MESSAGE);
ManageError(ERROR_LEVEL.FATAL, CMS_CONNECT_SETUP_ALARM_MESSAGE);
if (count == 3)
break;
@@ -871,10 +1064,10 @@ public static class ThreadsFunctions
if (availableLanguages.Count < 3 && defAlarmsNamesEn != null)
if (!RedisController.WriteAlarmsConfigCurr(defAlarmsNamesEn))
ManageError(ERROR_LEVEL.FATAL, CMS_CONNECT_SETUP_ALARM_MESSAGE);
else if (availableLanguages.Count < 3 && defAlarmsNamesIt != null)
if (!RedisController.WriteAlarmsConfigCurr(defAlarmsNamesIt))
ManageError(ERROR_LEVEL.FATAL, CMS_CONNECT_SETUP_ALARM_MESSAGE);
else if (availableLanguages.Count < 3 && defAlarmsNamesIt != null)
if (!RedisController.WriteAlarmsConfigCurr(defAlarmsNamesIt))
ManageError(ERROR_LEVEL.FATAL, CMS_CONNECT_SETUP_ALARM_MESSAGE);
}
catch (ThreadAbortException)
@@ -890,16 +1083,16 @@ public static class ThreadsFunctions
private static void TryNcConnection()
{
// Stop all the NC threads
ThreadsHandler.Stop();
StatReset();
ThreadsHandler.Stop();
StatReset();
NcAdapter ncAdapter = new NcAdapter();
CmsError cmsError = NO_ERROR;
// Run loop until NC is connected
while (!ncAdapter.numericalControl.NC_IsConnected())
while (!ncAdapter.numericalControl.NC_IsConnected())
{
// Try reconnection
cmsError = ncAdapter.Connect();
if (cmsError.errorCode == CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND || cmsError.errorCode == CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING || cmsError.errorCode == CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND)
if (cmsError.errorCode == CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND || cmsError.errorCode == CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING || cmsError.errorCode == CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND)
ManageLibraryError(cmsError);
else if (cmsError.errorCode != CMS_ERROR_CODES.OK)
{
@@ -975,7 +1168,7 @@ public static class ThreadsFunctions
break;
}
}
internal static void UpdateStat(string functionName, long timer)
{
if (!Timers.ContainsKey(functionName))
@@ -994,16 +1187,16 @@ public static class ThreadsFunctions
{
while (true)
{
foreach(var value in Counter)
foreach (var value in Counter)
{
if(ThreadsHandler.RunningThreadStatus.ContainsKey(value.Key) && Counter[value.Key] != 0)
if (ThreadsHandler.RunningThreadStatus.ContainsKey(value.Key) && Counter[value.Key] != 0)
{
ThreadsHandler.RunningThreadStatus[value.Key] = (Timers[value.Key] / Counter[value.Key]) + " mS";
Timers[value.Key] = 0;
Counter[value.Key] = 0;
}
}
MessageServices.Current.Publish(SEND_THREADS_STATUS, null, ThreadsHandler.RunningThreadStatus);
Thread.Sleep(2000);
@@ -1107,7 +1300,7 @@ public static class ThreadsFunctions
message = string.Format(NOT_FOUND_ALARM_MESSAGE, i);
}
// Add to dictionary
returnValue.Add(i.ToString("D6") + "|900",message);
returnValue.Add(i.ToString("D6") + "|900", message);
}
return returnValue;
}
+10 -3
View File
@@ -19,13 +19,17 @@ namespace Thermo.Active.Core
ThreadsFunctions.ReadExpiredMaintenances,
ThreadsFunctions.ReadAxesPositionsData,
ThreadsFunctions.ReadUserSoftKeysData,
ThreadsFunctions.ReadHeadsData,
//ThreadsFunctions.ReadHeadsData,
ThreadsFunctions.ReadAxesNamesData,
ThreadsFunctions.ReadActiveProgramData,
//ThreadsFunctions.ReadActiveProgramData,
//ThreadsFunctions.ReadPartProgramQueueData,
ThreadsFunctions.ReadScadaData,
ThreadsFunctions.ReadM154Data
ThreadsFunctions.ReadM154Data, // levare?
// ThreadsFunctions.ReadNcSoftKeysData,
ThreadsFunctions.ReadGaugeData,
ThreadsFunctions.ReadRecipeData,
ThreadsFunctions.ReadWarmersData,
ThreadsFunctions.ReadModulesData
};
private static Action ThreadSetupCmsConnect = ThreadsFunctions.SetupCmsConnect;
@@ -44,6 +48,7 @@ namespace Thermo.Active.Core
{
Thread t = new Thread(() => ThreadSetupCmsConnect());
t.Start();
Thread.Sleep(50);
}
}
@@ -60,6 +65,8 @@ namespace Thermo.Active.Core
threadFunction()
);
t.Start();
// aggiungo pausa x evitare sovrapposizioni chiamate
Thread.Sleep(50);
// Add thread to running threads list
lock (RunningThreadsList)
RunningThreadsList.Add(t);
+2 -4
View File
@@ -1,7 +1,7 @@
using Microsoft.Win32;
using MySql.Data.Entity;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Database.Migrations;
using Thermo.Active.Database.Migrations;
using Thermo.Active.Model.DatabaseModels;
using System;
@@ -34,8 +34,6 @@ namespace Thermo.Active.Database
public DbSet<MaintenanceFileModel> MaintenanceFiles { get; set; }
// Tool tables
public DbSet<DbNcFamilyModel> Families { get; set; }
public DbSet<DbNcShankModel> Shanks { get; set; }
public DbSet<DbNcMagazinePositionModel> MagazinePositions { get; set; }
public DbSet<QueueItemsModel> Queue { get; set; }
// Alarms
public DbSet<AlarmDescriptionsModel> AlarmDescriptions { get; set; }
@@ -84,7 +82,7 @@ namespace Thermo.Active.Database
{
// Run migrations and seed.
migrator.Update();
}
}
FindOrCreateMachineUniqueId();
@@ -1,29 +0,0 @@
// <auto-generated />
namespace Thermo.Active.Database.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class InitMigration : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(InitMigration));
string IMigrationMetadata.Id
{
get { return "201806130949510_InitMigration"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -1,165 +0,0 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class InitMigration : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.function_access",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
write_level_min = c.Int(nullable: false),
read_level_min = c.Int(nullable: false),
area = c.String(unicode: false),
enabled = c.Boolean(nullable: false),
plc_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.machine",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
unique_id = c.String(unicode: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.machine_user",
c => new
{
id = c.Int(nullable: false, identity: true),
machine_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
role_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.machine", t => t.machine_id, cascadeDelete: true)
.ForeignKey("dbo.role", t => t.role_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => new { t.machine_id, t.user_id }, unique: true, clustered: true, name: "unique_machine_user")
.Index(t => t.role_id);
CreateTable(
"dbo.role",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
level = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.user",
c => new
{
id = c.Int(nullable: false, identity: true),
username = c.String(nullable: false, unicode: false),
first_name = c.String(unicode: false),
last_name = c.String(unicode: false),
password = c.String(unicode: false),
security_stamp = c.String(unicode: false),
language = c.String(unicode: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.maintenance",
c => new
{
id = c.Int(nullable: false, identity: true),
intervall = c.Double(),
deadline = c.DateTime(nullable: false, precision: 0),
type = c.Int(nullable: false),
counter_id = c.Int(nullable: false),
title = c.String(unicode: false),
description = c.String(unicode: false),
unit_of_measure = c.Int(),
creation_date = c.DateTime(nullable: false, precision: 0),
last_expiration_date = c.DateTime(precision: 0),
user_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.user_id);
CreateTable(
"dbo.maintenance_note",
c => new
{
id = c.Int(nullable: false, identity: true),
message = c.String(unicode: false),
maintenance_id = c.Int(),
user_id = c.Int(),
timestamp = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance_id)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.maintenance_id)
.Index(t => t.user_id);
CreateTable(
"dbo.performed_maintenance",
c => new
{
id = c.Int(nullable: false, identity: true),
date = c.DateTime(nullable: false, precision: 0),
counter_value = c.Int(nullable: false),
maintenance = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance, cascadeDelete: true)
.Index(t => t.maintenance);
CreateTable(
"dbo.session",
c => new
{
id = c.Int(nullable: false, identity: true),
token = c.String(unicode: false),
machine_user_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.machine_user", t => t.machine_user_id, cascadeDelete: true)
.Index(t => t.machine_user_id);
}
public override void Down()
{
DropForeignKey("dbo.session", "machine_user_id", "dbo.machine_user");
DropForeignKey("dbo.performed_maintenance", "maintenance", "dbo.maintenance");
DropForeignKey("dbo.maintenance_note", "user_id", "dbo.user");
DropForeignKey("dbo.maintenance_note", "maintenance_id", "dbo.maintenance");
DropForeignKey("dbo.maintenance", "user_id", "dbo.user");
DropForeignKey("dbo.machine_user", "user_id", "dbo.user");
DropForeignKey("dbo.machine_user", "role_id", "dbo.role");
DropForeignKey("dbo.machine_user", "machine_id", "dbo.machine");
DropIndex("dbo.session", new[] { "machine_user_id" });
DropIndex("dbo.performed_maintenance", new[] { "maintenance" });
DropIndex("dbo.maintenance_note", new[] { "user_id" });
DropIndex("dbo.maintenance_note", new[] { "maintenance_id" });
DropIndex("dbo.maintenance", new[] { "user_id" });
DropIndex("dbo.machine_user", new[] { "role_id" });
DropIndex("dbo.machine_user", "unique_machine_user");
DropTable("dbo.session");
DropTable("dbo.performed_maintenance");
DropTable("dbo.maintenance_note");
DropTable("dbo.maintenance");
DropTable("dbo.user");
DropTable("dbo.role");
DropTable("dbo.machine_user");
DropTable("dbo.machine");
DropTable("dbo.function_access");
}
}
}
File diff suppressed because one or more lines are too long
@@ -1,29 +0,0 @@
// <auto-generated />
namespace Thermo.Active.Database.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class InitMigration : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(InitMigration));
string IMigrationMetadata.Id
{
get { return "201807120908403_InitMigration"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -1,196 +0,0 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class InitMigration : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.favorite_user_softkey",
c => new
{
user_softkey_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
})
.PrimaryKey(t => new { t.user_softkey_id, t.user_id });
CreateTable(
"dbo.function_access",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
write_level_min = c.Int(nullable: false),
read_level_min = c.Int(nullable: false),
area = c.String(unicode: false),
enabled = c.Boolean(nullable: false),
plc_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.machine",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
unique_id = c.String(unicode: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.machine_user",
c => new
{
id = c.Int(nullable: false, identity: true),
machine_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
role_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.machine", t => t.machine_id, cascadeDelete: true)
.ForeignKey("dbo.role", t => t.role_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => new { t.machine_id, t.user_id }, unique: true, clustered: true, name: "unique_machine_user")
.Index(t => t.role_id);
CreateTable(
"dbo.role",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
level = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.user",
c => new
{
id = c.Int(nullable: false, identity: true),
username = c.String(nullable: false, unicode: false),
first_name = c.String(unicode: false),
last_name = c.String(unicode: false),
password = c.String(unicode: false),
security_stamp = c.String(unicode: false),
language = c.String(unicode: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.maintenance_file",
c => new
{
id = c.Int(nullable: false, identity: true),
file_name = c.String(unicode: false),
local_file_name = c.String(unicode: false),
maintenance_id = c.Int(nullable: false),
user_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.maintenance_id)
.Index(t => t.user_id);
CreateTable(
"dbo.maintenance",
c => new
{
id = c.Int(nullable: false, identity: true),
intervall = c.Double(),
deadline = c.DateTime(nullable: false, precision: 0),
type = c.Int(nullable: false),
counter_id = c.Int(nullable: false),
title = c.String(unicode: false),
description = c.String(unicode: false),
unit_of_measure = c.Int(),
creation_date = c.DateTime(nullable: false, precision: 0),
last_expiration_date = c.DateTime(precision: 0),
user_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.user_id);
CreateTable(
"dbo.maintenance_note",
c => new
{
id = c.Int(nullable: false, identity: true),
message = c.String(unicode: false),
user_id = c.Int(nullable: false),
maintenance_id = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => t.user_id)
.Index(t => t.maintenance_id);
CreateTable(
"dbo.performed_maintenance",
c => new
{
id = c.Int(nullable: false, identity: true),
date = c.DateTime(nullable: false, precision: 0),
counter_value = c.Int(nullable: false),
maintenance = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance, cascadeDelete: true)
.Index(t => t.maintenance);
CreateTable(
"dbo.session",
c => new
{
id = c.Int(nullable: false, identity: true),
token = c.String(unicode: false),
machine_user_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.machine_user", t => t.machine_user_id, cascadeDelete: true)
.Index(t => t.machine_user_id);
}
public override void Down()
{
DropForeignKey("dbo.session", "machine_user_id", "dbo.machine_user");
DropForeignKey("dbo.performed_maintenance", "maintenance", "dbo.maintenance");
DropForeignKey("dbo.maintenance_note", "user_id", "dbo.user");
DropForeignKey("dbo.maintenance_note", "maintenance_id", "dbo.maintenance");
DropForeignKey("dbo.maintenance_file", "user_id", "dbo.user");
DropForeignKey("dbo.maintenance_file", "maintenance_id", "dbo.maintenance");
DropForeignKey("dbo.maintenance", "user_id", "dbo.user");
DropForeignKey("dbo.machine_user", "user_id", "dbo.user");
DropForeignKey("dbo.machine_user", "role_id", "dbo.role");
DropForeignKey("dbo.machine_user", "machine_id", "dbo.machine");
DropIndex("dbo.session", new[] { "machine_user_id" });
DropIndex("dbo.performed_maintenance", new[] { "maintenance" });
DropIndex("dbo.maintenance_note", new[] { "maintenance_id" });
DropIndex("dbo.maintenance_note", new[] { "user_id" });
DropIndex("dbo.maintenance", new[] { "user_id" });
DropIndex("dbo.maintenance_file", new[] { "user_id" });
DropIndex("dbo.maintenance_file", new[] { "maintenance_id" });
DropIndex("dbo.machine_user", new[] { "role_id" });
DropIndex("dbo.machine_user", "unique_machine_user");
DropTable("dbo.session");
DropTable("dbo.performed_maintenance");
DropTable("dbo.maintenance_note");
DropTable("dbo.maintenance");
DropTable("dbo.maintenance_file");
DropTable("dbo.user");
DropTable("dbo.role");
DropTable("dbo.machine_user");
DropTable("dbo.machine");
DropTable("dbo.function_access");
DropTable("dbo.favorite_user_softkey");
}
}
}
File diff suppressed because one or more lines are too long
@@ -1,29 +0,0 @@
// <auto-generated />
namespace Thermo.Active.Database.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class InitMigration : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(InitMigration));
string IMigrationMetadata.Id
{
get { return "201810100646276_InitMigration"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -1,340 +0,0 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class InitMigration : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.alarm_description",
c => new
{
id = c.Int(nullable: false, identity: true),
title = c.String(unicode: false),
description = c.String(unicode: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.alarm_occurrence",
c => new
{
id = c.Int(nullable: false, identity: true),
alarm_id = c.Int(),
source = c.Int(nullable: false),
type = c.Int(nullable: false),
processes = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.alarm_description", t => t.alarm_id)
.Index(t => t.alarm_id);
CreateTable(
"dbo.alarm_user",
c => new
{
user_id = c.Int(nullable: false),
alarm_occurence_id = c.Int(nullable: false),
})
.PrimaryKey(t => new { t.user_id, t.alarm_occurence_id })
.ForeignKey("dbo.alarm_occurrence", t => t.alarm_occurence_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => t.user_id)
.Index(t => t.alarm_occurence_id);
CreateTable(
"dbo.user",
c => new
{
id = c.Int(nullable: false, identity: true),
username = c.String(nullable: false, unicode: false),
first_name = c.String(unicode: false),
last_name = c.String(unicode: false),
password = c.String(unicode: false),
security_stamp = c.String(unicode: false),
language = c.String(unicode: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.family",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
type = c.Byte(nullable: false),
right_size = c.Byte(nullable: false),
left_size = c.Byte(nullable: false),
tcp_table = c.Byte(nullable: false),
gamma = c.Byte(nullable: false),
rotation_type = c.Byte(nullable: false),
cooling_byte = c.Byte(nullable: false),
max_speed = c.Int(nullable: false),
max_load = c.Byte(nullable: false),
min_load_pct_autoload = c.Byte(nullable: false),
max_load_pct_autoload = c.Byte(nullable: false),
dynamic_compensation = c.Byte(nullable: false),
min_load_dynamic_comp = c.Byte(nullable: false),
max_load_dynamic_comp = c.Byte(nullable: false),
life_type = c.Byte(nullable: false),
nominal_life = c.Int(nullable: false),
revive_delta = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.tool",
c => new
{
id = c.Int(nullable: false, identity: true),
offset_length = c.Int(nullable: false),
residual_life = c.Int(nullable: false),
residual_revive = c.Int(nullable: false),
status = c.Byte(nullable: false),
family_id = c.Int(nullable: false),
shank_id = c.Int(),
offsetId1 = c.Int(),
offsetId2 = c.Int(),
offsetId3 = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.family", t => t.family_id, cascadeDelete: true)
.ForeignKey("dbo.shank", t => t.shank_id)
.Index(t => t.family_id)
.Index(t => t.shank_id);
CreateTable(
"dbo.shank",
c => new
{
magazine_id = c.Byte(),
position_id = c.Byte(),
id = c.Int(nullable: false, identity: true),
balluf = c.Int(),
magazine_position_type = c.Byte(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.magazine_position", t => new { t.magazine_id, t.position_id })
.Index(t => new { t.magazine_id, t.position_id });
CreateTable(
"dbo.magazine_position",
c => new
{
magazine_id = c.Byte(nullable: false),
position_id = c.Byte(nullable: false),
type = c.Byte(nullable: false),
disabled = c.Boolean(nullable: false),
})
.PrimaryKey(t => new { t.magazine_id, t.position_id });
CreateTable(
"dbo.favorite_user_softkey",
c => new
{
user_softkey_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
})
.PrimaryKey(t => new { t.user_softkey_id, t.user_id });
CreateTable(
"dbo.function_access",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
write_level_min = c.Int(nullable: false),
read_level_min = c.Int(nullable: false),
area = c.String(unicode: false),
enabled = c.Boolean(nullable: false),
plc_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.machine",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
unique_id = c.String(unicode: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.machine_user",
c => new
{
id = c.Int(nullable: false, identity: true),
machine_id = c.Int(nullable: false),
user_id = c.Int(nullable: false),
role_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.machine", t => t.machine_id, cascadeDelete: true)
.ForeignKey("dbo.role", t => t.role_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => new { t.machine_id, t.user_id }, unique: true, clustered: true, name: "unique_machine_user")
.Index(t => t.role_id);
CreateTable(
"dbo.role",
c => new
{
id = c.Int(nullable: false, identity: true),
name = c.String(unicode: false),
level = c.Int(nullable: false),
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.maintenance_file",
c => new
{
id = c.Int(nullable: false, identity: true),
file_name = c.String(unicode: false),
local_file_name = c.String(unicode: false),
maintenance_id = c.Int(nullable: false),
user_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.maintenance_id)
.Index(t => t.user_id);
CreateTable(
"dbo.maintenance",
c => new
{
id = c.Int(nullable: false),
intervall = c.Double(),
deadline = c.DateTime(nullable: false, precision: 0),
type = c.Int(nullable: false),
counter_id = c.Int(nullable: false),
title = c.String(unicode: false),
description = c.String(unicode: false),
unit_of_measure = c.Int(),
creation_date = c.DateTime(nullable: false, precision: 0),
last_expiration_date = c.DateTime(precision: 0),
user_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.user", t => t.user_id)
.Index(t => t.user_id);
CreateTable(
"dbo.maintenance_note",
c => new
{
id = c.Int(nullable: false, identity: true),
message = c.String(unicode: false),
user_id = c.Int(nullable: false),
maintenance_id = c.Int(nullable: false),
timestamp = c.DateTime(nullable: false, precision: 0),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance_id, cascadeDelete: true)
.ForeignKey("dbo.user", t => t.user_id, cascadeDelete: true)
.Index(t => t.user_id)
.Index(t => t.maintenance_id);
CreateTable(
"dbo.performed_maintenance",
c => new
{
id = c.Int(nullable: false, identity: true),
date = c.DateTime(nullable: false, precision: 0),
counter_value = c.Int(nullable: false),
maintenance = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.maintenance", t => t.maintenance, cascadeDelete: true)
.Index(t => t.maintenance);
CreateTable(
"dbo.queue",
c => new
{
id = c.Int(nullable: false),
process = c.Int(nullable: false),
part_program_name = c.String(unicode: false),
reps = c.Int(nullable: false),
remaining_reps = c.Int(nullable: false),
absolute_path = c.String(unicode: false),
status = c.Int(nullable: false),
})
.PrimaryKey(t => new { t.id, t.process });
CreateTable(
"dbo.session",
c => new
{
id = c.Int(nullable: false, identity: true),
token = c.String(unicode: false),
machine_user_id = c.Int(nullable: false),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.machine_user", t => t.machine_user_id, cascadeDelete: true)
.Index(t => t.machine_user_id);
}
public override void Down()
{
DropForeignKey("dbo.session", "machine_user_id", "dbo.machine_user");
DropForeignKey("dbo.performed_maintenance", "maintenance", "dbo.maintenance");
DropForeignKey("dbo.maintenance_note", "user_id", "dbo.user");
DropForeignKey("dbo.maintenance_note", "maintenance_id", "dbo.maintenance");
DropForeignKey("dbo.maintenance_file", "user_id", "dbo.user");
DropForeignKey("dbo.maintenance_file", "maintenance_id", "dbo.maintenance");
DropForeignKey("dbo.maintenance", "user_id", "dbo.user");
DropForeignKey("dbo.machine_user", "user_id", "dbo.user");
DropForeignKey("dbo.machine_user", "role_id", "dbo.role");
DropForeignKey("dbo.machine_user", "machine_id", "dbo.machine");
DropForeignKey("dbo.tool", "shank_id", "dbo.shank");
DropForeignKey("dbo.shank", new[] { "magazine_id", "position_id" }, "dbo.magazine_position");
DropForeignKey("dbo.tool", "family_id", "dbo.family");
DropForeignKey("dbo.alarm_user", "user_id", "dbo.user");
DropForeignKey("dbo.alarm_user", "alarm_occurence_id", "dbo.alarm_occurrence");
DropForeignKey("dbo.alarm_occurrence", "alarm_id", "dbo.alarm_description");
DropIndex("dbo.session", new[] { "machine_user_id" });
DropIndex("dbo.performed_maintenance", new[] { "maintenance" });
DropIndex("dbo.maintenance_note", new[] { "maintenance_id" });
DropIndex("dbo.maintenance_note", new[] { "user_id" });
DropIndex("dbo.maintenance", new[] { "user_id" });
DropIndex("dbo.maintenance_file", new[] { "user_id" });
DropIndex("dbo.maintenance_file", new[] { "maintenance_id" });
DropIndex("dbo.machine_user", new[] { "role_id" });
DropIndex("dbo.machine_user", "unique_machine_user");
DropIndex("dbo.shank", new[] { "magazine_id", "position_id" });
DropIndex("dbo.tool", new[] { "shank_id" });
DropIndex("dbo.tool", new[] { "family_id" });
DropIndex("dbo.alarm_user", new[] { "alarm_occurence_id" });
DropIndex("dbo.alarm_user", new[] { "user_id" });
DropIndex("dbo.alarm_occurrence", new[] { "alarm_id" });
DropTable("dbo.session");
DropTable("dbo.queue");
DropTable("dbo.performed_maintenance");
DropTable("dbo.maintenance_note");
DropTable("dbo.maintenance");
DropTable("dbo.maintenance_file");
DropTable("dbo.role");
DropTable("dbo.machine_user");
DropTable("dbo.machine");
DropTable("dbo.function_access");
DropTable("dbo.favorite_user_softkey");
DropTable("dbo.magazine_position");
DropTable("dbo.shank");
DropTable("dbo.tool");
DropTable("dbo.family");
DropTable("dbo.user");
DropTable("dbo.alarm_user");
DropTable("dbo.alarm_occurrence");
DropTable("dbo.alarm_description");
}
}
}
File diff suppressed because one or more lines are too long
@@ -1,29 +0,0 @@
// <auto-generated />
namespace Thermo.Active.Database.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class InitMigration : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(InitMigration));
string IMigrationMetadata.Id
{
get { return "201902121508312_InitMigration"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
File diff suppressed because one or more lines are too long
@@ -1,18 +0,0 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class InitMigrtion : DbMigration
{
public override void Up()
{
AddColumn("dbo.performed_maintenance", "control_word", c => c.Int(nullable: false));
}
public override void Down()
{
DropColumn("dbo.performed_maintenance", "control_word");
}
}
}
File diff suppressed because one or more lines are too long
@@ -1,29 +0,0 @@
// <auto-generated />
namespace Thermo.Active.Database.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class UserDeleteMigratin : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(UserDeleteMigratin));
string IMigrationMetadata.Id
{
get { return "201904041054202_UserDeleteMigratin"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -1,18 +0,0 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class UserDeleteMigratin : DbMigration
{
public override void Up()
{
AddColumn("dbo.user", "deleted", c => c.Boolean(nullable: false));
}
public override void Down()
{
DropColumn("dbo.user", "deleted");
}
}
}
File diff suppressed because one or more lines are too long
@@ -7,13 +7,13 @@ namespace Thermo.Active.Database.Migrations
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
public sealed partial class InitMigrtion : IMigrationMetadata
public sealed partial class ThermoStart : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(InitMigrtion));
private readonly ResourceManager Resources = new ResourceManager(typeof(ThermoStart));
string IMigrationMetadata.Id
{
get { return "201903070940012_InitMigrtion"; }
get { return "202004241109233_Thermo-Start"; }
}
string IMigrationMetadata.Source
@@ -3,7 +3,7 @@ namespace Thermo.Active.Database.Migrations
using System;
using System.Data.Entity.Migrations;
public partial class InitMigration : DbMigration
public partial class ThermoStart : DbMigration
{
public override void Up()
{
@@ -42,6 +42,7 @@ namespace Thermo.Active.Database.Migrations
password = c.String(unicode: false),
security_stamp = c.String(unicode: false),
language = c.String(unicode: false),
deleted = c.Boolean(nullable: false),
})
.PrimaryKey(t => t.id);
@@ -95,7 +96,6 @@ namespace Thermo.Active.Database.Migrations
{
id = c.Short(nullable: false),
name = c.String(unicode: false),
type = c.Byte(nullable: false),
right_size = c.Byte(nullable: false),
left_size = c.Byte(nullable: false),
tcp_table = c.Byte(nullable: false),
@@ -115,54 +115,6 @@ namespace Thermo.Active.Database.Migrations
})
.PrimaryKey(t => t.id);
CreateTable(
"dbo.tool",
c => new
{
id = c.Short(nullable: false),
offset_length = c.Short(nullable: false),
residual_life = c.Int(nullable: false),
residual_revive = c.Int(nullable: false),
status = c.Byte(nullable: false),
family_id = c.Short(nullable: false),
shank_id = c.Short(),
offsetId1 = c.Short(),
offsetId2 = c.Short(),
offsetId3 = c.Short(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.family", t => t.family_id, cascadeDelete: true)
.ForeignKey("dbo.shank", t => t.shank_id)
.Index(t => t.family_id)
.Index(t => t.shank_id);
CreateTable(
"dbo.shank",
c => new
{
magazine_id = c.Byte(),
position_id = c.Int(),
id = c.Short(nullable: false),
balluf = c.Int(),
magazine_position_type = c.Byte(nullable: false),
origin_magazine_id = c.Byte(),
origin_position_id = c.Int(),
})
.PrimaryKey(t => t.id)
.ForeignKey("dbo.magazine_position", t => new { t.magazine_id, t.position_id })
.Index(t => new { t.magazine_id, t.position_id });
CreateTable(
"dbo.magazine_position",
c => new
{
magazine_id = c.Byte(nullable: false),
position_id = c.Int(nullable: false),
type = c.Byte(nullable: false),
disabled = c.Boolean(nullable: false),
})
.PrimaryKey(t => new { t.magazine_id, t.position_id });
CreateTable(
"dbo.favorite_user_softkey",
c => new
@@ -281,6 +233,7 @@ namespace Thermo.Active.Database.Migrations
id = c.Int(nullable: false, identity: true),
date = c.DateTime(nullable: false, precision: 0),
counter_value = c.Int(nullable: false),
control_word = c.Int(nullable: false),
maintenance = c.Int(nullable: false),
maintainers_id = c.Int(),
})
@@ -332,9 +285,6 @@ namespace Thermo.Active.Database.Migrations
DropForeignKey("dbo.machine_user", "user_id", "dbo.user");
DropForeignKey("dbo.machine_user", "role_id", "dbo.role");
DropForeignKey("dbo.machine_user", "machine_id", "dbo.machine");
DropForeignKey("dbo.tool", "shank_id", "dbo.shank");
DropForeignKey("dbo.shank", new[] { "magazine_id", "position_id" }, "dbo.magazine_position");
DropForeignKey("dbo.tool", "family_id", "dbo.family");
DropForeignKey("dbo.alarm_note", "user_id", "dbo.user");
DropForeignKey("dbo.alarm_user", "user_id", "dbo.user");
DropForeignKey("dbo.alarm_user", "alarm_occurence_id", "dbo.alarm_occurrence");
@@ -350,9 +300,6 @@ namespace Thermo.Active.Database.Migrations
DropIndex("dbo.maintenance_file", new[] { "maintenance_id" });
DropIndex("dbo.machine_user", new[] { "role_id" });
DropIndex("dbo.machine_user", "unique_machine_user");
DropIndex("dbo.shank", new[] { "magazine_id", "position_id" });
DropIndex("dbo.tool", new[] { "shank_id" });
DropIndex("dbo.tool", new[] { "family_id" });
DropIndex("dbo.alarm_note", new[] { "user_id" });
DropIndex("dbo.alarm_user", new[] { "alarm_occurence_id" });
DropIndex("dbo.alarm_user", new[] { "user_id" });
@@ -369,9 +316,6 @@ namespace Thermo.Active.Database.Migrations
DropTable("dbo.machine");
DropTable("dbo.function_access");
DropTable("dbo.favorite_user_softkey");
DropTable("dbo.magazine_position");
DropTable("dbo.shank");
DropTable("dbo.tool");
DropTable("dbo.family");
DropTable("dbo.alarm_note");
DropTable("dbo.alarm_user");
File diff suppressed because one or more lines are too long
@@ -1,21 +1,24 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity;
using System.Linq;
using Thermo.Active.Model.DatabaseModels;
using System.Data.Entity.Migrations;
using static Thermo.Active.Model.Constants.FUNCTIONALITY_NAMES;
using static Thermo.Active.Model.Constants.AREAS;
using static Thermo.Active.Model.Constants;
public sealed class Configuration : DbMigrationsConfiguration<DatabaseContext>
internal sealed class Configuration : DbMigrationsConfiguration<Thermo.Active.Database.DatabaseContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
AutomaticMigrationDataLossAllowed = true;
ContextKey = "Step.Database.DatabaseContext";
ContextKey = "Thermo.Active.Database.DatabaseContext";
}
protected override void Seed(DatabaseContext context)
protected override void Seed(Thermo.Active.Database.DatabaseContext context)
{
// This method will be called after migrating to the latest version. 0-99 Customer. 100 - 199 CMS
context.Roles.AddOrUpdate(
@@ -26,32 +29,27 @@ namespace Thermo.Active.Database.Migrations
new RoleModel() { RoleId = (int)ROLE_IDS.CUSTOMER_OPERATOR, Level = 20, Name = "Operator" },
new RoleModel() { RoleId = (int)ROLE_IDS.CUSTOMER_MAINTAINER, Level = 10, Name = "Maintainer" }
);
context.FunctionsAccess.AddOrUpdate(
// General Function, if plcId is 0 then the functionality is not connected to the NC
new FunctionAccessModel() { Name = GENERAL, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0},
new FunctionAccessModel() { Name = USER_FUNCTIONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0},
new FunctionAccessModel() { Name = NC_DATA, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0},
new FunctionAccessModel() { Name = ALARM_CMD, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 1},
new FunctionAccessModel() { Name = STARTUP_ICONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 2},
new FunctionAccessModel() { Name = GENERAL, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0 },
new FunctionAccessModel() { Name = USER_FUNCTIONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0 },
new FunctionAccessModel() { Name = NC_DATA, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0 },
new FunctionAccessModel() { Name = ALARM_CMD, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 1 },
new FunctionAccessModel() { Name = STARTUP_ICONS, Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 2 },
// Under hood
new FunctionAccessModel() { Name = PROCESS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 3},
new FunctionAccessModel() { Name = NC_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 4},
new FunctionAccessModel() { Name = USER_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 5},
new FunctionAccessModel() { Name = HEADS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 6},
new FunctionAccessModel() { Name = AXES_SELECTION, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 7},
#if false
new FunctionAccessModel() { Name = TOOL_MANAGER, Area = TOOLING_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 8 },
#endif
new FunctionAccessModel() { Name = MAINTENANCE, Area = MAINTENANCE_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 9},
new FunctionAccessModel() { Name = PROCESS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 3 },
new FunctionAccessModel() { Name = NC_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 4 },
new FunctionAccessModel() { Name = USER_SOFTKEY, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 5 },
new FunctionAccessModel() { Name = HEADS_CMD, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 6 },
new FunctionAccessModel() { Name = AXES_SELECTION, Area = UNDER_HOOD, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 7 },
new FunctionAccessModel() { Name = MAINTENANCE, Area = MAINTENANCE_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 9 },
// Main Areas
// Main Areas
new FunctionAccessModel() { Name = "productionArea", Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 20, ReadLevelMin = 1, PlcId = 0 },
new FunctionAccessModel() { Name = "toolingArea", Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 20, ReadLevelMin = 1, PlcId = 0 },
new FunctionAccessModel() { Name = "reportArea", Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 30, ReadLevelMin = 1, PlcId = 0 },
new FunctionAccessModel() { Name = "alarmsArea", Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0 },
new FunctionAccessModel() { Name = "maintenanceArea", Area = GENERAL_KEY, Enabled = true, WriteLevelMin = 1, ReadLevelMin = 1, PlcId = 0 },
@@ -64,4 +62,4 @@ namespace Thermo.Active.Database.Migrations
context.SaveChanges();
}
}
}
}
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("Step.Database")]
[assembly: AssemblyTitle("Thermo.Active.Database")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Step.Database")]
[assembly: AssemblyProduct("Thermo.Active.Database")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -34,7 +34,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CMS_CORE_Library">
<Reference Include="CMS_CORE_Library, Version=1.1.1.0, Culture=neutral, processorArchitecture=AMD64">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Libs\CMS_CORE_Library.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
@@ -121,17 +122,9 @@
<Compile Include="Controllers\MachinesUsersController.cs" />
<Compile Include="Controllers\UserSoftkeysController.cs" />
<Compile Include="DatabaseContext.cs" />
<Compile Include="Migrations\201902121508312_InitMigration.cs" />
<Compile Include="Migrations\201902121508312_InitMigration.Designer.cs">
<DependentUpon>201902121508312_InitMigration.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201903070940012_InitMigrtion.cs" />
<Compile Include="Migrations\201903070940012_InitMigrtion.Designer.cs">
<DependentUpon>201903070940012_InitMigrtion.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201904041054202_UserDeleteMigratin.cs" />
<Compile Include="Migrations\201904041054202_UserDeleteMigratin.Designer.cs">
<DependentUpon>201904041054202_UserDeleteMigratin.cs</DependentUpon>
<Compile Include="Migrations\202004241109233_Thermo-Start.cs" />
<Compile Include="Migrations\202004241109233_Thermo-Start.Designer.cs">
<DependentUpon>202004241109233_Thermo-Start.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -169,16 +162,9 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Migrations\201902121508312_InitMigration.resx">
<DependentUpon>201902121508312_InitMigration.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201903070940012_InitMigrtion.resx">
<DependentUpon>201903070940012_InitMigrtion.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201904041054202_UserDeleteMigratin.resx">
<DependentUpon>201904041054202_UserDeleteMigratin.cs</DependentUpon>
<EmbeddedResource Include="Migrations\202004241109233_Thermo-Start.resx">
<DependentUpon>202004241109233_Thermo-Start.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
@@ -0,0 +1,16 @@
using System.Collections.Generic;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model.ConfigModels
{
public class RecipeConfigModel
{
public int Id;
public TACT_PARAM_TYPE Category { get; set; }
public string SubCategory_1 { get; set; }
public string SubCategory_2 { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Format { get; set; }
}
}
+43 -17
View File
@@ -5,7 +5,7 @@ namespace Thermo.Active.Model
{
public static class Constants
{
public static bool IS_BETA = false;
public static bool IS_BETA = false;
public static string NOT_FOUND_ALARM_MESSAGE = "Alarm_id_{0} : Message not found";
public static string NOT_CONFIGURATED_ALARM_MESSAGE = "Alarm_id_{0} : Message not configurated";
public static string CMS_CONNECT_SETUP_ALARM_MESSAGE = "Error during CMS-Connect setup: Redis Db Not Found";
@@ -20,7 +20,7 @@ namespace Thermo.Active.Model
public enum SCADA_ELEMENT_TYPE
{
BUTTON = 0,
IMAGE = 1,
IMAGE = 1,
INPUT = 2,
PROGRESS_BAR = 3,
LABEL = 4,
@@ -32,12 +32,12 @@ namespace Thermo.Active.Model
public static string READ = "read";
public static string WRITE = "write";
}
public const int MIN_CMS_ROLE = 100;
public const int MIN_ADMIN_ROLE = 30;
public enum ROLE_IDS
{
{
CMS_SERVICE = 1,
CMS_UT = 2,
CUSTOMER_ADMIN = 3,
@@ -74,6 +74,22 @@ namespace Thermo.Active.Model
LASER = 3
}
public enum TACT_PARAM_TYPE
{
ND = 0,
General,
Positions,
Cycle,
Heats,
Pyrometer,
Drawing,
UpperPlate,
Cooling,
Vacuum,
Extraction,
Options
}
public enum MAINTENANCE_UNIT_OF_MEASURE
{
mm = 0,
@@ -118,13 +134,14 @@ namespace Thermo.Active.Model
public const string FANUC = "FANUC";
public const string SIEMENS = "SIEMENS";
public const string OSAI = "OSAI";
public const string S7NET = "S7NET";
}
// Database config
public const string DATABASE_USER = "root";
public const string DATABASE_PWD = "root";
public const string DATABASE_NAME = "step";
public const string DATABASE_NAME = "ThermoActive";
// Registry key
public const string REGISTER_MACHINE_ID_KEY_NAME = "MachineUniqueId";
@@ -144,7 +161,7 @@ namespace Thermo.Active.Model
public const string PROD_SFT_CONFIG_KEY = "softwareProdConfig";
public const string AREAS_CONFIG_KEY = "areasConfig";
// Step Areas
// Active Areas
public class AREAS
{
public const string PRODUCTION_KEY = "production";
@@ -165,7 +182,7 @@ namespace Thermo.Active.Model
public static readonly string BASE_PATH = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
#if DEBUG
public static readonly string CLIENT_PATH_64 = BASE_PATH + @"\Client_Debug\x64\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_64 = BASE_PATH + @"\Client_Debug\x64\" + CLIENT_EXE_NAME;
public static readonly string CLIENT_PATH_86 = BASE_PATH + @"\Client_Debug\x84\" + CLIENT_EXE_NAME;
public static string WEBSITE_DIRECTORY = Path.Combine(BASE_PATH, "..", "wwwroot");
#else
@@ -174,14 +191,14 @@ namespace Thermo.Active.Model
public static string WEBSITE_DIRECTORY = BASE_PATH + "\\view";
#endif
public const string CONFIG_DIRECTORY = "Config\\";
public const string RESOURCE_DIRECTORY = @"Step.Config.Config.";
public const string RESOURCE_DIRECTORY = @"Thermo.Active.Config.Config.";
public const string SERVER_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + @"serverConfigValidator.xsd";
public const string SERVER_CONFIG_PATH = CONFIG_DIRECTORY + "serverConfig.xml";
public const string AREAS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "areasConfigValidator.xsd";
public const string AREAS_CONFIG_PATH = CONFIG_DIRECTORY + "areasConfig.xml";
public const string MAINTENANCES_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "maintenancesConfigValidator.xsd";
public const string MAINTENANCES_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "maintenancesConfigValidator.xsd";
public const string CUSTOMER_CONTACTS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "customerContactConfigValidator.xsd";
public const string MAINTENANCES_CONFIG_PATH = CONFIG_DIRECTORY + "maintenancesConfig.xml";
public const string CUSTOMER_CONTACTS = CMS_FOLDER_PATH + "ContactInfo.xml";
@@ -189,13 +206,16 @@ namespace Thermo.Active.Model
public const string USER_SOFTKEYS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "userSoftKeyConfigValidator.xsd";
public const string USER_SOFTKEYS_CONFIG_PATH = CONFIG_DIRECTORY + "userSoftKeyConfig.xml";
public const string ALARMS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "alarmsConfigValidator.xsd";
public const string ALARMS_CONFIG_PATH = CONFIG_DIRECTORY + "alarmsConfig.xml";
public const string HEADS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "headsConfigValidator.xsd";
public const string HEADS_CONFIG_PATH = CONFIG_DIRECTORY + "headsConfig.xml";
public const string RECIPE_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "recipeConfigValidator.xsd";
public const string RECIPE_CONFIG_PATH = CONFIG_DIRECTORY + "recipeConfig.xml";
public const string NC_SOFTKEYS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "ncSoftKeyConfigValidator.xsd";
public const string NC_SOFTKEYS_CONFIG_PATH = CONFIG_DIRECTORY + "ncSoftKeyConfig.xml";
@@ -243,7 +263,13 @@ namespace Thermo.Active.Model
public const string SEND_QUEUE_DATA = "SEND_QUEUE_DATA";
public const string SEND_M155_DATA = "SEND_M155_DATA";
public const string SEND_SCADA_DATA = "SEND_SCADA_DATA";
public const string SEND_RECIPE_STATUS = "SEND_RECIPE_STATUS";
// MVVM Messages for Thermo active specs
public const string SEND_THERMO_RECIPE_FULL = "SEND_THERMO_RECIPE_FULL";
public const string SEND_THERMO_RECIPE_OVERWIEW = "SEND_THERMO_RECIPE_OVERWIEW";
public const string SEND_THERMO_MODULE_DATA = "SEND_THERMO_MODULE_DATA";
public const string SEND_THERMO_WARMERS_DATA = "SEND_THERMO_WARMERS_DATA";
public const string SEND_THERMO_GAUGE_DATA = "SEND_THERMO_GAUGE_DATA";
public const string BROADCAST_DATA = "BROADCAST_DATA";
@@ -280,22 +306,22 @@ namespace Thermo.Active.Model
public const string PASSWORD_IS_INVALID = "error_password_is_invalid";
public const string IMPORT_FILE_NOT_VALID = "error_import_file_not_valid";
public const string DUPLICATED_USERNAME = "error_duplicated_username";
public const string CUSTOMER_FILE_INVALID = "contactinfo_error_customer_configfile";
public const string CUSTOMER_FILE_INVALID = "contactinfo_error_customer_configfile";
}
// File paths
public const string CLIENT_EXE_NAME = @"Active_Client.exe";
public const string CLIENT_EXE_NAME_NOEXT = @"Active_Client";
public const string CLIENT_EXE_NAME_NOEXT = @"Active_Client";
public const string MAINTENANCE_ATTACHMENT_PATH = @"C:\CMS\Active\attachment\maintenance\";
public const string CMS_FOLDER_PATH = @"C:\CMS\";
public const string ALARM_ATTACHMENT_PATH = @"C:\CMS\Active\attachment\alarm\";
public const string TEMP_FOLDER = @"C:\CMS\Active\TMP\";
public const string TEMP_PP_FOLDER = TEMP_FOLDER + @"pp\";
public const string JOB_TMP_DIRECTORY = TEMP_PP_FOLDER + @"job\";
public const string JOB_TMP_DIRECTORY = TEMP_PP_FOLDER + @"job\";
public const string QUEUE_TMP_FOLDER = TEMP_PP_FOLDER + @"queue\";
public const string PART_PRG_IMAGES = TEMP_FOLDER + @"pp_img\";
public const string PART_PRG_IMAGES = TEMP_FOLDER + @"pp_img\";
public const string SCADA_DIRECTORY = @"C:\CMS\Active\scada\";
public static readonly string[] VALID_FILE_EXTENSIONS = { "", ".txt", ".cnc", ".ini", ".mpf", ".spf" };
@@ -323,7 +349,7 @@ namespace Thermo.Active.Model
"dd/MM/yyyy",
"MM/dd/yyyy",
"dd.MM.yyyy",
"MM.dd.yyyy"
"MM.dd.yyyy"
};
}
}
@@ -0,0 +1,33 @@
using CMS_CORE_Library.Models;
using System.Linq;
using static CMS_CORE_Library.Models.DataStructures;
using static CMS_CORE_Library.Models.ThermoModels;
namespace Thermo.Active.Model.DTOModels
{
public class DTOGaugeDataModel : GaugeModel
{
public override bool Equals(object obj)
{
if (!(obj is DTOGaugeDataModel item))
return false;
if (TimeAdv != item.TimeAdv)
return false;
if (Power != item.Power)
return false;
if (Vacuum != item.Vacuum)
return false;
if (Air != item.Air)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
}
@@ -0,0 +1,17 @@
using System.Collections.Generic;
using Thermo.Active.Model.ConfigModels;
namespace Thermo.Active.Model.DTOModels.Recipe
{
public class DTORecipeConfigModel
{
public int Id;
public string Category;
public string SubCategory_1;
public string SubCategory_2;
public string Name;
public string Description;
public string Format;
public string Label;
}
}
@@ -0,0 +1,19 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels.Recipe
{
[JsonConverter(typeof(StringEnumConverter))]
public enum RecipeCatStatus
{
Unchanged = 0,
ChangedOk,
HasError
}
}
@@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels.Recipe
{
public class DTORecipeParam
{
public int Id { get; set; } = 0;
public double SetpointHMI { get; set; } = 0;
public double SetpointPLC { get; set; } = 0;
public RPRange Range { get; set; }
public RPStatus Status { get; set; }
public string UnitMeasure { get; set; }
public double ValueAct { get; set; }
public override bool Equals(object obj)
{
if (!(obj is DTORecipeParam item))
return false;
if (Id!= item.Id)
return false;
if (SetpointHMI != item.SetpointHMI)
return false;
if (SetpointPLC != item.SetpointPLC)
return false;
if (!Range.Equals(item.Range))
return false;
if (!Status.Equals(item.Status))
return false;
if (UnitMeasure != item.UnitMeasure)
return false;
if (ValueAct != item.ValueAct)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
public struct RPRange
{
public double Min { get; set; }
public double Max { get; set; }
public override bool Equals(object obj)
{
if (!(obj is RPRange item))
return false;
if (Min != item.Min)
return false;
if (Max != item.Max)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
public struct RPStatus
{
public bool Visible { get; set; }
public bool Enabled { get; set; }
public bool HasError { get; set; }
public override bool Equals(object obj)
{
if (!(obj is RPStatus item))
return false;
if (Visible != item.Visible)
return false;
if (Enabled != item.Enabled)
return false;
if (HasError != item.HasError)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
}
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels.Recipe
{
/// <summary>
/// Struttura parametri "lenti" (lettura NON frequente)
/// </summary>
public class RecipeParam
{
public int Id { get; set; }
public double SetpointHMI { get; set; }
public double SetpointPLC { get; set; }
public double ValueMax { get; set; }
public double ValueMin { get; set; }
public string UnitMeasure { get; set; }
}
}
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Thermo.Active.Model.DTOModels.Recipe
{
/// <summary>
/// Struttura parametri "veloci" (RT=RealTime, lettura frequente)
/// </summary>
public class RecipeParamRT
{
public short Id { get; set; }
public short StatusBit { get; set; }
public double ValueAct { get; set; }
}
[Flags]
public enum StatusVal
{
None = 0x0,
Visible = 0x1,
Enabled = 0x2,
HasError = 0x4
}
}
@@ -1,33 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using CMS_CORE_Library.Models;
namespace Thermo.Active.Model.DatabaseModels
{
[Table("magazine_position")]
public class DbNcMagazinePositionModel
{
[Key, Column("magazine_id", Order = 0)]
public byte MagazineId { get; set; }
[Key, Column("position_id", Order = 1)]
public int PositionId { get; set; }
[Column("type")]
public byte Type { get; set; }
[Column("disabled")]
public bool Disabled { get; set; }
public static explicit operator NcMagazinePositionModel(DbNcMagazinePositionModel obj)
{
return new NcMagazinePositionModel()
{
MagazineId = obj.MagazineId,
PositionId = (ushort)obj.PositionId,
Type = obj.Type
};
}
}
}
@@ -1,70 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
using CMS_CORE_Library.Models;
using Newtonsoft.Json;
namespace Thermo.Active.Model.DatabaseModels
{
[Table("shank")]
public class DbNcShankModel
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Column("id")]
public short ShankId { get; set; }
[Column("balluf")]
public int? Balluf { get; set; }
[Column("magazine_position_type")]
public byte MagazinePositionType { get; set; }
[ForeignKey("MagazinePosition"), Column("magazine_id", Order = 0)]
public byte? MagazineId { get; set; }
[ForeignKey("MagazinePosition"), Column("position_id", Order = 1)]
public int? PositionId { get; set; }
[Column("origin_magazine_id")]
public byte? OriginMagazineId { get; set; }
[Column("origin_position_id")]
public int? OriginPositionId { get; set; }
[JsonIgnore]
[IgnoreDataMember]
public DbNcMagazinePositionModel MagazinePosition { get; set; }
public static explicit operator NcShankModel(DbNcShankModel obj)
{
return new NcShankModel()
{
ShankId = (ushort)obj.ShankId,
Balluf = obj.Balluf == null ? (ushort)0 : (ushort)obj.Balluf.Value,
MagazineId = obj.MagazineId == null ? (byte)0 : obj.MagazineId.Value,
PositionId = obj.PositionId == null ? (ushort)0 : (ushort)obj.PositionId.Value,
MagazinePositionType = obj.MagazinePositionType,
OriginMagazineId = obj.OriginMagazineId == null ? (byte)0 : obj.OriginMagazineId.Value,
OriginPositionId = obj.OriginPositionId == null ? (ushort)0 : (ushort)obj.OriginPositionId.Value,
};
}
public static explicit operator DbNcShankModel(NcShankModel obj)
{
return new DbNcShankModel()
{
ShankId = (short)obj.ShankId,
Balluf = obj.Balluf == 0 ? null : (ushort?)obj.Balluf,
MagazineId = obj.MagazineId == 0 ? null : (byte?)obj.MagazineId,
PositionId = obj.PositionId == 0 ? null : (ushort?)obj.PositionId,
MagazinePositionType = obj.MagazinePositionType,
OriginMagazineId = obj.OriginMagazineId == 0 ? null : (byte?)obj.OriginMagazineId,
OriginPositionId = obj.OriginPositionId == 0 ? null : (ushort?)obj.OriginPositionId,
};
}
}
}
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Step.Model")]
[assembly: AssemblyTitle("Thermo.Active.Model")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Step.Model")]
[assembly: AssemblyProduct("Thermo.Active.Model")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
+13 -5
View File
@@ -33,9 +33,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CMS_CORE_Library">
<HintPath>..\Libs\CMS_CORE_Library.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
@@ -66,6 +63,7 @@
<Compile Include="ConfigModels\AlarmsConfigModel.cs" />
<Compile Include="ConfigModels\CmsConnectConfigModel.cs" />
<Compile Include="ConfigModels\ExtSoftwareModel.cs" />
<Compile Include="ConfigModels\RecipeConfigModel.cs" />
<Compile Include="ConfigModels\HeadsConfigModel.cs" />
<Compile Include="ConfigModels\MaintenanceConfigModel.cs" />
<Compile Include="ConfigModels\NcSoftKeysModel.cs" />
@@ -88,8 +86,6 @@
<Compile Include="DatabaseModels\MaintenanceModel.cs" />
<Compile Include="DatabaseModels\NcOffsetModel.cs" />
<Compile Include="DatabaseModels\NcFamilyModel.cs" />
<Compile Include="DatabaseModels\NcMagazinePositionModel.cs" />
<Compile Include="DatabaseModels\NcShankModel.cs" />
<Compile Include="DatabaseModels\PerformedMaintenanceModel.cs" />
<Compile Include="DatabaseModels\QueueItemsModel.cs" />
<Compile Include="DatabaseModels\RoleModel.cs">
@@ -99,12 +95,15 @@
<Compile Include="DatabaseModels\MachineUserModel.cs" />
<Compile Include="DatabaseModels\SessionModel.cs" />
<Compile Include="DTOModels\AlarmModels\DTONewAlarmNoteModel.cs" />
<Compile Include="DTOModels\DTOGaugeDataModel.cs" />
<Compile Include="DTOModels\DTOActiveProgramInfoModel.cs" />
<Compile Include="DTOModels\AlarmModels\DTOAlarmHistoricModel.cs" />
<Compile Include="DTOModels\AlarmModels\DTOAlarmsModel.cs" />
<Compile Include="DTOModels\DTOAxesModel.cs" />
<Compile Include="DTOModels\DTOAxisNameModel.cs" />
<Compile Include="DTOModels\DTOClientConfigurationModel.cs" />
<Compile Include="DTOModels\Recipe\DTORecipeParam.cs" />
<Compile Include="DTOModels\Recipe\DTORecipeConfigModel .cs" />
<Compile Include="DTOModels\DTONetworkMonitor.cs" />
<Compile Include="DTOModels\DTOCmsConnectGateway.cs" />
<Compile Include="DTOModels\JobModels\DTOGenericParamModel.cs" />
@@ -114,6 +113,9 @@
<Compile Include="DTOModels\DTOQueueModel.cs" />
<Compile Include="DTOModels\JobModels\DTOMetadataFieldsModel.cs" />
<Compile Include="DTOModels\JobModels\DTOMetadataModel.cs" />
<Compile Include="DTOModels\Recipe\DTORecipeOverview.cs" />
<Compile Include="DTOModels\Recipe\RecipeParamRT.cs" />
<Compile Include="DTOModels\Recipe\RecipeParam.cs" />
<Compile Include="DTOModels\Scada\DTOScadaModel.cs" />
<Compile Include="DTOModels\Scada\ScadaSchemaModel.cs" />
<Compile Include="DTOModels\MaintenanceModels\DTOExpiredMaintenanceModel.cs" />
@@ -154,6 +156,12 @@
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\cms_core_library\CMS_CORE_Library\CMS_CORE_Library.csproj">
<Project>{4abf8eef-2b23-483e-acdc-53214fe28681}</Project>
<Name>CMS_CORE_Library</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
+368 -47
View File
@@ -4,8 +4,9 @@ using CMS_CORE_Library.Fanuc;
using CMS_CORE_Library.Models;
using CMS_CORE_Library.Osai;
using CMS_CORE_Library.Siemens;
using CMS_CORE_Library.S7Net;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.AlarmModels;
using Thermo.Active.Model.DTOModels.MaintenanceModels;
@@ -21,12 +22,13 @@ using System.Text.RegularExpressions;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using Thermo.Active.Model.DTOModels.Recipe;
namespace Thermo.Active.NC
{
public class NcAdapter : IDisposable
{
public Nc numericalControl;
public NcThermo numericalControl;
public NcAdapter() =>
// Choose NC
@@ -52,22 +54,13 @@ namespace Thermo.Active.NC
return null;
}
public Nc SetNumericalControl()
public NcThermo SetNumericalControl()
{
// Return new Numerical control instance choosed from the configuration
switch (NcConfig.NcVendor)
{
case NC_VENDOR.DEMO:
return new Nc_Demo(NcConfig.NcIpAddress, NcConfig.NcPort);
case NC_VENDOR.FANUC:
return new Nc_Fanuc(NcConfig.NcIpAddress, NcConfig.NcPort, 2000);
case NC_VENDOR.SIEMENS:
return new Nc_Siemens(2000);
case NC_VENDOR.OSAI:
return new Nc_Osai(NcConfig.NcIpAddress, NcConfig.NcPort, 2000);
case NC_VENDOR.S7NET:
return new Nc_S7Net(NcConfig.NcIpAddress, NcConfig.NcPort, 2000);
}
return null;
@@ -116,7 +109,7 @@ namespace Thermo.Active.NC
return cmsError;
}
public CmsError GetAxesPositionsByProcess(ushort processNum, out DTOAxesModel axes)
public CmsError GetAxesPositionsByProcess(ushort processNum, out DTOAxesModel axes)
{
axes = new DTOAxesModel();
@@ -232,7 +225,7 @@ namespace Thermo.Active.NC
// Max process number
genericData.ProcessNumber = procNum;
// Get Installation Date
genericData.InstallationDate = DateTime.ParseExact(NcConfig.InstallationDate, DATE_FORMATS, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal);
genericData.InstallationDate = DateTime.ParseExact(NcConfig.InstallationDate, DATE_FORMATS, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal);
// Get PLC version
genericData.PlcVersion = "1.0.0";
// Get PLC version
@@ -241,8 +234,8 @@ namespace Thermo.Active.NC
return cmsError;
genericData.UnitOfMeasurement = tmpInfo;
// Get Server version
genericData.ServerVersion = SupportFunctions.GetSoftwareVersionAndBuildDate();
// Get Server version
genericData.ServerVersion = SupportFunctions.GetSoftwareVersionAndBuildDate();
return cmsError;
}
@@ -539,7 +532,7 @@ namespace Thermo.Active.NC
if (performed != null)
perfVal = performed.CounterValue;
counterValue = (uint) Math.Ceiling(SupportFunctions.ConvertInUmeas(counterVal, currMaintenance.UnitOfMeasure.Value));
counterValue = (uint)Math.Ceiling(SupportFunctions.ConvertInUmeas(counterVal, currMaintenance.UnitOfMeasure.Value));
// Calc percentage = PLC - PERFORMED VALUE * 100 / interval
percentage = ((counterVal - perfVal) * 100) / SupportFunctions.ConvertInMinutes(currMaintenance.Interval.Value, currMaintenance.UnitOfMeasure.Value);
@@ -601,7 +594,7 @@ namespace Thermo.Active.NC
}
}
if(performed != null && performed.ControlWord == -2)
if (performed != null && performed.ControlWord == -2)
{
performed = null;
}
@@ -864,12 +857,84 @@ namespace Thermo.Active.NC
Id = head.Id,
Process = head.Process,
Type = configuredHead.Type.ToString(),
FixedHead = configuredHead.FixedHead,
FixedHead = configuredHead.FixedHead,
inWarning = head.Load_Abrasive >= configuredHead.WarningLimit,
inAlarm = head.Load_Abrasive >= configuredHead.AlarmLimit,
inAlarm = head.Load_Abrasive >= configuredHead.AlarmLimit,
OverrideEditable = head.OverrideEditable,
ActualSpeed = head.ActualSpeed_Pressure,
Load = head.Load_Abrasive,
Load = head.Load_Abrasive,
Override = head.Override,
IsActive = head.IsActive,
IsSelected = head.IsSelected,
AbrasiveIsActive = head.AbrasiveIsActive,
Configured = head.Configured,
Rotation = head.Rotation,
WorkedTime = head.WorkedTime
});
}
break;
case HEAD_TYPE.WJ:
{
heads.Add(new DTOWaterJet()
{
Id = head.Id,
Process = head.Process,
Type = configuredHead.Type.ToString(),
FixedHead = configuredHead.FixedHead,
inAlarm = false,
inWarning = false,
ActualPressure = head.ActualSpeed_Pressure,
OverrideEditable = head.OverrideEditable,
Override = head.Override,
IsActive = head.IsActive,
IsSelected = head.IsSelected,
AbrasiveIsActive = head.AbrasiveIsActive,
WorkedTime = head.WorkedTime
});
}
break;
}
}
return cmsError;
}
// !!!FARE!!! è copia delle heads
public CmsError GetRecipeData(out List<DTOHeadModel> heads)
{
// Returned value
heads = new List<DTOHeadModel>();
// Number of configured heads
int headsNumber = HeadsConfig.Count;
List<HeadDataModel> plcHeads = new List<HeadDataModel>();
// Read value from PLC
CmsError cmsError = numericalControl.PLC_RHeadsData(plcHeads, headsNumber);
if (cmsError.IsError())
return cmsError;
foreach (var head in plcHeads)
{
// Get current head config
var configuredHead = HeadsConfig.Find(x => x.Id == head.Id);
// Create different model according on type
switch (configuredHead.Type)
{
case HEAD_TYPE.SPINDLE:
{
heads.Add(new DTOSpindleModel()
{
Id = head.Id,
Process = head.Process,
Type = configuredHead.Type.ToString(),
FixedHead = configuredHead.FixedHead,
inWarning = head.Load_Abrasive >= configuredHead.WarningLimit,
inAlarm = head.Load_Abrasive >= configuredHead.AlarmLimit,
OverrideEditable = head.OverrideEditable,
ActualSpeed = head.ActualSpeed_Pressure,
Load = head.Load_Abrasive,
Override = head.Override,
IsActive = head.IsActive,
IsSelected = head.IsSelected,
@@ -924,7 +989,7 @@ namespace Thermo.Active.NC
Process = x.Process,
Type = x.Type.ToString(),
Value = x.Value
}).ToList();
}).ToList();
return NO_ERROR;
}
@@ -964,9 +1029,9 @@ namespace Thermo.Active.NC
scadas.Add(scadaValue);
// Add id to read scada
alreadyReadScada.Add(schema.Id);
}
}
}
return cmsError;
}
@@ -990,6 +1055,154 @@ namespace Thermo.Active.NC
return NO_ERROR;
}
public CmsError ReadGaugeData(out ThermoModels.GaugeModel gaugeData)
{
gaugeData = new ThermoModels.GaugeModel();
CmsError cmsError = numericalControl.PLC_RGaugeData(ref gaugeData);
return cmsError;
}
/// <summary>
/// Vero metodo lettura ricetta da 2 aree memoria PLC
/// </summary>
/// <param name="refreshOnlyRT">Indica se aggiornare SOLO i dati RT</param>
/// <param name="useLastRead">Indica se usare ultimi dati letti dal PLC senza effettiva lettura (via cache)</param>
/// <param name="currentRecipe"></param>
/// <returns></returns>
public CmsError ReadRecipeData(bool refreshOnlyRT, bool useLastRead, out Dictionary<string, DTORecipeParam> currentRecipe)
{
// init obj
currentRecipe = new Dictionary<string, DTORecipeParam>();
RPRange currRange = new RPRange();
RPStatus currStatus = new RPStatus();
// solo x S7...
if (NcConfig.NcVendor == NC_VENDOR.S7NET)
{
Dictionary<int, DataStructures.RecipeParam> currPlcRecipe = new Dictionary<int, DataStructures.RecipeParam>();
CmsError cmsError = NO_ERROR;
if (useLastRead)
{
cmsError = numericalControl.PLC_RRecipeLastParamList(ref currPlcRecipe);
}
else
{
cmsError = numericalControl.PLC_RRecipeParamList(refreshOnlyRT, ref currPlcRecipe);
}
if (cmsError.IsError())
return cmsError;
DTORecipeParam currParam = new DTORecipeParam();
// leggo l'intero array delle DB... QUI FAKE sulle DB configurate...
List<DTORecipeConfigModel> recipeConfig = RecipeConfig.Select(x => new DTORecipeConfigModel()
{
Id = x.Id,
Category = x.Category.ToString(),
SubCategory_1 = x.SubCategory_1,
SubCategory_2 = x.SubCategory_2,
Name = x.Name,
Description = x.Description,
Format = x.Format,
Label = $"{x.Category}_{x.SubCategory_1}_{x.SubCategory_2}_{x.Name}".Replace("__", "_").Replace("__", "_").ToLower()
}).ToList();
foreach (var item in recipeConfig)
{
if (currPlcRecipe.ContainsKey(item.Id))
{
// recupero da mem PLC
DataStructures.RecipeParam paramPLC = currPlcRecipe[item.Id];
currRange = new RPRange()
{
Min = paramPLC.ValMin,
Max = paramPLC.ValMax
};
currStatus = new RPStatus()
{
Visible = paramPLC.Visible,
Enabled = paramPLC.Enabled,
HasError = paramPLC.HasError
};
// calcolo intero oggetto
currParam = new DTORecipeParam()
{
Id = item.Id,
Range = currRange,
Status = currStatus,
UnitMeasure = "",
ValueAct = paramPLC.ValueAct,
SetpointHMI = paramPLC.SetpointHMI,
SetpointPLC = paramPLC.SetpointPLC
};
}
else
{
currRange = new RPRange()
{
Min = 0,
Max = 999999
};
currStatus = new RPStatus()
{
Visible = false,
Enabled = false,
HasError = false
};
// calcolo intero oggetto
currParam = new DTORecipeParam()
{
Id = item.Id,
Range = currRange,
Status = currStatus,
UnitMeasure = "",
ValueAct = 0
};
}
currentRecipe.Add(item.Label, currParam);
}
}
else
{
currentRecipe = new Dictionary<string, DTORecipeParam>();
}
return NO_ERROR;
}
/// <summary>
/// SCrittura memoria (SOLO SetpointHMI invero)
/// </summary>
/// <param name="updtRecipe"></param>
/// <returns></returns>
public CmsError WriteRecipeData(Dictionary<string, DTORecipeParam> updtRecipe)
{
// solo x S7...
if (NcConfig.NcVendor == NC_VENDOR.S7NET)
{
// ciclo x ogni valore della ricetta aggiornata ricevuto
DataStructures.RecipeParam currParam;
foreach (var item in updtRecipe)
{
// salvo SOLO il setpoint HMI...
currParam = new DataStructures.RecipeParam()
{
Id = (short)item.Value.Id,
SetpointHMI = item.Value.SetpointHMI
};
// scrivo!
CmsError cmsError = numericalControl.PLC_WRecipeParam(currParam);
if (cmsError.IsError())
return cmsError;
}
}
else
{
return FUNCTION_NOT_ALLOWED_ERROR;
}
return NO_ERROR;
}
public CmsError ReadNcScada(ScadaSchemaModel scadaSchema, out DTOScadaModel scadaValue)
{
//ReadScadaDataSiemens(scadaSchema, out scadaValue);
@@ -1014,7 +1227,7 @@ namespace Thermo.Active.NC
{
if (layer.Labels.ElementAtOrDefault(i) != null)
{
if(layer.Labels[i].MemEnabledIndex != null)
if (layer.Labels[i].MemEnabledIndex != null)
{
// Read enabled from PLC
cmsError = numericalControl.PLC_RScadaValue(layer.Labels[i].MemEnabledIndex, SCADA_MEM_TYPE.BOOL, ref val);
@@ -1044,7 +1257,7 @@ namespace Thermo.Active.NC
return cmsError;
// Populate & add new object into scada model
scadaValue.Buttons.Add(new DTOScadaButtonModel()
scadaValue.Buttons.Add(new DTOScadaButtonModel()
{
Id = layer.Buttons[i].Id,
IsEnabled = Convert.ToBoolean(val)
@@ -1065,7 +1278,7 @@ namespace Thermo.Active.NC
Id = layer.Images[i].Id,
IsVisible = negate ? !Convert.ToBoolean(val) : Convert.ToBoolean(val)
});
}
}
if (layer.ProgressBars.ElementAtOrDefault(i) != null)
{
@@ -1106,7 +1319,7 @@ namespace Thermo.Active.NC
{
IsEnabled = false, //Convert.ToBoolean(val),
Value = val2
}
}
});
}
else
@@ -1134,7 +1347,7 @@ namespace Thermo.Active.NC
});
}
}
}
}
@@ -1290,7 +1503,8 @@ namespace Thermo.Active.NC
Id = enabled.Id,
IsEnabled = Convert.ToBoolean(enabled.Value)
});
} break;
}
break;
case (int)SCADA_ELEMENT_TYPE.IMAGE:
case (int)SCADA_ELEMENT_TYPE.NEGATE_IMAGE:
{
@@ -1298,9 +1512,10 @@ namespace Thermo.Active.NC
scadaValue.Images.Add(new DTOScadaImageModel()
{
Id = enabled.Id,
IsVisible = enabled.ObjectType == (int)SCADA_ELEMENT_TYPE.NEGATE_IMAGE? !Convert.ToBoolean(enabled.Value) : Convert.ToBoolean(enabled.Value)
IsVisible = enabled.ObjectType == (int)SCADA_ELEMENT_TYPE.NEGATE_IMAGE ? !Convert.ToBoolean(enabled.Value) : Convert.ToBoolean(enabled.Value)
});
} break;
}
break;
case (int)SCADA_ELEMENT_TYPE.LABEL:
{
// Populate & add new object into scada model
@@ -1309,23 +1524,24 @@ namespace Thermo.Active.NC
Id = enabled.Id,
IsVisible = Convert.ToBoolean(enabled.Value)
});
} break;
}
}
break;
}
}
for (int i = 0; i < inputData.Count() - 1; i += 2)
{
var obj = inputData[i];
var enabled = inputData[i + 1];
// Populate & add new object into scada model
scadaValue.Inputs.Add(new DTOScadaInputModel()
{
Id = obj.Id,
Value = new DTOScadaValueModel()
{
IsEnabled = obj.Action.ToLower() == SCADA_ACTION.READ ? false : Convert.ToBoolean(enabled.Value),
Value = obj.Value
IsEnabled = obj.Action.ToLower() == SCADA_ACTION.READ ? false : Convert.ToBoolean(enabled.Value),
Value = obj.Value
}
});
}
@@ -1336,6 +1552,111 @@ namespace Thermo.Active.NC
return cmsError;
}
/// <summary>
/// Legge tutti i parametri della ricetta
/// </summary>
/// <param name="currRecipe">Oggetto ricetta corrente HMI</param>
/// <returns></returns>
public CmsError ReadFullRecipe(out Dictionary<string, DTORecipeParam> currRecipe)
{
CmsError cmsError = NO_ERROR;
currRecipe = new Dictionary<string, DTORecipeParam>();
DTORecipeParam currParam = new DTORecipeParam();
RPRange currRange = new RPRange();
RPStatus currStatus = new RPStatus();
// gestione errore
cmsError = ReadRecipeData(false, true, out currRecipe);
if (cmsError.IsError())
return cmsError;
// restituisco cod errore se trovato
return cmsError;
}
/// <summary>
/// Scrive tutti i parametri della ricetta indicati
/// </summary>
/// <param name="updtRecipe">Oggetto parametri da aggiornare (from HMI)</param>
/// <returns></returns>
public CmsError WriteRecipeParams(Dictionary<string, DTORecipeParam> updtRecipe)
{
CmsError cmsError = WriteRecipeData(updtRecipe);
return cmsError;
}
/// <summary>
/// Legge tutti i parametri della ricetta e calcolo la overview dei vari steps
/// </summary>
/// <param name="currOverview">Oggetto overview ricetta corrente HMI</param>
/// <returns></returns>
public CmsError GetRecipeOverview(out Dictionary<string, RecipeCatStatus> currOverview)
{
CmsError cmsError = NO_ERROR;
currOverview = new Dictionary<string, RecipeCatStatus>();
// !!!FARE davvero!!!
#if false
// gestione errore
cmsError = ReadScadaData(schema, out currParam);
if (cmsError.IsError())
return cmsError;
#endif
// calcolo!
// leggo l'intero array delle DB... QUI FAKE sulle DB configurate...
List<DTORecipeConfigModel> recipeConfig = RecipeConfig.Select(x => new DTORecipeConfigModel()
{
Id = x.Id,
Category = x.Category.ToString(),
SubCategory_1 = x.SubCategory_1,
SubCategory_2 = x.SubCategory_2,
Name = x.Name,
Description = x.Description,
Format = x.Format,
Label = $"{x.Category}_{x.SubCategory_1}_{x.SubCategory_2}_{x.Name}".Replace("__", "_").Replace("__", "_").ToLower()
}).ToList();
RecipeCatStatus currStatus = RecipeCatStatus.Unchanged;
int countCat = 0;
foreach (var item in recipeConfig)
{
// ogni 20 incremento...
if (countCat < 20)
{
currStatus = RecipeCatStatus.Unchanged;
}
else if (countCat < 40)
{
currStatus = RecipeCatStatus.ChangedOk;
}
else
{
currStatus = RecipeCatStatus.HasError;
}
// se non c'è aggiungo
if (!currOverview.ContainsKey(item.Category))
{
currOverview.Add(item.Category, currStatus);
countCat = 0;
}
else
{
// se il valore è maggiore --> aggiorno
currOverview[item.Category] = (int)currStatus > (int)currOverview[item.Category] ? currStatus : currOverview[item.Category];
}
countCat++;
}
// restituisco cod errore se trovato
return cmsError;
}
#endregion Read Data
#region Write data
@@ -1408,7 +1729,7 @@ namespace Thermo.Active.NC
public CmsError SetActiveScreen(short screen)
{
// Set to true power on data by id
return numericalControl.NC_SetScreenVisible((Nc.SCREEN_PAGE)screen);
return numericalControl.NC_SetScreenVisible((NcThermo.SCREEN_PAGE)screen);
}
public CmsError WriteM155Data(int process, double responseValue)
@@ -1427,7 +1748,7 @@ namespace Thermo.Active.NC
{
// Choose which list contains the maximum number of elements
int max = layer.Buttons.Count();
if (layer.Labels.Count() > max)
max = layer.Labels.Count();
@@ -1458,11 +1779,11 @@ namespace Thermo.Active.NC
SupportFunctions.ConvertStringMachineNumberIntoNumber(strMachNumber, out bool containsLetters, out int machNumber);
// Read Data from NC & elaborate it
long NcCandy = 0;
long NcCandy = 0;
cmsError = numericalControl.PLC_RCandy(ref NcCandy);
if (cmsError.IsError())
return cmsError;
bool bNC_OK = CandiesController.GetDataFromLincense(NcCandy, containsLetters, out long NCLic, out int NCMatr, out long NCParam);
bool bNC_VALID = machNumber == NCMatr && bNC_OK;
@@ -1482,7 +1803,7 @@ namespace Thermo.Active.NC
return cmsError;
// Manage Expired Lincense Bit
if(CandiesController.ElaborateExpiredBit(newDate, bNcCandy, out bool bNewCandy))
if (CandiesController.ElaborateExpiredBit(newDate, bNcCandy, out bool bNewCandy))
{
//Write Expired Lincense Bit on NC
cmsError = numericalControl.PLC_WExpiredCandy(bNewCandy);
@@ -1493,14 +1814,14 @@ namespace Thermo.Active.NC
return NO_ERROR;
}
public void WriteCandy(DateTime value,int machNumber)
public void WriteCandy(DateTime value, int machNumber)
{
long nDays;
long Lic=0;
long Lic = 0;
nDays = (value.Ticks / TimeSpan.TicksPerDay);
//Imposto nel registro
CandiesController.SetPCLincense(machNumber,nDays);
CandiesController.SetPCLincense(machNumber, nDays);
//Imposto nel CN
Lic = long.Parse(CandiesController.SetLincenseFromData(machNumber, nDays));
+2 -2
View File
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("Step.NC")]
[assembly: AssemblyTitle("Thermo.Active.NC")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Step.NC")]
[assembly: AssemblyProduct("Thermo.Active.NC")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
+4 -4
View File
@@ -32,10 +32,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CMS_CORE_Library, Version=1.1.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Libs\CMS_CORE_Library.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -70,6 +66,10 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\cms_core_library\CMS_CORE_Library\CMS_CORE_Library.csproj">
<Project>{4abf8eef-2b23-483e-acdc-53214fe28681}</Project>
<Name>CMS_CORE_Library</Name>
</ProjectReference>
<ProjectReference Include="..\Thermo.Active.Config\Thermo.Active.Config.csproj">
<Project>{3f5c2483-fc87-43ef-92a8-66ff7d0e440f}</Project>
<Name>Thermo.Active.Config</Name>
+4 -4
View File
@@ -34,10 +34,6 @@
<ApplicationIcon>Resources\CMS_Icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="CMS_CORE_Library, Version=1.1.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Libs\CMS_CORE_Library.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
@@ -139,6 +135,10 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\cms_core_library\CMS_CORE_Library\CMS_CORE_Library.csproj">
<Project>{4abf8eef-2b23-483e-acdc-53214fe28681}</Project>
<Name>CMS_CORE_Library</Name>
</ProjectReference>
<ProjectReference Include="..\Thermo.Active.Config\Thermo.Active.Config.csproj">
<Project>{3f5c2483-fc87-43ef-92a8-66ff7d0e440f}</Project>
<Name>Thermo.Active.Config</Name>
@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("Step.Utils")]
[assembly: AssemblyTitle("Thermo.Active.Utils")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Step.Utils")]
[assembly: AssemblyProduct("Thermo.Active.Utils")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,10 +32,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CMS_CORE_Library, Version=1.1.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Libs\CMS_CORE_Library.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=6.10.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.10.4\lib\net452\MySql.Data.dll</HintPath>
</Reference>
@@ -146,6 +142,10 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\cms_core_library\CMS_CORE_Library\CMS_CORE_Library.csproj">
<Project>{4abf8eef-2b23-483e-acdc-53214fe28681}</Project>
<Name>CMS_CORE_Library</Name>
</ProjectReference>
<ProjectReference Include="..\Thermo.Active.Model\Thermo.Active.Model.csproj">
<Project>{631375DD-06D3-49BB-8130-D9DDB34C429D}</Project>
<Name>Thermo.Active.Model</Name>
+24 -10
View File
@@ -20,7 +20,7 @@ namespace Thermo.Active.Utils
{
private static readonly string CMSCONNECT_TOKEN = "59f1qik5PYfiJLiXZ4xZ05pjzx5E9FscQWtj4lmfLKXaF1OAxkvu7ziBzXFBuuVQ";
public static SOFTKEY_TYPE GetSoftKeyType(string type)
public static SOFTKEY_TYPE GetSoftKeyType(string type)
{
switch (type)
{
@@ -40,6 +40,17 @@ namespace Thermo.Active.Utils
}
}
public static TACT_PARAM_TYPE GetTActCategory(string strCategory)
{
TACT_PARAM_TYPE answ = TACT_PARAM_TYPE.ND;
try
{
answ = (TACT_PARAM_TYPE)Enum.Parse(typeof(TACT_PARAM_TYPE), strCategory);
}
catch { }
return answ;
}
public static int GetPlcIdFromNcSoftKey(string softKey)
{
switch (softKey)
@@ -72,7 +83,7 @@ namespace Thermo.Active.Utils
case "xTen": return 26;
case "xHundred": return 27;
case "xThousand": return 28;
case "overstroke": return 30;
case "overstroke": return 30;
case "feedByPass": return 31;
default: return -1;
}
@@ -153,7 +164,7 @@ namespace Thermo.Active.Utils
List<short> listOfPossibleIds = Enumerable.Range(1, objIds.Max() + 1).Select(x => (short)x).ToList();
IEnumerable<short> res = listOfPossibleIds.Except(objIds).ToList();
IEnumerable<short> res = listOfPossibleIds.Except(objIds).ToList();
if (res.Count() > 0)
return res.First();
@@ -162,7 +173,7 @@ namespace Thermo.Active.Utils
}
public static string GetImageBase64String(string directoryPath, string imageName)
{
{
string fileName = Path.GetFileNameWithoutExtension(imageName);
foreach (string ext in VALID_IMAGE_EXTENSIONS)
{
@@ -199,7 +210,7 @@ namespace Thermo.Active.Utils
return null;
EmptyFolder(jobFolderPath);
using (ZipArchive zipExtractor = ZipFile.OpenRead(filePath))
{
// Setup main job fields
@@ -307,7 +318,7 @@ namespace Thermo.Active.Utils
string filePath = JOB_TMP_DIRECTORY + "\\" + processId + "\\";
if (!Directory.Exists(filePath))
return null;
// Setup main Fields
DTOJobModel jobData = new DTOJobModel()
{
@@ -372,7 +383,7 @@ namespace Thermo.Active.Utils
return SCADA_MEM_TYPE.WORD;
case "INT":
return SCADA_MEM_TYPE.INT;
return SCADA_MEM_TYPE.INT;
case "REAL":
return SCADA_MEM_TYPE.REAL;
@@ -407,7 +418,7 @@ namespace Thermo.Active.Utils
public static string GetSoftwareVersionAndBuildDate()
{
Version v = Assembly.GetEntryAssembly()?.GetName().Version;
Version v = Assembly.GetEntryAssembly()?.GetName().Version;
if (v != null)
{
// Get first 2 number of the version
@@ -424,7 +435,7 @@ namespace Thermo.Active.Utils
return "";
}
public static Boolean DecodeCMSConnectGatewayLogin(string encryptedString, out string login, out string password)
{
@@ -496,7 +507,10 @@ namespace Thermo.Active.Utils
{
intMachineVal = 0;
containsLetters = Regex.IsMatch(machineNumber, @".*?[a-zA-Z].*?");
if (string.IsNullOrEmpty(machineNumber))
{
machineNumber = "0000";
}
if (containsLetters)
// Convert ASCII string to a single INT
intMachineVal = SupportFunctions.ConvertAsciiStringToInt(machineNumber);
+101
View File
@@ -39,11 +39,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client.Chromium", "Client.C
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thermo.Active.CmsConnectGateway", "Thermo.Active.CmsConnectGateway\Thermo.Active.CmsConnectGateway.csproj", "{49B04D99-0ECD-4900-86D3-7098D61314D7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CMS_CORE_Library", "..\cms_core_library\CMS_CORE_Library\CMS_CORE_Library.csproj", "{4ABF8EEF-2B23-483E-ACDC-53214FE28681}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Debug2|Any CPU = Debug2|Any CPU
Debug2|x64 = Debug2|x64
Debug2|x86 = Debug2|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
@@ -55,6 +60,12 @@ Global
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Debug|x64.Build.0 = Debug|Any CPU
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Debug|x86.ActiveCfg = Debug|Any CPU
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Debug|x86.Build.0 = Debug|Any CPU
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Debug2|x64.ActiveCfg = Debug|Any CPU
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Debug2|x64.Build.0 = Debug|Any CPU
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Debug2|x86.ActiveCfg = Debug|Any CPU
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Debug2|x86.Build.0 = Debug|Any CPU
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Release|Any CPU.Build.0 = Release|Any CPU
{AFED34E1-77DB-4D81-830A-A8D0A190573D}.Release|x64.ActiveCfg = Release|Any CPU
@@ -67,6 +78,12 @@ Global
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Debug|x64.Build.0 = Debug|Any CPU
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Debug|x86.ActiveCfg = Debug|Any CPU
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Debug|x86.Build.0 = Debug|Any CPU
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Debug2|x64.ActiveCfg = Debug|Any CPU
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Debug2|x64.Build.0 = Debug|Any CPU
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Debug2|x86.ActiveCfg = Debug|Any CPU
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Debug2|x86.Build.0 = Debug|Any CPU
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Release|Any CPU.Build.0 = Release|Any CPU
{631375DD-06D3-49BB-8130-D9DDB34C429D}.Release|x64.ActiveCfg = Release|Any CPU
@@ -79,6 +96,12 @@ Global
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Debug|x64.Build.0 = Debug|Any CPU
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Debug|x86.ActiveCfg = Debug|Any CPU
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Debug|x86.Build.0 = Debug|Any CPU
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Debug2|x64.ActiveCfg = Debug|Any CPU
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Debug2|x64.Build.0 = Debug|Any CPU
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Debug2|x86.ActiveCfg = Debug|Any CPU
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Debug2|x86.Build.0 = Debug|Any CPU
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Release|Any CPU.Build.0 = Release|Any CPU
{20FC0937-E7CA-4693-95F9-7A948EFD173B}.Release|x64.ActiveCfg = Release|Any CPU
@@ -91,6 +114,12 @@ Global
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Debug|x64.Build.0 = Debug|Any CPU
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Debug|x86.ActiveCfg = Debug|Any CPU
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Debug|x86.Build.0 = Debug|Any CPU
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Debug2|x64.ActiveCfg = Debug|Any CPU
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Debug2|x64.Build.0 = Debug|Any CPU
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Debug2|x86.ActiveCfg = Debug|Any CPU
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Debug2|x86.Build.0 = Debug|Any CPU
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Release|Any CPU.Build.0 = Release|Any CPU
{357D5EE1-FFC8-489B-9232-22CF474D9A6F}.Release|x64.ActiveCfg = Release|Any CPU
@@ -103,6 +132,12 @@ Global
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Debug|x64.Build.0 = Debug|Any CPU
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Debug|x86.ActiveCfg = Debug|Any CPU
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Debug|x86.Build.0 = Debug|Any CPU
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Debug2|x64.ActiveCfg = Debug|Any CPU
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Debug2|x64.Build.0 = Debug|Any CPU
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Debug2|x86.ActiveCfg = Debug|Any CPU
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Debug2|x86.Build.0 = Debug|Any CPU
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Release|Any CPU.Build.0 = Release|Any CPU
{3F5C2483-FC87-43EF-92A8-66FF7D0E440F}.Release|x64.ActiveCfg = Release|Any CPU
@@ -115,6 +150,12 @@ Global
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Debug|x64.Build.0 = Debug|x64
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Debug|x86.ActiveCfg = Debug|x86
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Debug|x86.Build.0 = Debug|x86
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Debug2|x64.ActiveCfg = Debug|x64
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Debug2|x64.Build.0 = Debug|x64
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Debug2|x86.ActiveCfg = Debug|x86
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Debug2|x86.Build.0 = Debug|x86
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Release|Any CPU.Build.0 = Release|Any CPU
{66FA29DB-925A-402B-A4C7-D3D780FB1BC3}.Release|x64.ActiveCfg = Release|x64
@@ -127,6 +168,12 @@ Global
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Debug|x64.Build.0 = Debug|Any CPU
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Debug|x86.ActiveCfg = Debug|Any CPU
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Debug|x86.Build.0 = Debug|Any CPU
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Debug2|x64.ActiveCfg = Debug|Any CPU
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Debug2|x64.Build.0 = Debug|Any CPU
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Debug2|x86.ActiveCfg = Debug|Any CPU
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Debug2|x86.Build.0 = Debug|Any CPU
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Release|Any CPU.Build.0 = Release|Any CPU
{CBEB631B-ABFA-4042-9779-C0060B0DFEFE}.Release|x64.ActiveCfg = Release|Any CPU
@@ -139,6 +186,12 @@ Global
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Debug|x64.Build.0 = Debug|Any CPU
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Debug|x86.ActiveCfg = Debug|Any CPU
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Debug|x86.Build.0 = Debug|Any CPU
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Debug2|x64.ActiveCfg = Debug|Any CPU
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Debug2|x64.Build.0 = Debug|Any CPU
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Debug2|x86.ActiveCfg = Debug|Any CPU
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Debug2|x86.Build.0 = Debug|Any CPU
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Release|Any CPU.ActiveCfg = Release|Any CPU
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Release|Any CPU.Build.0 = Release|Any CPU
{205A6ADE-FB5A-45CB-9C51-9817E7BB8939}.Release|x64.ActiveCfg = Release|Any CPU
@@ -151,6 +204,12 @@ Global
{34434B22-D546-4A5C-B575-49720C77643A}.Debug|x64.Build.0 = Debug|Any CPU
{34434B22-D546-4A5C-B575-49720C77643A}.Debug|x86.ActiveCfg = Debug|Any CPU
{34434B22-D546-4A5C-B575-49720C77643A}.Debug|x86.Build.0 = Debug|Any CPU
{34434B22-D546-4A5C-B575-49720C77643A}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{34434B22-D546-4A5C-B575-49720C77643A}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{34434B22-D546-4A5C-B575-49720C77643A}.Debug2|x64.ActiveCfg = Debug|Any CPU
{34434B22-D546-4A5C-B575-49720C77643A}.Debug2|x64.Build.0 = Debug|Any CPU
{34434B22-D546-4A5C-B575-49720C77643A}.Debug2|x86.ActiveCfg = Debug|Any CPU
{34434B22-D546-4A5C-B575-49720C77643A}.Debug2|x86.Build.0 = Debug|Any CPU
{34434B22-D546-4A5C-B575-49720C77643A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34434B22-D546-4A5C-B575-49720C77643A}.Release|Any CPU.Build.0 = Release|Any CPU
{34434B22-D546-4A5C-B575-49720C77643A}.Release|x64.ActiveCfg = Release|Any CPU
@@ -163,6 +222,12 @@ Global
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Debug|x64.Build.0 = Debug|Any CPU
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Debug|x86.ActiveCfg = Debug|Any CPU
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Debug|x86.Build.0 = Debug|Any CPU
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Debug2|x64.ActiveCfg = Debug|Any CPU
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Debug2|x64.Build.0 = Debug|Any CPU
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Debug2|x86.ActiveCfg = Debug|Any CPU
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Debug2|x86.Build.0 = Debug|Any CPU
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Release|Any CPU.Build.0 = Release|Any CPU
{DE54FF4C-8390-4489-882A-1BC7D99EF185}.Release|x64.ActiveCfg = Release|Any CPU
@@ -175,6 +240,12 @@ Global
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Debug|x64.Build.0 = Debug|Any CPU
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Debug|x86.ActiveCfg = Debug|Any CPU
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Debug|x86.Build.0 = Debug|Any CPU
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Debug2|x64.ActiveCfg = Debug|Any CPU
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Debug2|x64.Build.0 = Debug|Any CPU
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Debug2|x86.ActiveCfg = Debug|Any CPU
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Debug2|x86.Build.0 = Debug|Any CPU
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Release|Any CPU.Build.0 = Release|Any CPU
{B2366B08-96BD-4F6B-B748-B45089B87A14}.Release|x64.ActiveCfg = Release|Any CPU
@@ -187,6 +258,12 @@ Global
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Debug|x64.Build.0 = Debug|Any CPU
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Debug|x86.ActiveCfg = Debug|Any CPU
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Debug|x86.Build.0 = Debug|Any CPU
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Debug2|x64.ActiveCfg = Debug|Any CPU
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Debug2|x64.Build.0 = Debug|Any CPU
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Debug2|x86.ActiveCfg = Debug|Any CPU
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Debug2|x86.Build.0 = Debug|Any CPU
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Release|Any CPU.Build.0 = Release|Any CPU
{F9F17F23-660E-488C-A7FA-6A5B35D64313}.Release|x64.ActiveCfg = Release|Any CPU
@@ -199,12 +276,36 @@ Global
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Debug|x64.Build.0 = Debug|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Debug|x86.ActiveCfg = Debug|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Debug|x86.Build.0 = Debug|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Debug2|Any CPU.ActiveCfg = Debug|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Debug2|Any CPU.Build.0 = Debug|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Debug2|x64.ActiveCfg = Debug|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Debug2|x64.Build.0 = Debug|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Debug2|x86.ActiveCfg = Debug|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Debug2|x86.Build.0 = Debug|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Release|Any CPU.Build.0 = Release|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Release|x64.ActiveCfg = Release|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Release|x64.Build.0 = Release|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Release|x86.ActiveCfg = Release|Any CPU
{49B04D99-0ECD-4900-86D3-7098D61314D7}.Release|x86.Build.0 = Release|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|x64.ActiveCfg = Debug|x64
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|x64.Build.0 = Debug|x64
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|x86.ActiveCfg = Debug|x86
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug|x86.Build.0 = Debug|x86
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug2|Any CPU.ActiveCfg = Debug2|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug2|Any CPU.Build.0 = Debug2|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug2|x64.ActiveCfg = Debug2|x64
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug2|x64.Build.0 = Debug2|x64
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug2|x86.ActiveCfg = Debug2|x86
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Debug2|x86.Build.0 = Debug2|x86
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|Any CPU.Build.0 = Release|Any CPU
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|x64.ActiveCfg = Release|x64
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|x64.Build.0 = Release|x64
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|x86.ActiveCfg = Release|x86
{4ABF8EEF-2B23-483E-ACDC-53214FE28681}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+149 -77
View File
@@ -4,81 +4,153 @@
https://go.microsoft.com/fwlink/?LinkId=301879
-->
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<appSettings>
<add key="enableDirectoryBrowsing" value="true" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="ServerServiceName" value="MariaDB"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.6.2" />
<httpRuntime targetFramework="4.6.2" />
<httpModules>
</httpModules>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.10.4.0" newVersion="6.10.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<connectionStrings>
<add name="mySQLDatabaseConnection" providerName="MySql.Data.MySqlClient" connectionString="Server=localhost;Database=step;Uid=root;Pwd=root;" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.10.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
</provider>
</providers>
</entityFramework>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<appSettings>
<add key="enableDirectoryBrowsing" value="true" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="ServerServiceName" value="MariaDB" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.6.2" />
<httpRuntime targetFramework="4.6.2" />
<httpModules>
</httpModules>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.10.4.0" newVersion="6.10.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<connectionStrings>
<add name="mySQLDatabaseConnection" providerName="MySql.Data.MySqlClient" connectionString="Server=localhost;Database=step;Uid=root;Pwd=root;" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.10.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
</provider>
</providers>
</entityFramework>
<system.diagnostics>
<sources>
<source name="SignalR.SqlMessageBus">
<listeners>
<add name="SignalR-Bus" />
</listeners>
</source>
<source name="SignalR.ServiceBusMessageBus">
<listeners>
<add name="SignalR-Bus" />
</listeners>
</source>
<source name="SignalR.RedisMessageBus">
<listeners>
<add name="SignalR-Bus" />
</listeners>
</source>
<source name="SignalR.ScaleoutMessageBus">
<listeners>
<add name="SignalR-Bus" />
</listeners>
</source>
<source name="SignalR.Transports.WebSocketTransport">
<listeners>
<add name="SignalR-Transports" />
</listeners>
</source>
<source name="SignalR.Transports.ServerSentEventsTransport">
<listeners>
<add name="SignalR-Transports" />
</listeners>
</source>
<source name="SignalR.Transports.ForeverFrameTransport">
<listeners>
<add name="SignalR-Transports" />
</listeners>
</source>
<source name="SignalR.Transports.LongPollingTransport">
<listeners>
<add name="SignalR-Transports" />
</listeners>
</source>
<source name="SignalR.Transports.TransportHeartBeat">
<listeners>
<add name="SignalR-Transports" />
</listeners>
</source>
<source name="SignalR.ReflectedHubDescriptorProvider">
<listeners>
<add name="SignalR-Init" />
</listeners>
</source>
</sources>
<!-- Sets the trace verbosity level -->
<switches>
<add name="SignalRSwitch" value="Verbose" />
</switches>
<!-- Specifies the trace writer for output -->
<sharedListeners>
<!-- Listener for transport events -->
<add name="SignalR-Transports" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs/transports.log" />
<!-- Listener for scaleout provider events -->
<add name="SignalR-Bus" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs/bus.log" />
<!-- Listener for hub discovery events -->
<add name="SignalR-Init" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs/init.log" />
</sharedListeners>
<trace autoflush="true" />
</system.diagnostics>
</configuration>
+2 -2
View File
@@ -64,7 +64,7 @@ namespace Thermo.Active.App_Start
RequestPath = PathString.Empty,
FileSystem = new PhysicalFileSystem(WEBSITE_DIRECTORY)
};
app.UseFileServer(options);
if (!ServerPortIsAvailable(ServerStartupConfig.ServerPort))
{
@@ -106,7 +106,7 @@ namespace Thermo.Active.App_Start
app.Map("/signalr", map =>
{
map.UseCors(CorsOptions.AllowAll);
map.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions()
{
Provider = new SignalROAuthBearerProvider(),
@@ -8,6 +8,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
using static Thermo.Active.Config.ServerConfig;
using Thermo.Active.Model.DTOModels.Recipe;
namespace Thermo.Active.Controllers.WebApi
{
@@ -102,6 +103,49 @@ namespace Thermo.Active.Controllers.WebApi
return Ok(heads);
}
[Route("recipe"), HttpGet]
public IHttpActionResult GetRecipeConfig()
{
List<DTORecipeConfigModel> recipeConfig = RecipeConfig.Select(x => new DTORecipeConfigModel()
{
Id = x.Id,
Category = x.Category.ToString(),
SubCategory_1 = x.SubCategory_1,
SubCategory_2 = x.SubCategory_2,
Name = x.Name,
Description = x.Description,
Format = x.Format,
Label = $"{x.Category}_{x.SubCategory_1}_{x.SubCategory_2}_{x.Name}".Replace("__", "_").Replace("__", "_").ToLower()
}).ToList();
return Ok(recipeConfig);
}
#if false
[Route("ThermoParams"), HttpGet]
public IHttpActionResult GetThermoParamsConfig()
{
// TODO FIXME
// passa i parametri di configurazione es min/max dei gauge...
List<DTORecipeConfigModel> recipeConfig = RecipeConfig.Select(x => new DTORecipeConfigModel()
{
Id = x.Id,
Category = x.Category.ToString(),
SubCategory_1 = x.SubCategory_1,
SubCategory_2 = x.SubCategory_2,
Name = x.Name,
Description = x.Description,
Format = x.Format,
Label = $"{x.Category}_{x.SubCategory_1}_{x.SubCategory_2}_{x.Name}".Replace("__", "_").Replace("__", "_").ToLower()
}).ToList();
return Ok(recipeConfig);
}
#endif
[Route("alarms"), HttpGet]
public IHttpActionResult GetAlarmsConfig()
{
@@ -114,6 +114,7 @@ namespace Thermo.Active.Controllers.WebApi
);
}
private static string GetValueFromLocalizationList(Dictionary<string, string> localizedNames, string language, string defaultString)
{
// Find text from names by language id
@@ -0,0 +1,98 @@
using CMS_CORE_Library.Models;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.NC;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using static CMS_CORE_Library.Models.DataStructures;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Model.Constants;
using Thermo.Active.Model.DTOModels.Recipe;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/recipe")]
public class RecipeController : ApiController
{
[Route("overview"), HttpGet]
public IHttpActionResult GetOverview()
{
using (NcAdapter ncAdapter = new NcAdapter())
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
return NotFound();
CmsError cmsError = ncAdapter.GetRecipeOverview(out Dictionary<string, RecipeCatStatus> currOverview);
if (cmsError.IsError())
return BadRequest(cmsError.localizationKey);
return Ok(currOverview);
}
}
[Route("current"), HttpGet]
public IHttpActionResult GetCurrentParameters()
{
using (NcAdapter ncAdapter = new NcAdapter())
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
return NotFound();
CmsError cmsError = ncAdapter.ReadFullRecipe(out Dictionary<string, DTORecipeParam> currRecipe);
if (cmsError.IsError())
return BadRequest(cmsError.localizationKey);
return Ok(currRecipe);
}
}
[Route("update"), HttpPut]
public IHttpActionResult WriteParameters(Dictionary<string, double> parametersList)
{
using (NcAdapter ncAdapter = new NcAdapter())
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
CmsError cmsError = ncAdapter.ReadFullRecipe(out Dictionary<string, DTORecipeParam> prevRecipe);
if (cmsError.IsError())
return BadRequest(cmsError.localizationKey);
Dictionary<string, DTORecipeParam> updtRecipe = new Dictionary<string, DTORecipeParam>();
foreach (var item in parametersList)
{
if (prevRecipe.ContainsKey(item.Key))
{
// aggiorno il valore HMI nel parametro
var currParam = prevRecipe[item.Key];
currParam.SetpointHMI = item.Value;
// salvo (1 parametro, potrei fare N...)
updtRecipe.Add(item.Key, currParam);
}
else
{
return NotFound();
}
}
// scrivo sul PLC
ncAdapter.WriteRecipeParams(updtRecipe);
// ritorno solo fatto!
return Ok();
}
}
}
}
+24 -4
View File
@@ -90,10 +90,30 @@ namespace Thermo.Active.Listeners
infos.Add(MessageServices.Current.Subscribe(SEND_CMSCONNECT_GW_REBOOT_STATUS, (a, b) =>
{
SignalRListener.SetGatewayRebootStatus(a);
}));
}));
// add specific modules for THERMO
infos.Add(MessageServices.Current.Subscribe(SEND_THERMO_RECIPE_FULL, (a, b) =>
{
SignalRListener.SendThermoRecipeFullData(a);
}));
infos.Add(MessageServices.Current.Subscribe(SEND_THERMO_RECIPE_OVERWIEW, (a, b) =>
{
SignalRListener.SendThermoRecipeOverviewData(a);
}));
infos.Add(MessageServices.Current.Subscribe(SEND_THERMO_MODULE_DATA, (a, b) =>
{
SignalRListener.SendThermoModulesData(a);
}));
infos.Add(MessageServices.Current.Subscribe(SEND_THERMO_WARMERS_DATA, (a, b) =>
{
SignalRListener.SendThermoWarmersData(a);
}));
infos.Add(MessageServices.Current.Subscribe(SEND_THERMO_GAUGE_DATA, (a, b) =>
{
SignalRListener.SendThermoGaugeData(a);
}));
//////////////////////////// Database
///// erano tooling...
// Broadcast
infos.Add(MessageServices.Current.Subscribe(BROADCAST_DATA, (a, b) =>
@@ -103,7 +123,7 @@ namespace Thermo.Active.Listeners
SignalRListener.BroadcastData();
}));
}
public static void Stop()
{
MessageServices.Current.UnSubscribe(infos.ToArray());
@@ -14,6 +14,10 @@ using System.Threading;
using static Thermo.Active.Listeners.SignalRStaticObjects;
using static Thermo.Active.Model.Constants;
using static Thermo.Active.Config.ServerConfig;
using Thermo.Active.Model.DTOModels.Recipe;
using CMS_CORE_Library.Models;
using static CMS_CORE_Library.Models.ThermoModels;
using System.Threading.Tasks;
namespace Thermo.Active.Listeners.SignalR
{
@@ -246,7 +250,114 @@ namespace Thermo.Active.Listeners.SignalR
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
context.Clients.Group("ncData").scadaData(scadaVal);
}
}
}
public static void SendThermoRecipeFullData(object recipeFull)
{
Dictionary<string, DTORecipeParam> currRecipeFull = recipeFull as Dictionary<string, DTORecipeParam>;
Dictionary<string, DTORecipeParam> diffData = new Dictionary<string, DTORecipeParam>();
// calcola ed invia SOLO le differenze...
if (false)
{
Parallel.ForEach(currRecipeFull, item =>
{
if (!LastRecipeFullData.ContainsKey(item.Key))
{
diffData.Add(item.Key, item.Value);
}
else
{
// comparazione
if (!item.Value.Equals(LastRecipeFullData[item.Key]))
{
diffData[item.Key] = item.Value;
}
}
});
}
else
{
foreach (var item in currRecipeFull)
{
if (!LastRecipeFullData.ContainsKey(item.Key))
{
diffData.Add(item.Key, item.Value);
}
else
{
// comparazione
if (!item.Value.Equals(LastRecipeFullData[item.Key]))
{
diffData[item.Key] = item.Value;
}
}
}
}
if (diffData.Count > 0)
{
// salvo update
LastRecipeFullData = currRecipeFull;
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
context.Clients.Group("ncData").recipeFullData(diffData);
}
}
public static void SendThermoRecipeOverviewData(object recipeOver)
{
Dictionary<string, RecipeCatStatus> currRecipeOver = recipeOver as Dictionary<string, RecipeCatStatus>;
if (!LastRecipeOverData.SequenceEqual(currRecipeOver))
{
LastRecipeOverData = currRecipeOver;
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
context.Clients.Group("ncData").recipeOverData(currRecipeOver);
}
}
public static void SendThermoModulesData(object modules)
{
Dictionary<string, DTORecipeParam> currModules = modules as Dictionary<string, DTORecipeParam>;
// FIXME TODO: usare un foreach comparer?
if (!LastRecipeFullData.SequenceEqual(currModules))
{
LastRecipeFullData = currModules;
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
context.Clients.Group("ncData").modulesData(currModules);
}
}
public static void SendThermoWarmersData(object warmers)
{
Dictionary<string, DTORecipeParam> currWarmers = warmers as Dictionary<string, DTORecipeParam>;
// FIXME TODO: usare un foreach comparer?
if (!LastRecipeFullData.SequenceEqual(currWarmers))
{
LastRecipeFullData = currWarmers;
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
context.Clients.Group("ncData").warmersData(currWarmers);
}
}
public static void SendThermoGaugeData(object gaugeData)
{
GaugeModel currGauge = gaugeData as GaugeModel;
if (!LastGaugeData.Equals(currGauge))
{
LastGaugeData = currGauge;
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
context.Clients.Group("ncData").gaugeData(currGauge);
}
}
public static void SetGatewayRebootStatus(object status)
@@ -286,32 +397,42 @@ namespace Thermo.Active.Listeners.SignalR
group.expiredMaintenances(LastExpiredMaintenances);
// Send nc status
context.Clients.Group("ncData").ncNetworkStatus(
group.ncNetworkStatus(
new
{
connected = LastIsNcConnected
});
// Send softkeys Nc
context.Clients.Group("ncData").ncSoftKeys(LastNcSoftKeysData);
group.ncSoftKeys(LastNcSoftKeysData);
// Send user softKeys
context.Clients.Group("ncData").userSoftKeys(LastUserSoftKeysData);
group.userSoftKeys(LastUserSoftKeysData);
// Send heads data
context.Clients.Group("ncData").headsData(LastHeadsData);
group.headsData(LastHeadsData);
// Send axesNames data
context.Clients.Group("ncData").axesNames(LastAxesNamesData);
group.axesNames(LastAxesNamesData);
// Send positions
context.Clients.Group("ncData").axesPositions(LastAxesPositions);
group.axesPositions(LastAxesPositions);
// Send active program data
context.Clients.Group("ncData").activeProgramData(LastProgramData);
group.activeProgramData(LastProgramData);
// Send magazine is active data
context.Clients.Group("ncData").magazineIsActive(LastNcMagazineIsActive);
group.magazineIsActive(LastNcMagazineIsActive);
// Send PP Queue
context.Clients.Group("ncData").partProgramQueue(LastPartProgramQueue);
group.partProgramQueue(LastPartProgramQueue);
// Send m155 data
context.Clients.Group("ncData").m155Data(LastM155Data);
group.m155Data(LastM155Data);
// Send Scada
context.Clients.Group("ncData").scadaData(LastScadaData);
group.scadaData(LastScadaData);
// Send THERMO Recipe data
group.recipeFullData(LastRecipeFullData);
group.recipeOverData(LastRecipeOverData);
// Send THERMO Modules data
group.recipeModulesData(LastModulesData);
// Send THERMO Warmers data
group.recipeWarmersData(LastWarmersData);
// THERMO Gauges
group.gaugeData(LastGaugeData);
Debug.WriteLine(string.Format("{0} {1} Broadcast..completed", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"), DateTime.Now.Millisecond));
Monitor.Exit(_broadcastlock);
@@ -2,6 +2,8 @@
using Thermo.Active.Model.DTOModels.AlarmModels;
using Thermo.Active.Model.DTOModels.Scada;
using System.Collections.Generic;
using Thermo.Active.Model.DTOModels.Recipe;
using CMS_CORE_Library.Models;
namespace Thermo.Active.Listeners
{
@@ -23,11 +25,16 @@ namespace Thermo.Active.Listeners
public static Dictionary<int, bool> LastNcMagazineIsActive = new Dictionary<int, bool>();
public static List<DTOQueueModel> LastPartProgramQueue = new List<DTOQueueModel>();
public static List<DTOM155InputModel> LastM155Data = new List<DTOM155InputModel>();
public static List<DTOScadaModel> LastScadaData = new List<DTOScadaModel>();
public static List<DTOScadaModel> LastScadaData = new List<DTOScadaModel>();
// FIXME TODO inserire oggetti corretti per THERMO
public static Dictionary<string, DTORecipeParam> LastRecipeFullData = new Dictionary<string, DTORecipeParam>();
public static Dictionary<string, RecipeCatStatus> LastRecipeOverData = new Dictionary<string, RecipeCatStatus>();
public static List<DTOScadaModel> LastModulesData = new List<DTOScadaModel>();
public static List<DTOScadaModel> LastWarmersData = new List<DTOScadaModel>();
public static ThermoModels.GaugeModel LastGaugeData = new ThermoModels.GaugeModel();
public static bool LastIsNcConnected = false;
// aggiugere oggetti nuovi e levare quelli che non servono +...
}
}
+5 -5
View File
@@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Active Server")]
[assembly: AssemblyDescription("Active - Main HMI for CMS Machines")]
[assembly: AssemblyTitle("Thermo Active Server")]
[assembly: AssemblyDescription("Thermo Active - Main HMI for CMS Machines")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CMS S.P.A.")]
[assembly: AssemblyProduct("Active Server")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyProduct("Thermo Active Server")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -31,4 +31,4 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.4.1")]
[assembly: AssemblyVersion("0.3.2")]
+13 -3
View File
@@ -58,9 +58,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="CMS_CORE_Library">
<HintPath>..\Libs\CMS_CORE_Library.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
@@ -122,6 +119,8 @@
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Swashbuckle.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cd1bb07a5ac7c7bc, processorArchitecture=MSIL">
<HintPath>..\packages\Swashbuckle.Core.5.6.0\lib\net40\Swashbuckle.Core.dll</HintPath>
</Reference>
@@ -166,6 +165,10 @@
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20505.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Windows.Interactivity">
<HintPath>..\Libs\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
@@ -207,6 +210,7 @@
<Reference Include="WebMatrix.WebData, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebPages.WebData.2.0.20505.0\lib\net40\WebMatrix.WebData.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="App_Start\SignalRContractResolver.cs" />
@@ -218,6 +222,7 @@
<Compile Include="Attributes\SignalRAuthorizeAttribute.cs" />
<Compile Include="Controllers\SignalR\NcHub.cs" />
<Compile Include="Controllers\WebApi\ApiAlarmController.cs" />
<Compile Include="Controllers\WebApi\RecipeController.cs" />
<Compile Include="Controllers\WebApi\AuthorizationController.cs" />
<Compile Include="Controllers\WebApi\CmsConnectController.cs" />
<Compile Include="Controllers\WebApi\ConfigurationController.cs" />
@@ -16121,6 +16126,10 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\cms_core_library\CMS_CORE_Library\CMS_CORE_Library.csproj">
<Project>{4abf8eef-2b23-483e-acdc-53214fe28681}</Project>
<Name>CMS_CORE_Library</Name>
</ProjectReference>
<ProjectReference Include="..\Thermo.Active.CmsConnectGateway\Thermo.Active.CmsConnectGateway.csproj">
<Project>{49b04d99-0ecd-4900-86d3-7098d61314d7}</Project>
<Name>Thermo.Active.CmsConnectGateway</Name>
@@ -16425,6 +16434,7 @@
<TypeScriptCompile Include="wwwroot\src\_base\utils.ts" />
</ItemGroup>
<ItemGroup>
<Folder Include="logs\" />
<Folder Include="wwwroot\src\router\" />
</ItemGroup>
<PropertyGroup>
Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

@@ -0,0 +1,240 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1156mm"
height="800mm"
viewBox="0 0 1156 800"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="disegno-controstampo-quote-velocita.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.125"
inkscape:cx="1119.1458"
inkscape:cy="2036.4307"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Livello 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,503)">
<path
style="fill:#4d85ff;fill-opacity:0.5018587;stroke:#0000a9;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 850.19123,-221.17487 c 0,0 122.26692,-1.97359 180.30647,0.24275 l -35.60462,147.001143 -111.4927,0.65955 -7.07924,-30.572513 -27.17361,-117.34132 1.04341,0.0577"
id="path54-0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
style="fill:none;stroke:#0000d1;stroke-width:4.21029854;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 762.66311,-224.80453 355.98669,-0.0872"
id="path4569-2"
inkscape:connector-curvature="0"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
style="fill:none;stroke:#b3b3b3;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 80.074,-467.77078 h 558"
id="path857"
inkscape:connector-curvature="0" />
<path
style="fill:#4d85ff;fill-opacity:0.5018587;stroke:#0000a9;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 220.17481,-466.8417 c 0,0 122.26692,-1.97359 180.30648,0.24275 l -35.60463,147.00114 -111.4927,0.65955 -7.07924,-30.57251 -27.17361,-117.34132 1.04341,0.0577"
id="path54"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
style="fill:none;stroke:#0000d1;stroke-width:4.21029854;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 132.64669,-470.47136 355.9867,-0.0872"
id="path4569"
inkscape:connector-curvature="0"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
<path
style="fill:none;stroke:#b3b3b3;stroke-width:1.15390325;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 80.074,258.22905 H 638.07402"
id="path857-9"
inkscape:connector-curvature="0" />
<path
style="fill:#b3b3b3;stroke:#b3b3b3;stroke-width:1.99642622;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 586.55369,-466.91951 1.6e-4,723.40752"
id="path892"
inkscape:connector-curvature="0" />
<path
sodipodi:type="star"
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:#b3b3b3;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path896"
sodipodi:sides="3"
sodipodi:cx="561.26599"
sodipodi:cy="-438.63263"
sodipodi:r1="12.744021"
sodipodi:r2="6.3720102"
sodipodi:arg1="0.8685394"
sodipodi:arg2="1.9157369"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 569.49789,-428.90402 -10.38654,-3.73194 -10.38653,-3.73194 8.42522,-7.12903 8.42522,-7.12904 1.96132,10.86098 z"
inkscape:transform-center-x="0.0055839671"
inkscape:transform-center-y="3.1811632"
transform="matrix(0.94139126,0.3373166,0.3373166,-0.94139126,206.12985,-358.50528)" />
<path
style="fill:#b3b3b3;stroke:#b3b3b3;stroke-width:1.99668467;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 153.82073,258.26847 1.6e-4,-723.59489"
id="path892-5"
inkscape:connector-curvature="0" />
<path
sodipodi:type="star"
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:#b3b3b3;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path896-3"
sodipodi:sides="3"
sodipodi:cx="561.26599"
sodipodi:cy="-438.63263"
sodipodi:r1="12.744021"
sodipodi:r2="6.3720102"
sodipodi:arg1="0.8685394"
sodipodi:arg2="1.9157369"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 569.49789,-428.90402 -10.38654,-3.73194 -10.38653,-3.73194 8.42522,-7.12903 8.42522,-7.12904 1.96132,10.86098 z"
inkscape:transform-center-x="0.0055849117"
inkscape:transform-center-y="-3.1811677"
transform="rotate(-19.713471,317.39459,726.92906)" />
<path
style="fill:#b3b3b3;stroke:#b3b3b3;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 240.81371,257.736 1.6e-4,-49.5639"
id="path892-3"
inkscape:connector-curvature="0" />
<path
sodipodi:type="star"
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:#b3b3b3;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path896-9"
sodipodi:sides="3"
sodipodi:cx="561.26599"
sodipodi:cy="-438.63263"
sodipodi:r1="12.744021"
sodipodi:r2="6.3720102"
sodipodi:arg1="0.8685394"
sodipodi:arg2="1.9157369"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 569.49789,-428.90402 -10.38654,-3.73194 -10.38653,-3.73194 8.42522,-7.12903 8.42522,-7.12904 1.96132,10.86098 z"
inkscape:transform-center-x="0.0055882036"
inkscape:transform-center-y="-3.1811704"
transform="rotate(-19.713471,2299.018,813.33867)" />
<path
style="fill:#b3b3b3;stroke:#b3b3b3;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 461.1167,181.58296 1.6e-4,75.04806"
id="path892-7"
inkscape:connector-curvature="0" />
<path
sodipodi:type="star"
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:#b3b3b3;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path896-1"
sodipodi:sides="3"
sodipodi:cx="561.26599"
sodipodi:cy="-438.63263"
sodipodi:r1="12.744021"
sodipodi:r2="6.3720102"
sodipodi:arg1="0.8685394"
sodipodi:arg2="1.9157369"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 569.49789,-428.90402 -10.38654,-3.73194 -10.38653,-3.73194 8.42522,-7.12903 8.42522,-7.12904 1.96132,10.86098 z"
inkscape:transform-center-x="0.0055839671"
inkscape:transform-center-y="3.1811632"
transform="matrix(0.94139126,0.3373166,0.3373166,-0.94139126,80.692857,-358.36228)" />
<path
style="fill:#b3b3b3;stroke:#b3b3b3;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 481.95486,180.89827 -41.71686,1.6e-4"
id="path892-7-0"
inkscape:connector-curvature="0" />
<path
style="fill:#b3b3b3;stroke:#b3b3b3;stroke-width:3.42526412;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 883.40308,-73.271427 -122.54456,1.6e-4"
id="path892-7-0-9"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#b3b3b3;stroke-width:1.96497488;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 770.52084,-221.43693 V -75.790677"
id="path972"
inkscape:connector-curvature="0" />
<path
sodipodi:type="star"
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:#b3b3b3;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path896-3-9"
sodipodi:sides="3"
sodipodi:cx="561.26599"
sodipodi:cy="-438.63263"
sodipodi:r1="12.744021"
sodipodi:r2="6.3720102"
sodipodi:arg1="0.8685394"
sodipodi:arg2="1.9157369"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 569.49789,-428.90402 -10.38654,-3.73194 -10.38653,-3.73194 8.42522,-7.12903 8.42522,-7.12904 1.96132,10.86098 z"
inkscape:transform-center-x="0.0055849117"
inkscape:transform-center-y="-3.1811677"
transform="rotate(-19.713471,1327.5852,-925.80315)" />
<path
sodipodi:type="star"
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:#b3b3b3;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path896-7"
sodipodi:sides="3"
sodipodi:cx="561.26599"
sodipodi:cy="-438.63263"
sodipodi:r1="12.744021"
sodipodi:r2="6.3720102"
sodipodi:arg1="0.8685394"
sodipodi:arg2="1.9157369"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 569.49789,-428.90402 -10.38654,-3.73194 -10.38653,-3.73194 8.42522,-7.12903 8.42522,-7.12904 1.96132,10.86098 z"
inkscape:transform-center-x="0.0055839671"
inkscape:transform-center-y="3.1811632"
transform="matrix(0.94139126,0.3373166,0.3373166,-0.94139126,390.09685,-690.78395)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 89 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 89 KiB

@@ -0,0 +1,34 @@
// out: false, sourceMap: false, main: ../style.less
@import "grid-system.less";
@import "colors.less";
@import "fonts.less";
@modal: modal;
.@{modal}.avvio-produzione-info {
margin-top: 100px;
width: 653px;
height: 616px;
section.body{
section{
justify-content: center;
.specific{
.disabled{
width: 420px;
height: 330px;
}
.tast{
margin-left: 25%;
}
}
}
}
}
@@ -50,26 +50,27 @@
.circle1{
position: relative;
top: 130px;
top: 200px;
right: 25px;
}
.circle2{
position: relative;
top: 180px;
top: 400px;
right: 25px;
}
.circle3{
width: 135px;
position: relative;
top: 175px;
top: 545px;
right: 410px;
}
.circle4{
position: relative;
top: 60px;
right: 180px;
top: 585px;
right: 200px;
}
}
@@ -0,0 +1,92 @@
// out: false, sourceMap: false, main: ../style.less
@import "grid-system.less";
@import "colors.less";
@import "fonts.less";
.circle-gantt{
height: 70px;
.specific{
div{
&:first-of-type{
display: flex;
flex-direction: column;
justify-content: flex-end;
height: 70px;
object-fit: contain;
border-radius: 2px;
background-color: #57636b;
label{
margin-left: 37%;
}
}
&:last-of-type{
display: flex;
flex-direction: column;
justify-content: center;
margin-top: -66px;
height: 40px;
object-fit: contain;
border-radius: 2px;
background-color: #c0c7cc;
label{
margin-left: 25%;
}
}
}
&:first-of-type{
div{
&:first-of-type{
display: flex;
flex-direction: column;
justify-content: flex-end;
width: 34px;
height: 70px;
object-fit: contain;
border-radius: 2px;
background-color: #57636b;
label{
margin-left: 25%;
}
}
&:last-of-type{
display: flex;
flex-direction: column;
justify-content: flex-end;
margin-top: -66px;
width: 34px;
height: 40px;
object-fit: contain;
border-radius: 2px;
background-color: #c0c7cc;
img{
margin-left: 25%;
flex-shrink: 0;
width: 20px;
height: 20px;
}
}
}
}
}
}
@@ -7,16 +7,24 @@
.@{modal}.estrazione-info {
width: 1820px;
height: 785px;
.specific {
justify-content: flex-end;
.box{
background-color: #e5f3ff;
}
}
section.body{
section{
.specific {
justify-content: flex-end;
padding-left: 10px;
.box{
margin:0;
background-color: #e5f3ff;
}
}
}
}
}
@@ -1,4 +1,5 @@
// out: false, sourceMap: false, main: ../style.less
@import "setup.less";
@import "colors.less";
@import "modals.less";
@import "pirometro.less";
@@ -6,8 +7,10 @@
@import "formato.less";
@import "slider.less";
@import "tastierino.less";
@import "circlegantt.less";
@import "paddle.less";
@import "arretramento-riscaldi.less";
@import "setup.less";
@import "avvio-prod.less";
@import "ciclo.less";
@import "raffreddamento.less";
@import "processo.less";
@@ -15,8 +15,10 @@
margin: 0;
}
.section{
display: flex;
section.body{
section{
padding: 0px;
.specific{
@@ -60,31 +62,33 @@
}
}
aside{
aside{
button{
display: block;
background-color: #bbbcbc;
color: #002680;
padding: 22px 16px;
margin: 2px 0;
width: 547px;
height: 70px;
border: none;
text-align: left;
cursor: pointer;
font-size: 17px;
}
button{
display: block;
background-color: #bbbcbc;
color: #002680;
padding: 22px 16px;
margin: 2px 0;
width: 547px;
height: 70px;
border: none;
text-align: left;
cursor: pointer;
font-size: 17px;
}
.active{
background-color: #fff;
font-weight: bold;
border-top: 2px solid #002680;
}
.active{
background-color: #fff;
font-weight: bold;
border-top: 2px solid #002680;
}
}
}
}
}
@@ -0,0 +1,188 @@
// out: false, sourceMap: false, main: ../style.less
@import "grid-system.less";
@import "colors.less";
@import "fonts.less";
html {
height: 100%;
overflow:hidden;
}
body {
border: 0; margin: 0; padding: 0;
height: 100%;
}
.hidden {
visibility: hidden;
}
.container{
#app{
nav {
position: absolute;
top: 50%;
right: 0;
.active button{
transform: translate(-761px, 0px);
}
div{
button {
position: relative;
height: 30px;
width: 32px;
display: block;
z-index: 9999;
border: 0;
border-radius: 0;
pointer-events: all;
background: #dddddd;
border-bottom-left-radius: 90px;
border-top-left-radius: 90px;
height: 90px;
width: 45px;
div{
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: 1fr 1fr;
align-items: center;
justify-items: center;
padding: 5px;
div {
width: 2px;
height: 2px;
border-radius: 10px;
margin: 2px;
background: #002680;
}
}
}
}
}
// .slide-enter-active,
// .slide-leave-active
// {
// transition: left,right 0s ease-in-out;
// }
// .slide-enter,
// .slide-leave-to {
// transition: right,left 0s ease-in-out
// }
.sidebar{
.sidebar-backdrop{
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
cursor: pointer;
}
.sidebar-panel{
overflow-y: auto;
background-color: #130f40;
position: fixed;
right: 0;
top: 141px;
height: 100vh;
z-index: 900;
padding: 3rem 20px 2rem 20px;
width: 721px;
height: 920px;
border-radius: 4px;
box-shadow: 2px 10px 15px 0 rgba(0, 0, 0, 0.5);
background-color: #dddddd;
.text-head-sidebar{
margin: 10px auto;
font-size: 24px;
font-weight: 500;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
text-align: center;
color: #002680;
}
.box-sidebar-panel{
display: grid;
grid-template-columns: repeat(2, 1fr);
align-items: center;
justify-items: center;
.sidebar-panel-nav{
width: 286px;
height: 100px;
border-radius: 2px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5);
background-color: #808e96;
margin: 10px 30px;
.text-box-paddle{
display: flex;
width: 268px;
height: 78px;
font-family: WorkSans;
font-size: 18px;
font-weight: 500;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
color: #ffffff;
margin: 10px;
i{
text-align: end;
width: 50px;
color: #bbbcbc;
}
label{
width: 117px;
margin: 10px;
}
}
.text-box-paddle.text-soft{
label{
width: 100%;
align-self: center;
}
}
}
}
}
}
}
}
@@ -10,83 +10,84 @@
width: 1820px;
height: 980px;
section{
.specific{
width: 470px;
@{pirometro-margin}:37%;
}
.termospecific{
@{pirometro-margin}:0%;
.svg-area{
padding-left: 90px;
width: 1270px;
height: 800px;
.disegnoTermoSuperiore{
flex-shrink: 0;
width: 1100px;
height: 750px;
}
.border-termo-superiore{
.circle1{
position: relative;
top: 135px;
right: 1150px;
}
.circle2{
position: relative;
top: 355px;
right: 1150px;
}
.circle3{
position: relative;
top: 425px;
right: 1150px;
}
.circle4{
position: relative;
top: 470px;
right: 635px;
}
.circle5{
position: relative;
top: 400px;
right: 255px;
}
.circle6{
width: 64px;
height: 20px;
color:white;
object-fit: contain;
background-color: #c03d58;
position: relative;
top: 95px;
right: 125px;
}
}
section.body{
section{
.specific{
width: 470px;
@{pirometro-margin}:37%;
}
button{
margin-left: 5px;
width: 48px;
height: 48px;
object-fit: contain;
border-radius: 2px;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
border: solid 1px #001e48;
background-image: linear-gradient(to bottom, #1756ad, #002680);
.termospecific{
@{pirometro-margin}:0%;
.svg-area{
padding-left: 90px;
width: 1270px;
height: 800px;
.disegnoTermoSuperiore{
flex-shrink: 0;
width: 1100px;
height: 750px;
}
.border-termo-superiore{
.circle1{
position: relative;
top: 135px;
right: 1150px;
}
.circle2{
position: relative;
top: 355px;
right: 1150px;
}
.circle3{
position: relative;
top: 425px;
right: 1150px;
}
.circle4{
position: relative;
top: 470px;
right: 635px;
}
.circle5{
position: relative;
top: 400px;
right: 255px;
}
.circle6{
width: 100px;
background-color: #c03d58;
position: relative;
top: 87px;
right: 150px;
}
}
}
button{
margin-left: 5px;
width: 48px;
height: 48px;
object-fit: contain;
border-radius: 2px;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
border: solid 1px #001e48;
background-image: linear-gradient(to bottom, #1756ad, #002680);
}
}
}
@@ -7,5 +7,54 @@
.@{modal}.processo-info {
width: 1820px;
height: 980px;
margin: 150px 193px;
margin-top: 50px;
header{
font-size: 22px;
color: #4b4b4b;
.tab-header{
padding: 10px 0px;
button{
padding: 0;
display: flex;
justify-content: flex-start;
margin-right: 10px;
width: 149px;
height: 48px;
border-radius: 2px;
box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.5);
background-image: linear-gradient(to bottom, #f1f1f1 0%, #bbbcbc 98%);
font-size: 14px;
font-weight: 500;
font-stretch: normal;
font-style: normal;
line-height: 1.15;
letter-spacing: normal;
color: #4b4b4b;
img{
margin-right: 20px;
}
}
label{
width: 106px;
height: 32px;
font-size: 32px;
font-weight: 600;
font-stretch: normal;
font-style: normal;
line-height: 1;
letter-spacing: normal;
text-align: right;
color: #545454;
}
}
}
}
@@ -48,22 +48,15 @@
height: 795px;
}
.disegnoControstampoQuoteVelocita{
flex-shrink: 0;
margin-left: 600px;
width: 1156px;
height: 800px;
}
.input-circles{
span{
object-fit: contain;
font-size: 22px;
font-weight: 500;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
text-align: center;
color: white;
background-color: #979797;
}
.circle{
width: 147px;
height: 60px;
@@ -181,16 +174,57 @@
.circle-stampo-10{
position: relative;
bottom: 557px;
bottom: 560px;
right: 769px;
}
.circle-stampo-11{
position: relative;
top: 38px;
top: 35px;
right: 781px;
}
.circle-controstampo-1{
position: relative;
top: 300px;
right: 1090px;
}
.circle-controstampo-2{
position: relative;
top: 570px;
right: 990px;
}
.circle-controstampo-3{
position: relative;
top: 475px;
right: 770px;
}
.circle-controstampo-4{
position: relative;
right: 650px;
}
.circle-controstampo-5{
position: relative;
top: 45px;
right: 480px;
}
.circle-controstampo-6{
position: relative;
top: -335px;
right: 650px;
}
.circle-controstampo-7{
position: relative;
top: 400px;
right: 650px;
}
}
}
@@ -10,7 +10,7 @@
.input-area{
width: 480px;
margin: 3px;
margin: 4px;
margin-bottom: 0px;
}
@@ -41,6 +41,7 @@
.auto{
overflow-y: auto;
overflow-x: hidden;
}
aside {
@@ -75,6 +76,19 @@
display: flex;
flex-direction: column;
span{
object-fit: contain;
font-size: 22px;
font-weight: 500;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
text-align: center;
color: white;
background-color: #979797;
}
.circle {
width: 141px;
height: 60px;
@@ -87,6 +101,21 @@
border: solid 4px #9b9b9b;
}
input{
width: 40px;
height: 21px;
margin: auto;
object-fit: contain;
font-size: 20px;
font-weight: 500;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
color: #6d6d6d;
border: none;
}
label {
margin: auto;
object-fit: contain;
@@ -125,12 +154,10 @@
header {
background-color: @color-white;
color: @color-darkish-blue;
font-weight: 600;
font-size: 24px;
text-align: left;
padding: 0px 23px;
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
@@ -249,9 +276,13 @@
color: #90BF3D;
}
&.fa-minus-circle{
color: #7A7C74;
&.fa-check-circle.undone-step{
color: #1791FF;
}
// &.fa-minus-circle{
// color: #7A7C74;
// }
}
position: relative;
@@ -390,10 +421,19 @@
}
.rect {
display: flex;
align-items: center;
justify-content: flex-end;
padding-inline-end: 20px;
// display: flex;
// align-items: center;
// justify-content: flex-end;
// padding-inline-end: 20px;
object-fit: contain;
font-size: 20px;
font-weight: 500;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
color: #6d6d6d;
text-align: center;
width: 98px;
height: 48px;
border-radius: 2px;

Some files were not shown because too many files have changed in this diff Show More