ok lettura vista pareto gloable stati amcchina
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x86;x64</Platforms>
|
||||
<Version>1.2.2303.2814</Version>
|
||||
<Version>1.2.2303.2818</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MAPO-MONO</i>
|
||||
<h4>Version: 1.2.2303.2814</h4>
|
||||
<h4>Version: 1.2.2303.2818</h4>
|
||||
<br /> Release Note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.2.2303.2814
|
||||
1.2.2303.2818
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.2.2303.2814</version>
|
||||
<version>1.2.2303.2818</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -58,6 +58,7 @@ namespace MP.MONO.Core
|
||||
public static readonly string PROD_CURR_KEY = $"{BASE_HASH}:Current:Production";
|
||||
public static readonly string STATUS_ACT_KEY = $"{BASE_HASH}:Current:StatusVal";
|
||||
public static readonly string STATUS_LAST_KEY = $"{BASE_HASH}:Current:StatusLastVal";
|
||||
public static readonly string STATUS_PARETO_KEY = $"{BASE_HASH}:Current:StatusPareto";
|
||||
public static readonly string STATUS_CURR_KEY = $"{BASE_HASH}:Current:Status";
|
||||
public static readonly string TOOLS_ACT_KEY = $"{BASE_HASH}:Current:ToolsVal";
|
||||
public static readonly string TOOLS_CURR_KEY = $"{BASE_HASH}:Current:Tools";
|
||||
@@ -77,6 +78,7 @@ namespace MP.MONO.Core
|
||||
public static readonly string PARAMS_M_QUEUE = $"Params";
|
||||
public static readonly string PROD_M_QUEUE = $"Production";
|
||||
public static readonly string STATUS_M_QUEUE = $"Status";
|
||||
public static readonly string STATUS_PAR_QUEUE = $"StatusPareto";
|
||||
public static readonly string COUNT_M_QUEUE = $"Count";
|
||||
public static readonly string TOOLS_M_QUEUE = $"Tools";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x86;x64</Platforms>
|
||||
<Version>1.2.2303.2814</Version>
|
||||
<Version>1.2.2303.2818</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -37,13 +37,18 @@ namespace MP.MONO.DECODER
|
||||
/// <param name="paramsList"></param>
|
||||
/// <param name="MachinePlate"></param>
|
||||
/// <returns></returns>
|
||||
public bool processData(Dictionary<string, int> paramsList, ref MachineDTO? MachinePlate)
|
||||
public MachineDTO processData(Dictionary<string, int> paramsList, MachineDTO MachinePlate)
|
||||
{
|
||||
bool calcOk = false;
|
||||
if (MachinePlate == null)
|
||||
MachineDTO plateOut = new MachineDTO()
|
||||
{
|
||||
MachinePlate = new MachineDTO();
|
||||
}
|
||||
Manufacturer = MachinePlate.Manufacturer,
|
||||
ModeId = MachinePlate.ModeId,
|
||||
Model = MachinePlate.Model,
|
||||
Name = MachinePlate.Name,
|
||||
SerNumber = MachinePlate.SerNumber,
|
||||
StatusId = MachinePlate.StatusId
|
||||
};
|
||||
DateTime adesso = DateTime.Now;
|
||||
|
||||
state.NewTable("dataList");
|
||||
@@ -75,12 +80,12 @@ namespace MP.MONO.DECODER
|
||||
var stringVal = state.GetString("statusId");
|
||||
if (!string.IsNullOrEmpty(stringVal))
|
||||
{
|
||||
MachinePlate.StatusId = state.GetInteger("statusId");
|
||||
plateOut.StatusId = state.GetInteger("statusId");
|
||||
}
|
||||
stringVal = state.GetString("modeId");
|
||||
if (!string.IsNullOrEmpty(stringVal))
|
||||
{
|
||||
MachinePlate.ModeId = state.GetInteger("modeId");
|
||||
plateOut.ModeId = state.GetInteger("modeId");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -91,7 +96,7 @@ namespace MP.MONO.DECODER
|
||||
else
|
||||
{ }
|
||||
|
||||
return calcOk;
|
||||
return plateOut;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
+149
-105
@@ -103,6 +103,14 @@ DateTime lastLogDetail = DateTime.Now.AddHours(-1);
|
||||
int numSendParam = 1;
|
||||
int numSendTools = 1;
|
||||
int numSendMStatus = 1;
|
||||
Random rand = new Random();
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* Setup Thread periodici (es calcolo pareto stati)
|
||||
* ----------------------------------------------------------------*/
|
||||
MessagePipe mpStatusParetoSendPipe = new MessagePipe(redisConn, Constants.STATUS_PAR_QUEUE);
|
||||
Thread threadStatus = new Thread(calcParetoStatus);
|
||||
threadStatus.Start();
|
||||
|
||||
/* --------------------------------
|
||||
* Setup Gestione Counters
|
||||
@@ -423,6 +431,29 @@ bool testEqual(Dictionary<string, string> dict1, Dictionary<string, string> dict
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Ultimo Plate machine salvato
|
||||
/// </summary>
|
||||
MachineDTO getLastMachinePlate()
|
||||
{
|
||||
MachineDTO? currMPlate = new MachineDTO();
|
||||
string rawData = redisDb.StringGet(Constants.STATUS_CURR_KEY);
|
||||
if (string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
rawData = redisDb.StringGet(Constants.MACHINE_CONF_PLATE);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
currMPlate = JsonConvert.DeserializeObject<MachineDTO>(rawData);
|
||||
}
|
||||
if (currMPlate == null)
|
||||
{
|
||||
currMPlate = new MachineDTO();
|
||||
}
|
||||
return currMPlate;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Stato precedentemente salvato su REDIS x calcolo variazioni
|
||||
/// </summary>
|
||||
@@ -463,6 +494,29 @@ bool setLastStatusVal(Dictionary<string, string> dataList)
|
||||
return answ;
|
||||
}
|
||||
|
||||
void calcParetoStatus()
|
||||
{
|
||||
// ricalcolo ogni 60" +/- 3sec
|
||||
int minPeriod = 57000;
|
||||
int maxPeriod = 63000;
|
||||
|
||||
do
|
||||
{
|
||||
// periodo riferimento sempre ricalcolato...
|
||||
DateTime inizio = DateTime.Today;
|
||||
DateTime fine = DateTime.Today.AddDays(1);
|
||||
// recupero pareto da DB
|
||||
var newStatus = dbController.ParetoStatusMach(MachineId, inizio, fine);
|
||||
// serializzo e salvo
|
||||
string rawData = JsonConvert.SerializeObject(newStatus);
|
||||
mpStatusParetoSendPipe.saveAndSendMessage(Constants.STATUS_PARETO_KEY, rawData);
|
||||
|
||||
// attesa random di circa 1 minuti x calcolare...
|
||||
Thread.Sleep(rand.Next(minPeriod, maxPeriod));
|
||||
} while (true);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gestione evento ricezione messaggi allarmi secondo tipologia attiva...
|
||||
/// </summary>
|
||||
@@ -1140,20 +1194,10 @@ void MpStatusRecvPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
*************************************************************************/
|
||||
|
||||
// recupero elenco parametri salvati in redis...
|
||||
MachineDTO? machinePlate = new MachineDTO();
|
||||
Dictionary<string, int> parList = new Dictionary<string, int>();
|
||||
|
||||
// recupero status precedente...
|
||||
|
||||
string rawData = redisDb.StringGet(Constants.MACHINE_CONF_PLATE);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
machinePlate = JsonConvert.DeserializeObject<MachineDTO>(rawData);
|
||||
}
|
||||
if (machinePlate == null)
|
||||
{
|
||||
machinePlate = new MachineDTO();
|
||||
}
|
||||
MachineDTO lastMachinePlate = getLastMachinePlate();
|
||||
MachineDTO nextMachinePlate = new MachineDTO();
|
||||
|
||||
int machStatus = 0;
|
||||
int procStatus = 0;
|
||||
@@ -1180,107 +1224,110 @@ void MpStatusRecvPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
parList.Add(currKey, procMode);
|
||||
}
|
||||
|
||||
bool useLua = true;
|
||||
// fix me todo inserire gestione program name!!!
|
||||
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
#if true
|
||||
// calcolo status
|
||||
if (machStatus == 0)
|
||||
if (useLua)
|
||||
{
|
||||
machinePlate.StatusId = 7;
|
||||
// calcolo con LUA e vedo se cambia...
|
||||
sw.Restart();
|
||||
nextMachinePlate = mpStatusMan.processData(parList, lastMachinePlate);
|
||||
sw.Stop();
|
||||
|
||||
if (adesso.Subtract(lastLogDetail).TotalSeconds > 5 || numSendMStatus > 10)
|
||||
{
|
||||
Log.Info($"Calcolo LUA | {sw.ElapsedTicks} ticks | {sw.ElapsedMilliseconds} ms | {JsonConvert.SerializeObject(nextMachinePlate)} | x {numSendMStatus}");
|
||||
lastLogDetail = adesso;
|
||||
numSendMStatus = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
numSendMStatus++;
|
||||
}
|
||||
}
|
||||
#if false
|
||||
else
|
||||
{
|
||||
switch (procMode)
|
||||
// calcolo status
|
||||
if (machStatus == 0)
|
||||
{
|
||||
nextMachinePlate.StatusId = 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (procMode)
|
||||
{
|
||||
case 1:
|
||||
nextMachinePlate.StatusId = 8;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
nextMachinePlate.StatusId = 2;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
nextMachinePlate.StatusId = 9;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
nextMachinePlate.StatusId = 5;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
nextMachinePlate.StatusId = 10;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
nextMachinePlate.StatusId = 11;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
nextMachinePlate.StatusId = 12;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
nextMachinePlate.StatusId = 13;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// eseguo cablata la gestione x ora... rispetto a MachineStatus + MachineMode
|
||||
// invierò un machineDTO
|
||||
switch (procStatus)
|
||||
{
|
||||
case 1:
|
||||
machinePlate.StatusId = 8;
|
||||
lastMachinePlate.ModeId = 2;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
machinePlate.StatusId = 2;
|
||||
lastMachinePlate.ModeId = 1;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
machinePlate.StatusId = 9;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
machinePlate.StatusId = 5;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
machinePlate.StatusId = 10;
|
||||
lastMachinePlate.ModeId = 3;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
machinePlate.StatusId = 11;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
machinePlate.StatusId = 12;
|
||||
lastMachinePlate.ModeId = 8;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
machinePlate.StatusId = 13;
|
||||
lastMachinePlate.ModeId = 9;
|
||||
break;
|
||||
|
||||
case 11:
|
||||
lastMachinePlate.ModeId = 10;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// eseguo cablata la gestione x ora... rispetto a MachineStatus + MachineMode
|
||||
// invierò un machineDTO
|
||||
switch (procStatus)
|
||||
{
|
||||
case 1:
|
||||
machinePlate.ModeId = 2;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
machinePlate.ModeId = 1;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
machinePlate.ModeId = 3;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
machinePlate.ModeId = 8;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
machinePlate.ModeId = 9;
|
||||
break;
|
||||
|
||||
case 11:
|
||||
machinePlate.ModeId = 10;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Info($"Calcolo C# | {sw.ElapsedTicks} ticks | {sw.ElapsedMilliseconds} ms | {JsonConvert.SerializeObject(machinePlate)}");
|
||||
Log.Info("-------------");
|
||||
#endif
|
||||
|
||||
#if false
|
||||
// calcolo con LUA e vedo se cambia...
|
||||
sw.Restart();
|
||||
bool done = mpStatusMan.processData(parList, ref machinePlate);
|
||||
sw.Stop();
|
||||
|
||||
if (adesso.Subtract(lastLogDetail).TotalSeconds > 5 || numSendMStatus > 10)
|
||||
{
|
||||
Log.Info($"Calcolo LUA | {sw.ElapsedTicks} ticks | {sw.ElapsedMilliseconds} ms | {JsonConvert.SerializeObject(machinePlate)} | x {numSendMStatus}");
|
||||
lastLogDetail = adesso;
|
||||
numSendMStatus = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
numSendMStatus++;
|
||||
sw.Stop();
|
||||
Log.Info($"Calcolo C# | {sw.ElapsedTicks} ticks | {sw.ElapsedMilliseconds} ms | {JsonConvert.SerializeObject(nextMachinePlate)}");
|
||||
Log.Info("-------------");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1317,29 +1364,26 @@ void MpStatusRecvPipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
}
|
||||
// salvo su DB x log produzione
|
||||
_ = dbController.ProdLogInsertMany(newProdRecords);
|
||||
}
|
||||
|
||||
#if false
|
||||
// confronto variazioni x "MACHINE STATUS"
|
||||
string keyStatus = "MACHINE STATUS";
|
||||
if (diffVal.ContainsKey(keyStatus))
|
||||
// confronto variazioni x "MACHINE STATUS"
|
||||
if (nextMachinePlate.StatusId != lastMachinePlate.StatusId)
|
||||
{
|
||||
//string codStatus = $"MS_{diffVal[keyStatus]:000}";
|
||||
string codStatus = $"MS_{nextMachinePlate.StatusId:000}";
|
||||
// chiamo registrazione sul DB dello stato...
|
||||
var newRecStatus = new StatusLogModel()
|
||||
{
|
||||
string codStatus = $"MS_{diffVal[keyStatus]:000}";
|
||||
// chiamo registrazione sul DB dello stato...
|
||||
var newRecStatus = new StatusLogModel()
|
||||
{
|
||||
MachineId = MachineId,
|
||||
DtRif = adesso,
|
||||
Duration = 0,
|
||||
CodStatus = codStatus
|
||||
};
|
||||
_ = dbController.StatusLogInsert(newRecStatus);
|
||||
}
|
||||
#endif
|
||||
|
||||
MachineId = MachineId,
|
||||
DtRif = adesso,
|
||||
Duration = 0,
|
||||
CodStatus = codStatus
|
||||
};
|
||||
_ = dbController.StatusLogInsert(newRecStatus);
|
||||
}
|
||||
|
||||
// invio sulla message pipeline corretta TUTTI i parametri aggiornati serializzati
|
||||
string updRawVal = JsonConvert.SerializeObject(machinePlate);
|
||||
string updRawVal = JsonConvert.SerializeObject(nextMachinePlate);
|
||||
mpStatusSendPipe.saveAndSendMessage(Constants.STATUS_CURR_KEY, updRawVal);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MAPO-MONO</i>
|
||||
<h4>Version: 1.2.2303.2814</h4>
|
||||
<h4>Version: 1.2.2303.2818</h4>
|
||||
<br /> Release Note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.2.2303.2814
|
||||
1.2.2303.2818
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.2.2303.2814</version>
|
||||
<version>1.2.2303.2818</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -907,6 +907,34 @@ namespace MP.MONO.Data.Controllers
|
||||
return currMachDto;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Recupero pareto status impianto
|
||||
/// </summary>
|
||||
/// <param name="MachineId">Macchina selezionata</param>
|
||||
/// <param name="from">inizio periodo</param>
|
||||
/// <param name="to">fine periodo</param>
|
||||
/// <returns></returns>
|
||||
public List<ParetoStatusModel> ParetoStatusMach(int MachineId, DateTime from, DateTime to)
|
||||
{
|
||||
List<ParetoStatusModel> dbResult = new List<ParetoStatusModel>();
|
||||
using (MapoMonoContext localDbCtx = new MapoMonoContext())
|
||||
{
|
||||
try
|
||||
{
|
||||
dbResult = localDbCtx
|
||||
.DbSetParetoStatus
|
||||
. OrderByDescending(x => x.TotDuration)
|
||||
.ToList();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante ParetoStatusMach{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco contatori ammessi
|
||||
/// </summary>
|
||||
@@ -1274,28 +1302,42 @@ namespace MP.MONO.Data.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
float duration = 0;
|
||||
bool needInsert = false;
|
||||
// ultimo inserito...
|
||||
var lastrec = localDbCtx
|
||||
var lastRec = localDbCtx
|
||||
.DbSetStatusLog
|
||||
.Where(x => x.MachineId == newRec.MachineId)
|
||||
.OrderByDescending(x => x.DtRif)
|
||||
.FirstOrDefault();
|
||||
|
||||
// se trovato calcolo durata...
|
||||
if (lastrec != null)
|
||||
// se non trovato inserisco comunque
|
||||
if (lastRec == null)
|
||||
{
|
||||
duration = (float)DateTime.Now.Subtract(lastrec.DtRif).TotalMinutes;
|
||||
needInsert = true;
|
||||
}
|
||||
// se trovato controllo variazione...
|
||||
else
|
||||
{
|
||||
// se cambia stato...
|
||||
if (lastRec.CodStatus != newRec.CodStatus)
|
||||
{
|
||||
needInsert = true;
|
||||
}
|
||||
// oppure se è passato il giorno...
|
||||
else if (lastRec.DtRif.Date < newRec.DtRif.Date)
|
||||
{
|
||||
needInsert = true;
|
||||
}
|
||||
// calcolo durata vecchio record...
|
||||
lastRec.Duration = (float)DateTime.Now.Subtract(lastRec.DtRif).TotalMinutes;
|
||||
}
|
||||
|
||||
// aggiorno durata
|
||||
newRec.Duration = duration;
|
||||
|
||||
// inserisco record
|
||||
|
||||
localDbCtx
|
||||
.DbSetStatusLog
|
||||
.Add(newRec);
|
||||
if (needInsert)
|
||||
{
|
||||
localDbCtx
|
||||
.DbSetStatusLog
|
||||
.Add(newRec);
|
||||
}
|
||||
|
||||
// salvo
|
||||
localDbCtx.SaveChanges();
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace MP.MONO.Data.DbModels
|
||||
{
|
||||
/// <summary>
|
||||
/// Tabella Codifica Stati
|
||||
/// </summary>
|
||||
public class ParetoStatusModel
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// UID
|
||||
/// </summary>
|
||||
[Key]
|
||||
public string CodStatus { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Durata totale stato
|
||||
/// </summary>
|
||||
public float TotDuration { get; set; } = 0;
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
-- stored
|
||||
DELIMITER //
|
||||
GO
|
||||
|
||||
CREATE OR REPLACE PROCEDURE stp_paretoStatus(
|
||||
IN machine_id INT,
|
||||
IN dt_from DATETIME,
|
||||
IN dt_to DATETIME
|
||||
)
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
SELECT CodStatus, SUM(Duration) AS TotDuration
|
||||
FROM StatusLog
|
||||
WHERE MachineId = machine_id
|
||||
AND DtRif >= dt_from
|
||||
AND DtRif <= dt_to
|
||||
GROUP BY CodStatus;
|
||||
END;
|
||||
//
|
||||
GO
|
||||
|
||||
DELIMITER ;
|
||||
GO
|
||||
@@ -0,0 +1,11 @@
|
||||
-- creazione viste
|
||||
DELIMITER ;
|
||||
|
||||
DROP VIEW IF EXISTS v_ParetoStatus;
|
||||
GO
|
||||
|
||||
CREATE VIEW v_ParetoStatus AS
|
||||
SELECT CodStatus,SUM(Duration) AS TotDuration
|
||||
FROM StatusLog
|
||||
GROUP BY CodStatus;
|
||||
GO
|
||||
@@ -123,6 +123,11 @@ namespace MP.MONO.Data
|
||||
/// </summary>
|
||||
public virtual DbSet<PendingMaintModel> DbSetSMTask { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// DbSet Pareto Status giornaliero
|
||||
/// </summary>
|
||||
public virtual DbSet<ParetoStatusModel> DbSetParetoStatus { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
@@ -146,7 +151,7 @@ namespace MP.MONO.Data
|
||||
{ }
|
||||
if(string.IsNullOrEmpty(connString))
|
||||
{
|
||||
connString = "server=10.74.82.230; port=3306; database=MAPO.MONO; uid=steamware; pwd=Seriate_24068!; sslmode=None;";
|
||||
connString = "server=10.74.82.230; port=3306; database=MAPO.MONO;uid=steamware; pwd=Seriate_24068!; sslmode=None;";
|
||||
}
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
@@ -162,6 +167,7 @@ namespace MP.MONO.Data
|
||||
relationship.DeleteBehavior = DeleteBehavior.Restrict;
|
||||
}
|
||||
|
||||
modelBuilder.Entity<ParetoStatusModel>().ToView("v_ParetoStatus");
|
||||
//modelBuilder.Entity<ConfigModel>(entity =>
|
||||
//{
|
||||
// entity.Property(e => e.ValStd)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x86;x64</Platforms>
|
||||
<Version>1.2.2303.2814</Version>
|
||||
<Version>1.2.2303.2818</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MAPO-MONO</i>
|
||||
<h4>Version: 1.2.2303.2814</h4>
|
||||
<h4>Version: 1.2.2303.2818</h4>
|
||||
<br /> Release Note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.2.2303.2814
|
||||
1.2.2303.2818
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.2.2303.2814</version>
|
||||
<version>1.2.2303.2818</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Platforms>AnyCPU;x86;x64</Platforms>
|
||||
<Version>1.2.2303.2814</Version>
|
||||
<Version>1.2.2303.2818</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MAPO-MONO</i>
|
||||
<h4>Version: 1.2.2303.2814</h4>
|
||||
<h4>Version: 1.2.2303.2818</h4>
|
||||
<br /> Release Note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.2.2303.2814
|
||||
1.2.2303.2818
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.2.2303.2814</version>
|
||||
<version>1.2.2303.2818</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user