Compare commits

...

41 Commits

Author SHA1 Message Date
Samuele Locatelli 529266b57b Merge branch 'feature/prodMgmt' into develop 2020-09-04 10:45:54 +02:00
Samuele Locatelli e1280c193f eliminati commenti + aggiornamento readme, testato bounce ricetta 2020-09-04 10:45:41 +02:00
Samuele Locatelli 77cec0160a rimesso metodo x set AUTO + metodo x start prod full 2020-09-04 09:32:17 +02:00
Samuele Locatelli f7234dd34b new rel 2020-09-04 09:29:30 +02:00
Samuele Locatelli 4c7ad000db rimesso softkey x reset 2020-09-04 09:24:06 +02:00
Samuele Locatelli 140afc4539 Merge branch 'feature/prodMgmt' into develop 2020-09-03 17:56:52 +02:00
Samuele Locatelli 699ccfbfba Commentata gest cicli warmup come richiesto 2020-09-03 17:56:44 +02:00
Samuele Locatelli 3877cb7843 new rel 2020-09-03 12:04:11 +02:00
Samuele Locatelli 80e6192e46 Conf parameters per gestione scrittura recipe 2020-09-03 12:03:59 +02:00
Samuele Locatelli 2786c8e6a8 Merge branch 'develop' into feature/prodMgmt 2020-09-03 11:19:07 +02:00
Samuele Locatelli efbfd857f6 new rel 2020-09-03 11:18:55 +02:00
Samuele Locatelli 3968f72061 Gestione cicli riscaldo in WRITE sul PLC 2020-09-03 11:18:50 +02:00
Samuele Locatelli 88e78736f0 Merge branch 'feature/prodMgmt' into develop 2020-09-02 18:23:09 +02:00
Samuele Locatelli a362829256 Update gestione nuovo dato scrap (metodo x salvataggio...) 2020-09-02 18:21:11 +02:00
Samuele Locatelli 43abdd203b update note x migrations 2020-09-02 18:20:59 +02:00
Samuele Locatelli 74e51a4156 Update modello dati x SCRAP parts 2020-09-02 18:00:51 +02:00
Samuele Locatelli 52621f83e8 new sprint 2020-09-02 18:00:36 +02:00
Samuele Locatelli d16712bbd9 Merge branch 'bugfix/softkeys' into develop 2020-09-02 15:46:26 +02:00
Samuele Locatelli 8c96c46d35 typo eliminato calcolo superseeded 2020-09-02 15:46:08 +02:00
Samuele Locatelli 678312ceca Fiox display su prod panel 2020-09-02 15:44:59 +02:00
Samuele Locatelli 072b216eff Update ordinamento softkey by M.Carissoni 2020-09-02 15:44:52 +02:00
Samuele Locatelli 4e27d3fe63 rivisto eliminazione transports.log 2020-09-02 14:19:21 +02:00
Samuele Locatelli 8d57a29fd9 start new sprint 2020-09-02 14:17:55 +02:00
Samuele Locatelli c45c81dbf7 Merge branch 'bugfix/calcoloStatus' into develop 2020-09-02 14:05:57 +02:00
Samuele Locatelli 7417c20dcc Fix gestione (si spera) status overview 2020-09-02 13:26:16 +02:00
Samuele Locatelli a98500bade Aggiunta preliminare readme.md 2020-09-02 12:22:42 +02:00
Samuele Locatelli 154897e835 start new release 2020-09-02 11:47:46 +02:00
Samuele Locatelli 587f4b3e82 new vers numb 2020-09-02 11:41:03 +02:00
Samuele Locatelli 8714898228 Eliminato dati perturbati grafico prod 2020-09-02 11:40:21 +02:00
Samuele Locatelli 49ccfe10e7 Merge remote-tracking branch 'origin/develop' into develop 2020-09-02 11:32:14 +02:00
Samuele Locatelli 1168c826c1 Eliminazione transports.log 2020-09-02 11:31:51 +02:00
= 4c5f1e975f fix 2020-09-01 16:04:20 +02:00
= 4a5d0b9770 saveas notes 2020-09-01 16:03:31 +02:00
= 1e4dc168ac save notes 2020-09-01 15:34:22 +02:00
= d2fd9675fd header menu 2020-09-01 11:15:56 +02:00
= 9440a01ff7 numeric 2020-08-31 17:00:04 +02:00
= 968dab090d fix velocità di aggiornamento slider tramite tasti. 2020-08-31 16:10:39 +02:00
= b47975c7f6 conferma annulla 2020-08-31 10:58:12 +02:00
= cc9527fbad Merge remote-tracking branch 'CMS/develop' into develop 2020-08-31 10:30:17 +02:00
= 208b2122ac toggle disabled 2020-08-31 10:24:07 +02:00
= a379fc96d3 kwh 2020-08-27 16:42:25 +02:00
60 changed files with 1318 additions and 450 deletions
+29
View File
@@ -0,0 +1,29 @@
# Progetto Thermo.Active CMS
## Struttura Progetto
## Ambiente sviluppo e simulazione
## Procedura udpate DB
In caso di update del modello DB, seguendo questa guida (https://www.entityframeworktutorial.net/efcore/entity-framework-core-migration.aspx#:~:text=Adding%20a%20Migration,-At%20the%20very&text=So%2C%20firstly%2C%20you%20need%20to,command%20to%20add%20a%20migration.&text=If%20you%20are%20using%20dotnet,Interface%2C%20execute%20the%20following%20command.)
* si modifica lato classe il modello
* si apre il PM Nuget,s elezionando il progetto DB (che contiene le migrations)
* si da il comando di migrazione con un testo descrittivo, tipo
add-migration MyFirstMigration
* si può poi aggiornare il DB manualmente (o all'avvio del sw) con il comando
Update-Database
## Procedura Riavvio su SIM
Step come indicati da M.Carissoni:
* mettere macchina in MANUAL
* Dai un paio di ResetSK (prima softkey! oppure sul pannello siemens)
* fai cicloReset (softkey)
* parcheggio macchina da GANT (fino a che si spegne)
* quando si spegne ciclo reset auto
* Inizia a lampeggiare start e lo clicchi e parte
* Quando si spegne cicloReset fai cicloAuto
@@ -552,17 +552,17 @@
"233": 0
},
"RecipeOverview": {
"General": "HasError",
"Positions": "HasError",
"Cycle": "ChangedOk",
"Heats": "ChangedOk",
"Pyrometer": "ChangedOk",
"Drawing": "ChangedOk",
"UpperPlate": "ChangedOk",
"Cooling": "HasError",
"Vacuum": "ChangedOk",
"Extraction": "ChangedOk",
"Options": "HasError"
"General": "Unchanged",
"Positions": "Unchanged",
"Cycle": "Unchanged",
"Heats": "Unchanged",
"Pyrometer": "Unchanged",
"Drawing": "Unchanged",
"UpperPlate": "Unchanged",
"Cooling": "Unchanged",
"Vacuum": "Unchanged",
"Extraction": "Unchanged",
"Options": "Unchanged"
},
"TC_last": 2532.940840175
}
@@ -2,7 +2,7 @@
<userSoftKeys>
<softKey_procedure>
<active>false</active>
<active>true</active>
<category>1</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>1</plcId>
@@ -17,7 +17,7 @@
<active>true</active>
<category>2</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>2</plcId>
<plcId>1</plcId>
<localizedNames>
<lang langKey="en">Refresh alarms</lang>
<lang langKey="it">Refresh allarmi</lang>
@@ -27,7 +27,7 @@
<softKey_procedure>
<active>false</active>
<category>3</category>
<category>2</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>3</plcId>
<localizedNames>
@@ -39,7 +39,7 @@
<softKey_procedure>
<active>false</active>
<category>4</category>
<category>2</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>4</plcId>
<localizedNames>
@@ -51,7 +51,7 @@
<softKey_procedure>
<active>true</active>
<category>5</category>
<category>2</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>5</plcId>
<localizedNames>
@@ -63,7 +63,7 @@
<softKey_procedure>
<active>true</active>
<category>6</category>
<category>1</category>
<operatorConfirmationNeeded>true</operatorConfirmationNeeded>
<plcId>6</plcId>
<localizedNames>
@@ -76,7 +76,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>1</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>7</plcId>
<localizedNames>
@@ -89,7 +89,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>1</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>8</plcId>
<localizedNames>
@@ -110,13 +110,26 @@
<lang langKey="it">Pompe vuoto</lang>
</localizedNames>
<visible>true</visible>
<starred>true</starred>
</softKey_procedure>
<softKey_procedure>
<active>true</active>
<category>10</category>
<category>1</category>
<operatorConfirmationNeeded>true</operatorConfirmationNeeded>
<plcId>10</plcId>
<localizedNames>
<lang langKey="en">Last cycle</lang>
<lang langKey="it">Ultimo ciclo</lang>
</localizedNames>
<visible>true</visible>
</softKey_procedure>
<softKey_procedure>
<active>false</active>
<category>10</category>
<operatorConfirmationNeeded>true</operatorConfirmationNeeded>
<plcId>11</plcId>
<localizedNames>
<lang langKey="en">START Cycle</lang>
<lang langKey="it">START Ciclo</lang>
@@ -126,43 +139,43 @@
<softKey_procedure>
<active>true</active>
<category>1</category>
<category>4</category>
<operatorConfirmationNeeded>true</operatorConfirmationNeeded>
<plcId>12</plcId>
<localizedNames>
<lang langKey="en">Reset hours pump 1</lang>
<lang langKey="it">Reset contaore pompa 1</lang>
</localizedNames>
<visible>true</visible>
<visible>false</visible>
</softKey_procedure>
<softKey_procedure>
<active>false</active>
<category>1</category>
<category>4</category>
<operatorConfirmationNeeded>true</operatorConfirmationNeeded>
<plcId>13</plcId>
<localizedNames>
<lang langKey="en">Reset hours pump 2</lang>
<lang langKey="it">Reset contaore pompa 2</lang>
</localizedNames>
<visible>true</visible>
<visible>false</visible>
</softKey_procedure>
<softKey_procedure>
<active>false</active>
<category>1</category>
<category>4</category>
<operatorConfirmationNeeded>true</operatorConfirmationNeeded>
<plcId>14</plcId>
<localizedNames>
<lang langKey="en">Reset hours pump 3</lang>
<lang langKey="it">Reset contaore pompa 3</lang>
</localizedNames>
<visible>true</visible>
<visible>false</visible>
</softKey_procedure>
<softKey_procedure>
<active>true</active>
<category>1</category>
<category>4</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>15</plcId>
<localizedNames>
@@ -174,7 +187,7 @@
<softKey_procedure>
<active>true</active>
<category>1</category>
<category>4</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>16</plcId>
<localizedNames>
@@ -186,7 +199,7 @@
<softKey_procedure>
<active>true</active>
<category>4</category>
<category>3</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>17</plcId>
<localizedNames>
@@ -198,7 +211,7 @@
<softKey_procedure>
<active>true</active>
<category>4</category>
<category>3</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>18</plcId>
<localizedNames>
@@ -210,7 +223,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>3</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>19</plcId>
<localizedNames>
@@ -222,7 +235,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>3</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>20</plcId>
<localizedNames>
@@ -234,7 +247,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>3</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>21</plcId>
<localizedNames>
@@ -246,7 +259,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>3</category>
<operatorConfirmationNeeded>true</operatorConfirmationNeeded>
<plcId>22</plcId>
<localizedNames>
@@ -254,11 +267,13 @@
<lang langKey="it">Ventose setup</lang>
</localizedNames>
<visible>true</visible>
<refCallParam>cycle_loader_enable</refCallParam>
<refCallLabel>cycle_loader_enable_button</refCallLabel>
</softKey_procedure>
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>3</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>23</plcId>
<localizedNames>
@@ -270,7 +285,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>3</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>24</plcId>
<localizedNames>
@@ -282,7 +297,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>3</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>25</plcId>
<localizedNames>
@@ -294,7 +309,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>3</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>26</plcId>
<localizedNames>
@@ -306,7 +321,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>3</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>27</plcId>
<localizedNames>
@@ -318,7 +333,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>2</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>28</plcId>
<localizedNames>
@@ -330,7 +345,7 @@
<softKey_procedure>
<active>false</active>
<category>7</category>
<category>2</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>29</plcId>
<localizedNames>
@@ -342,12 +357,12 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>2</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>30</plcId>
<localizedNames>
<lang langKey="en">Frame X</lang>
<lang langKey="it">Apertura cornice</lang>
<lang langKey="it">Larghezza cornice</lang>
</localizedNames>
<visible>true</visible>
<refCallParam>general_sizes_frame_dim_x</refCallParam>
@@ -356,7 +371,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>2</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>31</plcId>
<localizedNames>
@@ -370,7 +385,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>2</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>32</plcId>
<localizedNames>
@@ -384,7 +399,7 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>2</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>33</plcId>
<localizedNames>
@@ -398,33 +413,21 @@
<softKey_procedure>
<active>true</active>
<category>7</category>
<category>2</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>34</plcId>
<localizedNames>
<lang langKey="en">Preheating cycles</lang>
<lang langKey="it">Cicli di preriscaldo</lang>
<lang langKey="en">Windowplate Up</lang>
<lang langKey="it">Piastrafinestra su</lang>
</localizedNames>
<visible>true</visible>
</softKey_procedure>
<softKey_procedure>
<active>false</active>
<category>7</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>35</plcId>
<localizedNames>
<lang langKey="en">Loader Cycle Start</lang>
<lang langKey="it">Start Ciclo Caricatore</lang>
</localizedNames>
<visible>true</visible>
<refCallParam>cycle_loader_enable</refCallParam>
<refCallLabel>cycle_loader_enable_button</refCallLabel>
</softKey_procedure>
<softKey_procedure>
<active>true</active>
<category>1</category>
<category>7</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>36</plcId>
<localizedNames>
@@ -438,7 +441,7 @@
<softKey_procedure>
<active>true</active>
<category>1</category>
<category>7</category>
<operatorConfirmationNeeded>false</operatorConfirmationNeeded>
<plcId>37</plcId>
<localizedNames>
+11 -11
View File
@@ -552,17 +552,17 @@
"233": 0
},
"RecipeOverview": {
"General": "HasError",
"Positions": "HasError",
"Cycle": "ChangedOk",
"Heats": "ChangedOk",
"Pyrometer": "ChangedOk",
"Drawing": "ChangedOk",
"UpperPlate": "ChangedOk",
"Cooling": "HasError",
"Vacuum": "ChangedOk",
"Extraction": "ChangedOk",
"Options": "HasError"
"General": "Unchanged",
"Positions": "Unchanged",
"Cycle": "Unchanged",
"Heats": "Unchanged",
"Pyrometer": "Unchanged",
"Drawing": "Unchanged",
"UpperPlate": "Unchanged",
"Cooling": "Unchanged",
"Vacuum": "Unchanged",
"Extraction": "Unchanged",
"Options": "Unchanged"
},
"TC_last": 2532.940840175
}
-2
View File
@@ -810,8 +810,6 @@ public static class ThreadsFunctions
MessageServices.Current.Publish(SEND_THERMO_RECIPE_FULL, null, currRecipe);
// FIXME TODO verificare come ridurre chiamate
// ora gestisco la overview!
libraryError = ncAdapter.GetRecipeOverview(out Dictionary<RecipeSection, RecipeCatStatus> currOverview);
if (libraryError.IsError())
@@ -67,8 +67,9 @@ namespace Thermo.Active.Database.Controllers
/// <param name="VacuumReadVal"></param>
/// <param name="MouldEnergyOUT"></param>
/// <param name="MouldEnergyIN"></param>
/// <param name="IsScrap"></param>
/// <returns></returns>
public ProdInfoModel Create(short NumTarget, short NumDone, int TimeWarm, int TimeVent, int TimeVacuum, int TimeCycleGross, int TimeCycleNet, double MaterialTempEndWarm, double MaterialTempEndVent, double MoldTemp, double VacuumReadVal, double MouldEnergyOUT, double MouldEnergyIN)
public ProdInfoModel Create(short NumTarget, short NumDone, int TimeWarm, int TimeVent, int TimeVacuum, int TimeCycleGross, int TimeCycleNet, double MaterialTempEndWarm, double MaterialTempEndVent, double MoldTemp, double VacuumReadVal, double MouldEnergyOUT, double MouldEnergyIN, bool IsScrap)
{
// Create database machine model
ProdInfoModel prodData = new ProdInfoModel()
@@ -86,7 +87,8 @@ namespace Thermo.Active.Database.Controllers
MoldTemp = MoldTemp,
VacuumReadVal = VacuumReadVal,
MouldEnergyOUT = MouldEnergyOUT,
MouldEnergyIN = MouldEnergyIN
MouldEnergyIN = MouldEnergyIN,
IsScrap = IsScrap
};
try
{
@@ -100,6 +102,33 @@ namespace Thermo.Active.Database.Controllers
return prodData;
}
/// <summary>
/// Process table and set as scrap by num value
/// </summary>
/// <param name="maxKeep"></param>
/// <returns></returns>
public bool SetScrap(int num, bool isScrap)
{
bool answ = false;
var currRecord = dbCtx
.ProdInfo
.Where(x => x.NumDone == num)
.SingleOrDefault();
try
{
if (currRecord != null)
{
currRecord.IsScrap = isScrap;
}
// save!
dbCtx.SaveChanges();
answ = true;
}
catch
{ }
return answ;
}
/// <summary>
/// Process table and keep only maxKeep most recent ones
@@ -0,0 +1,29 @@
// <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 AddedScrapPartMgmt : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(AddedScrapPartMgmt));
string IMigrationMetadata.Id
{
get { return "202009021558544_AddedScrapPartMgmt"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,18 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class AddedScrapPartMgmt : DbMigration
{
public override void Up()
{
AddColumn("dbo.ProdInfo", "IsScrap", c => c.Boolean(nullable: false));
}
public override void Down()
{
DropColumn("dbo.ProdInfo", "IsScrap");
}
}
}
File diff suppressed because one or more lines are too long
@@ -131,6 +131,10 @@
<Compile Include="Migrations\202006170558519_AddedProdInfoModel.Designer.cs">
<DependentUpon>202006170558519_AddedProdInfoModel.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202009021558544_AddedScrapPartMgmt.cs" />
<Compile Include="Migrations\202009021558544_AddedScrapPartMgmt.Designer.cs">
<DependentUpon>202009021558544_AddedScrapPartMgmt.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Redis\redUtil.cs" />
@@ -173,6 +177,9 @@
<EmbeddedResource Include="Migrations\202006170558519_AddedProdInfoModel.resx">
<DependentUpon>202006170558519_AddedProdInfoModel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202009021558544_AddedScrapPartMgmt.resx">
<DependentUpon>202009021558544_AddedScrapPartMgmt.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -25,6 +25,7 @@ namespace Thermo.Active.Model.DTOModels.ThProd
public double VacuumReadVal { get; set; } = 0;
public double MouldEnergyOUT { get; set; } = 0;
public double MouldEnergyIN { get; set; } = 0;
public bool IsScrap { get; set; } = false;
public override bool Equals(object obj)
{
@@ -60,6 +61,8 @@ namespace Thermo.Active.Model.DTOModels.ThProd
return false;
if (MouldEnergyIN != item.MouldEnergyIN)
return false;
if (IsScrap != item.IsScrap)
return false;
return true;
}
@@ -88,6 +91,7 @@ namespace Thermo.Active.Model.DTOModels.ThProd
this.VacuumReadVal = pimRawData.VacuumReadVal;
this.MouldEnergyIN = pimRawData.MouldEnergyIN;
this.MouldEnergyOUT = pimRawData.MouldEnergyOUT;
this.IsScrap = pimRawData.IsScrap;
}
}
}
@@ -42,6 +42,8 @@ namespace Thermo.Active.Model.DatabaseModels
public double MouldEnergyOUT { get; set; }
[Column("MouldEnergyIN")]
public double MouldEnergyIN { get; set; }
[Column("IsScrap")]
public bool IsScrap { get; set; }
}
}
+108 -52
View File
@@ -3,6 +3,7 @@ using CMS_CORE_Library.Models;
using CMS_CORE_Library.S7Net;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.Linq;
using Thermo.Active.Database.Controllers;
@@ -53,6 +54,46 @@ namespace Thermo.Active.NC
/// </summary>
public static LiveData RecipeLiveData = new LiveData();
/// <summary>
/// Max number of param writable as single operation
/// </summary>
public int nMaxParamWrite
{
get
{
int answ = 5;
int.TryParse(ConfigurationManager.AppSettings["nMaxParamWrite"], out answ);
return answ;
}
}
/// <summary>
/// Delay between single param write operation
/// </summary>
public int delayParamWrite
{
get
{
int answ = 5;
int.TryParse(ConfigurationManager.AppSettings["delayParamWrite"], out answ);
return answ;
}
}
/// <summary>
/// Parametro lambda per EWMA smoothing
/// </summary>
public double ewmaLambda
{
get
{
int answ = 50;
int.TryParse(ConfigurationManager.AppSettings["ewmaPar100"], out answ);
return (double)answ / 100;
}
}
public NcAdapter() =>
// Choose NC
numericalControl = SetNumericalControl();
@@ -388,7 +429,7 @@ namespace Thermo.Active.NC
}
}
// se si in questo caso scrivo configurazione attuale...
WriteRecipeParams(updtRecipe);
WriteRecipeParams(updtRecipe, nMaxParamWrite, delayParamWrite);
// Ack !
libraryError = numericalControl.PLC_WAckConfRecipeRequest();
if (libraryError.IsError())
@@ -1400,7 +1441,9 @@ namespace Thermo.Active.NC
currentProdPanel.LastCadenza = Math.Round((double)3600000 / lastProdInfoData.TimeCycleGross, 2);
}
// stima durata da pz fatti...
currentProdPanel.StimaDurata = Math.Round((currentProdPanel.NumTarget - currentProdPanel.NumDone) * currentProdPanel.LastTCiclo, 2);
//currentProdPanel.StimaDurata = Math.Round((currentProdPanel.NumTarget - currentProdPanel.NumDone) * currentProdPanel.LastTCiclo, 2);
// 2020.09.03 uso dati da ricetta corrente... stimata con EWMA
currentProdPanel.StimaDurata = Math.Round((currentProdPanel.NumTarget - currentProdPanel.NumDone) * RecipeLiveData.TC_last, 2);
// se stima negativa (+ pezzi di quanti richiesti...) --> ZERO!
currentProdPanel.StimaDurata = currentProdPanel.StimaDurata < 0 ? 0 : currentProdPanel.StimaDurata;
}
@@ -1443,31 +1486,6 @@ namespace Thermo.Active.NC
numTcOk++;
}
}
#if DEBUG
// creo una perturubazione...
var rand = new Random();
int slope = TS_TC.Count / 2;
Dictionary<int, double> origTcData = new Dictionary<int, double>();
foreach (var item2fix in TS_TC)
{
origTcData.Add(item2fix.Key, item2fix.Value);
}
foreach (var origVal in origTcData)
{
TS_TC[origVal.Key] = Math.Round(origVal.Value + (rand.NextDouble() * 20 - 10) + slope, 2);
slope--;
if (TS_Cad.ContainsKey(origVal.Key))
{
TS_Cad[origVal.Key] = Math.Round((double)3600 / TS_TC[origVal.Key], 2);
}
else
{
TS_Cad.Add(origVal.Key, Math.Round((double)3600 / TS_TC[origVal.Key], 2));
}
}
#endif
// accodo!
currentProdPanel.TS_Cadenza = TS_Cad;
currentProdPanel.TS_TCiclo = TS_TC;
@@ -1498,7 +1516,7 @@ namespace Thermo.Active.NC
}
/// <summary>
/// Lettura dati ProdInfo
/// Lettura dati ProdInfo (LIVE)
/// </summary>
/// <param name="prodInfoData"></param>
/// <returns></returns>
@@ -1513,20 +1531,24 @@ namespace Thermo.Active.NC
// converto 1:1 dati da ThermoModels.ProdInfoModel --> DTOProdInfo
prodInfoData = new DTOProdInfo(prodInfoRawData);
// 2020.09.02: incremento di 1 il NUMERO dei pezzi, in modo che mostro il pezzo corrente (n=fatti + 1)
prodInfoData.NumDone++;
// if lastProdInfo is missing --> populate!
if (lastProdInfoData == null)
lastProdInfoData = prodInfoRawData;
// se ho update OPPURE differenza di lettura..., sennò restituisco ultima lettura...
// se ho update da strobe OPPURE differenza di lettura..., sennò restituisco ultima lettura...
if (ThermoProdUpdatedStr || (lastProdInfoData.NumDone != prodInfoRawData.NumDone))
{
// do comparison with old record and if changed --> persist on DB!
if (!prodInfoRawData.Equals(lastProdInfoData))
{
// save on DB!
// save on DB! attenzione: RAW DATA perché salvo pezzo PRECEDENTE...
using (ProdInfoController prodInfoController = new ProdInfoController())
prodInfoController.Create(prodInfoRawData.NumTarget, prodInfoRawData.NumDone, prodInfoRawData.TimeWarm, prodInfoRawData.TimeVent, prodInfoRawData.TimeVacuum, prodInfoRawData.TimeCycleGross, prodInfoRawData.TimeCycleNet, prodInfoRawData.MaterialTempEndWarm, prodInfoRawData.MaterialTempEndVent, prodInfoRawData.MoldTemp, prodInfoRawData.VacuumReadVal, prodInfoRawData.MouldEnergyOUT, prodInfoRawData.MouldEnergyIN);
{
prodInfoController.Create(prodInfoRawData.NumTarget, prodInfoRawData.NumDone, prodInfoRawData.TimeWarm, prodInfoRawData.TimeVent, prodInfoRawData.TimeVacuum, prodInfoRawData.TimeCycleGross, prodInfoRawData.TimeCycleNet, prodInfoRawData.MaterialTempEndWarm, prodInfoRawData.MaterialTempEndVent, prodInfoRawData.MoldTemp, prodInfoRawData.VacuumReadVal, prodInfoRawData.MouldEnergyOUT, prodInfoRawData.MouldEnergyIN, false);
}
// update last info data
lastProdInfoData = prodInfoRawData;
@@ -1555,15 +1577,16 @@ namespace Thermo.Active.NC
lastProdEnd = DateTime.Now;
// calcolo ultimo ciclo...
var lastDuration = lastProdEnd.Subtract(lastProdStart).TotalSeconds;
// se il valore SALVATO è > 3 * valore rilevato (ma NON inferiore a 1/3...) --> uso SOLO ultimo
if ((lastCycle > 3 * lastDuration) && (lastCycle / 3 < lastDuration))
// se il valore SALVATO è > 3 * valore rilevato --> uso SOLO ultimo
if (lastCycle > 3 * lastDuration)
{
lastCycle = lastDuration;
}
// altrimenti EWMA 50%
// altrimenti EWMA da parametro calcolato standard, default 50%
else
{
lastCycle = 0.5 * lastCycle + 0.5 * lastDuration;
//lastCycle = 0.5 * lastCycle + 0.5 * lastDuration;
lastCycle = ewmaLambda * lastDuration + (1 - ewmaLambda) * lastCycle;
}
// salvo anche nei live data della ricetta...
RecipeLiveData.TC_last = lastCycle;
@@ -1609,26 +1632,45 @@ namespace Thermo.Active.NC
MoldTemp = x.MoldTemp,
VacuumReadVal = x.VacuumReadVal,
MouldEnergyOUT = x.MouldEnergyOUT,
MouldEnergyIN = x.MouldEnergyIN
MouldEnergyIN = x.MouldEnergyIN,
IsScrap = x.IsScrap
}).ToList();
}
return libraryError;
}
/// <summary>
/// Get historical prodinfo data from DB
/// </summary>
/// <param name="num"></param>
/// <param name="isScrap"></param>
/// <returns></returns>
public CmsError SetScrap(int num, bool isScrap)
{
CmsError libraryError = NO_ERROR;
using (ProdInfoController prodInfoController = new ProdInfoController())
{
prodInfoController.SetScrap(num, isScrap);
}
return libraryError;
}
/// <summary>
/// Update requested prod quantity
/// </summary>
/// <param name="numTarget"></param>
/// <param name="newWorkOrder"></param>
/// <param name="numTarget">Total qty requested</param>
/// <param name="newWorkOrder">Reset counter = new order</param>
/// <param name="preWarmCycle">Number of pre-warm cycle requested</param>
/// <returns></returns>
public CmsError UpdateProdInfoData(short numTarget, bool newWorkOrder)
public CmsError UpdateProdInfoData(short numTarget, bool newWorkOrder, short preWarmCycle)
{
CmsError libraryError = NO_ERROR;
using (ProdInfoController prodInfoController = new ProdInfoController())
{
// registro dati aggiornati sul PLC
libraryError = numericalControl.PLC_WProdInfo(numTarget, newWorkOrder);
libraryError = numericalControl.PLC_WProdInfo(numTarget, newWorkOrder, preWarmCycle);
if (libraryError.IsError())
return libraryError;
@@ -1782,9 +1824,11 @@ namespace Thermo.Active.NC
/// <summary>
/// Recipe Parameters write to PLC (only SetpointHMI)
/// </summary>
/// <param name="updtRecipe"></param>
/// <param name="updtRecipe">Oggetto parametri da aggiornare (from HMI)</param>
/// <param name="nMaxParamWrite">num max parametri da scrivere singolarmente</param>
/// <param name="delayParamWrite">delay in scriottura multi parametri singoli</param>
/// <returns></returns>
public CmsError WriteRecipeParametersToPLC(Dictionary<string, DTORecipeParam> updtRecipe)
public CmsError WriteRecipeParametersToPLC(Dictionary<string, DTORecipeParam> updtRecipe, int nMaxParamWrite, int delayParamWrite)
{
Dictionary<int, int> newParameters = new Dictionary<int, int>();
// solo x S7...
@@ -1796,7 +1840,7 @@ namespace Thermo.Active.NC
newParameters.Add(item.Value.Id, (int)(item.Value.SetpointHMI * item.Value.ScaleFactor));
}
// scrivo!
CmsError libraryError = numericalControl.PLC_WRecipeParameters(newParameters);
CmsError libraryError = numericalControl.PLC_WRecipeParameters(newParameters, nMaxParamWrite, delayParamWrite);
if (libraryError.IsError())
return libraryError;
}
@@ -2266,10 +2310,12 @@ namespace Thermo.Active.NC
/// Scrive tutti i parametri della ricetta indicati
/// </summary>
/// <param name="updtRecipe">Oggetto parametri da aggiornare (from HMI)</param>
/// <param name="nMaxParamWrite">num max parametri da scrivere singolarmente</param>
/// <param name="delayParamWrite">delay in scriottura multi parametri singoli</param>
/// <returns></returns>
public CmsError WriteRecipeParams(Dictionary<string, DTORecipeParam> updtRecipe)
public CmsError WriteRecipeParams(Dictionary<string, DTORecipeParam> updtRecipe, int nMaxParamWrite, int delayParamWrite)
{
CmsError libraryError = WriteRecipeParametersToPLC(updtRecipe);
CmsError libraryError = WriteRecipeParametersToPLC(updtRecipe, nMaxParamWrite, delayParamWrite);
return libraryError;
}
@@ -2284,6 +2330,7 @@ namespace Thermo.Active.NC
CmsError libraryError = NO_ERROR;
// overview di base: ultima salvata...
currOverview = new Dictionary<RecipeSection, RecipeCatStatus>();
var err2fix = new Dictionary<RecipeSection, RecipeCatStatus>();
// leggo la ricetta dal PLC!
var currRecipe = new Dictionary<string, DTORecipeParam>();
@@ -2309,15 +2356,13 @@ namespace Thermo.Active.NC
RecipeCatStatus currStatus = RecipeCatStatus.Unchanged;
// 2020.08.27: faccio SEMPRE il calcolo degli stati, non rileggo e poi verifico...
#if false
// da conf ricetta --> se ci sono li leggo da li...
if (NcFileAdapter.RecipeLiveData.RecipeOverview != null)
{
currOverview = NcFileAdapter.RecipeLiveData.RecipeOverview;
}
#endif
}
// verifico eventualmente se mancasse qualcosa...
bool changed = false;
foreach (var item in recipeConfig)
{
@@ -2327,6 +2372,19 @@ namespace Thermo.Active.NC
changed = true;
}
}
// ricerco SE co fossero errori --> reset come changedOK
foreach (var item in currOverview)
{
if (item.Value == RecipeCatStatus.HasError)
err2fix.Add(item.Key, RecipeCatStatus.ChangedOk);
}
foreach (var item in err2fix)
{
currOverview[item.Key] = item.Value;
changed = true;
}
// se cambiato --> salvo in live data...
if (changed)
{
@@ -2360,8 +2418,6 @@ namespace Thermo.Active.NC
}
}
}
// salvo!
NcFileAdapter.RecipeLiveData.RecipeOverview = currOverview;
// restituisco cod errore se trovato
return libraryError;
+1
View File
@@ -37,6 +37,7 @@
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
+6 -3
View File
@@ -14,6 +14,9 @@
<add key="enableDirectoryBrowsing" value="true" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="ServerServiceName" value="MariaDB" />
<add key="nMaxParamWrite" value="5" />
<add key="delayParamWrite" value="10" />
<add key="ewmaPar100" value="40" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.6.2" />
@@ -108,7 +111,7 @@
<add name="SignalR-Bus" />
</listeners>
</source>
<source name="SignalR.Transports.WebSocketTransport">
<!-- <source name="SignalR.Transports.WebSocketTransport">
<listeners>
<add name="SignalR-Transports" />
</listeners>
@@ -132,7 +135,7 @@
<listeners>
<add name="SignalR-Transports" />
</listeners>
</source>
</source> -->
<source name="SignalR.ReflectedHubDescriptorProvider">
<listeners>
<add name="SignalR-Init" />
@@ -146,7 +149,7 @@
<!-- Specifies the trace writer for output -->
<sharedListeners>
<!-- Listener for transport events -->
<add name="SignalR-Transports" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs/transports.log" />
<!--<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 -->
@@ -45,6 +45,7 @@ namespace Thermo.Active.Controllers.WebApi
// ritorno solo fatto!
return Ok();
}
#if true
/// <summary>
/// Request mode AUTO
/// </summary>
@@ -71,7 +72,8 @@ namespace Thermo.Active.Controllers.WebApi
// ritorno solo fatto!
return Ok();
}
}
#endif
/// <summary>
/// Request mode SETUP
/// </summary>
@@ -100,9 +102,42 @@ namespace Thermo.Active.Controllers.WebApi
return Ok();
}
/// <summary>
/// Set item as scrap
/// </summary>
/// <param name="num">item NUM</param>
/// <param name="isScrap">scrap flag (true/false)</param>
/// <returns></returns>
[Route("setScrap"), HttpPut]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.RECIPE_MANAGER, Action = ACTIONS.READ)]
public IHttpActionResult SetScrap(int num, bool isScrap)
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"NC Not connected! | SetScrap | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// scrivo sul DB che il pezzo è SCRAPPED
libraryError = ncAdapter.SetScrap(num, isScrap);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"SetScrap error | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// ritorno solo fatto!
return Ok();
}
/// <summary>
/// Request start production
/// </summary>
/// <param name="requestQty">item NUM</param>
/// <param name="newWorkOrder">scrap flag (true/false)</param>
/// <returns></returns>
[Route("start"), HttpPut]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.RECIPE_MANAGER, Action = ACTIONS.READ)]
@@ -116,19 +151,73 @@ namespace Thermo.Active.Controllers.WebApi
return BadRequest(libraryError.localizationKey);
}
// scrivo sul PLC il comando strobe richiesta AUTO!
libraryError = ncAdapter.UpdateProdInfoData((short)requestQty, newWorkOrder);
// legacy method
short numCicliRisc = 0;
// scrivo sul PLC pezzi richiesti, cicli riscaldo + comando strobe reset se encessario!
libraryError = ncAdapter.UpdateProdInfoData((short)requestQty, newWorkOrder, numCicliRisc);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"StartProd error | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// se new workorder --> registro nuova data lorro!
// se new workorder --> registro nuova data x start lotto!
if (newWorkOrder)
{
ncAdapter.lottoStart = DateTime.Now;
}
// scrivo sul PLC il comando strobe richiesta AUTO!
libraryError = ncAdapter.StrobeMode(Mode.AUTO);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"RequestAuto error | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// ritorno solo fatto!
return Ok();
}
/// <summary>
/// Request start production
/// </summary>
/// <param name="requestQty">item NUM</param>
/// <param name="newWorkOrder">scrap flag (true/false)</param>
/// <param name="numCicliRisc">warmup cycle requested (0=none)</param>
/// <returns></returns>
[Route("startFull"), HttpPut]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.RECIPE_MANAGER, Action = ACTIONS.READ)]
public IHttpActionResult StartProdFull(int requestQty, bool newWorkOrder, int numCicliRisc)
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"NC Not connected! | StartProd | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// scrivo sul PLC pezzi richiesti, cicli riscaldo + comando strobe reset se encessario!
libraryError = ncAdapter.UpdateProdInfoData((short)requestQty, newWorkOrder, (short)numCicliRisc);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"StartProd error | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// se new workorder --> registro nuova data x start lotto!
if (newWorkOrder)
{
ncAdapter.lottoStart = DateTime.Now;
}
// scrivo sul PLC il comando strobe richiesta AUTO!
libraryError = ncAdapter.StrobeMode(Mode.AUTO);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"RequestAuto error | {libraryError.exception}");
return BadRequest(libraryError.localizationKey);
}
// ritorno solo fatto!
return Ok();
}
@@ -1,6 +1,7 @@
using CMS_CORE_Library.Models;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net;
@@ -118,8 +119,8 @@ namespace Thermo.Active.Controllers.WebApi
if (updtRecipe.Count > 0)
{
// scrivo sul PLC
ncAdapter.WriteRecipeParams(updtRecipe);
// scrivo sul PLC con i parametri specificati x ritardo/raggruppamento
ncAdapter.WriteRecipeParams(updtRecipe, ncAdapter.nMaxParamWrite, ncAdapter.delayParamWrite);
}
// ritorno solo fatto!
@@ -166,16 +167,13 @@ namespace Thermo.Active.Controllers.WebApi
}
// SE HO una section != null/empty --> salvo come modificata...
if (section != null)
try
{
try
{
NcFileAdapter.upsRecipeOverview(section, RecipeCatStatus.ChangedOk);
}
catch (Exception exc)
{
ThermoActiveLogger.LogError($"Error on set recipe overview | section: {section}{Environment.NewLine}{exc}");
}
NcFileAdapter.upsRecipeOverview(section, RecipeCatStatus.ChangedOk);
}
catch (Exception exc)
{
ThermoActiveLogger.LogError($"Error on set recipe overview | section: {section}{Environment.NewLine}{exc}");
}
// recupero i dati LIVE dei parametri HMI della ricetta...
@@ -506,7 +504,7 @@ namespace Thermo.Active.Controllers.WebApi
}
// salvo note...
if(!string.IsNullOrEmpty(recipeNotes))
if (!string.IsNullOrEmpty(recipeNotes))
{
NcFileAdapter.RecipeLiveData.recipeNotes = recipeNotes.Trim();
}
@@ -624,7 +622,7 @@ namespace Thermo.Active.Controllers.WebApi
}
// write to PLC
checkError = ncAdapter.WriteRecipeParams(updtRecipe);
checkError = ncAdapter.WriteRecipeParams(updtRecipe, ncAdapter.nMaxParamWrite, ncAdapter.delayParamWrite);
if (checkError.IsError())
{
ThermoActiveLogger.LogError($"WriteCurrentRecipeToPlc | WriteRecipeParams error | {checkError.exception}");
@@ -78,12 +78,6 @@ namespace Thermo.Active.Listeners
SignalRListener.SendPartProgramQueue(a);
SignalRDatabaseHandler.UpdateQueue(a);
}));
#if false
infos.Add(MessageServices.Current.Subscribe(SEND_M155_DATA, (a, b) =>
{
SignalRListener.SendM155Data(a);
}));
#endif
infos.Add(MessageServices.Current.Subscribe(SEND_SCADA_DATA, (a, b) =>
{
SignalRListener.SendScadaData(a);
@@ -514,10 +514,7 @@ namespace Thermo.Active.Listeners.SignalR
group.magazineIsActive(LastNcMagazineIsActive);
// Send PP Queue
group.partProgramQueue(LastPartProgramQueue);
#if false
// Send m155 data
group.m155Data(LastM155Data);
#endif
// Send Scada
group.scadaData(LastScadaData);
+1 -1
View File
@@ -30,4 +30,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("0.11.62")]
[assembly: AssemblyVersion("0.12.69")]
@@ -439,18 +439,19 @@ fieldset[disabled] .form-group.is-focused .togglebutton label {
color: #fff;
}
.togglebutton.big {
.togglebutton.big,
.togglebutton.big[disabled] {
span.toggle {
height: 40px;
width: 112px;
border-radius: 20px;
font-size: 17px;
line-height: 40px;
font-weight: bold;
height: 40px !important;
width: 112px !important;
border-radius: 20px !important;
font-size: 17px !important;
line-height: 40px !important;
font-weight: bold !important;
&:after {
width: 36px;
height: 36px;
width: 36px !important;
height: 36px !important;
}
}
@@ -143,6 +143,60 @@
margin-left: 5px;
margin-right: 5px;
}
.context-menu {
position: relative;
.context-area {
top: 50px;
display: none;
background-color: #fff;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
position: absolute;
width: 300px;
left: -150px + 24px;
padding-inline-start: 0;
padding-inline-end: 0;
&.show {
display: block !important;
}
li {
list-style-type: none;
height: 62px;
border-bottom: 1px solid rgba(0, 0, 0, 0.5);
color: #545454;
display: flex;
align-items: center;
justify-content: flex-start;
padding: 0 28px;
font-weight: 500;
font-size: 18px;
cursor: pointer;
&:last-of-type {
border-bottom: none;
}
}
&:before {
content: "";
position: absolute;
top: -15px;
left: calc(~'50% - 8px');
display: block;
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 15px solid #fff;
}
}
}
}
.colorWhite {
@@ -51,6 +51,7 @@
@import "report.less";
@import "users.less";
@import "tooltip.less";
@import "saveas.less";
@background-color: rgb(216, 216, 216);
@@ -0,0 +1,34 @@
// out: false, sourceMap: false, main: ../style.less
.modal.save-as {
width: 500px;
height: 300px;
top: calc(~'50% - 200px');
article {
label {
color: #002680;
font-size: 24px;
font-weight: 500;
overflow: hidden;
margin-bottom: 10px;
}
input {
padding: 5px;
font-size: 18px;
font-weight: 500;
color: #6d6d6d;
width: 100%;
height: 48px;
border-radius: 2px;
box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.5);
border: none;
display: flex;
flex-flow: row nowrap;
padding: 0 4px;
align-items: center;
justify-content: stretch;
}
}
}
+93 -11
View File
@@ -6032,19 +6032,22 @@ fieldset[disabled] .form-group.is-focused .togglebutton label {
background-image: linear-gradient(to bottom, #3fa4ff, #1791ff);
color: #fff;
}
.togglebutton.big span.toggle {
height: 40px;
width: 112px;
border-radius: 20px;
font-size: 17px;
line-height: 40px;
font-weight: bold;
.togglebutton.big span.toggle,
.togglebutton.big[disabled] span.toggle {
height: 40px !important;
width: 112px !important;
border-radius: 20px !important;
font-size: 17px !important;
line-height: 40px !important;
font-weight: bold !important;
}
.togglebutton.big span.toggle:after {
width: 36px;
height: 36px;
.togglebutton.big span.toggle:after,
.togglebutton.big[disabled] span.toggle:after {
width: 36px !important;
height: 36px !important;
}
.togglebutton.big input[type=checkbox]:checked + .toggle:after {
.togglebutton.big input[type=checkbox]:checked + .toggle:after,
.togglebutton.big[disabled] input[type=checkbox]:checked + .toggle:after {
left: 74px;
}
.custom-checkbox {
@@ -6284,6 +6287,57 @@ fieldset[disabled] .form-group.is-focused .togglebutton label {
margin-left: 5px;
margin-right: 5px;
}
#app > header .context-menu,
.dashboard > header .context-menu {
position: relative;
}
#app > header .context-menu .context-area,
.dashboard > header .context-menu .context-area {
top: 50px;
display: none;
background-color: #fff;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
position: absolute;
width: 300px;
left: -126px;
padding-inline-start: 0;
padding-inline-end: 0;
}
#app > header .context-menu .context-area.show,
.dashboard > header .context-menu .context-area.show {
display: block !important;
}
#app > header .context-menu .context-area li,
.dashboard > header .context-menu .context-area li {
list-style-type: none;
height: 62px;
border-bottom: 1px solid rgba(0, 0, 0, 0.5);
color: #545454;
display: flex;
align-items: center;
justify-content: flex-start;
padding: 0 28px;
font-weight: 500;
font-size: 18px;
cursor: pointer;
}
#app > header .context-menu .context-area li:last-of-type,
.dashboard > header .context-menu .context-area li:last-of-type {
border-bottom: none;
}
#app > header .context-menu .context-area:before,
.dashboard > header .context-menu .context-area:before {
content: "";
position: absolute;
top: -15px;
left: calc(50% - 8px);
display: block;
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 15px solid #fff;
}
.colorWhite {
color: #fff !important;
}
@@ -23739,6 +23793,34 @@ footer .container button.big:before {
text-align: center;
color: #4b4b4b;
}
.modal.save-as {
width: 500px;
height: 300px;
top: calc(50% - 200px);
}
.modal.save-as article label {
color: #002680;
font-size: 24px;
font-weight: 500;
overflow: hidden;
margin-bottom: 10px;
}
.modal.save-as article input {
padding: 5px;
font-size: 18px;
font-weight: 500;
color: #6d6d6d;
width: 100%;
height: 48px;
border-radius: 2px;
box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.5);
border: none;
display: flex;
flex-flow: row nowrap;
padding: 0 4px;
align-items: center;
justify-content: stretch;
}
a,
a:visited,
a:hover,
+124 -124
View File
@@ -1960,6 +1960,37 @@
"yorkie": "^2.0.0"
},
"dependencies": {
"ajv": {
"version": "6.12.4",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz",
"integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==",
"dev": true,
"optional": true,
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"ajv-keywords": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
"dev": true,
"optional": true
},
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"dev": true,
"optional": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
@@ -1969,6 +2000,30 @@
"fill-range": "^7.0.1"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true,
"optional": true
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
@@ -1978,6 +2033,46 @@
"to-regex-range": "^5.0.1"
}
},
"fork-ts-checker-webpack-plugin-v5": {
"version": "npm:fork-ts-checker-webpack-plugin@5.1.0",
"resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.1.0.tgz",
"integrity": "sha512-vuKyEjSLGbhQbEr5bifXXOkr9iV73L6n72mHoHIv7okvrf7O7z6RKeplM6C6ATPsukoQivij+Ba1vcptL60Z2g==",
"dev": true,
"optional": true,
"requires": {
"@babel/code-frame": "^7.8.3",
"@types/json-schema": "^7.0.5",
"chalk": "^4.1.0",
"cosmiconfig": "^6.0.0",
"deepmerge": "^4.2.2",
"fs-extra": "^9.0.0",
"memfs": "^3.1.2",
"minimatch": "^3.0.4",
"schema-utils": "2.7.0",
"semver": "^7.3.2",
"tapable": "^1.0.0"
},
"dependencies": {
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
"dev": true,
"optional": true
}
}
},
"globby": {
"version": "9.2.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz",
@@ -1994,6 +2089,13 @@
"slash": "^2.0.0"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"ignore": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
@@ -2022,6 +2124,18 @@
"integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
"dev": true
},
"schema-utils": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz",
"integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==",
"dev": true,
"optional": true,
"requires": {
"@types/json-schema": "^7.0.4",
"ajv": "^6.12.2",
"ajv-keywords": "^3.4.1"
}
},
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
@@ -2034,6 +2148,16 @@
"integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==",
"dev": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
@@ -8327,130 +8451,6 @@
}
}
},
"fork-ts-checker-webpack-plugin-v5": {
"version": "npm:fork-ts-checker-webpack-plugin@5.1.0",
"resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-5.1.0.tgz",
"integrity": "sha512-vuKyEjSLGbhQbEr5bifXXOkr9iV73L6n72mHoHIv7okvrf7O7z6RKeplM6C6ATPsukoQivij+Ba1vcptL60Z2g==",
"dev": true,
"optional": true,
"requires": {
"@babel/code-frame": "^7.8.3",
"@types/json-schema": "^7.0.5",
"chalk": "^4.1.0",
"cosmiconfig": "^6.0.0",
"deepmerge": "^4.2.2",
"fs-extra": "^9.0.0",
"memfs": "^3.1.2",
"minimatch": "^3.0.4",
"schema-utils": "2.7.0",
"semver": "^7.3.2",
"tapable": "^1.0.0"
},
"dependencies": {
"ajv": {
"version": "6.12.4",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz",
"integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==",
"dev": true,
"optional": true,
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"ajv-keywords": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
"dev": true,
"optional": true
},
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"dev": true,
"optional": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"schema-utils": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz",
"integrity": "sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==",
"dev": true,
"optional": true,
"requires": {
"@types/json-schema": "^7.0.4",
"ajv": "^6.12.2",
"ajv-keywords": "^3.4.1"
}
},
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",
"integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
@@ -9,6 +9,7 @@ import { UserInfoDialog, MachineInfoDialog, ContactInfoDialog } from "@/app_modu
import { ModalHelper } from "./components/modals/ModalHelper";
import Vue from "vue";
import { loginService, machineService, localizationService } from "./services";
import { prodService } from "./services/prodService";
// import { UsersService } from "./services/usersService";
@@ -61,6 +62,8 @@ async function loadMachineConfig() {
let mcresult = await machine.getMachineConfiguration();
await prodService.GetProdPanel();
// load default language
if (!(store.state as AppModel).localization.currentLanguage) {
localizationService.changeCurrentLanguage(mcresult.defaultLanguage);
@@ -48,9 +48,10 @@ export default class Numeric extends Vue {
KeyboardHelper.showKeyboard(x, y, this.value);
let textBox = (this.$refs.input as any);
textBox.SelectionStart = textBox.value.length;
textBox.SelectionLength = 0;
this.$nextTick(() => { this.focused = true; })
this.$nextTick(() => {
this.focused = true;
})
}
@@ -1,8 +1,9 @@
import Vue from "vue";
import Component from "vue-class-component";
import { Prop } from 'vue-property-decorator';
import { debounce } from "@/_base/debounce";
import { Hub } from "@/services";
import Numeric from "./numeric";
@Component({ name: "slider" })
export default class Slider extends Vue {
@@ -17,6 +18,8 @@ export default class Slider extends Vue {
@Prop({ default: 1 })
decimal: number;
incrementing: number = 0;
tempValue: number = null;
get actualvalue() {
return this.value.setpointHMI;
@@ -27,11 +30,9 @@ export default class Slider extends Vue {
}
set actualvalue(v: number) {
this.debouncedActualValue(v)
this.value.setpointHMI = v;
}
debouncedActualValue = debounce((v: number) => this.value.setpointHMI = v, 200);
get step() {
// var s = ((this.value.range.max - this.value.range.min) / (this.lines + 1));
// var m = Math.pow(10, this.decimal);
@@ -39,31 +40,43 @@ export default class Slider extends Vue {
return 1;
};
increment() {
startIncrement() {
if (!this.value.status.enabled) return;
this.incrementing = setInterval(() => {
var v = this.value.setpointHMI;
if (v < this.value.range.max) {
v += this.step;
}
if (v > this.value.range.max) {
v = this.value.range.max;
}
this.actualvalue = v;
}, 50);
}
startDecrement() {
if (!this.value.status.enabled) return;
this.incrementing = setInterval(() => {
var v = this.value.setpointHMI;
if (v > this.value.range.min) {
v -= this.step;
}
if (v < this.value.range.min) {
v = this.value.range.min;
}
this.actualvalue = v;
}, 50);
}
confirm() {
if (!this.value.status.enabled) return;
if (this.incrementing)
clearInterval(this.incrementing);
this.incrementing = 0;
var v = this.value.setpointHMI;
if (v < this.value.range.max) {
v += this.step;
}
if (v > this.value.range.max) {
v = this.value.range.max;
}
this.actualvalue = v;
};
decrement() {
if (!this.value.status.enabled) return;
var v = this.value.setpointHMI;
if (v > this.value.range.min) {
v -= this.step;
}
if (v < this.value.range.min) {
v = this.value.range.min;
}
this.actualvalue = v;
};
doSoftKeyClick() {
Hub.Current.sendUserSoftKey(this.softKey.id);
@@ -1,7 +1,7 @@
<template>
<div class="slider-container">
<div class="slider">
<button @click="decrement()">
<button @mousedown="startDecrement()" @mouseup="confirm()" @mouseout="confirm()">
<img src="assets/icons/png/min.png" />
</button>
<div class="control">
@@ -21,7 +21,7 @@
<small>{{`${this.value.range.max} ${this.value.unitMeasure}`}}</small>
</div>
</div>
<button @click="increment()">
<button @mousedown="startIncrement()" @mouseup="confirm()" @mouseout="confirm()">
<img src="assets/icons/png/max.png" />
</button>
</div>
@@ -56,11 +56,11 @@
</div>
<div class="col">
<small>{{'history-item_mouldEnergyIN' | localize("energia utilizzata in")}}</small>
<span>{{value.mouldEnergyIN | round(1)}}kW</span>
<span>{{value.mouldEnergyIN | round(1)}}kWh</span>
</div>
<div class="col">
<small>{{'history-item_mouldEnergyOUT' | localize("energia utilizzata out")}}</small>
<span>{{value.mouldEnergyOUT | round(1)}}kW</span>
<span>{{value.mouldEnergyOUT | round(1)}}kWh</span>
</div>
</div>
</div>
@@ -0,0 +1,34 @@
import Vue from "vue";
import Component from "vue-class-component";
import { Prop } from "vue-property-decorator";
import { Deferred } from "@/services";
import { Modal, ModalHelper } from "@/components/modals";
import { messageService } from "@/_base";
@Component({ components: { modal: Modal } })
export default class Notes extends Vue {
@Prop()
deferred: Deferred<string>;
@Prop()
value: string;
note: string = null;
get Note() {
return this.note || this.value;
}
set Note(value: string) {
this.note = value;
}
save(value: string) {
this.deferred.resolve(this.Note);
ModalHelper.HideModal();
}
close() {
messageService.deleteChannel("esc_pressed");
this.deferred.reject();
ModalHelper.HideModal();
}
}
@@ -0,0 +1,26 @@
<template>
<div class="setup">
<modal type="save-as" :title="'save-as' | localize('Salva con nome')">
<div slot="header-buttons">
<button class="modal-close" @click="close()">
<i class="fa fa-remove"></i>
</button>
</div>
<section>
<article>
<label>{{'recipe_note' | localize('Note della ricetta')}}</label>
<textarea
rows="3"
v-model="Note"
:placeholder="'recipe_note' | localize('Note della ricetta')"
/>
</article>
</section>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize("Annulla")}}</button>
<button class="btn btn-success" @click="save()">{{'confirm' | localize("Conferma")}}</button>
</footer>
</modal>
</div>
</template>
<script src="./changeNotes.ts" lang="ts"></script>
@@ -1,7 +1,36 @@
import Vue from "vue";
import Component from "vue-class-component";
import modal from "@/components/modals/modal.vue";
import { Deferred } from "@/services";
import { Prop } from "vue-property-decorator";
import { messageService } from "@/_base";
import { Modal, ModalHelper } from "@/components/modals";
@Component({})
@Component({ components: { modal: Modal } })
export default class SaveAs extends Vue {
@Prop()
deferred: Deferred<string>;
@Prop()
value: string;
recipeName: string = null;
get RecipeName() {
return this.recipeName || this.value;
}
set RecipeName(value: string) {
this.recipeName = value;
}
save(value: string) {
this.deferred.resolve(this.RecipeName);
ModalHelper.HideModal();
}
close() {
messageService.deleteChannel("esc_pressed");
this.deferred.reject();
ModalHelper.HideModal();
}
}
@@ -8,18 +8,12 @@
</div>
<section>
<article>
<div class="input-area mb-10">
<label>{{'recipe_name' | localize('Nome della ricetta')}}</label>
<input
class="custom"
v-model="searchText"
:placeholder="'recipe_name' | localize('Nome della ricetta')"
/>
</div>
<label>{{'recipe_name' | localize('Nome della ricetta')}}</label>
<input v-model="RecipeName" :placeholder="'recipe_name' | localize('Nome della ricetta')" />
</article>
</section>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize("Annulla")}}</button>
<button class="btn" @click="close()">{{'cancel' | localize("Annulla")}}</button>
<button class="btn btn-success" @click="save()">{{'confirm' | localize("Conferma")}}</button>
</footer>
</modal>
@@ -10,6 +10,7 @@ import { recipeActions } from "@/store/recipe.store";
import { store } from "@/store";
import { Deferred } from '@/services';
import { recipeService } from "@/services/recipeService";
import { debounce } from '@/_base/debounce';
@Component({ components: { modal: Modal, stepfooter: StepFooter, caricatore: Caricatore, cicloformatura: CicloFormatura } })
export default class ShowCicloInfo extends Vue {
@@ -27,7 +28,7 @@ export default class ShowCicloInfo extends Vue {
};
preparePayload() {
get payload() {
return {
cycle_forming_type: this.recipe.cycle_forming_type,
cycle_forming_pause_cycle: this.recipe.cycle_forming_pause_cycle,
@@ -57,19 +58,30 @@ export default class ShowCicloInfo extends Vue {
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
await recipeService.Update(this.preparePayload());
this.debouncedRecipeSave()
};
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
hasErrors() {
let payload = this.preparePayload();
let payload = this.recipe;
let errors = false;
for (const key in this.preparePayload()) {
for (const key in this.recipe) {
const el = payload[key] as Recipe.IValue;
if (el.status.hasError) errors = true;
}
return errors;
}
hasChanges() {
let result = false;
for (const key in this.payload) {
const el = this.payload[key] as Recipe.IValue;
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
hasEnabledFields(...fields: string[]) {
let result = false;
for (const field of fields) {
@@ -114,8 +126,8 @@ export default class ShowCicloInfo extends Vue {
// recipeActions.setCurrent(store, this.recipe);
await recipeService.Confirm('Cycle');
ModalHelper.HideModal();
this.deferred.resolve(1);
// ModalHelper.HideModal();
// this.deferred.resolve(1);
};
goTo(step) {
@@ -17,11 +17,15 @@
<cicloformatura v-if="show==0" :recipe="recipe"></cicloformatura>
<caricatore v-if="show==1" :recipe="recipe"></caricatore>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
<button
class="btn"
@click="annulla()"
:disabled="!hasChanges()"
>{{'cancel' | localize('Annulla')}}</button>
<button
class="btn btn-success"
@click="conferma()"
:disabled="hasErrors()"
:disabled="hasErrors() || !hasChanges()"
>{{'confirm' | localize('Conferma')}}</button>
</footer>
</modal>
@@ -12,6 +12,7 @@ import { recipeActions } from "@/store/recipe.store";
import { store } from "@/store";
import { Deferred } from '@/services';
import { recipeService } from "@/services/recipeService";
import { debounce } from '@/_base/debounce';
@Component({
components: {
@@ -39,10 +40,12 @@ export default class ShowControstampoInfo extends Vue {
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
await recipeService.Update(this.preparePayload());
}
this.debouncedRecipeSave()
};
preparePayload() {
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
get payload() {
return {
upperplate_cycle_type: this.recipe.upperplate_cycle_type,
upperplate_cycle_delay: this.recipe.upperplate_cycle_delay,
@@ -76,15 +79,24 @@ export default class ShowControstampoInfo extends Vue {
}
hasErrors() {
let payload = this.preparePayload();
let payload = this.recipe;
let errors = false;
for (const key in this.preparePayload()) {
for (const key in this.recipe) {
const el = payload[key] as Recipe.IValue;
if (el.status.hasError) errors = true;
}
return errors;
}
hasChanges() {
let result = false;
for (const key in this.payload) {
const el = this.payload[key] as Recipe.IValue;
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
hasEnabledFields(...fields: string[]) {
let result = false;
for (const field of fields) {
@@ -146,8 +158,8 @@ export default class ShowControstampoInfo extends Vue {
// recipeActions.setCurrent(store, this.recipe);
await recipeService.Confirm('UpperPlate');
ModalHelper.HideModal();
this.deferred.resolve(1);
// ModalHelper.HideModal();
// this.deferred.resolve(1);
};
goTo(step) {
@@ -33,11 +33,15 @@
<vuotocontrostampo v-if="show==2" :recipe="recipe"></vuotocontrostampo>
<estrazionecontrostampo v-if="show==3" :recipe="recipe"></estrazionecontrostampo>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
<button
class="btn"
@click="annulla()"
:disabled="!hasChanges()"
>{{'cancel' | localize('Annulla')}}</button>
<button
class="btn btn-success"
@click="conferma()"
:disabled="hasErrors()"
:disabled="hasErrors() || !hasChanges()"
>{{'confirm' | localize('Conferma')}}</button>
</footer>
</modal>
@@ -10,6 +10,7 @@ import { recipeActions } from "@/store/recipe.store";
import { store } from "@/store";
import { Deferred } from '@/services';
import { recipeService } from "@/services/recipeService";
import { debounce } from '@/_base/debounce';
@Component({
components:
@@ -36,11 +37,12 @@ export default class ShowEstrazioneInfo extends Vue {
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
};
await recipeService.Update(this.preparePayload());
}
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
preparePayload() {
get payload() {
return {
extraction_main_type: this.recipe.extraction_main_type,
extraction_main_mould_dw_delay: this.recipe.extraction_main_mould_dw_delay,
@@ -57,15 +59,24 @@ export default class ShowEstrazioneInfo extends Vue {
}
hasErrors() {
let payload = this.preparePayload();
let payload = this.recipe;
let errors = false;
for (const key in this.preparePayload()) {
for (const key in this.recipe) {
const el = payload[key] as Recipe.IValue;
if (el.status.hasError) errors = true;
}
return errors;
}
hasChanges() {
let result = false;
for (const key in this.payload) {
const el = this.payload[key] as Recipe.IValue;
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
hasEnabledFields(...fields: string[]) {
let result = false;
for (const field of fields) {
@@ -98,8 +109,8 @@ export default class ShowEstrazioneInfo extends Vue {
// recipeActions.setCurrent(store, this.recipe);
await recipeService.Confirm('Extraction');
ModalHelper.HideModal();
this.deferred.resolve(1);
// ModalHelper.HideModal();
// this.deferred.resolve(1);
};
goTo(step) {
@@ -21,11 +21,15 @@
<estrprincipale v-if="show==0" :recipe="recipe"></estrprincipale>
<estrsecondaria v-if="show==1" :recipe="recipe"></estrsecondaria>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
<button
class="btn"
@click="annulla()"
:disabled="!hasChanges()"
>{{'cancel' | localize('Annulla')}}</button>
<button
class="btn btn-success"
@click="conferma()"
:disabled="hasErrors()"
:disabled="hasErrors() || !hasChanges()"
>{{'confirm' | localize('Conferma')}}</button>
</footer>
</modal>
@@ -19,6 +19,7 @@ import { recipeActions } from "@/store/recipe.store";
import { store } from "@/store";
import { Deferred } from "@/services";
import { recipeService } from "@/services/recipeService";
import { debounce } from "@/_base/debounce";
@Component({
components: {
@@ -57,10 +58,12 @@ export default class ShowFormatoInfo extends Vue {
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
await recipeService.Update(this.preparePayload());
}
this.debouncedRecipeSave()
};
preparePayload() {
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
get payload() {
return {
general_sizes_mould_dim_x: this.recipe.general_sizes_mould_dim_x,
general_sizes_mould_dim_y: this.recipe.general_sizes_mould_dim_y,
@@ -83,21 +86,30 @@ export default class ShowFormatoInfo extends Vue {
}
hasErrors() {
let payload = this.preparePayload();
let payload = this.recipe;
let errors = false;
for (const key in this.preparePayload()) {
for (const key in this.recipe) {
const el = payload[key] as Recipe.IValue;
if (el.status.hasError) errors = true;
}
return errors;
}
hasChanges() {
let result = false;
for (const key in this.payload) {
const el = this.payload[key] as Recipe.IValue;
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
async conferma() {
// recipeActions.setCurrent(store, this.recipe);
await recipeService.Confirm('General');
ModalHelper.HideModal();
this.deferred.resolve(1);
// ModalHelper.HideModal();
// this.deferred.resolve(1);
};
goTo(step) {
@@ -70,11 +70,15 @@
</article>
</section>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
<button
class="btn"
@click="annulla()"
:disabled="!hasChanges()"
>{{'cancel' | localize('Annulla')}}</button>
<button
class="btn btn-success"
@click="conferma()"
:disabled="hasErrors()"
:disabled="hasErrors() || !hasChanges()"
>{{'confirm' | localize('Conferma')}}</button>
</footer>
</modal>
@@ -11,6 +11,7 @@ import { store } from "@/store";
import { Deferred } from "@/services";
import { recipeService } from "@/services/recipeService";
import svgChart from "@/app_modules_thermo/components/svgChart.vue";
import { debounce } from "@/_base/debounce";
@Component({
components: {
@@ -47,10 +48,12 @@ export default class ShowImbutituraInfo extends Vue {
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
await recipeService.Update(this.preparePayload());
}
this.debouncedRecipeSave()
};
preparePayload() {
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
get payload() {
return {
drawing_type: this.recipe.drawing_type,
drawing_height: this.recipe.drawing_height,
@@ -65,19 +68,28 @@ export default class ShowImbutituraInfo extends Vue {
}
hasErrors() {
let payload = this.preparePayload();
let payload = this.recipe;
let errors = false;
for (const key in this.preparePayload()) {
for (const key in this.recipe) {
const el = payload[key] as Recipe.IValue;
if (el.status.hasError) errors = true;
}
return errors;
}
hasChanges() {
let result = false;
for (const key in this.payload) {
const el = this.payload[key] as Recipe.IValue;
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
async conferma(name: string) {
await recipeService.Confirm('Drawing');
ModalHelper.HideModal();
this.deferred.resolve(1);
// ModalHelper.HideModal();
// this.deferred.resolve(1);
};
goTo(step) {
@@ -80,11 +80,15 @@
</article>
</section>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
<button
class="btn"
@click="annulla()"
:disabled="!hasChanges()"
>{{'cancel' | localize('Annulla')}}</button>
<button
class="btn btn-success"
@click="conferma()"
:disabled="hasErrors()"
:disabled="hasErrors() || !hasChanges()"
>{{'confirm' | localize('Conferma')}}</button>
</footer>
</modal>
@@ -11,6 +11,7 @@ import { store } from "@/store";
import { Prop, Watch } from "vue-property-decorator";
import { Deferred } from "@/services";
import { recipeService } from "@/services/recipeService";
import { debounce } from "@/_base/debounce";
@Component({
components: {
@@ -38,10 +39,12 @@ export default class ShowOpzioniInfo extends Vue {
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
await recipeService.Update(this.preparePayload());
}
this.debouncedRecipeSave()
};
preparePayload() {
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
get payload() {
return {
options_undercutmould_1_mode: this.recipe.options_undercutmould_1_mode,
options_undercutmould_1_position: this.recipe.options_undercutmould_1_position,
@@ -147,21 +150,30 @@ export default class ShowOpzioniInfo extends Vue {
}
hasErrors() {
let payload = this.preparePayload();
let payload = this.recipe;
let errors = false;
for (const key in this.preparePayload()) {
for (const key in this.recipe) {
const el = payload[key] as Recipe.IValue;
if (el.status.hasError) errors = true;
}
return errors;
}
hasChanges() {
let result = false;
for (const key in this.payload) {
const el = this.payload[key] as Recipe.IValue;
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
async conferma() {
// recipeActions.setCurrent(store, this.recipe);
await recipeService.Confirm('Options');
ModalHelper.HideModal();
this.deferred.resolve(1);
// ModalHelper.HideModal();
// this.deferred.resolve(1);
};
goTo(step) {
@@ -18,11 +18,15 @@
<sottosquadracontrostampo v-if="showOpzioni==2" :recipe="recipe"></sottosquadracontrostampo>
</section>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
<button
class="btn"
@click="annulla()"
:disabled="!hasChanges()"
>{{'cancel' | localize('Annulla')}}</button>
<button
class="btn btn-success"
@click="conferma()"
:disabled="hasErrors()"
:disabled="hasErrors() || !hasChanges()"
>{{'confirm' | localize('Conferma')}}</button>
</footer>
</modal>
@@ -11,6 +11,7 @@ import { recipeActions } from "@/store/recipe.store";
import { store } from "@/store";
import { Deferred } from "@/services";
import { recipeService } from "@/services/recipeService";
import { debounce } from "@/_base/debounce";
@Component({ components: { modal: Modal, pirometro: Pirometro, stepfooter: StepFooter, termosuperiore: TermoregolazioneSuperiore, termoinferiore: TermoregolazioneInferiore } })
export default class ShowPirometroInfo extends Vue {
@@ -29,10 +30,12 @@ export default class ShowPirometroInfo extends Vue {
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
await recipeService.Update(this.preparePayload());
}
this.debouncedRecipeSave()
};
preparePayload() {
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
get payload() {
return {
pyrometer_pyrometer_enabled: this.recipe.pyrometer_pyrometer_enabled,
pyrometer_pyrometer_setpoint: this.recipe.pyrometer_pyrometer_setpoint,
@@ -57,15 +60,24 @@ export default class ShowPirometroInfo extends Vue {
}
hasErrors() {
let payload = this.preparePayload();
let payload = this.recipe;
let errors = false;
for (const key in this.preparePayload()) {
for (const key in this.recipe) {
const el = payload[key] as Recipe.IValue;
if (el.status.hasError) errors = true;
}
return errors;
}
hasChanges() {
let result = false;
for (const key in this.payload) {
const el = this.payload[key] as Recipe.IValue;
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
hasEnabledFields(...fields: string[]) {
let result = false;
for (const field of fields) {
@@ -103,8 +115,8 @@ export default class ShowPirometroInfo extends Vue {
// recipeActions.setCurrent(store, this.recipe);
await recipeService.Confirm('Pyrometer');
ModalHelper.HideModal();
this.deferred.resolve(1);
// ModalHelper.HideModal();
// this.deferred.resolve(1);
};
goTo(step) {
@@ -23,11 +23,15 @@
<termosuperiore v-if="show==1" :recipe="recipe"></termosuperiore>
<termoinferiore v-if="show==2" :recipe="recipe"></termoinferiore>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
<button
class="btn"
@click="annulla()"
:disabled="!hasChanges()"
>{{'cancel' | localize('Annulla')}}</button>
<button
class="btn btn-success"
@click="conferma()"
:disabled="hasErrors()"
:disabled="hasErrors() || !hasChanges()"
>{{'confirm' | localize('Conferma')}}</button>
</footer>
</modal>
@@ -11,6 +11,7 @@ import { store } from "@/store";
import { Prop, Watch } from "vue-property-decorator";
import { Deferred } from "@/services";
import { recipeService } from "@/services/recipeService";
import { debounce } from "@/_base/debounce";
@Component({
components: {
@@ -37,10 +38,12 @@ export default class ShowQuoteVelocitaInfo extends Vue {
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
await recipeService.Update(this.preparePayload());
}
this.debouncedRecipeSave()
};
preparePayload() {
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
get payload() {
return {
positions_mould_lower_position: this.recipe.positions_mould_lower_position,
positions_mould_lower_speed: this.recipe.positions_mould_lower_speed,
@@ -70,15 +73,24 @@ export default class ShowQuoteVelocitaInfo extends Vue {
}
hasErrors() {
let payload = this.preparePayload();
let payload = this.recipe;
let errors = false;
for (const key in this.preparePayload()) {
for (const key in this.recipe) {
const el = payload[key] as Recipe.IValue;
if (el.status.hasError) errors = true;
}
return errors;
}
hasChanges() {
let result = false;
for (const key in this.payload) {
const el = this.payload[key] as Recipe.IValue;
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
hasEnabledFields(...fields: string[]) {
let result = false;
for (const field of fields) {
@@ -130,8 +142,8 @@ export default class ShowQuoteVelocitaInfo extends Vue {
// recipeActions.setCurrent(store, this.recipe);
await recipeService.Confirm('Positions');
ModalHelper.HideModal();
this.deferred.resolve(1);
// ModalHelper.HideModal();
// this.deferred.resolve(1);
};
goTo(step) {
@@ -27,11 +27,15 @@
<discesacornice v-if="show==1" :recipe="recipe"></discesacornice>
<controstampo v-if="show==2" :recipe="recipe"></controstampo>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
<button
class="btn"
@click="annulla()"
:disabled="!hasChanges()"
>{{'cancel' | localize('Annulla')}}</button>
<button
class="btn btn-success"
@click="conferma()"
:disabled="hasErrors()"
:disabled="hasErrors() || !hasChanges()"
>{{'confirm' | localize('Conferma')}}</button>
</footer>
</modal>
@@ -13,6 +13,7 @@ import { recipeActions } from "@/store/recipe.store";
import { store } from "@/store";
import { Deferred } from '@/services';
import { recipeService } from "@/services/recipeService";
import { debounce } from '@/_base/debounce';
@Component({
components: {
@@ -41,11 +42,13 @@ export default class Raffreddamento extends Vue {
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
await recipeService.Update(this.preparePayload());
}
this.debouncedRecipeSave()
};
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
preparePayload() {
get payload() {
return {
cooling_blowing_type: this.recipe.cooling_blowing_type,
cooling_blowing_delay: this.recipe.cooling_blowing_delay,
@@ -80,15 +83,24 @@ export default class Raffreddamento extends Vue {
}
hasErrors() {
let payload = this.preparePayload();
let payload = this.recipe;
let errors = false;
for (const key in this.preparePayload()) {
for (const key in this.recipe) {
const el = payload[key] as Recipe.IValue;
if (el.status.hasError) errors = true;
}
return errors;
}
hasChanges() {
let result = false;
for (const key in this.payload) {
const el = this.payload[key] as Recipe.IValue;
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
hasEnabledFields(...fields: string[]) {
let result = false;
@@ -150,8 +162,8 @@ export default class Raffreddamento extends Vue {
// recipeActions.setCurrent(store, this.recipe);
await recipeService.Confirm('Cooling');
ModalHelper.HideModal();
this.deferred.resolve(1);
// ModalHelper.HideModal();
// this.deferred.resolve(1);
};
goTo(step) {
@@ -39,11 +39,15 @@
<telescopi v-if="show==3" :recipe="recipe"></telescopi>
<otturatori v-if="show==4" :recipe="recipe"></otturatori>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
<button
class="btn"
@click="annulla()"
:disabled="!hasChanges()"
>{{'cancel' | localize('Annulla')}}</button>
<button
class="btn btn-success"
@click="conferma()"
:disabled="hasErrors()"
:disabled="hasErrors() || !hasChanges()"
>{{'confirm' | localize('Conferma')}}</button>
</footer>
</modal>
@@ -12,6 +12,7 @@ import { store } from "@/store";
import { Deferred } from "@/services";
import { recipeService } from "@/services/recipeService";
import { warmersService } from "@/services/warmersService";
import { debounce } from "@/_base/debounce";
@Component({ components: { modal: Modal, stepfooter: StepFooter, riscaldiinf: RiscaldiInf, riscaldisup: RiscaldiSup, sostdecomp: SostDecomp } })
export default class ShowRiscaldamentoSuperioreInfo extends Vue {
@@ -30,10 +31,12 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue {
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
await recipeService.Update(this.preparePayload());
}
this.debouncedRecipeSave()
};
preparePayload() {
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
get payload() {
return {
heats_lowerheaters_max_time: this.recipe.heats_lowerheaters_max_time,
heats_lowerheaters_movement_enabled: this.recipe.heats_lowerheaters_movement_enabled,
@@ -54,15 +57,24 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue {
}
hasErrors() {
let payload = this.preparePayload();
let payload = this.recipe;
let errors = false;
for (const key in this.preparePayload()) {
for (const key in this.recipe) {
const el = payload[key] as Recipe.IValue;
if (el.status.hasError) errors = true;
}
return errors;
}
hasChanges() {
let result = false;
for (const key in this.payload) {
const el = this.payload[key] as Recipe.IValue;
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
hasEnabledFields(...fields: string[]) {
let result = false;
for (const field of fields) {
@@ -107,8 +119,8 @@ export default class ShowRiscaldamentoSuperioreInfo extends Vue {
await warmersService.Update(store.state.warmers.channels.reduce((p, c) => { p[c.idChannel] = c.setpointHMI; return p; }, {}));
await warmersService.Confirm();
await recipeService.Confirm('Heats');
ModalHelper.HideModal();
this.deferred.resolve(1);
// ModalHelper.HideModal();
// this.deferred.resolve(1);
};
goTo(step) {
@@ -26,12 +26,16 @@
<riscaldiinf v-if="show == 1" :recipe="recipe"></riscaldiinf>
<riscaldisup v-if="show == 0" :recipe="recipe"></riscaldisup>
<sostdecomp v-if="show == 2" :recipe="recipe"></sostdecomp>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
<footer>
<button
class="btn"
@click="annulla()"
:disabled="!hasChanges()"
>{{'cancel' | localize('Annulla')}}</button>
<button
class="btn btn-success"
@click="conferma()"
:disabled="hasErrors()"
:disabled="hasErrors() || !hasChanges()"
>{{'confirm' | localize('Conferma')}}</button>
</footer>
</modal>
@@ -12,6 +12,7 @@ import { recipeActions } from "@/store/recipe.store";
import { store } from "@/store";
import { Deferred } from "@/services";
import { recipeService } from "@/services/recipeService";
import { debounce } from "@/_base/debounce";
@Component({
components:
@@ -41,10 +42,12 @@ export default class ShowVuotoInfo extends Vue {
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
await recipeService.Update(this.preparePayload());
}
this.debouncedRecipeSave()
};
preparePayload() {
debouncedRecipeSave = debounce(async () => await recipeService.Update(this.payload), 200);
get payload() {
return {
vacuum_main_start: this.recipe.vacuum_main_start,
vacuum_main_delay: this.recipe.vacuum_main_delay,
@@ -82,15 +85,24 @@ export default class ShowVuotoInfo extends Vue {
}
hasErrors() {
let payload = this.preparePayload();
let payload = this.recipe;
let errors = false;
for (const key in this.preparePayload()) {
for (const key in this.recipe) {
const el = payload[key] as Recipe.IValue;
if (el.status.hasError) errors = true;
}
return errors;
}
hasChanges() {
let result = false;
for (const key in this.payload) {
const el = this.payload[key] as Recipe.IValue;
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
hasEnabledFields(...fields: string[]) {
let result = false;
for (const field of fields) {
@@ -154,8 +166,8 @@ export default class ShowVuotoInfo extends Vue {
// recipeActions.setCurrent(store, this.recipe);
await recipeService.Confirm('Vacuum');
ModalHelper.HideModal();
this.deferred.resolve(1);
// ModalHelper.HideModal();
// this.deferred.resolve(1);
};
goTo(step) {
@@ -33,11 +33,15 @@
<vuotoausiliario v-if="show==2" :recipe="recipe"></vuotoausiliario>
<prevuoto v-if="show==3" :recipe="recipe"></prevuoto>
<footer>
<button class="btn" @click="annulla()">{{'cancel' | localize('Annulla')}}</button>
<button
class="btn"
@click="annulla()"
:disabled="!hasChanges()"
>{{'cancel' | localize('Annulla')}}</button>
<button
class="btn btn-success"
@click="conferma()"
:disabled="hasErrors()"
:disabled="hasErrors() || !hasChanges()"
>{{'confirm' | localize('Conferma')}}</button>
</footer>
</modal>
@@ -1,7 +1,7 @@
import Vue from "vue";
import Component from "vue-class-component";
import ProcessInfo from "@/modules/base-components/process-info.vue";
import { AppModel, buttonStatus } from "@/store";
import { AppModel, buttonStatus, store } from "@/store";
import { /*Factory,*/ messageService } from "@/_base";
//import { Hub } from "src/services/hub";
//import { Watch } from "vue-property-decorator";
@@ -11,6 +11,11 @@ import { Prop } from "vue-property-decorator";
import Archinterface from "@/app_modules_thermo/components/arch-interface/arch-interface.vue";
import { recipeService } from "@/services/recipeService";
import saveAsModal from "@/app_modules_thermo/save/save.vue";
import changeNotesModal from "@/app_modules_thermo/save/changeNotes.vue";
import { ModalHelper } from "@/components/modals";
import { recipeStore } from "@/store/recipe.store";
declare let $: any;
@@ -23,6 +28,8 @@ declare let $: any;
export default class AppHeader extends Vue {
$store: any;
showSaveAsMenu: boolean = false;
public get state() { return this.$store.state.machineStatus; };
public get isMainViewLiftedUp() { return this.$store.state.isMainViewLiftedUp; }
public get mainStatus() { return this.$store.getters.mainStatus; };
@@ -84,6 +91,16 @@ export default class AppHeader extends Vue {
}
}
public async showSaveAsModal() {
let result = await ModalHelper.ShowModalAsync(saveAsModal, (this.$store.state as AppModel).prod.panel.nomeRicetta);
await recipeService.SaveAs(result);
}
public async showChangeNoteModal() {
let result = await ModalHelper.ShowModalAsync(changeNotesModal, "");
await recipeService.UpdateNotes(result);
}
public get ribbonStatus(): ribbonStatusEnum {
// Controllo se ci sono allarmi
@@ -93,7 +110,6 @@ export default class AppHeader extends Vue {
if (s.alarms.warnings.length > 0) return ribbonStatusEnum.Warning;
if (s.process.running) return ribbonStatusEnum.Working;
return ribbonStatusEnum.Idle;
}
public get serviceRequired() {
@@ -113,7 +129,6 @@ export default class AppHeader extends Vue {
// Hub.Current.sendPowerCommand(btn.id);
}
async saveRecipe() {
await recipeService.Save();
}
@@ -159,6 +159,24 @@
<button class="over blue" :title="'recipe_save' | localize('save')" @click="saveRecipe()">
<i class="fa fa-save"></i>
</button>
<div class="context-menu">
<button
class="over blue"
:title="'recipe_saveas_button' | localize('saveas-button')"
@click="showSaveAsMenu = !showSaveAsMenu"
>
<i class="fa fa-ellipsis-h"></i>
</button>
<ul class="context-area" :class="{'show': showSaveAsMenu}">
<li
@click="showSaveAsMenu = false; showSaveAsModal()"
>{{'recipe_saveas' | localize('Salva con nome')}}</li>
<li
@click="showSaveAsMenu = false; showChangeNoteModal()"
>{{'recipe_change_note' | localize('Modifica nota')}}</li>
</ul>
</div>
<archinterface></archinterface>
<user-info></user-info>
</header>
@@ -86,5 +86,10 @@ export class RecipeService extends baseRestService {
return result;
}
async UpdateNotes(note: string) {
let result = await this.Post<any>((await this.BASE_URL()) + `updateNote?recipeNotes=${note}`, null, true);
return result;
}
}
export const recipeService = new RecipeService();