From 8c2d2014257dc5c0da0a4cdba7d95784501066af Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 24 Jul 2017 15:58:00 +0200 Subject: [PATCH] aggiunto controllo vettore counters x evitare crash in copia array... --- MTC_Adapter/MTC_Adapter/AdapterGeneric.cs | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs b/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs index 4a3e0c2..ce97456 100644 --- a/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs +++ b/MTC_Adapter/MTC_Adapter/AdapterGeneric.cs @@ -3352,7 +3352,7 @@ namespace MTC_Adapter catch { } - if (numero > 0) + if (numero > 0 && istCounters.Length >= numero) { //istCounters[numero - 1] = tabDatiMtz[i]; istCounters[numero - 1].addValue(DateTime.Now, Convert.ToInt32(tabDatiMtz[i])); @@ -3368,7 +3368,7 @@ namespace MTC_Adapter } catch { } - if (numero > 0) + if (numero > 0 && vettPath.Length >= numero) { vettPath[numero - 1].mPathPartCount.Value = tabDatiMtz[i]; } @@ -3384,7 +3384,7 @@ namespace MTC_Adapter } catch { } - if (numero > 0) + if (numero > 0 && istDistMovAssi.Length >= numero) { istDistMovAssi[numero - 1] = tabDatiMtz[i]; } @@ -3397,7 +3397,7 @@ namespace MTC_Adapter } catch { } - if (numero > 0) + if (numero > 0 && istNumInvAssi.Length >= numero) { // 2016.07.06 debug di valori che potrebbero essere nulli... try @@ -3420,7 +3420,7 @@ namespace MTC_Adapter } catch { } - if (numero > 0) + if (numero > 0 && istAccTimeAssi.Length >= numero) { // 2016.07.06 debug di valori che potrebbero essere nulli... try @@ -3446,7 +3446,7 @@ namespace MTC_Adapter } catch { } - if (numero > 0) + if (numero > 0 && istGiriElettrom.Length >= numero) { istGiriElettrom[numero - 1] = tabDatiMtz[i]; } @@ -3459,7 +3459,7 @@ namespace MTC_Adapter } catch { } - if (numero > 0) + if (numero > 0 && istNumCambiUt.Length >= numero) { istNumCambiUt[numero - 1] = tabDatiMtz[i]; } @@ -3475,7 +3475,7 @@ namespace MTC_Adapter } catch { } - if (numero > 0) + if (numero > 0 && istVacPumpWrkTime.Length >= numero) { istVacPumpWrkTime[numero - 1] = tabDatiMtz[i]; } @@ -3491,7 +3491,7 @@ namespace MTC_Adapter } catch { } - if (numero > 0) + if (numero > 0 && istVacActCount.Length >= numero) { istVacActCount[numero - 1] = tabDatiMtz[i]; } @@ -3507,7 +3507,7 @@ namespace MTC_Adapter } catch { } - if (numero > 0) + if (numero > 0 && istLubroCount.Length >= numero) { istLubroCount[numero - 1] = tabDatiMtz[i]; } @@ -3523,7 +3523,7 @@ namespace MTC_Adapter } catch { } - if (numero > 0) + if (numero > 0 && istSlittaMag.Length >= numero) { istSlittaMag[numero - 1] = tabDatiMtz[i]; } @@ -3539,7 +3539,7 @@ namespace MTC_Adapter } catch { } - if (numero > 0) + if (numero > 0 && istProtMag.Length >= numero) { istProtMag[numero - 1] = tabDatiMtz[i]; }