modificata catena recupero dati in upsertKey e saveMemBlock
This commit is contained in:
+20
-18
@@ -113,16 +113,16 @@ namespace IOB_WIN
|
||||
/// Salvo in memblock il valore Int indicato con formattazione siemens
|
||||
/// </summary>
|
||||
/// <param name="MemBlock">Blocco memoria come byte[] dove scrivere</param>
|
||||
/// <param name="currValue">Valore da scrivere</param>
|
||||
/// <param name="stringKey">Nome del parametro da recuperare da prodData x scrivere</param>
|
||||
/// <param name="startPos">Posizione inizio scrittura</param>
|
||||
public void saveIntOnMemBlock(ref byte[] MemBlock, string currValue, int startPos)
|
||||
public void saveIntOnMemBlock(ref byte[] MemBlock, string stringKey, int startPos)
|
||||
{
|
||||
if (currProdData.ContainsKey(currValue))
|
||||
if (currProdData.ContainsKey(stringKey))
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] stringPar = new byte[2];
|
||||
string valore = currProdData[currValue];
|
||||
string valore = currProdData[stringKey];
|
||||
short valInt = 0;
|
||||
short.TryParse(valore, out valInt);
|
||||
byte[] strByte = S7.Net.Types.Int.ToByteArray(valInt);
|
||||
@@ -132,7 +132,7 @@ namespace IOB_WIN
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lgError($"Errore in gestione scrittura {currValue}{Environment.NewLine}{exc}");
|
||||
lgError($"Errore in gestione scrittura {stringKey}{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,16 +140,16 @@ namespace IOB_WIN
|
||||
/// Salvo in memblock il valore DInt indicato con formattazione siemens
|
||||
/// </summary>
|
||||
/// <param name="MemBlock">Blocco memoria come byte[] dove scrivere</param>
|
||||
/// <param name="currValue">Valore da scrivere</param>
|
||||
/// <param name="stringKey">Valore da scrivere</param>
|
||||
/// <param name="startPos">Posizione inizio scrittura</param>
|
||||
public void saveDIntOnMemBlock(ref byte[] MemBlock, string currValue, int startPos)
|
||||
public void saveDIntOnMemBlock(ref byte[] MemBlock, string stringKey, int startPos)
|
||||
{
|
||||
if (currProdData.ContainsKey(currValue))
|
||||
if (currProdData.ContainsKey(stringKey))
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] stringPar = new byte[4];
|
||||
string valore = currProdData[currValue];
|
||||
string valore = currProdData[stringKey];
|
||||
int valInt = 0;
|
||||
int.TryParse(valore, out valInt);
|
||||
byte[] strByte = S7.Net.Types.DInt.ToByteArray(valInt);
|
||||
@@ -159,7 +159,7 @@ namespace IOB_WIN
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lgError($"Errore in gestione scrittura {currValue}{Environment.NewLine}{exc}");
|
||||
lgError($"Errore in gestione scrittura {stringKey}{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,16 +167,16 @@ namespace IOB_WIN
|
||||
/// Salvo in memblock il valore stringa indicato con formattazione siemens
|
||||
/// </summary>
|
||||
/// <param name="MemBlock">Blocco memoria come byte[] dove scrivere</param>
|
||||
/// <param name="stringValue">Valore scrivere</param>
|
||||
/// <param name="stringKey">Valore scrivere</param>
|
||||
/// <param name="startPos">Posizione inizio scrittura</param>
|
||||
public void saveRealOnMemBlock(ref byte[] MemBlock, string stringValue, int startPos)
|
||||
public void saveRealOnMemBlock(ref byte[] MemBlock, string stringKey, int startPos)
|
||||
{
|
||||
if (currProdData.ContainsKey(stringValue))
|
||||
if (currProdData.ContainsKey(stringKey))
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] stringPar = new byte[2];
|
||||
string valore = currProdData[stringValue];
|
||||
string valore = currProdData[stringKey];
|
||||
double valReal = 0;
|
||||
double.TryParse(valore, out valReal);
|
||||
byte[] strByte = S7.Net.Types.Double.ToByteArray(valReal);
|
||||
@@ -186,7 +186,7 @@ namespace IOB_WIN
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lgError($"Errore in gestione scrittura {stringValue}{Environment.NewLine}{exc}");
|
||||
lgError($"Errore in gestione scrittura {stringKey}{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1051,6 +1051,7 @@ namespace IOB_WIN
|
||||
byte[] MemBlock = new byte[1];
|
||||
string memAddrWrite = "";
|
||||
bool fatto = false;
|
||||
string serObj = "";
|
||||
if (updatedPar != null)
|
||||
{
|
||||
// controllo i parametri... ne gestisco 4...
|
||||
@@ -1062,14 +1063,15 @@ namespace IOB_WIN
|
||||
// cerco in area memMapWrite...
|
||||
if (memMap.mMapWrite.ContainsKey(item.uid))
|
||||
{
|
||||
// faccio preliminarmente upsertKey...
|
||||
upsertKey(item.uid, item.reqValue);
|
||||
lgInfo($"Inizio processing plcWriteParams per {item.uid} | valore richiesto {item.reqValue}");
|
||||
// recupero!
|
||||
currMem = memMap.mMapWrite[item.uid];
|
||||
byteSize = currMem.size;
|
||||
memAddrWrite = currMem.memAddr;
|
||||
MemBlock = new byte[byteSize];
|
||||
// faccio preliminarmente upsertKey...
|
||||
upsertKey(currMem.name, currMem.value);
|
||||
serObj = JsonConvert.SerializeObject(item);
|
||||
lgInfo($"Inizio processing plcWriteParams per {currMem.name} | valore richiesto {currMem.value}{Environment.NewLine}{serObj}");
|
||||
switch (currMem.tipoMem)
|
||||
{
|
||||
case plcDataType.Boolean:
|
||||
|
||||
Vendored
+1
-1
@@ -16,7 +16,7 @@ pipeline {
|
||||
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=517']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=518']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '2.4.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '2.4.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'MAPO-IOB-WIN'
|
||||
|
||||
Reference in New Issue
Block a user