Fix async methods
This commit is contained in:
@@ -1836,6 +1836,27 @@ namespace MP.Data.Controllers
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
/// <summary>
|
||||
/// Vista v_MSFD delle machine MULTI filtrato x macchina (da stored)
|
||||
/// </summary>
|
||||
/// <param name="idxMacc"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<VMSFDModel>> VMSFDGetMultiByMaccAsync(string idxMacc)
|
||||
{
|
||||
List<VMSFDModel> dbResult = new List<VMSFDModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
var IdxMacchina = new SqlParameter("@IdxMacchina", idxMacc);
|
||||
|
||||
dbResult = await dbCtx
|
||||
.DbSetMSFD
|
||||
.FromSqlRaw("exec dbo.stp_MSFD_getMulti @IdxMacchina", IdxMacchina)
|
||||
.AsNoTracking()
|
||||
//.AsEnumerable()
|
||||
.ToListAsync();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
|
||||
@@ -819,7 +819,7 @@ namespace MP.IOC.Data
|
||||
addTask4Machine(idxMacchina, taskType.setArt, setArtVal);
|
||||
addTask4Machine(idxMacchina, taskType.setComm, setCommVal);
|
||||
addTask4Machine(idxMacchina, taskType.setPzComm, setPzCommVal);
|
||||
|
||||
|
||||
updateMachineParameter(idxMacchina, "setArt", setArtVal);
|
||||
updateMachineParameter(idxMacchina, "setComm", setCommVal);
|
||||
updateMachineParameter(idxMacchina, "setPzComm", setPzCommVal);
|
||||
@@ -869,15 +869,14 @@ namespace MP.IOC.Data
|
||||
updDict.Add(taskType.setComm, setCommVal);
|
||||
updDict.Add(taskType.setPzComm, setPzCommVal);
|
||||
|
||||
|
||||
#if false
|
||||
addTask4Machine(machine.IdxMacchinaSlave, taskType.fixStopSetup, outData);
|
||||
addTask4Machine(machine.IdxMacchinaSlave, taskType.forceResetPzCount, outData);
|
||||
addTask4Machine(machine.IdxMacchinaSlave, taskType.forceResetPzCount, outData);
|
||||
// invio task caricamento dati ODL
|
||||
addTask4Machine(machine.IdxMacchinaSlave, taskType.setArt, setArtVal);
|
||||
addTask4Machine(machine.IdxMacchinaSlave, taskType.setComm, setCommVal);
|
||||
addTask4Machine(machine.IdxMacchinaSlave, taskType.setPzComm, setPzCommVal);
|
||||
|
||||
|
||||
updateMachineParameter(machine.IdxMacchinaSlave, "setArt", setArtVal);
|
||||
updateMachineParameter(machine.IdxMacchinaSlave, "setComm", setCommVal);
|
||||
updateMachineParameter(machine.IdxMacchinaSlave, "setPzComm", setPzCommVal);
|
||||
@@ -914,7 +913,6 @@ namespace MP.IOC.Data
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
public string CalcRecipe(RecipeModel currRecipe)
|
||||
{
|
||||
return mongoController.CalcRecipe(currRecipe);
|
||||
@@ -2418,7 +2416,7 @@ namespace MP.IOC.Data
|
||||
try
|
||||
{
|
||||
var currHash = Utils.RedKeyMsmi(idxMacchina);
|
||||
answ = await RedisGetHashDictAsync(currHash);
|
||||
answ = await RedisGetHashAsync(currHash);
|
||||
if (answ == null || answ.Length == 0)
|
||||
{
|
||||
answ = await resetMSMIAsync(idxMacchina);
|
||||
@@ -2452,6 +2450,7 @@ namespace MP.IOC.Data
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restitusice elenco KVP dei TASK (da passare a IOB-WIN) per l'impianto indicato
|
||||
/// </summary>
|
||||
@@ -3501,7 +3500,7 @@ namespace MP.IOC.Data
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<KeyValuePair<string, string>[]> RedisGetHashAsync(string redKey)
|
||||
public async Task<KeyValuePair<string, string>[]> RedisGetHashAsync(RedisKey redKey)
|
||||
{
|
||||
HashEntry[] rawData = await redisDb.HashGetAllAsync(redKey);
|
||||
var result = rawData.Where(x => !x.Name.IsNull).Select(x => new KeyValuePair<string, string>($"{x.Name}", $"{x.Value}")).ToArray();
|
||||
@@ -3615,6 +3614,17 @@ namespace MP.IOC.Data
|
||||
return answ;
|
||||
}
|
||||
|
||||
public async Task<bool> RedisSetHashAsync(RedisKey redKey, KeyValuePair<string, string>[] valori, double expireSeconds = -1.0)
|
||||
{
|
||||
bool answ = false;
|
||||
answ = await RedisSetHashAsync(redKey, valori);
|
||||
if (expireSeconds > 0.0)
|
||||
{
|
||||
await redisDb.KeyExpireAsync(redKey, DateTime.Now.AddSeconds(expireSeconds));
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public bool RedisSetHashDict(RedisKey redKey, Dictionary<string, string> valori, double expireSeconds = -1.0)
|
||||
{
|
||||
bool answ = false;
|
||||
@@ -4824,7 +4834,7 @@ namespace MP.IOC.Data
|
||||
int.TryParse(mDatiMacchinaVal(idxMacchina, "BSR"), out BSR);
|
||||
Boolean.TryParse(mDatiMacchinaVal(idxMacchina, "ExplodeBit"), out ExplodeBit);
|
||||
int.TryParse(mDatiMacchinaVal(idxMacchina, "NumBit"), out NumBit); // non usato (x ora)
|
||||
// recupero valore
|
||||
// recupero valore
|
||||
valINT = int.Parse(valore, NumberStyles.HexNumber);
|
||||
// filtro
|
||||
newValInt = MP.Core.Utils.bMaskInt(valINT, BitFilt);
|
||||
@@ -4873,7 +4883,7 @@ namespace MP.IOC.Data
|
||||
int.TryParse(datiMacc.ContainsKey("BSR") ? datiMacc["BSR"] : "0", out BSR);
|
||||
Boolean.TryParse(datiMacc.ContainsKey("ExplodeBit") ? datiMacc["ExplodeBit"] : "false", out ExplodeBit);
|
||||
int.TryParse(datiMacc.ContainsKey("NumBit") ? datiMacc["NumBit"] : "0", out NumBit); // non usato (x ora)
|
||||
// recupero valore
|
||||
// recupero valore
|
||||
valINT = int.Parse(valore, NumberStyles.HexNumber);
|
||||
// filtro
|
||||
newValInt = MP.Core.Utils.bMaskInt(valINT, BitFilt);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>6.16.2604.1709</Version>
|
||||
<Version>6.16.2604.1718</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MP-IOC </i>
|
||||
<h4>Versione: 6.16.2604.1709</h4>
|
||||
<h4>Versione: 6.16.2604.1718</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2604.1709
|
||||
6.16.2604.1718
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2604.1709</version>
|
||||
<version>6.16.2604.1718</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/MP.IOC.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-IOC/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user