Compare commits

...

18 Commits

Author SHA1 Message Date
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
34 changed files with 18873 additions and 18583 deletions
+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'))" />
+2 -1
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>
@@ -140,7 +141,7 @@
<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" />
+80 -55
View File
@@ -49,6 +49,7 @@ public static class ThreadsFunctions
public static int modulesRtCounter = 0;
public static int recipeRtCounter = 0;
public static bool reconnectionIsRunning = false;
public static bool forcetakeSnapshot = false;
#endregion Public Fields
@@ -360,6 +361,14 @@ public static class ThreadsFunctions
// avvio oggetto thermocam
ThermoCamComunicator TCCom = new ThermoCamComunicator(true);
Stopwatch sw = new Stopwatch();
forcetakeSnapshot = false;
RegistrationInfo takeReginfo = MessageServices.Current.Subscribe(TAKE_SNAPSHOT_THERMO, (a, b) =>
{
ThreadsFunctions.forcetakeSnapshot = true;
});
try
{
// Try connection
@@ -380,11 +389,13 @@ public static class ThreadsFunctions
if (libraryError.IsError())
ManageLibraryError(libraryError);
if (flirImageReq)
if (flirImageReq || forcetakeSnapshot)
{
forcetakeSnapshot = false;
bool done = false;
// if requested --> give ack!
ncAdapter.ManageFlirStrobe();
if (flirImageReq)
ncAdapter.ManageFlirStrobe();
// requesto photo from library
NcAdapter.lastThermoImage = TCCom.takePicture();
done = !string.IsNullOrEmpty(NcAdapter.lastThermoImage);
@@ -407,7 +418,8 @@ public static class ThreadsFunctions
ncAdapter.WriteRecipeWarmChTCamTempAct(actualTemp);
NcAdapter.lastImageTaken = DateTime.Now;
// give PLC strobe for uploaded Actual TEMP from image
ncAdapter.SendTCamImageReadyStrb();
if(flirImageReq)
ncAdapter.SendTCamImageReadyStrb();
MessageServices.Current.Publish(SEND_NEWTCAMIMAGE, null, NcAdapter.lastImageTaken);
@@ -438,7 +450,8 @@ public static class ThreadsFunctions
}
finally
{
ncAdapter.Dispose();
MessageServices.Current.UnSubscribe(takeReginfo);
ncAdapter.Dispose();
// chiudo thermocam
TCCom.Dispose();
}
@@ -1466,39 +1479,46 @@ 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();
}
// 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();
@@ -1633,33 +1653,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));
}
-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>
@@ -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
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";
+73
View File
@@ -475,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
{
@@ -1764,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)
@@ -1795,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())
{
@@ -1813,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())
@@ -1827,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);
}
}
}
@@ -3421,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;
}
@@ -3433,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;
}
@@ -3669,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;
}
@@ -3681,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;
}
@@ -3693,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;
}
@@ -3705,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;
}
@@ -3717,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;
}
@@ -3732,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)
{
@@ -3793,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;
}
-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>
+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>
@@ -701,6 +701,7 @@ namespace Thermo.Active.Controllers.WebApi
}
// copy data to PLC
checkError = ncAdapter.ReadFullRecipe(out Dictionary<string, DTORecipeParam> prevRecipe);
if (checkError.IsError())
@@ -591,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
}
@@ -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);
}
}
@@ -686,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
@@ -696,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.186")]
[assembly: AssemblyVersion("1.1.191")]
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,6 +3575,9 @@
cursor: pointer;
color: #FFF;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
}
button:disabled {
+17 -4
View File
@@ -2321,7 +2321,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 +3668,6 @@ article .box .body {
position: absolute;
width: 100%;
height: 100%;
background: #ffffff;
top: 0;
display: block;
overflow: hidden;
@@ -3677,6 +3676,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 +3717,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 +3742,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 +3754,9 @@ article .box .body {
cursor: pointer;
color: #FFF;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
}
.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,19 +61,16 @@ async function loadMachineConfig() {
await loginService.getUserInfo();
try {
let machine = new machineService();
let result = await machine.getAreasConfiguration();
machineStatusActions.setAreasConfg(store, result);
let mcresult = await machine.getMachineConfiguration();
await underTheHoodService.getChannelsConfig();
await warmersService.GetResistances();
machineStatusActions.setWarmersParameters(store, mcresult.additionalParameters);
await prodService.GetProdPanel();
await underTheHoodService.getChannels();
await underTheHoodService.getChannelsConfig();
// load default language
if (!(store.state as AppModel).localization.currentLanguage) {
@@ -130,8 +130,6 @@ export default class Dashboard extends Vue {
}
async mounted() {
prodService.GetProdPanel();
let $this = this;
setInterval(() => {
$this.now = moment();
@@ -0,0 +1,70 @@
.warmers {
display: grid !important;
grid-template-columns: 1fr 70px;
margin-right: -14px;
}
.warmers .right-controls {
display: flex;
flex-flow: column nowrap;
align-items: center;
justify-content: space-between;
}
.warmers .right-controls .tm-controls {
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-between;
height: 420px;
}
.warmers .right-controls .tm-controls input[type="range"][orient="vertical"] {
writing-mode: bt-lr;
/* IE */
-webkit-appearance: slider-vertical;
/* WebKit */
width: 6px;
height: 150px;
border: none !important;
box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.5);
border-radius: 10px;
}
.warmers .right-controls .tm-controls input[type="range"][orient="vertical"]::-webkit-slider-thumb {
min-width: 30px;
min-height: 30px;
border: none;
background: none !important;
appearance: none;
}
.warmers .right-controls .tm-controls input[type="range"]::-webkit-slider-thumb {
background-color: linear-gradient(to bottom, #1756ad, #002e6e 97%) !important;
}
.warmers .right-controls .um-buttons {
background-color: #dddddd;
height: 130px;
width: 40px;
border-radius: 20px;
box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.5);
display: flex;
flex-flow: column nowrap;
justify-content: space-around;
align-items: center;
}
.warmers .right-controls .um-buttons button {
width: 34px;
height: 34px;
border-radius: 50px;
border: none;
text-align: center;
line-height: 34px;
font-size: 18px;
font-weight: bold;
color: #fff;
box-shadow: inset 0 2px 2px 0 rgba(0, 0, 0, 0.19);
background-color: rgba(187, 188, 188, 0.5);
}
.warmers .right-controls .um-buttons button.selected {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.5);
background-image: linear-gradient(to bottom, #1756ad, #002e6e 97%);
}
.warmers .right-controls .buttons button {
margin: 8px;
}
@@ -13,13 +13,13 @@
flex-flow: column;
align-items: center;
justify-content: space-between;
height: 350px;
height: 420px;
input[type="range"][orient="vertical"] {
writing-mode: bt-lr; /* IE */
-webkit-appearance: slider-vertical; /* WebKit */
width: 6px;
height: 250px;
height: 150px;
border: none !important;
box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.5);
border-radius: 10px;
@@ -10,11 +10,12 @@ import termoModal from "./thermoProphet-modal.vue";
import { ModalHelper } from '@/components/modals';
import moment from "moment";
import { messageService } from "src/_base";
import ModalImage from "@/modules/base-components/modal-image.vue";
@Component({
name: "thermocamera", components: {
warmers
warmers,ModalImage
}
})
export default class Thermocamera extends Vue {
@@ -64,8 +65,8 @@ export default class Thermocamera extends Vue {
messageService.subscribeToChannel("new-thermocam-image", (args)=>{
if(this.TCamData){
console.log(args)
this.TCamData.lastTakenImage = args[0];
ModalHelper.modalImage.content = this.thermocameraOriginalUrl;
}
});
}
@@ -95,6 +96,11 @@ export default class Thermocamera extends Vue {
return "/thermoprophet/colored/_last.jpg?lastmod=NOTAVAILABLE";
return "/thermoprophet/colored/_last.jpg?lastmod=" + this.TCamData.lastTakenImage;
}
get thermocameraOriginalUrl(){
if(!this.TCamData || moment(this.TCamData.lastTakenImage).year() <= 2000)
return "/thermoprophet/original/_last.jpg?lastmod=NOTAVAILABLE";
return "/thermoprophet/original/_last.jpg?lastmod=" + this.TCamData.lastTakenImage;
}
get thermocameraImageOk(): boolean {
clearInterval(this.timeoutLastTakenImage);
@@ -231,4 +237,19 @@ export default class Thermocamera extends Vue {
async openThermoModal() {
ModalHelper.ShowModal(termoModal, "modal2");
}
async openImageModal() {
if(this.TCamData){
ModalHelper.modalImage.title = moment(this.TCamData.lastTakenImage).format("L") + " - " + moment(this.TCamData.lastTakenImage).format("LTS");
}
ModalHelper.modalImage.content = this.thermocameraOriginalUrl;
ModalHelper.ShowModal(ModalImage, "modal2");
}
async forceTakeImage() {
warmersService.TakeNewPhoto();
}
}
@@ -125,9 +125,15 @@
</div>
<div class="tm-controls">
<button class="btn btn-info square" @click="openThermoModal()">
<button class="btn btn-info square" @click="forceTakeImage()">
<img src="/assets/icons/png/takesnap.png" />
</button>
<button class="btn btn-info square" @click="openImageModal()">
<img src="/assets/icons/png/ico-bt-selez-image.png" />
</button>
<button class="btn btn-info square" @click="openThermoModal()">
<img src="/assets/icons/png/history.png" />
</button>
<span>{{timeCamDiff}}</span>
<input
:disabled="!thermocameraImageOk"
@@ -49,7 +49,8 @@ export class ModalHelper {
};
public static modalImage = {
content: null,
title: null
title: null,
lastPhoto:null
};
public static maintenanceModal = {
currentMaintenance: null,
-6
View File
@@ -24,12 +24,6 @@ import "./app.business-logic";
import "./app.modules";
import { messageService } from "src/_base";
import { warmersService } from "./services/warmersService";
warmersService.GetChannels();
warmersService.GetResistances();
import { prodService } from "./services/prodService";
prodService.GetProd();
const App = () =>
import("./App.vue");
@@ -3,6 +3,7 @@ import { Factory, messageService } from "../../_base";
import ZoomImage from './zoom-image.vue'
import Vue from "vue";
import Component from "vue-class-component";
import moment from "moment";
@Component({
components:{
@@ -13,19 +14,24 @@ import Component from "vue-class-component";
export default class ModalImage extends Vue {
content: string = "";
title: string = "";
content: string = "";
title: string = "";
mounted() {
this.content = ModalHelper.modalImage.content;
this.title = ModalHelper.modalImage.title;
mounted() {
this.content = ModalHelper.modalImage.content;
this.title = ModalHelper.modalImage.title;
}
messageService.subscribeToChannel("new-thermocam-image", (args)=>{
this.content = "/thermoprophet/original/_last.jpg?lastmod=" + args[0];
this.title = moment(args[0]).format("L") + " - " + moment(args[0]).format("LTS");
});
}
beforeMount() {
messageService.subscribeToChannel("esc_pressed", args => {
this.close();
});
beforeMount() {
messageService.subscribeToChannel("esc_pressed", args => {
this.close();
});
}
beforeDestroy() {
@@ -34,7 +40,7 @@ export default class ModalImage extends Vue {
close() {
messageService.deleteChannel("esc_pressed");
ModalHelper.HideModal();
ModalHelper.HideModal("modal2");
}
};
@@ -1,8 +1,7 @@
<template>
<modal type="modal-image" :title="title">
<button class="close" slot="header-buttons" @click="close()"><i class="fa fa-remove"></i></button>
<zoom-image :imageSrc="this.content" :showBackButton="false" />
<zoom-image :imageSrc="this.content" :showBackButton="false" :isTcam="true"/>
</modal>
</template>
<script src="./modal-image.ts" lang="ts" />
<!--<script src="./create-maintenance.ts" lang="ts"></script>-->
@@ -1,5 +1,6 @@
import Vue from "vue";
import { Prop, Component } from "vue-property-decorator";
import { warmersService } from "@/services/warmersService";
@Component([])
export default class ZoomImage extends Vue {
@@ -9,6 +10,8 @@ export default class ZoomImage extends Vue {
imageSrc: string;
@Prop({ default: true })
showBackButton: boolean;
@Prop({ default: false })
isTcam: boolean;
transImage: string = "";
scaleImage: number = 1;
@@ -136,5 +139,10 @@ export default class ZoomImage extends Vue {
this.transImage = "translateX(" + 0 + "px)translateY(" + 0 + "px)scale(" + this.scaleImage + ")";
}
async forceTakeImage() {
warmersService.TakeNewPhoto();
}
};
@@ -7,14 +7,19 @@
@touchstart="dw"
@touchmove="move"
@dblclick="zoomPlusAnimated">
<svg xmlns="http://www.w3.org/2000/svg" :style="{'transform':transImage}" v-html="imageSrc" version="1.1" width="100%" height="100%" viewBox="0 0 2000 1500" v-on:load="onImageLoaded"></svg>
<img ref="imageChild" :style="{'transform':transImage,'transition':animation}" :src="imageSrc" v-on:load="onImageLoaded" >
<!-- <svg xmlns="http://www.w3.org/2000/svg" :style="{'transform':transImage}" v-html="imageSrc" version="1.1" width="100%" height="100%" viewBox="0 0 2000 1500" v-on:load="onImageLoaded"></svg>-->
</div>
<!-- <div class="loading" v-if="!imageLoaded"><i class="fa fa-circle-o-notch fa-spin"></i></div>-->
<div class="loading" v-if="!imageLoaded"><i class="fa fa-circle-o-notch fa-spin"></i></div>
<div class="btngroup_close" v-if="showBackButton">
<button @click="close"><i class="fa fa-chevron-left" ></i></button>
</div>
<div class="btngroup2" v-if="true">
<button @click="forceTakeImage()">
<img src="/assets/icons/png/takesnap.png" />
</button>
</div>
<div class="btngroup">
<button @click="zoomPlusAnimated"><i class="fa fa-search-plus" ></i></button>
<div class="rangecontainer">
+10 -2
View File
@@ -113,6 +113,7 @@ export class Hub {
// qui i NUOVI metodi NUOVI dal server (Recipe, gauges) da completare lato HUB
this._hub.client.recipeFullData = Hub.recipeFullData;
this._hub.client.recipeFullDataInvalidSetpoint = Hub.recipeFullDataInvalidSetpoint;
this._hub.client.warmersData = Hub.warmersData;
this._hub.client.setpointHmiInvalid = Hub.setpointHmiInvalid;
this._hub.client.recipeOverData = Hub.recipeOverData;
@@ -201,14 +202,17 @@ export class Hub {
recipeActions.setCurrent(store, data, true);
}
public static recipeFullDataInvalidSetpoint(data) {
recipeActions.setCurrent(store, data, false);
}
public static warmersData(data) {
warmersActions.setChannels(store, data as { [id: number]: Warmers.IChannel });
}
public static async setpointHmiInvalid(data) {
if (data) {
await recipeService.GetCurrent();
await warmersService.GetChannels();
await warmersService.GetThermocameraStatus();
// await recipeService.GetOverview();
}
@@ -231,11 +235,14 @@ export class Hub {
prodActions.setProd(store, data);
}
public updateAuthToken() {
// Set or update authorization token
let authData = JSON.parse(window.localStorage.getItem("authorizationData") || window.sessionStorage.getItem("authorizationData")) as AuthToken;
$.connection.hub.qs = {};
console.log(authData);
if (authData)
$.connection.hub.qs.Authorization = authData.access_token;
@@ -243,6 +250,7 @@ export class Hub {
$.connection.hub.qs.CmsClientId = cmsClient.getClientID;
}
private logout(e) {
if (e)
appModelActions.CheckLogoff(store, e.id);
@@ -90,5 +90,10 @@ export class WarmersService extends baseRestService {
async ResetMeasurePoints() {
return this.Put((await this.BASE_URL()) + `resetMeasurePoint`, null, true);
}
async TakeNewPhoto() {
return this.Put((await this.BASE_URL()) + `TakeTcamImage`, null, true);
}
}
export const warmersService = new WarmersService();