Compare commits

...

51 Commits

Author SHA1 Message Date
Samuele Locatelli a6df5719f0 Merge remote-tracking branch 'origin/develop' into feature/prodMgmt 2020-09-08 09:49:07 +02:00
Samuele Locatelli d23f6fd4c5 new rel 2020-09-08 09:48:58 +02:00
= 91a554d616 utilities 2020-09-08 09:43:12 +02:00
= e96d97890f cancel della ricetta 2020-09-08 09:37:52 +02:00
= 42186c9509 fix remainging time negativo 2020-09-08 09:19:51 +02:00
= b0391855f5 fix numeric 2020-09-08 08:54:52 +02:00
= 305e2220f8 valueact 2020-09-08 08:48:31 +02:00
= a5d2323dea fix combo status 2020-09-08 08:41:17 +02:00
= 95db7bbdd9 Merge remote-tracking branch 'CMS/develop' into develop 2020-09-08 08:35:44 +02:00
= 345918cdaf valueAct 2020-09-08 08:35:19 +02:00
Samuele Locatelli 8bc9fc97c8 new rel 2020-09-07 13:55:09 +02:00
Samuele Locatelli cd5ea6c6cc Merge remote-tracking branch 'origin/develop' into feature/prodMgmt 2020-09-07 13:53:07 +02:00
= fb91158ee6 fix gant print & slider. 2020-09-07 12:52:53 +02:00
= 7b724b070f slider 2020-09-07 11:16:11 +02:00
= 7bb8602595 Merge remote-tracking branch 'CMS/develop' into develop 2020-09-07 10:32:55 +02:00
Samuele Locatelli 02b1b3b4c6 Merge branch 'feature/prodMgmt' into develop 2020-09-04 19:25:10 +02:00
Samuele Locatelli f499cdc203 new rel intermedia 71 2020-09-04 19:24:32 +02:00
Samuele Locatelli fa9db02e0e Aggiornamento gestione moduli x avere categorie + sub 2020-09-04 19:24:18 +02:00
Samuele Locatelli 136f3c40ff Update xml e validatore modBlock 2020-09-04 19:23:57 +02:00
= 0e02b0ca3f fixes 2020-09-04 17:14:15 +02:00
= 913834a34d Merge remote-tracking branch 'CMS/develop' into develop 2020-09-04 15:14:54 +02:00
= 6b0d5e2c03 fix generali e gestione produzione 2020-09-04 15:14:32 +02:00
Samuele Locatelli 3ead2b7283 Merge branch 'feature/prodMgmt' into develop 2020-09-04 11:52:21 +02:00
Samuele Locatelli 66ba44868e Update x nuova gest codici errore in core library 2020-09-04 11:46:30 +02:00
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
= 9be02d4666 dashboard & toggle.. 2020-09-02 17:52:54 +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
= 2f2fc02730 clock & dashboard 2020-09-02 15:44:10 +02:00
= cccd8f2c36 gantt printing 2020-09-02 15:15:41 +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
= 71a1333c12 gantt print 2020-09-01 16:52:24 +02:00
60 changed files with 904 additions and 204 deletions
+15 -2
View File
@@ -5,11 +5,24 @@
## 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:
* Dai un paio di ResetSK
* fai cicloReset
* 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
@@ -71,6 +71,9 @@
<idParam>80</idParam>
<showDelay>true</showDelay>
<priority>3</priority>
<category>Pyrometer</category>
<subCategory_1>Pyrometer</subCategory_1>
<subCategory_2></subCategory_2>
</block>
<block>
<id>9</id>
@@ -116,6 +119,9 @@
<idParam>99</idParam>
<showDelay>true</showDelay>
<priority>2</priority>
<category>Drawing</category>
<subCategory_1></subCategory_1>
<subCategory_2></subCategory_2>
</block>
<block>
<id>14</id>
@@ -152,6 +158,9 @@
<idParam>139</idParam>
<showDelay>true</showDelay>
<priority>4</priority>
<category>Cooling</category>
<subCategory_1>Pyrometer</subCategory_1>
<subCategory_2></subCategory_2>
</block>
<block>
<id>19</id>
@@ -16,6 +16,9 @@
<xs:element name="priority" type="xs:int" />
<xs:element name="scaleFactor" type="xs:int" minOccurs="0" />
<xs:element name="numDec" type="xs:int" minOccurs="0" />
<xs:element name="category" type="param_type" minOccurs="0" />
<xs:element name="subCategory_1" type="xs:string" minOccurs="0" />
<xs:element name="subCategory_2" type="xs:string" minOccurs="0" />
</xs:all>
</xs:complexType>
</xs:element>
@@ -23,6 +26,23 @@
</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>
<!-- Language Type -->
<xs:complexType name="langType">
<xs:simpleContent>
@@ -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>
@@ -654,7 +654,10 @@ namespace Thermo.Active.Config
Priority = Convert.ToInt16(x.Element("priority").Value),
// attributi presi da default se NON presenti...
ScaleFactor = x.Element("scaleFactor") != null ? Convert.ToInt16(x.Element("scaleFactor").Value) : 1000,
NumDec = x.Element("numDec") != null ? Convert.ToInt16(x.Element("numDec").Value) : 1
NumDec = x.Element("numDec") != null ? Convert.ToInt16(x.Element("numDec").Value) : 1,
Category = x.Element("category") != null ? x.Element("category").Value : "",
SubCategory_1 = x.Element("subCategory_1") != null ? x.Element("subCategory_1").Value : "",
SubCategory_2 = x.Element("subCategory_2") != null ? x.Element("subCategory_2").Value : ""
})
.ToList();
}
-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>
@@ -14,5 +14,8 @@ namespace Thermo.Active.Model.ConfigModels
public int Priority { get; set; }
public int ScaleFactor { get; set; } = 1000;
public int NumDec { get; set; } = 1;
public string Category { get; set; }
public string SubCategory_1 { get; set; }
public string SubCategory_2 { get; set; }
}
}
@@ -24,6 +24,9 @@ namespace Thermo.Active.Model.DTOModels.ThModules
public bool Running { get; set; } = false;
public bool HasError { get; set; } = false;
public bool Terminated { get; set; } = false;
public string Category { get; set; } = "";
public string SubCategory_1 { get; set; } = "";
public string SubCategory_2 { get; set; } = "";
public override bool Equals(object obj)
@@ -67,6 +70,12 @@ namespace Thermo.Active.Model.DTOModels.ThModules
return false;
if (Terminated != item.Terminated)
return false;
if (Category != item.Category)
return false;
if (SubCategory_1 != item.SubCategory_1)
return false;
if (SubCategory_2 != item.SubCategory_2)
return false;
return true;
}
@@ -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; }
}
}
+96 -22
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;
}
@@ -1473,7 +1516,7 @@ namespace Thermo.Active.NC
}
/// <summary>
/// Lettura dati ProdInfo
/// Lettura dati ProdInfo (LIVE)
/// </summary>
/// <param name="prodInfoData"></param>
/// <returns></returns>
@@ -1488,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;
@@ -1530,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;
@@ -1584,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;
@@ -1757,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...
@@ -1771,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;
}
@@ -2241,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;
}
@@ -2418,7 +2489,10 @@ namespace Thermo.Active.NC
Visible = currModule.Visible,
Running = currModule.Running,
HasError = currModule.HasError,
Terminated = currModule.Terminated
Terminated = currModule.Terminated,
Category = item.Category,
SubCategory_1 = item.SubCategory_1,
SubCategory_2 = item.SubCategory_2
};
currModules.Add(item.Id, currVal);
}
+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" />
+5 -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,6 @@
<!-- Specifies the trace writer for output -->
<sharedListeners>
<!-- Listener for transport events -->
<add name="SignalR-Transports" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs/transports.log" traceOutputOptions="None"/>
<!--<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" />
@@ -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!
@@ -621,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.12.64")]
[assembly: AssemblyVersion("0.12.73")]
@@ -256,11 +256,11 @@
align-items: center;
display: flex;
border-radius: 7px;
&.fa-check-circle {
color: #90BF3D;
}
&.fa-check-circle.undone-step {
color: #1791FF;
}
@@ -474,6 +474,8 @@ article {
padding-bottom: 10px;
padding-top: 5px;
border: 2px solid #979797;
box-sizing: border-box;
align-items: center;
}
.submit {
@@ -385,6 +385,8 @@ article .box .body {
padding-bottom: 10px;
padding-top: 5px;
border: 2px solid #979797;
box-sizing: border-box;
align-items: center;
}
.box .submit {
margin: auto;
@@ -2,7 +2,7 @@
"env": "development",
"api": {
"enabled": true,
"apiServerUrl": "http://localhost:9000/"
"apiServerUrl": "http://seriate.steamware.net:9000/"
},
"allUIVisible": true
}
+2 -1
View File
@@ -13,13 +13,14 @@
<script src="Scripts/jquery.mousewheel.js"></script>
<script src="Scripts/jquery.signalR-2.2.2.min.js"></script>
<script src="Scripts/raphael-2.1.4.min.js"></script>
<script src="http://localhost:9000/signalr/hubs" async></script>
<script src="http://seriate.steamware.net:9000/signalr/hubs" async></script>
<link href="assets/styles/style.css" rel="stylesheet" />
</head>
<body>
<app>
<img src="/assets/icons/png/bg.png" style="display:hidden">
<div id="loading-spinner"><i class="fa fa-circle-o-notch fa-spin"></i></div>
</app>
<script src="/dist/vendors~main.js" type="text/javascript"></script>
+6
View File
@@ -64,6 +64,12 @@ export default class app extends Vue {
mounted() {
let ms = messageService;
window.oncontextmenu = function (event) {
event.preventDefault();
event.stopPropagation();
return false;
};
// if cms is connected
if (typeof cmsClient != "undefined")
this.HMIsrc = cmsClient.getScreenBase64();
@@ -23,7 +23,7 @@
justify-content: center;
height: 100%;
font-family: "Work Sans";
font-size: 47px;
font-size: 40px;
font-weight: 500;
line-height: 1.01;
padding-right: 1rem;
@@ -1,6 +1,10 @@
<template>
<div class="combo">
<div class="form" @click="showList" :class="{'error': value.status && value.status.hasError}">
<div
class="form"
@click="showList"
:class="{'error': value && value.status && value.status.hasError}"
>
{{currentValue}}
<i v-if="opened" class="fa fa-chevron-up" />
<i v-else class="fa fa-chevron-down" />
@@ -18,29 +18,39 @@ export default class Keyboard extends Vue {
@Prop()
value: string;
get Value() {
return this.actualValue.setpointHMI;
}
set Value(v: number) {
let scale = Math.pow(10, this.actualValue.numDec);
this.actualValue.setpointHMI = Math.round(v * scale) / scale;
}
del() {
this.actualValue.setpointHMI = 0;
this.Value = 0;
}
canc() {
let temp = String(this.actualValue.setpointHMI);
this.actualValue.setpointHMI = Number(temp.slice(0, -1))
let temp = String(this.Value);
this.Value = Number(temp.slice(0, -1))
}
add(num: string) {
if (this.point) {
this.point += num;
this.actualValue.setpointHMI = Number(this.point)
this.Value = Number(this.point)
} else {
let temp = String(this.actualValue.setpointHMI);
let temp = String(this.Value);
temp += num;
this.actualValue.setpointHMI = Number(temp)
this.Value = Number(temp)
}
}
addpoint() {
if (!this.point) {
this.point = String(this.actualValue.setpointHMI);
this.point = String(this.Value);
this.point += ".";
}
}
@@ -29,6 +29,15 @@ export default class Numeric extends Vue {
focused: boolean = false;
get Value() {
return this.value.setpointHMI;
}
set Value(v: number) {
let scale = Math.pow(10, this.value.numDec);
this.value.setpointHMI = Math.round(v * scale) / scale;
}
onFocus() {
if (this.value && this.value.status && !this.value.status.enabled) return;
let rect = this.$el.getBoundingClientRect();
@@ -6,7 +6,7 @@
<input
type="number"
ref="input"
v-model.number="value.setpointHMI"
v-model.number="Value"
@focus="onFocus"
@blur="onBlur"
:id="id"
@@ -4,6 +4,7 @@ import { Prop } from 'vue-property-decorator';
import { Hub } from "@/services";
import Numeric from "./numeric";
import { unitOfTime } from "moment";
@Component({ name: "slider" })
export default class Slider extends Vue {
@@ -33,19 +34,24 @@ export default class Slider extends Vue {
this.value.setpointHMI = v;
}
get step() {
// var s = ((this.value.range.max - this.value.range.min) / (this.lines + 1));
// var m = Math.pow(10, this.decimal);
// return Math.round(s * m) / m
return 1;
};
@Prop({ default: .7 })
incrementingStep: number;
step: number = 1;
// get step() {
// var s = ((this.value.range.max - this.value.range.min) / (this.lines + 1));
// var m = Math.pow(10, this.decimal);
// return Math.round(s * m) / m
// return 1;
// };
startIncrement() {
if (!this.value.status.enabled) return;
this.incrementing = setInterval(() => {
var v = this.value.setpointHMI;
if (v < this.value.range.max) {
v += this.step;
v += Math.floor(this.step);
this.step += this.incrementingStep;
}
if (v > this.value.range.max) {
v = this.value.range.max;
@@ -59,7 +65,8 @@ export default class Slider extends Vue {
this.incrementing = setInterval(() => {
var v = this.value.setpointHMI;
if (v > this.value.range.min) {
v -= this.step;
v -= Math.floor(this.step);
this.step += this.incrementingStep;
}
if (v < this.value.range.min) {
v = this.value.range.min;
@@ -74,7 +81,7 @@ export default class Slider extends Vue {
clearInterval(this.incrementing);
this.incrementing = 0;
this.step = 1;
};
@@ -1,7 +1,13 @@
<template>
<div class="slider-container">
<div class="slider">
<button @mousedown="startDecrement()" @mouseup="confirm()" @mouseout="confirm()">
<button
@mousedown="startDecrement()"
v-on:touchstart="startDecrement()"
v-on:touchend="confirm()"
@mouseup="confirm()"
@mouseout="confirm()"
>
<img src="assets/icons/png/min.png" />
</button>
<div class="control">
@@ -21,7 +27,13 @@
<small>{{`${this.value.range.max} ${this.value.unitMeasure}`}}</small>
</div>
</div>
<button @mousedown="startIncrement()" @mouseup="confirm()" @mouseout="confirm()">
<button
@mousedown="startIncrement()"
v-on:touchstart="startIncrement()"
v-on:touchend="confirm()"
@mouseup="confirm()"
@mouseout="confirm()"
>
<img src="assets/icons/png/max.png" />
</button>
</div>
@@ -40,5 +52,13 @@
justify-items: center;
width: 100%;
}
input[type="range"] {
pointer-events: none;
}
input[type="range"]::-webkit-slider-thumb {
pointer-events: auto;
}
</style>
<script lang="ts" src="./slider.ts"></script>
@@ -12,6 +12,7 @@ import { prodService } from '@/services/prodService';
import moment from 'moment';
import stats from "./base-components/stats.vue";
import hitem from "./base-components/item.vue";
import { Hub } from '@/services';
@Component({
components: {
@@ -54,7 +55,7 @@ export default class Dashboard extends Vue {
}
get remainingTime() {
return this.endEstimation.diff(this.now);
return Math.max(this.endEstimation.diff(this.now), 0);
}
get currentUser() {
@@ -95,7 +96,6 @@ export default class Dashboard extends Vue {
}
public get ribbonStatus(): ribbonStatusEnum {
// Controllo se ci sono allarmi
let s = this.$store.state as AppModel;
@@ -103,7 +103,6 @@ export default class Dashboard extends Vue {
if (s.alarms.warnings.length > 0) return ribbonStatusEnum.Warning;
if (s.process.running) return ribbonStatusEnum.Working;
return ribbonStatusEnum.Idle;
}
public get alarmTitle() {
@@ -120,7 +119,6 @@ export default class Dashboard extends Vue {
default:
return "";
}
}
public get alarmCount() {
@@ -148,6 +146,10 @@ export default class Dashboard extends Vue {
}
}
sendSoftKey(id: number) {
Hub.Current.sendUserSoftKey(id);
}
public sendMessage(name: string) {
messageService.publishToChannel(name);
}
@@ -99,7 +99,12 @@
</div>
<div class="end">
<small>{{'dashboard-timing-end' | localize('fine')}}</small>
<time v-if="panel.stimaDurata">~{{endEstimation | date('HH:mm')}}</time>
<time v-if="panel.stimaDurata">
<span>~{{endEstimation | date('HH:mm')}}</span>
<small
style="text-transform:lowercase"
>+{{Math.floor(remainingTime /1000 / 3600 /24)}} {{'remainging__days' | localize("gg")}}</small>
</time>
<time v-else>--:--</time>
</div>
</div>
@@ -107,14 +112,14 @@
<div class="setpoint">
<img src="assets/icons/png/inv.png" />
<label>{{panel.tempAct}}°C</label>
<button>
<button @click="sendSoftKey(37)">
<i class="fa fa-minus"></i>
</button>
<div>
<small>{{'dashboard-setpoint' | localize('set point')}}</small>
<span>{{panel.tempSetpoint}}°C</span>
</div>
<button>
<button @click="sendSoftKey(36)">
<i class="fa fa-plus"></i>
</button>
</div>
@@ -124,7 +129,9 @@
<gauge></gauge>
<div class="remaining_time">
<small>{{'dashboard-remaining-time' | localize('tempo rimanente')}}</small>
<time v-if="panel.stimaDurata">{{remainingTime | date('HH:mm:ss')}}</time>
<time
v-if="panel.stimaDurata"
>{{Math.floor(remainingTime /1000 / 3600)}}:{{remainingTime | date('mm:ss')}}</time>
<time v-else>--:--:--</time>
</div>
</div>
@@ -4,6 +4,19 @@ import { Prop, InjectReactive } from 'vue-property-decorator';
import { IGanttOptions } from './gantt';
import { store } from '@/store';
import { RecipeGetters } from '@/store/recipe.store';
import { ModalHelper } from '@/components/modals';
import ShowRiscaldamentoInfo from "@/app_modules_thermo/setup/riscaldi/components/show-riscaldi-info.vue";
import ShowFormatoInfo from "@/app_modules_thermo/setup/formato/components/show-formato-info.vue";
import ShowPirometroInfo from "@/app_modules_thermo/setup/pirometro/components/show-pirometro-info.vue";
import ShowCicloInfo from "@/app_modules_thermo/setup/ciclo/components/show-ciclo-info.vue";
import ShowRaffreddamentoInfo from "@/app_modules_thermo/setup/raffreddamento/components/show-raffreddamento-info.vue";
import ShowControstampoInfo from "@/app_modules_thermo/setup/controstampo_setup/components/show-controstampo-info.vue";
import ShowQuoteVelocitaInfo from "@/app_modules_thermo/setup/quote-velocita/components/show-quote-velocita-info.vue";
import ShowEstrazioneInfo from "@/app_modules_thermo/setup/estrazione/components/show-estrazione-info.vue";
import ShowVuotoInfo from "@/app_modules_thermo/setup/vuoto/show-vuoto-info.vue";
import ShowImbutituraInfo from "@/app_modules_thermo/setup/imbutitura/show-imbutitura-info.vue";
import ShowOpzioniInfo from "@/app_modules_thermo/setup/opzioni/show-opzioni-info.vue";
@Component({})
export default class GanttComponent extends Vue {
@@ -71,6 +84,47 @@ export default class GanttComponent extends Vue {
return this.showStatus ? this.ganttOptions.block_status_minDuration : 0;
}
openModal() {
switch (this.blockType) {
case "movement": this.showModalAtStep(2); break;
case "heating": this.showModalAtStep(3); break;
case "drawing": this.showModalAtStep(5); break;
case "vacuum": this.showModalAtStep(8); break;
case "cooling": this.showModalAtStep(7); break;
case "extraction": this.showModalAtStep(9); break;
}
}
async showModalAtStep(step: number) {
try {
let next = await this.showModalStep(step);
if (next == null) return;
this.showModalAtStep(step + next);
} catch {
}
}
showModalStep(step: number): Promise<number> {
switch (step) {
case 0: return ModalHelper.ShowModalAsync(ShowFormatoInfo);
case 1: return ModalHelper.ShowModalAsync(ShowQuoteVelocitaInfo);
case 2: return ModalHelper.ShowModalAsync(ShowCicloInfo);
case 3: return ModalHelper.ShowModalAsync(ShowRiscaldamentoInfo);
case 4: return ModalHelper.ShowModalAsync(ShowPirometroInfo);
case 5: return ModalHelper.ShowModalAsync(ShowImbutituraInfo);
case 6: return ModalHelper.ShowModalAsync(ShowControstampoInfo);
case 7: return ModalHelper.ShowModalAsync(ShowRaffreddamentoInfo);
case 8: return ModalHelper.ShowModalAsync(ShowVuotoInfo);
case 9: return ModalHelper.ShowModalAsync(ShowEstrazioneInfo);
case 10: return ModalHelper.ShowModalAsync(ShowOpzioniInfo);
// case 11: return ModalHelper.ShowModalAsync(AvvioProduzione);
}
return null;
}
// mounted() {
// this.value.showDelay = true;
// }
@@ -36,7 +36,7 @@
x="0"
y="0"
>
<div class="body-header">{{value.label | localize(value.label)}}</div>
<div class="body-header" @click="openModal()">{{value.label | localize(value.label)}}</div>
</foreignObject>
<foreignObject
:width="(duration - (showStatus && recipeValue?statusDuration:0)) * ganttOptions.secondSize"
@@ -5,6 +5,22 @@ import ganttHeader from "./gantt-header.vue";
import ganttRow from "./gantt-row.vue"
import timeLine from "./timeline.vue";
var ContainerElements = ["svg", "g", "foreignobject"];
var RelevantStyles = {
"rect": ["fill", "stroke", "stroke-width"],
"path": ["fill", "stroke", "stroke-width"],
"circle": ["fill", "stroke", "stroke-width"],
"line": ["stroke", "stroke-width"],
"text": ["fill", "font-size", "text-anchor"],
"polygon": ["stroke", "fill"],
"foreignobject": [],
"div": [
"align-items", "justify-content", "font-family", "flex-flow", "font-size",
"height", "padding", "color", "display", "width", "border-radius",
"background-color", "transform"],
"span": ["letter-spacing", "text-transform", "background-color"]
};
@Component({
components: {
ganttHeader, ganttRow, timeLine
@@ -18,12 +34,61 @@ export default class Gantt extends Vue {
padX: number = 0;
padY: number = 0;
public print() {
this.ganttOptions.printing = true;
this.$nextTick(() => {
var oDOM = (this.$refs.mainContainer as SVGElement).cloneNode(true)
this.exportSVGWithStyle(oDOM, this.$refs.mainContainer)
var data = new XMLSerializer().serializeToString(oDOM);
var DOMURL = (window.URL || window.webkitURL);
var svgBlob = new Blob([data], { type: 'image/svg+xml;charset=utf-8' });
var url = DOMURL.createObjectURL(svgBlob);
this.ganttOptions.printing = false;
window.open(url, '_blank')
});
}
exportSVGWithStyle(ParentNode, OrigData) {
var Children = ParentNode.childNodes;
var OrigChildDat = OrigData.childNodes;
for (var cd = 0; cd < Children.length; cd++) {
var Child = Children[cd];
var TagName = (Child.tagName as string)?.toLowerCase();
if (ContainerElements.indexOf(TagName) != -1) {
this.exportSVGWithStyle(Child, OrigChildDat[cd])
} else if (TagName in RelevantStyles) {
var StyleDef = window.getComputedStyle(OrigChildDat[cd]);
var StyleString = "";
for (var st = 0; st < RelevantStyles[TagName].length; st++) {
StyleString += RelevantStyles[TagName][st] + ":" + StyleDef.getPropertyValue(RelevantStyles[TagName][st]) + "; ";
}
Child.setAttribute("style", StyleString);
}
}
}
get PadX() {
let w = ((this.$refs.mainContainer as any)?.clientWidth ?? 0) / 3;
if (this.follow && w && this.currentTime * this.ganttOptions.secondSize > w)
return -(this.currentTime * this.ganttOptions.secondSize - w);
return this.padX;
}
set PadX(value: number) {
if (!this.follow)
this.padX = value;
@@ -69,7 +134,8 @@ export default class Gantt extends Vue {
block_body_Vacuum_minDuration: 5,
block_body_Cooling_minDuration: 10,
block_body_Extraction_minDuration: 5,
block_padding: 0.01
block_padding: 0.01,
printing: false
};
@Prop({ default: 0 })
@@ -179,4 +245,5 @@ export interface IGanttOptions {
block_body_Cooling_minDuration: number;
block_body_Extraction_minDuration: number;
block_padding: number;
printing: boolean;
}
@@ -55,7 +55,7 @@
</g>
<gantt-header :padding-horizontal="PadX " :zoom-factor="zoomFactor" />
<time-line
v-if="!!getRowHeight($refs.section1) && !!getRowHeight($refs.section2)"
v-if="!!getRowHeight($refs.section1) && !!getRowHeight($refs.section2) && !ganttOptions.printing"
:padding-horizontal="PadX"
:zoom-factor="zoomFactor"
:speed="1"
@@ -19,7 +19,9 @@
@checkChanged="softKeyChanged(b.id, b.operatorConfirmationNeeded)"
></soft-key>
</template>
<label><span v-if="tot">{{actual}}/{{tot}}</span></label>
<label>
<span v-if="tot">{{actual}}/{{tot}}</span>
</label>
</div>
<gantt
ref="gantt"
@@ -40,6 +42,7 @@
class="realign"
v-if="$refs.gantt"
@click="$refs.gantt.toggleFollow()"
@dblclick="$refs.gantt.print()"
:class="{active: $refs.gantt.follow}"
>
<img src="/assets/icons/png/recenter-time.png" />
@@ -3,7 +3,7 @@ import { Modal, ModalHelper } from "@/components/modals";
import { Factory, messageService, awaiter } from "@/_base";
import Component from "vue-class-component";
import { Prop } from 'vue-property-decorator';
import { appModelActions } from "@/store/app.store";
import { appModelActions, store } from "@/store/app.store";
import { prodService } from "@/services/prodService";
@Component({
@@ -13,7 +13,7 @@ import { prodService } from "@/services/prodService";
})
export default class AvvioProduzione extends Vue {
enabling: boolean = true;
newjob: boolean = true;
pieces: Recipe.IValue = {
setpointHMI: 0,
@@ -25,13 +25,27 @@ export default class AvvioProduzione extends Vue {
}
} as Recipe.IValue;
warmuppieces: Recipe.IValue = {
setpointHMI: 0,
range: { min: 0, max: 999999 },
status: {
enabled: true,
hasError: false,
visible: true
}
} as Recipe.IValue;
annulla() {
ModalHelper.HideModal();
};
get prod() { return store.state.prod.panel }
showDashboard() {
prodService.Start(this.pieces.setpointHMI);
prodService.Start(this.pieces.setpointHMI, this.newjob, this.warmuppieces.setpointHMI);
ModalHelper.HideModal();
appModelActions.ShowDashboard(this.$store);
@@ -53,4 +67,8 @@ export default class AvvioProduzione extends Vue {
ModalHelper.HideModal();
}
mounted() {
this.pieces.setpointHMI = this.prod.numTarget;
}
}
@@ -11,13 +11,36 @@
</div>
<section>
<article>
<div class="input-area mb-10">
<label>{{'enabling'|localize('Settaggio numero pezzi')}}</label>
<toggle-button v-model="enabling"></toggle-button>
<div class="input-area mb-10" style="margin:auto">
<label>{{'new'|localize('Nuova produzione')}}</label>
<toggle-button v-model="newjob"></toggle-button>
</div>
<div class="input-area" v-if="enabling">
<label>{{'mock_pieces'|localize('Numero pezzi')}}</label>
<numeric v-model="pieces" :keyboardPosition="'bottom'" />
<div class="box mt-10">
<div class="header">
<label>{{'warmup_cycles' | localize("Preriscaldo")}}</label>
</div>
<div class="body">
<div class="input-area mb-10">
<label>{{'warmup_cycles_pieces'|localize('Cicli preriscaldo')}}</label>
<numeric v-model="warmuppieces" :keyboardPosition="'bottom'" />
</div>
</div>
</div>
<div class="box mt-10">
<div class="header">
<label>{{'production_management' | localize("Gestione produzione")}}</label>
</div>
<article class="body">
<div class="input-area mb-10">
<label>{{'production_enabling'|localize('Modifica numero pezzi')}}</label>
<toggle-button v-model="pieces.status.enabled"></toggle-button>
</div>
<div class="input-area mb-10">
<label style="flex:1;">{{'mock_pieces'|localize('Numero pezzi')}}</label>
<label>{{prod.numDone}}/</label>
<numeric v-model="pieces" :keyboardPosition="'bottom'" />
</div>
</article>
</div>
</article>
</section>
@@ -15,7 +15,7 @@ import ShowEstrazioneInfo from "@/app_modules_thermo/setup/estrazione/components
import ShowVuotoInfo from "@/app_modules_thermo/setup/vuoto/show-vuoto-info.vue";
import ShowImbutituraInfo from "@/app_modules_thermo/setup/imbutitura/show-imbutitura-info.vue";
import ShowOpzioniInfo from "@/app_modules_thermo/setup/opzioni/show-opzioni-info.vue";
import AvvioProduzione from "@/app_modules_thermo/setup/avvio-produzione/avvio-produzione.vue";
// import AvvioProduzione from "@/app_modules_thermo/setup/avvio-produzione/avvio-produzione.vue";
import { store } from '@/store';
@@ -54,7 +54,7 @@ export default class Setup extends Vue {
case 8: return ModalHelper.ShowModalAsync(ShowVuotoInfo);
case 9: return ModalHelper.ShowModalAsync(ShowEstrazioneInfo);
case 10: return ModalHelper.ShowModalAsync(ShowOpzioniInfo);
case 11: return ModalHelper.ShowModalAsync(AvvioProduzione);
// case 11: return ModalHelper.ShowModalAsync(AvvioProduzione);
}
return null;
@@ -79,9 +79,9 @@
:status="overview.options"
></setup-button>
<div class="setup-play" @click="showModalAtStep(11);">
<!-- <div class="setup-play" @click="showModalAtStep(11);">
<img class="dim" src="assets/icons/svg/setup-play.svg" />
</div>
</div>-->
</div>
</modal>
</div>
@@ -4,7 +4,7 @@
<div class="borded_label" id="quota1" v-focus-on:general_sizes_upperplate_max_height>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_upperplate_max_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_upperplate_max_height.valueAct}}</span>
<small>{{recipe.general_sizes_upperplate_max_height.unitMeasure}}</small>
</div>
</div>
@@ -4,14 +4,14 @@
<div class="borded_label" id="quota1" v-focus-on:general_sizes_frame_dim_y>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_frame_dim_y.setpointHMI}}</span>
<span>{{recipe.general_sizes_frame_dim_y.valueAct}}</span>
<small>{{recipe.general_sizes_frame_dim_y.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota2" v-focus-on:general_sizes_frame_dim_x>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_frame_dim_x.setpointHMI}}</span>
<span>{{recipe.general_sizes_frame_dim_x.valueAct}}</span>
<small>{{recipe.general_sizes_frame_dim_x.unitMeasure}}</small>
</div>
</div>
@@ -4,21 +4,21 @@
<div class="borded_label" id="quota1" v-focus-on:general_sizes_sheet_dim_x>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_sheet_dim_x.setpointHMI}}</span>
<span>{{recipe.general_sizes_sheet_dim_x.valueAct}}</span>
<small>{{recipe.general_sizes_sheet_dim_x.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota2" v-focus-on:general_sizes_sheet_dim_y>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_sheet_dim_y.setpointHMI}}</span>
<span>{{recipe.general_sizes_sheet_dim_y.valueAct}}</span>
<small>{{recipe.general_sizes_sheet_dim_y.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota3" v-focus-on:general_sizes_sheet_thickness>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_sheet_thickness.setpointHMI}}</span>
<span>{{recipe.general_sizes_sheet_thickness.valueAct}}</span>
<small>{{recipe.general_sizes_sheet_thickness.unitMeasure}}</small>
</div>
</div>
@@ -4,14 +4,14 @@
<div class="borded_label" id="quota1" v-focus-on:general_sizes_plate_dim_y>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_plate_dim_y.setpointHMI}}</span>
<span>{{recipe.general_sizes_plate_dim_y.valueAct}}</span>
<small>{{recipe.general_sizes_plate_dim_y.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota2" v-focus-on:general_sizes_plate_dim_x>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_plate_dim_x.setpointHMI}}</span>
<span>{{recipe.general_sizes_plate_dim_x.valueAct}}</span>
<small>{{recipe.general_sizes_plate_dim_x.unitMeasure}}</small>
</div>
</div>
@@ -4,35 +4,35 @@
<div class="borded_label" id="quota1" v-focus-on:general_sizes_mould_dim_x>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_dim_x.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_dim_x.valueAct}}</span>
<small>{{recipe.general_sizes_mould_dim_x.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota2" v-focus-on:general_sizes_mould_dim_y>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_dim_y.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_dim_y.valueAct}}</span>
<small>{{recipe.general_sizes_mould_dim_y.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota3" v-focus-on:general_sizes_mould_max_height>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_max_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_max_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_max_height.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota4" v-focus-on:general_sizes_mould_base_height>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_base_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_base_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_base_height.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota5" v-focus-on:general_sizes_mould_min_height>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_min_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_min_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_min_height.unitMeasure}}</small>
</div>
</div>
@@ -4,24 +4,24 @@
<div class="borded_label" id="quota1">
<div v-focus-on:positions_frame_intermediate_position>
<img src="assets/icons/png/salita.png" />
<span>{{recipe.positions_frame_intermediate_position.setpointHMI}}</span>
<span>{{recipe.positions_frame_intermediate_position.valueAct}}</span>
<small>{{recipe.positions_frame_intermediate_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_frame_intermediate_speed>
<img src="assets/icons/png/bassa.png" />
<span>{{recipe.positions_frame_intermediate_speed.setpointHMI}}</span>
<span>{{recipe.positions_frame_intermediate_speed.valueAct}}</span>
<small>{{recipe.positions_frame_intermediate_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota5">
<div v-focus-on:positions_frame_lower_position>
<img src="assets/icons/png/discesa.png" />
<span>{{recipe.positions_frame_lower_position.setpointHMI}}</span>
<span>{{recipe.positions_frame_lower_position.valueAct}}</span>
<small>{{recipe.positions_frame_lower_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_frame_lower_speed>
<img src="assets/icons/png/alta.png" />
<span>{{recipe.positions_frame_lower_speed.setpointHMI}}</span>
<span>{{recipe.positions_frame_lower_speed.valueAct}}</span>
<small>{{recipe.positions_frame_lower_speed.unitMeasure}}</small>
</div>
</div>
@@ -4,7 +4,7 @@
<div class="borded_label" id="quota1" v-focus-on:positions_mould_intermediate_position>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.positions_mould_intermediate_position.setpointHMI}}</span>
<span>{{recipe.positions_mould_intermediate_position.valueAct}}</span>
<small>{{recipe.positions_mould_intermediate_position.unitMeasure}}</small>
</div>
</div>
@@ -18,21 +18,21 @@
<div class="borded_label" id="quota3" v-focus-on>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_min_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_min_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_min_height.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota4" v-focus-on>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_base_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_base_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_base_height.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota5" v-focus-on>
<div>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_mould_max_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_mould_max_height.valueAct}}</span>
<small>{{recipe.general_sizes_mould_max_height.unitMeasure}}</small>
</div>
</div>
@@ -40,48 +40,48 @@
<div class="borded_label" id="quota6">
<div v-focus-on:positions_mould_upperdeceleration_position>
<img src="assets/icons/png/salita.png" />
<span>{{recipe.positions_mould_upperdeceleration_position.setpointHMI}}</span>
<span>{{recipe.positions_mould_upperdeceleration_position.valueAct}}</span>
<small>{{recipe.positions_mould_upperdeceleration_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_mould_upperdeceleration_speed>
<img src="assets/icons/png/bassa.png" />
<span>{{recipe.positions_mould_upperdeceleration_speed.setpointHMI}}</span>
<span>{{recipe.positions_mould_upperdeceleration_speed.valueAct}}</span>
<small>{{recipe.positions_mould_upperdeceleration_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota7">
<div v-focus-on:positions_mould_upper_position>
<img src="assets/icons/png/salita.png" />
<span>{{recipe.positions_mould_upper_position.setpointHMI}}</span>
<span>{{recipe.positions_mould_upper_position.valueAct}}</span>
<small>{{recipe.positions_mould_upper_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_mould_upper_speed>
<img src="assets/icons/png/alta.png" />
<span>{{recipe.positions_mould_upper_speed.setpointHMI}}</span>
<span>{{recipe.positions_mould_upper_speed.valueAct}}</span>
<small>{{recipe.positions_mould_upper_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota8">
<div v-focus-on:positions_mould_lowerdeceleration_position>
<img src="assets/icons/png/discesa.png" />
<span>{{recipe.positions_mould_lowerdeceleration_position.setpointHMI}}</span>
<span>{{recipe.positions_mould_lowerdeceleration_position.valueAct}}</span>
<small>{{recipe.positions_mould_lowerdeceleration_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_mould_lowerdeceleration_speed>
<img src="assets/icons/png/bassa.png" />
<span>{{recipe.positions_mould_lowerdeceleration_speed.setpointHMI}}</span>
<span>{{recipe.positions_mould_lowerdeceleration_speed.valueAct}}</span>
<small>{{recipe.positions_mould_lowerdeceleration_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota9">
<div v-focus-on:positions_mould_lower_position>
<img src="assets/icons/png/discesa.png" />
<span>{{recipe.positions_mould_lower_position.setpointHMI}}</span>
<span>{{recipe.positions_mould_lower_position.valueAct}}</span>
<small>{{recipe.positions_mould_lower_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_mould_lower_speed>
<img src="assets/icons/png/alta.png" />
<span>{{recipe.positions_mould_lower_speed.setpointHMI}}</span>
<span>{{recipe.positions_mould_lower_speed.valueAct}}</span>
<small>{{recipe.positions_mould_lower_speed.unitMeasure}}</small>
</div>
</div>
@@ -4,55 +4,55 @@ e<template>
<div class="borded_label" id="quota3">
<div v-focus-on:positions_upperplate_lower_position>
<img src="assets/icons/png/discesa.png" />
<span>{{recipe.positions_upperplate_lower_position.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_lower_position.valueAct}}</span>
<small>{{recipe.positions_upperplate_lower_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_upperplate_lower_speed>
<img src="assets/icons/png/alta.png" />
<span>{{recipe.positions_upperplate_lower_speed.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_lower_speed.valueAct}}</span>
<small>{{recipe.positions_upperplate_lower_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota4">
<div v-focus-on:positions_upperplate_lowerdeceleration_position>
<img src="assets/icons/png/discesa.png" />
<span>{{recipe.positions_upperplate_lowerdeceleration_position.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_lowerdeceleration_position.valueAct}}</span>
<small>{{recipe.positions_upperplate_lowerdeceleration_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_upperplate_lowerdeceleration_speed>
<img src="assets/icons/png/bassa.png" />
<span>{{recipe.positions_upperplate_lowerdeceleration_speed.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_lowerdeceleration_speed.valueAct}}</span>
<small>{{recipe.positions_upperplate_lowerdeceleration_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota1">
<div v-focus-on:positions_upperplate_upper_position>
<img src="assets/icons/png/salita.png" />
<span>{{recipe.positions_upperplate_upper_position.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_upper_position.valueAct}}</span>
<small>{{recipe.positions_upperplate_upper_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_upperplate_upper_speed>
<img src="assets/icons/png/alta.png" />
<span>{{recipe.positions_upperplate_upper_speed.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_upper_speed.valueAct}}</span>
<small>{{recipe.positions_upperplate_upper_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota2">
<div v-focus-on:positions_upperplate_upperdeceleration_position>
<img src="assets/icons/png/salita.png" />
<span>{{recipe.positions_upperplate_upperdeceleration_position.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_upperdeceleration_position.valueAct}}</span>
<small>{{recipe.positions_upperplate_upperdeceleration_position.unitMeasure}}</small>
</div>
<div v-focus-on:positions_upperplate_upperdeceleration_speed>
<img src="assets/icons/png/bassa.png" />
<span>{{recipe.positions_upperplate_upperdeceleration_speed.setpointHMI}}</span>
<span>{{recipe.positions_upperplate_upperdeceleration_speed.valueAct}}</span>
<small>{{recipe.positions_upperplate_upperdeceleration_speed.unitMeasure}}</small>
</div>
</div>
<div class="borded_label" id="quota5">
<div v-focus-on:general_sizes_upperplate_max_height>
<img src="assets/icons/png/quota.png" />
<span>{{recipe.general_sizes_upperplate_max_height.setpointHMI}}</span>
<span>{{recipe.general_sizes_upperplate_max_height.valueAct}}</span>
<small>{{recipe.general_sizes_upperplate_max_height.unitMeasure}}</small>
</div>
</div>
@@ -1,7 +1,11 @@
<template>
<div class="togglebutton big" v-if="status.visible">
<div class="togglebutton big" v-if="!status || status.visible">
<label>
<input type="checkbox" v-model="bindingValue" :disabled="readOnly || !status.enabled" />
<input
type="checkbox"
v-model="bindingValue"
:disabled="readOnly || (status && !status.enabled)"
/>
<span
class="toggle"
:class="{'error': status && status.hasError}"
@@ -2,6 +2,8 @@ import Vue from "vue";
import Component from "vue-class-component";
import { appModelActions, store, machineStatusActions } from "@/store";
import { prodService } from "@/services/prodService";
import AvvioProduzione from "@/app_modules_thermo/setup/avvio-produzione/avvio-produzione.vue";
import { ModalHelper } from "@/components/modals";
// import VueGesture from "@/_base/gestures.vue";
// import { Factory, messageService } from "src/_base";
@@ -53,15 +55,15 @@ export default class AppFooter extends Vue {
}
public getUtilities(): Array<Object> {
// if (typeof cmsClient != "undefined")
// return JSON.parse(cmsClient.getConfiguredProcessesInMainMenu());
// else
return new Array<Object>();
if (typeof cmsClient != "undefined")
return JSON.parse(cmsClient.getConfiguredProcessesInMainMenu());
else
return new Array<Object>();
}
public startUtility(id: any) {
// if (typeof cmsClient != "undefined")
// cmsClient.openOrStartProcess(id);
if (typeof cmsClient != "undefined")
cmsClient.openOrStartProcess(id);
}
showDashboard() {
@@ -73,6 +75,6 @@ export default class AppFooter extends Vue {
}
async runAuto() {
await prodService.Auto();
await ModalHelper.ShowModalAsync(AvvioProduzione);
}
}
@@ -66,6 +66,23 @@
class="oval clock"
:class="{ big:isInPath('clock') && !state.isMainViewLiftedUp}"
></button>
<div v-if="isAreaVisible('utilities') && getUtilities().length > 0" class="divider">
<i class="fa fa-circle"></i>
</div>
<template v-for="software in getUtilities()">
<button
@click="startUtility(software.id)"
:title="software.longName"
:key="software.id"
:disabled="!isAreaEnabled('utilities')"
v-if="isAreaVisible('utilities')"
class="oval externUtility"
>
<img v-if="software.iconBase64 && software.iconBase64!=''" :src="software.iconBase64" />
<div v-if="!software.iconBase64 || software.iconBase64==''">{{software.shortName}}</div>
</button>
</template>
</div>
<div class="machine-area">
@@ -33,8 +33,8 @@ export class ProdService extends baseRestService {
await this.Put<any>((await this.BASE_URL()) + "mode/auto", null);
}
async Start(qty: number, newWorkOrder: boolean = true) {
await this.Put<any>((await this.BASE_URL()) + `start?requestQty=${qty}&newWorkOrder=${newWorkOrder}`, null);
async Start(qty: number, newWorkOrder: boolean, riscqty: number) {
await this.Put<any>((await this.BASE_URL()) + `start?requestQty=${qty}&newWorkOrder=${newWorkOrder}&numCicliRisc=${riscqty}`, null);
}
}
export const prodService = new ProdService();
@@ -60,6 +60,7 @@ export class RecipeService extends baseRestService {
}
async Cancel() {
recipeActions.reset(store);
let result = await this.Put<any>((await this.BASE_URL()) + "cancel", null, true);
return result;
}
@@ -8,6 +8,7 @@ export interface RecipeStoreModel {
export interface RecipeActions {
reset(context);
setCurrent(context, model: Recipe.IRecipe, avoidSetpointHMI: boolean);
setOverview(context, model: Overview.IOverview);
}
@@ -35,6 +36,7 @@ export const recipeStore = {
upperPlate: "",
vacuum: ""
},
canUpdateRecipe: true,
_map: new Map<number, Recipe.IValue>()
} as RecipeStoreModel,
@@ -45,7 +47,13 @@ export const recipeStore = {
},
mutations: {
Reset(state) {
for (const key in state.current)
if (state.current.hasOwnProperty(key)) {
let m = state.current[key] as Recipe.IValue;
m.setpointHMI = m.setpointPLC;
}
},
SetCurrent(state, model: { avoidSetpoint: boolean, recipe: Recipe.IRecipe }) {
for (const key in model.recipe) {
if (model.recipe.hasOwnProperty(key)) {
@@ -86,7 +94,9 @@ export const recipeStore = {
},
actions: {
reset(context) {
context.commit("Reset")
},
async setCurrent(context, model: Recipe.IRecipe, avoidSetpointHMI: boolean = false) {
context.commit("SetCurrent", { avoidSetpoint: avoidSetpointHMI, recipe: model });