Compare commits

...

90 Commits

Author SHA1 Message Date
Samuele E. Locatelli 9bbea90d6f Merge remote-tracking branch 'origin/new/ThermoCamManager' into new/ThermoCamManager 2021-03-30 10:27:29 +02:00
Samuele E. Locatelli 53df674ae5 Fix setup x import conf 1.1.192 2021-03-30 10:27:22 +02:00
Samuele E. Locatelli efe5c73ea9 import in 2 step 2021-03-30 08:44:33 +02:00
Samuele E. Locatelli 0d78722593 Start setup fix 2021-03-30 08:29:48 +02:00
Thermo_SIM a1403ed5c1 Merge branch 'NewRecipe' into new/ThermoCamManager 2021-03-29 15:19:53 +02:00
Thermo_SIM 98504569b0 Fix 2021-03-29 15:19:21 +02:00
Thermo_SIM 91791b4aca Fix Setup procedure 2021-03-29 10:52:18 +02:00
Thermo_SIM 30e78e7a65 Merge branch 'develop' into new/ThermoCamManager 2021-03-29 10:09:21 +02:00
Thermo_SIM 3072618f25 First Friday evening commit 2021-03-26 18:37:44 +01:00
Thermo_SIM 2feb30bef6 Fix load Recipe 2021-03-26 18:10:32 +01:00
Thermo_SIM 44415f41ee Merge branch 'edited_asterisk' into develop 2021-03-26 14:53:34 +01:00
Thermo_SIM 1ff528006d Working version 2021-03-26 14:41:26 +01:00
Thermo_SIM bcd65da7cd First commit not working 2021-03-26 09:12:35 +01:00
Thermo_SIM 13cc5f66a3 Fix setup procedure 2021-03-25 13:11:49 +01:00
Thermo_SIM 07d1df9220 Fix sheets 2021-03-25 09:25:00 +01:00
Samuele E. Locatelli 2bb407d55c Merge remote-tracking branch 'origin/develop' into new/ThermoCamManager 2021-03-24 18:09:51 +01:00
Thermo_SIM 97dc1095b6 Added Id Piece on History 2021-03-24 14:24:23 +01:00
Thermo_SIM a090ef9fb2 FIx THermocam behaviour 2021-03-24 14:17:00 +01:00
Thermo_SIM c5c95f75ae Thickness 2021-03-24 12:38:15 +01:00
Thermo_SIM c95fb1806f FIx Caricatore view 2021-03-24 12:28:42 +01:00
Thermo_SIM d12d07c99e Fix UserLogin + IO 2021-03-24 12:16:21 +01:00
Samuele E. Locatelli 3103b7bba2 inizio vers 192 x fix visualizzazione IO 2021-03-24 11:45:03 +01:00
Samuele E. Locatelli b2932d927c Merge remote-tracking branch 'origin/develop' into new/ThermoCamManager 2021-03-24 11:25:04 +01:00
Thermo_SIM 68add4e08d Ottimizzazione Frontend 2021-03-24 11:24:33 +01:00
Samuele E. Locatelli 5585c11ef5 new rel start 2021-03-24 10:48:18 +01:00
Samuele E. Locatelli b9caa4ac74 setup serverConfig x SIM 2021-03-24 10:48:09 +01:00
Samuele E. Locatelli cde514eed8 refresh x test produzione 2021-03-24 09:29:37 +01:00
Samuele E. Locatelli fad45a5635 new rel 190 2021-03-24 09:29:26 +01:00
Samuele E. Locatelli 9bf2265082 pulizia riferimenti vers 0.8.1 --> 0.4.0 2021-03-24 09:29:18 +01:00
Samuele E. Locatelli e488619ae5 Merge remote-tracking branch 'origin/develop' into new/ThermoCamManager 2021-03-24 07:55:53 +01:00
Samuele E. Locatelli babd8b25da vers 189 semaforo unico 2021-03-24 07:55:40 +01:00
Thermo_SIM 5894cd63ce Check LastTakenImage 2021-03-24 07:33:58 +01:00
Samuele E. Locatelli 5a19d44b34 semaforo su confirm/cancel ricetta (strobe R798!) 2021-03-24 06:14:15 +01:00
Samuele E. Locatelli 577cbe5c9d start test new rel 2021-03-24 05:48:47 +01:00
Samuele E. Locatelli e881006857 gestione semafori x Reciper + Warmers 2021-03-23 21:47:31 +01:00
Samuele E. Locatelli 83fb0acfd0 helpers gestione semafori Recipe + Warmers 2021-03-23 21:47:21 +01:00
Samuele E. Locatelli 04b3588e7f lieve allungamento delay scrittura singole memorie ricetta 2021-03-23 21:46:54 +01:00
Samuele E. Locatelli c00e695c15 inizio nuova release 2021-03-23 19:34:02 +01:00
Samuele E. Locatelli c228c454f6 Merge remote-tracking branch 'origin/develop' into new/ThermoCamManager 2021-03-23 19:33:43 +01:00
Thermo_SIM e86495eab5 Added Thermocamera Takesnapshot 2021-03-23 17:31:13 +01:00
Samuele E. Locatelli 63e636cd36 fix base WebApi (NO dispose ncAdapter: non serve) 2021-03-23 12:49:04 +01:00
Samuele E. Locatelli 1458a4cf5d inserito force close 2021-03-23 12:43:55 +01:00
Samuele E. Locatelli 6cf7331081 Merge remote-tracking branch 'origin/develop' into new/ThermoCamManager 2021-03-23 12:09:26 +01:00
Samuele E. Locatelli 43402a785f aggiunti metodi dispose x WebAPI con ncAdapter 2021-03-23 12:09:10 +01:00
Thermo_SIM 88561778ce Fix Classes bitselector 2021-03-23 11:01:03 +01:00
Thermo_SIM 0d395fca33 Added LOG on Auth error 2021-03-23 10:48:17 +01:00
Samuele E. Locatelli 09fea8f0e3 start new rel 2021-03-23 10:47:34 +01:00
Thermo_SIM 42531aac49 Fix COnfirm IO 2021-03-23 10:23:24 +01:00
Thermo_SIM bbfc3ca64d Fix Caricatore 2021-03-23 09:18:02 +01:00
Thermo_SIM 50e76bd30c FIx Logs 2021-03-22 18:33:06 +01:00
Thermo_SIM 6f6559ce67 Fix Sheet read 2021-03-22 17:59:30 +01:00
Samuele E. Locatelli 5c2f69b8d2 fix serverconfig 2021-03-22 16:48:56 +01:00
Samuele E. Locatelli 0f7ce076f9 type 2021-03-22 16:18:47 +01:00
Samuele E. Locatelli 127b4ba1de new rel 185 2021-03-22 14:38:30 +01:00
Samuele E. Locatelli 9e2ee7d5b6 Merge branch 'develop' into new/ThermoCamManager 2021-03-22 14:38:10 +01:00
Thermo_SIM 2a0b3f7e72 Fix Frontend 2021-03-22 14:33:31 +01:00
Thermo_SIM 36dc4171e5 Added Migration 2021-03-22 14:24:34 +01:00
Thermo_SIM 29057c5431 Added TYpeval 2021-03-22 14:18:59 +01:00
Thermo_SIM a1336f9918 Merge branch 'Log_Lastre' into develop 2021-03-22 11:27:06 +01:00
Thermo_SIM 7ded45280f Fix THermocamera History 2021-03-22 11:26:33 +01:00
Thermo_SIM ef139a2365 Fix THermoprophet 2021-03-21 19:28:07 +01:00
Thermo_SIM fe6498f6ed Fix Vuoto Behaviour 2021-03-21 18:06:26 +01:00
Thermo_SIM 22ad46ab8c Fix bitselector 2021-03-21 17:57:19 +01:00
Thermo_SIM e098409b83 Fix COnfig FIle & Sheet cleaning 2021-03-19 22:52:17 +01:00
Thermo_SIM 083be20f02 Fix Frontend 2021-03-19 22:21:10 +01:00
Thermo_SIM f7ff6629ce Added NC Reading 2021-03-19 22:19:49 +01:00
Thermo_SIM 2a4c0e8335 Fix Frontend 2 2021-03-19 22:19:36 +01:00
Thermo_SIM bd1488bc02 FIx Frontend 2021-03-19 22:19:23 +01:00
Thermo_SIM bab9bf504a Removed ConsoleLog 2021-03-19 20:07:57 +01:00
Thermo_SIM c7f7c4f9c8 Added Frontend 2021-03-19 18:28:07 +01:00
Thermo_SIM 36e0927bd1 Backend 2021-03-19 18:00:03 +01:00
Thermo_SIM 7b132793d0 Third DB Commit 2021-03-19 17:26:34 +01:00
Thermo_SIM d01fcf7578 Second Commit 2021-03-19 17:11:18 +01:00
Thermo_SIM 539ed2508d First commit DB 2021-03-19 17:07:42 +01:00
Thermo_SIM cacae4eebf Fix pirometro in Dashboard 2021-03-19 16:40:07 +01:00
Thermo_SIM 34e31666cd Fix ricetta + Dashboard S 2021-03-19 16:05:30 +01:00
Samuele E. Locatelli 3b0dd98018 modifica meccanismo dispose FLIR 2021-03-19 10:11:43 +01:00
Samuele E. Locatelli 76fdf01d38 Merge branch 'new/ThermoCamManager' into develop 2021-03-18 11:49:36 +01:00
Samuele E. Locatelli 7918787ac6 new rel 2021-03-18 11:49:30 +01:00
Samuele E. Locatelli e797afabcb impostato in recipe current stesso comportamento di area 2021-03-18 11:48:46 +01:00
Samuele E. Locatelli c31edb94d5 Merge branch 'new/ThermoCamManager' into develop 2021-03-18 09:49:59 +01:00
Samuele E. Locatelli 86fd710aaa vers 182 2021-03-18 09:49:33 +01:00
Samuele E. Locatelli f1f8f3aa97 modifiche x evitare sovrapposizione chiamate lettura ricetta 2021-03-18 09:46:56 +01:00
Samuele E. Locatelli 83d6f40491 Merge branch 'develop' into new/ThermoCamManager 2021-03-17 19:06:03 +01:00
Samuele E. Locatelli 21cb4050b0 modifica DTO x upload stato connessione FLIR cam 2021-03-17 19:05:49 +01:00
Samuele E. Locatelli 027eed8770 Aggiunta gestione status camera connessa o meno (lettura) 2021-03-17 19:01:41 +01:00
Samuele E. Locatelli 43de959bca new rel number 2021-03-17 18:42:13 +01:00
Samuele E. Locatelli 5a56d53d90 fix thread thermo flir 2021-03-16 15:21:03 +01:00
Samuele E. Locatelli 89b0ce5f96 gestione conf XML server x abilitazione FLIR 2021-03-16 15:15:58 +01:00
Samuele E. Locatelli e57d16d690 vers 180 2021-03-15 17:09:26 +01:00
134 changed files with 21033 additions and 19271 deletions
@@ -29,6 +29,7 @@ namespace Client2020.BrowserTools
private const string THERMO_RECIPE_FOLDER_NAME = @"Recipes";
private const string THERMO_SCREENSHOT_PATH = @"C:\CMS\Screenshots";
private const string CMS_PATH = @"C:\CMS";
private string RUNNING_PATH = AppDomain.CurrentDomain.BaseDirectory;
#region CONSTRUCTOR_METHOD
public BrowserJSObject(Form f)
@@ -339,6 +340,29 @@ namespace Client2020.BrowserTools
return JsonConvert.SerializeObject("");
}
public string createRecipe(String p)
{
if (File.Exists(p))
{
return (JsonConvert.SerializeObject(new ErrorContainer("path_already_exists")));
}
try
{
string path = RUNNING_PATH.Replace("Client_Debug\\x64\\", "").Replace("Client\\x64\\", "") + "Config\\Recipes\\template.tpl";
FileInfo file = new FileInfo(path);
file.CopyTo(p);
}
catch (Exception e)
{
return (JsonConvert.SerializeObject(new ErrorContainer("error_during_file_creation")));
}
return JsonConvert.SerializeObject("");
}
// Read all files in directory
public string getFileList(string p)
+1 -1
View File
@@ -180,7 +180,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
<ErrorText>Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x64.84.4.1\build\cef.redist.x64.props'))" />
<Error Condition="!Exists('..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x86.84.4.1\build\cef.redist.x86.props'))" />
@@ -51,6 +51,14 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Flir.Atlas.Image, Version=2.0.14266.1000, Culture=neutral, PublicKeyToken=caa391fd8e07c76b, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\FLIR Systems\FLIR Atlas SDK 6\bin\x86\Flir.Atlas.Image.dll</HintPath>
</Reference>
<Reference Include="Flir.Atlas.Live, Version=2.0.14266.1000, Culture=neutral, PublicKeyToken=caa391fd8e07c76b, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\FLIR Systems\FLIR Atlas SDK 6\bin\x86\Flir.Atlas.Live.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
@@ -1,4 +1,5 @@
using System;
using Flir.Atlas.Live.Device;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -26,6 +27,11 @@ namespace Thermo.Active.Thermocamera
public static readonly string BASE_PATH = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
/// <summary>
/// Indica se la camera sia connessa
/// </summary>
public bool CameraIsConnected = false;
#endregion Public Fields
#region Public Constructors
@@ -33,12 +39,15 @@ namespace Thermo.Active.Thermocamera
/// <summary>
/// Init classe
/// </summary>
/// <param name="isLive">Indica aabilitazione alive straming vs load dati storici</param>
/// <param name="isLive">Indica aabilitazione a live straming vs load dati storici</param>
public ThermoCamComunicator(bool isLive)
{
// init classe controllo camera
TCamLive = new TCContr($"{Constants.WEBSITE_DIRECTORY}\\{Constants.THERMO_DATA_FOLDER}", $"{BASE_PATH}\\{Constants.CONFIG_DIRECTORY}");
// aggancio evento connesisone/disconnessione
TCamLive.eh_CameraConnStatusChanged += TCamLive_eh_CameraConnStatusChanged;
// avvio classe gestione thermocamera...
TCamLive.tryReloadConf();
@@ -49,6 +58,12 @@ namespace Thermo.Active.Thermocamera
}
}
private void TCamLive_eh_CameraConnStatusChanged(object sender, Flir.Atlas.Live.ConnectionStatusChangedEventArgs e)
{
// salvo stato connessione
CameraIsConnected = e.Status == ConnectionStatus.Connected;
}
#endregion Public Constructors
#region Protected Methods
@@ -307,7 +307,7 @@
"options_thermoregulator_9_enabled": 0.0,
"options_thermoregulator_9_setpoint": 0.0,
"options_thermoregulator_10_enabled": 0.0,
"options_thermoregulator_10_setpoint": 0.0
"options_thermoregulator_10_setpoint": 0.0,
"extraction_main_drawing_enabled": 0.0
},
"ChannelSetpoints": {
+11 -4
View File
@@ -4,6 +4,7 @@
<ncVendor>S7NET</ncVendor>
<!-- NO_NC/DEMO/FANUC/SIEMENS/OSAI/S7NET -->
<showNcHMI>false</showNcHMI>
<!--<ncIpAddress>192.168.139.1</ncIpAddress>-->
<ncIpAddress>192.168.0.102</ncIpAddress>
<ncPort>102</ncPort>
<machineModel>Thermo 2020</machineModel>
@@ -31,6 +32,8 @@
<CMSConnectReady>true</CMSConnectReady>
<maxAlarmsRows>50000</maxAlarmsRows>
<alarmToDelete>5000</alarmToDelete>
<maxSheetHistoryRows>10000</maxSheetHistoryRows>
<sheetHistoryToDelete>500</sheetHistoryToDelete>
</serverConfig>
<extSoftwares>
<software>
@@ -113,6 +116,10 @@
<key>RangeTempMax</key>
<value>100</value>
</entry>
<entry>
<key>EnableThermocam</key>
<value>true</value>
</entry>
</additionalParameters>
<unitOfMeasures>
<unitOfMeasure id="0" value="" />
@@ -129,24 +136,24 @@
<thread name="axis" value="200" />
<thread name="channelsIoFast" value="300" />
<thread name="channelsIoSlow" value="5000" />
<thread name="area" value="500" />
<thread name="area" value="2500" />
<thread name="confReq" value="2000" />
<thread name="expMan" value="30000" />
<thread name="functionEnab" value="300" />
<thread name="gauges" value="500" />
<thread name="m154" value="500" />
<thread name="m154" value="1000" />
<thread name="mCommands" value="250" />
<thread name="powerOn" value="500" />
<thread name="prodCycle" value="1000" />
<thread name="prodInfo" value="1000" />
<thread name="prodPanel" value="500" />
<thread name="modules" value="200" />
<thread name="recipe" value="4000" />
<thread name="recipe" value="1000" />
<thread name="scada" value="1000" />
<thread name="statusCommand" value="250" />
<thread name="FlirCamera" value="500" />
<thread name="userSK" value="250" />
<thread name="warmers" value="500" />
<thread name="warmers" value="2000" />
<thread name="watchdog" value="250" />
<thread name="stats" value="2000" />
</sampling>
@@ -42,6 +42,8 @@
<xs:element name="MTCApplicationName" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="maxAlarmsRows" type="xs:int" minOccurs="1" maxOccurs="1"/>
<xs:element name="alarmToDelete" type="xs:int" minOccurs="1" maxOccurs="1"/>
<xs:element name="maxSheetHistoryRows" type="xs:int" minOccurs="1" maxOccurs="1"/>
<xs:element name="sheetHistoryToDelete" type="xs:int" minOccurs="1" maxOccurs="1"/>
<xs:element name="CMSConnectReady" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
</xs:all>
</xs:complexType>
@@ -1033,6 +1033,8 @@ namespace Thermo.Active.Config
MTCApplicationName = x.Element("MTCApplicationName").Value,
MaxAlarmsRows = Convert.ToInt32(x.Element("maxAlarmsRows").Value),
AlarmToDelete = Convert.ToInt32(x.Element("alarmToDelete").Value),
MaxSheetHistoryRows = Convert.ToInt32(x.Element("maxSheetHistoryRows").Value),
SheetHistoryToDelete = Convert.ToInt32(x.Element("sheetHistoryToDelete").Value),
CmsConnectReady = Convert.ToBoolean(x.Element("CMSConnectReady").Value)
}).FirstOrDefault();
+288 -129
View File
@@ -49,6 +49,8 @@ public static class ThreadsFunctions
public static int modulesRtCounter = 0;
public static int recipeRtCounter = 0;
public static bool reconnectionIsRunning = false;
public static bool forcetakeSnapshot = false;
public static bool ReloadAfterLoad = false;
#endregion Public Fields
@@ -193,34 +195,45 @@ public static class ThreadsFunctions
StatReset();
NcAdapter ncAdapter = new NcAdapter();
CmsError libraryError = NO_ERROR;
// Run loop until NC is connected
while (!ncAdapter.numericalControl.NC_IsConnected())
try
{
// Try reconnection
libraryError = ncAdapter.Connect();
if (libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND || libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING || libraryError.errorCode == CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND)
ManageLibraryError(libraryError);
else if (libraryError.errorCode != CMS_ERROR_CODES.OK)
// Run loop until NC is connected
while (!ncAdapter.numericalControl.NC_IsConnected())
{
ncAdapter.Dispose();
// Try reconnection
libraryError = ncAdapter.Connect();
if (libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_ENVIRONMENT_NOT_FOUND || libraryError.errorCode == CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING || libraryError.errorCode == CMS_ERROR_CODES.OSAI_TT_FOLDER_NOT_FOUND)
ManageLibraryError(libraryError);
else if (libraryError.errorCode != CMS_ERROR_CODES.OK)
{
ncAdapter.Dispose();
}
// Send status to UI
MessageServices.Current.Publish(SEND_NC_STATUS_UI, null, ncAdapter.numericalControl.NC_IsConnected());
// Send status to signalr
MessageServices.Current.Publish(SEND_NC_STATUS, null, ncAdapter.numericalControl.NC_IsConnected());
Thread.Sleep(1000);
}
// Send status to UI
MessageServices.Current.Publish(SEND_NC_STATUS_UI, null, ncAdapter.numericalControl.NC_IsConnected());
// Send status to signalr
MessageServices.Current.Publish(SEND_NC_STATUS, null, ncAdapter.numericalControl.NC_IsConnected());
if (!libraryError.IsError())
{
if (ServerStartupConfig.AutoOpenCmsClient)
StartCMSClient();
Thread.Sleep(1000);
// Start/Restart NC threads
ThreadsHandler.StartWorkers();
reconnectionIsRunning = false;
}
}
if (!libraryError.IsError())
catch (ThreadAbortException ex)
{
if (ServerStartupConfig.AutoOpenCmsClient)
StartCMSClient();
// Start/Restart NC threads
ThreadsHandler.StartWorkers();
reconnectionIsRunning = false;
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
@@ -326,6 +339,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
/// <summary>
@@ -339,77 +356,106 @@ public static class ThreadsFunctions
public static void ManageFlirCamera()
{
NcAdapter ncAdapter = new NcAdapter();
ThermoCamComunicator TCCom = new ThermoCamComunicator(true);
Stopwatch sw = new Stopwatch();
try
// verifica abilitazione thermocam
if (NcAdapter.EnableThermocam)
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
// avvio oggetto thermocam
ThermoCamComunicator TCCom = new ThermoCamComunicator(true);
Stopwatch sw = new Stopwatch();
forcetakeSnapshot = false;
while (true)
RegistrationInfo takeReginfo = MessageServices.Current.Subscribe(TAKE_SNAPSHOT_THERMO, (a, b) =>
{
bool flirImageReq = false;
sw.Restart();
ThreadsFunctions.forcetakeSnapshot = true;
});
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
try
{
// Try connection
CmsError libraryError = ncAdapter.Connect();
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
while (true)
{
// check if there is a photo request pending
libraryError = ncAdapter.checkFlirImageRequest(out flirImageReq);
if (libraryError.IsError())
ManageLibraryError(libraryError);
bool flirImageReq = false;
sw.Restart();
if (flirImageReq)
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
bool done = false;
// if requested --> give ack!
ncAdapter.ManageFlirStrobe();
// requesto photo from library
NcAdapter.lastThermoImage = TCCom.takePicture();
done = !string.IsNullOrEmpty(NcAdapter.lastThermoImage);
if (done)
// check if there is a photo request pending
libraryError = ncAdapter.checkFlirImageRequest(out flirImageReq);
if (libraryError.IsError())
ManageLibraryError(libraryError);
if (flirImageReq || forcetakeSnapshot)
{
// init
List<Thermo.Cam.Utils.MeasurePoint> measuredpoints = new List<Thermo.Cam.Utils.MeasurePoint>();
Dictionary<int, double> actualTemp = new Dictionary<int, double>();
Dictionary<int, ThermoPoint> chPoints = new Dictionary<int, ThermoPoint>();
// recupero punti centrali resistenze
ncAdapter.GetWarmersChannelCenterPoints(out chPoints);
// richiesta temperature per i punti
done = TCCom.readMultiTemperatures("", chPoints, out measuredpoints);
// converto in actualTemp
foreach (var item in measuredpoints)
forcetakeSnapshot = false;
bool done = false;
// if requested --> give ack!
if (flirImageReq)
ncAdapter.ManageFlirStrobe();
// requesto photo from library
NcAdapter.lastThermoImage = TCCom.takePicture();
done = !string.IsNullOrEmpty(NcAdapter.lastThermoImage);
if (done)
{
actualTemp.Add(item.Id, item.Temperature);
// init
List<Thermo.Cam.Utils.MeasurePoint> measuredpoints = new List<Thermo.Cam.Utils.MeasurePoint>();
Dictionary<int, double> actualTemp = new Dictionary<int, double>();
Dictionary<int, ThermoPoint> chPoints = new Dictionary<int, ThermoPoint>();
// recupero punti centrali resistenze
ncAdapter.GetWarmersChannelCenterPoints(out chPoints);
// richiesta temperature per i punti
done = TCCom.readMultiTemperatures("", chPoints, out measuredpoints);
// converto in actualTemp
foreach (var item in measuredpoints)
{
actualTemp.Add(item.Id, item.Temperature);
}
// salvo dati temp sul PLC
ncAdapter.WriteRecipeWarmChTCamTempAct(actualTemp);
NcAdapter.lastImageTaken = DateTime.Now;
// give PLC strobe for uploaded Actual TEMP from image
if(flirImageReq)
ncAdapter.SendTCamImageReadyStrb();
MessageServices.Current.Publish(SEND_NEWTCAMIMAGE, null, NcAdapter.lastImageTaken);
}
// salvo dati temp sul PLC
ncAdapter.WriteRecipeWarmChTCamTempAct(actualTemp);
// give PLC strobe for uploaded Actual TEMP from image
ncAdapter.SendTCamImageReadyStrb();
}
// salvo status thermocam...
NcAdapter.cameraIsConnected = TCCom.CameraIsConnected;
}
else
RestoreConnection();
sw.Stop();
// Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(samplMsec("FlirCamera"), (int)sw.ElapsedMilliseconds));
}
else
RestoreConnection();
sw.Stop();
// Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(samplMsec("FlirCamera"), (int)sw.ElapsedMilliseconds));
}
}
catch (ThreadAbortException)
{
ncAdapter.Dispose();
}
finally
{
// chiudo thermocam
TCCom.Dispose();
catch (ThreadAbortException)
{
ncAdapter.Dispose();
// chiudo thermocam
TCCom.Dispose();
}
finally
{
MessageServices.Current.UnSubscribe(takeReginfo);
ncAdapter.Dispose();
// chiudo thermocam
TCCom.Dispose();
}
}
}
@@ -484,6 +530,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ManageWatchdog()
@@ -530,6 +580,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadAlarms()
@@ -574,6 +628,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadAreaData()
@@ -616,6 +674,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
/// <summary>
@@ -669,6 +731,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
/// <summary>
@@ -718,6 +784,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadEnabledFunctionality()
@@ -762,6 +832,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadExpiredMaintenances()
@@ -816,6 +890,11 @@ public static class ThreadsFunctions
}
catch (Exception ex)
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
@@ -860,6 +939,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadM154Data()
@@ -1034,6 +1117,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadMComandsData()
@@ -1080,6 +1167,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadModulesData()
@@ -1122,6 +1213,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadPowerOnData()
@@ -1164,6 +1259,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadProcessesPPStatus()
@@ -1210,6 +1309,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadProdCycleData()
@@ -1253,6 +1356,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadProdInfoData()
@@ -1296,6 +1403,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadProdPanelData()
@@ -1339,6 +1450,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadRecipeData()
@@ -1352,6 +1467,13 @@ public static class ThreadsFunctions
if (libraryError.errorCode != 0)
ManageLibraryError(libraryError);
MessageServices.Current.Subscribe(RECIPE_LOADED, (a, b) =>
{
ReloadAfterLoad = true;
recipeRtCounter = 0;
});
while (true)
{
// ogni n counter leggo anche dati NON RT
@@ -1365,39 +1487,51 @@ public static class ThreadsFunctions
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
// Get new data from PLC
libraryError = ncAdapter.ReadRecipeData(onlyRt, false, out Dictionary<string, DTORecipeParam> currRecipe);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_THERMO_RECIPE_FULL, null, currRecipe);
// ora gestisco la overview!
libraryError = ncAdapter.GetRecipeOverview(out Dictionary<RecipeSection, RecipeCatStatus> currOverview);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_THERMO_RECIPE_OVERWIEW, null, currOverview);
// ora gestisco la lettura della overview di "modificata
DTORecipeStatus message = new DTORecipeStatus()
// controllo su redis che NON sia bloccata lettura ricetta..
if (!RedisController.getRecipeReadSem)
{
recipeName = NcAdapter.RecipeLiveData.RecipeName,
hasChanged = NcAdapter.RecipeLiveData.hasChanged
};
// Get new data from PLC
libraryError = ncAdapter.ReadRecipeData(onlyRt, false, out Dictionary<string, DTORecipeParam> currRecipe);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_THERMO_RECIPE_CHANGED, null, message);
MessageServices.Current.Publish(SEND_THERMO_RECIPE_FULL, null, currRecipe);
// verifico se dal PLC è segnalato che i setpointHMI sono invalidati, nel qual caso INVIO
bool setpointHmiInvalidated = false;
libraryError = ncAdapter.checkSetpointInvalidated(out setpointHmiInvalidated);
if (setpointHmiInvalidated)
{
// ora gestisco l'ack della richiesta
libraryError = ncAdapter.doAckSetpointInvalidated();
// ora gestisco la overview!
libraryError = ncAdapter.GetRecipeOverview(out Dictionary<RecipeSection, RecipeCatStatus> currOverview);
if (libraryError.IsError())
ManageLibraryError(libraryError);
MessageServices.Current.Publish(SEND_THERMO_RECIPE_OVERWIEW, null, currOverview);
// ora gestisco la lettura della overview di "modificata
DTORecipeStatus message = new DTORecipeStatus()
{
recipeName = NcAdapter.RecipeLiveData.RecipeName,
hasChanged = NcAdapter.RecipeLiveData.hasChanged
};
MessageServices.Current.Publish(SEND_THERMO_RECIPE_CHANGED, null, message);
// verifico se dal PLC è segnalato che i setpointHMI sono invalidati, nel qual caso INVIO
bool setpointHmiInvalidated = false;
libraryError = ncAdapter.checkSetpointInvalidated(out setpointHmiInvalidated);
if (setpointHmiInvalidated)
{
// ora gestisco l'ack della richiesta
libraryError = ncAdapter.doAckSetpointInvalidated();
}
if(ReloadAfterLoad)
{
ReloadAfterLoad = false;
setpointHmiInvalidated = true;
}
// pubblico booleana dei setpointHMI invalidati
MessageServices.Current.Publish(SEND_THERMO_RECIPE_SETPOINTHMI_CHANGED, null, setpointHmiInvalidated);
}
else
{
}
// pubblico booleana dei setpointHMI invalidati
MessageServices.Current.Publish(SEND_THERMO_RECIPE_SETPOINTHMI_CHANGED, null, setpointHmiInvalidated);
}
else
RestoreConnection();
@@ -1414,6 +1548,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadScadaData()
@@ -1459,6 +1597,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadUserSoftKeysData()
@@ -1503,6 +1645,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void ReadWarmersData()
@@ -1520,33 +1666,38 @@ public static class ThreadsFunctions
bool useCache = false;
while (true)
{
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
// controllo su redis che NON sia bloccata lettura ricetta..
if (!RedisController.getWarmersReadSem)
{
if (cacheWarmers)
sw.Restart();
// Check if client is connected
if (ncAdapter.numericalControl.NC_IsConnected())
{
// every 10 reads all data...
useCache = (readCount != 0);
readCount++;
// ciclo resettato ogni 20
readCount = readCount % 20;
if (cacheWarmers)
{
// every 10 reads all data...
useCache = (readCount != 0);
readCount++;
// ciclo resettato ogni 20
readCount = readCount % 20;
}
// Get new data from PLC
libraryError = ncAdapter.ReadWarmers(useCache, out Dictionary<int, DTOWarmers> currWarmers);
if (libraryError.IsError())
ManageLibraryError(libraryError);
// pubblico
MessageServices.Current.Publish(SEND_THERMO_WARMERS_DATA, null, currWarmers);
}
// Get new data from PLC
libraryError = ncAdapter.ReadWarmers(useCache, out Dictionary<int, DTOWarmers> currWarmers);
if (libraryError.IsError())
ManageLibraryError(libraryError);
// pubblico
MessageServices.Current.Publish(SEND_THERMO_WARMERS_DATA, null, currWarmers);
else
RestoreConnection();
sw.Stop();
// Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
}
else
RestoreConnection();
sw.Stop();
// Update thread timer
UpdateStat(MethodBase.GetCurrentMethod().Name, sw.ElapsedMilliseconds);
// Wait
Thread.Sleep(CalcSleepTime(samplMsec("warmers"), (int)sw.ElapsedMilliseconds));
}
@@ -1555,6 +1706,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void RestoreConnection()
@@ -1648,6 +1803,10 @@ public static class ThreadsFunctions
{
ncAdapter.Dispose();
}
finally
{
ncAdapter.Dispose();
}
}
public static void StartCMSClient()
-4
View File
@@ -38,10 +38,6 @@
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="S7.Net" publicKeyToken="d5812d469e84c693" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.8.1.0" newVersion="0.8.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
-4
View File
@@ -57,10 +57,6 @@
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="S7.Net" publicKeyToken="d5812d469e84c693" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.8.1.0" newVersion="0.8.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Thermo.Active.Model.DatabaseModels;
using static Thermo.Active.Config.ServerConfig;
namespace Thermo.Active.Database.Controllers
{
public class HistorySheetsController : IDisposable
{
private DatabaseContext dbCtx;
public HistorySheetsController()
{
// Initialize database context
dbCtx = new DatabaseContext();
}
public void Dispose()
{
dbCtx.Dispose();
}
public HistorySheetModel Create(string recipe, short piece, float value1, float value2, float value3, ushort typeval)
{
HistorySheetModel mod = new HistorySheetModel()
{
DtEvent = DateTime.Now,
RecipeName = recipe,
NumDone = piece,
FirstVal = value1,
SecondVal = value2,
ThirdVal = value3,
TypeVal = typeval
};
// Add to database
dbCtx.HistorySheet.Add(mod);
// Commit changes
dbCtx.SaveChanges();
return mod;
}
public void Clean()
{
if (this.count() >= ServerStartupConfig.MaxSheetHistoryRows)
{
dbCtx.Database.ExecuteSqlCommand("DELETE FROM historysheets LIMIT {0}", ServerStartupConfig.SheetHistoryToDelete);
}
}
public List<HistorySheetModel> GetData(int start, int number)
{
// Get page numbers
return dbCtx
.HistorySheet
.OrderByDescending(x => x.DtEvent).Skip(start).Take(number).ToList();
}
public List<HistorySheetModel> GetData()
{
// Get page numbers
return dbCtx
.HistorySheet
.OrderByDescending(x => x.DtEvent).ToList();
}
public int count()
{
// Get page numbers
return dbCtx
.HistorySheet.Count();
}
}
}
@@ -21,6 +21,12 @@ namespace Thermo.Active.Database.Controllers
// Initialize database context
dbCtx = new DatabaseContext();
}
public void Dispose()
{
// Clear database context
dbCtx.Dispose();
}
#endregion Public Constructors
@@ -80,11 +86,6 @@ namespace Thermo.Active.Database.Controllers
return prodData;
}
public void Dispose()
{
// Clear database context
dbCtx.Dispose();
}
/// <summary>
/// Get record by NumDone
@@ -36,6 +36,12 @@ namespace Thermo.Active.Database.Controllers
private const string machineEventKpis = "Events:Kpis";
private const string machineMessagePath = "Events:Messages";
private const string thermoSemRecipe = "Thermo:Semaphore:All";
private const string thermoSemWarmers = "Thermo:Semaphore:All";
//private const string thermoSemRecipe = "Thermo:Semaphore:Recipe";
//private const string thermoSemWarmers = "Thermo:Semaphore:Warmers";
public static void WriteProductionNotification(uint ProductionProcess, string Notification)
{
string redisHash = redUtil.man.redHash(redisNotificationAddress).Replace("%NN%", ProductionProcess.ToString("00"));
@@ -246,5 +252,89 @@ namespace Thermo.Active.Database.Controllers
return true;
}
/// <summary>
/// Imposta semaforo Recipe
/// </summary>
/// <param name="doLock">true: imposto lock per 5 sec, false: tolgo lock (stringa vuota)</param>
/// <returns></returns>
public static bool setRecipeReadSem(bool doLock)
{
return setSemaphore(doLock, redUtil.man.redHash(thermoSemRecipe));
}
/// <summary>
/// Restituisce semaforo Recipe
/// </summary>
/// <returns></returns>
public static bool getRecipeReadSem
{
get
{
return getSemaphore(redUtil.man.redHash(thermoSemRecipe));
}
}
/// <summary>
/// Imposta semaforo Warmers
/// </summary>
/// <param name="doLock">true: imposto lock per 5 sec, false: tolgo lock (stringa vuota)</param>
/// <returns></returns>
public static bool setWarmersReadSem(bool doLock)
{
return setSemaphore(doLock, redUtil.man.redHash(thermoSemWarmers));
}
/// <summary>
/// Restituisce semaforo Warmers
/// </summary>
/// <returns></returns>
public static bool getWarmersReadSem
{
get
{
return getSemaphore(redUtil.man.redHash(thermoSemWarmers));
}
}
/// <summary>
/// Gestione generica SET semaforo
/// </summary>
/// <param name="doLock"></param>
/// <param name="redisHash"></param>
/// <returns></returns>
private static bool setSemaphore(bool doLock, string redisHash)
{
bool answ = true;
int ttlSec = 5;
string rawData = $"{DateTime.Now}";
try
{
if (doLock)
{
// imposto lock
answ = redUtil.man.setRSV(redisHash, rawData, ttlSec);
}
else
{
// metto empty string a 1 sec
answ = redUtil.man.setRSV(redisHash, "", 1);
}
}
catch
{ }
return answ;
}
/// <summary>
/// Gestione generica GET semafoto
/// </summary>
/// <param name="redisHash"></param>
/// <returns></returns>
private static bool getSemaphore(string redisHash)
{
bool answ = true;
string rawData = redUtil.man.getRSV(redisHash);
// se non nulla --> ho semaforo!
answ = !string.IsNullOrEmpty(rawData);
return answ;
}
}
}
+1 -1
View File
@@ -44,7 +44,7 @@ namespace Thermo.Active.Database
// thermo!
public DbSet<ProdInfoModel> ProdInfo { get; set; }
public DbSet<HistorySheetModel> HistorySheet { get; set; }
// Create migration string
public static string CONNECTION_STRING = "Server = " + "localhost" + "; Database=" + DATABASE_NAME + ";Uid=" + DATABASE_USER + ";Pwd=" + DATABASE_PWD + ";";
@@ -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 HistorySheets : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(HistorySheets));
string IMigrationMetadata.Id
{
get { return "202103191608500_HistorySheets"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,29 @@
namespace Thermo.Active.Database.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class HistorySheets : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.HistorySheets",
c => new
{
DtEvent = c.DateTime(nullable: false, precision: 0),
Recipe = c.String(unicode: false),
FirstVal = c.Single(nullable: false),
SecondVal = c.Single(nullable: false),
ThirdVal = c.Single(nullable: false),
})
.PrimaryKey(t => t.DtEvent);
}
public override void Down()
{
DropTable("dbo.HistorySheets");
}
}
}
File diff suppressed because one or more lines are too long
@@ -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 HistorySheetsCycle : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(HistorySheetsCycle));
string IMigrationMetadata.Id
{
get { return "202103191626072_HistorySheetsCycle"; }
}
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 HistorySheetsCycle : DbMigration
{
public override void Up()
{
AddColumn("dbo.HistorySheets", "NumDone", c => c.Short(nullable: false));
}
public override void Down()
{
DropColumn("dbo.HistorySheets", "NumDone");
}
}
}
File diff suppressed because one or more lines are too long
@@ -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 addedTypeValHistory : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(addedTypeValHistory));
string IMigrationMetadata.Id
{
get { return "202103221323362_addedTypeValHistory"; }
}
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 addedTypeValHistory : DbMigration
{
public override void Up()
{
AddColumn("dbo.HistorySheets", "TypeVal", c => c.Int(nullable: false));
}
public override void Down()
{
DropColumn("dbo.HistorySheets", "TypeVal");
}
}
}
File diff suppressed because one or more lines are too long
@@ -124,6 +124,7 @@
<ItemGroup>
<Compile Include="Controllers\AlarmsController.cs" />
<Compile Include="Controllers\FunctionsAccessController.cs" />
<Compile Include="Controllers\HistorySheetsController.cs" />
<Compile Include="Controllers\ProdInfoController.cs" />
<Compile Include="Controllers\MachinesController.cs" />
<Compile Include="Controllers\MaintenancesController.cs" />
@@ -158,6 +159,18 @@
<Compile Include="Migrations\202102171753226_Added_ThermoImage_prodInfo.Designer.cs">
<DependentUpon>202102171753226_Added_ThermoImage_prodInfo.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202103191608500_HistorySheets.cs" />
<Compile Include="Migrations\202103191608500_HistorySheets.Designer.cs">
<DependentUpon>202103191608500_HistorySheets.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202103191626072_HistorySheetsCycle.cs" />
<Compile Include="Migrations\202103191626072_HistorySheetsCycle.Designer.cs">
<DependentUpon>202103191626072_HistorySheetsCycle.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202103221323362_addedTypeValHistory.cs" />
<Compile Include="Migrations\202103221323362_addedTypeValHistory.Designer.cs">
<DependentUpon>202103221323362_addedTypeValHistory.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Redis\redUtil.cs" />
@@ -212,6 +225,15 @@
<EmbeddedResource Include="Migrations\202102171753226_Added_ThermoImage_prodInfo.resx">
<DependentUpon>202102171753226_Added_ThermoImage_prodInfo.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202103191608500_HistorySheets.resx">
<DependentUpon>202103191608500_HistorySheets.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202103191626072_HistorySheetsCycle.resx">
<DependentUpon>202103191626072_HistorySheetsCycle.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202103221323362_addedTypeValHistory.resx">
<DependentUpon>202103221323362_addedTypeValHistory.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -18,5 +18,9 @@ namespace Thermo.Active.Model.ConfigModels
public int MaxAlarmsRows { get; set; }
public int AlarmToDelete { get; set; }
public int MaxSheetHistoryRows { get; set; }
public int SheetHistoryToDelete { get; set; }
}
}
+3
View File
@@ -23,6 +23,7 @@ namespace Thermo.Active.Model
public const string AXES_CONFIG_PATH = CONFIG_DIRECTORY + "axesConfig.xml";
public const string AXES_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + @"axesConfigValidator.xsd";
public const string BROADCAST_DATA = "BROADCAST_DATA";
public const string TAKE_SNAPSHOT_THERMO = "TAKE_SNAPSHOT_THERMO";
// File paths
public const string CLIENT_EXE_NAME = @"Active_Client.exe";
@@ -104,6 +105,7 @@ namespace Thermo.Active.Model
public const string SEND_AXIS_INFO = "SEND_AXIS_INFO";
public const string SEND_CHANNELS_IO_DATA = "SEND_CHANNELS_IO_DATA";
public const string SEND_NEWTCAMIMAGE = "SEND_NEWTCAMIMAGE";
public const string SEND_CMSCONNECT_GW_REBOOT_STATUS = "SEND_CMSCONNECT_GW_REBOOT_STATUS";
public const string SEND_ERROR_TO_UI = "SEND_ERROR_TO_UI";
public const string SEND_EXPIRED_MAINTENANCES_DATA = "SEND_EXPIRED_MAINTENANCES_DATA";
@@ -141,6 +143,7 @@ namespace Thermo.Active.Model
public const string SEND_THERMO_WARMERS_DATA = "SEND_THERMO_WARMERS_DATA";
public const string SEND_THREADS_STATUS = "THREAD_STATUS";
public const string SEND_USER_SOFTKEYS_DATA = "SEND_USER_SOFTKEYS_DATA";
public const string RECIPE_LOADED = "RECIPE_LOADED";
// Names in the xml file
public const string SERVER_CONFIG_KEY = "serverConfig";
@@ -30,11 +30,21 @@ namespace Thermo.Active.Model.DTOModels.ThWarmers
/// </summary>
public bool ThermoCamOnOff { get; set; } = false;
/// <summary>
/// Stato connessione ThermoCamera (in rete)
/// </summary>
public bool ThermoCamConnected { get; set; } = false;
/// <summary>
/// Opzione ThermoCamera (set by PLC)
/// </summary>
public bool ThermoOptionActive { get; set; } = false;
/// <summary>
/// Data ultima acquisizione
/// </summary>
public DateTime LastTakenImage { get; set; } = new DateTime(0);
#endregion Public Properties
#region Public Methods
@@ -59,7 +69,9 @@ namespace Thermo.Active.Model.DTOModels.ThWarmers
return false;
if (RangeTemperature != item.RangeTemperature)
return false;
if (LastTakenImage != item.LastTakenImage)
return false;
return true;
}
@@ -0,0 +1,38 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Thermo.Active.Model.DatabaseModels
{
[Table("HistorySheets")]
public class HistorySheetModel
{
#region Public Properties
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Column("DtEvent", Order = 0)]
public DateTime DtEvent { get; set; }
[Column("Recipe")]
public string RecipeName { get; set; }
[Column("NumDone")]
public short NumDone { get; set; }
[Column("FirstVal")]
public float FirstVal { get; set; }
[Column("SecondVal")]
public float SecondVal { get; set; }
[Column("ThirdVal")]
public float ThirdVal { get; set; }
[Column("TypeVal")]
public int TypeVal { get; set; }
#endregion Public Properties
}
}
@@ -85,6 +85,7 @@
<Compile Include="DatabaseModels\AlarmNoteModel.cs" />
<Compile Include="DatabaseModels\AlarmOccurrencesModel.cs" />
<Compile Include="DatabaseModels\AlarmUserModel.cs" />
<Compile Include="DatabaseModels\HistorySheetModel.cs" />
<Compile Include="DatabaseModels\FavoriteUserSoftKeyModel.cs" />
<Compile Include="DatabaseModels\FunctionAccessModel.cs" />
<Compile Include="ConfigModels\MessageModel.cs" />
+123 -3
View File
@@ -135,6 +135,16 @@ namespace Thermo.Active.NC
/// </summary>
public NcThermo numericalControl;
/// <summary>
/// Indica se la FLIR camera è connessa
/// </summary>
public static bool cameraIsConnected = false;
/// <summary>
/// Indica se la FLIR camera è connessa
/// </summary>
public static DateTime lastImageTaken = new DateTime(0);
#endregion Public Fields
#region Public Constructors
@@ -465,10 +475,16 @@ namespace Thermo.Active.NC
// solo x S7...
if (NcConfig.NcVendor == NC_VENDOR.S7NET)
{
// registro in redis blocco x lettura ricetta...
RedisController.setRecipeReadSem(true);
// call NC for update
CmsError libraryError = numericalControl.PLC_WRecipeEdit(confirmUpdate);
if (libraryError.IsError())
return libraryError;
// tolgo blocco x lettura ricetta...
RedisController.setRecipeReadSem(false);
}
else
{
@@ -1409,7 +1425,9 @@ namespace Thermo.Active.NC
// leggo la ricetta dal PLC!
var currRecipe = new Dictionary<string, DTORecipeParam>();
libraryError = ReadFullRecipe(out currRecipe);
//libraryError = ReadFullRecipe(out currRecipe);
libraryError = ReadRecipeData(true, true, out currRecipe);
if (libraryError.IsError())
return libraryError;
@@ -1680,7 +1698,7 @@ namespace Thermo.Active.NC
var currRecipe = new Dictionary<string, DTORecipeParam>();
// read recipe
libraryError = ReadRecipeData(false, true, out currRecipe);
libraryError = ReadRecipeData(true, true, out currRecipe);
if (libraryError.IsError())
return libraryError;
@@ -1752,10 +1770,16 @@ namespace Thermo.Active.NC
{
if (NcFileAdapter.RecipeLiveData.ChannelSetpoints != null)
{
// registro in redis blocco x lettura ricetta...
RedisController.setRecipeReadSem(true);
// se si in questo caso scrivo configurazione...
WriteRecipeWarmConfig();
// Ack !
libraryError = numericalControl.PLC_WAckConfRiskRequest();
// tolgo in redis blocco x lettura ricetta...
RedisController.setRecipeReadSem(false);
}
}
if (ThermoReqConfRecipeStr)
@@ -1783,8 +1807,12 @@ namespace Thermo.Active.NC
return NOT_FOUND_ERROR;
}
}
// registro in redis blocco x lettura ricetta...
RedisController.setRecipeReadSem(true);
// se si in questo caso scrivo configurazione attuale...
WriteRecipeParams(updtRecipe, nMaxParamWrite, delayParamWrite);
// tolgo in redis blocco x lettura ricetta...
RedisController.setRecipeReadSem(false);
using (UserSoftkeysController controller = new UserSoftkeysController())
{
@@ -1801,6 +1829,9 @@ namespace Thermo.Active.NC
newRisk.Add(item.Key, item.Value);
}
// registro in redis blocco x lettura ricetta...
RedisController.setRecipeReadSem(true);
// write to PLC SetPointHMI (%)
libraryError = WriteRecipeWarmChSetpHMI(newRisk);
if (libraryError.IsError())
@@ -1815,6 +1846,9 @@ namespace Thermo.Active.NC
libraryError = ConfirmRecipeData(true);
if (libraryError.IsError())
return libraryError;
// tolgo in redis blocco x lettura ricetta...
RedisController.setRecipeReadSem(true);
}
}
}
@@ -2508,7 +2542,7 @@ namespace Thermo.Active.NC
{
imgName = "UNDEFINED";
}
prodInfoController.Create(pInfoRaw.NumTarget, pInfoRaw.NumDone, pInfoRaw.TimeWarm, pInfoRaw.TimeVent, pInfoRaw.TimeVacuum, pInfoRaw.TimeCycleGross, pInfoRaw.TimeCycleNet, pInfoRaw.MaterialTempEndWarm, pInfoRaw.MaterialTempEndVent, pInfoRaw.MoldTemp, pInfoRaw.VacuumReadVal, pInfoRaw.MouldEnergyOUT, pInfoRaw.MouldEnergyIN, false, pInfoRaw.ThermoImage);
prodInfoController.Create(pInfoRaw.NumTarget, pInfoRaw.NumDone, pInfoRaw.TimeWarm, pInfoRaw.TimeVent, pInfoRaw.TimeVacuum, pInfoRaw.TimeCycleGross, pInfoRaw.TimeCycleNet, pInfoRaw.MaterialTempEndWarm, pInfoRaw.MaterialTempEndVent, pInfoRaw.MoldTemp, pInfoRaw.VacuumReadVal, pInfoRaw.MouldEnergyOUT, pInfoRaw.MouldEnergyIN, false, imgName);
// indico di rileggere il DB...
forceProdPanelDbReload = true;
}
@@ -2554,6 +2588,26 @@ namespace Thermo.Active.NC
lastProdStart = DateTime.Now;
}
ThermoModels.HistorySheet sheetRaw = new ThermoModels.HistorySheet();
libraryError = numericalControl.PLC_RHistorySheets(ref sheetRaw);
if (libraryError.IsError())
return libraryError;
if (sheetRaw.newData)
{
using (HistorySheetsController HSC = new HistorySheetsController())
{
HSC.Create(NcFileAdapter.RecipeLiveData.RecipeName, sheetRaw.IdPiece, (float) sheetRaw.Value1, (float) sheetRaw.Value2, (float) sheetRaw.Value3,sheetRaw.TypeVal);
// manage strobe/ack!
libraryError = numericalControl.PLC_WAckHistorySheets();
if (libraryError.IsError())
return libraryError;
}
}
return libraryError;
}
@@ -3120,6 +3174,16 @@ namespace Thermo.Active.NC
return libraryError;
}
public static bool EnableThermocam
{
get
{
bool answ = false;
bool.TryParse(AdditionalParametersConfig["EnableThermocam"], out answ);
return answ;
}
}
public CmsError ReadTCamData(out DTOThermoCam currTCamData)
{
CmsError libraryError = NO_ERROR;
@@ -3153,6 +3217,11 @@ namespace Thermo.Active.NC
Min = minVal,
Max = maxVal
};
// controllo se connessa
currTCamData.ThermoCamConnected = cameraIsConnected;
// DataOra ultima immagine scattata
currTCamData.LastTakenImage = lastImageTaken;
}
return libraryError;
}
@@ -3374,8 +3443,14 @@ namespace Thermo.Active.NC
/// <returns></returns>
public CmsError SetTCamActiv(bool enableTCam)
{
// registro in redis blocco x lettura ricetta...
RedisController.setWarmersReadSem(true);
CmsError libraryError = numericalControl.PLC_WTCamActiv(enableTCam);
// tolgo in redis blocco x lettura ricetta...
RedisController.setWarmersReadSem(false);
return libraryError;
}
@@ -3386,8 +3461,14 @@ namespace Thermo.Active.NC
/// <returns></returns>
public CmsError SetTCamMode(bool enableTCam)
{
// registro in redis blocco x lettura ricetta...
RedisController.setWarmersReadSem(true);
CmsError libraryError = numericalControl.PLC_WTCamMode(enableTCam);
// tolgo in redis blocco x lettura ricetta...
RedisController.setWarmersReadSem(false);
return libraryError;
}
@@ -3622,8 +3703,15 @@ namespace Thermo.Active.NC
/// <returns></returns>
public CmsError WriteRecipeParams(Dictionary<string, DTORecipeParam> updtRecipe, int nMaxParamWrite, int delayParamWrite)
{
// registro in redis blocco x lettura ricetta...
RedisController.setRecipeReadSem(true);
CmsError libraryError = WriteRecipeParametersToPLC(updtRecipe, nMaxParamWrite, delayParamWrite);
// tolgo blocco x lettura ricetta...
RedisController.setRecipeReadSem(false);
return libraryError;
}
@@ -3634,8 +3722,15 @@ namespace Thermo.Active.NC
/// <returns></returns>
public CmsError WriteRecipeWarmChSetpHMI(Dictionary<int, int> updtSetpHmi)
{
// registro in redis blocco x lettura warmers...
RedisController.setWarmersReadSem(true);
CmsError libraryError = numericalControl.PLC_WWarmerChSetpHmi(updtSetpHmi);
// tolgo blocco x lettura warmers...
RedisController.setWarmersReadSem(false);
return libraryError;
}
@@ -3646,8 +3741,14 @@ namespace Thermo.Active.NC
/// <returns></returns>
public CmsError WriteRecipeWarmChTCamEnab(Dictionary<int, bool> actualStates)
{
// registro in redis blocco x lettura warmers...
RedisController.setWarmersReadSem(true);
CmsError libraryError = numericalControl.PLC_WWarmerChTCamEnab(actualStates);
// tolgo blocco x lettura warmers...
RedisController.setWarmersReadSem(false);
return libraryError;
}
@@ -3658,8 +3759,14 @@ namespace Thermo.Active.NC
/// <returns></returns>
public CmsError WriteRecipeWarmChTCamTempAct(Dictionary<int, double> actualTemp)
{
// registro in redis blocco x lettura warmers...
RedisController.setWarmersReadSem(true);
CmsError libraryError = numericalControl.PLC_WWarmerChTCamTempAct(actualTemp);
// tolgo blocco x lettura warmers...
RedisController.setWarmersReadSem(false);
return libraryError;
}
@@ -3670,8 +3777,14 @@ namespace Thermo.Active.NC
/// <returns></returns>
public CmsError WriteRecipeWarmChTCamTempSet(Dictionary<int, double> referenceTemp)
{
// registro in redis blocco x lettura warmers...
RedisController.setWarmersReadSem(true);
CmsError libraryError = numericalControl.PLC_WWarmerChTCamTempSet(referenceTemp);
// tolgo blocco x lettura warmers...
RedisController.setWarmersReadSem(false);
return libraryError;
}
@@ -3685,6 +3798,9 @@ namespace Thermo.Active.NC
Dictionary<int, int> newData = new Dictionary<int, int>();
CmsError libraryError = NO_ERROR;
// registro in redis blocco x lettura warmers...
RedisController.setWarmersReadSem(true);
// scrivo l'abilitazione dei canali...
foreach (var item in RiskBoardConfig)
{
@@ -3746,6 +3862,10 @@ namespace Thermo.Active.NC
numericalControl.PLC_WWarmerChTCamEnab(resetTCamEnab);
numericalControl.PLC_WWarmerChTCamTempAct(resetTCamTemp);
numericalControl.PLC_WWarmerChTCamTempSet(resetTCamTemp);
// tolgo blocco x lettura warmers...
RedisController.setWarmersReadSem(false);
// esce
return libraryError;
}
+7 -6
View File
@@ -724,7 +724,6 @@ namespace Thermo.Active.NC
// check filePath...
if (File.Exists(RECIPE_TEMPLATE_PATH))
{
answ = true;
// load all text data
var rawData = File.ReadAllText(RECIPE_TEMPLATE_PATH);
@@ -737,18 +736,20 @@ namespace Thermo.Active.NC
// fix Modifica dati
RecipeLiveData.hasChanged = false;
// from template --> reset (if present) overview data...
if (RecipeLiveData.RecipeOverview != null)
/*if (RecipeLiveData.RecipeOverview != null)
{
foreach (var item in RecipeLiveData.RecipeOverview)
{
RecipeLiveData.RecipeOverview[item.Key] = RecipeCatStatus.Unchanged;
}
}
}*/
// update NAME
RecipeLiveData.RecipeName = $"{DateTime.Now:yyyyMMss_HHmmss}.json";
RecipeLiveData.RecipeName = $"NEW_RECIPE_{DateTime.Now:HH_mm_ss}";
answ = true;
}
catch
{ }
catch(Exception e)
{ return answ; }
// update current live data!
SaveRecipeCurrent();
}
-4
View File
@@ -38,10 +38,6 @@
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="S7.Net" publicKeyToken="d5812d469e84c693" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.8.1.0" newVersion="0.8.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
-4
View File
@@ -38,10 +38,6 @@
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="S7.Net" publicKeyToken="d5812d469e84c693" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.8.1.0" newVersion="0.8.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -47,6 +47,10 @@ namespace Thermo.Active.Utils
{
Log.Info(message);
}
public static void LogDebug(string message)
{
Log.Debug(message);
}
public static void LogWarning(string message)
{
+15 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Automatically generated by nicola.carminati: 2021-03-10 -->
<!-- Automatically generated by nicola.carminati: 2021-03-29 -->
<root>
<language_it>Italiano</language_it>
<header_maintainance_request>Effettuare manutenzione</header_maintainance_request>
@@ -430,4 +430,18 @@
<axis_info_position>In posizione:</axis_info_position>
<axis_info_error>In errore:</axis_info_error>
<axis_info_brakealm>Allarme test freno:</axis_info_brakealm>
<bitselect_select_none>Nessuno</bitselect_select_none>
<bitselect_select_all>Tutti</bitselect_select_all>
<underthehood_label_recipe>RIcetta</underthehood_label_recipe>
<underthehood_label_numpiece>Lastra</underthehood_label_numpiece>
<underthehood_label_type>Tipo</underthehood_label_type>
<tem_fix>Fissa Temperature</tem_fix>
<warmers_thermoprophet_enabled>Thermoprophet</warmers_thermoprophet_enabled>
<modal_image_thermo>Immagini termocamera</modal_image_thermo>
<thermo-long-tap-info>Tocca a lungo sull&#39;immagine per leggere la temperatura</thermo-long-tap-info>
<last-image>Ultimo scatto</last-image>
<first-image>Primo scatto</first-image>
<new_folder_name>Nome della Cartella:</new_folder_name>
<new_recipe_name>Nome della nuova ricetta:</new_recipe_name>
<recipe_create>Nuova ricetta</recipe_create>
</root>
+16 -2
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Automatically generated by nicola.carminati: 2021-03-10 -->
<!-- Automatically generated by nicola.carminati: 2021-03-29 -->
<root>
<language_it>English</language_it>
<header_maintainance_request>Maintenance request</header_maintainance_request>
@@ -211,7 +211,7 @@
<confirm>Confirm</confirm>
<modal_load_program_lbl_sheet_x>Sheet size X:</modal_load_program_lbl_sheet_x>
<modal_load_program_lbl_sheet_y>Sheet size Y:</modal_load_program_lbl_sheet_y>
<modal_load_program_lbl_sheet_z>Sheet tickness:</modal_load_program_lbl_sheet_z>
<modal_load_program_lbl_sheet_z>Sheet thickness:</modal_load_program_lbl_sheet_z>
<modal_load_program_lbl_notes>Notes:</modal_load_program_lbl_notes>
<modal_confirm_delete_recipe>Do you confirm that you want to delete the recipe?</modal_confirm_delete_recipe>
<modal_load_program_lbl_box_selected_folder>Selected folder:</modal_load_program_lbl_box_selected_folder>
@@ -430,4 +430,18 @@
<axis_info_position>In Position:</axis_info_position>
<axis_info_error>In Error:</axis_info_error>
<axis_info_brakealm>Brake Test Alarm:</axis_info_brakealm>
<bitselect_select_none>None</bitselect_select_none>
<bitselect_select_all>All</bitselect_select_all>
<underthehood_label_recipe>Recipe</underthehood_label_recipe>
<underthehood_label_numpiece>Sheet</underthehood_label_numpiece>
<underthehood_label_type>Type</underthehood_label_type>
<tem_fix>Fix temperatures</tem_fix>
<warmers_thermoprophet_enabled>Thermoprophet</warmers_thermoprophet_enabled>
<modal_image_thermo>Thermocamera Images</modal_image_thermo>
<thermo-long-tap-info>Long tap on image to add temperature inspectors</thermo-long-tap-info>
<last-image>Last Image</last-image>
<first-image>First Image</first-image>
<new_folder_name>Name of the folder:</new_folder_name>
<new_recipe_name>Name of the new recipe:</new_recipe_name>
<recipe_create>New Recipe</recipe_create>
</root>
+1 -5
View File
@@ -15,7 +15,7 @@
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="ServerServiceName" value="MariaDB" />
<add key="nMaxParamWrite" value="5" />
<add key="delayParamWrite" value="5" />
<add key="delayParamWrite" value="10" />
<add key="ewmaPar100" value="40" />
<add key="flirSwapXY" value="true" />
<add key="cacheWarmers" value="false" />
@@ -115,10 +115,6 @@
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="S7.Net" publicKeyToken="d5812d469e84c693" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.8.1.0" newVersion="0.8.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<connectionStrings>
@@ -8,6 +8,7 @@ using System.Security.Principal;
using Thermo.Active.Config;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Utils;
using static Thermo.Active.Config.ServerConfig;
using static Thermo.Active.Listeners.SignalRStaticObjects;
using static Thermo.Active.Model.Constants;
@@ -28,7 +29,11 @@ namespace Thermo.Active.Attributes
// Find user session on this machine
SessionModel session = sessionsController.FindSessionByToken(token);
if (session == null)
{
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | AuthorizeHubConnection | session == null");
return false;
}
}
return base.AuthorizeHubConnection(hubDescriptor, request);
@@ -39,11 +44,16 @@ namespace Thermo.Active.Attributes
var connectionId = hubIncomingInvokerContext.Hub.Context.ConnectionId;
var request = hubIncomingInvokerContext.Hub.Context.Request;
var token = request.QueryString.Get("Authorization");
if (!string.IsNullOrEmpty(token))
{
// check authorization
if (!CheckAuthorization(FunctionAccess, token, out int machineId, out int userId))
{
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | AuthorizeHubMethodInvocation | CheckAuthorization == false");
return false;
}
var claims = new ClaimsIdentity(AUTHENTICATION_TYPE);
claims.AddClaim(new Claim(USER_ID_KEY, userId.ToString()));
@@ -66,11 +76,17 @@ namespace Thermo.Active.Attributes
// Find user session on this machine
SessionModel session = sessionsController.FindSessionByToken(token);
if (session == null)
{
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | session == null");
return false;
}
// Check if the machine is the same where the user logged in
if (session.MachineUser.MachineId != MachineConfig.MachineId)
{
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | session.MachineUser.MachineId != MachineConfig.MachineId | " + session.MachineUser.MachineId + "," + MachineConfig.MachineId);
return false;
}
machineId = session.MachineUser.MachineId;
userId = session.MachineUser.UserId;
@@ -91,12 +107,18 @@ namespace Thermo.Active.Attributes
if (Action == ACTIONS.READ)
{ // Check read permissions
if (functionAccess.ReadLevelMin > machineUser.Role.Level)
{
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | functionAccess.ReadLevelMin > machineUser.Role.Level | " + functionAccess.ReadLevelMin + "," + machineUser.Role.Level);
return false; // Not authorized
}
}
else
{ // Check write permissions
if (functionAccess.WriteLevelMin > machineUser.Role.Level)
{
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | functionAccess.WriteLevelMin > machineUser.Role.Level | " + functionAccess.WriteLevelMin + "," + machineUser.Role.Level);
return false; // Not authorized
}
}
// Check if PLC bit exists
@@ -105,13 +127,21 @@ namespace Thermo.Active.Attributes
// Check if functionality is enabled by PLC
var functionalityIsEnabled = LastRuntimeFunctionality.Where(x => x.Name == functionName).FirstOrDefault();
if (functionalityIsEnabled == null || functionalityIsEnabled.Enabled == false)
return false;
{
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | functionalityIsEnabled == null || functionalityIsEnabled.Enabled == false | " + functionalityIsEnabled + "," + functionalityIsEnabled.Enabled);
return false; // Not authorized
}
}
}
else
{
ThermoActiveLogger.LogError($"SignalRAuthorizeAttribute | CheckAuthorization | functionAccess != null && ServerConfigController.CheckAreaStatus(functionAccess.Area) | " + functionAccess + "," + functionAccess.Area);
return false;
}
// Authorized
ThermoActiveLogger.LogInfo($"SignalRAuthorizeAttribute | CheckAuthorization | Authorized | ");
return true;
}
}
@@ -22,12 +22,14 @@ using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/maintenance_manager")]
public class ApiMaintenanceController : ApiController
public class ApiMaintenanceController : aBaseApiController // ApiController
{
#if false
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
protected static NcAdapter ncAdapter = new NcAdapter();
#endif
[Route("maintenances"), HttpGet]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.MAINTENANCE, Action = ACTIONS.READ)]
@@ -10,7 +10,7 @@ using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/authorization")]
public class AuthorizationController : ApiController
public class AuthorizationController : ApiController
{
[Route("functions"), HttpGet]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.GENERAL, Action = ACTIONS.READ)]
@@ -13,12 +13,14 @@ using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/user_softkey")]
public class FavoriteUserSoftkeyController : ApiController
public class FavoriteUserSoftkeyController : aBaseApiController // ApiController
{
#if false
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
protected static NcAdapter ncAdapter = new NcAdapter();
#endif
[Route("favorite"), HttpGet]
@@ -12,12 +12,14 @@ using static Thermo.Active.Utils.LanguageController;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/language")]
public class LanguageController : ApiController
public class LanguageController : aBaseApiController // ApiController
{
#if false
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
protected static NcAdapter ncAdapter = new NcAdapter();
#endif
[Route("languages"), HttpGet]
public IHttpActionResult GetLanguageList()
@@ -8,12 +8,14 @@ using Thermo.Active.Utils;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/ModBlock")]
public class ModulesController : ApiController
public class ModulesController : aBaseApiController // ApiController
{
#if false
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
protected static NcAdapter ncAdapter = new NcAdapter();
#endif
[Route("current"), HttpGet]
public IHttpActionResult GetCurrentModules()
@@ -8,13 +8,15 @@ using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/nc")]
public class NcApiController : ApiController
public class NcApiController : aBaseApiController // ApiController
{
#if false
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
#endif
[Route("generic_data"), HttpGet]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.NC_DATA, Action = ACTIONS.READ)]
public IHttpActionResult GetNcGenericData()
@@ -11,13 +11,16 @@ using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/prod")]
public class ProdController : ApiController
public class ProdController : aBaseApiController //ApiController
{
#if false
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
#endif
/// <summary>
/// Request mode SETUP
/// </summary>
@@ -7,6 +7,7 @@ using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
@@ -26,12 +27,14 @@ using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/recipe")]
public class RecipeController : ApiController
public class RecipeController : aBaseApiController // ApiController
{
#if false
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
protected static NcAdapter ncAdapter = new NcAdapter();
#endif
[Route("overview"), HttpGet]
public IHttpActionResult GetOverview()
@@ -100,7 +103,8 @@ namespace Thermo.Active.Controllers.WebApi
}
// read recipe!
libraryError = ncAdapter.ReadFullRecipe(out Dictionary<string, DTORecipeParam> prevRecipe);
//libraryError = ncAdapter.ReadFullRecipe(out Dictionary<string, DTORecipeParam> prevRecipe);
libraryError = ncAdapter.ReadRecipeData(true, true, out Dictionary<string, DTORecipeParam> prevRecipe);
if (libraryError.IsError())
{
ThermoActiveLogger.LogError($"GetRecipeOverview error | {libraryError.exception}");
@@ -139,7 +143,8 @@ namespace Thermo.Active.Controllers.WebApi
var originalRecipe = NcFileAdapter.LoadRecipe($"{NcAdapter.RecipeLiveData.RecipeDir}{NcAdapter.RecipeLiveData.RecipeName}");
// comparazione parametri...
bool isEqual = false;
ncAdapter.paramsComparer(originalRecipe.RecipeParameters, NcAdapter.RecipeLiveData.RecipeParameters, out isEqual);
if(originalRecipe != null)
ncAdapter.paramsComparer(originalRecipe.RecipeParameters, NcAdapter.RecipeLiveData.RecipeParameters, out isEqual);
// salvo se la ricetta SIA cambiata
NcAdapter.RecipeLiveData.hasChanged = !isEqual;
@@ -322,6 +327,7 @@ namespace Thermo.Active.Controllers.WebApi
notifyHmi();
// Get new data from PLC
/*
libraryError = ncAdapter.ReadWarmers(false, out Dictionary<int, DTOWarmers> currWarmers);
if (libraryError.IsError())
{
@@ -330,6 +336,8 @@ namespace Thermo.Active.Controllers.WebApi
}
// pubblico
MessageServices.Current.Publish(SEND_THERMO_WARMERS_DATA, null, currWarmers);
*/
MessageServices.Current.Publish(RECIPE_LOADED, null);
// ritorno solo fatto!
return Ok();
@@ -698,6 +706,7 @@ namespace Thermo.Active.Controllers.WebApi
}
// copy data to PLC
checkError = ncAdapter.ReadFullRecipe(out Dictionary<string, DTORecipeParam> prevRecipe);
if (checkError.IsError())
@@ -13,12 +13,14 @@ namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/scada")]
public class ScadaController : ApiController
public class ScadaController : aBaseApiController // ApiController
{
#if false
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
protected static NcAdapter ncAdapter = new NcAdapter();
#endif
[Route("list"), HttpGet]
public IHttpActionResult GetScadaList()
@@ -8,12 +8,14 @@ using Thermo.Active.Utils;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/starred_softkey")]
public class StarredUserSoftKeyController : ApiController
public class StarredUserSoftKeyController : aBaseApiController // ApiController
{
#if false
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
protected static NcAdapter ncAdapter = new NcAdapter();
#endif
[Route("get"), HttpGet]
public IHttpActionResult GetStarredUserSoftkey()
@@ -15,6 +15,7 @@ using System.Windows.Media.Animation;
using TeamDev.SDK.MVVM;
using Thermo.Active.Config;
using Thermo.Active.Database.Controllers;
using Thermo.Active.Model.DatabaseModels;
using Thermo.Active.Model.DTOModels;
using Thermo.Active.Model.DTOModels.ThIO;
using Thermo.Active.Model.DTOModels.ThRecipe;
@@ -28,12 +29,15 @@ using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/underthehood")]
public class UnderTheHoodController : ApiController
public class UnderTheHoodController : aBaseApiController // ApiController
{
#if false
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
protected static NcAdapter ncAdapter = new NcAdapter();
#endif
[ResponseType(typeof(DTOCycleLog))]
[Route("CycleLogRefresh"), HttpGet]
@@ -364,5 +368,41 @@ namespace Thermo.Active.Controllers.WebApi
// ritorno solo fatto!
return Ok(expires);
}
[ResponseType(typeof(List<HistorySheetModel>))]
[Route("SheetHistory"), HttpGet]
public IHttpActionResult GetSheetHistory()
{
using (HistorySheetsController hsc = new HistorySheetsController())
{
List<HistorySheetModel> models = hsc.GetData();
return Ok(models);
}
}
[ResponseType(typeof(List<HistorySheetModel>))]
[Route("SheetHistoryFiltered"), HttpGet]
public IHttpActionResult GetSheetHistoryFiltered(int start, int number)
{
using (HistorySheetsController hsc = new HistorySheetsController())
{
List<HistorySheetModel> models = hsc.GetData(start, number);
return Ok(models);
}
}
[ResponseType(typeof(int))]
[Route("SheetHistoryCount"), HttpGet]
public IHttpActionResult GetSheetHistoryCount()
{
using (HistorySheetsController hsc = new HistorySheetsController())
{
return Ok(hsc.count());
}
}
}
}
@@ -18,14 +18,16 @@ using System.Linq;
namespace Thermo.Active.Controllers.WebApi
{
[RoutePrefix("api/warmers")]
public class WarmersController : ApiController
public class WarmersController : aBaseApiController // ApiController
{
#region Protected Fields
#if false
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
protected static NcAdapter ncAdapter = new NcAdapter();
#endif
protected static Dictionary<int, ThermoPoint> MeasurePoints = new Dictionary<int, ThermoPoint>();
@@ -589,6 +591,19 @@ namespace Thermo.Active.Controllers.WebApi
return NotFound();
}
}
/// <summary>
///Take photo Thermocam
/// </summary>
/// <param name="channelsTemp"></param>
/// <returns></returns>
[Route("takeTcamImage"), HttpPut]
[WebApiAuthorize(FunctionAccess = FUNCTIONALITY_NAMES.RECIPE_MANAGER, Action = ACTIONS.READ)]
public IHttpActionResult TakeTcamImage()
{
MessageServices.Current.Publish(TAKE_SNAPSHOT_THERMO);
return Ok();
}
#endregion Public Methods
}
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Thermo.Active.NC;
namespace Thermo.Active.Controllers.WebApi
{
public class aBaseApiController : ApiController
{
/// <summary>
/// Oggetto adapter condiviso da WebAPI
/// </summary>
protected static NcAdapter ncAdapter = new NcAdapter();
#if false
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (ncAdapter != null)
{
ncAdapter.Dispose();
}
}
base.Dispose(disposing);
}
#endif
}
}
@@ -50,7 +50,13 @@ namespace Thermo.Active.Listeners.Database
}
}
}
public static void cleanHistorySheets()
{
using (HistorySheetsController HSC = new HistorySheetsController())
{
HSC.Clean();
}
}
public static void UpdateAlarms(object alarmsObj)
{
@@ -68,6 +68,10 @@ namespace Thermo.Active.Listeners
{
SignalRListener.SendThermoChannelsIoData(a);
}));
infos.Add(MessageServices.Current.Subscribe(SEND_NEWTCAMIMAGE, (a, b) =>
{
SignalRListener.SendTCamNewImage(a);
}));
infos.Add(MessageServices.Current.Subscribe(SEND_ACTIVE_PROGRAM_DATA, (a, b) =>
{
SignalRListener.SendActiveProgramData(a);
@@ -130,6 +134,7 @@ namespace Thermo.Active.Listeners
}));
infos.Add(MessageServices.Current.Subscribe(SEND_THERMO_PROD_INFO_DATA, (a, b) =>
{
SignalRDatabaseHandler.cleanHistorySheets();
SignalRListener.SendThermoProdInfoData(a);
}));
infos.Add(MessageServices.Current.Subscribe(SEND_THERMO_PROD_CYCLE_DATA, (a, b) =>
@@ -326,6 +326,10 @@ namespace Thermo.Active.Listeners.SignalR
lastSetpointHmiInvalid = currMessage;
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
context.Clients.Group("ncData").setpointHmiInvalid(currMessage);
context.Clients.Group("ncData").recipeFullDataInvalidSetpoint(LastRecipeFullData);
context.Clients.Group("ncData").warmersData(LastWarmersData);
}
}
@@ -611,6 +615,13 @@ namespace Thermo.Active.Listeners.SignalR
}
}
public static void SendTCamNewImage(object newImageDate)
{
DateTime imageDate = (DateTime)newImageDate;
var context = GlobalHost.ConnectionManager.GetHubContext<NcHub>();
context.Clients.Group("ncData").newThermoCamImage(newImageDate);
}
public static void SetGatewayRebootStatus(object status)
{
string msg = status.ToString();
@@ -679,7 +690,7 @@ namespace Thermo.Active.Listeners.SignalR
// Send THERMO Recipe data
group.recipeFullData(LastRecipeFullData);
group.recipeOverData(LastRecipeOverData);
group.setpointHmiInvalid();
// Send THERMO Modules data
group.modulesData(LastModulesData);
// Send THERMO Warmers data
@@ -689,6 +700,8 @@ namespace Thermo.Active.Listeners.SignalR
group.gaugeData(LastLiveProdData);
// THERMO prod info data
group.prodInfoData(LastProdInfoData);
group.prodPanelData(LastProdPanelData);
// THERMO prod cycle data
group.prodCycleData(LastProdCycleData);
+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("1.1.179")]
[assembly: AssemblyVersion("1.1.192")]
-305
View File
@@ -1,305 +0,0 @@
;================================= 09-04-2019 =====
; CMS S.p.A. - UX-HMI Office
;
; Setup for Active
; Inno Setup Compiler version 5.6.0
;==================================================
#define AppName "CMS Active"
#define SCMAppName "Maestro Active cnc"
#define FolderName "Active"
#define SCMIcoName "SCM.ico"
#define MyAppVersion "1.5.5"
#define MyAppPublisher "CMS"
#define MyAppURL "https://www.scmgroup.com/it/cms"
#define MyAppExeName "Active.exe"
#define ProjectPath "C:\Users\ext_lmascherone\Documents\cms_step\Step\"
#define MySourcePath "C:\Users\ext_lmascherone\Documents\cms_step\Step\bin"
#define WwwRootPath "C:\Users\ext_lmascherone\Documents\cms_step\Step\wwwroot"
#define IconsPath "C:\Users\ext_lmascherone\Documents\cms_step\Step\Desktop_Link\"
#define InvDialPath "C:\Users\ext_lmascherone\Documents\cms_inverterdiagnosis\CMSInverterDiagnosis\bin\Release\"
#define SinumerikPath1 "{pf}\Siemens\Sinumerik\HMIsl\siemens\sinumerik\hmi\autostart\"
#define SinumerikPath2 "C:\Siemens\Sinumerik\HMIsl\siemens\sinumerik\hmi\autostart\"
#define SinumerikPath3 "{pf}\Siemens\MotionControl\siemens\sinumerik\hmi\autostart\"
#define SinumerikAppName "Sinumerik HMI"
#define SinumerikAppExeName "run_hmi.exe"
; Support installers
; .Net
#define DotNetInstallerPath "C:\Users\ext_lmascherone\Documents\Per installazioni Active\"
#define DotNetInstallerName "NDP462-KB3151800-x86-x64-AllOS-ENU.exe"
; MariaDb
#define MariaDBInstallerPath "C:\Users\ext_lmascherone\Documents\Per installazioni Active\"
#define MariaDBInstallerName "mariadb-10.3.13-winx64.msi"
[Setup]
AppName={#AppName}
AppVersion={#MyAppVersion}
AppVerName={#AppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DisableDirPage=true
DisableProgramGroupPage=yes
Compression=lzma
SolidCompression=true
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany={#MyAppPublisher}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoCopyright={#MyAppPublisher}
DefaultDirName = C:\CMS\{#FolderName}\{#FolderName}
WindowVisible=false
PrivilegesRequired=admin
; Setup installation type
[Types]
Name: custom; Description: CMS installation; Flags: iscustom
; Set NC types, this types are used to configure server config file
[Components]
Name: Fanuc; Description: {#AppName} {cm:ForFanucNC}; Types: custom; Flags: exclusive
Name: Osai; Description: {#AppName} {cm:ForOsaiNC}; Types: custom; Flags: exclusive
Name: Siemens; Description: {#AppName} {cm:ForSiemensNC}; Types: custom; Flags: exclusive
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
[CustomMessages]
english.CreateStartupIcon=Create Startup &icon
english.CreateSinumerikIcons=Create &Sinumerik HMI icons
english.ForDemoNC=for DEMO NC
english.ForFanucNC=for FANUC NC
english.ForOsaiNC=for OSAI NC
english.ForSiemensNC=for SIEMENS NC
italian.CreateStartupIcon = Crea il collegamento in &Esecuzione Automatica
italian.CreateSinumerikIcons = Crea le icone di &Sinumerik HMI
italian.ForDemoNC=per CN DEMO
italian.ForFanucNC=per CN FANUC
italian.ForOsaiNC=per CN OSAI
italian.ForSiemensNC=per CN SIEMENS
english.InstallDotNet = Install .Net 4.6.2
english.InstallMariaDB = Install MariaDB
italian.InstallDotNet = Installa .Net 4.6.2
italian.InstallMariaDB = Installa MariaDB
italian.InstallingMariaDB = Installando MariaDB
english.InstallingMariaDB = Installing MariaDB
italian.InstallingDotNet = Installando .Net
english.InstallingDotNet = Installing .Net
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone; Components: Fanuc Osai Siemens
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Fanuc Osai Siemens
Name: startupicon; Description: {cm:CreateStartupIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Fanuc Osai Siemens
Name: sinumerikicons; Description: {cm:CreateSinumerikIcons}; GroupDescription: {cm:AdditionalIcons}; Flags: checkablealone; Components: Siemens
[Files]
Source: "{#MySourcePath}\Thermo.Active.exe"; DestDir: "{app}"; Flags: ignoreversion
; Path to exe resources (dll, xml, config)
Source: "{#MySourcePath}\*.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Fanuc Osai Siemens
Source: "{#MySourcePath}\*.xml"; DestDir: "{app}"; Flags: ignoreversion; Components: Fanuc Osai Siemens
Source: "{#MySourcePath}\*.config"; DestDir: "{app}"; Flags: ignoreversion; Components: Fanuc Osai Siemens
; Configuration files
Source: "{#MySourcePath}\Config\*.xml"; DestDir: "{app}\Config\"; Flags: ignoreversion; Components: Fanuc Osai Siemens; Check: GetOverwriteConfig;
; Osai Library
Source: "{#MySourcePath}\CndexLinkDotNet.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Osai
; Languages
Source: "{#MySourcePath}\Language\*.*"; DestDir: "{app}\Language\"; Flags: ignoreversion; Components: Osai
Source: "{#MySourcePath}\languages\*.*"; DestDir: "{app}\languages\"; Flags: ignoreversion; Components: Fanuc Osai Siemens
; Client copy
Source: "{#MySourcePath}\Client\x64\*.*"; DestDir: "{app}\Client\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens; AfterInstall: DeleteLocalStorage
; WWWRoot Files
Source: "{#WwwRootPath}\favicon.ico"; DestDir: "{app}\view\"; Flags: ignoreversion; Components: Fanuc Osai Siemens
Source: "{#WwwRootPath}\index.html"; DestDir: "{app}\view\"; Flags: ignoreversion; Components: Fanuc Osai Siemens
; WWWRoot Directories
Source: "{#WwwRootPath}\dist\*"; DestDir: "{app}\view\dist\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens
Source: "{#WwwRootPath}\libs\*"; DestDir: "{app}\view\libs\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens
Source: "{#WwwRootPath}\assets\*"; DestDir: "{app}\view\assets\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens
Source: "{#WwwRootPath}\scripts\*"; DestDir: "{app}\view\scripts\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens
; SCM Icon
Source: {#IconsPath}{#SCMIcoName}; DestDir: "{app}"; Flags: ignoreversion; Components: Fanuc Osai Siemens; Check: GetStyleOption;
;.Net Installer
Source: {#DotNetInstallerPath}\{#DotNetInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
;Check: FrameworkIsNotInstalled
Source: {#MariaDBInstallerPath}\{#MariaDBInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
; --- UTILS
; Fanuc scripts - TEAMVIEWER
Source: "{#ProjectPath}\Utility\*"; DestDir: "{app}\..\Utility\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens
; Inverter Dialog
Source: "{#InvDialPath}\*"; DestDir: "{app}\..\Utility\Cms_Inverter_Diagnosis\"; Flags: recursesubdirs ignoreversion; Components: Fanuc Osai Siemens
; Client SCM Style
Source: {#ProjectPath}\SCM_Client_Config.xml; DestDir:"{app}\Client\"; DestName: "Config.xml"; Flags: ignoreversion; Components: Fanuc Osai Siemens; Check: GetStyleOption;
[Icons]
; Default icons
Name: {group}\{#AppName}; Filename: {app}\{#MyAppExeName}; Components: Fanuc Osai; Check: NOT GetStyleOption;
Name: {userdesktop}\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon; Components: Fanuc Osai; Check: NOT GetStyleOption;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon; Components: Fanuc Osai; Check: NOT GetStyleOption;
Name: {userstartup}\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: startupicon; Components: Fanuc Osai; Check: NOT GetStyleOption;
; Siemens startup icon with parameters "-start ..."
Name: {group}\{#AppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Components: Siemens; Check: NOT GetStyleOption;
Name: {userdesktop}\{#AppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; Components: Siemens; Check: NOT GetStyleOption;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon; Comment: {#AppName}; Components: Siemens; Check: NOT GetStyleOption;
Name: {userstartup}\{#AppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Tasks: startupicon; IconFilename: "{app}\{#MyAppExeName}"; Parameters: -start {app}\{#MyAppExeName}; Components: Siemens; Check: NOT GetStyleOption;
; SCM ICONS
; Default icons
Name: {group}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Components: Fanuc Osai; Check: GetStyleOption;
Name: {userdesktop}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: desktopicon; Components: Fanuc Osai; Check: GetStyleOption;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: quicklaunchicon; Components: Fanuc Osai; Check: GetStyleOption;
Name: {userstartup}\{#SCMAppName}; Filename: {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Parameters: -start {app}\{#MyAppExeName}; Tasks: startupicon; Components: Fanuc Osai; Check: GetStyleOption;
; SCM Siemens startup icon with parameters "-start ..."
Name: {group}\{#SCMAppName}; Filename: {#IconsPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Components: Siemens; Check: GetStyleOption;
Name: {userdesktop}\{#SCMAppName}; Filename: {#IconsPath}{#SCMIcoName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: desktopicon; Components: Siemens; Check: GetStyleOption;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#SCMAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName};Tasks: quicklaunchicon; Components: Siemens; Check: GetStyleOption;
Name: {userstartup}\{#SCMAppName}; Filename: {code:SiemensPath}{#SinumerikAppExeName}; Parameters: -start {app}\{#MyAppExeName}; IconFilename: {app}\{#SCMIcoName}; Tasks: startupicon; Components: Siemens; Check: GetStyleOption;
[Run]
; Install .net
Filename: {tmp}\{#DotNetInstallerName}; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingDotNet}; Check: NetFrameworkNeedInstall
;Check: NetFrameworkIsMissing
; Install MariaDb
Filename: "msiexec.exe"; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingMariaDB}; Parameters: "/i {tmp}\{#MariaDBInstallerName}"; Check: CheckHeidiSQLNeedInstall;
/// MinVersion: 10
[Registry]
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Active"; ValueData: "C:\CMS\ACTIVE\Active\Active.exe"; Components: Fanuc Osai; MinVersion: 10;
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Active"; ValueData: "C:\Program Files (x86)\Siemens\MotionControl\siemens\sinumerik\hmi\autostart\run_hmi.exe -start C:\CMS\Active\Active\Active.exe"; Components: Siemens; MinVersion: 10;
[Code]
///////////// SiemensPath ///////////////////////////////
var
CheckBoxIni: TCheckBox;
CustomInputOptionCMSorSCM: TInputOptionWizardPage;
IsSCM: Boolean;
OverwriteConfig: Boolean;
function GetStyleOption: Boolean;
begin
Result := IsSCM;
end;
////////////////// GetSiemens Path ///////////////////
function SiemensPath(S: String): string;
var
sSiemensPath: string;
sSelectedSinumerikDir: string;
begin
if DirExists(ExpandConstant('{#SinumerikPath3}')) then
sSiemensPath := ExpandConstant('{#SinumerikPath3}')
else if DirExists(ExpandConstant('{#SinumerikPath2}')) then
sSiemensPath := ExpandConstant('{#SinumerikPath2}')
else if DirExists(ExpandConstant('{#SinumerikPath1}')) then
sSiemensPath := ExpandConstant('{#SinumerikPath1}')
else
begin
if (sSelectedSinumerikDir = '') then
BrowseForFolder('Sinumerik folder not found!'#13#10'Select Sinumerik folder containing run_hmi.exe'#13#10'ex: '+ExpandConstant('{#SinumerikPath1}'), sSelectedSinumerikDir, False);
sSiemensPath := sSelectedSinumerikDir + '\' ;
end;
Result := sSiemensPath ;
end;
///////////////// Check .NET Framework 4.6.2 ////////////////////////////////////
function NetFrameworkNeedInstall(): Boolean;
var
bSuccess: Boolean;
regVersion: Cardinal;
begin
Result := True;
bSuccess := RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', regVersion);
if (True = bSuccess) and (regVersion >= 394802) then begin
Result := False;
end;
end;
///////////// Check heidiSQL /////////////////
function CheckHeidiSQLNeedInstall: Boolean;
begin
if FileExists(ExpandConstant('C:\Program Files (x86)\Common Files\MariaDBShared\HeidiSQL\heidisql.exe'))
then Result:= false
else
begin
Result:= True
end;
end;
///////////////// CreateCustomInputOptionCMsorSCM //////////////////////////
procedure CreateCustomInputOptionCMSorSCM;
begin
CustomInputOptionCMSorSCM := CreateInputOptionPage(wpSelectComponents, 'Seleziona lo stile:', '', '', True, False);
//Add Fields
CustomInputOptionCMSorSCM.Add('CMS');
CustomInputOptionCMSorSCM.Add('SCM');
// Set initial values (optional)
CustomInputOptionCMSorSCM.Values[0] := True;
end;
/////////////////// CheckConfigExistence /////////////////////////////
function OverwriteConfigModal: Boolean;
begin
if DirExists(ExpandConstant('C:\CMS\Active\Active\Config')) then begin
// Ask the user a Yes/No question, defaulting to No
if not (MsgBox('La cartella "Config" esiste già. Vuoi sovrascriverla?', mbConfirmation, MB_YESNO) = IDYES) then
begin
// user clicked NO
Result:= false;
Exit;
end;
end;
Result:= True;
end;
function GetOverwriteConfig: Boolean;
begin
Result:= OverwriteConfig;
end;
/////////////////// DeleteLocalStorage //////////////////////
procedure DeleteLocalStorage;
begin
DelTree(ExpandConstant('{app}\Client\LocalStorage'), True, True, True);
end;
///////////// InitializeWizard //////////////////////////
procedure InitializeWizard();
begin
CreateCustomInputOptionCMSorSCM;
OverwriteConfig := OverwriteConfigModal;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CustomInputOptionCMSorSCM.Values[0]
then IsSCM := false
else
IsSCM := true;
if CurStep = ssPostInstall then
begin
DeleteLocalStorage;
end;
end;
+47 -15
View File
@@ -5,8 +5,8 @@
; Inno Setup Compiler version 5.6.0
;==================================================
#define AppName "CMS Active"
#define FolderName "Thermo.Active"
#define AppName "CMS ThermoActive"
#define FolderName "ThermoActive"
#define MyAppPublisher "CMS"
#define MyAppURL "https://www.scmgroup.com/it/cms"
@@ -26,10 +26,10 @@
; .Net
; MariaDb
; cms_inv_diag
#define DotNetInstallerName "NDP462-KB3151800-x86-x64-AllOS-ENU.exe"
#define MariaDBInstallerName "mariadb-10.3.13-winx64.msi"
#define CmsInvDiagPath "cms_inv_diag"
#define DotNetInstallerName "NDP472-KB4054530-x86-x64-AllOS-ENU.exe"
#define MariaDBInstallerName "mariadb-10.3.13-winx64.msi"
#define VCppInstallerName "VC_redist.x64.exe"
[Setup]
AppName={#AppName}
@@ -51,7 +51,7 @@ VersionInfoVersion={#MyAppVersion}
VersionInfoCompany={#MyAppPublisher}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoCopyright={#MyAppPublisher}
DefaultDirName = C:\CMS\{#FolderName}\{#FolderName}
DefaultDirName = C:\CMS\{#FolderName}
WindowVisible=false
PrivilegesRequired=admin
@@ -71,17 +71,21 @@ Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
english.CreateStartupIcon=Create Startup &icon
italian.CreateStartupIcon = Crea il collegamento in &Esecuzione Automatica
english.InstallDotNet = Install .Net 4.6.2
english.InstallDotNet = Install .Net 4.7.2
english.InstallMariaDB = Install MariaDB
english.InstallVCpp = Install VC++ 2017
italian.InstallDotNet = Installa .Net 4.6.2
italian.InstallMariaDB = Installa MariaDB
italian.InstallMariaDB = Installa MariaDB
italian.InstallVCpp = Installa VC++ 2017
italian.InstallingMariaDB = Installando MariaDB
english.InstallingMariaDB = Installing MariaDB
english.InstallingVCpp = Installing VC++ 2017
italian.InstallingDotNet = Installando .Net
english.InstallingDotNet = Installing .Net
italian.InstallingMariaDB = Installando MariaDB
italian.InstallingVCpp = Installando VC++ 2017
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkablealone;
@@ -91,10 +95,12 @@ Name: startupicon; Description: {cm:CreateStartupIcon}; GroupDescription: {cm:Ad
[Files]
Source: "{#MySourcePath}\Thermo.Active.exe"; DestDir: "{app}"; Flags: ignoreversion
; Path to exe resources (dll, xml, config)
; Path to exe resources (dll, xml, config)
Source: "{#MySourcePath}\*.dll"; DestDir: "{app}"; Flags: ignoreversion;
Source: "{#MySourcePath}\*.xml"; DestDir: "{app}"; Flags: ignoreversion;
Source: "{#MySourcePath}\*.config"; DestDir: "{app}"; Flags: ignoreversion;
; Configuration files
Source: "{#MySourcePath}\Config\*.xml"; DestDir: "{app}\Config\"; Flags: ignoreversion;
Source: "{#MySourcePath}\Config\*.xml"; DestDir: "{app}\Config\"; Flags: ignoreversion; Check: GetOverwriteConfig;
; Languages
Source: "{#MySourcePath}\languages\*.*"; DestDir: "{app}\languages\"; Flags: ignoreversion;
; dll
@@ -104,16 +110,19 @@ Source: "{#MySourcePath}\Client\*.*"; DestDir: "{app}\Client\"; Flags: recursesu
; WWWRoot Files
Source: "{#WwwRootPath}\favicon.ico"; DestDir: "{app}\view\"; Flags: ignoreversion;
Source: "{#WwwRootPath}\index.html"; DestDir: "{app}\view\"; Flags: ignoreversion;
Source: "{#WwwRootPath}\config.production.json"; DestDir: "{app}\view\"; Flags: ignoreversion;
; WWWRoot Directories
Source: "{#WwwRootPath}\dist\*"; DestDir: "{app}\view\dist\"; Flags: recursesubdirs ignoreversion;
Source: "{#WwwRootPath}\libs\*"; DestDir: "{app}\view\libs\"; Flags: recursesubdirs ignoreversion;
Source: "{#WwwRootPath}\assets\*"; DestDir: "{app}\view\assets\"; Flags: recursesubdirs ignoreversion;
Source: "{#WwwRootPath}\scripts\*"; DestDir: "{app}\view\scripts\"; Flags: recursesubdirs ignoreversion;
;.Net Installer
Source: {#ToolInstallerPath}\{#DotNetInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
;Check: FrameworkIsNotInstalled
Source: {#ToolInstallerPath}\{#VCppInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
;Check: FrameworkIsNotInstalled
Source: {#ToolInstallerPath}\{#MariaDBInstallerName}; DestDir: {tmp}; Flags: deleteafterinstall;
; --- UTILS
@@ -131,6 +140,8 @@ Name: {userstartup}\{#AppName}; Filename: {app}\{#MyAppExeName}; Tasks: startupi
[Run]
; Install .net
Filename: {tmp}\{#DotNetInstallerName}; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingDotNet}; Check: NetFrameworkNeedInstall
Filename: {tmp}\{#VCppInstallerName}; Description: {cm:InstallVCpp}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingVCpp}; Check: VCPPNeedInstall
;Check: NetFrameworkIsMissing
; Install MariaDb
Filename: "msiexec.exe"; Description: {cm:InstallDotNet}; WorkingDir:{tmp}; StatusMsg: {cm:InstallingMariaDB}; Parameters: "/i {tmp}\{#MariaDBInstallerName}"; Check: CheckHeidiSQLNeedInstall;
@@ -157,11 +168,32 @@ var
Result := True;
bSuccess := RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', regVersion);
if (True = bSuccess) and (regVersion >= 394802) then begin
if (True = bSuccess) and (regVersion >= 461808) then begin
Result := False;
end;
end;
///////////////// Check .NET Framework 4.6.2 ////////////////////////////////////
function VCPPNeedInstall(): Boolean;
var
bSuccess: Boolean;
bSuccessM: Boolean;
regVersion: Cardinal;
regMinor: Cardinal;
begin
Result := True;
bSuccess := RegQueryDWordValue(HKLM, 'Software\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Major', regVersion);
bSuccessM := RegQueryDWordValue(HKLM, 'Software\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Minor', regMinor);
if (True = bSuccess) and (True = bSuccessM) and ((regVersion >14) or ((regVersion = 14) and (regMinor >13))) then begin
Result := False;
end;
end;
///////////// Check heidiSQL /////////////////
function CheckHeidiSQLNeedInstall: Boolean;
begin
@@ -177,7 +209,7 @@ var
/////////////////// CheckConfigExistence /////////////////////////////
function OverwriteConfigModal: Boolean;
begin
if DirExists(ExpandConstant('C:\CMS\Thermo.Active\Thermo.Active\Config')) then begin
if DirExists(ExpandConstant('C:\CMS\ThermoActive\Config')) then begin
// Ask the user a Yes/No question, defaulting to No
if not (MsgBox('La cartella "Config" esiste già. Vuoi sovrascriverla?', mbConfirmation, MB_YESNO) = IDYES) then
begin
Binary file not shown.
+1
View File
@@ -222,6 +222,7 @@
<Compile Include="Attributes\WebApiAuthorizeAttribute.cs" />
<Compile Include="Attributes\SignalRAuthorizeAttribute.cs" />
<Compile Include="Controllers\SignalR\NcHub.cs" />
<Compile Include="Controllers\WebApi\aBaseApiController.cs" />
<Compile Include="Controllers\WebApi\ApiAlarmController.cs" />
<Compile Include="Controllers\WebApi\UnderTheHoodController.cs" />
<Compile Include="Controllers\WebApi\SchedTaskController.cs" />
+3
View File
@@ -0,0 +1,3 @@
{
"lockfileVersion": 1
}
+3
View File
@@ -119,6 +119,9 @@ namespace Thermo.Active
ListenersHandler.Stop();
// Close WinForm
ServerControlWindow.Stop();
// force close
Environment.Exit(0);
}
private static bool ValidateAddress(string Addr)
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@@ -2092,7 +2092,7 @@
}
.body {
height: calc(~"100%"- 64px);
height: calc(~"100%" - 64px);
overflow: hidden;
align-items: center;
justify-content: center;
@@ -3476,7 +3476,6 @@
position: absolute;
width: 100%;
height: 100%;
background: #ffffff;
top: 0;
display: block;
overflow: hidden;
@@ -3485,6 +3484,9 @@
width: 100%;
height: 100%;
cursor: -webkit-grab;
display: flex;
justify-content: center;
align-items: center;
}
.loading {
@@ -3530,6 +3532,17 @@
}
.btngroup2{
position: absolute;
bottom: 510px;
right: 0;
margin-right: 20px;
img{
box-shadow: none;
filter: grayscale(1)brightness(0)invert(1);
}
}
.btngroup {
position: absolute;
bottom: 0;
@@ -3562,11 +3575,17 @@
cursor: pointer;
color: #FFF;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
&:active{
background-image: linear-gradient(to bottom,#002680, #1756ad);
}
}
button:disabled {
background-color: #002680 !important;
;
filter: grayscale(100%);
}
@@ -426,6 +426,10 @@
&.fa-check-circle.undone-step {
color: #1791ff;
}
&.edit{
left: 80px;
color: #1791ff;
}
}
span,
@@ -534,6 +538,10 @@
&.fa-check-circle.undone-step {
color: #1791ff;
}
&.edit{
left: 133px;
color: #1791ff;
}
}
position: relative;
+28 -4
View File
@@ -382,6 +382,10 @@
.setup .modal-footer-navigator .setup-button i.fa-check-circle.undone-step {
color: #1791ff;
}
.setup .modal-footer-navigator .setup-button i.edit {
left: 80px;
color: #1791ff;
}
.setup .modal-footer-navigator .setup-button span,
.setup .modal-footer-navigator .setup-button label {
grid-row-start: 1;
@@ -473,6 +477,10 @@
.setup-button i.fa-check-circle.undone-step {
color: #1791ff;
}
.setup-button i.edit {
left: 133px;
color: #1791ff;
}
.setup-button .background-top,
.setup-button .background-bottom {
position: absolute;
@@ -2321,7 +2329,7 @@ article .box .body {
color: #fff;
}
.modal.modal-image .body {
height: calc(100%-64px);
height: calc(100% - 64px);
overflow: hidden;
align-items: center;
justify-content: center;
@@ -3668,7 +3676,6 @@ article .box .body {
position: absolute;
width: 100%;
height: 100%;
background: #ffffff;
top: 0;
display: block;
overflow: hidden;
@@ -3677,6 +3684,9 @@ article .box .body {
width: 100%;
height: 100%;
cursor: -webkit-grab;
display: flex;
justify-content: center;
align-items: center;
}
.imageViewerZoom .loading {
position: absolute;
@@ -3715,6 +3725,16 @@ article .box .body {
margin-right: 20px;
margin-top: 20px;
}
.imageViewerZoom .btngroup2 {
position: absolute;
bottom: 510px;
right: 0;
margin-right: 20px;
}
.imageViewerZoom .btngroup2 img {
box-shadow: none;
filter: grayscale(1) brightness(0) invert(1);
}
.imageViewerZoom .btngroup {
position: absolute;
bottom: 0;
@@ -3730,8 +3750,6 @@ article .box .body {
}
.imageViewerZoom button {
font-size: 20px;
justify-content: center;
display: flex;
background-color: #ffffff;
background-image: linear-gradient(to bottom, #1756ad, #002680);
box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.4);
@@ -3744,6 +3762,12 @@ article .box .body {
cursor: pointer;
color: #FFF;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
}
.imageViewerZoom button:active {
background-image: linear-gradient(to bottom, #002680, #1756ad);
}
.imageViewerZoom button:disabled {
background-color: #002680 !important;
+18412 -18460
View File
File diff suppressed because it is too large Load Diff
@@ -12,6 +12,7 @@ import { loginService, machineService, localizationService } from "./services";
import { prodService } from "./services/prodService";
import * as iziToast from "izitoast";
import { underTheHoodService } from "./services/underTheHoodService";
import { warmersService } from "./services/warmersService";
// import { UsersService } from "./services/usersService";
@@ -60,7 +61,6 @@ async function loadMachineConfig() {
await loginService.getUserInfo();
try {
let machine = new machineService();
let result = await machine.getAreasConfiguration();
@@ -68,12 +68,12 @@ async function loadMachineConfig() {
let mcresult = await machine.getMachineConfiguration();
machineStatusActions.setWarmersParameters(store, mcresult.additionalParameters);
await prodService.GetProdPanel();
await warmersService.GetResistances();
await underTheHoodService.getChannels();
await underTheHoodService.getChannelsConfig();
// load default language
if (!(store.state as AppModel).localization.currentLanguage) {
localizationService.changeCurrentLanguage(mcresult.defaultLanguage);
@@ -5,7 +5,7 @@
<label :class="{red: value.isScrap}" v-else>{{value.numDone}}</label>
<div class="col">
<small>{{'history-item_warmup' | localize("tempo riscaldo")}}</small>
<span>{{Math.floor(value.timeWarm / 60) | round(0)}}'{{value.timeWarm % 60 | round(0)}}''</span>
<span>{{value.timeWarm | round(0)}}''</span>
</div>
<div class="col">
<small>{{'history-item_vacuum' | localize("vuoto")}}</small>
@@ -29,7 +29,7 @@
</div>
<div class="col">
<small>{{'history_item_venttime' | localize("tempo ventilazione")}}</small>
<span>{{value.timeVent / 60 | round(0)}}'{{value.timeVent % 60 | round(0)}}''</span>
<span>{{value.timeVent | round(0)}}''</span>
</div>
<div class="col">
<small>{{'history_item_cycletimegross' | localize("tempo ciclo lordo")}}</small>
@@ -53,7 +53,7 @@
<div class="row">
<div class="col">
<small>{{'history_item_vacuumtime' | localize("tempo vuoto")}}</small>
<span>{{Math.floor(value.timeVacuum / 60) | round(0)}}'{{value.timeVacuum % 60 | round(0)}}''</span>
<span>{{value.timeVacuum | round(0)}}''</span>
</div>
<div class="col">
<small>{{'history_item_mouldenergyin' | localize("energia utilizzata in")}}</small>
@@ -9,7 +9,6 @@ export default class stats extends Vue {
value: { [id: number]: number };
get Values(): number[] {
console.log(this.value);
var r: number[] = [];
if (this.value)
for (const i in this.value) {
@@ -10,18 +10,6 @@
<line :x1="0" :x2="width" :y1="height*2/3" :y2="height*2/3" stroke="#353535" stroke-width="1" />
<line :x1="0" :x2="width" :y1="height" :y2="height" stroke="#353535" stroke-width="1" />
</g>
<!--<g chart="chart-axis">
<line
v-for="(i,idx) in Values"
:key="idx"
:x1="idx * (width / 19)"
:x2="idx * (width / 19)"
:y1="0"
:y2="height"
stroke="#35353550"
stroke-width="1"
/>
</g>-->
<g>
<polygon :points="calcPointFill" style="fill:#1791ff;stroke-width:0" fill-opacity="0.3" />
<path fill="none" :d="pathData" v-if="pathData" stroke="#1791ff" stroke-width="4" />
@@ -118,8 +118,6 @@ export default class Dashboard extends Vue {
this.itemsMap.set(i.numDone, i);
}
this.items = Array.from(this.itemsMap.values()).sort((a, b) => b.numDone - a.numDone);
console.log(this.items);
this.loading = false;
}
@@ -132,8 +130,6 @@ export default class Dashboard extends Vue {
}
async mounted() {
prodService.GetProdPanel();
let $this = this;
setInterval(() => {
$this.now = moment();
@@ -204,13 +200,33 @@ export default class Dashboard extends Vue {
}
incrementPyr() {
this.recipe.pyrometer_pyrometer_setpoint.setpointHMI++;
this.recipe.pyrometer_pyrometer_setpoint.setpointHMI++;
this.recipe.pyrometer_upperthermoregulator_start_adjustment.setpointHMI++;
this.recipe.pyrometer_upperthermoregulator_end_adjustment.setpointHMI++;
this.recipe.pyrometer_lowerthermoregulator_start_adjustment.setpointHMI++;
this.recipe.pyrometer_lowerthermoregulator_end_adjustment.setpointHMI++;
this.debouncedRecipeSave();
}
decrementPyr() {
this.recipe.pyrometer_pyrometer_setpoint.setpointHMI--;
this.recipe.pyrometer_pyrometer_setpoint.setpointHMI--;
this.recipe.pyrometer_upperthermoregulator_start_adjustment.setpointHMI--;
this.recipe.pyrometer_upperthermoregulator_end_adjustment.setpointHMI--;
this.recipe.pyrometer_lowerthermoregulator_start_adjustment.setpointHMI--;
this.recipe.pyrometer_lowerthermoregulator_end_adjustment.setpointHMI--;
this.debouncedRecipeSave();
}
togglePyr() {
if(this.recipe.pyrometer_pyrometer_enabled.setpointHMI == 1)
this.recipe.pyrometer_pyrometer_enabled.setpointHMI = 0;
else
this.recipe.pyrometer_pyrometer_enabled.setpointHMI = 1;
this.debouncedRecipeSave();
}
get pyrOn(){
return this.recipe.pyrometer_pyrometer_enabled.setpointHMI == 1;
}
debouncedRecipeSave = debounce(this.savePyr, 1000);
public async savePyr(){
@@ -229,7 +245,11 @@ export default class Dashboard extends Vue {
get payload() {
return {
pyrometer_pyrometer_enabled: this.recipe.pyrometer_pyrometer_enabled,
pyrometer_pyrometer_setpoint: this.recipe.pyrometer_pyrometer_setpoint
pyrometer_pyrometer_setpoint: this.recipe.pyrometer_pyrometer_setpoint,
pyrometer_upperthermoregulator_start_adjustment: this.recipe.pyrometer_upperthermoregulator_start_adjustment,
pyrometer_upperthermoregulator_end_adjustment: this.recipe.pyrometer_upperthermoregulator_end_adjustment,
pyrometer_lowerthermoregulator_start_adjustment: this.recipe.pyrometer_lowerthermoregulator_start_adjustment,
pyrometer_lowerthermoregulator_end_adjustment: this.recipe.pyrometer_lowerthermoregulator_end_adjustment,
}
}
@@ -118,9 +118,11 @@
<button @click="decrementPyr()" :disabled="!recipe.pyrometer_pyrometer_setpoint.status.enabled" >
<i class="fa fa-minus"></i>
</button>
<div :class="{'notenabled': recipe.pyrometer_pyrometer_enabled.setpointHMI == 0}">
<div :class="{'notenabled': recipe.pyrometer_pyrometer_enabled.setpointHMI == 0}" @click="togglePyr">
<small>{{'dashboard-setpoint' | localize('set point')}}</small>
<span :class="{'strike': recipe.pyrometer_pyrometer_enabled.setpointHMI == 0}">{{recipe.pyrometer_pyrometer_setpoint.setpointHMI}}{{recipe.pyrometer_pyrometer_setpoint.unitMeasure}}</span>
<div v-if="pyrOn">ON</div>
<div v-else>OFF</div>
</div>
<button @click="incrementPyr()" :disabled="!recipe.pyrometer_pyrometer_setpoint.status.enabled" >
<i class="fa fa-plus"></i>
@@ -42,8 +42,8 @@ export default class SVGCaricatore extends Vue{
minoreuguale:string="<=";
getPositionSheet(id,col){
var vent = ((this.larghTelaioSVG + (this.dimVentose*2)) / (this.numVentose +1));
var posX = (id*vent ) - (this.dimVentose*2);
var vent = (this.larghTelaioSVG - (this.dimVentose*2)) / (this.numVentose -1);
var posX = (id-1)*vent;
if(col == 1)
return "translate(-630 -147) translate(50 25) translate(580 122) translate(0 70) translate(0 0) translate("+ posX + ")";
else if(col == 2)
@@ -1,6 +1,6 @@
<template>
<div class="svg-area">
<svg xmlns="http://www.w3.org/2000/svg" width="1057" height="707" viewBox="0 0 1100 707">
<svg xmlns="http://www.w3.org/2000/svg" width="1057" height="707" viewBox="-50 0 1150 707">
<g fill="none" fill-rule="evenodd">
<g>
<g>
@@ -97,6 +97,19 @@ export default class ShowCicloInfo extends Vue {
}
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 2,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 2,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -122,10 +135,6 @@ export default class ShowCicloInfo extends Vue {
if (el.status.visible && el.status.enabled)
if (el.setpointHMI != el.setpointPLC) result = true;
}
for (const key in store.state.warmers.channels) {
const el = store.state.warmers.channels[key];
if (el.setpointHMI != el.setpointPLC) result = true;
}
return result;
}
@@ -20,6 +20,12 @@
position: relative;
cursor: pointer;
}
.bitSelect .form.error {
outline: 2px #d0021b auto !important;
}
.bitSelect .form.disabled {
background-color: rgba(0, 0, 0, 0.15);
}
.bitSelect .form i {
position: absolute;
right: 4px;
@@ -40,6 +46,18 @@
overflow: hidden;
height: auto !important;
width: 500px !important;
border-top: 1px solid #979797;
border-left: 1px solid #979797;
}
.bitSelect > section.bitsections .selall {
grid-column-start: 1;
grid-column-end: 3;
display: flex;
justify-content: flex-end;
align-items: center;
margin: 24px 0px 0 0;
height: 64px;
border-top: 2px solid #bbbcbc;
}
.bitSelect > section.bitsections > article {
height: 70px !important;
@@ -47,7 +65,8 @@
grid-template-columns: 68px 1fr;
align-items: center;
justify-items: center;
border: 1px solid #979797;
border-bottom: 1px solid #979797;
border-right: 1px solid #979797;
}
.bitSelect > section.bitsections > article label {
width: 100%;
@@ -19,6 +19,16 @@
padding-right: 25px;
position: relative;
cursor: pointer;
&.error{
outline: 2px #d0021b auto !important;
}
&.disabled{
background-color: rgba(0, 0, 0, 0.15);
}
i {
position: absolute;
right: 4px;
@@ -27,7 +37,7 @@
}
}
> section.bitsections {
> section.bitsections {
position: absolute !important;
top: 48px;
right: 0;
@@ -42,13 +52,28 @@
height: auto !important;
width: 500px !important;
border-top: 1px solid #979797;
border-left: 1px solid #979797;
.selall{
grid-column-start:1;
grid-column-end:3;
display: flex;
justify-content: flex-end;
align-items: center;
margin: 24px 0px 0 0;
height: 64px;
border-top: 2px solid #bbbcbc;
}
> article {
height: 70px !important;
display: grid !important;
grid-template-columns: 68px 1fr;
align-items: center;
justify-items: center;
border: 1px solid #979797;
border-bottom: 1px solid #979797;
border-right: 1px solid #979797;
label {
width: 100%;
@@ -23,6 +23,13 @@ export default class bitSelect extends Vue {
this.value.setpointHMI = v;
}
openclose(){
if(!this.value || !this.value.status || !this.value.status.enabled)
return
this.opened = !this.opened
}
get currentValue() {
let result = []
for (let index = 0; index < this.bitSize; index++) {
@@ -66,4 +73,20 @@ export default class bitSelect extends Vue {
return this.bit_test(this.value.range.max,bit-1);
}
setAll(){
this.Value = this.value.range.max;
for (let i = 0; i < this.bitSize; i++) {
Vue.set(this.bits, i, this.bit_test(this.Value, i))
}
}
clearAll(){
this.Value = 0;
for (let i = 0; i < this.bitSize; i++) {
Vue.set(this.bits, i, this.bit_test(this.Value, i))
}
}
}
@@ -2,7 +2,7 @@
<div class="bitSelect">
<div
class="form"
@click="opened = !opened"
@click="openclose"
:class="{'error': value && value.status && value.status.hasError, 'disabled': value && value.status && !value.status.enabled}"
>
{{currentValue}}
@@ -23,7 +23,11 @@
</div>
<label :for="`cb-${b}`">{{`${key}_${b}` | localize((b).toString())}}</label>
</article>
</template>
</template>
<div class="selall">
<button class="btn" @click="clearAll">{{'bitselect_select_none' | localize('Nessuno')}}</button>
<button class="btn btn-success" @click="setAll">{{'bitselect_select_all' | localize('Tutti')}}</button>
</div>
</section>
</div>
</template>
@@ -17,6 +17,7 @@ import ShowImbutituraInfo from "@/app_modules_thermo/setup/imbutitura/show-imbut
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 { store } from '@/store';
import { RecipeGetters } from '@/store/recipe.store';
@Component({
@@ -27,7 +28,7 @@ import { store } from '@/store';
})
export default class Setup extends Vue {
async showModalAtStep(step: number) {
try {
let next = await this.showModalStep(step);
@@ -41,6 +42,10 @@ export default class Setup extends Vue {
return store.state.recipe.overview;
}
getIntChanges(val) {
return (this.$store.getters as RecipeGetters).getIntStates(val);
}
showModalStep(step: number): Promise<number> {
switch (step) {
case 0: return ModalHelper.ShowModalAsync(ShowFormatoInfo, null);
@@ -60,6 +65,7 @@ export default class Setup extends Vue {
return null;
}
mounted() {
messageService.subscribeToChannel('show-setup-modal', (m) => this.showModalAtStep(m));
}
@@ -7,6 +7,7 @@
:phase="1"
:title="'lbl_recipe_overview_general' | localize('Formato')"
:status="overview.general"
:haschanges="getIntChanges(0)"
></setup-button>
<setup-button
@@ -14,6 +15,7 @@
:phase="2"
:title="'lbl_recipe_overview_positions' | localize('Quota e velocità')"
:status="overview.positions"
:haschanges="getIntChanges(1)"
></setup-button>
<setup-button
@@ -21,6 +23,7 @@
:phase="3"
:title="'lbl_recipe_overview_cycle' | localize('Ciclo')"
:status="overview.cycle"
:haschanges="getIntChanges(2)"
></setup-button>
<setup-button
@@ -28,6 +31,7 @@
:phase="4"
:title="'lbl_recipe_overview_heats' | localize('Riscaldi')"
:status="overview.heats"
:haschanges="getIntChanges(3)"
></setup-button>
<setup-button
@@ -35,6 +39,7 @@
:phase="5"
:title="'lbl_recipe_overview_pyrometer' | localize('Pirometro')"
:status="overview.pyrometer"
:haschanges="getIntChanges(4)"
></setup-button>
<setup-button
@@ -42,6 +47,7 @@
:phase="6"
:title="'lbl_recipe_overview_drawing' | localize('Imbutitura')"
:status="overview.drawing"
:haschanges="getIntChanges(5)"
></setup-button>
<setup-button
@@ -49,6 +55,7 @@
:phase="7"
:title="'lbl_recipe_overview_upperPlate' | localize('Controstampo')"
:status="overview.upperPlate"
:haschanges="getIntChanges(6)"
></setup-button>
<setup-button
@@ -56,6 +63,7 @@
:phase="8"
:title="'lbl_recipe_overview_cooling' | localize('Raffreddamento')"
:status="overview.cooling"
:haschanges="getIntChanges(7)"
></setup-button>
<setup-button
@@ -63,6 +71,7 @@
:phase="9"
:title="'lbl_recipe_overview_vacuum' | localize('Vuoto')"
:status="overview.vacuum"
:haschanges="getIntChanges(8)"
></setup-button>
<setup-button
@@ -70,6 +79,7 @@
:phase="10"
:title="'lbl_recipe_overview_extraction' | localize('Estrazione')"
:status="overview.extraction"
:haschanges="getIntChanges(9)"
></setup-button>
<setup-button
@@ -77,6 +87,7 @@
:phase="11"
:title="'lbl_recipe_overview_options' | localize('Opzioni di lavorazione')"
:status="overview.options"
:haschanges="getIntChanges(10)"
></setup-button>
<!-- <div class="setup-play" @click="showModalAtStep(11);">
@@ -17,4 +17,9 @@ export default class setupButton extends Vue {
@Prop()
status: string;
@Prop()
haschanges: boolean;
}
@@ -7,6 +7,7 @@
<i v-if="status == 'Unchanged'" class="fa fa-check-circle undone-step"></i>
<i v-if="status == 'ChangedOk'" class="fa fa-check-circle"></i>
<i v-if="status == 'HasError'" class="fa fa-exclamation-triangle warning"></i>
<i v-if="haschanges" class="fa fa-pencil-square undone-step edit"></i>
</div>
</template>
<script src="./setupButton.ts" lang="ts"></script>
@@ -4,6 +4,7 @@ import { messageService } from "@/_base/messageService";
import setupButton from "./setupButton.vue";
import { Prop } from 'vue-property-decorator';
import { store } from '@/store';
import { RecipeGetters } from '@/store/recipe.store';
@Component({ name: 'stepfooter', components: { setupButton } })
export default class StepFooter extends Vue {
@@ -15,8 +16,18 @@ export default class StepFooter extends Vue {
this.$emit('click', step - this.current)
}
getIntChanges(val) {
return (this.$store.getters as RecipeGetters).getIntStates(val);
}
get overview() {
return store.state.recipe.overview;
}
mounted() {
messageService.subscribeToChannel('show-setup-modal', (m) => this.showModalAtStep(m));
}
}
@@ -6,6 +6,7 @@
:phase="1"
:title="'lbl_recipe_overview_general' | localize('Formato')"
:status="overview.general"
:haschanges="getIntChanges(0)"
></setup-button>
<setup-button
@@ -14,6 +15,7 @@
:phase="2"
:title="'lbl_recipe_overview_positions' | localize('Quota e velocità')"
:status="overview.positions"
:haschanges="getIntChanges(1)"
></setup-button>
<setup-button
@@ -22,6 +24,7 @@
:phase="3"
:title="'lbl_recipe_overview_cycle' | localize('Ciclo')"
:status="overview.cycle"
:haschanges="getIntChanges(2)"
></setup-button>
<setup-button
@@ -30,6 +33,7 @@
:phase="4"
:title="'lbl_recipe_overview_heats' | localize('Riscaldi')"
:status="overview.heats"
:haschanges="getIntChanges(3)"
></setup-button>
<setup-button
@@ -38,22 +42,25 @@
:phase="5"
:title="'lbl_recipe_overview_pyrometer' | localize('Pirometro')"
:status="overview.pyrometer"
:haschanges="getIntChanges(4)"
></setup-button>
<setup-button
@click="showModalAtStep(5)"
:class="{'current': current== 5}"
:phase="6"
:title="'lbl_recipe_overview_drawing' | localize('Imbutitura')"
:status="overview.drawing"
:title="'lbl_recipe_overview_drawing' | localize('Imbutitura')"
:status="overview.drawing"
:haschanges="getIntChanges(5)"
></setup-button>
<setup-button
@click="showModalAtStep(6)"
:class="{'current': current== 6}"
:phase="7"
:title="'lbl_recipe_overview_upperPlate' | localize('Controstampo')"
:status="overview.upperPlate"
:title="'lbl_recipe_overview_upperPlate' | localize('Controstampo')"
:status="overview.upperPlate"
:haschanges="getIntChanges(6)"
></setup-button>
<setup-button
@@ -62,6 +69,7 @@
:phase="8"
:title="'lbl_recipe_overview_cooling' | localize('Raffreddamento')"
:status="overview.cooling"
:haschanges="getIntChanges(7)"
></setup-button>
<setup-button
@@ -70,6 +78,7 @@
:phase="9"
:title="'lbl_recipe_overview_vacuum' | localize('Vuoto')"
:status="overview.vacuum"
:haschanges="getIntChanges(8)"
></setup-button>
<setup-button
@@ -78,6 +87,7 @@
:phase="10"
:title="'lbl_recipe_overview_extraction' | localize('Estrazione')"
:status="overview.extraction"
:haschanges="getIntChanges(9)"
></setup-button>
<setup-button
@@ -86,6 +96,7 @@
:phase="11"
:title="'lbl_recipe_overview_options' | localize('Opzioni di lavorazione')"
:status="overview.options"
:haschanges="getIntChanges(10)"
></setup-button>
</div>
</template>
@@ -49,6 +49,20 @@ export default class ShowControstampoInfo extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 6,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 6,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -38,6 +38,20 @@ export default class ShowEstrazioneInfo extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 9,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 9,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -60,6 +60,20 @@ export default class ShowFormatoInfo extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 0,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 0,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -49,6 +49,19 @@ export default class ShowImbutituraInfo extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 5,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 5,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -41,6 +41,19 @@ export default class ShowOpzioniInfo extends Vue {
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 10,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 10,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -39,6 +39,20 @@ export default class ShowPirometroInfo extends Vue {
// ModalHelper.HideModal();
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 4,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 4,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
@@ -82,6 +82,20 @@ export default class ShowQuoteVelocitaInfo extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 1,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 1,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -53,6 +53,20 @@ export default class Raffreddamento extends Vue {
// this.deferred.resolve(-1);
};
@Watch('payload', { deep: true })
async payloadChanged(n, o) {
for (var key in n) {
if (Object.prototype.hasOwnProperty.call(n, key)) {
if(n[key].setpointHMI != n[key].setpointPLC){
recipeActions.setIntState(store, {id: 7,value: true});
return;
}
}
}
recipeActions.setIntState(store, {id: 7,value: false});
};
@Watch('recipe', { deep: true })
async recipeChanged(n, o) {
this.debouncedRecipeSave()
@@ -68,17 +68,26 @@
.modal.prophetimages section .image-selector .timeseries {
width: 100%;
position: relative;
display: flex;
flex-flow: row;
align-items: center;
justify-content: space-between;
}
.modal.prophetimages section .image-selector .timeseries time {
color: #002680;
font-size: 18px;
font-weight: 500;
width: 200px;
position: absolute;
display: flex;
flex-flow: column;
align-items: center;
}
.modal.prophetimages section .image-selector .timeseries time:last-child {
align-items: flex-end;
}
.modal.prophetimages section .image-selector .timeseries time:first-child {
align-items: flex-start;
}
.modal.prophetimages section .image-selector .selector {
color: #002680;
font-size: 18px;
@@ -101,7 +110,7 @@
}
.modal.prophetimages section .color-bar .color-line {
height: 100%;
background-image: linear-gradient(to bottom, #fff, #ffdf00 16%, #e40000 37%, #ab00a5 62%, #000ca4 86%, #000000);
background-image: linear-gradient(to bottom, #ffffff, #ffffcc 16%, #ff9900 48%, #ff0066 64%, #3300ff 80%, #000033);
}
.modal.prophetimages section .color-bar .legend {
display: flex;
@@ -69,17 +69,26 @@
.timeseries {
width: 100%;
position: relative;
display: flex;
flex-flow: row;
align-items: center;
justify-content: space-between;
time {
color: #002680;
font-size: 18px;
font-weight: 500;
width: 200px;
position: absolute;
display: flex;
flex-flow: column;
align-items: center;
}
time:last-child{
align-items:flex-end;
}
time:first-child{
align-items:flex-start;
}
}
.selector {
@@ -109,12 +118,12 @@
height: 100%;
background-image: linear-gradient(
to bottom,
#fff,
#ffdf00 16%,
#e40000 37%,
#ab00a5 62%,
#000ca4 86%,
#000000
rgba(255,255,255,1),
rgba(255,255,204,1) 16%,
rgba(255,153,0,1) 48%,
rgba(255,0,102,1) 64%,
rgba(51,0,255,1) 80%,
rgba(0,0,51,1)
);
}
@@ -32,6 +32,7 @@ export default class ThermoModal extends Vue {
selectedImage: number = 0;
serverPath = "/thermoprophet/colored";
items: Prod.IProd[] = [];
get images() {
return this.items.map(i => i.thermoImage)
}
@@ -48,6 +49,7 @@ export default class ThermoModal extends Vue {
this.TCamData = await warmersService.GetTCamData();
await warmersService.ResetMeasurePoints();
console.log(this.lastItem);
let min = Math.min(this.lastItem.numDone);
this.items.push(...await prodService.History(min - 1, min - 1))
}
@@ -63,6 +65,10 @@ export default class ThermoModal extends Vue {
this.reloadMeasuresDelayed(this.images[this.selectedImage], this.measurePoints);
}
getImageCycle(Sel){
return this.items[Sel];
}
@Watch("selectedImage")
reloadMeasuresDelayed = debounce(async (image, points) => {
let result = await warmersService.GetMeasurePoints(image);

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