Merge branch 'release/AddProxyShelly_03'
This commit is contained in:
+86
-1
@@ -165,6 +165,19 @@ stages:
|
||||
# --------------------------------
|
||||
# BUILD
|
||||
# --------------------------------
|
||||
EgwConf.Iob:build:
|
||||
stage: build
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: EgwConf.Iob
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=Release /p:Platform="x86" /p:OutputPath=bin/ /nodeReuse:false /verbosity:minimal /m'
|
||||
|
||||
EgwProxy.Ftp:build:
|
||||
stage: build
|
||||
tags:
|
||||
@@ -256,10 +269,37 @@ EgwProxy.SqlDb:build:
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=Release /p:Platform="x86" /p:OutputPath=bin/ /nodeReuse:false /verbosity:minimal /m'
|
||||
|
||||
|
||||
# --------------------------------
|
||||
# STAGING: (nuget beta)
|
||||
# --------------------------------
|
||||
EgwConf.Iob:staging:
|
||||
stage: staging
|
||||
needs: ["EgwConf.Iob:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
CONFIG: Debug
|
||||
APP_NAME: EgwConf.Iob
|
||||
# rules:
|
||||
# - if: $CI_COMMIT_BRANCH == 'develop'
|
||||
# changes:
|
||||
# - EgwConf.Iob/*
|
||||
# when: always
|
||||
# - if: $CI_COMMIT_BRANCH == 'SDK/Conf'
|
||||
# changes:
|
||||
# - EgwConf.Iob/*
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
- *nuspec-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="Any CPU" /p:OutputPath=bin/$env:CONFIG /verbosity:minimal /m'
|
||||
- '& Remove-Item *.nupkg'
|
||||
- '& $env:NUGET_PATH pack "$env:APP_NAME.Debug.nuspec"'
|
||||
- '& "$env:NUGET_PATH" setapikey $NUGET_API_KEY -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_DEB.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
EgwProxy.Ftp:staging:
|
||||
stage: staging
|
||||
needs: ["EgwProxy.Ftp:build"]
|
||||
@@ -459,6 +499,31 @@ EgwProxy.SqlDb:staging:
|
||||
# --------------------------------
|
||||
# RELEASE
|
||||
# --------------------------------
|
||||
EgwConf.Iob:build:release:
|
||||
stage: release
|
||||
needs: ["EgwConf.Iob:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
CONFIG: Release
|
||||
APP_NAME: EgwConf.Iob
|
||||
# rules:
|
||||
# - if: $CI_COMMIT_BRANCH == 'main'
|
||||
# changes:
|
||||
# - EgwConf.Iob/*
|
||||
# when: always
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
- *version-fix
|
||||
- *nuspec-fix
|
||||
script:
|
||||
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.csproj" -target:Build /p:Configuration=$env:CONFIG /p:Platform="Any CPU" /p:OutputPath=bin/$env:CONFIG /verbosity:minimal /m'
|
||||
- '& Remove-Item *.nupkg'
|
||||
- '& $env:NUGET_PATH pack "$env:APP_NAME.Release.nuspec"'
|
||||
- '& "$env:NUGET_PATH" setapikey $NUGET_API_KEY -source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
- '& "$env:NUGET_PATH" push *$env:NUM_REL.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted'
|
||||
|
||||
EgwProxy.Ftp:build:release:
|
||||
stage: release
|
||||
needs: ["EgwProxy.Ftp:build"]
|
||||
@@ -635,6 +700,26 @@ EgwProxy.SqlDb:build:release:
|
||||
# --------------------------------
|
||||
# DocFx
|
||||
# --------------------------------
|
||||
EgwConf.Iob:docfx:
|
||||
stage: docfx
|
||||
needs: ["EgwConf.Iob:build"]
|
||||
tags:
|
||||
- win
|
||||
variables:
|
||||
APP_NAME: EgwConf.Iob
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == 'main'
|
||||
changes:
|
||||
- EgwConf.Iob/*
|
||||
when: always
|
||||
before_script:
|
||||
- *nuget-fix
|
||||
- '& "$env:NUGET_PATH" restore "$env:APP_NAME.sln" -verbosity quiet'
|
||||
script:
|
||||
- docfx $env:APP_NAME/docfx.json
|
||||
- mv $env:APP_NAME/_site "docfx"
|
||||
- *DocReplica
|
||||
|
||||
EgwProxy.Ftp:docfx:
|
||||
stage: docfx
|
||||
needs: ["EgwProxy.Ftp:build"]
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>EgwConf.Iob</id>
|
||||
<version>#version#</version>
|
||||
<title>EgwConf.Iob</title>
|
||||
<authors>Samuele E. Locatelli, EgalWare</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">MIT</license>
|
||||
<description>Libreria per gestione configurazione in modalità *.ini (legacy) o *.yaml (nuova) dei singoli IOB-WIN-NEXT - beta/unstable</description>
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwConf.Iob EgwConf Iob</tags>
|
||||
<dependencies>
|
||||
<dependency id="Newtonsoft.Json" version="13.0.3" />
|
||||
<dependency id="NLog" version="5.3.4" />
|
||||
<dependency id="YamlDotNet" version="16.3.0" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwConf.Iob\bin\Debug\EgwConf*.dll" target="lib" />
|
||||
<file src="EgwConf.Iob\bin\Debug\EgwConf*.config" target="lib" />
|
||||
<file src="EgwConf.Iob\bin\Debug\EgwConf*.pdb" target="lib" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>EgwConf.Iob</id>
|
||||
<version>#version#</version>
|
||||
<title>EgwConf.Iob</title>
|
||||
<authors>Samuele E. Locatelli, EgalWare</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<license type="expression">MIT</license>
|
||||
<description>Libreria per gestione configurazione in modalità *.ini (legacy) o *.yaml (nuova) dei singoli IOB-WIN-NEXT</description>
|
||||
<releaseNotes>#releaseNotes#</releaseNotes>
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwConf.Iob EgwConf Iob</tags>
|
||||
<dependencies>
|
||||
<dependency id="Newtonsoft.Json" version="13.0.3" />
|
||||
<dependency id="NLog" version="5.3.4" />
|
||||
<dependency id="YamlDotNet" version="16.3.0" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="EgwConf.Iob\bin\Release\EgwConf*.dll" target="lib" />
|
||||
<file src="EgwConf.Iob\bin\Release\EgwConf*.config" target="lib" />
|
||||
</files>
|
||||
</package>
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.12.35527.113
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwConf.Iob", "EgwConf.Iob\EgwConf.Iob.csproj", "{26CD6258-206B-4FB4-B9FB-1C573C930919}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{26CD6258-206B-4FB4-B9FB-1C573C930919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{26CD6258-206B-4FB4-B9FB-1C573C930919}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{26CD6258-206B-4FB4-B9FB-1C573C930919}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{26CD6258-206B-4FB4-B9FB-1C573C930919}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E2472E21-58D3-4EAD-BC4A-BC3915B18BEF}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,85 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace EgwConf.Iob.Base
|
||||
{
|
||||
/// <summary>
|
||||
/// Set comandi URI x chiamate server
|
||||
/// </summary>
|
||||
public class CmdUriDto
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Init classe gestione comandi
|
||||
/// </summary>
|
||||
/// <param name="baseURI"></param>
|
||||
public CmdUriDto(string baseURI)
|
||||
{
|
||||
BaseUri = baseURI;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// comando base x USER LOG - salvataggio parametri extra sistema MAPO
|
||||
/// </summary>
|
||||
public string ULog { get; set; } = "IOB/ulog/";
|
||||
|
||||
/// <summary>
|
||||
/// comando base x USER LOG - salvataggio parametri extra sistema MAPO in modalità JSON
|
||||
/// payload come lista
|
||||
/// </summary>
|
||||
public string ULogJson { get; set; } = "IOB/ulogJson/";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Recupera path/URI comando richiesto (SE disponibile) senno default
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public string GetCommand(string key)
|
||||
{
|
||||
// default ad implicito...
|
||||
string answ = $"{BaseUri}/{key}/";
|
||||
if (CurrSetup.ContainsKey(key))
|
||||
{
|
||||
answ = CurrSetup[key];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public Dictionary<string, string> StdCommands()
|
||||
{
|
||||
CurrSetup = new Dictionary<string, string>();
|
||||
CurrSetup.Add("Alive", "IOB");
|
||||
CurrSetup.Add("Base", "IOB/input/");
|
||||
CurrSetup.Add("BaseJson", "IOB/evListJson/");
|
||||
CurrSetup.Add("RawTransfJson", "IOB/rawTransfJson/");
|
||||
CurrSetup.Add("Enabled", "IOB/enabled/");
|
||||
CurrSetup.Add("Flog", "IOB/flog/");
|
||||
CurrSetup.Add("FlogJson", "IOB/flogJson/");
|
||||
CurrSetup.Add("ForcleSplitOdl", "IOB/forceSplitOdlFull/");
|
||||
CurrSetup.Add("IdleTime", "IOB/getIdlePeriod/");
|
||||
CurrSetup.Add("OdlStarted", "IOB/getCurrOdlStart/");
|
||||
CurrSetup.Add("Reboot", "IOB/sendReboot.aspx?idxMacchina=/");
|
||||
// riordino
|
||||
CurrSetup = CurrSetup.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value);
|
||||
return CurrSetup;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected string BaseUri { get; set; } = "IOB";
|
||||
protected Dictionary<string, string> CurrSetup { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
#endregion Protected Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using EgwConf.Iob.Special;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwConf.Iob.Base
|
||||
{
|
||||
/// <summary>
|
||||
/// Definizione parametri Macchina / CN / PLC
|
||||
/// </summary>
|
||||
public class ConnectParamsDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Indirizzo Ip del CNC Controllato
|
||||
/// </summary>
|
||||
public string IpAddr { get; set; } = "127.0.0.1";
|
||||
|
||||
/// <summary>
|
||||
/// Porta del CNC Controllato
|
||||
/// </summary>
|
||||
public string Port { get; set; } = "0";
|
||||
|
||||
/// <summary>
|
||||
/// Timeout test PING
|
||||
/// </summary>
|
||||
public int pingMsTimeout { get; set; } = 500;
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione specifica Siemens (se applicabile)
|
||||
/// </summary>
|
||||
public SiemensDto SiemensCpu { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwConf.Iob.Base
|
||||
{
|
||||
/// <summary>
|
||||
/// Configurazioni specifiche per segnali ingresso (tipicamente gestione blink)
|
||||
/// </summary>
|
||||
public class InputSignalDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Maschera di filtro blink, INT corrispondente ai BIT da filtrare, ad es
|
||||
/// 11111111 = 255
|
||||
/// 00010110 = 22
|
||||
/// 00000111 = 7
|
||||
/// </summary>
|
||||
public int BlinkFilterMask { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Numero di cicli per cui effettuare il mascheramento dei valori (sul fronte di discesa)
|
||||
/// </summary>
|
||||
public int BlinkMaxCounter { get; set; } = 10;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwConf.Iob.Base
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe setup comunicazione server REDIS per comunicazione con IOB-MAN
|
||||
/// </summary>
|
||||
public class IobManDto
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Minimo delta in sec x considerare variazioni informazioni inviate ad IOB-MAN via redis
|
||||
/// </summary>
|
||||
public int MinDeltaSec { get; set; } = 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwConf.Iob.Base
|
||||
{
|
||||
public class ServerMapoDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Indica il metodo di trasporto http/https
|
||||
/// </summary>
|
||||
public string Transport { get; set; } = "http";
|
||||
|
||||
/// <summary>
|
||||
/// Indirizzo IP server
|
||||
/// </summary>
|
||||
public string IpAddr { get; set; } = "127.0.0.1";
|
||||
|
||||
/// <summary>
|
||||
/// URL Base del server applicativo
|
||||
/// </summary>
|
||||
public string BaseAppUrl { get; set; } = "/MP/IO/";
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario comandi configurati
|
||||
/// </summary>
|
||||
public Dictionary<string, string> Commands { get; set; } = new CmdUriDto("IOB").StdCommands();
|
||||
|
||||
/// <summary>
|
||||
/// Installazione di riferimento
|
||||
/// </summary>
|
||||
public string ClientInstall { get; set; } = "SW";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwConf.Iob.Base
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe gestione parametri legati a gestioen TempoCiclo
|
||||
/// </summary>
|
||||
public class TCDataDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Fattore Lambda (innovazione) per calcolo EWMA valore TCiclo corrente
|
||||
/// </summary>
|
||||
public double Lambda { get; set; } = 0.4;
|
||||
|
||||
/// <summary>
|
||||
/// Fattore massimo ammesso di delay x il TCiclo
|
||||
/// </summary>
|
||||
public double MaxDelayFactor { get; set; } = 1.2;
|
||||
|
||||
/// <summary>
|
||||
/// Incremento massimo pezzi per cui fare calcolo del tempociclo attuale
|
||||
/// </summary>
|
||||
public double MaxIncrPz { get; set; } = 2;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{26CD6258-206B-4FB4-B9FB-1C573C930919}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>EgwConf.Iob</RootNamespace>
|
||||
<AssemblyName>EgwConf.Iob</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MapoSDK, Version=6.14.2411.518, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MapoSDK.6.14.2411.518\lib\MapoSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.5.3.4\lib\net46\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="YamlDotNet, Version=16.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\YamlDotNet.16.3.0\lib\netstandard2.0\YamlDotNet.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Base\InputSignalDto.cs" />
|
||||
<Compile Include="Base\CmdUriDto.cs" />
|
||||
<Compile Include="Base\ConnectParamsDto.cs" />
|
||||
<Compile Include="EnumConf.cs" />
|
||||
<Compile Include="IniFile.cs" />
|
||||
<Compile Include="IobConfTree.cs" />
|
||||
<Compile Include="Mem\plcMemMapExt.cs" />
|
||||
<Compile Include="Mem\ToMapo.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Base\IobManDto.cs" />
|
||||
<Compile Include="Base\ServerMapoDto.cs" />
|
||||
<Compile Include="Special\SiemensDto.cs" />
|
||||
<Compile Include="Base\TCDataDto.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,396 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwConf.Iob
|
||||
{
|
||||
public class EnumConf
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Macro tipologia sistema di comunicazione (macro-adapter)
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ComLayer
|
||||
{
|
||||
ND = 0,
|
||||
Db,
|
||||
Dll,
|
||||
File,
|
||||
ModBus,
|
||||
Network,
|
||||
Serial
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia di adapters ammessi
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum AdapterType
|
||||
{
|
||||
/// <summary>
|
||||
/// Adapter SIMULAZIONE
|
||||
/// </summary>
|
||||
SIMULA,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Beckhoff
|
||||
/// </summary>
|
||||
BECKHOFF,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Beckhoff x CPA (selezionatrici ex Jetco)
|
||||
/// </summary>
|
||||
BECKHOFF_CPA,
|
||||
|
||||
/// <summary>
|
||||
/// adapter FANUC
|
||||
/// </summary>
|
||||
FANUC,
|
||||
|
||||
/// <summary>
|
||||
/// File Based exchange generic adapter
|
||||
/// </summary>
|
||||
FILE_GEN,
|
||||
|
||||
/// <summary>
|
||||
/// File Based exchange Euromap63
|
||||
/// </summary>
|
||||
FILE_EUROM63,
|
||||
|
||||
///// <summary>
|
||||
///// File Based exchange SCM Xylog
|
||||
///// </summary>
|
||||
//FILE_XYLOG,
|
||||
|
||||
/// <summary>
|
||||
/// File Based Log file analisys per Soitaab
|
||||
/// </summary>
|
||||
FILE_SOITAAB,
|
||||
|
||||
/// <summary>
|
||||
/// Gestione sync FTP
|
||||
/// </summary>
|
||||
FTP,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter KAWASAKI e-controller
|
||||
/// </summary>
|
||||
KAWASAKI,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Icoel per DB (barcode, tracciatura, produzione,...)
|
||||
/// </summary>
|
||||
IcoelDb,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Icoel per WS SOAP (sizer)
|
||||
/// </summary>
|
||||
IcoelSoap,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter non specificato
|
||||
/// </summary>
|
||||
ND,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter MITSUBISHI con EZCnc lib
|
||||
/// </summary>
|
||||
MITSUBISHI,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter ModBus TCP generico
|
||||
/// </summary>
|
||||
MODBUS_TCP,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter ModBus TCP versione Cedax (Giacovelli)
|
||||
/// </summary>
|
||||
MODBUS_TCP_CEDAX,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter ModBus TCP versione Centerfrigo (Giacovelli)
|
||||
/// </summary>
|
||||
MODBUS_TCP_CENTERFRIGO,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter modbus (+ file) x FIMAT (Tenditalia)
|
||||
/// </summary>
|
||||
MODBUS_TCP_FIMAT,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter ModBus TCP versione HAM (Pizzaferri)
|
||||
/// </summary>
|
||||
MODBUS_TCP_HAM,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter ModBus TCP versione HELPI (Cererie Finassi)
|
||||
/// </summary>
|
||||
MODBUS_TCP_HELPI,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Modubus TCP versione IMAX Aeromacchine (Jetco)
|
||||
/// </summary>
|
||||
MODBUS_TCP_IMAS_AEROMEC,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Modubus TCP versione Rimor (IMI Remosa)
|
||||
/// </summary>
|
||||
MODBUS_TCP_RIMOR,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Modubus TCP versione Saim (Giacovelli)
|
||||
/// </summary>
|
||||
MODBUS_TCP_SAIM,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter Modubus TCP versione Zetapack (Giacovelli)
|
||||
/// </summary>
|
||||
MODBUS_TCP_ZETAPACK,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter MTConnect
|
||||
/// </summary>
|
||||
MTConnect,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OMRON
|
||||
/// </summary>
|
||||
OMRON,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA
|
||||
/// </summary>
|
||||
OpcUa,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA CMS
|
||||
/// </summary>
|
||||
OpcUaCMS,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA per Ewon
|
||||
/// </summary>
|
||||
OpcUaEwon,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA per Ewon x Adige (BLM) / STIL
|
||||
/// </summary>
|
||||
OpcUaEwonAdige,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA per Ewon x BLM / Mecart
|
||||
/// </summary>
|
||||
OpcUaEwonBLM,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA per Ewon x Monti / Tenditalia
|
||||
/// </summary>
|
||||
OpcUaEwonMonti,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA per Ewon x Mecolpress (BLM) / STIL
|
||||
/// </summary>
|
||||
OpcUaEwonMecolpress,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA per KeepWare
|
||||
/// </summary>
|
||||
OpcUaKwp,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA per KeepWare, UnitechRama
|
||||
/// </summary>
|
||||
OpcUaKwpRama,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA per IMAS Aeromec / Jetco
|
||||
/// </summary>
|
||||
OpcUaImasAeromec,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter MBH (es Cimolai)
|
||||
/// </summary>
|
||||
OpcUaMBH,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter MBH implementazione Cimolai x travel lift
|
||||
/// </summary>
|
||||
OpcUaMBHCimolai,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OMRON (es ICOEL)
|
||||
/// </summary>
|
||||
OpcUaOmron,
|
||||
|
||||
/// <summary>
|
||||
/// Implementaizone OMRON specifica x ICOEL
|
||||
/// </summary>
|
||||
OpcUaOmronIcoel,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA SCM
|
||||
/// </summary>
|
||||
OpcUaSCM,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA Siemens generico
|
||||
/// </summary>
|
||||
OpcUaSiemens,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA Siemens OMP
|
||||
/// </summary>
|
||||
OpcUaSiemensOMP,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA Siemens Rama
|
||||
/// </summary>
|
||||
OpcUaSiemensRama,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OPC-UA Ulma (packaging, Giacovelli)
|
||||
/// </summary>
|
||||
OpcUaUlma,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OSAI CNDEX (Cndex)
|
||||
/// </summary>
|
||||
OSAI_CNDEX,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OSAI OPEN (ws)
|
||||
/// </summary>
|
||||
OSAI_OPEN,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter OSAI VB6
|
||||
/// </summary>
|
||||
OSAI_VB6,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter tipo watchdog via ping (per impianti spenti e non rilevati)
|
||||
/// </summary>
|
||||
PingWatchdog,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter REST (base)
|
||||
/// </summary>
|
||||
REST,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter REST Citizen
|
||||
/// </summary>
|
||||
REST_CITIZEN,
|
||||
|
||||
/// <summary>
|
||||
/// Shelly's Device (tipicamente PM series)
|
||||
/// </summary>
|
||||
Shelly,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS
|
||||
/// </summary>
|
||||
SIEMENS,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione APROCHIM (filtro liquidi rettifiche)
|
||||
/// </summary>
|
||||
SIEMENS_APROCHIM,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione VIPA @2001
|
||||
/// </summary>
|
||||
SIEMENS_AT2001,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione FAPE (punzonatrici) vers 2018
|
||||
/// </summary>
|
||||
SIEMENS_FAPE,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione FAPE (punzonatrici) vers 2024
|
||||
/// </summary>
|
||||
SIEMENS_FAPE_2,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione COMECA (impianti gestione GNL)
|
||||
/// </summary>
|
||||
SIEMENS_COMECA,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione COMUR (dentatrice)
|
||||
/// </summary>
|
||||
SIEMENS_COMUR,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione COSMAP (transfer smerigliatrice donati)
|
||||
/// </summary>
|
||||
SIEMENS_COSMAP,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione INGENIA (Valvital, Automazione)
|
||||
/// </summary>
|
||||
SIEMENS_INGENIA,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione LASCO (Valvital, Pressa Bilancere)
|
||||
/// </summary>
|
||||
SIEMENS_LASCO,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione NWSE (Giacovelli, impianto filtrazione NWS)
|
||||
/// </summary>
|
||||
SIEMENS_NWSE,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione PRESSOIL + CEI (Valvital, Pressa Idraulica)
|
||||
/// </summary>
|
||||
SIEMENS_PRESSOIL_CEI,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia verisone RobotService (Donati, smerigliatrici)
|
||||
/// </summary>
|
||||
SIEMENS_ROBOTSERVICE,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione SAET (Valvital, forni / tempra)
|
||||
/// </summary>
|
||||
SIEMENS_SAET,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione SIMEC (Valvital, taglio)
|
||||
/// </summary>
|
||||
SIEMENS_SIMEC,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SIEMENS, interfaccia versione Torri
|
||||
/// </summary>
|
||||
SIEMENS_TORRI,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter SOAP x bilance Gomba
|
||||
/// </summary>
|
||||
SOAP_GOMBA,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter basato su DB scambio Microsoft SqlServer, macchine LANTEK
|
||||
/// </summary>
|
||||
SQLSERVER_LANTEK,
|
||||
|
||||
/// <summary>
|
||||
/// Adapter basato su DB scambio Microsoft SqlServer, macchine PAMA
|
||||
/// </summary>
|
||||
SQLSERVER_PAMA,
|
||||
|
||||
/// <summary>
|
||||
/// Metodi di WPS WebPageScraping (es x compressori Atlas Copco)
|
||||
/// </summary>
|
||||
WPS
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwConf.Iob
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a new INI file to store or load data
|
||||
/// </summary>
|
||||
public class IniFile
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public string FileName;
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <PARAM name="INIPath"></PARAM>
|
||||
public IniFile(string INIPath)
|
||||
{
|
||||
FileName = INIPath;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Delete a key from section
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// <param name="Key"></param>
|
||||
public void IniDeleteKey(string Section, string Key)
|
||||
{
|
||||
WritePrivateProfileString(Section, Key, "", FileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Completely remove one section
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
public void IniDeleteSection(string Section)
|
||||
{
|
||||
WritePrivateProfileSection(Section, "", FileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return true if section exists
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// <returns></returns>
|
||||
public bool IniSectionExists(string Section)
|
||||
{
|
||||
int bytesReturned = 0;
|
||||
const int bufferSize = 2048; // max is 32767
|
||||
IntPtr pReturnedString = Marshal.AllocCoTaskMem(bufferSize);
|
||||
try
|
||||
{
|
||||
bytesReturned = GetPrivateProfileSection(Section, pReturnedString, bufferSize, FileName);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.FreeCoTaskMem(pReturnedString);
|
||||
}
|
||||
return (bytesReturned > 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a boolean
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// <param name="Key"></param>
|
||||
/// <returns></returns>
|
||||
public bool ReadBoolean(string Section, string Key)
|
||||
{
|
||||
return (ReadInteger(Section, Key, 0) != 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a boolean with default value
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// <param name="Key"></param>
|
||||
/// <param name="DefaultVal"></param>
|
||||
/// <returns></returns>
|
||||
public bool ReadBoolean(string Section, string Key, bool DefaultVal)
|
||||
{
|
||||
int v = DefaultVal ? 1 : 0;
|
||||
return (ReadInteger(Section, Key, v) != 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read an integer
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// <param name="Key"></param>
|
||||
/// <returns></returns>
|
||||
public int ReadInteger(string Section, string Key)
|
||||
{
|
||||
return GetPrivateProfileInt(Section, Key, 0, FileName);
|
||||
//System.Convert.ToInt32(IniReadValue(Section, Key));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read an integer. If not found use default value
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// <param name="Key"></param>
|
||||
/// <param name="DefaultVal"></param>
|
||||
/// <returns></returns>
|
||||
public int ReadInteger(string Section, string Key, int DefaultVal)
|
||||
{
|
||||
//int temp = System.Convert.ToInt32(IniReadString(Section, Key, Convert.ToString(DefaultVal)));
|
||||
//return temp;
|
||||
return GetPrivateProfileInt(Section, Key, DefaultVal, FileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a complete section (keys=values)
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// Section name
|
||||
/// <returns>
|
||||
/// restituisce delle stringhe keys=values da suddividere appunto come key/val successivamente
|
||||
/// </returns>
|
||||
public string[] ReadSection(string Section)
|
||||
{
|
||||
const int bufferSize = 2048; // max is 32767
|
||||
|
||||
StringBuilder returnedString = new StringBuilder();
|
||||
|
||||
IntPtr pReturnedString = Marshal.AllocCoTaskMem(bufferSize);
|
||||
try
|
||||
{
|
||||
int bytesReturned = GetPrivateProfileSection(Section, pReturnedString, bufferSize, FileName);
|
||||
if (bytesReturned > 0)
|
||||
{
|
||||
//bytesReturned -1 to remove trailing \0
|
||||
for (int i = 0; i < bytesReturned - 1; i++)
|
||||
{
|
||||
var currPointer = IntPtr.Add(pReturnedString, i);
|
||||
var currChar = (char)Marshal.ReadByte(currPointer);
|
||||
returnedString.Append(currChar);
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.FreeCoTaskMem(pReturnedString);
|
||||
}
|
||||
|
||||
string sectionData = returnedString.ToString();
|
||||
return sectionData.Split('\0');
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read data from the Ini file
|
||||
/// </summary>
|
||||
/// <PARAM name="Section"></PARAM>
|
||||
/// <PARAM name="Key"></PARAM>
|
||||
/// <PARAM name="Path"></PARAM>
|
||||
/// <returns></returns>
|
||||
public string ReadString(string Section, string Key)
|
||||
{
|
||||
StringBuilder temp = new StringBuilder(255);
|
||||
int i = GetPrivateProfileString(Section, Key, "", temp, 255, FileName);
|
||||
return temp.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a string. If not found use default value
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// <param name="Key"></param>
|
||||
/// <param name="DefaultVal"></param>
|
||||
/// <returns></returns>
|
||||
public string ReadString(string Section, string Key, string DefaultVal)
|
||||
{
|
||||
string temp = ReadString(Section, Key);
|
||||
if (temp == "") temp = DefaultVal;
|
||||
return temp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return true if value exists
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// <param name="Key"></param>
|
||||
/// <returns></returns>
|
||||
public bool ValueExists(string Section, string Key)
|
||||
{
|
||||
StringBuilder temp = new StringBuilder(255);
|
||||
int i = GetPrivateProfileString(Section, Key, "", temp, 255, FileName);
|
||||
return (i > 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write a boolean value
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// <param name="Key"></param>
|
||||
/// <param name="Value"></param>
|
||||
public void WriteBoolean(string Section, string Key, bool Value)
|
||||
{
|
||||
int flag = Value ? 1 : 0;
|
||||
WriteString(Section, Key, Convert.ToString(flag));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write a double value
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// <param name="Key"></param>
|
||||
/// <param name="Value"></param>
|
||||
public void WriteDouble(string Section, string Key, double Value)
|
||||
{
|
||||
WriteString(Section, Key, Convert.ToString(Value, NumberFormatInfo.InvariantInfo));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write an integer value
|
||||
/// </summary>
|
||||
/// <param name="Section"></param>
|
||||
/// <param name="Key"></param>
|
||||
/// <param name="Value"></param>
|
||||
public void WriteInteger(string Section, string Key, int Value)
|
||||
{
|
||||
WriteString(Section, Key, Convert.ToString(Value));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write data to the INI file
|
||||
/// </summary>
|
||||
/// <PARAM name="Section"></PARAM>
|
||||
/// Section name
|
||||
/// <PARAM name="Key"></PARAM>
|
||||
/// Key Name
|
||||
/// <PARAM name="Value"></PARAM>
|
||||
/// Value Name
|
||||
public void WriteString(string Section, string Key, string Value)
|
||||
{
|
||||
WritePrivateProfileString(Section, Key, Value, FileName);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// GetPrivateProfileInt: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="def"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileInt(string section, string key, int def, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// GetPrivateProfileSection: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="retVal"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileSection(string section, IntPtr retVal, uint size, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// GetPrivateProfileString: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="def"></param>
|
||||
/// <param name="retVal"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// WritePrivateProfileSection: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32")]
|
||||
private static extern bool WritePrivateProfileSection(string section, string value, string filePath);
|
||||
|
||||
/// <summary>
|
||||
/// WritePrivateProfileString: import windows dll functions
|
||||
/// </summary>
|
||||
/// <param name="section"></param>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="val"></param>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32", CharSet = CharSet.Auto, BestFitMapping = false)]
|
||||
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,374 @@
|
||||
using Newtonsoft.Json;
|
||||
using YamlDotNet.Serialization.NamingConventions;
|
||||
using YamlDotNet.Serialization;
|
||||
using NLog;
|
||||
using System.IO;
|
||||
using System;
|
||||
using static EgwConf.Iob.EnumConf;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using EgwConf.Iob.Base;
|
||||
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
namespace EgwConf.Iob
|
||||
{
|
||||
/// <summary>
|
||||
/// Albero configurazione globale IOB in formato serializable
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class IobConfTree
|
||||
{
|
||||
/// <summary>
|
||||
/// Init classe configurazione
|
||||
/// </summary>
|
||||
public IobConfTree()
|
||||
{
|
||||
Log = LogManager.GetCurrentClassLogger();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Init classe configurazione da file
|
||||
/// </summary>
|
||||
public IobConfTree(string confFilePath)
|
||||
{
|
||||
Log = LogManager.GetCurrentClassLogger();
|
||||
if (File.Exists(confFilePath))
|
||||
{
|
||||
IobConfTree newConfObj = new IobConfTree();
|
||||
// verifico TIPO file...
|
||||
string fileExt = Path.GetExtension(confFilePath);
|
||||
string fileName = Path.GetFileName(confFilePath);
|
||||
string rawData = File.ReadAllText(confFilePath);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
// leggo in base al tipo...
|
||||
switch (fileExt)
|
||||
{
|
||||
case "yaml":
|
||||
case "yml":
|
||||
var deserializer = new DeserializerBuilder()
|
||||
.WithNamingConvention(CamelCaseNamingConvention.Instance)
|
||||
.Build();
|
||||
try
|
||||
{
|
||||
newConfObj = deserializer.Deserialize<IobConfTree>(rawData);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
//lgError($"Eccezione in LoadFromYaml{Environment.NewLine}{exc}");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (newConfObj != null)
|
||||
{
|
||||
// ora copio in oggetto corrente...
|
||||
CncData = newConfObj.CncData;
|
||||
CodIOB = newConfObj.CodIOB;
|
||||
ConfFileName = fileName;
|
||||
Customer = newConfObj.Customer;
|
||||
GeneralCom = newConfObj.GeneralCom;
|
||||
InputDataProc = newConfObj.InputDataProc;
|
||||
IobManConf = newConfObj.IobManConf;
|
||||
IobType = newConfObj.IobType;
|
||||
Model = newConfObj.Model;
|
||||
OptPar = newConfObj.OptPar;
|
||||
ReleaseVers = newConfObj.ReleaseVers;
|
||||
ServerMES = newConfObj.ServerMES;
|
||||
TempoCiclo = newConfObj.TempoCiclo;
|
||||
Vendor = newConfObj.Vendor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce un oggetto di conf leggendo INI ed effettuando conversione
|
||||
/// </summary>
|
||||
/// <param name="iniFilePath"></param>
|
||||
/// <returns></returns>
|
||||
public static IobConfTree LoadFromINI(string iniFilePath)
|
||||
{
|
||||
IobConfTree newConfObj = new IobConfTree();
|
||||
try
|
||||
{
|
||||
// leggo file INI
|
||||
IniFile fIni = new IniFile(iniFilePath);
|
||||
string codIob = Path.GetFileNameWithoutExtension(iniFilePath);
|
||||
|
||||
// effettuo conversione...
|
||||
|
||||
// Dati generali (vendor, modello...)
|
||||
newConfObj.CodIOB = fIni.ReadString("IOB", "IOB_NAME", codIob);
|
||||
newConfObj.Vendor = fIni.ReadString("MACHINE", "VENDOR", "STEAMWARE");
|
||||
newConfObj.Model = fIni.ReadString("MACHINE", "MODEL", "NONE");
|
||||
newConfObj.ConfFileName = Path.GetFileName(iniFilePath);
|
||||
|
||||
// tipo adapter// verifico tipo adapter
|
||||
try
|
||||
{
|
||||
newConfObj.IobType = (AdapterType)Enum.Parse(typeof(AdapterType), fIni.ReadString("IOB", "CNCTYPE", "ND"));
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
newConfObj.IobType = AdapterType.ND;
|
||||
string rawVal = fIni.ReadString("IOB", "CNCTYPE", "DEMO");
|
||||
newConfObj.lgError($"Eccezione in conversione tipo adapter: richiesto {rawVal} | tipo non codificato...{Environment.NewLine}{exc}");
|
||||
}
|
||||
newConfObj.GeneralCom = (ComLayer)Enum.Parse(typeof(ComLayer), fIni.ReadString("IOB", "CNCFAMILY", "ND"));
|
||||
|
||||
// CNC
|
||||
newConfObj.CncData.pingMsTimeout = fIni.ReadInteger("IOB", "PING_MS_TIMEOUT", 500);
|
||||
newConfObj.CncData.IpAddr = fIni.ReadString("CNC", "IP", "::1");
|
||||
newConfObj.CncData.Port = fIni.ReadString("CNC", "PORT", "0");
|
||||
if (!string.IsNullOrEmpty(fIni.ReadString("CNC", "CPUTYPE", "")))
|
||||
{
|
||||
newConfObj.CncData.SiemensCpu = new Special.SiemensDto();
|
||||
newConfObj.CncData.SiemensCpu.CpuType = fIni.ReadString("CNC", "CPUTYPE", "");
|
||||
newConfObj.CncData.SiemensCpu.Rack = (short)fIni.ReadInteger("CNC", "RACK", 0);
|
||||
newConfObj.CncData.SiemensCpu.Slot = (short)fIni.ReadInteger("CNC", "SLOT", 0);
|
||||
}
|
||||
|
||||
// BLINK
|
||||
newConfObj.InputDataProc.BlinkMaxCounter = Convert.ToInt32(fIni.ReadString("BLINK", "MAX_COUNTER_BLINK", "1"));
|
||||
newConfObj.InputDataProc.BlinkFilterMask = Convert.ToInt32(fIni.ReadString("BLINK", "BLINK_FILT", "0"));
|
||||
newConfObj.TempoCiclo.MaxDelayFactor = Convert.ToDouble(fIni.ReadString("OPTPAR", "TC_MAX_TC_FACTOR", "1.2").Replace(".", ","));
|
||||
newConfObj.TempoCiclo.Lambda = Convert.ToDouble(fIni.ReadString("OPTPAR", "TC_LAMBDA", "0.5").Replace(".", ","));
|
||||
newConfObj.TempoCiclo.MaxIncrPz = Convert.ToDouble(fIni.ReadString("OPTPAR", "TC_MAX_INCR", "5").Replace(".", ","));
|
||||
|
||||
// Server
|
||||
string MpIp = fIni.ReadString("SERVER", "MPIP", "::1");
|
||||
if (!string.IsNullOrEmpty(MpIp))
|
||||
{
|
||||
newConfObj.ServerMES.Transport = MpIp.StartsWith("https://") ? "https" : "http";
|
||||
newConfObj.ServerMES.IpAddr = MpIp.Replace($"{newConfObj.ServerMES.Transport}://", ""); // tolgo http/https...
|
||||
}
|
||||
|
||||
// Altro (versione, ...)
|
||||
newConfObj.ReleaseVers = $"{System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}";
|
||||
newConfObj.IobManConf.MinDeltaSec = fIni.ReadInteger("IOB", "MinDeltaSec", 6);
|
||||
|
||||
// OptPar
|
||||
Dictionary<string, string> optParRead = new Dictionary<string, string>();
|
||||
string[] optParRows = fIni.ReadSection("OPTPAR");
|
||||
if (optParRows.Length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
string[] kvp;
|
||||
foreach (var item in optParRows)
|
||||
{
|
||||
kvp = item.Split('=');
|
||||
optParRead.Add(kvp[0], kvp[1]);
|
||||
}
|
||||
//newConfObj.lgDebug($"Caricati {optParRead.Count} parametri opzionali da OPTPAR");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
newConfObj.lgError(string.Format("EXCEPTION in fase di lettura OPTPAR: {0}{1}", Environment.NewLine, exc));
|
||||
}
|
||||
}
|
||||
// riordino alfabeticamente
|
||||
optParRead = optParRead.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value);
|
||||
newConfObj.OptPar = optParRead;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return newConfObj;
|
||||
}
|
||||
|
||||
#region Logging
|
||||
|
||||
/// <summary>
|
||||
/// oggetto logging
|
||||
/// </summary>
|
||||
protected Logger Log;// = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// Effettua logging DEBUG corretto impostanto anche la variabile IOB prima di scrivere...
|
||||
/// </summary>
|
||||
/// <param name="txt2log"></param>
|
||||
protected void lgDebug(string txt2log)
|
||||
{
|
||||
Log.Factory.Configuration.Variables["codIOB"] = this.CodIOB;
|
||||
Log.Debug(txt2log);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua logging ERROR corretto impostanto anche la variabile IOB prima di scrivere...
|
||||
/// </summary>
|
||||
/// <param name="txt2log"></param>
|
||||
protected void lgError(string txt2log)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(txt2log))
|
||||
{
|
||||
Log.Factory.Configuration.Variables["codIOB"] = this.CodIOB;
|
||||
Log.Error(txt2log);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua logging INFO corretto impostanto anche la variabile IOB prima di scrivere...
|
||||
/// </summary>
|
||||
/// <param name="txt2log"></param>
|
||||
protected void lgInfo(string txt2log)
|
||||
{
|
||||
Log.Factory.Configuration.Variables["codIOB"] = this.CodIOB;
|
||||
Log.Info(txt2log);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua logging TRACE corretto impostanto anche la variabile IOB prima di scrivere...
|
||||
/// </summary>
|
||||
/// <param name="txt2log"></param>
|
||||
protected void lgTrace(string txt2log)
|
||||
{
|
||||
Log.Factory.Configuration.Variables["codIOB"] = this.CodIOB;
|
||||
Log.Trace(txt2log);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Codice Cliente/Installazione
|
||||
/// </summary>
|
||||
public string Customer { get; set; } = "SteamWare";
|
||||
|
||||
/// <summary>
|
||||
/// Codice univoco IOB
|
||||
/// </summary>
|
||||
public string CodIOB { get; set; } = "ND";
|
||||
/// <summary>
|
||||
/// Costruttore
|
||||
/// </summary>
|
||||
public string Vendor { get; set; } = "ACME";
|
||||
|
||||
/// <summary>
|
||||
/// Codice modello
|
||||
/// </summary>
|
||||
public string Model { get; set; } = "NONE";
|
||||
|
||||
/// <summary>
|
||||
/// Nome file di configurazione
|
||||
/// </summary>
|
||||
public string ConfFileName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia generale dell'adapter
|
||||
/// </summary>
|
||||
public ComLayer GeneralCom { get; set; } = ComLayer.ND;
|
||||
|
||||
/// <summary>
|
||||
/// Tipo Adapter specifico (implementazione)
|
||||
/// </summary>
|
||||
public AdapterType IobType { get; set; } = AdapterType.ND;
|
||||
|
||||
/// <summary>
|
||||
/// Setup server MP da chiamare
|
||||
/// </summary>
|
||||
public ServerMapoDto ServerMES { get; set; } = new ServerMapoDto();
|
||||
|
||||
/// <summary>
|
||||
/// Setup info verso IOB-MAN
|
||||
/// </summary>
|
||||
public IobManDto IobManConf { get; set; } = new IobManDto();
|
||||
|
||||
/// <summary>
|
||||
/// Dati configurazione CNC
|
||||
/// </summary>
|
||||
public ConnectParamsDto CncData { get; set; } = new ConnectParamsDto();
|
||||
|
||||
/// <summary>
|
||||
/// Setup processing dati in ingresso (es: blink segnali)
|
||||
/// </summary>
|
||||
public InputSignalDto InputDataProc { get; set; } = new InputSignalDto();
|
||||
|
||||
/// <summary>
|
||||
/// Dati relativi ai parametri gestione tempo ciclo
|
||||
/// </summary>
|
||||
public TCDataDto TempoCiclo { get; set; } = new TCDataDto();
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario dei parametri opzionali
|
||||
/// </summary>
|
||||
public Dictionary<string, string> OptPar { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Versione software IOB
|
||||
/// </summary>
|
||||
public string ReleaseVers { get; set; } = "0.0.0.0";
|
||||
|
||||
#region Metodi Serializzazione
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce conf serializzata in formato JSON
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
public string GetJson()
|
||||
{
|
||||
string rawdata = JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
return rawdata;
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce conf serializzata in formato YAML
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
public string GetYaml()
|
||||
{
|
||||
// opzioni alternative: PascalCaseNamingConvention (iniziale masiucola) o lowerCaseNamingConvention
|
||||
var serializer = new SerializerBuilder()
|
||||
.WithNamingConvention(CamelCaseNamingConvention.Instance)
|
||||
.Build();
|
||||
var rawdata = serializer.Serialize(this);
|
||||
return rawdata;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Metodi Load/Save
|
||||
|
||||
/// <summary>
|
||||
/// Scrive conf serializzata in formato JSON
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
public bool SaveJson(string filePath)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
string rawdata = GetJson();
|
||||
File.WriteAllText(filePath, rawdata);
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Scrive conf serializzata in formato YAML
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
public bool SaveYaml(string filePath)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
var rawdata = GetYaml();
|
||||
File.WriteAllText(filePath, rawdata);
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,923 @@
|
||||
using MapoSDK;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace EgwConf.Iob.Mem
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe gestione configurazione parametri di base x allarmi
|
||||
/// </summary>
|
||||
public class BaseAlarmConf
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Elenco dei contatori blink x gestione caso fronte salita/discesa segnale che blinka
|
||||
/// </summary>
|
||||
public int[] alarmsBlinkCounter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// BitMask 16bit (1 = valido, 0 = filtro) degli allarmi silenziati/disabilitati (se
|
||||
/// iniziano per ##) come valore da sottrarre x check
|
||||
/// </summary>
|
||||
public uint[] alarmsMask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Array dei valori allarme correnti
|
||||
/// </summary>
|
||||
public uint[] alarmsState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// valore di partenza x un segnale di blink in caso di fine variazione (fronte discesa)
|
||||
/// </summary>
|
||||
public int blinkDownVal { get; set; } = 4;
|
||||
|
||||
/// <summary>
|
||||
/// valore di partenza x un segnale di blink in caso di inizio variazione (fronte salita)
|
||||
/// </summary>
|
||||
public int blinkUpVal { get; set; } = 3;
|
||||
|
||||
/// <summary>
|
||||
/// Descrizione area allarmi
|
||||
/// </summary>
|
||||
public string description { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Indice nell'area di memoria (da valore iniziale = 0)
|
||||
/// </summary>
|
||||
public int index { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Nome "assoluto" della posizione nell'area di memoria (anche diverso da indice)
|
||||
/// </summary>
|
||||
public string memAddr { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Elenco allarmi configurati x la bitmap
|
||||
/// </summary>
|
||||
public List<string> messages { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Size in byte
|
||||
/// </summary>
|
||||
public int size { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Tipo di dato
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public plcDataType tipoMem { get; set; } = plcDataType.Boolean;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Tipo del blocco allarmi configurato
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public AlarmBlockType blockType { get; set; } = AlarmBlockType.Bitmap;
|
||||
|
||||
/// <summary>
|
||||
/// Livello del blocco memoria
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public AlarmLevel blockLevel { get; set; } = AlarmLevel.Alarm;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco KEY codici allarme attivabili
|
||||
/// </summary>
|
||||
public List<string> activeKeys { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco VALUE codici allarme attivabili
|
||||
/// </summary>
|
||||
public List<string> activeValues { get; set; } = new List<string>();
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Calcola il filtro da condizione blink (ovvero maschera per valori indicati blinking)
|
||||
/// </summary>
|
||||
/// <param name="num"></param>
|
||||
/// <returns></returns>
|
||||
public uint blinkFilter(int num)
|
||||
{
|
||||
uint answ = 0;
|
||||
int idx = 16 * num;
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
if (alarmsBlinkCounter[idx + i] > 0)
|
||||
{
|
||||
answ += (uint)1 << i;
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua update dei contatori blink per gestire i segnali alternati sul fronte di salita/discesa
|
||||
/// </summary>
|
||||
/// <param name="num"></param>
|
||||
/// <param name="newStatus"></param>
|
||||
public void checkBlinkCounter(int num, uint newStatus)
|
||||
{
|
||||
// calcola la maschera di variazione da valore precedente
|
||||
var variations = newStatus ^ alarmsState[num];
|
||||
// ciclo sui 16 bit...
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
// controllo se è variato
|
||||
if ((variations & (1 << i)) == (1 << i))
|
||||
{
|
||||
// se il valore nuovo è 1 --> è in fronte salita
|
||||
if ((newStatus & (1 << i)) == (1 << i))
|
||||
{
|
||||
// cambio SOLO SE il valore blink è zero...
|
||||
if (alarmsBlinkCounter[num * 16 + i] == 0)
|
||||
{
|
||||
alarmsBlinkCounter[num * 16 + i] = blinkUpVal;
|
||||
}
|
||||
}
|
||||
// altrimenti se è fronte discesa
|
||||
else
|
||||
{
|
||||
// cambio SOLO SE il valore blink è zero...
|
||||
if (alarmsBlinkCounter[num * 16 + i] == 0)
|
||||
{
|
||||
alarmsBlinkCounter[num * 16 + i] = blinkDownVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// decremento contatori blink
|
||||
int idx = 0;
|
||||
foreach (var item in alarmsBlinkCounter)
|
||||
{
|
||||
alarmsBlinkCounter[idx] = item > 0 ? item - 1 : item;
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confronta un valore di stato allarme con lo stato precedentemente salvato considerando blink/veto
|
||||
/// </summary>
|
||||
/// <param name="num">Numero/indice del banco di allarme (uint16)</param>
|
||||
/// <param name="newValue">Valore (bitmap) allarmi come uint16</param>
|
||||
/// <returns></returns>
|
||||
public bool isChanged(int num, uint newValue)
|
||||
{
|
||||
// per prima cosa controllo valori RAW
|
||||
bool answ = !alarmsState[num].Equals(newValue);
|
||||
if (answ)
|
||||
{
|
||||
// controllo valori filtrati con ## (sottraendo BITMASK dai valori di filtro)
|
||||
answ = ((alarmsState[num] & alarmsMask[num]) != (newValue & alarmsMask[num]));
|
||||
// se fossero ancora differenti controllo ulteriore mask dato il counter dei blink:
|
||||
if (answ)
|
||||
{
|
||||
var blinkFilt = blinkFilter(num);
|
||||
answ = ((alarmsState[num] & (alarmsMask[num] & ~blinkFilt)) != (newValue & (alarmsMask[num] & ~blinkFilt)));
|
||||
//answ = ((alarmsState[num] & (alarmsMask[num] | blinkFilt)) != (newValue & (alarmsMask[num] | blinkFilt)));
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inizializzazione classe con valori calcolati: attenzione si aspetta banchi da 32 bit...
|
||||
/// ATTENZIONE: eseguita solo se blockType == bitmap
|
||||
/// </summary>
|
||||
public void setupData()
|
||||
{
|
||||
// verifico si tratti di un tipo allarmi a bitmap... altrimenti salto
|
||||
if (blockType == AlarmBlockType.Bitmap)
|
||||
{
|
||||
// inizializzo vettore valore allarmi x banco int8 x iniziare
|
||||
alarmsState = new uint[size];
|
||||
alarmsMask = new uint[size];
|
||||
int bitSize = 8;
|
||||
|
||||
// 16/32 bit
|
||||
if (size > 1)
|
||||
{
|
||||
// inizializzo vettore valore allarmi x banco int16
|
||||
alarmsState = new uint[size / 2];
|
||||
alarmsMask = new uint[size / 2];
|
||||
bitSize = 16;
|
||||
}
|
||||
|
||||
// una volta inizializzata la classe di base sistemo vettori allarmi disabilitati ed il
|
||||
// contatore blink dei fronti di discesa
|
||||
alarmsBlinkCounter = new int[messages.Count];
|
||||
//verifico i contatori di blink da eventuale conf...
|
||||
|
||||
int idx = 0;
|
||||
int bank = 0;
|
||||
foreach (var item in messages)
|
||||
{
|
||||
if (item.StartsWith("##"))
|
||||
{
|
||||
alarmsBlinkCounter[idx] = -999;
|
||||
}
|
||||
else
|
||||
{
|
||||
alarmsBlinkCounter[idx] = 1;
|
||||
alarmsMask[bank] += (uint)1 << idx;
|
||||
}
|
||||
idx++;
|
||||
// sistemo bank/indice
|
||||
if (idx > bitSize - 1)
|
||||
{
|
||||
bank++;
|
||||
idx = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua il caricamento dello status da un valore precedente (es da cache REDIS)
|
||||
/// ATTENZIONE: eseguita solo se blockType == bitmap e size corrisponde a quella della mem allarmi
|
||||
/// </summary>
|
||||
/// <param name="lastState"></param>
|
||||
public void loadPrev(uint[] lastState)
|
||||
{
|
||||
// verifico si tratti di un tipo allarmi a bitmap... altrimenti salto
|
||||
if (blockType == AlarmBlockType.Bitmap)
|
||||
{
|
||||
if (lastState.Length == alarmsState.Length)
|
||||
{
|
||||
alarmsState = lastState;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Imposta il valore dello status attuale allarme impostando eventuale valore blink x le variazioni
|
||||
/// </summary>
|
||||
/// <param name="num"></param>
|
||||
/// <param name="newStatus"></param>
|
||||
public void updStatusVal(int num, uint newStatus)
|
||||
{
|
||||
// salvo nuovo valore
|
||||
alarmsState[num] = newStatus;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tipologia del blocco allarmi configurato
|
||||
/// </summary>
|
||||
public enum AlarmBlockType
|
||||
{
|
||||
/// <summary>
|
||||
/// Modalità standard a bitmap
|
||||
/// </summary>
|
||||
Bitmap,
|
||||
|
||||
/// <summary>
|
||||
/// Modalità elenco dei valori attivi (es OPC-UA BLM/Adige)
|
||||
/// </summary>
|
||||
ActiveList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Livello Allarme
|
||||
/// </summary>
|
||||
public enum AlarmLevel
|
||||
{
|
||||
/// <summary>
|
||||
/// Messaggio (non bloccante)
|
||||
/// </summary>
|
||||
Message = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Avviso (non bloccante)
|
||||
/// </summary>
|
||||
Warning = 100,
|
||||
|
||||
/// <summary>
|
||||
/// Allarme (bloccante)
|
||||
/// </summary>
|
||||
Alarm = 200,
|
||||
|
||||
/// <summary>
|
||||
/// Allarme di massimo livello
|
||||
/// </summary>
|
||||
Emergency = 300
|
||||
}
|
||||
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe gestione configurazione parametri di base x configurazione estesa (es MTConnect,
|
||||
/// OPC-UA, ...)
|
||||
/// </summary>
|
||||
public class BaseParamConf
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione LAVORA / Green
|
||||
/// </summary>
|
||||
public List<diCheckCondition> condWork { get; set; } = new List<diCheckCondition>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione EXTRA di controllo x singoli BIT
|
||||
/// </summary>
|
||||
public Dictionary<int, diCheckCondSetup> bitSpecCond { get; set; } = new Dictionary<int, diCheckCondSetup>();
|
||||
|
||||
/// <summary>
|
||||
/// Indica se l'emergenza armata va riportata verso Mapo come bit a TRUE True --> armata
|
||||
/// = 1 / triggered = 0 False --> triggered = 1 / armata = 0
|
||||
/// </summary>
|
||||
public bool emergencyArmedTrue { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco items FILTRATI da invio come dynData --> FluxLog (events o samples), ricerca SECCA
|
||||
/// </summary>
|
||||
public List<string> fluxLogVeto { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco items FILTRATI da invio come dynData --> FluxLog (events o samples), ricerca testo come contains in displayName
|
||||
/// </summary>
|
||||
public List<string> fluxLogVetoContains { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Indica se il controllo di ping sia OK (x controllo prima della connessione)
|
||||
/// </summary>
|
||||
public bool forcePingOk { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Array degli elementi di traduzione item
|
||||
/// </summary>
|
||||
public Dictionary<string, string> itemTranslation { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Indica se decodificare valori dall'area mMapRead da valori byte[] delle variabili sottoscritte
|
||||
/// </summary>
|
||||
public bool mMapReadFromRawByte { get; set; } = false;
|
||||
/// <summary>
|
||||
/// Indica se decodificare valori dall'area mMapWrite da valori byte[] delle variabili sottoscritte
|
||||
/// </summary>
|
||||
public bool mMapWriteFromRawByte { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se inviare i dati sottoscritti che sono "raw" o meno...
|
||||
/// </summary>
|
||||
public bool sendSubscribItemsRaw { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Separatore configurazione area OPC e subObj in caso di memorie struct speciali
|
||||
/// </summary>
|
||||
public char kvDelim { get; set; } = '#';
|
||||
|
||||
/// <summary>
|
||||
/// Separatore definizione aree memoria speciali
|
||||
/// </summary>
|
||||
public char memDelim { get; set; } = '.';
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Nome variabile x EmergencyStop
|
||||
/// </summary>
|
||||
public string keyEStop { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Nome variabile x ExeMode
|
||||
/// </summary>
|
||||
public string keyExeMode { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Nome variabile x pezzi FATTI
|
||||
/// </summary>
|
||||
public string keyPartCount { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Nome variabile x Codice Articolo
|
||||
/// </summary>
|
||||
public string keyPartId { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Nome variabile x pezzi RICHIESTI
|
||||
/// </summary>
|
||||
public string keyPartReq { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Nome variabile x NOME PROGRAMMA
|
||||
/// </summary>
|
||||
public string keyProgName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Nome variabile x RunMode
|
||||
/// </summary>
|
||||
public string keyRunMode { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Aree di memoria lettura
|
||||
/// </summary>
|
||||
public Dictionary<string, dataConfTSVC> mMapRead { get; set; } = new Dictionary<string, dataConfTSVC>();
|
||||
|
||||
/// <summary>
|
||||
/// Aree di memoria scrittura
|
||||
/// </summary>
|
||||
public Dictionary<string, dataConf> mMapWrite { get; set; } = new Dictionary<string, dataConf>();
|
||||
|
||||
/// <summary>
|
||||
/// Dictionary dei nomi da cercare come "endsWith" a cui applicare la soglia indicata
|
||||
/// </summary>
|
||||
public Dictionary<string, float> paramsEndThresh { get; set; } = new Dictionary<string, float>();
|
||||
|
||||
/// <summary>
|
||||
/// Dictionary dei nomi da cercare come "contains" a cui applicare la soglia indicata
|
||||
/// </summary>
|
||||
public Dictionary<string, float> paramsContainsThresh { get; set; } = new Dictionary<string, float>();
|
||||
|
||||
/// <summary>
|
||||
/// Indica se il ping sia un criterio valido x determinare powerON impianto
|
||||
/// </summary>
|
||||
public bool pingAsPowerOn { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se venga richiesta invio del run mode
|
||||
/// </summary>
|
||||
public bool runModeSend { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se venga richiesta traduzione del run mode
|
||||
/// </summary>
|
||||
public bool runModeTrad { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Lista ulteriori configurazioni KeyValuePair
|
||||
/// </summary>
|
||||
public Dictionary<string, string> optKVP { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto x processing valori (elenco valori e modalità)
|
||||
/// </summary>
|
||||
public class calcConf
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public calcMode calcMode { get; set; } = calcMode.None;
|
||||
public List<string> listVal { get; set; } = new List<string>();
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe per rappresentare oggetti chiave/valore target x controlo condizioni multiple
|
||||
/// </summary>
|
||||
public class diCheckCondition
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Nome variabile
|
||||
/// </summary>
|
||||
public string keyName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Se >=0 indica ordine bit x decodifica di byte[] raw
|
||||
/// </summary>
|
||||
public int bitNum { get; set; } = -1;
|
||||
|
||||
/// <summary>
|
||||
/// valore target per esito richiesto
|
||||
/// </summary>
|
||||
public string targetValue { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe per rappresentare una lista di oggetti chiave/valore target x controlo condizioni
|
||||
/// multiple + indicazione modalità di controllo (AND/OR/...)
|
||||
/// </summary>
|
||||
public class diCheckCondSetup
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Elenco condizioni
|
||||
/// </summary>
|
||||
public List<diCheckCondition> checkList { get; set; } = new List<diCheckCondition>();
|
||||
|
||||
/// <summary>
|
||||
/// Modalità verifica condizioni
|
||||
/// </summary>
|
||||
public boolCheckMode checkMode { get; set; } = boolCheckMode.AND;
|
||||
|
||||
/// <summary>
|
||||
/// indica se il check vada NEGATO (esempio se cerco la condizione opposta, esempio num
|
||||
/// allarmi 0 --> se true NEGO la condizione HO ALLARMI)
|
||||
/// </summary>
|
||||
public bool negateValue { get; set; } = false;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe x definizione delle azioni in fase di setup macchina
|
||||
/// </summary>
|
||||
public class MachineSetupAction
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Indica se vada disabilitato il contapezzi quando la condizione NotEqual sia soddisfatta
|
||||
/// </summary>
|
||||
public bool DisablePzCountNotEqual { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Parametro target dell'azione
|
||||
/// </summary>
|
||||
public string TargetParam { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// parametro da impostare SE il check da esito EQUAL
|
||||
/// </summary>
|
||||
public int TargetValEqual { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// parametro da impostare SE il check da esito NOT EQUAL
|
||||
/// </summary>
|
||||
public int TargetValNotEqual { get; set; } = 1;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Definizione parametri di setup incrociato...
|
||||
/// </summary>
|
||||
public class MachineSetupConf
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario dei parametri di corrispondenza tra variabili MES e variabili Macchina MES =
|
||||
/// scritte dal MES Macchina = scritte da macchina
|
||||
/// </summary>
|
||||
public Dictionary<string, string> checkParList { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Abilitazione gestione Setup Avanzato (= scrittura)
|
||||
/// </summary>
|
||||
public bool EnableAdvSetup { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Modalità gestione setup
|
||||
/// </summary>
|
||||
public MachineSetupMode SetupMode { get; set; } = MachineSetupMode.ND;
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario dei parametri da scrivere quando si rilevano differenze tra i parametri MES/Macchina
|
||||
/// </summary>
|
||||
public List<MachineSetupAction> writeParAction { get; set; } = new List<MachineSetupAction>();
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// COnfigurazione blocchi x accesso memoria ottimizzato
|
||||
/// </summary>
|
||||
public class MemBlockConf
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public Dictionary<int, int> ReadBlocks { get; set; } = new Dictionary<int, int>();
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe gestione configurazione parametri specifici MTC da BaseParamConf
|
||||
/// </summary>
|
||||
public class MtcParamConf : BaseParamConf
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione PowerOn
|
||||
/// </summary>
|
||||
public diCheckCondition condPowerOn { get; set; } = new diCheckCondition();
|
||||
|
||||
/// <summary>
|
||||
/// Intervallo standard x SAMPLE data in ms
|
||||
/// </summary>
|
||||
public int clientSampleIntMs { get; set; } = 500;
|
||||
|
||||
/// <summary>
|
||||
/// Timeout standard x richieste in ms
|
||||
/// </summary>
|
||||
public int reqTOutMs { get; set; } = 1500;
|
||||
|
||||
/// <summary>
|
||||
/// Intervallo riconnessione standard in caso di mancanza risposta in ms
|
||||
/// </summary>
|
||||
public int reconnectIntMs { get; set; } = 1500;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se usare il metodo di sottoscrizione alle variazioni in modalità observations
|
||||
/// </summary>
|
||||
public bool doSubsObserv { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se usare il metodo di sottoscrizione alle variazioni sample
|
||||
/// </summary>
|
||||
public bool doSubsSample { get; set; } = true;
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe gestione configurazione parametri specifici OPC-UA da BaseParamConf
|
||||
/// </summary>
|
||||
public class OpcUaParamConf : BaseParamConf
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Variabili (e valori da impostare) x indicare di resettare contatore lotto e
|
||||
/// quindi riavviare produzione (es: impostando valore a 1...)
|
||||
/// </summary>
|
||||
public Dictionary<string, string> actResetCounter { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Variabili (e valori da impostare) x indicare di effettuare impostazione nuovo
|
||||
/// programma/ricetta (es: impostando valore a 1...)
|
||||
/// </summary>
|
||||
public Dictionary<string, string> actSetRecipe { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco Variabili (e valori da impostare) x indicare di fermare la produzione (es:
|
||||
/// impostando valore a 1...)
|
||||
/// </summary>
|
||||
public Dictionary<string, string> actStopProd { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Identificativo nodo iniziale
|
||||
/// </summary>
|
||||
public string BrowseFullVal { get; set; } = "ns=2;s=Scalar_Static";
|
||||
|
||||
/// <summary>
|
||||
/// Elenco di nodi da sottoscrivere direttamente al posto dell'albero derivante dal BrowseFullVal
|
||||
/// </summary>
|
||||
public List<string> BrowseNodeList { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Indice NS da cui fare il browse dei file
|
||||
/// </summary>
|
||||
public ushort BrowseNSIndex { get; set; } = 4;
|
||||
|
||||
/// <summary>
|
||||
/// ID del nodo da cui partire x il browse di identificazione nodi iniziale
|
||||
/// </summary>
|
||||
public uint BrowseValue { get; set; } = 5001;
|
||||
|
||||
/// <summary>
|
||||
/// Lista valori calcolati/derivati da processare
|
||||
/// </summary>
|
||||
public Dictionary<string, calcConf> calcValues { get; set; } = new Dictionary<string, calcConf>();
|
||||
|
||||
/// <summary>
|
||||
/// Numero minimo di secondi di durata di uno status
|
||||
/// </summary>
|
||||
public int minSecStatusDuration { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Numero minimo di secondi di attesa finale (es prima di chiedere chiusura ODL)
|
||||
/// </summary>
|
||||
public int minSecFinalWait { get; set; } = 30;
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione Contapezzi Abilitato (se vuoto = sempre abilitato)
|
||||
/// </summary>
|
||||
public diCheckCondSetup condCountEnabled { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione Errore
|
||||
/// </summary>
|
||||
public diCheckCondSetup condError { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione Emergenza
|
||||
/// </summary>
|
||||
public diCheckCondSetup condEStop { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione Manual
|
||||
/// </summary>
|
||||
public diCheckCondSetup condManual { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione PowerOn
|
||||
/// </summary>
|
||||
public diCheckCondSetup condPowerOn { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione READY
|
||||
/// </summary>
|
||||
public diCheckCondSetup condReady { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione Setup
|
||||
/// </summary>
|
||||
public diCheckCondSetup condSetup { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione WarmUp - CoolDown
|
||||
/// </summary>
|
||||
public diCheckCondSetup condWarmUpCoolDown { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione Warning
|
||||
/// </summary>
|
||||
public diCheckCondSetup condWarning { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Struttura dati x check condizione Errore
|
||||
/// </summary>
|
||||
public diCheckCondSetup condWorkOpc { get; set; } = new diCheckCondSetup();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco dei NodeId da ignorare intesi come interi rami (se vuoto NON filtro)
|
||||
/// </summary>
|
||||
public List<string> filterItemsNodeId { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco item flux da FILTRARE per chiave tradotta/VALORE
|
||||
/// es: Cimolai / Baglietto, RunModeVal NON VOGLIO inviare quando il valore è 0
|
||||
/// </summary>
|
||||
public Dictionary<string, List<string>> fluxLogKeyValVeto { get; set; } = new Dictionary<string, List<string>>();
|
||||
|
||||
public UserIdent Identity { get; set; } = new UserIdent();
|
||||
|
||||
/// <summary>
|
||||
/// Aree di memoria lettura
|
||||
/// </summary>
|
||||
public new Dictionary<string, dataConfTSVC> mMapRead { get; set; } = new Dictionary<string, dataConfTSVC>();
|
||||
|
||||
/// <summary>
|
||||
/// Aree di memoria scrittura
|
||||
/// </summary>
|
||||
public new Dictionary<string, dataConf> mMapWrite { get; set; } = new Dictionary<string, dataConf>();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco item RAW sottoscritti e relative configurazioni di decodifica da byte[]
|
||||
/// </summary>
|
||||
public Dictionary<string, string> rawSubscribedItemsConf { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Conf gestione setup macchina
|
||||
/// </summary>
|
||||
public MachineSetupConf SetupConf { get; set; } = new MachineSetupConf();
|
||||
|
||||
/// <summary>
|
||||
/// Elenco dei SOLI item sottoscritti (se vuoto TUTTI)
|
||||
/// </summary>
|
||||
public List<string> subscribedItems { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Conf Gestione WatchDog
|
||||
/// </summary>
|
||||
public WatchDogConf WatchDog { get; set; } = new WatchDogConf();
|
||||
|
||||
/// <summary>
|
||||
/// Indica che si utilizza (per LUT e gestione conf) il NodeId completo, default false (solo il DisplayName)
|
||||
/// </summary>
|
||||
public bool UseFullId { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Numero massimo di letture null prima di disconnettere il client
|
||||
/// </summary>
|
||||
public int maxNullRead { get; set; } = 1000;
|
||||
|
||||
/// <summary>
|
||||
/// Base del namespace da mascherare in invio OPC
|
||||
/// </summary>
|
||||
public string BaseIdMask { get; set; } = "";
|
||||
|
||||
public Dictionary<string, string> DictOpcNameReplace { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe gestione configurazione parametri specifici Rest Client da BaseParamConf
|
||||
/// </summary>
|
||||
public class RestParamConf : BaseParamConf
|
||||
{
|
||||
/// <summary>
|
||||
/// Timeout chiamate REST
|
||||
/// </summary>
|
||||
public int timeOutSec { get; set; } = 60;
|
||||
|
||||
/// <summary>
|
||||
/// API di base x chiamate REST, eventuali variabili van indicate come [[nomevar]]
|
||||
/// </summary>
|
||||
public string apiUrl { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Periodo minimo di campionamento in ms x lettura dati frequenti stato/semafori...
|
||||
/// </summary>
|
||||
public int samplePeriod { get; set; } = 1000;
|
||||
|
||||
/// <summary>
|
||||
/// Numero di errori dopo cui fare una vera disconnesisone con report poweroff della macchina
|
||||
/// </summary>
|
||||
public int connErrorMax { get; set; } = 5;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco delle chiamate x ID / struttura
|
||||
/// </summary>
|
||||
public Dictionary<string, CallStruc> CallList { get; set; } = new Dictionary<string, CallStruc>();
|
||||
|
||||
public class CallStruc
|
||||
{
|
||||
/// <summary>
|
||||
/// ID univoco chiamata per poterla recuperare
|
||||
/// </summary>
|
||||
public int Idx { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Metodo chiamata
|
||||
/// </summary>
|
||||
public RestSharp.Method Method { get; set; } = RestSharp.Method.Get;
|
||||
|
||||
/// <summary>
|
||||
/// Url chiamata
|
||||
/// </summary>
|
||||
public string Url { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Nome x invio a MES
|
||||
/// </summary>
|
||||
public string Name { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Nome x salvataggio valore output in ProdData da poter richiamare
|
||||
/// </summary>
|
||||
public string OutVarName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Intervallo di campionamento (minimo) da rispettare x evitare flood chiamate
|
||||
/// </summary>
|
||||
public int SamplePeriod { get; set; } = 5000;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco chiamate richieste se non fosse trovata/valida una variabile
|
||||
/// </summary>
|
||||
public List<string> ListPrevCall { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
||||
|
||||
public class UserIdent
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string Passwd { get; set; } = "";
|
||||
public string UserName { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Definizione parametri watchdog
|
||||
/// </summary>
|
||||
public class WatchDogConf
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Abilitazione WatchDog
|
||||
/// </summary>
|
||||
public bool IsEnabled { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Valore max contatore prima di resettare
|
||||
/// </summary>
|
||||
public int MaxVal { get; set; } = 9999;
|
||||
|
||||
/// <summary>
|
||||
/// Conf memoria x lettura WatchDog (ToMes), se !="" è gestito
|
||||
/// </summary>
|
||||
public string MemConfRead { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Conf memoria x scrittura WatchDog (FromMes), se !="" è gestito
|
||||
/// </summary>
|
||||
public string MemConfWrite { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using MapoSDK;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwConf.Iob.Mem
|
||||
{
|
||||
public class plcMemMapExt : plcMemMap
|
||||
{
|
||||
/// <summary>
|
||||
/// Dizionario parametri opzionali
|
||||
/// </summary>
|
||||
public Dictionary<string, string> optMemPar { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario x decodifica file
|
||||
/// </summary>
|
||||
public Dictionary<string, int> fileDecod { get; set; } = new Dictionary<string, int>();
|
||||
|
||||
/// <summary>
|
||||
/// Lista ulteriori configurazioni KeyValuePair
|
||||
/// </summary>
|
||||
public Dictionary<string, string> optKVP { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario opzionale di configurazione memorie WRITE con "alias",
|
||||
/// impiegato tipicamente per poter gestire scritture valori INT su CNC/PLC che non accettano stringhe (es FANUC)
|
||||
/// </summary>
|
||||
public Dictionary<string, string> mMapWriteLink { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario di dizionari di decodifica, chiave è nome/tipo dizionario e poi dizionario da impiegare
|
||||
/// Usato ad esempio x decodifica stati da valore intero o degli step di esecuzione di un ciclo (es Fape v2+)
|
||||
/// </summary>
|
||||
public Dictionary<string, Dictionary<string, string>> DataDecodMap { get; set; } = new Dictionary<string, Dictionary<string, string>>();
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Base del NameSpace usato per le funzionalità di translate (parametri ACT-SET), da inserire come PRE
|
||||
/// </summary>
|
||||
public string BaseKeyTranslate { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario per la traduzione delle ricette (se gestite) tra valori acquisiti in dossier e impostazioni da inviare (ACTual, SETup)
|
||||
/// </summary>
|
||||
public Dictionary<string, string> RecipeKeyTranslate { get; set; } = new Dictionary<string, string>();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("EgwConf.Iob")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("EgwConf.Iob")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("26cd6258-206b-4fb4-b9fb-1c573c930919")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgwConf.Iob.Special
|
||||
{
|
||||
public class SiemensDto
|
||||
{
|
||||
/// <summary>
|
||||
/// TipoCPU (es: 1500, 1200, 300)
|
||||
/// </summary>
|
||||
public string CpuType { get; set; } = "ND";
|
||||
|
||||
/// <summary>
|
||||
/// Rack (Siemens S7)
|
||||
/// </summary>
|
||||
public short Rack { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Slot (Siemens S7)
|
||||
/// </summary>
|
||||
public short Slot { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MapoSDK" version="6.14.2411.518" targetFramework="net462" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net462" />
|
||||
<package id="NLog" version="5.3.4" targetFramework="net462" />
|
||||
<package id="YamlDotNet" version="16.3.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -12,10 +12,8 @@
|
||||
<copyright>#copyright#</copyright>
|
||||
<tags>EgwProxy.Ftp EgwProxy Ftp</tags>
|
||||
<dependencies>
|
||||
<group>
|
||||
<dependency id="FluentFTP" version="41.0.0" />
|
||||
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" />
|
||||
</group>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
||||
@@ -10,7 +10,27 @@
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
@@ -11,6 +11,7 @@ using EgwProxy.Shelly.Clients;
|
||||
using System.Net.Http;
|
||||
using EgwProxy.Shelly.Options;
|
||||
using System.Threading;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace EgwProxy.Shelly.Test
|
||||
{
|
||||
@@ -26,7 +27,7 @@ namespace EgwProxy.Shelly.Test
|
||||
/// <summary>
|
||||
/// legge conf in formato stringa
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param power="key"></param>
|
||||
/// <returns></returns>
|
||||
protected static string ReadSetting(string key)
|
||||
{
|
||||
@@ -51,7 +52,7 @@ namespace EgwProxy.Shelly.Test
|
||||
/// <summary>
|
||||
/// Programma principale
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <param power="args"></param>
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine(separator);
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace EgwProxy.Shelly.Clients
|
||||
{
|
||||
var readAsStringAsync = await response.Content.ReadAsStringAsync();
|
||||
var shelly1Status = JsonConvert.DeserializeObject<T>(readAsStringAsync);
|
||||
return ShellyResult<T>.Success(shelly1Status);
|
||||
return ShellyResult<T>.Success(shelly1Status, readAsStringAsync);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,35 +39,38 @@
|
||||
<Reference Include="Flurl.Http, Version=4.0.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Flurl.Http.4.0.2\lib\net461\Flurl.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
<Reference Include="System.Buffers, Version=4.0.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
|
||||
<Reference Include="System.IO.Pipelines, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Pipelines.9.0.0\lib\net462\System.IO.Pipelines.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Encodings.Web, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.6.0.0\lib\net461\System.Text.Encodings.Web.dll</HintPath>
|
||||
<Reference Include="System.Text.Encodings.Web, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encodings.Web.9.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Json, Version=6.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.6.0.4\lib\net461\System.Text.Json.dll</HintPath>
|
||||
<Reference Include="System.Text.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Json.9.0.0\lib\net462\System.Text.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
|
||||
@@ -109,11 +112,4 @@
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\System.Text.Json.6.0.4\build\System.Text.Json.targets" Condition="Exists('..\packages\System.Text.Json.6.0.4\build\System.Text.Json.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\System.Text.Json.6.0.4\build\System.Text.Json.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Text.Json.6.0.4\build\System.Text.Json.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -59,7 +59,7 @@ namespace EgwProxy.Shelly
|
||||
return new ShellyResult<T>(default, success: false, isTransient: false, message);
|
||||
}
|
||||
|
||||
public static ShellyResult<T> Success(T value, string message = null)
|
||||
public static ShellyResult<T> Success(T value, string rawResp, string message = null)
|
||||
{
|
||||
return new ShellyResult<T>(value, true, false, message);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,27 @@
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.1.0" newVersion="6.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.4.0" newVersion="4.0.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.5.0" newVersion="4.1.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
<packages>
|
||||
<package id="Flurl" version="4.0.0" targetFramework="net462" />
|
||||
<package id="Flurl.Http" version="4.0.2" targetFramework="net462" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.0" targetFramework="net462" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net462" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net462" />
|
||||
<package id="System.Memory" version="4.5.4" targetFramework="net462" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net462" />
|
||||
<package id="System.Text.Encodings.Web" version="6.0.0" targetFramework="net462" />
|
||||
<package id="System.Text.Json" version="6.0.4" targetFramework="net462" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
|
||||
<package id="System.Buffers" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.IO.Pipelines" version="9.0.0" targetFramework="net462" />
|
||||
<package id="System.Memory" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.Numerics.Vectors" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.0" targetFramework="net462" />
|
||||
<package id="System.Text.Encodings.Web" version="9.0.0" targetFramework="net462" />
|
||||
<package id="System.Text.Json" version="9.0.0" targetFramework="net462" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.6.0" targetFramework="net462" />
|
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user