Merge branch 'feature/IobCtrlIntegration' into develop
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GWMS.Data
|
||||
{
|
||||
public class IobObjects
|
||||
{
|
||||
/// <summary>
|
||||
/// Array valori tipo evData inviati come JSon
|
||||
/// </summary>
|
||||
public class evJsonPayload
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public List<evData> eventList { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
/// <summary>
|
||||
/// Tracciato InputEvents in formato JSON valido
|
||||
/// Derivato da input realtime valore=3&dtEve=20181206180600000&dtCurr=20181206180600000&cnt=999
|
||||
/// </summary>
|
||||
public class evData
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Contatore incrementale x riordino invio (opzionale)
|
||||
/// </summary>
|
||||
public int cnt { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// DataOra corrente della trasmissione
|
||||
/// </summary>
|
||||
public DateTime dtCurr { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// DataOra evento
|
||||
/// </summary>
|
||||
public DateTime dtEve { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// Valore del dato di flusso registrato
|
||||
/// </summary>
|
||||
public string valore { get; set; } = "-";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Array valori tipo flogData inviati come JSon
|
||||
/// </summary>
|
||||
public class flogJsonPayload
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public List<flogData> fluxData { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
/// <summary>
|
||||
/// Tracciato FluxLog in formato JSON valido
|
||||
/// </summary>
|
||||
public class flogData : evData
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// nome del flusso
|
||||
/// </summary>
|
||||
public string flux { get; set; } = "ND";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,7 @@ using System.Diagnostics;
|
||||
using NLog;
|
||||
using GWMS.Data.DTO;
|
||||
using GWMS.Data.DatabaseModels;
|
||||
using static GWMS.Data.IobObjects;
|
||||
|
||||
namespace GWMS.UI.Data
|
||||
{
|
||||
@@ -217,6 +218,18 @@ namespace GWMS.UI.Data
|
||||
return dbController.PlantLogInsertNew(newItems);
|
||||
}
|
||||
|
||||
public async Task<PlantDTO> PlantsGetByCode(string PlantCode)
|
||||
{
|
||||
PlantDTO answ = new PlantDTO();
|
||||
var ListRecords = await PlantsGetAll();
|
||||
var found = ListRecords.Where(x => x.PlantCode == PlantCode).FirstOrDefault();
|
||||
if (found != null)
|
||||
{
|
||||
answ = found;
|
||||
}
|
||||
return await Task.FromResult(answ);
|
||||
}
|
||||
|
||||
public async Task<List<PlantDTO>> PlantsGetAll()
|
||||
{
|
||||
List<PlantDTO> dbResult = new List<PlantDTO>();
|
||||
@@ -373,6 +386,25 @@ namespace GWMS.UI.Data
|
||||
}
|
||||
}
|
||||
|
||||
public PlantLogModel convertFluxToPL(int plantId, flogData origData)
|
||||
{
|
||||
// cerco di ottenere un val in cifre
|
||||
double valDbl = 0;
|
||||
double.TryParse(origData.valore, out valDbl);
|
||||
TimeSpan delta = origData.dtCurr.Subtract(origData.dtEve);
|
||||
PlantLogModel answ = new PlantLogModel()
|
||||
{
|
||||
FluxType = origData.flux,
|
||||
ValNumber = valDbl,
|
||||
ValString = origData.valore,
|
||||
PlantId = plantId,
|
||||
DtEvent = DateTime.Now.Subtract(delta)
|
||||
|
||||
};
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
@@ -99,6 +99,7 @@ namespace GWMS.UI
|
||||
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
|
||||
});
|
||||
endpoints.MapFallbackToPage("/_Host");
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GWMS.UI", "GWMS.UI\GWMS.UI.
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GWMS.User", "GWMS.User\GWMS.User.csproj", "{3112DC8B-4752-4D43-A9A7-41AC40A38DFD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GWMS.API", "GWMS.API\GWMS.API.csproj", "{F455A3A5-89FD-49E3-B5B6-ED8B0DCEC444}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -29,10 +27,6 @@ Global
|
||||
{3112DC8B-4752-4D43-A9A7-41AC40A38DFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3112DC8B-4752-4D43-A9A7-41AC40A38DFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3112DC8B-4752-4D43-A9A7-41AC40A38DFD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F455A3A5-89FD-49E3-B5B6-ED8B0DCEC444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F455A3A5-89FD-49E3-B5B6-ED8B0DCEC444}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F455A3A5-89FD-49E3-B5B6-ED8B0DCEC444}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F455A3A5-89FD-49E3-B5B6-ED8B0DCEC444}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo statistiche MAPO</i>
|
||||
<h4>Versione: 1.0.2106.3010</h4>
|
||||
<h4>Versione: 1.0.2107.2412</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.0.2106.3010
|
||||
1.0.2107.2412
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.0.2106.3010</version>
|
||||
<version>1.0.2107.2412</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP-STATS/stable/0/GWMS.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP-STATS/stable/0/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user