72 lines
2.4 KiB
C#
72 lines
2.4 KiB
C#
using IOB_UT;
|
|
using MapoSDK;
|
|
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Windows.Forms;
|
|
|
|
namespace IOB_WIN
|
|
{
|
|
public class IobFileEurom63 : IobFile
|
|
{
|
|
/// <summary>
|
|
/// Oggetti decodificati da pagina
|
|
/// </summary>
|
|
protected Eurom63.SessionConf currentSessions;
|
|
|
|
/// <summary>
|
|
/// Estende l'init della classe base...
|
|
/// </summary>
|
|
/// <param name="caller"></param>
|
|
/// <param name="adpConf"></param>
|
|
public IobFileEurom63(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
|
|
{
|
|
lgInfo("INIT IobFileEurom63");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ricarica conf adapter...
|
|
/// </summary>
|
|
internal override void reloadAdapterConf()
|
|
{
|
|
// init obj display
|
|
newDisplayData currDispData = new newDisplayData();
|
|
lgInfo("BEGIN reloadAdapterConf");
|
|
// inizializzo LUT decodifica
|
|
string jsonConf = getOptPar("LUT_CONF");
|
|
if (!string.IsNullOrEmpty(jsonConf))
|
|
{
|
|
string jsonFullPath = $"{Application.StartupPath}/DATA/CONF/{jsonConf}";
|
|
lgInfo($"Apertura file {jsonFullPath}");
|
|
StreamReader reader = new StreamReader(jsonFullPath);
|
|
string jsonData = reader.ReadToEnd();
|
|
if (!string.IsNullOrEmpty(jsonData))
|
|
{
|
|
try
|
|
{
|
|
currentSessions = JsonConvert.DeserializeObject<Eurom63.SessionConf>(jsonData);
|
|
|
|
// salvo baseUri
|
|
BaseDir = currentSessions.BaseDir;
|
|
lgInfo($"baseDir = {BaseDir}");
|
|
// imposto a zero la bitmap x riavvio!
|
|
B_input = 0;
|
|
// FORZO invio dati...
|
|
accodaSigIN(ref currDispData);
|
|
// loggo!
|
|
lgInfo($"init input bitmap to zero: {B_input}");
|
|
}
|
|
catch (Exception exc)
|
|
{
|
|
lgError(exc, "Eccezione in decodifica conf json");
|
|
}
|
|
}
|
|
reader.Dispose();
|
|
}
|
|
lgInfo("DONE reloadAdapterConf");
|
|
raiseRefresh(currDispData);
|
|
}
|
|
}
|
|
} |