fix gestione override che dava errori (ora sono OK)

This commit is contained in:
Samuele E. Locatelli
2018-11-22 21:06:06 +01:00
parent 91d7477856
commit 08ae599540
2 changed files with 16 additions and 18 deletions
+1 -2
View File
@@ -1937,8 +1937,7 @@ namespace IOB_WIN
{
Dictionary<string, string> currOverride = new Dictionary<string, string>();
if (!DemoIn)
{
{
if (connectionOk)
{
currOverride = getOverrides();
+15 -16
View File
@@ -48,6 +48,10 @@ namespace IOB_WIN
/// LookUpTable di decodifica da CNC a segnali tipo bitmap MAPO
/// </summary>
Dictionary<string, string> signLUT = new Dictionary<string, string>();
/// <summary>
/// Struttura dati principale in continuo update...
/// </summary>
protected Cndex.GETINFO1DATA oData;
/// <summary>
/// wrapper chiamata lettura/scrittura OSAI x BYTE...
@@ -241,9 +245,9 @@ namespace IOB_WIN
// inizializzo correttamente aree memoria secondo CONF - iniFileName
IniFile fIni = new IniFile(IOBConf.iniFileName);
// inizializzo aree di memoria correnti...
// fix enable prgName
enablePrgName = fIni.ReadBoolean("CNC", "GETPRGNAME", true);
@@ -281,7 +285,7 @@ namespace IOB_WIN
if (utils.CRB("verbose"))
{
lgInfo(string.Format("INIT OSAI_ref da CncLib come {0}",IOBConf.tipoIob));
lgInfo(string.Format("INIT OSAI_ref da CncLib come {0}", IOBConf.tipoIob));
}
// disconnetto e connetto...
@@ -301,7 +305,7 @@ namespace IOB_WIN
lgInfo(string.Format("Lettura preliminare: machineStatus={0} | modeSelected={1}", machineStatus, modeSelected));
// possiamo leggere tutto da qui che contiene status, mode e last_nc_error
Cndex.GETINFO1DATA oData = new Cndex.GETINFO1DATA();
oData = new Cndex.GETINFO1DATA();
var ncInfo = OSAI_ref.NcInfo1(ref oData);
// esempio dati
var lastNcError = oData.last_nc_error;
@@ -312,7 +316,7 @@ namespace IOB_WIN
var speedPrg = oData.progr_speed;
var speedReal = oData.real_speed;
var modeSel = oData.real_feed;
lgInfo(string.Format("Lettura START completa NCINFO1DATA{0} lastNcError={1}{0}status={2}{0}substatus={9}{0}mode_select={3}{0}main_progr_name={4}{0}speed_ov={5}{0}progr_speed={6}{0}real_speed={7}{0}real_feed={8}{0}", Environment.NewLine, oData.last_nc_error, oData.status, oData.mode_select, oData.main_progr_name, oData.speed_ov, oData.progr_speed, oData.real_speed, oData.real_feed, oData.substatus));
@@ -484,7 +488,7 @@ namespace IOB_WIN
try
{
// ora provo connessione...
parentForm.commPlcActive = true;
parentForm.commPlcActive = true;
OSAI_ref.OpenSession();
parentForm.commPlcActive = false;
@@ -536,7 +540,7 @@ namespace IOB_WIN
processMemoryDiscon();
}
}
/// <summary>
/// lettura principale (bit semafori)
/// </summary>
@@ -553,9 +557,9 @@ namespace IOB_WIN
parentForm.sIN = Semaforo.SV;
// possiamo leggere tutto da qui che contiene status, mode e last_nc_error
Cndex.GETINFO1DATA oData = new Cndex.GETINFO1DATA();
//oData = new Cndex.GETINFO1DATA();
var ncInfo = OSAI_ref.NcInfo1(ref oData);
lgInfo(string.Format("Lettura completa NCINFO1DATA{0} lastNcError={1}{0}status={2}{0}substatus={9}{0}mode_select={3}{0}main_progr_name={4}{0}speed_ov={5}{0}progr_speed={6}{0}real_speed={7}{0}real_feed={8}{0}", Environment.NewLine, oData.last_nc_error, oData.status, oData.mode_select, oData.main_progr_name, oData.speed_ov, oData.progr_speed, oData.real_speed, oData.real_feed, oData.substatus));
@@ -1124,13 +1128,8 @@ namespace IOB_WIN
public override Dictionary<string, string> getOverrides()
{
Dictionary<string, string> outVal = new Dictionary<string, string>();
#if false
if (utils.CRB("enableMode") && MemBlockG != null)
{
outVal.Add("FEED_OVER", MemBlockG[30].ToString());
outVal.Add("RAPID_OVER", MemBlockG[12].ToString());
}
#endif
outVal.Add("FEED_OVER", (oData.feed_ov).ToString());
outVal.Add("RAPID_OVER", (oData.rapid_override).ToString());
return outVal;
}