DynData condizionale... e inzio a leggere semafori...

This commit is contained in:
Samuele E. Locatelli
2018-01-29 18:51:39 +01:00
parent 949fdb13a5
commit 53d63d3723
4 changed files with 43 additions and 52 deletions
+2 -1
View File
@@ -9,7 +9,8 @@
<add key="enableTest" value="true" />
<add key="enableContapezzi" value="true" />
<add key="enableMode" value="true" />
<add key="enableOverrides" value="true" />
<add key="enableOverrides" value="true" />
<add key="enableDynData" value="true" />
<add key="doMemDump" value="false" />
<add key="doSampleMemory" value="false" />
<add key="basePrgMemPath" value="CNCMEMUSER" />
+22 -19
View File
@@ -1512,27 +1512,30 @@ namespace IOB_WIN
/// </summary>
public void processDynData()
{
Dictionary<string, string> currDynData = new Dictionary<string, string>();
if (!DemoIn)
if (utils.CRB("enableDynData"))
{
currDynData = getDynData();
}
else
{
currDynData.Add("DYNDATA", string.Format("D-{0:HHmm}", DateTime.Now));
}
// verifico SE sia cambiato il programma...
if (lastDynData != currDynData["DYNDATA"])
{
// salvo!
lastDynData = currDynData["DYNDATA"];
// per ogni valore del dizionario mostro ed accodo!
string sVal = "";
foreach (var item in currDynData)
Dictionary<string, string> currDynData = new Dictionary<string, string>();
if (!DemoIn)
{
sVal = string.Format("[DYNDATA]{0}|{1}", item.Key, item.Value);
// chiamo accodamento...
accodaFLog(sVal, qEncodeFLog(item.Key, item.Value));
currDynData = getDynData();
}
else
{
currDynData.Add("DYNDATA", string.Format("D-{0:HHmm}", DateTime.Now));
}
// verifico SE sia cambiato il programma...
if (lastDynData != currDynData["DYNDATA"])
{
// salvo!
lastDynData = currDynData["DYNDATA"];
// per ogni valore del dizionario mostro ed accodo!
string sVal = "";
foreach (var item in currDynData)
{
sVal = string.Format("[DYNDATA]{0}|{1}", item.Key, item.Value);
// chiamo accodamento...
accodaFLog(sVal, qEncodeFLog(item.Key, item.Value));
}
}
}
}
+18 -31
View File
@@ -431,27 +431,7 @@ namespace IOB_WIN
byte[] MemBlock = new byte[parametri.memSizeRead];
bool fatto = S7ReadBB(ref MemBlock);
Buffer.BlockCopy(MemBlock, 0, RawInput, 0, parametri.memSizeRead);
#if false
// Red: Y8.4 | Yellow: Y8.5 | Green Y8.6 | WrkZone Y8.7 | All DoorsClosed: Y10.5
int memIndex = 8;
inizio = DateTime.Now;
FanucMemRW(R, FANUC.MemType.Y, memIndex, ref MemBlock);
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-Y", MemBlock.Length), DateTime.Now.Subtract(inizio).Ticks);
// riporto!
Buffer.BlockCopy(MemBlock, 0, RawInput, 0, 4);
// ora mi leggo 2 byte in area X... HARD CODED, rendere parametrico...
MemBlock = new byte[2];
// GESTIONE memoria endcycle
// la variabile X7.0 (da 1 a 0) oppure la X7.1 (da 0 a 1) indica il CONTAPEZZI --> copio 2 byte!
inizio = DateTime.Now;
FanucMemRW(R, FANUC.MemType.X, 6, ref MemBlock);
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-X", MemBlockF.Length), DateTime.Now.Subtract(inizio).Ticks);
// riporto!
Buffer.BlockCopy(MemBlock, 0, RawInput, 4, 2);
if (verboseLog) lg.Info(string.Format("RawInput: {0}", utils.binaryForm((int)RawInput[0])));
#endif
// salvo il solo BYTE dell'input decifrando il semaforo...
decodeToBitmap();
}
@@ -462,33 +442,40 @@ namespace IOB_WIN
{
// init a zero...
B_input = 0;
#if false
// temporaneamente decodifico HARD CODED... poi implementerò da MemMap...
// !!!FARE!!! generalizzazione... x ora usa dati "hard coded"...
//Red: Y8.4 | Yellow: Y8.5 | Green Y8.6
// leggo i byte interessati...
int byteSem = RawInput[0];
#if false
int byteCount = RawInput[5];
if (verboseLog) lg.Info(string.Format("PrimoByte: {0}", byteSem));
#endif
B_input = byteSem;
#if false
if (utils.CRB("macOnFromConn"))
{
// SE SI E' CONNESSO al FANUC allora è 1...
if (FANUC_ref.Connected)
if (currPLC.IsConnected)
{
B_input += 1 << 0;
}
}
else
{
// B0: facio un OR tra i 3 semafori...
if ((byteSem & 112) > 0)
// B0.0: powerOn
if ((byteSem & 1) > 0)
{
B_input += 1 << 0;
}
}
// B1: verde! Y8.6
if ((byteSem & 64) > 0)
// Verde: B0.1
if ((byteSem & 2) > 0)
{
B_input += 1 << 1;
}
@@ -496,9 +483,9 @@ namespace IOB_WIN
if ((byteCount & 2) > 0)
{
B_input += 1 << 2;
}
// B3: Rosso! Y8.4
if ((byteSem & 16) > 0)
}
// Rosso: B0.3
if ((byteSem & 8) > 0)
{
B_input += 1 << 3;
}
@@ -507,9 +494,9 @@ namespace IOB_WIN
{
B_input += 1 << 4;
}
#endif
// log opzionale!
if (verboseLog) lg.Info(string.Format("Trasformazione B_input: {0}", B_input));
#endif
}
/// <summary>
/// Recupero programma in lavorazione
Vendored
+1 -1
View File
@@ -14,7 +14,7 @@ pipeline {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=203']) {
withEnv(['NEXT_BUILD_NUMBER=204']) {
// env.versionNumber = VersionNumber(versionNumberString : '1.17.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '1.17.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'MAPO-IOB-WIN'