Files
Mapo-IOB-WIN/IOB-WIN-OPC-UA/AdapterFormNext.cs
T
2025-01-09 08:54:12 +01:00

143 lines
5.1 KiB
C#

using IOB_UT_NEXT;
using IOB_WIN_OPC_UA.Iob;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_WIN_OPC_UA
{
public class AdapterFormNext: IOB_WIN_FORM.AdapterForm
{
/// <summary>
/// Avvio MainForm
/// </summary>
/// <param name="codIOB"></param>
public AdapterFormNext(string codIOB): base(codIOB)
{
}
/// <summary>
/// carica IOB richiesto
/// </summary>
protected override void loadIobType()
{
if (IOBConf != null)
{
switch (tipoScelto)
{
case tipoAdapter.OpcUa:
iobObj = new IobOpc.OpcUa(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaCMS:
case tipoAdapter.OpcUaSCM:
iobObj = new IobOpc.OpcUaCMS(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaEwon:
iobObj = new IobOpc.OpcUaEwon(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaEwonAdige:
iobObj = new IobOpc.OpcUaEwonAdige(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaEwonBLM:
iobObj = new IobOpc.OpcUaEwonBLM(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaEwonMonti:
iobObj = new IobOpc.OpcUaEwonMonti(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaEwonMecolpress:
iobObj = new IobOpc.OpcUaEwonMecolpress(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaKwp:
iobObj = new IobOpc.OpcUaKpw(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaKwpRama:
iobObj = new IobOpc.OpcUaKpwRama(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaImasAeromec:
iobObj = new IobOpc.OpcUaImas(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaMBH:
iobObj = new IobOpc.OpcUaMBH(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaMBHCimolai:
iobObj = new IobOpc.OpcUaMBHCimolai(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaOmron:
iobObj = new IobOpc.OpcUaOmron(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaOmronIcoel:
iobObj = new IobOpc.OpcUaOmronIcoel(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaSiemens:
iobObj = new IobOpc.OpcUaSiemens(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaSiemensOMP:
iobObj = new IobOpc.OpcUaSiemensOMP(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaSiemensRama:
iobObj = new IobOpc.OpcUaSiemensRama(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.OpcUaUlma:
iobObj = new IobOpc.OpcUaUlma(this, IOBConf);
btnStart.Enabled = true;
break;
case tipoAdapter.SIMULA:
case tipoAdapter.ND:
default:
iobObj = new IOB_WIN_FORM.Iob.Simula(this, IOBConf);
btnStart.Enabled = false;
break;
}
lblCncText = $"CNC: {IOBConf.tipoIob} [{IOBConf.cncIpAddr}:{IOBConf.cncPort}]";
lblSrvUrlText = $"SRV: {IOBConf.serverData.MPIP} | URL: {IOBConf.serverData.MPURL}{IOBConf.serverData.CMDBASE}";
// aggancio evento refresh
iobObj.eh_refreshed += IobObj_eh_refreshed;
// carico i default values su interfaccia
setDefaults();
displayTaskAndLog($"Caricata conf per adapter {tipoScelto}");
}
}
}
}