1 Commits

Author SHA1 Message Date
Samuele Locatelli f34bffd551 Merge branch 'develop' into SDK/MultiCnc 2022-07-12 11:02:22 +02:00
299 changed files with 11147 additions and 31073 deletions
+5 -84
View File
@@ -35,9 +35,9 @@ variables:
# helper x fix version number
.version-fix: &version-fix
- |
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format ddHH)
$env:NUM_REL = $env:VERS_MAIN+"."+(get-date -format yyMM)+"."+(get-date -format dHH)
$env:NUM_DEB = $env:VERS_MAIN+"."+(get-date -format yyMM)+"-beta."+(get-date -format dHH)
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date format yyMM)+"."+(get-date format ddHH)
$env:NUM_REL = $env:VERS_MAIN+"."+(get-date format yyMM)+"."+(get-date format dHH)
$env:NUM_DEB = $env:VERS_MAIN+"."+(get-date format yyMM)+"-beta."+(get-date format dHH)
$env:NEW_COPYRIGHT = "EgalWare @ 2006-" + (get-date -format yyyy)
$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw
$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL
@@ -46,7 +46,7 @@ variables:
# display versioni generate
$resoconto = "Effettuato fix file VersGen | release v: " + $env:NUM_REL + " | debug v: " + $env:NUM_DEB;
Write-Output $resoconto;
echo "Replace completati"
echo "replace completati"
# helper x fix nuspec file
.nuspec-fix: &nuspec-fix
@@ -93,7 +93,7 @@ variables:
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
cd "$env:APP_NAME\bin\"
$Source = "*"
7zip a -tzip $Target $Source -xr!DATA\CONF
7zip a -tzip $Target $Source -xr!DATA
echo "called ZIP $Source --> $Target"
# helper creazione hash files
@@ -201,23 +201,6 @@ IOB-WIN-NEXT: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'
EgwProxy.Ftp:build:
stage: build
tags:
- win
variables:
APP_NAME: EgwProxy.Ftp
only:
refs:
- develop
- SDK/Ftp
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.Icoel:build:
stage: build
tags:
@@ -269,33 +252,9 @@ EgwProxy.OsaiCncLib:build:
script:
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=Release /p:Platform="x86" /p:OutputPath=bin/ /nodeReuse:false /verbosity:minimal /m'
# --------------------------------
# STAGING: (nuget beta)
# --------------------------------
EgwProxy.Ftp:build:staging:
stage: staging
needs: ["EgwProxy.Ftp:build"]
tags:
- win
variables:
CONFIG: Debug
APP_NAME: EgwProxy.Ftp
only:
refs:
- develop
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 fe387daa-d07c-3207-877e-96c8be1be91b -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.Icoel:build:staging:
stage: staging
needs: ["EgwProxy.Icoel:build"]
@@ -439,30 +398,6 @@ IOB-WIN-NEXT:release:
- *hashBuild
- *nexusUpload
EgwProxy.Ftp:build:release:
stage: release
needs: ["EgwProxy.Ftp:build"]
tags:
- win
variables:
CONFIG: Release
APP_NAME: EgwProxy.Ftp
only:
refs:
- SDK/Ftp
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" pack "$env:APP_NAME\$env:APP_NAME.csproj" -properties Configuration=$env:CONFIG -Version $env:NUM_REL'
- '& "$env:NUGET_PATH" setapikey fe387daa-d07c-3207-877e-96c8be1be91b -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.Icoel:build:release:
stage: release
needs: ["EgwProxy.Icoel:build"]
@@ -537,20 +472,6 @@ EgwProxy.OsaiCncLib:build:release:
# --------------------------------
# DocFx
# --------------------------------
EgwProxy.Ftp:docfx:
stage: docfx
needs: ["EgwProxy.Ftp:build"]
tags:
- win
variables:
APP_NAME: EgwProxy.Ftp
only:
- SDK/Ftp
script:
- docfx $env:APP_NAME/docfx.json
- mv $env:APP_NAME/_site "docfx"
- *DocReplica
EgwProxy.Icoel:docfx:
stage: docfx
needs: ["EgwProxy.Icoel:build"]
-72
View File
@@ -1,72 +0,0 @@
namespace EgwCApp.Core
{
/// <summary>
/// Implementazione di riferimento x un file di configurazione x esecuzione task tramite EgwCApp
/// </summary>
public class ConfigFile
{
#region Public Properties
/// <summary>
/// Path Archivio dove depositare file ORIGINALI processati (se !="" vanno archiviati)
/// </summary>
public string ArchiveDir { get; set; } = "";
/// <summary>
/// Path dove depositare file tradotti processati (se !="" vanno spostati li)
/// </summary>
public string ConvertDir { get; set; } = "";
/// <summary>
/// Path file da processare
/// </summary>
public string FileInPath { get; set; } = "demoIn.txt";
/// <summary>
/// Path file dove salvare
/// </summary>
public string FileOutPath { get; set; } = "";
/// <summary>
/// IdxODL da registrare
/// </summary>
public int IdxODL { get; set; } = 0;
/// <summary>
/// Parametri per processing file string --&gt; int
/// </summary>
public Dictionary<string, int> ProcessParamInt { get; set; } = new Dictionary<string, int>();
/// <summary>
/// Parametri per processing file string --&gt; string
/// </summary>
public Dictionary<string, string> ProcessParamStr { get; set; } = new Dictionary<string, string>();
/// <summary>
/// DB Redis dove salvare
/// </summary>
public int RedisDB { get; set; } = 0;
/// <summary>
/// Posizione Redis dove salvare (HashKey)
/// </summary>
public string RedisOut { get; set; } = "";
/// <summary>
/// Modalità ritorno risutlati
/// </summary>
public ReturnMode Return { get; set; } = ReturnMode.ND;
/// <summary>
/// Path file da processare
/// </summary>
public string TargetName { get; set; } = "";
/// <summary>
/// Tipologia di iport da condurre
/// </summary>
public ImportType Type { get; set; } = ImportType.ND;
#endregion Public Properties
}
}
-15
View File
@@ -1,15 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ExcelDataReader.DataSet" Version="3.6.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="StackExchange.Redis" Version="2.6.86" />
</ItemGroup>
</Project>
-37
View File
@@ -1,37 +0,0 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace EgwCApp.Core
{
/// <summary>
/// Tipologia file da importare
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ImportType
{
ND = 0,
CSV,
Excel
}
[JsonConverter(typeof(StringEnumConverter))]
public enum rawTransfType
{
ND,
IcoelBatch,
IcoelVarInfo,
RegGiacenze
}
/// <summary>
/// Modalità ritorno risultati
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum ReturnMode
{
ND = 0,
Console,
File,
Redis
}
}
-107
View File
@@ -1,107 +0,0 @@
using ExcelDataReader;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCApp.Core
{
/// <summary>
/// Gestione lettura excel:
/// https://github.com/ExcelDataReader/ExcelDataReader
/// </summary>
public class ExcelMan
{
protected string _path { get; set; } = "";
/// <summary>
/// Avvio componente x il file indicato
/// </summary>
/// <param name="filePath"></param>
public ExcelMan(string filePath)
{
// verifico esistenza file...
if (File.Exists(filePath))
{
_path = filePath;
}
}
public DataSet getDataSet()
{
DataSet result = new DataSet();
using (var stream = File.Open(_path, FileMode.Open, FileAccess.Read))
{
// Auto-detect format, supports:
// - Binary Excel files (2.0-2003 format; *.xls)
// - OpenXml Excel files (2007 format; *.xlsx, *.xlsb)
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
using (var reader = ExcelReaderFactory.CreateReader(stream))
{
// 2. Use the AsDataSet extension method
//result = reader.AsDataSet();
// The result of each spreadsheet is in result.Tables
// modalità lettura con intestazione
result = reader.AsDataSet(new ExcelDataSetConfiguration()
{
ConfigureDataTable = (_) => new ExcelDataTableConfiguration()
{
UseHeaderRow = true
}
});
#if false
result = reader.AsDataSet();
#endif
}
}
return result;
}
public IExcelDataReader getExcelReader()
{
// ExcelDataReader works with the binary Excel file, so it needs a FileStream
// to get started. This is how we avoid dependencies on ACE or Interop:
FileStream stream = File.Open(_path, FileMode.Open, FileAccess.Read);
// We return the interface, so that
IExcelDataReader reader = null;
try
{
if (_path.EndsWith(".xls"))
{
reader = ExcelReaderFactory.CreateBinaryReader(stream);
}
if (_path.EndsWith(".xlsx"))
{
reader = ExcelReaderFactory.CreateOpenXmlReader(stream);
}
return reader;
}
catch (Exception)
{
throw;
}
}
public IEnumerable<string> getWorksheetNames()
{
var reader = this.getExcelReader();
var workbook = reader.AsDataSet();
var sheets = from DataTable sheet in workbook.Tables select sheet.TableName;
return sheets;
}
public IEnumerable<DataRow> getData(string sheet, bool firstRowIsColumnNames = true)
{
var reader = this.getExcelReader();
//reader.IsFirstRowAsColumnNames = firstRowIsColumnNames;
var workSheet = reader.AsDataSet().Tables[sheet];
var rows = from DataRow a in workSheet.Rows select a;
return rows;
}
}
}
-32
View File
@@ -1,32 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCApp.Core
{
public class RedisMan
{
protected string connString = "";
protected string servAddr = "";
protected int servPort = 0;
protected int redisDb = 0;
public RedisMan(string server, int port, int db)
{
servAddr = server;
servPort = port;
redisDb = db;
connString = $"{servAddr}:{servPort},db={redisDb},abortConnect=false,ssl=false";
}
public bool writeData(string redKey, string rawData)
{
return false;
}
public string getRSV(string redKey)
{
return "";
}
}
}
-28
View File
@@ -1,28 +0,0 @@
namespace EgwCApp.Core
{
public class WharehouseData
{
#region Public Classes
public class BatchRec
{
#region Public Properties
public DateTime DateRif { get; set; } = DateTime.Today;
public string ExtDoc { get; set; } = "Doc";
public string IdentRG { get; set; } = "NA";
public int IdxODL { get; set; } = 0;
public string Notes { get; set; } = "Notes";
public int NumPack { get; set; } = 0;
public string Product { get; set; } = "Prod";
public double QtyTot { get; set; } = 0.0;
public string Supplier { get; set; } = "Suppl";
public string Variety { get; set; } = "Var";
#endregion Public Properties
}
#endregion Public Classes
}
}
-37
View File
@@ -1,37 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32516.85
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EgwCApp.Testing", "EgwCApp.Testing\EgwCApp.Testing.csproj", "{E37013B7-E5C6-48ED-8051-0BA5F29CB234}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EgwCApp.ExcImport", "EgwCApp.ExcImport\EgwCApp.ExcImport.csproj", "{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwCApp.Core", "EgwCApp.Core\EgwCApp.Core.csproj", "{DF02D478-2309-48B8-BF0D-90B02327AF02}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E37013B7-E5C6-48ED-8051-0BA5F29CB234}.Release|Any CPU.Build.0 = Release|Any CPU
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D689CB4E-14DB-4CD4-B0D6-D2029219EF7E}.Release|Any CPU.Build.0 = Release|Any CPU
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF02D478-2309-48B8-BF0D-90B02327AF02}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2AF3181F-288A-47D5-8087-2AB660476D85}
EndGlobalSection
EndGlobal
@@ -1,32 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>ExcImport</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="StackExchange.Redis" Version="2.6.86" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EgwCApp.Core\EgwCApp.Core.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="testConfExcel.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="testConfCsv.json">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</None>
<None Update="testConf.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
-373
View File
@@ -1,373 +0,0 @@
using EgwCApp.Core;
using Newtonsoft.Json;
using static EgwCApp.Core.WharehouseData;
namespace EgwCApp.ExcImport
{
public class ImportProc
{
#region Public Constructors
/// <summary>
/// Init oggetto per import
/// </summary>
/// <param name="confFileName"></param>
public ImportProc(string confFileName)
{
if (!string.IsNullOrEmpty(confFileName))
{
fileConfName = confFileName;
}
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Decodifica configurazione
/// </summary>
/// <returns></returns>
public bool decodeConfig()
{
bool answ = false;
if (!string.IsNullOrEmpty(fileConfName))
{
// deserializzo config
if (!File.Exists(fileConfName))
{
Console.WriteLine($"Error: ConfigFile not found | {fileConfName}");
}
else
{
string rawData = File.ReadAllText(fileConfName);
// se ho contenuto procedo
if (string.IsNullOrEmpty(rawData))
{
Console.WriteLine($"Error: ConfigFile empty! | {fileConfName}");
}
else
{
// deserializzo
taskConfig = JsonConvert.DeserializeObject<ConfigFile>(rawData);
answ = taskConfig != null;
}
}
}
return answ;
}
/// <summary>
/// Esegue import (se possibile)
/// </summary>
/// <returns></returns>
public bool doProcess()
{
bool answ = false;
if (taskConfig != null)
{
// verifico esista il file...
if (string.IsNullOrEmpty(taskConfig.FileInPath) && File.Exists(taskConfig.FileInPath))
{
// manca file ingresso!!! esco!
}
else
{
// verifico il tipo di process necessario...
switch (taskConfig.Type)
{
case ImportType.CSV:
fileReturnData = File.ReadAllText(taskConfig.FileInPath);
answ = true;
break;
case ImportType.Excel:
fileReturnData = processExcelImport(taskConfig.FileInPath);
answ = true;
break;
case ImportType.ND:
default:
break;
}
}
}
return answ;
}
/// <summary>
/// Esecuzione ritorno informazioni secondo configurazione...
/// </summary>
/// <returns></returns>
public bool doReturn()
{
bool answ = false;
if (taskConfig != null)
{
// verifico il tipo di return necessario...
switch (taskConfig.Return)
{
case ReturnMode.Console:
Console.WriteLine(fileReturnData);
answ = true;
break;
case ReturnMode.Redis:
break;
case ReturnMode.File:
// verifico path ci sia... sennò creo
string outPath = string.IsNullOrEmpty(taskConfig.FileOutPath) ? "FileOut.txt" : taskConfig.FileOutPath;
// verifico se vadano salvati in una folder differente...
if (!string.IsNullOrEmpty(taskConfig.ConvertDir))
{
if (!Directory.Exists(taskConfig.ConvertDir))
{
Directory.CreateDirectory(taskConfig.ConvertDir);
}
outPath = Path.Combine(taskConfig.ConvertDir, Path.GetFileName(outPath));
}
// salvo il file!
File.WriteAllText(outPath, fileReturnData);
answ = true;
break;
case ReturnMode.ND:
default:
break;
}
// se fatto eventualmente archivio
if (answ)
{
if (!string.IsNullOrEmpty(taskConfig.ArchiveDir))
{
// verifico cartella archivio
if (!Directory.Exists(taskConfig.ArchiveDir))
{
Directory.CreateDirectory(taskConfig.ArchiveDir);
}
// sposto file
string fName = Path.GetFileName(taskConfig.FileInPath);
File.Move(taskConfig.FileInPath, Path.Combine(taskConfig.ArchiveDir, fName), true);
}
}
}
return answ;
}
#endregion Public Methods
#region Protected Properties
/// <summary>
/// Nome del file config da processare
/// </summary>
protected string fileConfName { get; set; } = "";
/// <summary>
/// Contenuto del file da restituire come return data (serializzato)
/// </summary>
protected string fileReturnData { get; set; } = "";
/// <summary>
/// Configurazione del task da eseguire
/// </summary>
protected ConfigFile? taskConfig { get; set; } = new ConfigFile();
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Estrae da una riga l'i-esimo elemento
/// </summary>
/// <param name="riga"></param>
/// <param name="col"></param>
/// <returns></returns>
protected string getCellVal(System.Data.DataRow? riga, int col)
{
string answ = "";
if (riga != null)
{
try
{
answ = $"{riga.ItemArray[col]}".Trim();
}
catch
{ }
}
return answ;
}
/// <summary>
/// Cleanup stringa x impiego tipo ident da char dubbi
/// </summary>
/// <param name="origData"></param>
/// <returns></returns>
protected string strFixId(string origData)
{
return origData.Replace(".", "").Replace(" ", "_");
}
#endregion Protected Methods
#region Private Methods
/// <summary>
/// Importa un file excel e restituisce una
/// </summary>
/// <param name="fileItem"></param>
/// <returns></returns>
private string processExcelImport(string fileItem)
{
string outVal = "";
int numErr = 0;
// test procedura di import files excel x Giacovelli...
var currExcel = new ExcelMan(fileItem);
// creo lista dati in formato RegGiacenze...
Dictionary<string, BatchRec> listaGiac = new Dictionary<string, BatchRec>();
var dtSet = currExcel.getDataSet();
if (dtSet != null && dtSet.Tables != null && dtSet.Tables.Count > 0)
{
string nomeFile = Path.GetFileName(fileItem);
nomeFile = nomeFile.Substring(0, nomeFile.LastIndexOf("."));
var elSheet = dtSet.Tables;
int idxTab = 0;
// cerco lo sheet corretto se > 1
if (dtSet.Tables.Count > 1)
{
bool found = false;
for (int i = 0; i < dtSet.Tables.Count; i++)
{
if (nomeFile.Contains(dtSet.Tables[i].TableName))
{
idxTab = i;
found = true;
break;
}
// controllo parametro opzionale...
if (!found && taskConfig != null && !string.IsNullOrEmpty(taskConfig.TargetName))
{
if (dtSet.Tables[i].TableName == taskConfig.TargetName)
{
idxTab = i;
break;
}
}
}
}
var tabella = dtSet.Tables[idxTab];
int numRighe = tabella.Rows.Count;
int idxODL = taskConfig != null ? taskConfig.IdxODL : 0;
for (int i = 0; i < numRighe; i++)
{
if (taskConfig != null && taskConfig.ProcessParamInt != null && taskConfig.ProcessParamInt.Count > 5)
{
if (numErr < numRighe / 5)
{
try
{
// variabili di appoggio...
DateTime dtRif = DateTime.Today;
double qtyTot = 0;
int numPack = 0;
var riga = tabella.Rows[i];
if (riga != null)
{
string ddt = getCellVal(riga, taskConfig.ProcessParamInt["ExtDoc"]);
string sDate = getCellVal(riga, taskConfig.ProcessParamInt["DateRif"]);
string prod = getCellVal(riga, taskConfig.ProcessParamInt["Product"]);
// verifiche x import: header, data e DDT (vuoti o "-") --> SKIP!
bool checkHeaderKo = (ddt == "DDT" || prod == "PRODOTTO");
bool checkEmptyDdt = (string.IsNullOrEmpty(ddt) || ddt == "-");
bool checkEmptyDate = (string.IsNullOrEmpty(sDate) || sDate == "-");
if (checkHeaderKo)
{
//lgTrace($"SKIP header");
}
else if (checkEmptyDdt || checkEmptyDate)
{
//lgTrace($"SKIP linea vuota | i: {i} | ddt: {ddt} | date: {sDate} | prod: {prod}");
}
else
{
string variety = getCellVal(riga, taskConfig.ProcessParamInt["Variety"]);
string suppl = getCellVal(riga, taskConfig.ProcessParamInt["Supplier"]);
string sQty = getCellVal(riga, taskConfig.ProcessParamInt["QtyTot"]);
string sNum = getCellVal(riga, taskConfig.ProcessParamInt["NumPack"]);
string numPed = getCellVal(riga, taskConfig.ProcessParamInt["NumPed"]);
string packPed = getCellVal(riga, taskConfig.ProcessParamInt["PackPed"]);
string pesoPack = getCellVal(riga, taskConfig.ProcessParamInt["PesoPack"]);
DateTime.TryParse(sDate, out dtRif);
int.TryParse(sNum, out numPack);
double.TryParse(sQty, out qtyTot);
string identRG = ddt.Length > 2 ? $"{strFixId(ddt)}.{strFixId(prod)}.{strFixId(variety)}.{strFixId(suppl)}" : $"{dtRif:yyyyMMdd}.{strFixId(prod)}.{strFixId(variety)}.{strFixId(suppl)}";
string notes = $"{numPed}x{packPed}x{pesoPack}";
// verifico di avere dati per proseguire...
bool checkIdent = !string.IsNullOrEmpty($"{prod}{variety}{suppl}");
if (checkIdent)
{
BatchRec newRow = new BatchRec()
{
IdxODL = idxODL,
IdentRG = identRG,
DateRif = dtRif,
ExtDoc = ddt,
Product = prod,
Variety = variety,
Supplier = suppl,
NumPack = numPack,
QtyTot = qtyTot,
Notes = notes
};
// verifico: se manca aggiungo
if (!listaGiac.ContainsKey(identRG))
{
listaGiac.Add(identRG, newRow);
}
else
{
// altrimenti aggiorno giacenza con valori numerici
listaGiac[identRG].NumPack += newRow.NumPack;
listaGiac[identRG].QtyTot += newRow.QtyTot;
}
}
else
{
//lgError($"Errore verifica identità riga | prod: {prod} | variety: {variety} | suppl: {suppl}");
numErr++;
}
}
}
}
catch (Exception exc)
{
numErr++;
}
}
}
}
}
if (listaGiac.Count > 0)
{
// converto in una nuova lista...
int rCounter = 1;
Dictionary<int, BatchRec> list2Send = new Dictionary<int, BatchRec>();
foreach (var item in listaGiac)
{
list2Send.Add(rCounter, item.Value);
rCounter++;
}
// serializzo e restituisco file JSON...
var serVal = JsonConvert.SerializeObject(list2Send);
if (serVal != null && !string.IsNullOrEmpty(serVal))
{
outVal = serVal;
}
}
return outVal;
}
#endregion Private Methods
}
}
-61
View File
@@ -1,61 +0,0 @@
// See https://aka.ms/new-console-template for more information
// ExcImport: Excel Importer, per IobWin in logica lettura Giacenze
// parametri:
// $0: Path ConfigFile file per esecuzione
using EgwCApp.ExcImport;
string separator = "--------------------------------------";
string fileName = "";
// controllo args, se mancassero o incompleti mostro help
if (args.Length < 1)
{
Console.WriteLine(separator);
Console.WriteLine("- ExcelFileImporter - Core 6.0");
Console.WriteLine("- v.0.0.0.0 | @Egalware 2022+");
Console.WriteLine(separator);
Console.WriteLine();
Console.WriteLine("Mancano parametri per esecuzione:");
Console.WriteLine("");
Console.WriteLine("$0: ConfigFile da impiegare");
// provo a processare testConf...
fileName = "testConf.json";
}
else
{
fileName = args[0];
}
// ora processo se ho filename valido...
if (!string.IsNullOrEmpty(fileName))
{
// verifico se ho file...
if (File.Exists(fileName))
{
ImportProc importObj = new ImportProc(fileName);
bool stepOk = importObj.decodeConfig();
if (stepOk)
{
stepOk = importObj.doProcess();
if (!stepOk)
{
Console.WriteLine("Errore in processing file");
}
else
{
importObj.doReturn();
}
}
else
{
Console.WriteLine("Errore in processing config file");
}
}
else
{
Console.WriteLine("Errore file non trovato!");
}
}
-4
View File
@@ -1,4 +0,0 @@
@echo off
REM compilo in publish
dotnet publish EgwCApp.ExcImport.csproj -p:PublishSingleFile=true -r win-x64 -c Release --self-contained false
-25
View File
@@ -1,25 +0,0 @@
{
"ArchiveDir": "C:\\temp\\import\\archive",
"ConvertDir": "C:\\temp\\import\\convert",
"FileInPath": "C:\\temp\\import\\01.12.xlsx",
"FileOutPath": "01.12.json",
"IdxODL": 987654321,
"ProcessParamInt": {
"Product": 3,
"Variety": 9,
"Supplier": 8,
"ExtDoc": 2,
"DateRif": 14,
"QtyTot": 22,
"NumPack": 21,
"NumPed": 17,
"PackPed": 18,
"PesoPack": 20
},
"ProcessParamStr": {},
"RedisDB": 0,
"RedisOut": "",
"Return": "File",
"TargetName": "DB Loco",
"Type": "Excel"
}
@@ -1,6 +0,0 @@
{
"FilePath": "C:\\Temp\\test.log",
"ProcessParams": {},
"Return": "Console",
"Type": "Excel"
}
@@ -1,25 +0,0 @@
{
"ArchiveDir": "C:\\temp\\import\\archive",
"ConvertDir": "C:\\temp\\import\\convert",
"FileInPath": "C:\\temp\\import\\01.12.xlsx",
"FileOutPath": "01.12.json",
"IdxODL": 987654321,
"ProcessParamInt": {
"Product": 3,
"Variety": 9,
"Supplier": 8,
"ExtDoc": 2,
"DateRif": 14,
"QtyTot": 22,
"NumPack": 21,
"NumPed": 17,
"PackPed": 18,
"PesoPack": 20
},
"ProcessParamStr": {},
"RedisDB": 0,
"RedisOut": "",
"Return": "File",
"TargetName": "DB Loco",
"Type": "Excel"
}
-9
View File
@@ -1,9 +0,0 @@
echo ------------ Parametri compilazione ------------
echo OutDir: $(OutDir)
echo Configuration: $(ConfigurationName)
echo ProjectDir: $(ProjectDir)
echo AssemblyName: $(AssemblyName)
echo TargetDir: $(TargetDir)
echo ------------ Parametri compilazione ------------
preBuild.bat $(SolutionDir)EgwCApp.ExcImport\EgwCApp.ExcImport.csproj $(SolutionDir)EgwCApp.ExcImport\bin\Release\net6.0\publish\win-x64\ $(ProjectDir)Utils
@@ -1,42 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>embedded</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<Folder Include="Tools\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EgwCApp.Core\EgwCApp.Core.csproj" />
<ProjectReference Include="..\EgwCApp.ExcImport\EgwCApp.ExcImport.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Tools\ExcImport.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="preBuild.bat $(SolutionDir)EgwCApp.ExcImport\bin\Release\net6.0\win-x64\publish\ $(ProjectDir)Tools" />
</Target>
</Project>
-114
View File
@@ -1,114 +0,0 @@
using EgwCApp.Core;
using Newtonsoft.Json;
using System.Diagnostics;
namespace EgwCApp.Testing
{
public class FileProcMan
{
#region Public Constructors
public FileProcMan(string toolDir, string exeFileName)
{
this.confFileName = "conf.json";
this.baseDir = toolDir;
this.exeName = exeFileName;
appPath = $"./{baseDir}/{exeName}";
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Processa il singolo file e riporta tempo esecuzione
/// </summary>
/// <returns></returns>
public TimeSpan doProcess(string fPath)
{
TimeSpan outVal = new TimeSpan();
Stopwatch sw = new Stopwatch();
// preparo file conf
createConfFile(fPath);
// avvio processing
Console.WriteLine("calling ext app with args:");
Console.WriteLine($"{appPath} {confFileName}");
Console.WriteLine();
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = appPath,
Arguments = $"{confFileName}",
WindowStyle = ProcessWindowStyle.Minimized,
//WindowStyle = ProcessWindowStyle.Hidden,
UseShellExecute = false,
//CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardInput = true,
};
sw.Start();
Process p = Process.Start(psi);
string q = "";
while (!p.HasExited)
{
q += p.StandardOutput.ReadToEnd();
}
sw.Stop();
outVal = sw.Elapsed;
return outVal;
}
#endregion Public Methods
#region Protected Fields
protected string appPath = "";
protected string baseDir = "";
protected string confFileName = "";
protected string exeName = "";
#endregion Protected Fields
#region Private Methods
private void createConfFile(string item)
{
Dictionary<string, int> importParams = new Dictionary<string, int>();
importParams.Add("Product", 3);
importParams.Add("Variety", 9);
importParams.Add("Supplier", 8);
importParams.Add("ExtDoc", 2);
importParams.Add("DateRif", 14);
importParams.Add("QtyTot", 22);
importParams.Add("NumPack", 21);
importParams.Add("NumPed", 17);
importParams.Add("PackPed", 18);
importParams.Add("PesoPack", 20);
// calcolo nome file conf specifico
string outFileName = Path.GetFileName(item).Replace("xlsx", "json");
confFileName = $"conf_{outFileName}";
// calcolo outFIleName
var newConf = new ConfigFile()
{
ArchiveDir = @"C:\temp\import\archive\",
ConvertDir = @"C:\temp\import\convert\",
Type = ImportType.Excel,
FileInPath = item,
FileOutPath = outFileName,
Return = ReturnMode.File,
ProcessParamInt = importParams,
TargetName = "DB Loco"
};
// serializzo e salvo!
var rawData = JsonConvert.SerializeObject(newConf, Formatting.Indented);
File.WriteAllText(confFileName, rawData);
}
#endregion Private Methods
}
}
-65
View File
@@ -1,65 +0,0 @@
// See https://aka.ms/new-console-template for more information
using EgwCApp.Core;
using System.Diagnostics;
using Newtonsoft.Json;
using EgwCApp.Testing;
Dictionary<string, TimeSpan> statsColl = new Dictionary<string, TimeSpan>();
Stopwatch sw = new Stopwatch();
string separator = "--------------------------------------";
Console.WriteLine(separator);
Console.WriteLine("Console Test Application");
Console.WriteLine(separator);
Console.WriteLine();
// creo il file di configurazione...
string fileName = "conf.json";
ConfigFile newConf = new ConfigFile();
string rawData = "";
// test CSV
//newConf = new ConfigFile()
//{
// Type = ImportType.CSV,
// FileInPath = @"C:\Temp\test.log",
// Return = ReturnMode.Console
//};
// svuoto eventuali conf vecchi
var listaConf = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.json");
if (listaConf != null && listaConf.Count() > 0)
{
foreach (var file2del in listaConf)
{
File.Delete(file2del);
}
}
// cerco file xlsx e ciclo...
var listaFiles = Directory.GetFiles(@"C:\temp\import\", "*.xlsx");
if (listaFiles != null && listaFiles.Count() > 0)
{
FileProcMan fpm = new FileProcMan("Tools", "ExcImport.exe");
foreach (var item in listaFiles)
{
TimeSpan timeElaps = fpm.doProcess(item);
statsColl.Add($"Ext prog executed for {item}", timeElaps);
}
}
Console.WriteLine(separator);
Console.WriteLine("press enter to proceed...");
Console.ReadLine();
foreach (var item in statsColl)
{
Console.WriteLine($"{item.Key} {item.Value.TotalMilliseconds} ms");
}
//Console.WriteLine($"Display executed in {timeElaps.TotalMilliseconds} ms");
Console.ReadLine();
Binary file not shown.
-6
View File
@@ -1,6 +0,0 @@
@echo off
REM recupero versione compilata
ROBOCOPY %1 %2 *.exe /MIR
echo Eseguito restore CApp!
-31
View File
@@ -1,31 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32901.82
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Ftp.Test", "EgwProxy.Ftp.Test\EgwProxy.Ftp.Test.csproj", "{A655A6AC-5997-46F9-9752-8C621B80516C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgwProxy.Ftp", "EgwProxy.Ftp\EgwProxy.Ftp.csproj", "{35D95ED8-E48A-434D-A305-A83E48C8FC6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A655A6AC-5997-46F9-9752-8C621B80516C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A655A6AC-5997-46F9-9752-8C621B80516C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A655A6AC-5997-46F9-9752-8C621B80516C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A655A6AC-5997-46F9-9752-8C621B80516C}.Release|Any CPU.Build.0 = Release|Any CPU
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35D95ED8-E48A-434D-A305-A83E48C8FC6F}.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
-26
View File
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>EgwProxy.Ftp</id>
<version>#version#</version>
<title>EgwProxy.Ftp</title>
<authors>Samuele E. Locatelli, EgalWare</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<description>Libreria per comunicazione con server Ftp (IOB-WIN-NEXT) - beta/unstable</description>
<releaseNotes>#releaseNotes#</releaseNotes>
<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>
<file src="EgwProxy.Ftp\bin\Debug\EgwProxy*.dll" target="lib" />
<file src="EgwProxy.Ftp\bin\Debug\EgwProxy*.config" target="lib" />
<file src="EgwProxy.Ftp\bin\Debug\EgwProxy*.pdb" target="lib" />
</files>
</package>
-23
View File
@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>EgwProxy.Ftp</id>
<version>#version#</version>
<title>EgwProxy.Ftp</title>
<authors>Samuele E. Locatelli, EgalWare</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<description>Libreria per comunicazione con server Ftp (IOB-WIN-NEXT)</description>
<releaseNotes>#releaseNotes#</releaseNotes>
<copyright>#copyright#</copyright>
<tags>EgwProxy.Ftp EgwProxy Ftp</tags>
<dependencies>
<dependency id="FluentFTP" version="41.0.0" />
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" />
</dependencies>
</metadata>
<files>
<file src="EgwProxy.Ftp\bin\Release\EgwProxy*.dll" target="lib" />
<file src="EgwProxy.Ftp\bin\Release\EgwProxy*.config" target="lib" />
</files>
</package>
-51
View File
@@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<appSettings>
<add key="testFile" value="conf/testSetup.json" />
<add key="server" value="ftp.steamware.net" />
<add key="userName" value="testftpuser" />
<add key="passwd" value="we4reFromB3rghem!" />
<add key="rawCert" value="" />
<add key="skipCert" value="true" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<runtime>
<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-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.1" newVersion="4.0.5.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
@@ -1,84 +0,0 @@
<?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>{A655A6AC-5997-46F9-9752-8C621B80516C}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>EgwProxy.Ftp.Test</RootNamespace>
<AssemblyName>EgwProxy.Ftp.Test</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<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' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentFTP, Version=41.0.0.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
<HintPath>..\packages\FluentFTP.41.0.0\lib\net462\FluentFTP.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Web.Extensions" />
<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" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestSetup.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="conf\testSetup.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="conf\.placeholder" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Content Include="test\FileProva.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="temp\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EgwProxy.Ftp\EgwProxy.Ftp.csproj">
<Project>{35d95ed8-e48a-434d-a305-a83e48c8fc6f}</Project>
<Name>EgwProxy.Ftp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
-374
View File
@@ -1,374 +0,0 @@
using Newtonsoft.Json;
using System;
using System.Configuration;
using System.IO;
using static System.Net.Mime.MediaTypeNames;
namespace EgwProxy.Ftp.Test
{
internal class Program
{
#region Protected Methods
/// <summary>
/// legge conf in formato stringa
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
protected static string ReadSetting(string key)
{
string answ = "";
try
{
answ = $"{ConfigurationManager.AppSettings[key]}" ?? "";
}
catch (Exception exc)
{
Console.Write("Eccezione in ReadSettings");
Console.Write(exc.Message);
}
return answ;
}
#endregion Protected Methods
#region Private Fields
/// <summary>
/// Helper separatore dash
/// </summary>
private const string separator = "------------------------";
#endregion Private Fields
#region Private Methods
/// <summary>
/// Programma principale
/// </summary>
/// <param name="args"></param>
private static void Main(string[] args)
{
Console.WriteLine(separator);
Console.WriteLine("Test FTP Client");
Console.WriteLine(separator);
Console.WriteLine();
string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;
string BaseDirectory = System.IO.Path.GetDirectoryName(exePath);
string testFile = Path.Combine(BaseDirectory, ReadSetting("testFile"));
Manager ftpClient = new Manager("", "", "", "", false);
if (!string.IsNullOrEmpty(testFile))
{
Console.WriteLine(separator);
Console.WriteLine($"Mode json ({testFile})");
Console.WriteLine(separator);
Console.WriteLine();
if (File.Exists(testFile))
{
var rawData = File.ReadAllText(testFile);
if (!string.IsNullOrEmpty(rawData))
{
TestSetup testConf = new TestSetup();
try
{
testConf = JsonConvert.DeserializeObject<TestSetup>(rawData);
}
catch
{ }
// setup server
ftpClient = new Manager(testConf.server, testConf.user, testConf.password, testConf.rawCert, testConf.skipCert);
serverTest(ftpClient);
// eseguo per ogni step
foreach (var item in testConf.steps)
{
Console.WriteLine($"------ Step {item.id} | {item.description} ------");
string esitoStep = "";
switch (item.action)
{
case stepType.checkDir:
if (item.paramList != null && item.paramList.Count > 0)
{
string dir2check = item.paramList[0];
var dirCheckExists = ftpClient.dirExists(dir2check);
esitoStep = dirCheckExists ? $"Directory {dir2check} found!" : $"Directory {dir2check} NOT found!";
}
else
{
esitoStep = "Error: missing parameter!";
}
break;
case stepType.checkFile:
if (item.paramList != null && item.paramList.Count > 0)
{
string file2check = item.paramList[0];
var dirCheckExists = ftpClient.fileExists(file2check);
esitoStep = dirCheckExists ? $"File {file2check} found!" : $"File {file2check} NOT found!";
}
else
{
esitoStep = "Error: missing parameter!";
}
break;
case stepType.createDir:
if (item.paramList != null && item.paramList.Count > 0)
{
string dir2check = item.paramList[0];
var preTest = ftpClient.dirExists(dir2check);
if (preTest)
{
esitoStep = "Error: Folder already exists!";
}
else
{
var dirCreate = ftpClient.createDir(dir2check);
esitoStep = dirCreate ? $"Directory {dir2check} created!" : $"Error: {dir2check} NOT created!";
}
}
else
{
esitoStep = "Error: missing parameter!";
}
break;
case stepType.delDir:
if (item.paramList != null && item.paramList.Count > 0)
{
string dir2check = item.paramList[0];
var preTest = ftpClient.dirExists(dir2check);
if (preTest)
{
var dirDelete = ftpClient.deleteDir(dir2check);
esitoStep = dirDelete ? $"Directory {dir2check} deleted!" : $"Error: {dir2check} NOT deleted!";
}
else
{
esitoStep = "Error: Folder doesn't exists, delete not possible!";
}
}
else
{
esitoStep = "Error: missing parameter!";
}
break;
case stepType.delFile:
if (item.paramList != null && item.paramList.Count > 0)
{
string file2check = item.paramList[0];
var preTest = ftpClient.fileExists(file2check);
if (preTest)
{
var dirDelete = ftpClient.deleteFile(file2check);
esitoStep = dirDelete ? $"File {file2check} deleted!" : $"Error: {file2check} NOT deleted!";
}
else
{
esitoStep = "Error: File doesn't exists, delete not possible!";
}
}
else
{
esitoStep = "Error: missing parameter!";
}
break;
case stepType.downloadDir:
if (item.paramList != null && item.paramList.Count > 1)
{
string dir2check = item.paramList[0];
string localDir = Path.Combine(BaseDirectory, item.paramList[1]);
var preTest = ftpClient.dirExists(dir2check);
if (preTest)
{
var dirDelete = ftpClient.getDir(localDir, dir2check);
esitoStep = dirDelete ? $"Directory {dir2check} downloaded!" : $"Error: {dir2check} NOT downloaded!";
}
else
{
esitoStep = "Error: Folder doesn't exists, download not possible!";
}
}
else
{
esitoStep = "Error: missing parameters!";
}
break;
case stepType.downloadFile:
if (item.paramList != null && item.paramList.Count > 1)
{
string dir2check = item.paramList[0];
string localDir = Path.Combine(BaseDirectory, item.paramList[1]);
var preTest = ftpClient.dirExists(dir2check);
if (preTest)
{
var dirDelete = ftpClient.getDir(localDir, dir2check);
esitoStep = dirDelete ? $"Directory {dir2check} downloaded!" : $"Error: {dir2check} NOT downloaded!";
}
else
{
esitoStep = "Error: Folder doesn't exists, download not possible!";
}
}
else
{
esitoStep = "Error: missing parameters!";
}
break;
case stepType.uploadDir:
if (item.paramList != null && item.paramList.Count > 1)
{
string remoteDir = item.paramList[0];
string localDir = Path.Combine(BaseDirectory, item.paramList[1]);
var dirUploaded = ftpClient.sendDir(localDir, remoteDir);
esitoStep = dirUploaded ? $"Directory {remoteDir} uploaded!" : $"Error: {remoteDir} NOT uploaded!";
}
else
{
esitoStep = "Error: missing parameters!";
}
break;
case stepType.uploadFile:
if (item.paramList != null && item.paramList.Count > 1)
{
string remotePath = item.paramList[0];
string localPath = Path.Combine(BaseDirectory, item.paramList[1]);
var fileUploaded = ftpClient.sendFile(localPath, remotePath);
esitoStep = fileUploaded ? $"File {remotePath} uploaded!" : $"Error: {remotePath} NOT uploaded!";
}
else
{
esitoStep = "Error: missing parameters!";
}
break;
case stepType.listContent:
if (item.paramList != null && item.paramList.Count > 0)
{
string remoteDir = item.paramList[0];
var preTest = ftpClient.dirExists(remoteDir);
if (preTest)
{
var listResult = ftpClient.listDir(remoteDir, false);
Console.WriteLine($"Content of dir {remoteDir}:");
foreach (var itemList in listResult)
{
Console.WriteLine(itemList);
}
}
else
{
esitoStep = "Error: Folder doesn't exists, list not possible!";
}
}
else
{
esitoStep = "Error: missing parameter!";
}
break;
default:
break;
}
Console.WriteLine(esitoStep);
Console.WriteLine($"------ Done Step {item.id} ------");
Console.WriteLine();
Console.WriteLine("Press a key to continue...");
Console.ReadKey();
}
}
}
}
// test base su server steamware
else
{
Console.WriteLine(separator);
Console.WriteLine("Mode: base");
Console.WriteLine(separator);
Console.WriteLine();
string sSkipCert = ReadSetting("skipCert");
bool skipCert = false;
bool.TryParse(sSkipCert, out skipCert);
ftpClient = new Manager(ReadSetting("server"), ReadSetting("userName"), ReadSetting("passwd"), ReadSetting("rawCert"), skipCert);
serverTest(ftpClient);
Console.WriteLine("--- Folder ---");
var testExists = ftpClient.dirExists($"data/test_folder");
if (testExists)
{
Console.WriteLine("Folder already exists!");
}
else
{
Console.WriteLine("--- Create folder ---");
var testCreate = ftpClient.createDir($"data/test_folder");
Console.WriteLine();
}
Console.WriteLine("Contenuto folder remota: ");
var folderContent = ftpClient.listDir("data/", true);
foreach (var item in folderContent)
{
Console.WriteLine(item);
}
Console.WriteLine();
Console.WriteLine("Premere un tasto x continuare...");
Console.ReadKey();
Console.WriteLine("--- Upload file ---");
ftpClient.sendFile("test/FileProva.txt", "data/test_folder/FileProva.txt");
Console.WriteLine("Contenuto folder remota: ");
folderContent = ftpClient.listDir("data/", true);
foreach (var item in folderContent)
{
Console.WriteLine(item);
}
Console.WriteLine();
Console.WriteLine("Premere un tasto x continuare...");
Console.ReadKey();
Console.WriteLine("--- Download File ---");
ftpClient.getFile("test/FileProva_02.txt", "data/test_folder/FileProva.txt");
Console.WriteLine("Contenuto folder remota: ");
folderContent = ftpClient.listDir("data/", true);
foreach (var item in folderContent)
{
Console.WriteLine(item);
}
Console.WriteLine();
Console.WriteLine("Premere un tasto x continuare...");
Console.ReadKey();
}
}
private static void serverTest(Manager ftpClient)
{
Console.WriteLine(separator);
var testServer = ftpClient.serverOk();
Console.WriteLine($"Test connessione: esito {testServer}");
var srvType = ftpClient.serverType();
Console.WriteLine($"Server: {srvType}");
Console.WriteLine(separator);
Console.WriteLine();
}
#endregion Private Methods
}
}
@@ -1,36 +0,0 @@
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("EgwProxy.Ftp.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EgwProxy.Ftp.Test")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[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("a655a6ac-5997-46f9-9752-8c621b80516c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
-42
View File
@@ -1,42 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwProxy.Ftp.Test
{
public class TestSetup
{
public string server { get; set; } = "";
public string user { get; set; } = "";
public string password { get; set; } = "";
public string rawCert { get; set; } = "";
public bool skipCert { get; set; } = false;
public List<singleStep> steps { get; set; }
}
public class singleStep
{
public string id { get; set; } = "00";
public string description { get; set; } = "00";
public stepType action { get; set; } = stepType.checkDir;
public List<string> paramList { get; set; } = new List<string>();
}
public enum stepType
{
checkDir,
checkFile,
createDir,
delDir,
delFile,
downloadDir,
downloadFile,
uploadDir,
uploadFile,
listContent
}
}
-1
View File
@@ -1 +0,0 @@

-76
View File
@@ -1,76 +0,0 @@
{
"server": "ftp.steamware.net",
"user": "testftpuser",
"password": "we4reFromB3rghem!",
"rawCert": "",
"skipCert": true,
"steps": [
{
"id": "01",
"description": "Test base directory",
"action": "checkDir",
"paramList": [
"data/"
]
},
{
"id": "02",
"description": "Create directory",
"action": "createDir",
"paramList": [
"data/test_directory"
]
},
{
"id": "03",
"description": "Upload File",
"action": "uploadFile",
"paramList": [
"data/test_directory/FileProva.txt",
"test/FileProva.txt"
]
},
{
"id": "04",
"description": "Browse Directory",
"action": "listContent",
"paramList": [
"data/test_directory/"
]
},
{
"id": "05",
"description": "Upload File",
"action": "uploadFile",
"paramList": [
"data/test_directory/FileProva_02.txt",
"test/FileProva.txt"
]
},
{
"id": "06",
"description": "Browse Directory",
"action": "listContent",
"paramList": [
"data/test_directory/"
]
},
{
"id": "07",
"description": "Download Directory",
"action": "downloadDir",
"paramList": [
"data/test_directory/",
"temp/mirror"
]
},
{
"id": "08",
"description": "Delete Remote Directory",
"action": "delDir",
"paramList": [
"data/test_directory/"
]
}
]
}
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentFTP" version="41.0.0" targetFramework="net462" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" targetFramework="net462" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
</packages>
-1
View File
@@ -1 +0,0 @@
File di prova
-57
View File
@@ -1,57 +0,0 @@
<?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>{35D95ED8-E48A-434D-A305-A83E48C8FC6F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>EgwProxy.Ftp</RootNamespace>
<AssemblyName>EgwProxy.Ftp</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="FluentFTP, Version=41.0.0.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
<HintPath>..\packages\FluentFTP.41.0.0\lib\net462\FluentFTP.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<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" />
</ItemGroup>
<ItemGroup>
<Compile Include="Manager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
-325
View File
@@ -1,325 +0,0 @@
using FluentFTP;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Security;
namespace EgwProxy.Ftp
{
/// <summary>
/// Client per operazioni FTP, basato su FluentFTP: https://github.com/robinrodricks/FluentFTP/wiki/Quick-Start-Example
/// </summary>
public class Manager
{
#region Public Constructors
/// <summary>
/// Inizializzazione di oggetto per comunicazione FTP
/// </summary>
/// <param name="server"></param>
/// <param name="userName"></param>
/// <param name="passwd"></param>
/// <param name="rawCert"></param>
/// <param name="skipCert"></param>
public Manager(string server, string userName, string passwd, string rawCert, bool skipCert)
{
_server = server;
_userName = userName;
_passwd = passwd;
_skipCert = skipCert;
_rawCert = rawCert;
if (!string.IsNullOrEmpty(server))
{
// se ho user/pwd è autenticato...
if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(passwd))
{
client = new FtpClient(server, userName, passwd);
}
//.. altrimenti anonimo...
else
{
client = new FtpClient(server);
}
}
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Creazione directory remota
/// </summary>
/// <param name="remoteDir">Nome directory remota da creare (ad es: @"/public_html/videos")</param>
public bool createDir(string remoteDir)
{
tryConnect();
// upload della folder + files, cancellazione extra files = mirroring
bool answ = client.CreateDirectory(remoteDir);
// chiudo!
client.Disconnect();
return answ;
}
/// <summary>
/// Eliminazionedirectory remota
/// </summary>
/// <param name="remoteDir">Nome directory remota da eliminare</param>
public bool deleteDir(string remoteDir)
{
tryConnect();
bool answ = false;
try
{
// Elimina folder
client.DeleteDirectory(remoteDir);
answ = true;
}
catch
{ }
// chiudo!
client.Disconnect();
return answ;
}
/// <summary>
/// Eliminazionedirectory remota
/// </summary>
/// <param name="remoteFile">Nome file remoto da eliminare</param>
public bool deleteFile(string remoteFile)
{
tryConnect();
bool answ = false;
try
{
// Elimina folder
client.DeleteFile(remoteFile);
answ = true;
}
catch
{ }
// chiudo!
client.Disconnect();
return answ;
}
/// <summary>
/// Verifica esistenza directory su server FTP remoto
/// </summary>
/// <param name="remotePath">Percorso remoto da testare (ad es "/htdocs/extras/")</param>
/// <returns></returns>
public bool dirExists(string remotePath)
{
tryConnect();
bool answ = client.DirectoryExists(remotePath);
// chiudo!
client.Disconnect();
return answ;
}
/// <summary>
/// Verifica esistenza file su server FTP remoto
/// </summary>
/// <param name="remotePath">Percorso remoto da testare (ad es "/htdocs/big2.txt")</param>
/// <returns></returns>
public bool fileExists(string remotePath)
{
tryConnect();
bool answ = client.FileExists(remotePath);
// chiudo!
client.Disconnect();
return answ;
}
/// <summary>
/// Scaricamento intera directory, modalità MIRROR
/// </summary>
/// <param name="dirPath">Path directory da inviare (ad es:@"C:\website\videos\")</param>
/// <param name="remoteDir">Nome remoto file per caricamento (ad es: @"/public_html/videos")</param>
public bool getDir(string dirPath, string remoteDir)
{
bool answ = false;
tryConnect();
try
{
// upload della folder + files, cancellazione extra files = mirroring
var result = client.DownloadDirectory(dirPath, remoteDir, FtpFolderSyncMode.Mirror);
answ = (result != null && result.Count > 0);
}
catch
{ }
// chiudo!
client.Disconnect();
return answ;
}
/// <summary>
/// Download singolo file
/// </summary>
/// <param name="fileName">Path locale del file da inviare (ad es: @"C:\MyVideo.mp4")</param>
/// <param name="remoteName">NOme remoto file per caricamento (ad es: "/htdocs/MyVideo.mp4")</param>
public bool getFile(string fileName, string remoteName)
{
bool answ = false;
tryConnect();
// effettuo caricamento puntuale
var result = client.DownloadFile(fileName, remoteName);
answ = result == FtpStatus.Success;
// chiudo!
client.Disconnect();
return answ;
}
/// <summary>
/// Mostra contenuto directory remota
/// </summary>
/// <param name="remoteDir">Nome directory remota da leggere (ad es: @"/public_html/videos")</param>
/// <param name="recurse">Indica se fare search ricorsivo</param>
public List<string> listDir(string remoteDir, bool recurse)
{
tryConnect();
// upload della folder + files, cancellazione extra files = mirroring
FtpListItem[] dirContent;
if (recurse)
{
dirContent = client.GetListing(remoteDir, FtpListOption.Recursive);
}
else
{
dirContent = client.GetListing(remoteDir);
}
client.Disconnect();
var answ = dirContent.Select(x => $"{x.Type} - {x.Name}").ToList();
// chiudo!
return answ;
}
/// <summary>
/// Caricamento intera directory, modalità MIRROR
/// </summary>
/// <param name="dirPath">Path directory da inviare (ad es:@"C:\website\videos\")</param>
/// <param name="remoteDir">Nome remoto file per caricamento (ad es: @"/public_html/videos")</param>
public bool sendDir(string dirPath, string remoteDir)
{
bool answ = false;
tryConnect();
// upload della folder + files, cancellazione extra files = mirroring
var result = client.UploadDirectory(dirPath, remoteDir, FtpFolderSyncMode.Mirror);
answ = (result != null && result.Count > 0);
// chiudo!
client.Disconnect();
return answ;
}
/// <summary>
/// Caricamento singolo file
/// </summary>
/// <param name="fileName">Path locale del file da inviare (ad es: @"C:\MyVideo.mp4")</param>
/// <param name="remoteName">NOme remoto file per caricamento (ad es: "/htdocs/MyVideo.mp4")</param>
public bool sendFile(string fileName, string remoteName)
{
bool answ = false;
tryConnect();
// effettuo caricamento puntuale
var result = client.UploadFile(fileName, remoteName);
answ = result == FtpStatus.Success;
// se insuccesso --> controllo se ci sia file...
if (!answ)
{
answ = fileExists(remoteName);
}
// chiudo!
client.Disconnect();
return answ;
}
/// <summary>
/// Verifica connessione con server FTP remoto
/// </summary>
/// <returns></returns>
public bool serverOk()
{
tryConnect();
bool answ = client.IsConnected;
// chiudo!
client.Disconnect();
return answ;
}
/// <summary>
/// Restituisce tipo server remoto
/// </summary>
/// <returns></returns>
public string serverType()
{
tryConnect();
FtpServer srvType = client.ServerType;
// chiudo!
client.Disconnect();
return $"{srvType}";
}
#endregion Public Methods
#region Protected Fields
protected bool _skipCert = false;
#endregion Protected Fields
#region Protected Properties
protected string _passwd { get; set; } = "";
protected string _rawCert { get; set; } = "";
protected string _server { get; set; } = "";
protected string _userName { get; set; } = "";
#endregion Protected Properties
#region Private Properties
private FtpClient client { get; set; }
#endregion Private Properties
#region Private Methods
private void Client_ValidateCertificate(FluentFTP.Client.BaseClient.BaseFtpClient control, FtpSslValidationEventArgs e)
{
if (e.PolicyErrors == SslPolicyErrors.None || _skipCert || e.Certificate.GetRawCertDataString() == _rawCert)
{
e.Accept = true;
}
else
{
Console.WriteLine($"{e.PolicyErrors}");
Console.WriteLine($"Cert:{Environment.NewLine}{e.Certificate}");
Console.WriteLine($"RawString:{Environment.NewLine}{e.Certificate.GetRawCertDataString()}");
throw new Exception($"{e.PolicyErrors}{Environment.NewLine}{e.Certificate.GetRawCertDataString()}");
}
}
private void tryConnect()
{
// connect to the server and automatically detect working FTP settings
if (!client.IsConnected)
{
var profiles = client.AutoDetect();
#if false
// if any profiles are found, print the code to the console
if (profiles.Count > 0)
{
var code = profiles[0].ToCode();
Console.WriteLine(code);
}
#endif
client.ValidateCertificate += Client_ValidateCertificate;
client.AutoConnect();
}
}
#endregion Private Methods
}
}
-36
View File
@@ -1,36 +0,0 @@
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("EgwProxy.Ftp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EgwProxy.Ftp")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[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("35d95ed8-e48a-434d-a305-a83e48c8fc6f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
-69
View File
@@ -1,69 +0,0 @@
{
"metadata": [
{
"src": [
{
"files": [
"*.csproj",
"*.vbproj"
],
"cwd": ".",
"exclude": [
"**/obj/**",
"**/bin/**",
"_site/**"
]
}
],
"dest": "obj/api"
}
],
"build": {
"content": [
{
"files": [
"api/**.yml"
],
"cwd": "obj"
},
{
"files": [
"api/*.md",
"articles/**.md",
"toc.yml",
"*.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"resource": [
{
"files": [
"images/**"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"dest": "_site",
"template": [
"default"
]
}
}
-17
View File
@@ -1,17 +0,0 @@
# EgwProxy.Ftp Library
Documentazione relativa alla libreria di interfaccia via FTP con server generici.
Disponibile in forma di pacchetto nuget sul repo aziendale nexus.steamware.net: i pacchetti sono disponibili all'indirizzo
https://nexus.steamware.net/#browse/browse:nuget-hosted
Vedere la sezione Articles per maggiori informazioni sulle definizioni, l'impiego ed esempi.
## Articles
Per maggiori dettagli, definizioni e demo funzionamento si rimanda alla sezione Articles
## Api
Per ogni dettaglio e riferimento alla libreria si rimanda alla sezione Api Documentation
-5
View File
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentFTP" version="41.0.0" targetFramework="net462" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="2.1.0" targetFramework="net462" />
</packages>
-6
View File
@@ -1,6 +0,0 @@
- name: Articles
href: articles/
- name: API Documentation
href: obj/api/
homepage: api/index.md
+15 -19
View File
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="EntrataFrontiera" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
<add name="ExportIcoel" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=IcoelExport;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
<add name="TrackerLotti" connectionString="data source=192.168.250.250\sqlexpress;initial catalog=TrackerLotti3;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
<add name="SyncState" connectionString="data source=localhost\sqlexpress;initial catalog=MoonPro_ISF;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
</connectionStrings>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="EntrataFrontiera" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=frontiera;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
<add name="ExportIcoel" connectionString="data source=192.168.137.10\sqlexpress;initial catalog=IcoelExport;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
<add name="TrackerLotti" connectionString="data source=192.168.250.250\sqlexpress;initial catalog=TrackerLotti3;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
<add name="SyncState" connectionString="data source=localhost\sqlexpress;initial catalog=MoonPro_ISF;persist security info=True;user id=egalware;password=egalware2022;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
@@ -37,10 +37,6 @@
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -51,7 +51,7 @@
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.SqlClient, Version=4.1.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.SqlClient.4.1.1\lib\net461\Microsoft.Data.SqlClient.dll</HintPath>
<HintPath>..\packages\Microsoft.Data.SqlClient.4.1.0\lib\net461\Microsoft.Data.SqlClient.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Identity.Client, Version=4.22.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Identity.Client.4.22.0\lib\net461\Microsoft.Identity.Client.dll</HintPath>
@@ -98,10 +98,10 @@
</Reference>
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.IO.Compression, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.4.1.0\lib\net46\System.IO.Compression.dll</HintPath>
</Reference>
<Reference Include="System.IO.Compression" />
<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>
@@ -115,6 +115,8 @@
</Reference>
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
@@ -123,9 +125,13 @@
</Reference>
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Security.Cryptography.ProtectedData, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.ProtectedData.4.5.0\lib\net461\System.Security.Cryptography.ProtectedData.dll</HintPath>
@@ -180,13 +186,14 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.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>
<ErrorText>Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Data.SqlClient.SNI.4.0.1\build\net46\Microsoft.Data.SqlClient.SNI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Data.SqlClient.SNI.4.0.1\build\net46\Microsoft.Data.SqlClient.SNI.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Data.SqlClient.SNI.4.0.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Data.SqlClient.SNI.4.0.0\build\net46\Microsoft.Data.SqlClient.SNI.targets'))" />
</Target>
<Import Project="..\packages\Microsoft.Data.SqlClient.SNI.4.0.1\build\net46\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\packages\Microsoft.Data.SqlClient.SNI.4.0.1\build\net46\Microsoft.Data.SqlClient.SNI.targets')" />
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
<Import Project="..\packages\Microsoft.Data.SqlClient.SNI.4.0.0\build\net46\Microsoft.Data.SqlClient.SNI.targets" Condition="Exists('..\packages\Microsoft.Data.SqlClient.SNI.4.0.0\build\net46\Microsoft.Data.SqlClient.SNI.targets')" />
</Project>
+2 -3
View File
@@ -4,8 +4,8 @@
<package id="Azure.Identity" version="1.3.0" targetFramework="net462" />
<package id="EntityFramework" version="6.4.4" targetFramework="net462" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.0.0" targetFramework="net462" />
<package id="Microsoft.Data.SqlClient" version="4.1.1" targetFramework="net462" />
<package id="Microsoft.Data.SqlClient.SNI" version="4.0.1" targetFramework="net462" />
<package id="Microsoft.Data.SqlClient" version="4.1.0" targetFramework="net462" />
<package id="Microsoft.Data.SqlClient.SNI" version="4.0.0" targetFramework="net462" />
<package id="Microsoft.Identity.Client" version="4.22.0" targetFramework="net462" />
<package id="Microsoft.Identity.Client.Extensions.Msal" version="2.16.5" targetFramework="net462" />
<package id="Microsoft.IdentityModel.JsonWebTokens" version="6.8.0" targetFramework="net462" />
@@ -19,7 +19,6 @@
<package id="System.Diagnostics.DiagnosticSource" version="4.6.0" targetFramework="net462" />
<package id="System.IdentityModel.Tokens.Jwt" version="6.8.0" targetFramework="net462" />
<package id="System.IO" version="4.3.0" targetFramework="net462" />
<package id="System.IO.Compression" version="4.1.0" 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="4.6.0" targetFramework="net462" />
-4
View File
@@ -11,10 +11,6 @@
<releaseNotes>#releaseNotes#</releaseNotes>
<copyright>#copyright#</copyright>
<tags>EgwProxy.Icoel EgwProxy Icoel</tags>
<dependencies>
<dependency id="NLog" version="4.7.9" />
<dependency id="EntityFramework" version="6.4.4" />
</dependencies>
</metadata>
<files>
<file src="EgwProxy.Icoel\bin\Debug\EgwProxy*.dll" target="lib" />
-4
View File
@@ -11,10 +11,6 @@
<releaseNotes>#releaseNotes#</releaseNotes>
<copyright>#copyright#</copyright>
<tags>EgwProxy.Icoel EgwProxy Icoel</tags>
<dependencies>
<dependency id="NLog" version="4.7.9" />
<dependency id="EntityFramework" version="6.4.4" />
</dependencies>
</metadata>
<files>
<file src="EgwProxy.Icoel\bin\Release\EgwProxy*.dll" target="lib" />
-4
View File
@@ -68,10 +68,6 @@
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -36,9 +36,6 @@
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.4.1.0\lib\net46\System.IO.Compression.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -58,14 +55,10 @@
<None Include="conf.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="INI\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EgwProxy.Icoel.DataLayer\EgwProxy.Icoel.DataLayer.csproj">
<Project>{e36544cb-d699-48d8-9f81-c2758e7c7d19}</Project>
<Project>{E36544CB-D699-48D8-9F81-C2758E7C7D19}</Project>
<Name>EgwProxy.Icoel.DataLayer</Name>
</ProjectReference>
<ProjectReference Include="..\EgwProxy.Icoel\EgwProxy.Icoel.csproj">
@@ -73,5 +66,8 @@
<Name>EgwProxy.Icoel</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="INI\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
-4
View File
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.IO.Compression" version="4.1.0" targetFramework="net462" />
</packages>
-4
View File
@@ -54,10 +54,6 @@
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+1 -3
View File
@@ -46,9 +46,7 @@
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.4.1.0\lib\net46\System.IO.Compression.dll</HintPath>
</Reference>
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
-1
View File
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.7.9" targetFramework="net462" />
<package id="System.IO.Compression" version="4.1.0" targetFramework="net462" />
</packages>
+113 -113
View File
@@ -1,116 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<appSettings>
<add key="appName" value="IOB-MAN" />
<add key="appNameExt" value="IOB-WIN-NEXT" />
<add key="uiPeriod" value="100" />
<add key="checkPeriod" value="3000" />
<add key="forceCheckPeriodMult" value="20" />
<add key="autoRestartTimeoutMin" value="15" />
<add key="autoStartProc" value="true" />
<add key="closeOnChildUpdate" value="true" />
<add key="targetExe" value="C:\Steamware\IOB-WIN-NEXT\IOB-WIN-NEXT.exe" />
<add key="TargetNLogConf" value="C:\Steamware\IOB-WIN-NEXT\NLog.config" />
<add key="TargetLogDir" value="C:\Steamware\IOB-WIN-NEXT\logs\" />
<add key="ApiUrl" value="https://liman.egalware.com/ELM.Api/" />
<!--<add key="ApiUrl" value="https://localhost:44351/" />-->
<add key="BaseArg" value="MODE=MAN IOB=" />
<!--<add key="ArgsList" value="SIMUL_00,SIMUL_00" />-->
<add key="ArgsConfFile" value="/CONF/process.json" />
<!--Gestione riavvio periodico: ora e min di avvio, periodo ripetizione in minuti -->
<add key="fullRestartHour" value="0" />
<add key="fullRestartMinute" value="30" />
<add key="fullRestartIntervMin" value="1440" />
<add key="waitForExitMsec" value="250" />
<!--gestione REDIS-->
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
<add key="redisDb" value="10" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<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" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.31.0.0" newVersion="0.31.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.2" newVersion="6.0.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<probing privatePath="lib;libs" />
<probing privatePath="lib;libs" xmlns="" />
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DnsClient" publicKeyToken="4574bb5573c51424" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.3.11" newVersion="1.3.3.11" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="RestSharp" publicKeyToken="598062e77f915f75" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-106.15.0.0" newVersion="106.15.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<appSettings>
<add key="appName" value="IOB-MAN" />
<add key="appNameExt" value="IOB-WIN-NEXT" />
<add key="uiPeriod" value="100" />
<add key="checkPeriod" value="3000" />
<add key="forceCheckPeriodMult" value="15" />
<add key="autoRestartTimeoutMin" value="15" />
<add key="autoStartProc" value="true" />
<add key="closeOnChildUpdate" value="true" />
<add key="targetExe" value="C:\Steamware\IOB-WIN-NEXT\IOB-WIN-NEXT.exe" />
<add key="TargetNLogConf" value="C:\Steamware\IOB-WIN-NEXT\NLog.config" />
<add key="TargetLogDir" value="C:\Steamware\IOB-WIN-NEXT\logs\" />
<add key="ApiUrl" value="https://liman.egalware.com/ELM.Api/" />
<!--<add key="ApiUrl" value="https://localhost:44351/" />-->
<add key="BaseArg" value="MODE=MAN IOB=" />
<!--<add key="ArgsList" value="SIMUL_00,SIMUL_00" />-->
<add key="ArgsConfFile" value="/CONF/process.json" />
<!--Gestione riavvio periodico: ora e min di avvio, periodo ripetizione in minuti -->
<add key="fullRestartHour" value="0" />
<add key="fullRestartMinute" value="30" />
<add key="fullRestartIntervMin" value="1440" />
<add key="waitForExitMsec" value="250" />
<!--gestione REDIS-->
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
<add key="redisDb" value="10" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<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" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.31.0.0" newVersion="0.31.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.2" newVersion="6.0.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.1" newVersion="4.0.1.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<probing privatePath="lib;libs" />
<probing privatePath="lib;libs" xmlns="" />
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DnsClient" publicKeyToken="4574bb5573c51424" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.SharpZipLib" publicKeyToken="1b03e6acf1164f73" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.3.11" newVersion="1.3.3.11" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="RestSharp" publicKeyToken="598062e77f915f75" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-106.15.0.0" newVersion="106.15.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
</configuration>
+241 -237
View File
@@ -1,17 +1,20 @@
using Newtonsoft.Json;
using RestSharp;
using RestSharp.Serializers.NewtonsoftJson;
using SteamWare.Scheduler;
using SteamWare.IO;
using SteamWare.Logger;
using SteamWare.Scheduler;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
@@ -21,53 +24,28 @@ namespace IOB_MAN
{
public partial class IOBManPanel : Form
{
#region Public Fields
#region Private Fields
private const int SW_SHOWMAXIMIZED = 3;
private const int SW_SHOWMINIMIZED = 2;
private const int SW_SHOWNORMAL = 1;
/// <summary>
/// Elenco ARGS (uno per child da avviare)
/// Context x sync thread
/// </summary>
public List<string> ArgsList = new List<string>();
#endregion Public Fields
#region Public Constructors
private readonly SynchronizationContext synchronizationContext;
/// <summary>
/// Init classe
/// Oggetto semaforico di lock
/// </summary>
public IOBManPanel()
{
InitializeComponent();
synchronizationContext = SynchronizationContext.Current;
preInit();
loadConfig();
// fix log...
cbLogLevelMin.SelectedValue = "Info";
setLogLevel("Info");
initTimers();
initControls();
updateStatus();
}
#endregion Public Constructors
#region Public Methods
private SemaphoreSlim _sync = new SemaphoreSlim(1);
/// <summary>
/// Cerca nell'elenco il processo corrente
/// Binding source degli elementi gestiti..
/// </summary>
/// <param name="processlist"></param>
/// <param name="id"></param>
/// <returns></returns>
public static Process myGetProcByID(Process[] processlist, int id)
{
return processlist.FirstOrDefault(pr => pr.Id == id);
}
private BindingSource ElencoIOB = new BindingSource();
#endregion Public Methods
#endregion Private Fields
#region Protected Fields
@@ -76,11 +54,6 @@ namespace IOB_MAN
/// </summary>
protected static List<iobAdapt> item2rem = new List<iobAdapt>();
/// <summary>
/// URL di base x l'API di gestione licenze/file upload
/// </summary>
protected string ApiUrl = "";
/// <summary>
/// Ramo applicazione (x update)
/// </summary>
@@ -141,21 +114,26 @@ namespace IOB_MAN
/// </summary>
protected string TargetExe = "";
/// <summary>
/// File target x conf NLog
/// </summary>
protected string TargetNLogConf = "";
/// <summary>
/// Directory log generale x IOB-WIN (dentro ci sono x singoli IOB)
/// </summary>
protected string TargetLogDir = "";
/// <summary>
/// URL di base x l'API di gestione licenze/file upload
/// </summary>
protected string ApiUrl = "";
/// <summary>
/// Name dell'exe da chiamare
/// </summary>
protected string TargetName = "";
/// <summary>
/// File target x conf NLog
/// </summary>
protected string TargetNLogConf = "";
/// <summary>
/// Dataora prossima scadenza riavvio automatico
/// </summary>
@@ -173,6 +151,39 @@ namespace IOB_MAN
#endregion Protected Fields
#region Public Fields
/// <summary>
/// Elenco ARGS (uno per child da avviare)
/// </summary>
public List<string> ArgsList = new List<string>();
#endregion Public Fields
#region Public Constructors
/// <summary>
/// Init classe
/// </summary>
public IOBManPanel()
{
InitializeComponent();
synchronizationContext = SynchronizationContext.Current;
preInit();
loadConfig();
// fix log...
cbLogLevelMin.SelectedValue = "Info";
setLogLevel("Info");
initTimers();
initControls();
updateStatus();
}
#endregion Public Constructors
#region Protected Properties
/// <summary>
@@ -188,29 +199,6 @@ namespace IOB_MAN
#endregion Protected Properties
#region Private Fields
private const int SW_SHOWMAXIMIZED = 3;
private const int SW_SHOWMINIMIZED = 2;
private const int SW_SHOWNORMAL = 1;
/// <summary>
/// Context x sync thread
/// </summary>
private readonly SynchronizationContext synchronizationContext;
/// <summary>
/// Oggetto semaforico di lock
/// </summary>
private SemaphoreSlim _sync = new SemaphoreSlim(1);
/// <summary>
/// Binding source degli elementi gestiti..
/// </summary>
private BindingSource ElencoIOB = new BindingSource();
#endregion Private Fields
#region Private Methods
[DllImport("user32.dll")]
@@ -387,155 +375,12 @@ namespace IOB_MAN
updateStatus();
}
private async void btnSendLog_Click(object sender, EventArgs e)
{
// salvo valori button normali
var stdColor = btnSendLog.BackColor;
var stdText = btnSendLog.Text;
// mostro che sto inviando dati...
btnSendLog.Enabled = false;
btnSendLog.BackColor = Color.OrangeRed;
btnSendLog.Text = "fix directory";
btnSendLog.Refresh();
// svuoto area temp...
string fileName = "LogFiles.zip";
string tempDir = Path.Combine(Application.StartupPath, "temp", "logs");
string zipPath = Path.Combine(Application.StartupPath, "temp", fileName);
if (Directory.Exists(tempDir))
{
Directory.Delete(tempDir, true);
}
// ricreo directory...
Directory.CreateDirectory(tempDir);
// definisco limite temporale alle 21 di 2 gg prima...
DateTime minDate = DateTime.Today.AddHours(-27);
// SOLO SE selezionato in dgv...
string logDir = TargetLogDir;
if (dgvManagedItems.SelectedRows.Count > 0)
{
btnSendLog.Text = "zip start";
btnSendLog.Refresh();
// ciclo su row selezionate
foreach (DataGridViewRow riga in dgvManagedItems.SelectedRows)
{
// verifico che sia già chiuso...
var iobData = (iobAdapt)ElencoIOB[riga.Index];
// calcolo folder
logDir = Path.Combine(TargetLogDir, iobData.CodIOB);
// recupero file odierno
DirectoryInfo dI = new DirectoryInfo(logDir);
var files = dI.GetFiles().Where(i => i.CreationTime >= minDate);
// copio in area temp...
foreach (var file in files)
{
Directory.CreateDirectory(Path.Combine(tempDir, iobData.CodIOB));
file.CopyTo(Path.Combine(tempDir, iobData.CodIOB, file.Name));
}
}
// creo unico ZIP
if (File.Exists(zipPath))
{
File.Delete(zipPath);
}
ZipFile.CreateFromDirectory(tempDir, zipPath);
btnSendLog.Text = "zip end";
btnSendLog.Refresh();
// ciclo di creazione ticket e upload file
try
{
// client chiamate rest
var client = new RestClient(ApiUrl);
client.UseNewtonsoftJson();
SupportRequest newSuppReq = new SupportRequest();
string licensePath = Path.Combine(Application.StartupPath, "CONF", "license.json");
string rawData = "";
if (File.Exists(licensePath))
{
rawData = File.ReadAllText(licensePath);
}
if (!string.IsNullOrEmpty(rawData))
{
// fare: composizione richiesta da parametri chiave
newSuppReq = JsonConvert.DeserializeObject<SupportRequest>(rawData);
}
else
{
string hostName = utils.machineName;
string listIP = string.Join(", ", utils.machineIp);
// genero il ticket
newSuppReq = new SupportRequest()
{
CodApp = "MAPO-IOB-WIN-NEXT",
CodImp = "",
CodInst = "SteamWare",
ContactEmail = "info@steamware.net",
ContactName = "Default Config",
ContactPhone = "035-460560",
MasterKey = "a3BRQz/1B34uvvcDoE/D38ssH/c/KSsjpn39wZsxOVsck9rGnBkF3xfUnj3edYIl",
ReqBody = $"File Upload - MISSING license file | machine: {utils.machineName} | IP: {listIP}",
Tipo = TipologiaTicket.FileUpload,
idxSubLic = 0
};
}
btnSendLog.Text = "LogSend start";
btnSendLog.BackColor = Color.DarkOrange;
btnSendLog.Refresh();
var ticketReq = new RestRequest("/api/ticket/sendReq", DataFormat.Json).AddJsonBody(newSuppReq);
var ticketResp = await client.PostAsync<TicketDTO>(ticketReq);
// preparo richiesta x upload file
var fileUploadReq = new RestRequest("/api/filesave/single");
fileUploadReq.AddParameter("ticketId", ticketResp.idxTicket);
fileUploadReq.AddFile("file", zipPath);
// ... infine INVIA file zip che li contiene...
//var fileUploadResp = client.Post(fileUploadReq);
var fileUploadResp = await client.PostAsync<UploadResult>(fileUploadReq);
btnSendLog.Text = "LogSend end";
btnSendLog.BackColor = Color.DarkOliveGreen;
btnSendLog.Refresh();
// elimino folder temporanea
if (Directory.Exists(tempDir))
{
Directory.Delete(tempDir, true);
}
// elimino il file temporaneo...
if (File.Exists(zipPath))
{
File.Delete(zipPath);
}
}
catch (Exception exc)
{
Logging.LogError($"Eccezione in fase gestione REST services{Environment.NewLine}{exc}");
}
}
btnSendLog.BackColor = stdColor;
btnSendLog.Text = stdText;
btnSendLog.Enabled = true;
}
private void btnStartSel_Click(object sender, EventArgs e)
{
// riapro child (SOLO SE non era già aperto...)
apriChildSel();
}
private void cbLogLevelMin_SelectedIndexChanged(object sender, EventArgs e)
{
// aggiornato livelo di log --> chiamo procedura x riscrivere il file conf di NLog
setLogLevel($"{cbLogLevelMin.SelectedItem}");
}
/// <summary>
/// verifica buttons attivi data selezione su gridview...
/// </summary>
@@ -631,8 +476,7 @@ namespace IOB_MAN
IList<iobAdapt> allItems = (IList<iobAdapt>)ElencoIOB.List;
bool needRem = false;
// 2020.02.01 passato chiamata specifica x leggere in 1 sola volta TUTTO elenco processi
// (x nome)...
// 2020.02.01 passato chiamata specifica x leggere in 1 sola volta TUTTO elenco processi (x nome)...
Process[] processList = Process.GetProcessesByName(TargetName);
// ciclo
@@ -885,12 +729,6 @@ namespace IOB_MAN
}
}
private void dgvManagedItems_SelectionChanged(object sender, EventArgs e)
{
checkButtons();
}
private void ElencoIOB_AddingNew(object sender, System.ComponentModel.AddingNewEventArgs e)
{
}
@@ -1116,6 +954,9 @@ namespace IOB_MAN
{
try
{
//Task result = checkProcessStatusAsync();
//result.Wait();
Task result = Task.Run(() => checkProcessStatusAsync().ConfigureAwait(false));
result.Wait();
}
@@ -1252,21 +1093,6 @@ namespace IOB_MAN
updateStatus();
}
private void setLogLevel(string selectedValue)
{
// leggo il file loglevel in resources
string rawData = File.ReadAllText($@"{Application.StartupPath}\Resources\NLog.template.config");
// sostituzione livello minimo da selezione
rawData = rawData.Replace("{{minLevel}}", selectedValue);
// scrivo conf x programma IOB-MAN
File.WriteAllText($@"{Application.StartupPath}\NLog.config", rawData);
// scrivo conf x IOB-WIN gestiti
File.WriteAllText(TargetNLogConf, rawData);
}
/// <summary>
/// Avvio di un child process da parametro ARG
/// </summary>
@@ -1413,5 +1239,183 @@ namespace IOB_MAN
#endregion Private Methods
#region Public Methods
/// <summary>
/// Cerca nell'elenco il processo corrente
/// </summary>
/// <param name="processlist"></param>
/// <param name="id"></param>
/// <returns></returns>
public static Process myGetProcByID(Process[] processlist, int id)
{
return processlist.FirstOrDefault(pr => pr.Id == id);
}
#endregion Public Methods
private void cbLogLevelMin_SelectedIndexChanged(object sender, EventArgs e)
{
// aggiornato livelo di log --> chiamo procedura x riscrivere il file conf di NLog
setLogLevel($"{cbLogLevelMin.SelectedItem}");
}
private void setLogLevel(string selectedValue)
{
// leggo il file loglevel in resources
string rawData = File.ReadAllText($@"{Application.StartupPath}\Resources\NLog.template.config");
// sostituzione livello minimo da selezione
rawData = rawData.Replace("{{minLevel}}", selectedValue);
// scrivo conf x programma IOB-MAN
File.WriteAllText($@"{Application.StartupPath}\NLog.config", rawData);
// scrivo conf x IOB-WIN gestiti
File.WriteAllText(TargetNLogConf, rawData);
}
private void dgvManagedItems_SelectionChanged(object sender, EventArgs e)
{
checkButtons();
}
private async void btnSendLog_Click(object sender, EventArgs e)
{
// salvo valori button normali
var stdColor = btnSendLog.BackColor;
var stdText = btnSendLog.Text;
// mostro che sto inviando dati...
btnSendLog.Enabled = false;
btnSendLog.BackColor = Color.OrangeRed;
btnSendLog.Text = "fix directory";
btnSendLog.Refresh();
// svuoto area temp...
string fileName = "LogFiles.zip";
string tempDir = Path.Combine(Application.StartupPath, "temp", "logs");
string zipPath = Path.Combine(Application.StartupPath, "temp", fileName);
if (Directory.Exists(tempDir))
{
Directory.Delete(tempDir, true);
}
// ricreo directory...
Directory.CreateDirectory(tempDir);
// definisco limite temporale alle 21 di 2 gg prima...
DateTime minDate = DateTime.Today.AddHours(-27);
// SOLO SE selezionato in dgv...
string logDir = TargetLogDir;
if (dgvManagedItems.SelectedRows.Count > 0)
{
btnSendLog.Text = "zip start";
btnSendLog.Refresh();
// ciclo su row selezionate
foreach (DataGridViewRow riga in dgvManagedItems.SelectedRows)
{
// verifico che sia già chiuso...
var iobData = (iobAdapt)ElencoIOB[riga.Index];
// calcolo folder
logDir = Path.Combine(TargetLogDir, iobData.CodIOB);
// recupero file odierno
DirectoryInfo dI = new DirectoryInfo(logDir);
var files = dI.GetFiles().Where(i => i.CreationTime >= minDate);
// copio in area temp...
foreach (var file in files)
{
Directory.CreateDirectory(Path.Combine(tempDir, iobData.CodIOB));
file.CopyTo(Path.Combine(tempDir, iobData.CodIOB, file.Name));
}
}
// creo unico ZIP
if (File.Exists(zipPath))
{
File.Delete(zipPath);
}
ZipFile.CreateFromDirectory(tempDir, zipPath);
btnSendLog.Text = "zip end";
btnSendLog.Refresh();
// ciclo di creazione ticket e upload file
try
{
// client chiamate rest
var client = new RestClient(ApiUrl);
client.UseNewtonsoftJson();
SupportRequest newSuppReq = new SupportRequest();
string licensePath = Path.Combine(Application.StartupPath, "CONF", "license.json");
string rawData = "";
if (File.Exists(licensePath))
{
rawData = File.ReadAllText(licensePath);
}
if (!string.IsNullOrEmpty(rawData))
{
// fare: composizione richiesta da parametri chiave
newSuppReq = JsonConvert.DeserializeObject<SupportRequest>(rawData);
}
else
{
string hostName = utils.machineName;
string listIP = string.Join(", ", utils.machineIp);
// genero il ticket
newSuppReq = new SupportRequest()
{
CodApp = "MAPO-IOB-WIN-NEXT",
CodImp = "",
CodInst = "SteamWare",
ContactEmail = "info@steamware.net",
ContactName = "Default Config",
ContactPhone = "035-460560",
MasterKey = "a3BRQz/1B34uvvcDoE/D38ssH/c/KSsjpn39wZsxOVsck9rGnBkF3xfUnj3edYIl",
ReqBody = $"File Upload - MISSING license file | machine: {utils.machineName} | IP: {listIP}",
Tipo = TipologiaTicket.FileUpload,
idxSubLic = 0
};
}
btnSendLog.Text = "LogSend start";
btnSendLog.BackColor = Color.DarkOrange;
btnSendLog.Refresh();
var ticketReq = new RestRequest("/api/ticket/sendReq", DataFormat.Json).AddJsonBody(newSuppReq);
var ticketResp = await client.PostAsync<TicketDTO>(ticketReq);
// preparo richiesta x upload file
var fileUploadReq = new RestRequest("/api/filesave/single");
fileUploadReq.AddParameter("ticketId", ticketResp.idxTicket);
fileUploadReq.AddFile("file", zipPath);
// ... infine INVIA file zip che li contiene...
//var fileUploadResp = client.Post(fileUploadReq);
var fileUploadResp = await client.PostAsync<UploadResult>(fileUploadReq);
btnSendLog.Text = "LogSend end";
btnSendLog.BackColor = Color.DarkOliveGreen;
btnSendLog.Refresh();
// elimino folder temporanea
if (Directory.Exists(tempDir))
{
Directory.Delete(tempDir, true);
}
// elimino il file temporaneo...
if (File.Exists(zipPath))
{
File.Delete(zipPath);
}
}
catch (Exception exc)
{
Logging.LogError($"Eccezione in fase gestione REST services{Environment.NewLine}{exc}");
}
}
btnSendLog.BackColor = stdColor;
btnSendLog.Text = stdText;
btnSendLog.Enabled = true;
}
}
}
-89
View File
@@ -1,89 +0,0 @@
namespace IOB_UT_NEXT
{
public class BitConditionCheck
{
#region Public Constructors
/// <summary>
/// Inizializza un oggetto da usare per testing bit condition
/// </summary>
/// <param name="keyName">Nome della chiave registrata</param>
/// <param name="rawConf">Configurazione nel formato BaseAddr.BitNum=ValOk</param>
public BitConditionCheck(string keyName, string rawConf)
{
Logging.Instance.Info($"Init BitConditionCheck | {keyName} | {rawConf}");
KeyName = keyName;
RawVal = rawConf;
string sVal = "";
int valDecoded = 0;
// check preliminare
if (rawConf.Contains(".") && rawConf.Contains("="))
{
// splitto per "="...
var splitCond = rawConf.Split('=');
sVal = splitCond[1];
int.TryParse(sVal, out valDecoded);
ValOk = valDecoded;
// il restante splitto per "."
var splitMem = splitCond[0].Split('.');
// BaseAddr
sVal = splitMem[0];
int.TryParse(sVal, out valDecoded);
BaseAddr = valDecoded;
// BitNum
sVal = splitMem[1];
int.TryParse(sVal, out valDecoded);
BitNum = valDecoded;
}
}
/// <summary>
/// Inizializza un oggetto fake/empty
/// </summary>
public BitConditionCheck()
{
Logging.Instance.Info("Init empty BitConditionCheck");
}
/// <summary>
/// Inizializza un oggetto solo per key
/// </summary>
/// <param name="keyName">Nome della chiave registrata</param>
public BitConditionCheck(string keyName)
{
Logging.Instance.Info($"Init BitConditionCheck | {keyName}");
KeyName = keyName;
}
#endregion Public Constructors
#region Public Properties
/// <summary>
/// Indirizzo base x memoria da testare come bit condition
/// </summary>
public int BaseAddr { get; set; } = 0;
/// <summary>
/// Numero bit da impiegare
/// </summary>
public int BitNum { get; set; } = 0;
/// <summary>
/// Valore chiave
/// </summary>
public string KeyName { get; set; } = "";
/// <summary>
/// Valore raw decodificato
/// </summary>
public string RawVal { get; set; } = "";
/// <summary>
/// Valore target che porta a condizione OK = true
/// </summary>
public int ValOk { get; set; } = 0;
#endregion Public Properties
}
}
-181
View File
@@ -1,181 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static IOB_UT_NEXT.CustomObj;
namespace IOB_UT_NEXT
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
public class CustomObj
{
public class ArtRow
{
#region Public Properties
[Description("Matricola_articolo")]
public string Matricola { get; set; } = "";
[Description("Articolo")]
//[Display(Name = "Articolo", Order = 1)]
public string Articolo { get; set; } = "";
[Description("Identificazione")]
//[Display(Name = "Identificazione", Order = 2)]
public string Descrizione { get; set; } = "";
[Description("Peso_teorico_linea1[ton]")]
public int Peso_01 { get; set; } = 0;
[Description("Peso_teorico_linea2[ton]")]
public int Peso_02 { get; set; } = 0;
[Description("Peso_teorico_linea3[ton]")]
public int Peso_03 { get; set; } = 0;
[Description("Peso_teorico_linea4[ton]")]
public int Peso_04 { get; set; } = 0;
[Description("Pos. Carrello 1[mm]")]
public int PosizCarrello_01 { get; set; } = 0;
[Description("Pos. Carrello 2[mm]")]
public int PosizCarrello_02 { get; set; } = 0;
[Description("Pos. Carrello 3[mm]")]
public int PosizCarrello_03 { get; set; } = 0;
[Description("Pos. Carrello 4[mm]")]
public int PosizCarrello_04 { get; set; } = 0;
[Description("Limitazione_velocita_sollevamento[%]")]
//[Display(Name = "Limitazione_velocita_sollevamento[%]", Order = 3)]
public int LimiteVel { get; set; } = 100;
#endregion Public Properties
}
public class JobRow
{
#region Public Properties
[Description("Matricola")]
public string Matricola { get; set; } = "";
[Description("Commessa")]
public string Commessa { get; set; } = "";
[Description("Articolo")]
public string Articolo { get; set; } = "";
[Description("Identificazione")]
public string Descrizione { get; set; } = "";
[Description("Data inserimento")]
public string DataIns { get; set; } = "";
[Description("Ora inserimento")]
public string OraIns { get; set; } = "";
[Description("Lavorazione")]
public string Lavorazione { get; set; } = "";
#endregion Public Properties
}
public partial class AnagArticoli
{
public string CodArticolo { get; set; }
public string DescArticolo { get; set; }
public string Disegno { get; set; }
public string Tipo { get; set; }
public string Azienda { get; set; }
}
public class PODLModel
{
public int IdxPromessa { get; set; } = 0;
public string KeyRichiesta { get; set; } = "";
public string KeyBCode { get; set; } = "";
public bool Attivabile { get; set; } = false;
public int IdxOdl { get; set; } = 0;
public string CodArticolo { get; set; } = "";
public string CodGruppo { get; set; } = "";
public string IdxMacchina { get; set; }
public int NumPezzi { get; set; } = 1;
public decimal Tcassegnato { get; set; } = 1;
public DateTime? DueDate { get; set; }
public int Priorita { get; set; } = 1;
public int PzPallet { get; set; } = 1;
public string Note { get; set; } = "";
public string CodCli { get; set; } = "";
public DateTime InsertDate { get; set; } = DateTime.Now;
public string CodFase
{
get
{
string answ = "*";
var allData = KeyRichiesta.Split('_');
if (allData.Length > 0)
{
answ = allData[0];
}
return answ;
}
}
}
public class DossiersModel
{
public int IdxDossier { get; set; } = 0;
public string DataType { get; set; } = "";
public DateTime DtRif { get; set; } = DateTime.Now;
public string IdxMacchina { get; set; } = "";
public int IdxODL { get; set; } = 0;
public string CodArticolo { get; set; } = "";
public string Valore { get; set; } = "";
}
public class DossierFluxLogDTO
{
public List<FluxLog> ODL { get; set; } = new List<FluxLog>();
}
public class FluxLog
{
public string IdxMacchina { get; set; }
public DateTime dtEvento { get; set; }
public string CodFlux { get; set; }
public string Valore { get; set; } = "";
public string ValoreEdit { get; set; } = "";
public int Cnt { get; set; }
}
public partial class ListVal
{
public string value { get; set; }
public string label { get; set; }
}
}
}
-47
View File
@@ -1,47 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace IOB_UT_NEXT
{
public class DataExport
{
/// <summary>
/// Effettua salvataggio in file di un generico oggetto in formato CSV
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="reportData"></param>
/// <param name="path"></param>
/// <param name="writeHeader">Indica se scrivere header ad inizio CSV</param>
/// <param name="separator">Separatore da impiegare (default ";")</param>
/// <returns></returns>
public static bool SaveToCsv<T>(List<T> reportData, string path, bool writeHeader, char separator = ';')
{
bool answ = false;
var lines = new List<string>();
try
{
IEnumerable<PropertyDescriptor> props = TypeDescriptor.GetProperties(typeof(T)).OfType<PropertyDescriptor>();
var elencoValori = props.ToList();
var header = string.Join($"{separator}", props.ToList().Select(x => !string.IsNullOrEmpty(x.Description) ? x.Description : x.Name));
var fieldList = string.Join($"{separator}", props.ToList().Select(x => x.Name));
if (writeHeader)
{
lines.Add(header);
}
var valueLines = reportData.Select(row => string.Join($"{separator}", fieldList.Split(separator).Select(a => row.GetType().GetProperty(a).GetValue(row, null))));
//var valueLines = reportData.Select(row => string.Join(";", header.Split(';').Select(a => row.GetType().GetProperty(a).GetValue(row, null))));
lines.AddRange(valueLines);
File.WriteAllLines(path, lines.ToArray());
answ = true;
}
catch
{ }
return answ;
}
}
}
+6 -96
View File
@@ -18,27 +18,6 @@ namespace IOB_UT_NEXT
OR
}
/// <summary>
/// Modalità di calcolo tra serie di valori
/// </summary>
public enum calcMode
{
/// <summary>
/// NEssun processing
/// </summary>
None = 0,
/// <summary>
/// somma dei valori
/// </summary>
sum,
/// <summary>
/// produttoria
/// </summary>
prod
}
/// <summary>
/// Elenco MODI CNC
/// </summary>
@@ -196,24 +175,10 @@ namespace IOB_UT_NEXT
{
ND = 0,
/// <summary>
/// Modalità Mecolpress (3 parametri IN, se variati --&gt; porto a 1 la variabile di controllo)
/// </summary>
// Modalità Mecolpress (3 parametri IN, se variati --> porto a 1 la variabile di controllo)
MECOLPRESS = 1
}
/// <summary>
/// Tipo di memoria Modbus
/// </summary>
public enum modbusMemType
{
Coil = 0,
DiscreteInput = 1,
NotDefined = 2,
InputRegister = 3,
HoldingRegister = 4
}
/// <summary>
/// StFlag32: set di 32 bit (4 word) contente semaforo di variabili
/// </summary>
@@ -347,11 +312,6 @@ namespace IOB_UT_NEXT
/// </summary>
MODBUS_TCP_CENTERFRIGO,
/// <summary>
/// Adapter modbus (+ file) x FIMAT (Tenditalia)
/// </summary>
MODBUS_TCP_FIMAT,
/// <summary>
/// Adapter ModBus TCP versione HAM (Pizzaferri)
/// </summary>
@@ -362,26 +322,6 @@ namespace IOB_UT_NEXT
/// </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>
@@ -402,6 +342,11 @@ namespace IOB_UT_NEXT
/// </summary>
OpcUaCMS,
/// <summary>
/// Adapter OPC-UA SCM
/// </summary>
OpcUaSCM,
/// <summary>
/// Adapter OPC-UA per Ewon
/// </summary>
@@ -422,21 +367,6 @@ namespace IOB_UT_NEXT
/// </summary>
OpcUaEwonMecolpress,
/// <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>
@@ -447,26 +377,6 @@ namespace IOB_UT_NEXT
/// </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 Ulma (packaging, Giacovelli)
/// </summary>
OpcUaUlma,
/// <summary>
/// Adapter OSAI CNDEX (Cndex)
/// </summary>
+1 -1
View File
@@ -104,7 +104,7 @@ namespace IOB_UT_NEXT
#region Public Fields
/// <summary>
/// Array delle sessioni attive
/// Array delel sessioni attive
/// </summary>
public Dictionary<int, Session> ActiveSessions = new Dictionary<int, Session>();
-114
View File
@@ -1,114 +0,0 @@
using Newtonsoft.Json;
using System;
using System.Diagnostics;
using System.IO;
namespace IOB_UT_NEXT
{
public class FileProcMan
{
#region Public Constructors
public FileProcMan(string archiveDir, string convertDir, string toolDir, string exeFileName, string refConfFileName, string sheetName)
{
this.archDir = archiveDir;
this.convDir = convertDir;
this.confFileNameOut = "conf.json";
this.baseDir = toolDir;
this.exeName = exeFileName;
this.sheetName = sheetName;
appPath = Path.Combine(baseDir, exeName);
// leggo file di conf base
string refConfFile = Path.Combine(baseDir, refConfFileName);
this.refConf = File.ReadAllText(refConfFile);
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Processa il singolo file e riporta tempo esecuzione
/// </summary>
/// <returns></returns>
public TimeSpan doProcess(string fPath, int idxODL)
{
TimeSpan outVal = new TimeSpan();
Stopwatch sw = new Stopwatch();
// preparo file conf
createConfFile(fPath, idxODL);
// avvio processing
Console.WriteLine("calling ext app with args:");
Console.WriteLine($"{appPath} {confFileNameOut}");
Console.WriteLine();
ProcessStartInfo psi = new ProcessStartInfo
{
FileName = appPath,
Arguments = $"{confFileNameOut}",
WindowStyle = ProcessWindowStyle.Minimized,
//WindowStyle = ProcessWindowStyle.Hidden,
UseShellExecute = false,
//CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardInput = true,
};
sw.Start();
Process p = Process.Start(psi);
string q = "";
while (!p.HasExited)
{
q += p.StandardOutput.ReadToEnd();
}
sw.Stop();
outVal = sw.Elapsed;
return outVal;
}
#endregion Public Methods
#region Protected Fields
protected string appPath = "";
protected string archDir = "";
protected string baseDir = "";
protected string confFileNameOut = "";
protected string convDir = "";
protected string exeName = "";
protected string refConf = "";
protected string sheetName = "";
#endregion Protected Fields
#region Private Methods
private void createConfFile(string item, int idxOdl)
{
string outFileName = Path.GetFileName(item).Replace("xlsx", "json");
string rawContent = String.Copy(refConf);
rawContent = rawContent.Replace("{{ArchiveDir}}", fixJsonDir(archDir));
rawContent = rawContent.Replace("{{ConvertDir}}", fixJsonDir(convDir));
rawContent = rawContent.Replace("{{FileInPath}}", fixJsonDir(item));
rawContent = rawContent.Replace("{{FileOutPath}}", outFileName);
rawContent = rawContent.Replace("{{TargetSheetName}}", sheetName);
rawContent = rawContent.Replace("987654321", $"{idxOdl}");
// calcolo nome file conf specifico
confFileNameOut = $"conf_{outFileName}";
File.WriteAllText(confFileNameOut, rawContent);
}
protected string fixJsonDir(string origPath)
{
string answ = JsonConvert.ToString(origPath);
answ = answ.Substring(1, answ.Length - 2);
return answ;
}
#endregion Private Methods
}
}
+4 -30
View File
@@ -55,31 +55,12 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Remote_DEBUG\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Remote_DEBUG|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Remote_DEBUG\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.1.9, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<HintPath>..\packages\SharpZipLib.1.3.1\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="MapoSDK, Version=6.14.2211.3016, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MapoSDK.6.14.2211.3016\lib\MapoSDK.dll</HintPath>
<Reference Include="MapoSDK, Version=6.14.2205.2808, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MapoSDK.6.14.2205.2808\lib\MapoSDK.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>
@@ -91,10 +72,10 @@
<HintPath>..\packages\NLog.4.7.13\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="Pipelines.Sockets.Unofficial, Version=1.0.0.0, Culture=neutral, PublicKeyToken=42ea0a778e13fbe2, processorArchitecture=MSIL">
<HintPath>..\packages\Pipelines.Sockets.Unofficial.2.2.2\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath>
<HintPath>..\packages\Pipelines.Sockets.Unofficial.2.2.0\lib\net461\Pipelines.Sockets.Unofficial.dll</HintPath>
</Reference>
<Reference Include="StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46, processorArchitecture=MSIL">
<HintPath>..\packages\StackExchange.Redis.2.6.80\lib\net461\StackExchange.Redis.dll</HintPath>
<HintPath>..\packages\StackExchange.Redis.2.2.4\lib\net461\StackExchange.Redis.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
@@ -141,16 +122,9 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="FileProcMan.cs" />
<Compile Include="IntConditionCheck.cs" />
<Compile Include="BitConditionCheck.cs" />
<Compile Include="CustomObj.cs" />
<Compile Include="DataExport.cs" />
<Compile Include="Eurom63.cs" />
<Compile Include="IobWinStatus.cs" />
<Compile Include="plcMemMapExt.cs" />
<Compile Include="TCMan.cs" />
<Compile Include="TimeUtils.cs" />
<Compile Include="ToMapo.cs" />
<Compile Include="baseUtils.cs" />
<Compile Include="BinaryFormatter.cs" />
+4
View File
@@ -16,6 +16,7 @@ namespace IOB_UT_NEXT
#endregion Public Fields
#region Public Constructors
/// <summary>
@@ -252,6 +253,9 @@ namespace IOB_UT_NEXT
#region Private Methods
// INI filename
/// <summary>
/// GetPrivateProfileInt: import windows dll functions
/// </summary>
-97
View File
@@ -1,97 +0,0 @@
namespace IOB_UT_NEXT
{
public class IntConditionCheck
{
#region Public Constructors
/// <summary>
/// Inizializza un oggetto da usare per testing INT condition
/// </summary>
/// <param name="keyName">Nome della chiave registrata</param>
/// <param name="rawConf">Configurazione nel formato BaseAddr|IntIndex=ValOk</param>
public IntConditionCheck(string keyName, string rawConf)
{
Logging.Instance.Info($"Init IntConditionCheck | {keyName} | {rawConf}");
KeyName = keyName;
RawVal = rawConf;
string sVal = "";
int valDecoded = 0;
// check preliminare
if (rawConf.Contains("|") && rawConf.Contains("="))
{
// splitto per "="...
var splitCond = rawConf.Split('=');
sVal = splitCond[1];
// i valori INT sono "," separated
var splitValOk = sVal.Split(',');
ValOk = new int[splitValOk.Length];
int i = 0;
foreach (var item in splitValOk)
{
int.TryParse(item, out valDecoded);
ValOk[i] = valDecoded;
i++;
}
// il restante splitto per "."
var splitMem = splitCond[0].Split('|');
// BaseAddr
sVal = splitMem[0];
int.TryParse(sVal, out valDecoded);
BaseAddr = valDecoded;
// BitNum
sVal = splitMem[1];
int.TryParse(sVal, out valDecoded);
IntIndex = valDecoded;
}
}
/// <summary>
/// Inizializza un oggetto fake/empty
/// </summary>
public IntConditionCheck()
{
Logging.Instance.Info("Init empty IntConditionCheck");
}
/// <summary>
/// Inizializza un oggetto solo per key
/// </summary>
/// <param name="keyName">Nome della chiave registrata</param>
public IntConditionCheck(string keyName)
{
Logging.Instance.Info($"Init IntConditionCheck | {keyName}");
KeyName = keyName;
}
#endregion Public Constructors
#region Public Properties
/// <summary>
/// Indirizzo base x memoria da testare come iny condition
/// </summary>
public int BaseAddr { get; set; } = 0;
/// <summary>
/// Indirizzo base x memoria da testare come int condition (0/1) dell'int[], 2=DWord
/// </summary>
public int IntIndex { get; set; } = 0;
/// <summary>
/// Valore chiave
/// </summary>
public string KeyName { get; set; } = "";
/// <summary>
/// Valore raw decodificato
/// </summary>
public string RawVal { get; set; } = "";
/// <summary>
/// Valore target che porta a condizione OK = true
/// </summary>
public int[] ValOk { get; set; } = new int[1];
#endregion Public Properties
}
}
+4 -15
View File
@@ -55,11 +55,6 @@ namespace IOB_UT_NEXT
/// </summary>
public DateTime lastUpdate { get; set; } = DateTime.Now.AddDays(-1);
/// <summary>
/// Valore minimo da considerare come delta secondi x indicare variazione sui dati temporali
/// </summary>
public int minDeltaSec { get; set; } = 5;
/// <summary>
/// Status del SINGOLO IOB
/// </summary>
@@ -126,22 +121,16 @@ namespace IOB_UT_NEXT
if (online != item.online)
return false;
// controllo se sia ALMENO 10 sec...
if (lastUpdate != item.lastUpdate)
{
if (lastUpdate.Subtract(item.lastUpdate).TotalSeconds > minDeltaSec)
return false;
}
// controllo se sia ALMENO 3 sec...
// controllo se sia ALMENO 1 sec...
if (lastDataIn != item.lastDataIn)
{
if (lastDataIn.Subtract(item.lastDataIn).TotalSeconds > minDeltaSec)
if (lastDataIn.Subtract(item.lastDataIn).TotalSeconds > 1)
return false;
}
// controllo se sia ALMENO 5 sec...
// controllo se sia ALMENO 1 sec...
if (lastDataOut != item.lastDataOut)
{
if (lastDataOut.Subtract(item.lastDataOut).TotalSeconds > minDeltaSec)
if (lastDataOut.Subtract(item.lastDataOut).TotalSeconds > 1)
return false;
}
if (semIn != item.semIn)
+9 -53
View File
@@ -59,52 +59,6 @@ namespace IOB_UT_NEXT
#endregion Public Methods
}
#if false
/// <summary>
/// Classe di base per trasferimento informazioni di tipo RawTransfer
/// </summary>
public class BaseRawTransf
{
/// <summary>
/// Data-Ora riferimento (x ordinamento fifo)
/// </summary>
public DateTime dataRif { get; set; } = DateTime.Now;
/// <summary>
/// Messaggio in modalità raw/stringa
/// </summary>
public object mesContent { get; set; } = new object();
/// <summary>
/// Tipo di messaggio trasmesso
/// </summary>
public rawTransfType mesType { get; set; } = rawTransfType.ND;
/// <summary>
/// Costruttore senza parametri
/// </summary>
public BaseRawTransf()
{
this.dataRif = DateTime.Now;
this.mesContent = new object();
this.mesType = rawTransfType.ND;
}
/// <summary>
/// Costruttore oggetto
/// </summary>
/// <param name="dataRif"></param>
/// <param name="mesContent"></param>
/// <param name="mesType"></param>
public BaseRawTransf(DateTime dataRif, object mesContent, rawTransfType mesType)
{
this.dataRif = dataRif;
this.mesContent = mesContent;
this.mesType = mesType;
}
}
#endif
/// <summary>
/// Gestione dati di timing
/// </summary>
@@ -257,6 +211,8 @@ namespace IOB_UT_NEXT
/// </summary>
public class IobWinStatus
{
#region Public Properties
/// <summary>
/// ID univoco
/// </summary>
@@ -322,6 +278,10 @@ namespace IOB_UT_NEXT
/// </summary>
public int queueUlLen { get; set; } = 0;
#endregion Public Properties
#region Public Methods
/// <summary>
/// Override metodo di equality
/// </summary>
@@ -360,7 +320,9 @@ namespace IOB_UT_NEXT
{
return base.GetHashCode();
}
}
#endregion Public Methods
}
#endif
/// <summary>
@@ -808,12 +770,6 @@ namespace IOB_UT_NEXT
/// </summary>
public int Period { get; set; } = 60;
/// <summary>
/// UM parametro, impiegato anche x conversione (es epoch --&gt; datetime)
/// </summary>
public string UM { get; set; } = "";
#endregion Public Properties
}
}
+10 -14
View File
@@ -23,13 +23,9 @@ namespace IOB_UT_NEXT
/// <summary>
/// init classe gestione dati IOB su Redis
/// </summary>
/// <param name="codServer">IP/nome server</param>
/// <param name="codIob">Cod IOB</param>
/// <param name="tipoIob">Tipo di IOB</param>
/// <param name="minDeltaS">
/// Minima differenza in secondi x considerare variazione dati DataOra
/// </param>
public RedisIobCache(string codServer, string codIob, string tipoIob, int minDeltaS)
/// <param name="codServer"></param>
/// <param name="codIob"></param>
public RedisIobCache(string codServer, string codIob, string tipoIob)
{
// init dati di base...
currCodIob = codIob;
@@ -46,8 +42,7 @@ namespace IOB_UT_NEXT
{
CodIob = currCodIob,
IobType = currIobType,
online = false,
minDeltaSec = minDeltaS
online = false
};
// salvo in area REDIS
servStatus = newSrvStatus;
@@ -174,6 +169,7 @@ namespace IOB_UT_NEXT
{
string rawData = JsonConvert.SerializeObject(value);
saveAndSendMessage(redIobKey, redIobChannel, rawData);
//setRSV(redIobKey, rawData);
}
}
@@ -1107,16 +1103,16 @@ namespace IOB_UT_NEXT
/// </summary>
protected string currIobType = "ND";
/// <summary>
/// Nome del channel REDIS x dati IOB
/// </summary>
protected string redIobChannel = "IobChannel";
/// <summary>
/// Hash REDIS x dati IOB
/// </summary>
protected string redIobKey = "";
/// <summary>
/// Nome del channel REDIS x dati IOB
/// </summary>
protected string redIobChannel = "IobChannel";
/// <summary>
/// Hash REDIS x dati server
/// </summary>
-18
View File
@@ -1,18 +0,0 @@
using System;
namespace IOB_UT_NEXT
{
public class TimeUtils
{
#region Public Methods
public static DateTime epochConvert(double epoch)
{
DateTime date = new DateTime(1970, 1, 1, 0, 0, 0, 0); //from start epoch time
date = date.AddSeconds(epoch);
return date;
}
#endregion Public Methods
}
}
+6 -99
View File
@@ -166,19 +166,9 @@ namespace IOB_UT_NEXT
/// </summary>
public void setupData()
{
// 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;
}
// inizializzo vettore valore allarmi x banco int16
alarmsState = new uint[size / 2];
alarmsMask = new uint[size / 2];
// una volta inizializzata la classe di base sistemo vettori allarmi disabilitati ed il
// contatore blink dei fronti di discesa
@@ -198,7 +188,7 @@ namespace IOB_UT_NEXT
}
idx++;
// sistemo bank/indice
if (idx > bitSize - 1)
if (idx > 15)
{
bank++;
idx = 0;
@@ -244,11 +234,6 @@ namespace IOB_UT_NEXT
/// </summary>
public List<string> fluxLogVeto { 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>
@@ -259,11 +244,6 @@ namespace IOB_UT_NEXT
/// </summary>
public string keyEStop { get; set; } = "";
/// <summary>
/// Nome variabile x ExeMode
/// </summary>
public string keyExeMode { get; set; } = "";
/// <summary>
/// Nome variabile x pezzi FATTI
/// </summary>
@@ -289,16 +269,6 @@ namespace IOB_UT_NEXT
/// </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>
@@ -309,29 +279,6 @@ namespace IOB_UT_NEXT
/// </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;
#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
}
@@ -477,24 +424,6 @@ namespace IOB_UT_NEXT
{
#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>
@@ -510,22 +439,6 @@ namespace IOB_UT_NEXT
/// </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>
@@ -581,23 +494,17 @@ namespace IOB_UT_NEXT
/// </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>();
public 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>();
public Dictionary<string, dataConf> mMapWrite { get; set; } = new Dictionary<string, dataConf>();
/// <summary>
/// Elenco item RAW sottoscritti e relative configurazioni di decodifica da byte[]
+12 -90
View File
@@ -41,6 +41,11 @@ namespace IOB_UT_NEXT
/// </summary>
public static bool MPIO_Online = false;
/// <summary>
/// Oggetto connessione REDIS
/// </summary>
public static RedisIobCache redisMan = new RedisIobCache();
#endregion Public Fields
#region Public Properties
@@ -66,27 +71,6 @@ namespace IOB_UT_NEXT
#region Public Methods
/// <summary>
/// Restituisce la prima cifra (a sx) da un numero (es x decodere quale memoria modbus sia)
/// </summary>
/// <param name="num">Numero di cui trovare la priam cifra</param>
/// <returns></returns>
public static int getFirstInt(int num)
{
if (num >= 100000000) num /= 100000000;
if (num >= 10000) num /= 10000;
if (num >= 100) num /= 100;
if (num >= 10) num /= 10;
#if false
// formulazione alternativa con ciclo...
while (num >= 10)
num /= 10;
#endif
return num;
}
/// <summary>
/// formatta un numero in forma binaria 0/1
/// </summary>
@@ -212,11 +196,8 @@ namespace IOB_UT_NEXT
int pauseSendMSec = nextPauseSendMSec;
dtVetoSend = DateTime.Now.AddMilliseconds(pauseSendMSec);
// controllo log permesso...
if (logValuePermit(URL))
{
lg.Error($"Errore in callURL verso {URL}: impostato attesa di {pauseSendMSec} ms prima della prossima chiamata{Environment.NewLine}Eccezione:{Environment.NewLine}{exc}");
}
// log ogni
lg.Error($"Errore in callURL verso {URL}: impostato attesa di {pauseSendMSec} ms prima della prossima chiamata{Environment.NewLine}Eccezione:{Environment.NewLine}{exc}");
}
// restituisco valore!
return answ;
@@ -249,11 +230,7 @@ namespace IOB_UT_NEXT
answ = clientPayload.UploadString(URL, payload);
if (answ != "OK")
{
// controllo log permesso...
if (logValuePermit($"{URL}|[{answ}]"))
{
lg.Error($"Invio dati fallito, ricevuto messaggio [{answ}]:{Environment.NewLine}- URL{Environment.NewLine}{URL}{Environment.NewLine}- payload{Environment.NewLine}{payload}");
}
lg.Error($"Invio dati fallito, ricevuto messaggio [{answ}]:{Environment.NewLine}- URL{Environment.NewLine}{URL}{Environment.NewLine}- payload{Environment.NewLine}{payload}");
}
}
catch (Exception exc)
@@ -261,11 +238,8 @@ namespace IOB_UT_NEXT
// imposto veto
int pauseSendMSec = nextPauseSendMSec;
dtVetoSend = DateTime.Now.AddMilliseconds(pauseSendMSec);
// controllo log permesso...
if (logValuePermit(URL))
{
lg.Error($"Errore in callURL con PAYLOAD verso {URL}: impostato attesa di {pauseSendMSec} ms prima della prossima chiamata. Dump Payload:{Environment.NewLine}{payload}{Environment.NewLine}Eccezione:{Environment.NewLine}{exc}");
}
// log ogni
lg.Error($"Errore in callURL con PAYLOAD verso {URL}: impostato attesa di {pauseSendMSec} ms prima della prossima chiamata. Dump Payload:{Environment.NewLine}{payload}{Environment.NewLine}Eccezione:{Environment.NewLine}{exc}");
}
// restituisco valore!
return answ;
@@ -376,11 +350,7 @@ namespace IOB_UT_NEXT
}
catch (Exception exc)
{
// controllo log permesso...
if (logValuePermit("GetIP"))
{
lg.Error(exc);
}
lg.Error(exc);
}
return sIpAddr;
}
@@ -465,11 +435,7 @@ namespace IOB_UT_NEXT
}
catch (Exception exc)
{
// controllo log permesso...
if (logValuePermit("pingAddr"))
{
lg.Error(exc);
}
lg.Error(exc);
}
return answ;
}
@@ -750,50 +716,6 @@ namespace IOB_UT_NEXT
protected static WebClientWT clientPayload { get; set; }
#endregion Protected Properties
#region Private Fields
/// <summary>
/// Dizionario dei valori bloccati x evitare log eccessivo
/// </summary>
private static Dictionary<string, DateTime> vetoLogError = new Dictionary<string, DateTime>();
/// <summary>
/// Periodo di veto log in minuti
/// </summary>
private static int vetoPeriodMin = 30;
#endregion Private Fields
#region Private Methods
/// <summary>
/// Verifica se il log di un dato errore sia permesso
/// </summary>
/// <param name="logKey">ID del valore log da loggare/verificare</param>
/// <returns></returns>
private static bool logValuePermit(string logKey)
{
bool doLog = false;
if (vetoLogError.ContainsKey(logKey))
{
// verifico se veto scaduto...
if (DateTime.Now > vetoLogError[logKey])
{
doLog = true;
vetoLogError[logKey] = DateTime.Now.AddMinutes(vetoPeriodMin);
}
}
else
{
doLog = true;
vetoLogError.Add(logKey, DateTime.Now.AddMinutes(vetoPeriodMin));
}
return doLog;
}
#endregion Private Methods
}
/// <summary>
+146 -149
View File
@@ -13,6 +13,15 @@ namespace IOB_UT_NEXT
/// </summary>
public class fileMover
{
#region Protected Fields
/// <summary>
/// path di lavoro dei metodi leggi/scrivi
/// </summary>
protected string _workPath;
#endregion Protected Fields
#region Public Fields
/// <summary>
@@ -33,7 +42,7 @@ namespace IOB_UT_NEXT
/// inizializza il metodo alla cartella indicata
/// </summary>
/// <param name="_path"></param>
/// <param name="_log">non serve +... x retrocompatibilit...</param>
/// <param name="_log">non serve +... x retrocompatibilità...</param>
public fileMover(string _path, string _log)
{
setDirs(_path);
@@ -50,6 +59,111 @@ namespace IOB_UT_NEXT
#endregion Public Constructors
#region Private Methods
/// <summary>
/// cerca di caricare la directoryInfo o da httpcontext-application re-position o direttamente come workpath
/// </summary>
/// <returns></returns>
private DirectoryInfo getDirectoryInfo()
{
DirectoryInfo _di;
_di = new DirectoryInfo(_workPath);
return _di;
}
/// <summary>
/// Recupera oggetto DirInfo da path
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
private DirectoryInfo getDirectoryInfo(string path)
{
DirectoryInfo _di = new DirectoryInfo(path);
return _di;
}
/// <summary>
/// cerca di caricare il fileinfo o da httpcontext-application re-position o direttamente come workpath + nomefile
/// </summary>
/// <param name="_fullPath">path completo file</param>
/// <returns></returns>
private FileInfo getFileInfoByName(string _fullPath)
{
FileInfo _fi;
_fi = new FileInfo(_fullPath);
return _fi;
}
/// <summary>
/// cerca di caricare il fileinfo o da httpcontext-application re-position o direttamente come workpath + nomefile
/// </summary>
/// <param name="_path">cartella file</param>
/// <param name="_nomeFile">nome file</param>
/// <returns></returns>
private FileInfo getFileInfoByName(string _path, string _nomeFile)
{
FileInfo _fi;
_fi = new FileInfo(_path + "\\" + _nomeFile);
return _fi;
}
/// <summary>
/// setta le directory
/// </summary>
/// <param name="_path"></param>
private void setDirs(string _path)
{
_workPath = _path;
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// converte un byte[] in una string
/// </summary>
/// <param name="_array"></param>
/// <returns></returns>
protected string byteToStr(byte[] _array)
{
System.Text.ASCIIEncoding encod = new System.Text.ASCIIEncoding();
return encod.GetString(_array);
}
/// <summary>
/// converte una string in un byte[]
/// </summary>
/// <param name="_val"></param>
/// <returns></returns>
protected byte[] strToByte(string _val)
{
System.Text.ASCIIEncoding encod = new System.Text.ASCIIEncoding();
return encod.GetBytes(_val);
}
/// <summary>
/// verifica esistenza directory ed eventualmente crea restituendo nome completo di "/" finale
/// </summary>
/// <param name="_path"></param>
/// <returns></returns>
protected string verDir(string _path)
{
DirectoryInfo di = getDirectoryInfo(_path);
if (!di.Exists)
{
di.Create();
}
if (!_path.EndsWith("/") && !_path.EndsWith(@"\"))
{
_path += "/";
}
return _path;
}
#endregion Protected Methods
#region Public Methods
/// <summary>
@@ -139,15 +253,16 @@ namespace IOB_UT_NEXT
}
/// <summary>
/// Legge i dati da uno stream fino a quando arriva alla fine. I dati sono restituiti come
/// un byte[] array. Un eccezione IOException viene sollevata se una delle chiamate IO
/// sottostanti fallisce.
/// Legge i dati da uno stream fino a quando arriva alla fine.
/// I dati sono restituiti come un byte[] array. un eccezione IOException è
/// sollevata se una delle chiamate IO sottostanti fallisce.
/// </summary>
/// <param name="stream">Lo stream da cui leggere</param>
/// <param name="initialLength">Lunghezza buffer iniziale (-1 = default 32k)</param>
public static byte[] ReadFully(Stream stream, int initialLength)
{
// If we've been passed an unhelpful initial length, just use 32K.
// If we've been passed an unhelpful initial length, just
// use 32K.
if (initialLength < 1)
{
initialLength = 32768;
@@ -161,7 +276,8 @@ namespace IOB_UT_NEXT
{
read += chunk;
// If we've reached the end of our buffer, check to see if there's any more information
// If we've reached the end of our buffer, check to see if there's
// any more information
if (read == buffer.Length)
{
int nextByte = stream.ReadByte();
@@ -172,7 +288,8 @@ namespace IOB_UT_NEXT
return buffer;
}
// Nope. Resize the buffer, put in the byte we've just read, and continue
// Nope. Resize the buffer, put in the byte we've just
// read, and continue
byte[] newBuffer = new byte[buffer.Length * 2];
Array.Copy(buffer, newBuffer, buffer.Length);
newBuffer[read] = (byte)nextByte;
@@ -396,25 +513,6 @@ namespace IOB_UT_NEXT
return fatto;
}
/// <summary>
/// Elimina i file + vecchi di maxNumDays giorni
/// </summary>
/// <returns></returns>
public void deleteOlderThan(int maxNumDays)
{
DirectoryInfo _di = checkDir();
FileInfo[] _fis = _di.GetFiles();
DateTime dateLimit = DateTime.Now.AddDays(-maxNumDays);
try
{
_fis.Where(x => x.LastWriteTime < dateLimit).ToList().ForEach(x => x.Delete());
}
catch (Exception exc)
{
Logging.Instance.Error($"Eccezione in deleteOlderThan{Environment.NewLine}{exc}");
}
}
/// <summary>
/// elimina il file + vecchio
/// </summary>
@@ -443,6 +541,24 @@ namespace IOB_UT_NEXT
catch
{ }
}
/// <summary>
/// Elimina i file + vecchi di maxNumDays giorni
/// </summary>
/// <returns></returns>
public void deleteOlderThan(int maxNumDays)
{
DirectoryInfo _di = checkDir();
FileInfo[] _fis = _di.GetFiles();
DateTime dateLimit = DateTime.Now.AddDays(-maxNumDays);
try
{
_fis.Where(x => x.LastWriteTime <dateLimit).ToList().ForEach(x => x.Delete());
}
catch(Exception exc)
{
Logging.Instance.Error($"Eccezione in deleteOlderThan{Environment.NewLine}{exc}");
}
}
/// <summary>
/// elenco dei files come array di oggetti FileInfo
@@ -466,7 +582,7 @@ namespace IOB_UT_NEXT
}
/// <summary>
/// elimina la directory di lavoro se dir virtuale mappata
/// elimina la directory di lavoro se è dir virtuale mappata
/// </summary>
/// <returns></returns>
public bool eliminaDir()
@@ -736,7 +852,7 @@ namespace IOB_UT_NEXT
/// imposta la dir di lavoro
/// </summary>
/// <param name="_path"></param>
/// <param name="_log">non serve +... x retrocompatibilit...</param>
/// <param name="_log">non serve +... x retrocompatibilità...</param>
public void setDirectory(string _path, string _log)
{
setDirs(_path);
@@ -795,8 +911,7 @@ namespace IOB_UT_NEXT
{
s.SetLevel(5);
byte[] buffer = new byte[4096];
// effettuo una ricerca dei files corrispondenti al criterio regexp, e per
// ognuno effettuo inserimento in zipfile...
// effettuo una ricerca dei files corrispondenti al criterio regexp, e per ognuno effettuo inserimento in zipfile...
FileInfo[] filesTrovati = elencoFiles_FI(regExp);
ZipEntry entry;
foreach (FileInfo _fi in filesTrovati)
@@ -808,8 +923,7 @@ namespace IOB_UT_NEXT
s.PutNextEntry(entry);
using (FileStream fs = File.OpenRead(_fi.FullName))
{
// Using a fixed size buffer here makes no noticeable difference for
// output but keeps a lid on memory usage.
// Using a fixed size buffer here makes no noticeable difference for output but keeps a lid on memory usage.
int sourceBytes;
do
{
@@ -912,122 +1026,5 @@ namespace IOB_UT_NEXT
}
#endregion Public Methods
#region Protected Fields
/// <summary>
/// path di lavoro dei metodi leggi/scrivi
/// </summary>
protected string _workPath;
#endregion Protected Fields
#region Protected Methods
/// <summary>
/// converte un byte[] in una string
/// </summary>
/// <param name="_array"></param>
/// <returns></returns>
protected string byteToStr(byte[] _array)
{
System.Text.ASCIIEncoding encod = new System.Text.ASCIIEncoding();
return encod.GetString(_array);
}
/// <summary>
/// converte una string in un byte[]
/// </summary>
/// <param name="_val"></param>
/// <returns></returns>
protected byte[] strToByte(string _val)
{
System.Text.ASCIIEncoding encod = new System.Text.ASCIIEncoding();
return encod.GetBytes(_val);
}
/// <summary>
/// verifica esistenza directory ed eventualmente crea restituendo nome completo di "/" finale
/// </summary>
/// <param name="_path"></param>
/// <returns></returns>
protected string verDir(string _path)
{
DirectoryInfo di = getDirectoryInfo(_path);
if (!di.Exists)
{
di.Create();
}
if (!_path.EndsWith("/") && !_path.EndsWith(@"\"))
{
_path += "/";
}
return _path;
}
#endregion Protected Methods
#region Private Methods
/// <summary>
/// cerca di caricare la directoryInfo o da httpcontext-application re-position o
/// direttamente come workpath
/// </summary>
/// <returns></returns>
private DirectoryInfo getDirectoryInfo()
{
DirectoryInfo _di;
_di = new DirectoryInfo(_workPath);
return _di;
}
/// <summary>
/// Recupera oggetto DirInfo da path
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
private DirectoryInfo getDirectoryInfo(string path)
{
DirectoryInfo _di = new DirectoryInfo(path);
return _di;
}
/// <summary>
/// cerca di caricare il fileinfo o da httpcontext-application re-position o direttamente
/// come workpath + nomefile
/// </summary>
/// <param name="_fullPath">path completo file</param>
/// <returns></returns>
private FileInfo getFileInfoByName(string _fullPath)
{
FileInfo _fi;
_fi = new FileInfo(_fullPath);
return _fi;
}
/// <summary>
/// cerca di caricare il fileinfo o da httpcontext-application re-position o direttamente
/// come workpath + nomefile
/// </summary>
/// <param name="_path">cartella file</param>
/// <param name="_nomeFile">nome file</param>
/// <returns></returns>
private FileInfo getFileInfoByName(string _path, string _nomeFile)
{
FileInfo _fi;
_fi = new FileInfo(_path + "\\" + _nomeFile);
return _fi;
}
/// <summary>
/// setta le directory
/// </summary>
/// <param name="_path"></param>
private void setDirs(string _path)
{
_workPath = _path;
}
#endregion Private Methods
}
}
+3 -3
View File
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MapoSDK" version="6.14.2211.3016" targetFramework="net462" />
<package id="MapoSDK" version="6.14.2205.2808" targetFramework="net462" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="6.0.0" targetFramework="net462" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net462" />
<package id="NLog" version="4.7.13" targetFramework="net462" />
<package id="Pipelines.Sockets.Unofficial" version="2.2.2" targetFramework="net462" />
<package id="Pipelines.Sockets.Unofficial" version="2.2.0" targetFramework="net462" />
<package id="SharpZipLib" version="1.3.1" targetFramework="net462" />
<package id="StackExchange.Redis" version="2.6.80" targetFramework="net462" />
<package id="StackExchange.Redis" version="2.2.4" targetFramework="net462" />
<package id="System.Buffers" version="4.5.1" targetFramework="net462" />
<package id="System.Diagnostics.PerformanceCounter" version="6.0.0" targetFramework="net462" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net462" />
-17
View File
@@ -1,17 +0,0 @@
using MapoSDK;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_UT_NEXT
{
public class plcMemMapExt : plcMemMap
{
public Dictionary<string, string> optMemPar { get; set; } = new Dictionary<string, string>();
public Dictionary<string, int> fileDecod { get; set; } = new Dictionary<string, int>();
}
}
+14 -14
View File
@@ -18,10 +18,10 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
FANUC|Any CPU = FANUC|Any CPU
FANUC|x86 = FANUC|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
Remote_DEBUG|Any CPU = Remote_DEBUG|Any CPU
Remote_DEBUG|x86 = Remote_DEBUG|x86
SIEMENS|Any CPU = SIEMENS|Any CPU
SIEMENS|x86 = SIEMENS|x86
EndGlobalSection
@@ -30,14 +30,14 @@ Global
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|x86.ActiveCfg = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|x86.Build.0 = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|Any CPU.ActiveCfg = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|Any CPU.Build.0 = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|x86.ActiveCfg = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.FANUC|x86.Build.0 = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|Any CPU.Build.0 = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|x86.ActiveCfg = Release|x86
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Release|x86.Build.0 = Release|x86
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|Any CPU.ActiveCfg = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|Any CPU.Build.0 = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|x86.ActiveCfg = Remote_DEBUG|x86
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Remote_DEBUG|x86.Build.0 = Remote_DEBUG|x86
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.SIEMENS|x86.ActiveCfg = Debug|Any CPU
@@ -46,14 +46,14 @@ Global
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|x86.ActiveCfg = Debug|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.Debug|x86.Build.0 = Debug|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|Any CPU.ActiveCfg = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|Any CPU.Build.0 = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|x86.ActiveCfg = Debug|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.FANUC|x86.Build.0 = Debug|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|Any CPU.Build.0 = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|x86.ActiveCfg = Release|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.Release|x86.Build.0 = Release|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|Any CPU.ActiveCfg = Debug|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|Any CPU.Build.0 = Debug|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|x86.ActiveCfg = Remote_DEBUG|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.Remote_DEBUG|x86.Build.0 = Remote_DEBUG|x86
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
{90512E12-29FC-460D-94CC-648C2A072DBD}.SIEMENS|x86.ActiveCfg = Debug|x86
@@ -62,14 +62,14 @@ Global
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|x86.ActiveCfg = Debug|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Debug|x86.Build.0 = Debug|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|Any CPU.ActiveCfg = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|Any CPU.Build.0 = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|x86.ActiveCfg = Debug|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.FANUC|x86.Build.0 = Debug|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|Any CPU.Build.0 = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|x86.ActiveCfg = Release|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Release|x86.Build.0 = Release|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|Any CPU.ActiveCfg = Remote_DEBUG|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|Any CPU.Build.0 = Remote_DEBUG|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|x86.ActiveCfg = Remote_DEBUG|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.Remote_DEBUG|x86.Build.0 = Remote_DEBUG|x86
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|Any CPU.Build.0 = Release|Any CPU
{B2ABB009-C046-4F9C-956C-52DCAA9FE5A9}.SIEMENS|x86.ActiveCfg = Debug|x86
File diff suppressed because it is too large Load Diff
+171 -174
View File
@@ -1,177 +1,174 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<appSettings>
<add key="appName" value="IOB-WIN-NEXT" />
<!--<add key="appVers" value="develop" />-->
<add key="enableTest" value="true" />
<add key="enableContapezzi" value="true" />
<add key="enableMode" value="true" />
<add key="enableOverrides" value="false" />
<add key="enableTSVC" value="true" />
<add key="enableDynData" value="false" />
<add key="enableSysInfo" value="false" />
<add key="enableAlarms" value="true" />
<add key="doStartMemDump" value="false" />
<add key="doSampleMemory" value="false" />
<add key="basePrgMemPath" value="CNCMEMUSER" />
<add key="pingMsTimeout" value="1500" />
<add key="serverPingDisabled" value="false" />
<add key="urlCallTOut" value="9999" />
<add key="urlRandWait" value="200" />
<!-- ciclo corto x invio a server: ms -->
<add key="timerIntMs" value="10" />
<add key="fastCount" value="20" />
<add key="normCount" value="200" />
<add key="slowCount" value="500" />
<add key="verySlowCount" value="3000" />
<add key="sampleMemCount" value="6000" />
<add key="waitEndCycle" value="0" />
<add key="comCheckTOut" value="10" />
<!-- watchdog, ping, check disconnesso -->
<add key="nMaxSend" value="10" />
<add key="pingTestSec" value="5" />
<add key="watchdogMaxSec" value="90" />
<add key="disconMaxSec" value="30" />
<add key="defIOB" value="2999" />
<add key="pauseSendMSec" value="2000" />
<add key="sendStartFLog" value="false" />
<!--gestione coda-->
<add key="maxQueueFLog" value="16384" />
<add key="maxQueueRawTransf" value="1024" />
<!--gestione max num errori-->
<add key="maxAliveErrors" value="1000" />
<add key="maxErroriCheck" value="200" />
<add key="maxSendErrors" value="100" />
<add key="maxReadErrors" value="20" />
<!--parametri SIM-->
<add key="waitSimPar" value="30" />
<!--<add key="waitSimPar" value="45" />-->
<!--gestione REDIS-->
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
<add key="redisDb" value="10" />
<!--gestione invio dati in blocchi Json-->
<add key="minJsonData" value="2" />
<add key="maxJsonData" value="100" />
<add key="maxJsonDataEv" value="25" />
<!--gestione multithread-->
<add key="sendDataByThread" value="false" />
<!--Modalità DEMO: DemoOUT indica che NON invia davvero al server e DemoIN che simula e NON legge da PLC-->
<add key="DemoIn" value="false" />
<add key="DemoInSample" value="false" />
<add key="DemoOut" value="false" />
<!--definizione invio dati molto variabili-->
<add key="SendAxPos" value="false" />
<add key="SendFeedSpeed" value="false" />
<!--Definizione avvio Adapter-->
<add key="autoLoadConf" value="true" />
<add key="autoStartOnLoad" value="true" />
<add key="startMinimized" value="false" />
<add key="windowCanMax" value="true" />
<add key="trayClose" value="true" />
<add key="autoSaveSec" value="60" />
<add key="waitRecMSec" value="60000" />
<add key="testCharSep" value="|" />
<add key="delayShowLogMs" value="500" />
<add key="vetoSeconds" value="5" />
<!--conf file-->
<add key="dataPath" value="DATA" />
<add key="dataConfPath" value="DATA\CONF" />
<add key="dataDatPath" value="DATA\DAT" />
<add key="resxPath" value="Resources" />
<add key="mainConfFile" value="MAIN.ini" />
<add key="defaultPersLayerFile" value="PersistData.dat" />
<add key="simDataFile" value="SimData.dat" />
<add key="memDumpFile" value="MemoryDump.dat" />
<add key="numSim" value="1" />
<add key="MMapR" value="MMapR.map" />
<add key="MMapW" value="MMapW.map" />
<add key="AUpdAsAdm" value="true" />
<add key="ConfToCloud" value="true" />
<add key="CacheConfToCloudDuratHour" value="24" />
<!--logging-->
<add key="recTime" value="true" />
<add key="verbose" value="false" />
<add key="logEvery" value="100" />
<add key="zipLogOldDay" value="1" />
<add key="maxLogDirSize" value="300" />
<add key="maxLogDays" value="400" />
<add key="numRowConsole" value="50" />
<add key="verboseLogTOut" value="60" />
<!--conf x FANUC-->
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="pzCountDelay" value="2000" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;libs" />
<probing privatePath="lib;libs" xmlns="" />
<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" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="OPENcontrol" />
</basicHttpBinding>
<netNamedPipeBinding>
<binding name="NetNamedPipeBinding_ISizerService">
<security mode="None" />
</binding>
</netNamedPipeBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_ISizerService" maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://192.168.20.2:8080" binding="basicHttpBinding" bindingConfiguration="OPENcontrol" contract="OpenControl.OPENcontrolPortType" name="OPENcontrol" />
<endpoint address="http://localhost:8001/SizerService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISizerService" contract="SizerService.ISizerService" name="WSHttpBinding_ISizerService" />
<endpoint address="net.pipe://localhost/Compac/8001/SizerService" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_ISizerService" contract="SizerService.ISizerService" name="NetNamedPipeBinding_ISizerService" />
</client>
</system.serviceModel>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<appSettings>
<add key="appName" value="IOB-WIN-NEXT" />
<!--<add key="appVers" value="develop" />-->
<add key="enableTest" value="true" />
<add key="enableContapezzi" value="true" />
<add key="enableMode" value="true" />
<add key="enableOverrides" value="false" />
<add key="enableTSVC" value="true" />
<add key="enableDynData" value="false" />
<add key="enableSysInfo" value="false" />
<add key="enableAlarms" value="true" />
<add key="doStartMemDump" value="false" />
<add key="doSampleMemory" value="false" />
<add key="basePrgMemPath" value="CNCMEMUSER" />
<add key="pingMsTimeout" value="1500" />
<add key="serverPingDisabled" value="false" />
<add key="urlCallTOut" value="9999" />
<add key="urlRandWait" value="200" />
<!-- ciclo corto x invio a server: ms -->
<add key="timerIntMs" value="10" />
<add key="fastCount" value="20" />
<add key="normCount" value="200" />
<add key="slowCount" value="500" />
<add key="verySlowCount" value="3000" />
<add key="sampleMemCount" value="6000" />
<add key="waitEndCycle" value="0" />
<add key="comCheckTOut" value="10" />
<!-- watchdog, ping, check disconnesso -->
<add key="nMaxSend" value="10" />
<add key="pingTestSec" value="5" />
<add key="watchdogMaxSec" value="90" />
<add key="disconMaxSec" value="30" />
<add key="defIOB" value="2999" />
<add key="pauseSendMSec" value="2000" />
<!--gestione coda-->
<add key="maxQueueFLog" value="16384" />
<add key="maxQueueRawTransf" value="1024" />
<!--gestione max num errori-->
<add key="maxAliveErrors" value="1000" />
<add key="maxSendErrors" value="100" />
<add key="maxReadErrors" value="20" />
<!--parametri SIM-->
<add key="waitSimPar" value="30" />
<!--<add key="waitSimPar" value="45" />-->
<!--gestione REDIS-->
<add key="RedisConn" value="localhost,abortConnect=false,ssl=false" />
<add key="RedisConnAdmin" value="localhost,abortConnect=false,ssl=false" />
<add key="redisDb" value="10" />
<!--gestione invio dati in blocchi Json-->
<add key="minJsonData" value="2" />
<add key="maxJsonData" value="100" />
<add key="maxJsonDataEv" value="25" />
<!--gestione multithread-->
<add key="sendDataByThread" value="false" />
<!--Modalità DEMO: DemoOUT indica che NON invia davvero al server e DemoIN che simula e NON legge da PLC-->
<add key="DemoIn" value="false" />
<add key="DemoInSample" value="false" />
<add key="DemoOut" value="false" />
<!--definizione invio dati molto variabili-->
<add key="SendAxPos" value="false" />
<add key="SendFeedSpeed" value="false" />
<!--Definizione avvio Adapter-->
<add key="autoLoadConf" value="true" />
<add key="autoStartOnLoad" value="true" />
<add key="startMinimized" value="false" />
<add key="windowCanMax" value="true" />
<add key="trayClose" value="true" />
<add key="autoSaveSec" value="60" />
<add key="waitRecMSec" value="60000" />
<add key="testCharSep" value="|" />
<add key="delayShowLogMs" value="500" />
<add key="vetoSeconds" value="5" />
<!--conf file-->
<add key="dataPath" value="DATA" />
<add key="dataConfPath" value="DATA\CONF" />
<add key="dataDatPath" value="DATA\DAT" />
<add key="resxPath" value="Resources" />
<add key="mainConfFile" value="MAIN.ini" />
<add key="defaultPersLayerFile" value="PersistData.dat" />
<add key="simDataFile" value="SimData.dat" />
<add key="memDumpFile" value="MemoryDump.dat" />
<add key="numSim" value="1" />
<add key="MMapR" value="MMapR.map" />
<add key="MMapW" value="MMapW.map" />
<add key="AUpdAsAdm" value="true" />
<add key="ConfToCloud" value="true" />
<!--logging-->
<add key="recTime" value="true" />
<add key="verbose" value="false" />
<add key="logEvery" value="100" />
<add key="zipLogOldDay" value="1" />
<add key="maxLogDirSize" value="300" />
<add key="maxLogDays" value="400" />
<add key="numRowConsole" value="50" />
<add key="verboseLogTOut" value="60" />
<!--conf x FANUC-->
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="pzCountDelay" value="2000" />
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;libs" />
<probing privatePath="lib;libs" xmlns="" />
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
<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" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="OPENcontrol" />
</basicHttpBinding>
<netNamedPipeBinding>
<binding name="NetNamedPipeBinding_ISizerService">
<security mode="None" />
</binding>
</netNamedPipeBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_ISizerService" maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://192.168.20.2:8080" binding="basicHttpBinding" bindingConfiguration="OPENcontrol" contract="OpenControl.OPENcontrolPortType" name="OPENcontrol" />
<endpoint address="http://localhost:8001/SizerService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISizerService" contract="SizerService.ISizerService" name="WSHttpBinding_ISizerService" />
<endpoint address="net.pipe://localhost/Compac/8001/SizerService" binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_ISizerService" contract="SizerService.ISizerService" name="NetNamedPipeBinding_ISizerService" />
</client>
</system.serviceModel>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
+6 -2
View File
@@ -1,4 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace IOB_WIN_NEXT
@@ -11,7 +15,7 @@ namespace IOB_WIN_NEXT
{
#region Public Methods
public static void UIThread(this Control control, Action code)
static public void UIThread(this Control control, Action code)
{
if (control.InvokeRequired)
{
@@ -21,7 +25,7 @@ namespace IOB_WIN_NEXT
code.Invoke();
}
public static void UIThreadInvoke(this Control control, Action code)
static public void UIThreadInvoke(this Control control, Action code)
{
if (control.InvokeRequired)
{
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_COSMAP
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=COSMAP
MODEL=02
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_ROBOTSERVICE
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=RobotService
MODEL=SMER12
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_ROBOTSERVICE
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=RobotService
MODEL=SCAT06
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_ROBOTSERVICE
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=RobotService
MODEL=SCAT05
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=SIEMENS_APROCHIM
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=Aprochim
MODEL=Micro4000
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=WPS
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=Atlas Copco
MODEL=GA18VP_13
+1 -1
View File
@@ -4,7 +4,7 @@
CNCTYPE=WPS
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=Atlas Copco
MODEL=GA18VP_12
-4
View File
@@ -65,9 +65,5 @@
"PosAct": 50,
"PosTgt": 50,
"InvDDone": 50
},
"mMapWrite": {
},
"mMapRead": {
}
}
+1 -1
View File
@@ -26,7 +26,7 @@ CMDREBO=/sendReboot.aspx?idxMacchina=
; Red: Y31.4 | Yellow: Y31.5 | Green Y31.6 | riscaldamento Y7.4 ???
;BIT0=CONN
BIT1=Y31.6
BIT2=PZCOUNT.MACRO.10100
BIT2=STD.MACRO.10100
BIT3=Y31.4
BIT4=Y31.5
BIT5=Y7.4
-78
View File
@@ -1,78 +0,0 @@
;Configurazione IOB-WIN
[IOB]
;Impianto IMAX Aeromec - Jetco (non va, sostituito con OPC-UA)
CNCTYPE=MODBUS_TCP_IMAX_AEROMEC
PING_MS_TIMEOUT=1000
MinDeltaSec=5
[MACHINE]
VENDOR=IMAX
MODEL=Filtro Aria
[CNC]
IP=192.168.0.80
PORT=502
[SERVER]
MPIP=http://192.168.1.7
MPURL=/MP/IO
CMDBASE=/IOB/input/
CMDFLOG=/IOB/flog/
CMDALIVE=/IOB
CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
ADDR_READ=40001
ADDR_WRITE=40001
SIZE_READ=30
SIZE_WRITE=0
HR_BASE_ADDR=40000
DELTA_BASE=0
[BLINK]
;MAX_COUNTER_BLINK = 30
MAX_COUNTER_BLINK = 15
;bit0 = 0
;bit1 = 0
;bit2 = 1
;bit3 = 1
;bit4 = 1
;bit5 = 0
;bit6 = 0
;bit7 = 0
BLINK_FILT=0
;BLINK_FILT=28
[OPTPAR]
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=STD.DB85.DBRE16
DISABLE_PZCOUNT=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
; GEST DATI DYN
ENABLE_DYN_DATA=TRUE
FORCE_DYN_DATA=TRUE
; gestione delta minimo accettabile tra min/MAX
DELTA_VAL=0.1
; clock base (da 10ms)
timerIntMs=10
; conf parametri memoria READ/WRITE
PARAM_CONF=3026.json
NO_PING=FALSE
; conf blocchi memoria x READ
MEM_BLOCK=3026_MBlock.json
; conf aree allarme
ALARM_CONF=3026_alarm.json
; rimozione check limiti min/max dynData
disDynDataRangeCheck=true
[BRANCH]
NAME=master
-110
View File
@@ -1,110 +0,0 @@
{
"mMapWrite": {
},
"mMapRead": {
//"StatusWord": {
// "name": "StatusWord",
// "description": "Word di Status",
// "memAddr": "40002",
// "tipoMem": "Int",
// "index": 2,
// "size": 1,
// "func": "POINT",
// "period": 90,
// "factor": 1,
// "minVal": 0,
// "maxVal": 65536,
// "unit": "BMap"
//},
//"StatusDetWord": {
// "name": "StatusDetWord",
// "description": "Word di Status",
// "memAddr": "40005",
// "tipoMem": "Int",
// "index": 5,
// "size": 1,
// "func": "POINT",
// "period": 90,
// "factor": 1,
// "minVal": 0,
// "maxVal": 65536,
// "unit": "BMap"
//},
"FreqInverter": {
"name": "FreqInverter",
"description": "Frequenza Inverter",
"memAddr": "40011",
"tipoMem": "Real",
"index": 11,
"size": 2,
"func": "MEDIAN",
"period": 90,
"factor": 1,
"minVal": 0,
"maxVal": 999999999,
"unit": "Hz"
},
"CDOreManuten": {
"name": "CDOreManuten",
"description": "Residuo ore a prossimo service",
"memAddr": "40013",
"tipoMem": "Int",
"index": 13,
"size": 1,
"func": "MEDIAN",
"period": 90,
"factor": 1,
"minVal": 0,
"maxVal": 999999999,
"unit": "h"
},
"COreTAsp1": {
"name": "COreTAsp1",
"description": "Totale ore funzionamento impianto",
"memAddr": "40014",
"tipoMem": "Int",
"index": 14,
"size": 1,
"func": "MEDIAN",
"period": 90,
"factor": 1,
"minVal": 0,
"maxVal": 999999999,
"unit": "h"
},
"COrePAsp1": {
"name": "COrePAsp1",
"description": "Parziale ore funzionamento impianto da ultimo service",
"memAddr": "40015",
"tipoMem": "Int",
"index": 15,
"size": 1,
"func": "MEDIAN",
"period": 90,
"factor": 1,
"minVal": 0,
"maxVal": 999999999,
"unit": "h"
},
"AmpereReale": {
"name": "AmpereReale",
"description": "Assorbimento aspiratore 1",
"memAddr": "40016",
"tipoMem": "Real",
"index": 16,
"size": 2,
"func": "MEDIAN",
"period": 90,
"factor": 1,
"minVal": 0,
"maxVal": 999999999,
"unit": "A"
}
},
"optMemPar": {
"AutoBitCond": "40002.14=1",
"EStopBitCond": "40002.9=0",
"WorkBitCond": "40002.0=1"
}
}
@@ -1,5 +0,0 @@
{
"ReadBlocks": {
"40000": 30
}
}
@@ -1,52 +0,0 @@
[
{
"description": "Allarmi Impianto",
"tipoMem": "DInt",
"memAddr": "40003",
"index": 3,
"size": 2,
"messages": [
"ALLARME VENTILATORE 1",
"ALLARME VENTILATORE 2",
"WARNING FILTRI INTASATI",
"WARNING LIVELLO FILTRO",
"ALLARME LIVELLO FILTRO",
"ALLARME TAGLIAFUOCO 1 ASPIRAZIONE ",
"ALLARME TAGLIAFUOCO 2 ASPIRAZIONE ",
"CUMULATIVO ALLARMI ALIMENTAZIONI (24V AC-DC)",
"ALLARME FUORIUSCITA IQUINANTE ",
"ALLARME TERMOVELOCIMETRICO",
"ALLARME RILEVATORE SCINTILLE",
"ALLARME SPORTELLO APERTO",
"ALLARME MOTORE VALVOLA STELLARE FILTRO",
"ALLARME MOTORE COCLEA ",
"ALLARME MOTORE VALVOLA STELLARE CALDAIA",
"ALLARME MOTORE ESTRATTORE FILTRO"
]
},
{
"description": "Allarmi Impianto",
"tipoMem": "DInt",
"memAddr": "40004",
"index": 4,
"size": 2,
"messages": [
"ALLARME MOTORE ASPIRATORE TRAVASO",
"WARNING BY-PASS 1 ASPIRAZIONE",
"WARNING BY-PASS 2 ASPIRAZIONE",
"WARNING BY-PASS 3 ASPIRAZIONE",
"WARNING BY-PASS 4 ASPIRAZIONE",
"ALLARME TERMICO VIBRATORI",
"ALLARME INTASAMENTO ESTRATTORE",
"WARNING FILTRI INTASATI PLENUM",
"CUMULATIVO ALLARMI RECUPERATORE",
"WARNING SERRANDA 1 PARTENZA ASPIRAZIONE",
"WARNING SERRANDA 2 PARTENZA ASPIRAZIONE",
"WARNING SERRANDA 3 PARTENZA ASPIRAZIONE",
"ALLARME IMPLOSIONE TUBAZIONI",
"WARNING IMPLOSIONE TUBAZIONI",
"ALLARME VENTILATORE 3",
"ALLARME INTASAMENTO TASCHE"
]
}
]
-71
View File
@@ -1,71 +0,0 @@
;Configurazione IOB-WIN
[IOB]
;Impianto IMAS AEROMEC Jetco
CNCTYPE=OpcUaImasAeromec
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=IMAX
MODEL=Filtro Aria
[CNC]
IP=192.168.0.80
PORT=4840
;GETPRGNAME=true
[SERVER]
MPIP=http://192.168.1.7
MPURL=/MP/IO
CMDBASE=/IOB/input/
CMDFLOG=/IOB/flog/
CMDALIVE=/IOB
CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
ADDR_READ=40001
ADDR_WRITE=40001
SIZE_READ=30
SIZE_WRITE=0
[BLINK]
;MAX_COUNTER_BLINK = 30
MAX_COUNTER_BLINK = 15
;bit0 = 0
;bit1 = 0
;bit2 = 1
;bit3 = 1
;bit4 = 1
;bit5 = 0
;bit6 = 0
;bit7 = 0
BLINK_FILT=0
;BLINK_FILT=28
[OPTPAR]
AUTO_CHANGE_ODL=TRUE
CHANGE_ODL_MODE=DAILY
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=OPC
DISABLE_PZCOUNT=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
; GEST DATI DYN
ENABLE_DYN_DATA=TRUE
FORCE_DYN_DATA=TRUE
ENABLE_DATA_FILTER=TRUE
ENABLE_CLI_RESTART=TRUE
; gestione delta minimo accettabile tra min/MAX
DELTA_VAL=0
; clock base (da 10ms)
timerIntMs=10
; conf parametri memoria READ/WRITE
OPC_PARAM_CONF=3026.json
[BRANCH]
NAME=master
-154
View File
@@ -1,154 +0,0 @@
{
"BrowseFullVal": "i=85",
"BrowseNSIndex": 4,
"BrowseValue": 5001,
"keyPartCount": "",
"keyPartReq": "",
"keyPartId": "",
"keyProgName": "",
"keyExeMode": "",
"keyRunMode": "",
"runModeSend": true,
"pingAsPowerOn": true,
"forcePingOk": false,
"translRunMode": true,
"Identity": {
"UserName": "IMAS",
"Passwd": "iM@s_1975"
},
"condWork": [],
"condWorkOpc": {
"checkMode": "OR",
"checkList": [
{
"keyName": "ASPIRATORE 1 IN FUNZIONE",
"targetValue": "True"
}
]
},
"condPowerOn": {
"checkMode": "OR",
"negateValue": false,
"checkList": []
},
"condReady": {
"checkMode": "OR",
"checkList": [
{
"keyName": "GENERICO RUN IMPIANTO",
"targetValue": "5"
}
]
},
"condManual": {
"checkMode": "OR",
"checkList": [
{
"keyName": "SCARICO DIRETTO ABILITATO",
"targetValue": "True"
},
{
"keyName": "SCARICO IN CALDAIA ABILITATO",
"targetValue": "True"
},
{
"keyName": "SCARICO IN CONTAINER ABILITATO",
"targetValue": "True"
}
]
},
"condEStop": {
"checkMode": "AND",
"checkList": [
{
"keyName": "PULSANTE DI EMERGENZA PREMUTO",
"targetValue": "False"
}
]
},
"condError": {
"checkMode": "OR",
"checkList": [
{
"keyName": "CUMULATIVO ALLARMI BLOCCANTI SICUREZZE",
"targetValue": "True"
},
{
"keyName": "CUMULATIVO ALLARMI IMPIANTO ASPIRAZIONE",
"targetValue": "True"
}
]
},
"condCountEnabled": {
"checkMode": "AND",
"checkList": []
},
"condWarmUpCoolDown": {
"checkMode": "OR",
"negateValue": true,
"checkList": []
},
"condWarning": {
"checkMode": "AND",
"checkList": []
},
"condSetup": {
"checkMode": "AND",
"checkList": []
},
"fluxLogVeto": [
"Auditing",
"EnabledFlag",
"RedundancySupport",
"LocaleIdArray",
"MaxBrowseContinuationPoints",
"MaxHistoryContinuationPoints",
"MaxMonitoredItemsPerCall",
"MaxNodesPerBrowse",
"MaxNodesPerMethodCall",
"MaxNodesPerNodeManagement",
"MaxNodesPerRegisterNodes",
"MaxNodesPerRead",
"MaxNodesPerTranslateBrowsePathsToNodeIds",
"MaxNodesPerWrite",
"MaxQueryContinuationPoints",
"MinSupportedSampleRate",
"NamespaceArray",
"NamingRule",
"Server",
"ServerArray",
"ServerDiagnostics",
"ServerDiagnosticsSummary",
"ServerProfileArray",
"ServerStatus",
"ServiceLevel",
"SoftwareCertificates"
],
"itemTranslation": {
"fdovrd": "PATH FEED OVERRIDE",
"rovrd": "PATH RAPID OVERRIDE",
"RunMode_0": "STOP",
"RunMode_1": "RUN",
"SCARICO DIRETTO ABILITATO": "SCARICO DIRETTO ABILITATO",
"rstat": "Execution Mode",
"mode": "Controller Mode",
"PartName(0)": "Program Name",
"PartDone(0)": "Pezzi Prodotti",
"PartToDo(0)": "Qta Richiesta",
"MachineStatus(0)": "Stato Macchina principale",
"MachineStatus(1)": "Stato Macchina secondario",
"EmergencyState": "Emergenza"
},
"mMapWrite": {
},
"subscribedItems": [
],
"WatchDog": {
"IsEnabled": false,
"MemConfRead": "ns=4;s=tomes_1_Watchdog",
"MemConfWrite": "ns=4;s=tomach_1_watchdog",
"MaxVal": 9999
},
"fluxLogKeyValVeto": {
}
}
@@ -1,83 +0,0 @@
;Configurazione IOB-WIN
[IOB]
;Travel Lift CIMOLAI (https://www.cimolaitechnology.com/it/products/) con controllo MBH OpcUa
CNCTYPE=OpcUaMBHCimolai
PING_MS_TIMEOUT=500
[MACHINE]
VENDOR=CIMOLAI
MODEL=Travel Lift
[CNC]
IP=192.168.60.234
PORT=48010
GETPRGNAME=true
[SERVER]
MPIP=http://192.168.60.15
MPURL=/MP/IO
CMDBASE=/IOB/input/
CMDFLOG=/IOB/flog/
CMDALIVE=/IOB
CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
ADDR_READ=DB9999.DBB0
ADDR_WRITE=DB9999.DBB0
SIZE_READ=0
SIZE_WRITE=0
[BLINK]
;MAX_COUNTER_BLINK = 30
MAX_COUNTER_BLINK = 30
;bit0 = 1
;bit1 = 0
;bit2 = 0
;bit3 = 0
;bit4 = 1
;bit5 = 0
;bit6 = 0
;bit7 = 0
;BLINK_FILT=145
BLINK_FILT=0
[OPTPAR]
AUTO_CHANGE_ODL=true
CHANGE_ODL_MODE=TIME
CHANGE_ODL_HOURS=24
CHANGE_ODL_IDLE_MIN=5
PZCOUNT_MODE=OPC
DISABLE_PZCOUNT=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
ENABLE_DYN_DATA=FALSE
FORCE_DYN_DATA=TRUE
ENABLE_DATA_FILTER=TRUE
ENABLE_CLI_RESTART=TRUE
MAX_TRY_PING=3
DISABLE_SEND_WDST=TRUE
FTP_SERVER=192.168.60.234
FTP_USER=ftpaccess
FTP_PWD=ftpaccess
FTP_CERT=
FTP_SKIP=TRUE
FTP_LOC_DIR=temp\csv
FTP_REM_DIR=
CSV_ADD_HEADER=true
VETO_SEND_SNAPSHOT=3
;NO_PING=TRUE
;EXEMODE_CHECK_BYPASS=true
; conf aree allarme
ALARM_CONF=BAGLIETTO_CIMOLAI_01_alarm.json
; conf parametri memoria READ/WRITE
OPC_PARAM_CONF=BAGLIETTO_CIMOLAI_01.json
[BRANCH]
NAME=master
@@ -1,210 +0,0 @@
{
"BrowseFullVal": "ns=2;i=1001",
"BrowseNSIndex": 2,
"BrowseValue": 1001,
"keyPartCount": "",
"keyPartReq": "",
"keyPartId": "",
"keyProgName": "Commessa",
"keyExeMode": "PLC/DB231/InCorso",
"keyRunMode": "PLC/DB231/Attivita",
"runModeSend": true,
"pingAsPowerOn": true,
"forcePingOk": false,
"translRunMode": true,
"condWork": [
{
"keyName": "PLC/DB13/Gen/Marcia_AUX",
"targetValue": "2"
},
{
"keyName": "PLC/DB231/InCorso",
"targetValue": "1"
}
],
"condWorkOpc": {
"checkMode": "AND",
"checkList": [
{
"keyName": "PLC/DB13/Gen/Marcia_AUX",
"targetValue": "2"
},
{
"keyName": "PLC/DB231/InCorso",
"targetValue": "1"
}
]
},
"condPowerOn": {
"checkMode": "AND",
"checkList": []
},
"condReady": {
"checkMode": "AND",
"checkList": [
{
"keyName": "PLC/DB231/InCorso",
"targetValue": "0"
}
]
},
"condManual": {
"checkMode": "AND",
"checkList": [
{
"keyName": "PLC/DB13/Gen/Marcia_AUX",
"targetValue": "2"
},
{
"keyName": "PLC/DB231/InCorso",
"targetValue": "0"
}
]
},
"condEStop": {
"checkMode": "AND",
"checkList": [
{
"keyName": "PLC/DB13/Gen/Marcia_AUX",
"targetValue": "2"
}
]
},
"condError": {
"checkMode": "OR",
"checkList": [
{
"keyName": "PLC/DB13/Gen/ComProfibusMessage",
"targetValue": "1"
},
{
"keyName": "PLC/DB13/Gen/ComProfibusMessage",
"targetValue": "3"
},
{
"keyName": "PLC/DB13/Gen/Hydraulic_Unit",
"targetValue": "3"
},
{
"keyName": "PLC/DB13/Gen/ReserveDieselMessage",
"targetValue": "3"
},
{
"keyName": "PLC/DB13/Gen/Wheel_Fault",
"targetValue": "3"
}
]
},
"condCountEnabled": {
"checkMode": "AND",
"checkList": []
},
"condWarmUpCoolDown": {
"checkMode": "OR",
"checkList": [],
"negateValue": true
},
"condWarning": {
"checkMode": "AND",
"checkList": []
},
"condSetup": {
"checkMode": "AND",
"checkList": []
},
"fluxLogVeto": [
""
],
"itemTranslation": {
"fdovrd": "PATH FEED OVERRIDE",
"rovrd": "PATH RAPID OVERRIDE",
"RunMode_0": "Wait action",
"RunMode_1": "Avvio Registrazione Ricetta",
"RunMode_2": "Inizio Comando Traslazione",
"RunMode_3": "Termine Comando Traslazione",
"RunMode_4": "Inizio Comando Sterzatura",
"RunMode_5": "Termine Comando Sterzatura",
"RunMode_6": "Inizio Comando Movimento Carrelli",
"RunMode_7": "Termine Comando Movimento Carrelli",
"RunMode_8": "Inizio Comando Sollevamento",
"RunMode_9": "Termine Comando Sollevamento",
"RunMode_10": "Invio Comando Snapshot Parametri",
"Marcia_AUX_0": "Macchina non pronta",
"Marcia_AUX_1": "Macchina non pronta",
"Marcia_AUX_2": "Macchina pronta",
"Wheel_Fault_2": "Ruote OK",
"Wheel_Fault_3": "Ruote NON OK",
"Wheel_Fault_4": "Ruote in bypass",
"Wheel_Fault_5": "Ruote in manutenzione",
"MotorMessage_1": "Motore 1 acceso",
"MotorMessage_2": "Motore 2 acceso",
"MotorMessage_3": "Entrambi i motori accesi",
"ReserveDieselMessage_1": "Riserva diesel motore 1",
"ReserveDieselMessage_2": "Riserva diesel motore 2",
"ReserveDieselMessage_3": "Spegnimento per minimo diesel",
"Hydraulic_Unit_2": "Centralina idraulica OK",
"Hydraulic_Unit_3": "Allarme grave idraulica",
"Hydraulic_Unit_4": "Warning su centralina idraulica",
"ComProfibusMessage_1": "Allarme rete Profinet",
"ComProfibusMessage_3": "Allarme rete CAN"
},
"paramsEndThresh": {
"InvDDone": 50
},
"mMapWrite": {
"setPzComm": {
"name": "setPzComm",
"description": "Qty",
"tipoMem": "Int",
"memAddr": "ns=4;i=11",
"index": 0,
"size": 4
},
"setProg": {
"name": "setProg",
"description": "Programma",
"tipoMem": "String",
"memAddr": "ns=4;i=9",
"index": 0,
"size": 30
},
"syncDbData": {
"name": "syncDbData",
"description": "Sincronizzazione dati DB",
"tipoMem": "String",
"memAddr": "ns=4;i=0",
"index": 0,
"size": 30
}
},
"subscribedItems": [],
"WatchDog": {
"IsEnabled": false,
"MemConfRead": "ns=4;s=tomes_1_Watchdog",
"MemConfWrite": "ns=4;s=tomach_1_watchdog",
"MaxVal": 9999
},
"fluxLogKeyValVeto": {
"RunModeVal": [
"-1",
"0"
],
"OPC_PLC/DB231/Attivita": [
"-1",
"0"
]
},
"minSecStatusDuration": 20,
"minSecFinalWait": 60,
"calcValues": {
"PesoTot": {
"calcMode": "sum",
"listVal": [
"PLC/DB231/peso1",
"PLC/DB231/peso2",
"PLC/DB231/peso3",
"PLC/DB231/peso4"
]
}
}
}
@@ -1,664 +0,0 @@
[
{
"description": "Profinet Byte_00",
"tipoMem": "Byte",
"memAddr": "All_Byte_B0",
"index": 0,
"size": 1,
"messages": [
"Allarme comunicazione profinet - I/O GT2",
"Allarme comunicazione profinet - Sistema di pesatura",
"Allarme comunicazione - Ricevente radiocomando",
"Allarme comunicazione CanOpen - Motore GT1",
"Allarme comunicazione CanOpen - Motore GT2",
"##",
"##",
"##"
]
},
{
"description": "Profinet Byte_01",
"tipoMem": "Byte",
"memAddr": "All_Byte_B1",
"index": 1,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Modulo IOlink 1(TU) {A190.1}",
"Allarme comunicazione profinet - Modulo IOlink 2(TU) {A190.2}",
"Allarme comunicazione profinet - Modulo IOlink 3(TU) {A190.3}",
"Allarme comunicazione profinet - Modulo IOlink 1(LB) {A206.1}",
"Allarme comunicazione profinet - Modulo IOlink 2(LB) {A206.2}",
"Allarme comunicazione profinet - Modulo IOlink 3(LB) {A206.3}",
"Allarme comunicazione profinet - Modulo IOlink 6(LB) {A206.6}",
"Allarme comunicazione profinet - Modulo IOlink 1(UB) {A231.1}"
]
},
{
"description": "Profinet Byte_02",
"tipoMem": "Byte",
"memAddr": "All_Byte_B2",
"index": 2,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Modulo IOlink 1.1(TU) {A690.1}",
"Allarme comunicazione profinet - Modulo IOlink 2.1(TU) {A690.2}",
"Allarme comunicazione profinet - Modulo IOlink 3.1(TU) {A690.3}",
"Allarme comunicazione profinet - Modulo IOlink 1.1(LB) {A706.1}",
"Allarme comunicazione profinet - Modulo IOlink 2.1(LB) {A706.2}",
"Allarme comunicazione profinet - Modulo IOlink 3.1(LB) {A706.3}",
"Allarme comunicazione profinet - Modulo IOlink 6.1(LB) {A706.6}",
"Allarme comunicazione profinet - Modulo IOlink 1.1(UB) {A731.1}"
]
},
{
"description": "Profinet Byte_03",
"tipoMem": "Byte",
"memAddr": "All_Byte_B3",
"index": 3,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Encoder ruota 1 sinistra",
"Allarme comunicazione profinet - Encoder ruota 2 sinistra",
"Allarme comunicazione profinet - Encoder ruota 3 sinistra",
"Allarme comunicazione profinet - Encoder ruota 4 sinistra",
"Allarme comunicazione profinet - Encoder ruota 5 sinistra",
"Allarme comunicazione profinet - Encoder ruota 6 sinistra",
"Allarme comunicazione profinet - Encoder ruota 7 sinistra",
"Allarme comunicazione profinet - Encoder ruota 8 sinistra"
]
},
{
"description": "Profinet Byte_04",
"tipoMem": "Byte",
"memAddr": "All_Byte_B4",
"index": 4,
"size": 1,
"messages": [
"Allarme comunicazione profinet - Encoder ruota 1 destra",
"Allarme comunicazione profinet - Encoder ruota 2 destra",
"Allarme comunicazione profinet - Encoder ruota 3 destra",
"Allarme comunicazione profinet - Encoder ruota 4 destra",
"Allarme comunicazione profinet - Encoder ruota 5 destra",
"Allarme comunicazione profinet - Encoder ruota 6 destra",
"Allarme comunicazione profinet - Encoder ruota 7 destra",
"Allarme comunicazione profinet - Encoder ruota 8 destra"
]
},
{
"description": "Profinet Byte_05",
"tipoMem": "Byte",
"memAddr": "All_Byte_B5",
"index": 5,
"size": 1,
"messages": [
"Allarme comunicazione profinet - encoder carrello 1",
"Allarme comunicazione profinet - encoder carrello 2",
"Allarme comunicazione profinet - encoder carrello 3",
"Allarme comunicazione profinet - encoder carrello 4",
"Allarme comunicazione profinet - encoder carrello 5",
"Allarme comunicazione profinet - encoder carrello 6",
"Allarme comunicazione profinet - encoder carrello 7",
"Allarme comunicazione profinet - encoder carrello 8"
]
},
{
"description": "Profinet Byte_06",
"tipoMem": "Byte",
"memAddr": "All_Byte_B6",
"index": 6,
"size": 1,
"messages": [
"Allarme comunicazione profinet - encoder argano 1",
"Allarme comunicazione profinet - encoder argano 2",
"Allarme comunicazione profinet - encoder argano 3",
"Allarme comunicazione profinet - encoder argano 4",
"Allarme comunicazione profinet - encoder argano 5",
"Allarme comunicazione profinet - encoder argano 6",
"Allarme comunicazione profinet - encoder argano 7",
"Allarme comunicazione profinet - encoder argano 8"
]
},
{
"description": "Message Byte_07",
"tipoMem": "Byte",
"memAddr": "All_Byte_B7",
"index": 7,
"size": 1,
"messages": [
"Pulsante emergenza premuto su ruota 1 SX",
"Pulsante emergenza premuto su ruota 2 SX",
"Pulsante emergenza premuto su ruota 3 SX",
"Pulsante emergenza premuto su ruota 4 SX",
"Pulsante emergenza premuto su ruota 5 SX",
"Pulsante emergenza premuto su ruota 6 SX",
"Pulsante emergenza premuto su ruota 7 SX",
"Pulsante emergenza premuto su ruota 8 SX"
]
},
{
"description": "Message Byte_08",
"tipoMem": "Byte",
"memAddr": "All_Byte_B8",
"index": 8,
"size": 1,
"messages": [
"Pulsante emergenza premuto su ruota 1 DX",
"Pulsante emergenza premuto su ruota 2 DX",
"Pulsante emergenza premuto su ruota 3 DX",
"Pulsante emergenza premuto su ruota 4 DX",
"Pulsante emergenza premuto su ruota 5 DX",
"Pulsante emergenza premuto su ruota 6 DX",
"Pulsante emergenza premuto su ruota 7 DX",
"Pulsante emergenza premuto su ruota 8 DX"
]
},
{
"description": "Message Byte_09",
"tipoMem": "Byte",
"memAddr": "All_Byte_B9",
"index": 9,
"size": 1,
"messages": [
"Pulsante emergenza premuto su QE GT1",
"Pulsante emergenza premuto su QE GT2",
"Radiocomando spento o fungo di emergenza premuto",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Message Byte_10",
"tipoMem": "Byte",
"memAddr": "All_Byte_B10",
"index": 10,
"size": 1,
"messages": [
"Filtro Intasato 1 - GT1",
"Filtro Intasato 2 - GT1",
"Filtro Intasato 3 - GT1",
"Filtro Intasato 4 - GT1",
"Filtro Intasato 5 - GT1",
"Filtro Intasato 6 - GT1",
"Massima temperatura olio - GT1",
"Livello minimo olio - GT1"
]
},
{
"description": "Hydraulic Byte_11",
"tipoMem": "Byte",
"memAddr": "All_Byte_B11",
"index": 11,
"size": 1,
"messages": [
"Massima pressione sterzo - GT1",
"Allarme sensori di pressione su ralle",
"GT1 - Sensore livello olio - Massimo livello, Stop movimenti",
"##",
"Allarme Riserva diesel motore GT1",
"Anomalia motore diesel GT1",
"Timeout disattivazione frizione - inserimento pompe su GT1",
"##"
]
},
{
"description": "Hydraulic Byte_12",
"tipoMem": "Byte",
"memAddr": "All_Byte_B12",
"index": 12,
"size": 1,
"messages": [
"GT1 - Sensore livello olio - Nessun segnale",
"GT1 - Sensore pressione freno - Nessun segnale",
"GT1 - Sensore pressione traslazione - Nessun segnale",
"GT1 - Sensore pressione PVG1 - Nessun segnale",
"GT1 - Sensore pressione PVG2 - Nessun segnale",
"GT1 - Sensore pressione PVG3 - Nessun segnale",
"GT1 - Sensore pressione PVG4 - Nessun segnale",
"GT1 - Sensore pressione PVG5 - Nessun segnale"
]
},
{
"description": "Hydraulic Byte_13",
"tipoMem": "Byte",
"memAddr": "All_Byte_B13",
"index": 13,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"GT1 - Sensore pressione pompa 2 - Nessun segnale",
"GT1 - Sensore pressione pompa 3 - Nessun segnale",
"GT1 - Sensore pressione pompa 4 - Nessun segnale"
]
},
{
"description": "Hydraulic Byte_14",
"tipoMem": "Byte",
"memAddr": "All_Byte_B14",
"index": 14,
"size": 1,
"messages": [
"GT1 - Sensore pressione pompa 5 - Nessun segnale",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Message Byte_15",
"tipoMem": "Byte",
"memAddr": "All_Byte_B15",
"index": 15,
"size": 1,
"messages": [
"Filtro Intasato 1 - GT2",
"Filtro Intasato 2 - GT2",
"Filtro Intasato 3 - GT2",
"Filtro Intasato 4 - GT2",
"Filtro Intasato 5 - GT2",
"Filtro Intasato 6 - GT2",
"##",
"Livello minimo olio - GT2"
]
},
{
"description": "Hydraulic Byte_16",
"tipoMem": "Byte",
"memAddr": "All_Byte_B16",
"index": 16,
"size": 1,
"messages": [
"Massima pressione sterzo - GT2",
"##",
"GT2 - Sensore livello olio - Massimo livello, Stop movimenti",
"##",
"Riserva diesel motore GT2",
"Anomalia motore diesel GT2",
"Timeout disattivazione frizione - inserimento pompe su GT2",
"##"
]
},
{
"description": "Hydraulic Byte_17",
"tipoMem": "Byte",
"memAddr": "All_Byte_B17",
"index": 17,
"size": 1,
"messages": [
"GT2 - Sensore livello olio - Nessun segnale",
"GT2 - Sensore pressione freno - Nessun segnale",
"GT2 - Sensore pressione traslazione - Nessun segnale",
"GT2 - Sensore pressione PVG1 - Nessun segnale",
"GT2 - Sensore pressione PVG2 - Nessun segnale",
"GT2 - Sensore pressione PVG3 - Nessun segnale",
"GT2 - Sensore pressione PVG4 - Nessun segnale",
"GT2 - Sensore pressione PVG5 - Nessun segnale"
]
},
{
"description": "Hydraulic Byte_18",
"tipoMem": "Byte",
"memAddr": "All_Byte_B18",
"index": 18,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"GT2 - Sensore pressione pompa 2 - Nessun segnale",
"GT2 - Sensore pressione pompa 3 - Nessun segnale",
"GT2 - Sensore pressione pompa 4 - Nessun segnale"
]
},
{
"description": "Hydraulic Byte_19",
"tipoMem": "Byte",
"memAddr": "All_Byte_B19",
"index": 19,
"size": 1,
"messages": [
"GT2 - Sensore pressione pompa 5 - Nessun segnale",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Positioning Byte_20",
"tipoMem": "Byte",
"memAddr": "All_Byte_B20",
"index": 20,
"size": 1,
"messages": [
"Ruota fuori finestra 1 SX",
"Ruota fuori finestra 2 SX",
"Ruota fuori finestra 3 SX",
"Ruota fuori finestra 4 SX",
"Ruota fuori finestra 5 SX",
"Ruota fuori finestra 6 SX",
"Ruota fuori finestra 7 SX",
"Ruota fuori finestra 8 SX"
]
},
{
"description": "Positioning Byte_21",
"tipoMem": "Byte",
"memAddr": "All_Byte_B21",
"index": 21,
"size": 1,
"messages": [
"Ruota fuori finestra 1 DX",
"Ruota fuori finestra 2 DX",
"Ruota fuori finestra 3 DX",
"Ruota fuori finestra 4 DX",
"Ruota fuori finestra 5 DX",
"Ruota fuori finestra 6 DX",
"Ruota fuori finestra 7 DX",
"Ruota fuori finestra 8 DX"
]
},
{
"description": "Positioning Byte_22",
"tipoMem": "Byte",
"memAddr": "All_Byte_B22",
"index": 22,
"size": 1,
"messages": [
"##",
"Allarme fuori finestra 5°",
"Allarme fuori finestra 10°",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Wind Byte_23",
"tipoMem": "Byte",
"memAddr": "All_Byte_B23",
"index": 23,
"size": 1,
"messages": [
"Allarme trasduttore velocità vento",
"Allarme anemometro soglia 1",
"Allarme anemometro soglia 2",
"Bypass inserito - Anemometro",
"##",
"##",
"##",
"##"
]
},
{
"description": "Positioning Byte_24",
"tipoMem": "Byte",
"memAddr": "All_Byte_B24",
"index": 24,
"size": 1,
"messages": [
"Posizione argano 1 fuori finestra",
"Posizione argano 2 fuori finestra",
"Posizione argano 3 fuori finestra",
"Posizione argano 4 fuori finestra",
"Posizione argano 5 fuori finestra",
"Posizione argano 6 fuori finestra",
"Posizione argano 7 fuori finestra",
"Posizione argano 8 fuori finestra"
]
},
{
"description": "Positioning Byte_25",
"tipoMem": "Byte",
"memAddr": "All_Byte_B25",
"index": 25,
"size": 1,
"messages": [
"Posizione Carrello 1 fuori finestra",
"Posizione Carrello 2 fuori finestra",
"Posizione Carrello 3 fuori finestra",
"Posizione Carrello 4 fuori finestra",
"Posizione Carrello 5 fuori finestra",
"Posizione Carrello 6 fuori finestra",
"Posizione Carrello 7 fuori finestra",
"Posizione Carrello 8 fuori finestra"
]
},
{
"description": "Bypass Byte_26",
"tipoMem": "Byte",
"memAddr": "All_Byte_B26",
"index": 26,
"size": 1,
"messages": [
"Bypass inserito - encoder posizione - Argano 1",
"Bypass inserito - encoder posizione - Argano 2",
"Bypass inserito - encoder posizione - Argano 3",
"Bypass inserito - encoder posizione - Argano 4",
"Bypass inserito - encoder posizione - Argano 5",
"Bypass inserito - encoder posizione - Argano 6",
"Bypass inserito - encoder posizione - Argano 7",
"Bypass inserito - encoder posizione - Argano 8"
]
},
{
"description": "Weighting Byte_27",
"tipoMem": "Byte",
"memAddr": "All_Byte_B27",
"index": 27,
"size": 1,
"messages": [
"Guasto celle canale 1",
"Guasto celle canale 2",
"Guasto celle canale 3",
"Guasto celle canale 4",
"Allarme sovraccarico argani 7-8",
"Allarme sovraccarico argani 5-6",
"Allarme sovraccarico argani 3-4",
"Allarme sovraccarico argani 1-2"
]
},
{
"description": "Weighting Byte_28",
"tipoMem": "Byte",
"memAddr": "All_Byte_B28",
"index": 28,
"size": 1,
"messages": [
"Allarme sovraccarico somma totale",
"Stop sollevamento da controllo baricentro",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "## Byte_29",
"tipoMem": "Byte",
"memAddr": "All_Byte_B29",
"index": 29,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Bypass Byte_30",
"tipoMem": "Byte",
"memAddr": "All_Byte_B30",
"index": 30,
"size": 1,
"messages": [
"Bypass inserito - sensore pressione - Ruota SX 1",
"Bypass inserito - sensore pressione - Ruota SX 2",
"Bypass inserito - sensore pressione - Ruota SX 3",
"Bypass inserito - sensore pressione - Ruota SX 4",
"Bypass inserito - sensore pressione - Ruota SX 5",
"Bypass inserito - sensore pressione - Ruota SX 6",
"Bypass inserito - sensore pressione - Ruota SX 7",
"Bypass inserito - sensore pressione - Ruota SX 8"
]
},
{
"description": "Bypass Byte_31",
"tipoMem": "Byte",
"memAddr": "All_Byte_B31",
"index": 31,
"size": 1,
"messages": [
"Bypass inserito - sensore pressione - Ruota DX 1",
"Bypass inserito - sensore pressione - Ruota DX 2",
"Bypass inserito - sensore pressione - Ruota DX 3",
"Bypass inserito - sensore pressione - Ruota DX 4",
"Bypass inserito - sensore pressione - Ruota DX 5",
"Bypass inserito - sensore pressione - Ruota DX 6",
"Bypass inserito - sensore pressione - Ruota DX 7",
"Bypass inserito - sensore pressione - Ruota DX 8"
]
},
{
"description": "Bypass Byte_32",
"tipoMem": "Byte",
"memAddr": "All_Byte_B32",
"index": 32,
"size": 1,
"messages": [
"Bypass inserito - sensore posizione - Carrello 1",
"Bypass inserito - sensore posizione - Carrello 2",
"Bypass inserito - sensore posizione - Carrello 3",
"Bypass inserito - sensore posizione - Carrello 4",
"Bypass inserito - sensore posizione - Carrello 5",
"Bypass inserito - sensore posizione - Carrello 6",
"Bypass inserito - sensore posizione - Carrello 7",
"Bypass inserito - sensore posizione - Carrello 8"
]
},
{
"description": "Bypass Byte_33",
"tipoMem": "Byte",
"memAddr": "All_Byte_B33",
"index": 33,
"size": 1,
"messages": [
"Bypass inserito - sensore posizione - Carrello 1",
"Bypass inserito - sensore posizione - Carrello 2",
"Bypass inserito - sensore posizione - Carrello 3",
"Bypass inserito - sensore posizione - Carrello 4",
"Bypass inserito - sensore posizione - Carrello 5",
"Bypass inserito - sensore posizione - Carrello 6",
"Bypass inserito - sensore posizione - Carrello 7",
"Bypass inserito - sensore posizione - Carrello 8"
]
},
{
"description": "Bypass Byte_34",
"tipoMem": "Byte",
"memAddr": "All_Byte_B34",
"index": 34,
"size": 1,
"messages": [
"Bypass inserito - finecorsa posizione - Argano 1",
"Bypass inserito - finecorsa posizione - Argano 2",
"Bypass inserito - finecorsa posizione - Argano 3",
"Bypass inserito - finecorsa posizione - Argano 4",
"Bypass inserito - finecorsa posizione - Argano 5",
"Bypass inserito - finecorsa posizione - Argano 6",
"Bypass inserito - finecorsa posizione - Argano 7",
"Bypass inserito - finecorsa posizione - Argano 8"
]
},
{
"description": "Bypass Byte_35",
"tipoMem": "Byte",
"memAddr": "All_Byte_B35",
"index": 35,
"size": 1,
"messages": [
"Bypass inserito - controllo posizione baricentro",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "## Byte_36",
"tipoMem": "Byte",
"memAddr": "All_Byte_B36",
"index": 36,
"size": 1,
"messages": [
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##"
]
},
{
"description": "Maintenance Byte_37",
"tipoMem": "Byte",
"memAddr": "All_Byte_B37",
"index": 37,
"size": 1,
"messages": [
"Richiesta manutenzione traslazione",
"Richiesta manutenzione sterzatura",
"Richiesta manutenzione motore GT1",
"Richiesta manutenzione motore GT2",
"Richiesta manutenzione argani",
"Richiesta manutenzione carrelli",
"##",
"##"
]
},
{
"description": "n/a Byte_B38",
"tipoMem": "Byte",
"memAddr": "n/a",
"index": 38,
"size": 1,
"messages": [
"n/a",
"n/a",
"n/a",
"n/a",
"n/a",
"n/a",
"n/a"
]
}
]
+3 -3
View File
@@ -4,15 +4,15 @@
CNCTYPE=FILE_EUROM63
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=PlasticMetal
MODEL=MPW280SP
[CNC]
IP=10.74.82.253
IP=10.74.82.253
;IP=192.168.1.151
[SERVER]
[SERVER]
MPIP=http://10.74.82.218
;MPIP=http://192.168.1.150
MPURL=/MP/IO
+13 -17
View File
@@ -1,36 +1,35 @@
;Configurazione IOB-WIN
[IOB]
[IOB]
;Impianto Helpi x impacchettatrice - Finassi
CNCTYPE=MODBUS_TCP_HELPI
PING_MS_TIMEOUT=1000
MinDeltaSec=5
[MACHINE]
[MACHINE]
VENDOR=HELPI
MODEL=HELPI
[CNC]
IP=10.150.0.20
IP=10.74.82.65
PORT=502
[SERVER]
MPIP=http://10.150.0.1
MPIP=https://iis01.egalware.com
;MPIP=https://gwms.egalware.com
MPURL=/MP/IO
CMDBASE=/IOB/input/
CMDFLOG=/IOB/flog/
CMDALIVE=/IOB
CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
CMDREBO=/IOB/sendReboot?idxMacchina=
;CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
ADDR_READ=41050
ADDR_READ=41060
ADDR_WRITE=41060
SIZE_READ=60
SIZE_WRITE=50
HR_BASE_ADDR=0
;HR_BASE_ADDR=40000
DELTA_BASE=0
SIZE_READ=0
SIZE_WRITE=0
HR_BASE_ADDR=40000
[BLINK]
@@ -48,8 +47,8 @@ BLINK_FILT=0
;BLINK_FILT=28
[OPTPAR]
;PZCOUNT_MODE=STD.Nome valore DynData
PZCOUNT_MODE=STD.NumPacchi
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=STD.41100.UDINT32
DISABLE_PZCOUNT=TRUE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
@@ -72,8 +71,5 @@ MEM_BLOCK=FINASSI_HELPI_01_MBlock.json
; conf aree allarme
ALARM_CONF=FINASSI_HELPI_01_alarm.json
; rimozione check limiti min/max dynData
disDynDataRangeCheck=true
[BRANCH]
NAME=master
+18 -18
View File
@@ -44,7 +44,7 @@
"name": "NumPacchi",
"description": "Numero Pacchi Richiesti",
"memAddr": "41098",
"tipoMem": "IntLH",
"tipoMem": "INT",
"index": 1098,
"size": 2,
"unit": "#"
@@ -61,7 +61,7 @@
"minVal": 0,
"maxVal": 32767,
"unit": "#",
"func": "POINT",
"func": "MEDIAN",
"period": 90,
"factor": 1
},
@@ -75,7 +75,7 @@
"minVal": 0,
"maxVal": 1,
"unit": "#",
"func": "POINT",
"func": "MEDIAN",
"period": 90,
"factor": 1
},
@@ -87,7 +87,7 @@
"index": 1062,
"size": 16,
"unit": "#",
"func": "POINT",
"func": "LAST",
"period": 90
},
"LOTTO": {
@@ -98,18 +98,18 @@
"index": 1078,
"size": 16,
"unit": "#",
"func": "POINT",
"func": "LAST",
"period": 90
},
"NumPacchi": {
"name": "NumPacchi",
"description": "Numero Pacchi Richiesti",
"memAddr": "41098",
"tipoMem": "IntLH",
"tipoMem": "INT",
"index": 1098,
"size": 2,
"unit": "#",
"func": "POINT",
"func": "MEDIAN",
"period": 90,
"factor": 1
},
@@ -117,11 +117,11 @@
"name": "NumPacchiFatti",
"description": "Numero Pacchi Fatti",
"memAddr": "41100",
"tipoMem": "IntLH",
"tipoMem": "INT",
"index": 1100,
"size": 2,
"unit": "#",
"func": "POINT",
"func": "MEDIAN",
"period": 90,
"factor": 1
},
@@ -129,11 +129,11 @@
"name": "EpochStart",
"description": "DateTime inizio lavorazione formato EPOCH",
"memAddr": "41102",
"tipoMem": "IntLH",
"tipoMem": "INT",
"index": 1102,
"size": 2,
"unit": "EPOCH",
"func": "POINT",
"unit": "#",
"func": "LAST",
"period": 90,
"factor": 1
},
@@ -141,23 +141,23 @@
"name": "EpochStop",
"description": "DateTime fine lavorazione formato EPOCH",
"memAddr": "41104",
"tipoMem": "IntLH",
"tipoMem": "INT",
"index": 1104,
"size": 2,
"unit": "EPOCH",
"func": "POINT",
"unit": "#",
"func": "LAST",
"period": 90,
"factor": 1
},
"PPM": {
"name": "PPM",
"description": "Velocita espressa come Pacchi Per Minuto",
"description": "Velocit espressa come Pacchi Per Minuto",
"memAddr": "41106",
"tipoMem": "RealLH",
"tipoMem": "Real",
"index": 1106,
"size": 2,
"unit": "#",
"func": "POINT",
"func": "LAST",
"period": 90,
"factor": 1
}
@@ -4,7 +4,7 @@
"tipoMem": "DInt",
"memAddr": "41094",
"index": 1094,
"size": 4,
"size": 2,
"messages": [
"AUSILIARI NON INSERITI",
"TERMICA SBOBINATORI",
@@ -18,8 +18,8 @@
"##",
"EMERGENZA FINECORSA GUIDA INGRESSO",
"ANOMALIA BARRA SALDATURA",
"##TIMEOUT PROXIMITY SBOBINATORE INFERIORE",
"##TIMEOUT PROXIMITY SBOBINATORE SUPERIORE",
"TIMEOUT PROXIMITY SBOBINATORE INFERIORE",
"TIMEOUT PROXIMITY SBOBINATORE SUPERIORE",
"ROTTURA FILM",
"ANOMALIA SONDA PT100 TUNNEL",
"ANOMALIA SONDA PT100 SALDATURA",
@@ -37,7 +37,8 @@
"BYPASS SPORTELLI INSERITO",
"BARRA SALDANTE NON IN POSIZIONE, EFFETTUARE SALDATURA MANUALE",
"GESTIONALE: MACCHINA IN CICLO",
"GESTIONALE: RICETTA NON TROVATA"
"GESTIONALE: RICETTA NON TROVATA",
"PROBLEMA FC BYPASS EMERGENZA BARRA"
]
},
{
@@ -45,9 +46,8 @@
"tipoMem": "DInt",
"memAddr": "41096",
"index": 1096,
"size": 4,
"size": 2,
"messages": [
"PROBLEMA FC BYPASS EMERGENZA BARRA",
"PROBLEMA FC EMERGENZA BARRA",
"##",
"##",
@@ -78,6 +78,7 @@
"##",
"##",
"##",
"##",
"##"
]
}
-67
View File
@@ -1,67 +0,0 @@
;Configurazione IOB-WIN
[IOB]
;Centro di lavoro OMP (https://omp.it/) con controllo siemens S7-1200 + OpcUa
CNCTYPE=OpcUaSiemensOMP
PING_MS_TIMEOUT=500
[MACHINE]
VENDOR=OMP
MODEL=Infilatrice
[CNC]
IP=10.150.0.41
PORT=4840
GETPRGNAME=true
[SERVER]
MPIP=http://10.150.0.1
MPURL=/MP/IO
CMDBASE=/IOB/input/
CMDFLOG=/IOB/flog/
CMDALIVE=/IOB
CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
ADDR_READ=DB9999.DBB0
ADDR_WRITE=DB9999.DBB0
SIZE_READ=0
SIZE_WRITE=0
[BLINK]
;MAX_COUNTER_BLINK = 30
MAX_COUNTER_BLINK = 1
;bit0 = 0
;bit1 = 0
;bit2 = 1
;bit3 = 1
;bit4 = 1
;bit5 = 0
;bit6 = 0
;bit7 = 0
;BLINK_FILT=28
BLINK_FILT=131
[OPTPAR]
AUTO_CHANGE_ODL=false
CHANGE_ODL_MODE=TIME
CHANGE_ODL_HOURS=24
CHANGE_ODL_IDLE_MIN=5
PZCOUNT_MODE=OPC
DISABLE_PZCOUNT=FALSE
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=10000
ENABLE_DYN_DATA=FALSE
FORCE_DYN_DATA=TRUE
ENABLE_DATA_FILTER=TRUE
ENABLE_CLI_RESTART=TRUE
MAX_TRY_PING=3
; conf parametri memoria READ/WRITE
OPC_PARAM_CONF=FINASSI_OMP_01.json
[BRANCH]
NAME=master
-132
View File
@@ -1,132 +0,0 @@
{
"BrowseFullVal": "ns=3;s=ServerInterfaces",
"BrowseNSIndex": 4,
"BrowseValue": 1,
"keyPartCount": "Conteggio",
"keyPartReq": "Set Quantità Lotto",
"keyPartId": "Generale: Nome Ricetta",
"keyProgName": "Generale: Nome Ricetta",
"keyRunMode": "",
"pingAsPowerOn": true,
"condWork": [
{
"keyName": "Selettore in Automatico",
"targetValue": "True"
},
{
"keyName": "Memoria Ciclo Automatico",
"targetValue": "True"
}
],
"condPowerOn": {
"checkMode": "AND",
"checkList": []
},
"condReady": {
"checkMode": "AND",
"checkList": []
},
"condManual": {
"checkMode": "AND",
"checkList": [
{
"keyName": "Selettore in Manuale",
"targetValue": "True"
}
]
},
"condEStop": {
"checkMode": "AND",
"checkList": []
},
"condError": {
"checkMode": "AND",
"checkList": [
{
"keyName": "Memoria Allarme Attivo",
"targetValue": "True"
}
]
},
"condCountEnabled": {
"checkMode": "AND",
"checkList": []
},
"condWarmUpCoolDown": {
"checkMode": "OR",
"checkList": [],
"negateValue": true
},
"condWarning": {
"checkMode": "AND",
"checkList": []
},
"condSetup": {
"checkMode": "AND",
"checkList": [
{
"keyName": "Fine Lotto (1=Stop Ciclo)",
"targetValue": "1"
}
]
},
"fluxLogVeto": [
""
],
"itemTranslation": {
"fdovrd": "PATH FEED OVERRIDE",
"rovrd": "PATH RAPID OVERRIDE"
},
"paramsEndThresh": {
"InvDDone": 50
},
"mMapWrite": {
"setPzComm": {
"name": "setPzComm",
"description": "Qty",
"tipoMem": "Int",
"memAddr": "ns=4;i=11",
"index": 0,
"size": 4
},
"setProg": {
"name": "setProg",
"description": "Programma",
"tipoMem": "String",
"memAddr": "ns=4;i=9",
"index": 0,
"size": 30
}
},
"subscribedItems": [
"ns=4;i=1",
"ns=4;i=2",
"ns=4;i=3",
"ns=4;i=4",
"ns=4;i=5",
"ns=4;i=6",
"ns=4;i=7",
"ns=4;i=8",
"ns=4;i=9",
"ns=4;i=10",
"ns=4;i=11",
"ns=4;i=12",
"ns=4;i=13",
"ns=4;i=14"
],
"WatchDog": {
"IsEnabled": false,
"MemConfRead": "ns=4;s=tomes_1_Watchdog",
"MemConfWrite": "ns=4;s=tomach_1_watchdog",
"MaxVal": 9999
},
"actStopProd": {
"ns=4;i=14": "1"
},
"actSetRecipe": {
"ns=4;i=10": "1"
},
"actResetCounter": {
"ns=4;i=13": "1"
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ CNCTYPE=OpcUaCMS
;CNCTYPE=OpcUa
PING_MS_TIMEOUT=500
[MACHINE]
[MACHINE]
VENDOR=CMS
MODEL=Eidos

Some files were not shown because too many files have changed in this diff Show More