Merge remote-tracking branch 'origin/OSAI' into OSAI

This commit is contained in:
Samuele E. Locatelli
2017-04-05 09:05:08 +02:00
91 changed files with 181064 additions and 876 deletions
+727
View File
@@ -0,0 +1,727 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NLog;
using MTC;
namespace MTC_ADB
{
using MTConnect;
using System.Configuration;
using System.Data.Common;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Threading;
using System.Windows.Forms;
public class AdapterGeneric
{
/// <summary>
/// wrapper di log
/// </summary>
public static Logger lg;
/// <summary>
/// valore booleano di check se sia in fase di COMUNICAZIONE ATTIVA con il DB
/// </summary>
protected bool adpCommAct;
/// <summary>
/// valore booleano di check se sia stato AVVIATO l'adapter (Running)
/// </summary>
public bool adpRunning;
/// <summary>
/// valore booleano di check se l'adapter STIA SALVANDO
/// </summary>
public bool adpSaving;
/// <summary>
/// valore booleano (richiesta di riavvio automatico)
/// </summary>
public bool adpTryRestart;
/// <summary>
/// ultimo ID letto
/// </summary>
protected uint lastId = 0;
/// <summary>
/// DataOra ultimo avvio adapter x watchdog
/// </summary>
protected DateTime adpStartRun;
/// <summary>
/// Data/ora ultimo avvio adapter
/// </summary>
public DateTime dtAvvioAdp = DateTime.Now;
/// <summary>
/// Data/ora ultimo spegnimento adapter
/// </summary>
public DateTime dtStopAdp = DateTime.Now;
/// <summary>
/// vettore gestione cronometraggi
/// </summary>
public DateTime inizio;
/// <summary>
/// adapter globale
/// </summary>
public Adapter mAdapter = new Adapter();
/// <summary>
/// Form chiamante
/// </summary>
protected MainForm parentForm;
/// <summary>
/// Numero tentativi di riconnesiosne prima di chiamare "fermaAdapter" nel parent...
/// </summary>
protected int numRetryConnDb = 10;
/// <summary>
/// Tipo server DB
/// </summary>
public string ServerType = "ND";
/// <summary>
/// Indirizzo server DB
/// </summary>
public string ServerAddress = "";
/// <summary>
/// Nome DB
/// </summary>
public string DbName = "";
/// <summary>
/// User connessione
/// </summary>
protected string DbUser = "";
/// <summary>
/// Pwd connessione
/// </summary>
protected string DbPwd = "";
/// <summary>
/// Oggetto connessione al DB
/// </summary>
protected DbConnection DbConn;
/// <summary>
/// testo della query da eseguire...
/// </summary>
public string Query { get; set; }
/// <summary>
/// Singola istanza valore tipo DbTimeseries
/// </summary>
public class DbTS
{
/// <summary>
/// Vettore della serie storica
/// </summary>
public Sample mSampleData;
/// <summary>
/// Classe gestione dati POWER
/// </summary>
/// <param name="ident">Nome (univoco) variabile da pubblicare</param>
public DbTS(string ident)
{
mSampleData = new Sample(ident);
}
}
#region DataItems Globali
/// <summary>
/// Disponibilità (del DB)
/// </summary>
public Event mAvail = new Event("AVAIL");
/// <summary>
/// Status (ADP Running = ON / stopped INACTIVE)
/// </summary>
public Event mStatus = new Event("STATUS");
/// <summary>
/// Orologio
/// </summary>
public Sample mClock = new Sample("CLOCK");
/// <summary>
/// Messaggi (generico)
/// </summary>
public MTConnect.Message mMessage = new MTConnect.Message("MESSAGE");
/// <summary>
/// vettore dati da lettura DB
/// </summary>
public DbTS[] vettDbData;
#endregion
public event EventHandler eh_refreshed;
/// <summary>
/// inizializzo l'oggetto
/// </summary>
/// <param name="caller"></param>
/// <param name="adpConf"></param>
public AdapterGeneric(MainForm caller)
{
lg = LogManager.GetCurrentClassLogger();
lg.Info("Avvio AdapterGeneric");
// salvo al form chiamante
parentForm = caller;
numRetryConnDb = utils.CRI("numRetryConnDb");
adpRunning = false;
adpSaving = false;
// item base
mAdapter.AddDataItem(mAvail);
mAdapter.AddDataItem(mStatus);
mAdapter.AddDataItem(mClock);
mAdapter.AddDataItem(mMessage);
mAvail.Value = "ND";
mStatus.Value = "ND";
mClock.Value = string.Format("{0:yyyy-MM-dd} {0:HH:mm:ss}", DateTime.Now);
mMessage.Code = "ND";
mMessage.Value = "INIT";
createDbConn();
// aggiunto 1 valore x la gestione timeseries...
vettDbData = new DbTS[1];
for (int i = 0; i < vettDbData.Length; i++)
{
vettDbData[i] = new DbTS(string.Format("DbVal_E_{0:00}", i + 1));
mAdapter.AddDataItem(vettDbData[i].mSampleData);
}
// concluso!
lg.Info("Istanziata classe ADB");
}
/// <summary>
/// Inizializzazione oggetti connessione al DB...
/// </summary>
private void createDbConn()
{
DbProviderFactory factory = DbProviderFactories.GetFactory("MySql.Data.MySqlClient");
DbConn = factory.CreateConnection();
}
/// <summary>
/// Lettura conf DB
/// </summary>
public void loadServerConf()
{
// disconnetto e riconnetto SE fosse già connesso...
if (!connectionOk)
{
ServerType = utils.CRS("ServerType");
ServerAddress = utils.CRS("ServerAddress");
DbName = utils.CRS("DbName");
DbUser = utils.CRS("DbUser");
DbPwd = utils.CRS("DbPwd");
DbConn.ConnectionString = string.Format("SERVER={0};database={1};uid={2};password={3}", ServerAddress, DbName, DbUser, DbPwd);
}
}
/// <summary>
/// Caricamento altri file necessari epr adapter all'avvio
/// </summary>
protected virtual void loadOtherFile()
{
}
#region metodi adapter
public void loadPersData()
{
// nuova lettura valori da file persistenza...
lastId = getStoredValUInt("LAST_ID");
}
/// <summary>
/// Avvia l'adapter sulla porta richiesta
/// </summary>
/// <param name="port"></param>
public virtual void startAdapter(int port)
{
lg.Info("Starting adapter...");
adpRunning = true;
dtAvvioAdp = DateTime.Now;
// inizializzo vettori di utility..
loadOtherFile();
// salvo porta!
mAdapter.Port = port;
// avvio!
mAdapter.Start();
// setto status a ON
mStatus.Value = "ON";
// resetto running flag...
adpCommAct = false;
//mAlarmGeneral.Normal();
adpTryRestart = true;
parentForm.displayTaskAndWait("Adapter Started!");
}
/// <summary>
/// ferma l'adapter...
/// </summary>
/// <param name="tryRestart">indica se si debba tentare di riavviare l'adapter (con caduta connessione viene fermato in automatico)</param>
public void stopAdapter(bool tryRestart)
{
parentForm.displayTaskAndWait("Stopping adapter...");
adpTryRestart = false;
mStatus.Value = "INACTIVE";
// faccio una chiamata extra ad ogni metodo di check...
gaterAndSend(gatherCycle.HF);
gaterAndSend(gatherCycle.MF);
gaterAndSend(gatherCycle.LF);
gaterAndSend(gatherCycle.VLF);
parentForm.displayTaskAndWait("Stopping adapter - last periodic data read...");
// chiudo la connessione all'adapter...
tryDisconnect();
// Stop everything...
try
{
mAdapter.Stop();
}
catch (Exception exc)
{
lg.Error(exc, "Eccezione in chiusura Adapter");
}
dtStopAdp = DateTime.Now;
adpTryRestart = tryRestart;
adpRunning = false;
// chiudo!
parentForm.resetProgBar();
parentForm.displayTaskAndWait("Adapter Stopped.");
}
/// <summary>
/// effettua recupero dati ed invio valori modificati...
/// </summary>
/// <param name="ciclo"></param>
public void gaterAndSend(gatherCycle ciclo)
{
// controllo connessione/connettività
if (connectionOk)
{
// controllo non sia già in esecuzione...
if (!adpCommAct)
{
// provo ad avviare
try
{
// avvio fase raccolta dati
mAdapter.Begin();
// imposto flag adapter running..
adpCommAct = true;
adpStartRun = DateTime.Now;
}
catch (Exception exc)
{
parentForm.displayTaskAndWait(string.Format("Adapter NOT STARTED!!!{0}{1}", Environment.NewLine, exc));
adpCommAct = false;
adpStartRun = DateTime.Now;
}
if (adpCommAct)
{
// try / catch generale altrimenti segno che è disconnesso...
try
{
// ciclo HF (nulla)
if (ciclo == gatherCycle.HF)
{
// gestisco dati stato adapter
getGlobalData();
}
else if (ciclo == gatherCycle.MF)
{
getMainData();
}
// ciclo lento
else if (ciclo == gatherCycle.LF)
{
// invio dati "lenti"
getSlowChangingData();
}
// ciclo lentissimo
else if (ciclo == gatherCycle.VLF)
{
// eventuale log!
if (utils.CRB("recTime")) logTimeResults();
}
// INVIO dati variati!
mAdapter.SendChanged();
}
catch (Exception exc)
{
// segnalo eccezione e indico disconnesso...
DbConn.Close();
numRetryConnDb--;
if (numRetryConnDb < 0)
{
numRetryConnDb = utils.CRI("numRetryConnDb");
lg.Error(exc, string.Format("Errore in gestione ciclo principale ADP, richiesto reset completo{0}{1}", Environment.NewLine, exc));
mMessage.Code = "ERR-ADP-RESET";
mMessage.Value = "Effettuato Reset Adapter";
parentForm.fermaAdapter(true);
}
else
{
lg.Error(exc, string.Format("Errore in gestione ciclo principale ADP, tentativo reset{0}{1}", Environment.NewLine, exc));
mMessage.Code = "ERR-DB-RESET";
mMessage.Value = "Reset Connessione DB";
}
}
// tolgo flag running
adpCommAct = false;
}
else
{
lg.Info("ADP not running...");
}
}
else
{
// log ADP running
lg.Error("Non eseguo chiamata: ADP ancora in running");
// se è bloccato da oltre maxSec lo sblocco...
if (DateTime.Now.Subtract(adpStartRun).TotalSeconds > utils.CRI("maxAdapterLockSec"))
{
// tolgo flag running
adpCommAct = false;
adpStartRun = DateTime.Now;
}
}
}
else
{
// log connessione KO
lg.Error("ADP - Connessione non disponibile, provo a riconnettere");
mMessage.Code = "ERR-DB-CONN";
mMessage.Value = "Connessione DB non disponibile, tentativo riconnessione";
// provo a riconnettere SE abilitato tryRestart...
if (adpTryRestart && !connectionOk)
{
lg.Info("ConnKO - tryConnect");
tryConnect();
}
}
if (eh_refreshed != null)
{
eh_refreshed(this, new EventArgs());
}
}
/// <summary>
/// salvo e controllo dati globali...
/// </summary>
public virtual void getGlobalData()
{
string currAvail = "";
if (connectionOk)
{
currAvail = "AVAILABLE";
}
else
{
currAvail = "DISCONNECTED";
}
if (mAvail.Value.ToString() != currAvail)
{
mAvail.Value = currAvail;
}
}
/// <summary>
/// riporta il log di tutti i dati di results temporali registrati
/// </summary>
public void logTimeResults()
{
if (TimingData.results.Count > 0)
{
lg.Info("{0}--------------- START TIMING DATA ---------------", Environment.NewLine);
int globNumCall = 0;
TimeSpan globAvgMsec = new TimeSpan(0);
foreach (TimeRec item in TimingData.results)
{
lg.Info("Chiamate {0}: effettuate {1}, tempo medio {2:N2} msec", item.codCall, item.numCall, item.avgMsec);
globNumCall += item.numCall;
globAvgMsec += item.totMsec;
}
// riporto conteggio medio al secondo...
lg.Info("Chiamate GLOBALI: {0}, periodo: {1:N2} minuti.cent, tempo medio {2:N2} msec, impegno MEDIO del canale {3:P3}", globNumCall, DateTime.Now.Subtract(dtAvvioAdp).TotalMinutes, globAvgMsec.TotalMilliseconds / globNumCall, globAvgMsec.TotalSeconds / DateTime.Now.Subtract(dtAvvioAdp).TotalSeconds);
lg.Info("{0}--------------- STOP TIMING DATA ---------------{0}", Environment.NewLine);
}
}
/// <summary>
/// Metodo base connessione...
/// </summary>
public virtual void tryConnect()
{
if (!connectionOk)
{
try
{
DbConn.Open();
mMessage.Code = "DB-CONN";
mMessage.Value = "DB Connesso";
}
catch (Exception exc)
{
mMessage.Code = "DB-DISC";
mMessage.Value = "DB Disconnesso";
lg.Error(exc, string.Format("Errore apertura connessione DB: {0}{1}", Environment.NewLine, exc));
mAdapter.SendChanged();
}
}
else
{
lg.Info("Exit tryConnect (ADP connected)");
}
}
/// <summary>
/// Metodo base disconnessione...
/// </summary>
public virtual void tryDisconnect()
{
try
{
// CHIUDO!
DbConn.Close();
mMessage.Code = "DB-DISC";
mMessage.Value = "ADP - Disconnessione DB";
}
catch (Exception exc)
{
lg.Error(exc, string.Format("Errore in tryDisconnect da DB: {0}{1}", Environment.NewLine, exc));
mMessage.Code = "ERR-DB-DISC";
mMessage.Value = "Errore durante disconnessione DB";
}
}
/// <summary>
/// Salva verifica stato connessione OK
/// </summary>
/// <returns></returns>
public virtual bool connectionOk
{
get
{
return DbConn.State == System.Data.ConnectionState.Open;
}
}
/// <summary>
/// Restituisce conteggio record disponibili e lo restituisce
/// </summary>
/// <returns></returns>
public string numRecAvail
{
get
{
string answ = "NA";
if (connectionOk)
{
// recupero conteggio degli eventi...
Query = string.Format("SELECT COUNT(id) AS num FROM tracelog WHERE resource = 'E' AND device=1 AND id > {0}", lastId);
DbCommand qrycmd = DbConn.CreateCommand();
qrycmd.CommandText = Query;
qrycmd.Connection = DbConn;
using (DbDataReader reader = qrycmd.ExecuteReader())
{
try
{
while (reader.Read())
{
answ = reader["num"].ToString();
}
// chiudo reader!
reader.Close();
}
catch (Exception exc)
{
lg.Error(exc, string.Format("Errore in recupero conteggio eventi: {0}{1}", Environment.NewLine, exc));
answ = "ERR";
mMessage.Code = "ERR-DB-COUNT";
mMessage.Value = "Errore conteggio dati da DB";
}
}
}
return answ;
}
}
/// <summary>
/// Recupero dati principali (DB)
/// </summary>
public virtual void getMainData()
{
// recupero da DB ultimo valore NON inviato e se c'è lo invio...
string valore = "-999";
bool valFound = false;
if (connectionOk)
{
// recupero conteggio degli eventi... se in debug rileggo da inizio altrimenti SOLO ultimo valore...
#if DEBUG
Query = string.Format("SELECT id, value FROM tracelog WHERE resource = 'E' AND device=1 AND id > {0} ORDER BY id LIMIT 1", lastId);
#else
Query = string.Format("SELECT id, value FROM tracelog WHERE resource = 'E' AND device=1 AND id > {0} ORDER BY id DESC LIMIT 1", lastId);
#endif
DbCommand qrycmd = DbConn.CreateCommand();
qrycmd.CommandText = Query;
qrycmd.Connection = DbConn;
using (DbDataReader reader = qrycmd.ExecuteReader())
{
try
{
while (reader.Read())
{
valore = reader["value"].ToString();
lastId = Convert.ToUInt32(reader["id"].ToString());
valFound = true;
}
// chiudo reader!
reader.Close();
}
catch (Exception exc)
{
lg.Error(exc, string.Format("Errore in recupero dati da DB: {0}{1}", Environment.NewLine, exc));
valore = "-99";
mMessage.Code = "ERR-DB-READ";
mMessage.Value = "Errore recupero dati da DB";
}
}
if (valFound)
{
// salvo in sample SE trovato...!
vettDbData[0].mSampleData.Value = valore;
// salvo lastID...
updateValUInt(0, lastId, "LAST_ID");
}
}
}
/// <summary>
/// dati "lenti" relativi al device
/// </summary>
public virtual void getSlowChangingData()
{
// dati da PC
mClock.Value = string.Format("{0:yyyy-MM-dd} {0:HH:mm:ss}", DateTime.Now);
}
#endregion
#region layer persistenza dati
/// <summary>
/// Dizionario di persistenza per i valori da salvare da/su file
/// </summary>
public Dictionary<string, string> persistenceLayer;
/// <summary>
/// recupera valore salvato in persistence layer (se non c'è crea...)
/// </summary>
/// <param name="keyVal"></param>
/// <returns></returns>
private string getStoredVal(string keyVal)
{
string value = "";
try
{
if (!persistenceLayer.TryGetValue(keyVal, out value))
{
persistenceLayer.Add(keyVal, "0");
}
}
catch
{ }
return value;
}
/// <summary>
/// recupera valore salvato in persistence layer (se non c'è crea...) come UINT
/// </summary>
/// <param name="keyVal"></param>
/// <returns></returns>
private uint getStoredValUInt(string keyVal)
{
uint answ = 0;
try
{
answ = Convert.ToUInt32(getStoredVal(keyVal));
}
catch
{ }
return answ;
}
/// <summary>
/// recupera valore salvato in persistence layer (se non c'è crea...) come INT
/// </summary>
/// <param name="keyVal"></param>
/// <returns></returns>
private long getStoredValLong(string keyVal)
{
long answ = 0;
try
{
answ = Convert.ToInt64(getStoredVal(keyVal));
}
catch
{ }
return answ;
}
/// <summary>
/// recupera valore salvato in persistence layer (se non c'è crea...) come double
/// </summary>
/// <param name="keyVal"></param>
/// <returns></returns>
private double getStoredValDouble(string keyVal)
{
double answ = 0;
try
{
answ = Convert.ToDouble(getStoredVal(keyVal));
}
catch
{ }
return answ;
}
/// <summary>
/// Aggiorna un valore del dizionario in SOSTITUZIONE
/// </summary>
/// <param name="i"></param>
/// <param name="newVal"></param>
/// <param name="searchString"></param>
/// <returns>Nuovo valore incrementato</returns>
private void updateValString(int i, string newVal, string searchString)
{
// stringa da cercare..
string keyVal = string.Format(searchString, i + 1);
// salvo in ram!
persistenceLayer[keyVal] = newVal;
}
/// <summary>
/// Aggiorna un valore del dizionario in SOSTITUZIONE e lo restituisce
/// </summary>
/// <param name="i"></param>
/// <param name="newVal"></param>
/// <param name="searchString"></param>
/// <returns>Nuovo valore incrementato</returns>
private void updateValUInt(int i, uint newVal, string searchString)
{
// stringa da cercare..
string keyVal = string.Format(searchString, i + 1);
// salvo in ram!
persistenceLayer[keyVal] = newVal.ToString();
}
#endregion
}
}
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations
see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="autoStartOnLoad" value="false" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
</appSettings>
</configuration>
+18
View File
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations
see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="autoStartOnLoad" value="true" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="openDumpOnStart" value="false" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="timerIntMs" value="10" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="startMinimized" value="true" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="windowCanMax" value="false" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="trayClose" value="false" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="recTime" value="false" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="ServerAddress" value="localhost" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="DbName" value="savenergy" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="DbUser" value="root" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add key="DbPwd" value="scmgroup" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
</appSettings>
</configuration>
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations
see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
</configuration>
+61
View File
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
<appSettings>
<add key="appName" value="MTConnect Adapter DB"/>
<!--obbligatorio x dump compilato su 7879...-->
<add key="portMTC" value="7879"/>
<add key="recTime" value="true"/>
<add key="verbose" value="true"/>
<!--gestione TIMERS-->
<add key="startTimerMs" value="250"/>
<!--invio da adapter ad agent: 10ms-->
<add key="timerIntMs" value="10"/>
<!--0.2 sec-->
<add key="fastCount" value="20"/>
<!--0.5 sec-->
<add key="normCount" value="50"/>
<!--60 sec-->
<add key="slowCount" value="600"/>
<!--2 min-->
<add key="verySlowCount" value="1200"/>
<!--parametri gestione watchdog-->
<add key="maxAdapterLockSec" 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="defaultPersLayerFile" value="PersistData.dat"/>
<add key="maxNumDD" value="30"/>
<!--Definizione avvio Adapter-->
<add key="autoStartOnLoad" value="true"/>
<add key="openDumpOnStart" 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="5000"/>
<add key="testCharSep" value="|"/>
<!--CONF DB-->
<add key="ServerType" value="MySQL"/>
<add key="ServerAddress" value="10.74.82.62"/>
<add key="DbName" value="savenergy"/>
<add key="DbUser" value="root"/>
<add key="DbPwd" value="scmgroup"/>
<add key="numRetryConnDb" value="10"/>
</appSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;libs"/>
</assemblyBinding>
</runtime>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient"/>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories>
</system.data></configuration>
@@ -0,0 +1 @@

@@ -0,0 +1 @@
LAST_ID:0
Binary file not shown.
+172
View File
@@ -0,0 +1,172 @@
<?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>{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>MTC_ADB</RootNamespace>
<AssemblyName>MTC-ADB</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'MySql|AnyCPU'">
<OutputPath>bin\MySql\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="DotNetAdapterSDK, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>ExtLib\DotNetAdapterSDK.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.5\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<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.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\VersGen\VersGen.cs">
<Link>VersGen.cs</Link>
</Compile>
<Compile Include="AdapterGeneric.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="utils.cs" />
<None Include="App.Debug.config">
<DependentUpon>App.config</DependentUpon>
<IsTransformFile>True</IsTransformFile>
</None>
<None Include="App.MySql.config">
<DependentUpon>App.config</DependentUpon>
<IsTransformFile>True</IsTransformFile>
</None>
<None Include="App.Release.config">
<DependentUpon>App.config</DependentUpon>
<IsTransformFile>True</IsTransformFile>
</None>
<None Include="dump\dump.c" />
<Content Include="dump\dump.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Resources\MTCA.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="DATA\DAT\PersistData.dat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Content Include="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="dump\build.bat" />
<None Include="dump\dump.obj" />
<None Include="NLog.xsd">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<TransformOnBuild>true</TransformOnBuild>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="ExtLib\DotNetAdapterSDK.dll" />
<Content Include="DATA\CONF\.placeholder.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="logs\.placeholder.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MTC\MTC.csproj">
<Project>{ec83d80e-9f3b-4de9-b16a-ca216543b7ec}</Project>
<Name>MTC</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<ItemGroup>
<MoveToLibFolder Include="$(OutputPath)*.dll ; $(OutputPath)*.pdb ; $(OutputPath)*.xml" />
</ItemGroup>
<Move SourceFiles="@(MoveToLibFolder)" DestinationFolder="$(OutputPath)lib" OverwriteReadOnlyFiles="true" />
</Target>
<Import Project="..\packages\SlowCheetah.2.5.48\build\SlowCheetah.targets" Condition="Exists('..\packages\SlowCheetah.2.5.48\build\SlowCheetah.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<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\SlowCheetah.2.5.48\build\SlowCheetah.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SlowCheetah.2.5.48\build\SlowCheetah.targets'))" />
</Target>
</Project>
+383
View File
@@ -0,0 +1,383 @@
namespace MTC_ADB
{
partial class MainForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.label1 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label5 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.lblNumData = new System.Windows.Forms.Label();
this.btnOpenDump = new System.Windows.Forms.Button();
this.lblLastData = new System.Windows.Forms.Label();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.lblApp = new System.Windows.Forms.ToolStripStatusLabel();
this.lblVers = new System.Windows.Forms.ToolStripStatusLabel();
this.MainProgrBar = new System.Windows.Forms.ToolStripProgressBar();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.lblServer = new System.Windows.Forms.Label();
this.btnStart = new System.Windows.Forms.Button();
this.btnConnect = new System.Windows.Forms.Button();
this.lblStatus = new System.Windows.Forms.Label();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.trayMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.gather = new System.Windows.Forms.Timer(this.components);
this.groupBox1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoEllipsis = true;
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(478, 24);
this.label1.TabIndex = 0;
this.label1.Text = "MTConnect Adapter SavEnergy";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.AutoSize = true;
this.groupBox1.Controls.Add(this.tableLayoutPanel1);
this.groupBox1.Location = new System.Drawing.Point(4, 119);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(468, 93);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Data Available";
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 3;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 47.45763F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 52.54237F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 82F));
this.tableLayoutPanel1.Controls.Add(this.label5, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.label2, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.lblNumData, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.btnOpenDump, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.lblLastData, 1, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 16);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(462, 74);
this.tableLayoutPanel1.TabIndex = 2;
//
// label5
//
this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
this.label5.Location = new System.Drawing.Point(183, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(193, 37);
this.label5.TabIndex = 1;
this.label5.Text = "Last Read";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Location = new System.Drawing.Point(3, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(174, 37);
this.label2.TabIndex = 0;
this.label2.Text = "Data Available";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblNumData
//
this.lblNumData.AutoSize = true;
this.lblNumData.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblNumData.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblNumData.Location = new System.Drawing.Point(3, 37);
this.lblNumData.Name = "lblNumData";
this.lblNumData.Size = new System.Drawing.Size(174, 37);
this.lblNumData.TabIndex = 2;
this.lblNumData.Text = "#";
this.lblNumData.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnOpenDump
//
this.btnOpenDump.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnOpenDump.Enabled = false;
this.btnOpenDump.Location = new System.Drawing.Point(382, 3);
this.btnOpenDump.Name = "btnOpenDump";
this.btnOpenDump.Size = new System.Drawing.Size(77, 31);
this.btnOpenDump.TabIndex = 3;
this.btnOpenDump.Text = "dump";
this.btnOpenDump.UseVisualStyleBackColor = true;
this.btnOpenDump.Click += new System.EventHandler(this.dump_Click);
//
// lblLastData
//
this.lblLastData.AutoSize = true;
this.lblLastData.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblLastData.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblLastData.Location = new System.Drawing.Point(183, 37);
this.lblLastData.Name = "lblLastData";
this.lblLastData.Size = new System.Drawing.Size(193, 37);
this.lblLastData.TabIndex = 5;
this.lblLastData.Text = "...";
this.lblLastData.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.lblApp,
this.lblVers,
this.MainProgrBar,
this.toolStripStatusLabel1});
this.statusStrip1.Location = new System.Drawing.Point(0, 256);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(478, 25);
this.statusStrip1.TabIndex = 2;
this.statusStrip1.Text = "statusStrip1";
//
// lblApp
//
this.lblApp.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.lblApp.ForeColor = System.Drawing.SystemColors.ControlText;
this.lblApp.Name = "lblApp";
this.lblApp.Size = new System.Drawing.Size(16, 20);
this.lblApp.Text = "...";
//
// lblVers
//
this.lblVers.Font = new System.Drawing.Font("Segoe UI", 8F);
this.lblVers.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
this.lblVers.Name = "lblVers";
this.lblVers.Size = new System.Drawing.Size(16, 20);
this.lblVers.Text = "...";
//
// MainProgrBar
//
this.MainProgrBar.Name = "MainProgrBar";
this.MainProgrBar.Size = new System.Drawing.Size(100, 19);
this.MainProgrBar.Step = 1;
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(22, 20);
this.toolStripStatusLabel1.Text = "---";
//
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox2.AutoSize = true;
this.groupBox2.Controls.Add(this.tableLayoutPanel2);
this.groupBox2.Location = new System.Drawing.Point(4, 27);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(468, 89);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "DB";
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 3;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 47.45763F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 52.54237F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 82F));
this.tableLayoutPanel2.Controls.Add(this.label3, 1, 0);
this.tableLayoutPanel2.Controls.Add(this.label4, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.lblServer, 0, 1);
this.tableLayoutPanel2.Controls.Add(this.btnStart, 2, 0);
this.tableLayoutPanel2.Controls.Add(this.btnConnect, 2, 1);
this.tableLayoutPanel2.Controls.Add(this.lblStatus, 1, 1);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 16);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(462, 70);
this.tableLayoutPanel2.TabIndex = 2;
//
// label3
//
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Location = new System.Drawing.Point(183, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(193, 35);
this.label3.TabIndex = 1;
this.label3.Text = "Status";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label4
//
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
this.label4.Location = new System.Drawing.Point(3, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(174, 35);
this.label4.TabIndex = 0;
this.label4.Text = "Server";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblServer
//
this.lblServer.AutoSize = true;
this.lblServer.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblServer.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblServer.ForeColor = System.Drawing.Color.DimGray;
this.lblServer.Location = new System.Drawing.Point(3, 35);
this.lblServer.Name = "lblServer";
this.lblServer.Size = new System.Drawing.Size(174, 35);
this.lblServer.TabIndex = 2;
this.lblServer.Text = "none";
this.lblServer.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnStart
//
this.btnStart.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnStart.Location = new System.Drawing.Point(382, 3);
this.btnStart.Name = "btnStart";
this.btnStart.Size = new System.Drawing.Size(77, 29);
this.btnStart.TabIndex = 3;
this.btnStart.Text = "ADP START";
this.btnStart.UseVisualStyleBackColor = true;
this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
//
// btnConnect
//
this.btnConnect.Dock = System.Windows.Forms.DockStyle.Fill;
this.btnConnect.Location = new System.Drawing.Point(382, 38);
this.btnConnect.Name = "btnConnect";
this.btnConnect.Size = new System.Drawing.Size(77, 29);
this.btnConnect.TabIndex = 4;
this.btnConnect.Text = "connect";
this.btnConnect.UseVisualStyleBackColor = true;
this.btnConnect.Click += new System.EventHandler(this.btnConnect_Click);
//
// lblStatus
//
this.lblStatus.AutoSize = true;
this.lblStatus.BackColor = System.Drawing.Color.DimGray;
this.lblStatus.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblStatus.Location = new System.Drawing.Point(183, 35);
this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new System.Drawing.Size(193, 35);
this.lblStatus.TabIndex = 5;
this.lblStatus.Text = "offline";
this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// notifyIcon1
//
this.notifyIcon1.ContextMenuStrip = this.trayMenu;
this.notifyIcon1.Text = "MTC ADB";
this.notifyIcon1.Visible = true;
this.notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
//
// trayMenu
//
this.trayMenu.Name = "trayMenu";
this.trayMenu.Size = new System.Drawing.Size(61, 4);
this.trayMenu.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.trayMenu_ItemClicked);
//
// gather
//
this.gather.Tick += new System.EventHandler(this.gather_Tick);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(478, 281);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.label1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "MainForm";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "MTC-ADB";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
this.Shown += new System.EventHandler(this.MainForm_Shown);
this.Resize += new System.EventHandler(this.MainForm_Resize);
this.groupBox1.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label lblNumData;
private System.Windows.Forms.Button btnOpenDump;
private System.Windows.Forms.Label lblLastData;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel lblApp;
private System.Windows.Forms.ToolStripStatusLabel lblVers;
private System.Windows.Forms.ToolStripProgressBar MainProgrBar;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label lblServer;
private System.Windows.Forms.Button btnStart;
private System.Windows.Forms.Button btnConnect;
private System.Windows.Forms.Label lblStatus;
private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.Timer gather;
private System.Windows.Forms.ContextMenuStrip trayMenu;
}
}
+796
View File
@@ -0,0 +1,796 @@
/*
* Copyright Copyright 2017, Steamware s.r.l. & CMS/SCM s.p.a.
*
* Based on data, code and example by MTC consortium & System Insights, Inc.
*
* */
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;
using NLog;
using MTC;
using NLog.Config;
using NLog.Targets;
using System.Collections;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using MTConnect;
namespace MTC_ADB
{
public partial class MainForm : Form
{
#region variabili ed oggetti globali
/// <summary>
/// porta servizio MTC ADB
/// </summary>
protected int portMTC = 7879;
/// <summary>
/// Oggetto x gestione dell'adapter GENERICO (x poter usare metodi di ognuno...)
/// </summary>
AdapterGeneric agObj;
/// <summary>
/// timer base in avvio
/// </summary>
protected int startTimerMs = 250;
/// <summary>
/// timer base (base moltiplica)
/// </summary>
protected int timerIntMs = 100; // di norma 100 msec x timer base...
/// <summary>
/// contatore veloce
/// </summary>
protected int fastCount = 1; // 100ms primo refresh...
/// <summary>
/// contatore normale
/// </summary>
protected int normCount = 2; // 200ms primo refresh...
/// <summary>
/// contatore slow
/// </summary>
protected int slowCount = 3; // 300ms primo refresh...
/// <summary>
/// contatore lentissimo
/// </summary>
protected int verySlowCount = 4; // 400ms primo refresh...
/// <summary>
/// ultimo tentativo riavvio...
/// </summary>
protected DateTime lastStartTry;
/// <summary>
/// tipo di adapter prescelto...
/// </summary>
protected tipoAdapter tipoScelto = tipoAdapter.DB;
/// <summary>
/// oggetto logging
/// </summary>
public static Logger lg;
#endregion
public MainForm()
{
InitializeComponent();
myInit();
}
/// <summary>
/// inizializzazione specifica
/// </summary>
private void myInit()
{
#if DEBUG
// Setup the logging view for Sentinel - http://sentinel.codeplex.com
var sentinalTarget = new NLogViewerTarget()
{
Name = "sentinal",
Address = "udp://127.0.0.1:9999",
IncludeNLogData = false
};
var sentinalRule = new LoggingRule("*", LogLevel.Trace, sentinalTarget);
LogManager.Configuration.AddTarget("sentinal", sentinalTarget);
LogManager.Configuration.LoggingRules.Add(sentinalRule);
#endif
// avvio logger...
LogManager.ReconfigExistingLoggers();
lg = LogManager.GetCurrentClassLogger();
// inizio
setDefaults();
displayTaskAndWait("Starting...");
lastStartTry = DateTime.Now;
advProgBar();
// fix icon!
Icon = Icon.ExtractAssociatedIcon(defIconFilePath);
notifyIcon1.Icon = Icon.ExtractAssociatedIcon(defIconFilePath);
// fix versione!
lblApp.Text = string.Format("{0}", ConfigurationManager.AppSettings.Get("appName"));
lblVers.Text = string.Format(" v.{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
startTimerMs = utils.CRI("startTimerMs");
advProgBar();
displayTaskAndWait("Starting MainForm");
// avvio adapter...
agObj = new AdapterGeneric(this);
loadPersistLayer(defPersLayerFile);
lg.Info("PersLayerFile READ");
agObj.loadPersData();
lg.Info("PersLayerFile LOADED");
// Start timer periodico
gather.Interval = utils.CRI("timerIntMs");
gather.Enabled = true;
displayTaskAndWait("Running");
createTrayMenu();
displayTaskAndWait("Tray Menu OK");
// avvio minimizzato se richiesto
if (utils.CRB("startMinimized"))
{
// imposto minimized se necessario!
if (WindowState != FormWindowState.Minimized)
{
WindowState = FormWindowState.Minimized;
}
displayTaskAndWait("Minimized");
}
displayTaskAndWait("Main Form OK");
// SE abilitato provo ad avviare...
if (utils.CRB("autoStartOnLoad"))
{
avviaAdapter();
}
checkStarted();
checkConnected();
}
/// <summary>
/// Lettura conf DB
/// </summary>
private void loadServerConf()
{
agObj.loadServerConf();
lblServer.Text = string.Format("{0} | {1}", agObj.ServerType, agObj.ServerAddress);
displayTaskAndWait("...LOADING DB CONF...");
checkConnected();
}
/// <summary>
/// Tentativo connessione al DB
/// </summary>
private void connectAdapter()
{
displayTaskAndWait("...CONNECTIONG DB...");
agObj.tryConnect();
checkConnected();
}
/// <summary>
/// Tentativo disconnessione al DB
/// </summary>
private void disconnectAdapter()
{
displayTaskAndWait("...DISCONNECTIONG DB...");
agObj.tryDisconnect();
checkConnected();
}
/// <summary>
/// Verifica se il server sia connesso...
/// </summary>
private void checkConnected()
{
lblLastData.Text = DateTime.Now.ToString("yy-MM-dd HH:mm:ss");
if (agObj.connectionOk)
{
lblStatus.Text = "CONNECTED";
lblStatus.BackColor = Color.ForestGreen;
lblStatus.ForeColor = Color.Yellow;
btnConnect.Text = "close";
lblServer.ForeColor = Color.Black;
lblServer.Text = string.Format("{0} | {1}", agObj.ServerType, agObj.ServerAddress);
// recupero conteggio degli eventi...
advProgBar();
lblNumData.Text = string.Format("{0} new data", agObj.numRecAvail);
displayTaskAndWait("DB Server CONNECTED");
}
else
{
lblStatus.Text = "offline";
lblStatus.BackColor = Color.DimGray;
lblStatus.ForeColor = Color.White;
btnConnect.Text = "open";
lblServer.ForeColor = Color.DimGray;
lblServer.Text = string.Format("???{0}???", agObj.ServerType, agObj.ServerAddress);
lblNumData.Text = "#";
displayTaskAndWait("ERROR connecting to DB Server");
}
}
/// <summary>
/// Verifica se l'adapter sia partito...
/// </summary>
private void checkStarted()
{
if (agObj.adpRunning)
{
btnStart.Text = "ADP STOP";
btnStart.ForeColor = Color.DarkRed;
displayTaskAndWait("ADP STARTED");
}
else
{
btnStart.Text = "ADP START";
btnStart.ForeColor = Color.ForestGreen;
displayTaskAndWait("ADP STOPPED");
}
}
/// <summary>
/// Verifica finale a fine show...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MainForm_Shown(object sender, EventArgs e)
{
// avvio minimizzato se richiesto
if (utils.CRB("startMinimized"))
{
// controllo e mando a tray...
sendToTray();
}
displayTaskAndWait("Main Form SHOWN");
}
/// <summary>
/// mostra un testo sulla status bar ed attende startTimerMs
/// </summary>
/// <param name="txt2show"></param>
public void displayTaskAndWait(string txt2show)
{
toolStripStatusLabel1.Text = txt2show;
lg.Info(txt2show);
// aggiorno componenti principali...
toolStripStatusLabel1.Invalidate();
lblServer.Refresh();
lblStatus.Refresh();
lblNumData.Refresh();
advProgBar();
Thread.Sleep(startTimerMs);
}
/// <summary>
/// crea menù tray x applicazione
/// </summary>
private void createTrayMenu()
{
// Fix testi menù tray...
trayMenu.Items.Clear();
// SE permessa massimizzazione...
if (utils.CRB("windowCanMax"))
{
trayMenu.Items.Add("Show MTC-ADB");
}
// se è permesso tray close...
if (utils.CRB("trayClose"))
{
trayMenu.Items.Add("Close MTC-ADB");
}
advProgBar();
}
/// <summary>
/// doppio click su tray icon
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void notifyIcon1_DoubleClick(object sender, EventArgs e)
{
// SOLO SE PERMESSO mostrare full...
if (utils.CRB("windowCanMax"))
{
Show();
WindowState = FormWindowState.Normal;
}
}
/// <summary>
/// evento resize
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MainForm_Resize(object sender, EventArgs e)
{
checkFormVisibility();
}
/// <summary>
/// Verifica stato windows (minimized/normal) e visibilità con tray...
/// </summary>
private void checkFormVisibility()
{
// se non può massimizzare imposto COMUNQUE a minimized...
if (!utils.CRB("windowCanMax"))
{
WindowState = FormWindowState.Minimized;
}
// controllo cosa devo mostrare...
if (WindowState == FormWindowState.Minimized)
{
notifyIcon1.Visible = false;
sendToTray();
}
else
{
notifyIcon1.Visible = false;
}
}
/// <summary>
/// Gestisce "andata nel tray" della form
/// </summary>
private void sendToTray()
{
if (!notifyIcon1.Visible)
{
notifyIcon1.BalloonTipTitle = utils.CRS("appName");
notifyIcon1.BalloonTipText = string.Format("{0} running on tray", utils.CRS("appName"));
notifyIcon1.Visible = true;
notifyIcon1.ShowBalloonTip(100);
}
Hide();
}
/// <summary>
/// click su menù contestuale in tray
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void trayMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (e.ClickedItem.Text.StartsWith("Close"))
{
// stop adapter...
closeAdapter();
// chiudo!
Close();
}
else if (e.ClickedItem.Text.StartsWith("Show"))
{
if (utils.CRB("windowCanMax"))
{
Show();
WindowState = FormWindowState.Normal;
}
}
}
/// <summary>
/// File persistenza generale
/// </summary>
protected string defPersLayerFile
{
get
{
return string.Format(@"{0}\{1}", utils.dataDatDir, utils.CRS("defaultPersLayerFile"));
}
}
protected string defIconFilePath
{
get
{
return string.Format(@"{0}\MTCA.ico", utils.resxDir);
}
}
/// <summary>
/// impostazione valori defaults
/// </summary>
private void setDefaults()
{
MainProgrBar.Minimum = 0;
MainProgrBar.Maximum = 300;
MainProgrBar.Value = 0;
MainProgrBar.Step = 1;
portMTC = utils.CRI("portMTC");
}
/// <summary>
/// Avvio adapter
/// </summary>
public void avviaAdapter()
{
// avvio adapter vero e proprio...
displayTaskAndWait("Adapter starting");
// inizio con la connessione al DB
if (!agObj.connectionOk)
{
loadServerConf();
connectAdapter();
advProgBar();
}
agObj.startAdapter(portMTC);
//displayTaskAndWait("Adapter started!");
btnOpenDump.Enabled = true;
if (utils.CRB("openDumpOnStart"))
{
displayTaskAndWait("Dump Window starting");
apriDumpAgent();
displayTaskAndWait("Dump Windows OK");
}
displayTaskAndWait("Start Timers");
// inizializzo contatori fast/mid/slow
fastCount = utils.CRI("fastCount");
normCount = utils.CRI("normCount");
slowCount = utils.CRI("slowCount");
verySlowCount = utils.CRI("verySlowCount");
displayTaskAndWait("Adapter Running...");
}
/// <summary>
/// fermata dell'adapter
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void stop_Click(object sender, EventArgs e)
{
fermaAdapter(false);
// salvo che ho fermato adapter
lg.Info("UNLOAD Adapter");
}
/// <summary>
/// Ferma l'adapter
/// </summary>
/// <param name="tryRestart">determina se si debba tentare riavvio automatico (per caduta connessione)</param>
public void fermaAdapter(bool tryRestart)
{
fermaTutto(false, tryRestart);
}
private void gather_Tick(object sender, EventArgs e)
{
// eseguo cicli attivi SOLO se adapter è in EFFETTIVO running...
if (agObj.adpRunning)
{
// inizio a riportare che sto eseguendo..
advProgBar();
if (agObj.connectionOk)
{
// check esecuzione FastTask
checkFastTask();
// check esecuzione NormTask
checkNormTask();
// check esecuzione SlowTask
checkSlowTask();
// check esecuzione VerySlowTask
checkVerySlowTask();
}
else
{
double currWait = DateTime.Now.Subtract(lastStartTry).TotalMilliseconds;
if (agObj.adpTryRestart && currWait > utils.CRI("waitRecMSec"))
{
// provo a connettermi...
lblStatus.Text = "...CONNECTING...";
lblStatus.BackColor = Color.Goldenrod;
displayTaskAndWait("Server Conf READ");
lastStartTry = DateTime.Now;
agObj.tryConnect();
agObj.loadPersData();
checkStarted();
checkConnected();
}
}
// se è arrivato a MAX resetto...
if (MainProgrBar.Value >= MainProgrBar.Maximum)
{
MainProgrBar.Value = 0;
}
}
else
{
// verifico SE debba tentare il riavvio, ovvero NON running ma tryReconn e non ho riprovato x oltre waitRecMSec
double currWait = DateTime.Now.Subtract(lastStartTry).TotalMilliseconds;
if (agObj.adpTryRestart && currWait > utils.CRI("waitRecMSec"))
{
lastStartTry = DateTime.Now;
avviaAdapter();
}
}
advProgBar();
}
public void resetProgBar()
{
MainProgrBar.Value = 0;
}
private void checkSlowTask()
{
slowCount--;
if (slowCount <= 0)
{
slowCount = utils.CRI("slowCount");
agObj.gaterAndSend(gatherCycle.LF);
// tenta salvataggio valori ATTUALI dei parametri ove applicabile/aggiornati --> sia file corrente che file "history"
persistData();
}
}
private void checkVerySlowTask()
{
verySlowCount--;
if (verySlowCount <= 0)
{
verySlowCount = utils.CRI("verySlowCount");
agObj.gaterAndSend(gatherCycle.VLF);
}
}
/// <summary>
/// file persistenza generale
/// </summary>
public string histPersLayerFile
{
get
{
return string.Format(@"{0}\{1:yyyy}\{1:yyyy-MM-dd}.mtc", utils.dataDatDir, DateTime.Now);
}
}
/// <summary>
/// file persistenza generale data attuale ANTICIPATA di xx giorni
/// </summary>
/// <param name="numDD">num DD di anticipo</param>
/// <returns></returns>
public string prevPersLayerFile(int numDD)
{
return string.Format(@"{0}\{1:yyyy}\{1:yyyy-MM-dd}.mtc", utils.dataDatDir, DateTime.Now.AddDays(-numDD));
}
/// <summary>
/// salva i valori attuali del file di conf sia in file corrente che in cartella valori storici
/// </summary>
public void persistData()
{
// salvo ogni "autoSaveSec" secondi dall'ultimo salvataggio...
TimeSpan tempoMod = new TimeSpan(0);
if (File.Exists(defPersLayerFile))
{
DateTime adesso = DateTime.Now;
tempoMod = DateTime.Now.Subtract(File.GetLastWriteTime(defPersLayerFile));
}
if (tempoMod.TotalSeconds > utils.CRI("autoSaveSec"))
{
savePersistLayer(defPersLayerFile);
savePersistLayer(histPersLayerFile);
}
}
private void checkNormTask()
{
// decremento...
normCount--;
// se il counter è a zero eseguo...
if (normCount <= 0)
{
normCount = utils.CRI("normCount");
agObj.gaterAndSend(gatherCycle.MF);
lblLastData.Text = DateTime.Now.ToString("yy-MM-dd HH:mm:ss");
}
}
/// <summary>
/// Avanza la barra di stato...
/// </summary>
public void advProgBar()
{
try
{
MainProgrBar.PerformStep();
if (MainProgrBar.Value >= MainProgrBar.Maximum) resetProgBar();
MainProgrBar.Invalidate();
}
catch
{ }
}
private void checkFastTask()
{
// decremento...
fastCount--;
// se il counter è a zero eseguo...
if (fastCount <= 0)
{
fastCount = utils.CRI("fastCount");
agObj.gaterAndSend(gatherCycle.HF);
}
}
/// <summary>
/// apro eseguibile dump
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void dump_Click(object sender, EventArgs e)
{
apriDumpAgent();
}
/// <summary>
/// apre agent di dump in CMD
/// </summary>
private static void apriDumpAgent()
{
string path = Application.StartupPath;
try
{
Process.Start(string.Format(@"{0}\..\..\dump\dump.exe", path));
}
catch
{
Process.Start(string.Format(@"{0}\dump\dump.exe", path));
}
}
/// <summary>
/// Salva su file l'oggetto di persistenza dati
/// </summary>
/// <param name="filePath"></param>
public void savePersistLayer(string filePath)
{
// in primis check semaforo salvataggio...
if (!agObj.adpSaving)
{
// alzo semaforo salvataggio
agObj.adpSaving = true;
// se HO dei dati...
if (agObj.persistenceLayer != null)
{
try
{
utils.WritePlain(agObj.persistenceLayer, filePath);
}
catch (Exception exc)
{
lg.Error(string.Format("Errore salvataggio file{0}{1}", Environment.NewLine, exc));
}
}
else
{
lg.Info("persistenceLayer null, non salvato...");
}
// abbasso semaforo salvataggio
agObj.adpSaving = false;
}
}
/// <summary>
/// Carica da file l'oggetto di persistenza dati
/// </summary>
/// <param name="filePath"></param>
public void loadPersistLayer(string filePath)
{
// inizializzo prima di leggere...
agObj.persistenceLayer = new Dictionary<string, string>();
agObj.persistenceLayer = utils.ReadPlain(filePath);
// 2017.03.23 check problema files corrotti...
if (agObj.persistenceLayer.Count == 0)
{
// se avesse letto un valore NON coerente (senza righe) PROVA a leggere a ritroso vecchi files... da histPersLayerFile e precedenti...
int numDD = 0;
int maxNumDD = utils.CRI("maxNumDD");
Dictionary<string, string> lastRead = new Dictionary<string, string>();
// continuo fino a che non leggo almeno 1 riga valida e non ho raggiunto maxDD
while (numDD < maxNumDD && lastRead.Count == 0)
{
// leggo il file storico alla data anticipata... (ci provo...)
try
{
lastRead = utils.ReadPlain(prevPersLayerFile(numDD));
}
catch
{ }
numDD++;
}
// se sono uscito PROVO a passare il file storico letto buono (oppure vuoto...)
agObj.persistenceLayer = lastRead;
}
}
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
closeAdapter();
}
private void closeAdapter()
{
fermaTutto(true, false);
}
/// <summary>
/// Ferma tutti i componenti adapter + update buttons
/// </summary>
/// <param name="stopTimer">determina se fermare il timer (gather) principale (solo se non si chiude)</param>
/// <param name="tryRestart">determina se tentare di riconnettersi</param>
private void fermaTutto(bool stopTimer, bool tryRestart)
{
agObj.stopAdapter(tryRestart);
// salvo!
savePersistLayer(defPersLayerFile);
savePersistLayer(histPersLayerFile);
if (stopTimer)
{
gather.Enabled = false;
agObj.tryDisconnect();
}
// verifica e display
checkStarted();
displayTaskAndWait("Adapter Stopped");
}
/// <summary>
/// toggle connessione...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnConnect_Click(object sender, EventArgs e)
{
// blocco button
btnConnect.Enabled = false;
btnConnect.Refresh();
advProgBar();
// processo
if (agObj.connectionOk)
{
lblStatus.Text = "...CLOSING...";
lblStatus.BackColor = Color.Goldenrod;
displayTaskAndWait("Closing DB Connection");
// CHIUDO!
disconnectAdapter();
}
else
{
lblStatus.Text = "...CONNECTING...";
lblStatus.BackColor = Color.Goldenrod;
displayTaskAndWait("Opening DB Connection");
// APRO!
loadServerConf();
connectAdapter();
}
// sblocco button...
btnConnect.Enabled = true;
btnConnect.Refresh();
advProgBar();
}
private void btnStart_Click(object sender, EventArgs e)
{
// blocco button
btnStart.Enabled = false;
btnStart.Refresh();
advProgBar();
// processo
if (agObj.adpRunning)
{
// CHIUDO!
fermaTutto(true, false);
}
else
{
gather.Enabled = true;
avviaAdapter();
}
checkStarted();
checkConnected();
// sblocco button...
btnStart.Enabled = true;
btnStart.Refresh();
advProgBar();
}
}
}
+157
View File
@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="notifyIcon1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>133, 17</value>
</metadata>
<metadata name="trayMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>333, 17</value>
</metadata>
<metadata name="gather.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>246, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABILAAASCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADIy
MgA2NjYCKikqCikpKQQXFxcAAAALAQAAQwEAABIAAAAVAAAAIAEAAAMAAAAWAAICBAEUEAkBCwsxAAoH
AAAcGxsWCQkJgwcHB8EHBweeEBAQM9yvS4/ar1KVw6BSI96zVF/asFWYvpxRJuG7ZV/et2Chy6dWRua2
TQDbqTo9W0UYvhUPBfQPDw6vCAgI5QcHB8fhr0Lp369G786kSkbhsUrF4bFL/82kSmnkuFug5LdX/9Ss
Vm/ovGAA1K5cYIVzUv9hWU3WTktHGx8fH0QXFxde2KE16dahOe3MnUBs2KM669qmPv/NnDuk2KlJptup
Rv/LnkNy4rRXAM+pW2GPfmH/fHVt1GxpZxiYmJg/Xl5eW8eQMenGkDPswI44pciSNerJlzzLxJE228iZ
RsbMmT//vpA8cdyqTgDQpFJinYNY/3FpZPRfX1+aQUFB2R8fH8OzfCrotYAx/LiHPPOzfi/GtoY6cLqI
Pfm/kUv6uYc5/66AOHLNmkkAwZNJY7uSUv+KdlnpNzc4wQsMDJ8ODg4zoGoo6KFqKP+ibCn/nmwslKZ2
OCymczXmqHU2/6h1N/+fczqRn3NAgqh7Q7qsfUD/mmQj5IRQFKWFVyJVrkcAAJNfM9eVYjfulmQ76o9h
OVWhdksImWhAtJZkO++YaEDql2tFmp5vSN2aakLviVAi7YNHFu6ESBfzhVAkfaM/AACsiHIsm25TMYpW
Ny+CTzEMAAAAAJxwVSGKVjYwmm1SLpBjRh+XaUwqjlw9MIFJJjGDTCkxg0spMYFOLxeQSh4AAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA//8AAP//AAD//wAA//EAAABgAAAAQAAAAEAAAABAAAAAQAAAAEAAAAABAAAAAQAACAEAAP//
AAD//wAA//8AAA==
</value>
</data>
</root>
+56
View File
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log" >
<!-- optional, add some variabeles
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="myvar" value="myvalue"/>
<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets async="true">
<!--
add your targets here
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
-->
<!--
Write events to a file with the date in the filename.
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
-->
<target xsi:type="File"
name="f"
fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}"
/>
<!--<target xsi:type="File"
name="default"
layout="${longdate} - ${level:uppercase=true}: ${message}${onexception:${newline}EXCEPTION\: ${exception:format=ToString}}"
fileName="${specialfolder:ApplicationData}\${appName}\Debug.log"
keepFileOpen="false"
archiveFileName="${specialfolder:ApplicationData}\${appName}\Debug_${shortdate}.{##}.log"
archiveNumbering="Sequence"
archiveEvery="Day"
maxArchiveFiles="30"
/>-->
</targets>
<rules>
<!-- add your logging rules here -->
<!--
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
<logger name="*" minlevel="Debug" writeTo="f" />
-->
<logger name="*" minlevel="Debug" writeTo="f" />
</rules>
</nlog>
File diff suppressed because it is too large Load Diff
+25
View File
@@ -0,0 +1,25 @@
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace MTC_ADB
{
static class Program
{
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool AllocConsole();
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool FreeConsole();
/// <summary>
/// Punto di ingresso principale dell'applicazione.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}
@@ -0,0 +1,28 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("MTC-ADB")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("MTC-ADB")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
// COM, impostare su true l'attributo ComVisible per tale tipo.
[assembly: ComVisible(false)]
// Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
[assembly: Guid("df877e5e-8d04-4532-ba01-cefd8636d4da")]
// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
//
// Versione principale
// Versione secondaria
// Numero di build
// Revisione
+71
View File
@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Codice generato da uno strumento.
// Versione runtime:4.0.30319.42000
//
// Le modifiche apportate a questo file possono causare un comportamento non corretto e andranno perse se
// il codice viene rigenerato.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MTC_ADB.Properties
{
/// <summary>
/// Classe di risorse fortemente tipizzata per la ricerca di stringhe localizzate e così via.
/// </summary>
// Questa classe è stata generata automaticamente dalla classe StronglyTypedResourceBuilder
// tramite uno strumento quale ResGen o Visual Studio.
// Per aggiungere o rimuovere un membro, modificare il file .ResX, quindi eseguire di nuovo ResGen
// con l'opzione /str oppure ricompilare il progetto VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Restituisce l'istanza di ResourceManager memorizzata nella cache e usata da questa classe.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MTC_ADB.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Esegue l'override della proprietà CurrentUICulture del thread corrente per tutte
/// le ricerche di risorse che utilizzano questa classe di risorse fortemente tipizzata.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+30
View File
@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MTC_ADB.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+15
View File
@@ -0,0 +1,15 @@
Con riferimento a
https://msdn.microsoft.com/en-us/library/f2ccy3wt%28v=vs.140%29.aspx
1) andare in dic di VC
cd "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC"
2) eseguire conf
vcvarsall.bat
vcvarsall x86
3) adesso si può compilare
cd C:\Users\samuele.STEAMWAREWIN\Documents\VisualStudioProjects\CMS-MTConn\MTC_Adapter\MTC-ADB\dump
build.bat
+1
View File
@@ -0,0 +1 @@
cl dump.c ws2_32.lib
+184
View File
@@ -0,0 +1,184 @@
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/socket.h>
#include <sys/select.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <time.h>
#include <unistd.h>
#endif
#include <sys/types.h>
#include <string.h>
#define PORT 7879
#define HOST "localhost"
#define BUFFER_SIZE 1024
#ifndef _WIN32
#define SOCKET int
#define closesocket close
#endif
void cleanup_and_exit(int ret)
{
#ifdef _WIN32
WSACleanup();
#endif
exit(ret);
}
void usage()
{
fprintf(stderr, "Usage: dump [-t timeout] [host] [port] [file]\n host defaults to localhost\n port defaults to 7878\n file defaults to stdout\n");
exit(0);
}
int main(int argc, char **argv)
{
char hostname[100];
SOCKET sd;
struct sockaddr_in pin;
struct hostent *hp;
char buffer[BUFFER_SIZE];
int port;
FILE *file;
char dump = 0;
char **argvp = argv;
time_t start = 0;
int remaining = 1, timeout = 0, nfds;
struct fd_set fds;
struct timeval tv, *tvp = 0;
#ifdef _WIN32
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2,0), &wsaData) != 0) {
fprintf(stderr, "WSAStartup failed\n");
cleanup_and_exit(1);
}
#endif
if (argc > 1) {
if (strcmp(argv[1], "-h") == 0) {
usage();
} else if (strcmp(argv[1], "-t") == 0) {
if (argc < 3) {
fprintf(stderr, "Missing timeout argument\n");
usage();
}
timeout = atoi(argv[2]);
argc -= 2;
argvp += 2;
}
}
strcpy(hostname,HOST);
if (argc > 1) {
strcpy(hostname,argvp[1]);
}
port = PORT;
if (argc > 2) {
port = atoi(argvp[2]);
}
file = stdout;
if (argc > 3) {
file = fopen(argvp[3], "w");
if (file == NULL) {
perror("fopen");
fprintf(stderr, "Cannot open file %s\n", argv[3]);
exit(1);
}
dump = 1;
}
/* go find out about the desired host machine */
if ((hp = gethostbyname(hostname)) == (void*) 0) {
perror("gethostbyname");
cleanup_and_exit(1);
}
/* fill in the socket structure with host information */
memset(&pin, 0, sizeof(pin));
pin.sin_family = AF_INET;
memcpy(&pin.sin_addr.s_addr, hp->h_addr, hp->h_length);
pin.sin_port = htons(port);
/* grab an Internet domain socket */
if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
perror("socket");
cleanup_and_exit(1);
}
/* connect to PORT on HOST */
if (connect(sd,(struct sockaddr *) &pin, sizeof(pin)) == -1) {
perror("connect");
cleanup_and_exit(1);
}
if (dump) {
printf("Connected to %s port %d\n", hostname, port);
}
/* wait for a message to come back from the server */
if (timeout > 0) {
start = time(0);
remaining = timeout;
tv.tv_usec = 0;
tvp = &tv;
}
#ifdef _WIN32
nfds = 1;
#else
nfds = sd + 1;
#endif
while (remaining > 0) {
int n;
FD_ZERO(&fds);
FD_SET(sd, &fds);
tv.tv_sec = remaining;
n = select(nfds, &fds, (fd_set*) 0, (fd_set*) 0, tvp);
if (n < 0) {
closesocket(sd);
perror("recv");
cleanup_and_exit(1);
} else if (n > 0) {
int count = recv(sd, buffer, BUFFER_SIZE, 0);
if (count == -1) {
closesocket(sd);
perror("recv");
cleanup_and_exit(1);
}
if (count == 0)
break;
fwrite(buffer, 1, count, file);
if (dump) {
fputc('.', stdout);
fflush(stdout);
}
fflush(file);
}
if (timeout > 0) {
time_t now = time(0);
remaining -= (int) (now - start);
start = now;
}
}
if (dump) printf("\nFinished\n");
fclose(file);
closesocket(sd);
#ifdef _WIN32
WSACleanup();
#endif
return 0;
}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@

+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MySql.Data" version="6.9.9" targetFramework="net452" />
<package id="NLog" version="4.4.5" targetFramework="net452" />
<package id="NLog.Config" version="4.4.5" targetFramework="net452" />
<package id="NLog.Schema" version="4.4.5" targetFramework="net452" />
<package id="PrettyBin" version="1.1.0" targetFramework="net452" />
<package id="SlowCheetah" version="2.5.48" targetFramework="net452" />
</packages>
+56
View File
@@ -0,0 +1,56 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using NLog;
namespace MTC
{
public class utils : MTC.baseUtils
{
/// <summary>
/// folder archiviazione dati configurazione (DATA\CONF)
/// </summary>
public static string resxDir
{
get
{
return string.Format(@"{0}\{1}", Application.StartupPath, CRS("resxPath"));
}
}
/// <summary>
/// folder archiviazione dati configurazione (DATA\CONF)
/// </summary>
public static string confDir
{
get
{
return string.Format(@"{0}\{1}", Application.StartupPath, CRS("dataConfPath"));
}
}
/// <summary>
/// folder archiviazione dati storici giornalieri (DATA\DAT)
/// </summary>
public static string dataDatDir
{
get
{
return string.Format(@"{0}\{1}", Application.StartupPath, CRS("dataDatPath"));
}
}
/// <summary>
/// folder archiviazione dati (DATA)
/// </summary>
public static string dataDir
{
get
{
return string.Format(@"{0}\{1}", Application.StartupPath, CRS("dataPath"));
}
}
}
}
@@ -1,12 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using System.Numerics;
namespace MTC_Adapter
namespace MTC
{
public class BinaryFormatter : IFormatProvider, ICustomFormatter
+62
View File
@@ -0,0 +1,62 @@
<?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>{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MTC</RootNamespace>
<AssemblyName>MTC</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.4\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<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="BinaryFormatter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="baseUtils.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="NLog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="NLog.xsd">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+41
View File
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<!-- optional, add some variables
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="myvar" value="myvalue"/>
<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets>
<!--
add your targets here
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
-->
<!--
Write events to a file with the date in the filename.
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
-->
</targets>
<rules>
<!-- add your logging rules here -->
<!--
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
<logger name="*" minlevel="Debug" writeTo="f" />
-->
</rules>
</nlog>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
// associate a un assembly.
[assembly: AssemblyTitle("MTC")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MTC")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
// COM, impostare su true l'attributo ComVisible per tale tipo.
[assembly: ComVisible(false)]
// Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
[assembly: Guid("ec83d80e-9f3b-4de9-b16a-ca216543b7ec")]
// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
//
// Versione principale
// Versione secondaria
// Numero di build
// Revisione
//
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// usando l'asterisco '*' come illustrato di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+786
View File
@@ -0,0 +1,786 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using NLog;
namespace MTC
{
public class baseUtils
{
/// <summary>
/// classe logger
/// </summary>
public static Logger lg;
/// <summary>
/// legge conf in formato char
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static char CRC(string key)
{
char answ = '-';
try
{
answ = ConfigurationManager.AppSettings[key].ToCharArray()[0];
}
catch
{ }
return answ;
}
/// <summary>
/// legge conf in formato stringa
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static string CRS(string key)
{
string answ = "";
try
{
answ = ConfigurationManager.AppSettings[key].ToString();
}
catch
{ }
return answ;
}
/// <summary>
/// legge conf in formato INT
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static Int32 CRI(string key)
{
int answ = 0;
try
{
answ = Convert.ToInt32(CRS(key));
}
catch
{ }
return answ;
}
/// <summary>
/// legge conf in formato BOOLean
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static bool CRB(string key)
{
bool answ = false;
try
{
answ = Convert.ToBoolean(CRS(key));
}
catch
{ }
return answ;
}
/// <summary>
/// verifica se un dato bit sia alzato (come flag di strobe)
/// </summary>
/// <param name="value">valore da testare</param>
/// <param name="flag">valore cercato, può essere un singolo valore o un insieme in modalità AND</param>
/// <returns></returns>
public static bool IsSetAll(Strobe value, Strobe flag)
{
return ((value & flag) == flag);
}
/// <summary>
/// verifica se un dato bit sia alzato (come flag di strobe)
/// </summary>
/// <param name="value">valore da testare</param>
/// <param name="flag">valore cercato, può essere un singolo valore o un insieme in modalità OR</param>
/// <returns></returns>
public static bool IsSetAny(Strobe value, Strobe flag)
{
return ((value & flag) != 0);
}
/// <summary>
/// verifica se un dato bit sia alzato (come flag di strobe)
/// </summary>
/// <param name="value">valore da testare</param>
/// <param name="flag">valore cercato, può essere un singolo valore o un insieme in modalità AND</param>
/// <returns></returns>
public static bool IsSetAll(StatusBitMap value, StatusBitMap flag)
{
return ((value & flag) == flag);
}
/// <summary>
/// verifica se un dato bit sia alzato (come flag di strobe)
/// </summary>
/// <param name="value">valore da testare</param>
/// <param name="flag">valore cercato, può essere un singolo valore o un insieme in modalità OR</param>
/// <returns></returns>
public static bool IsSetAny(StatusBitMap value, StatusBitMap flag)
{
return ((value & flag) != 0);
}
/// <summary>
/// formatta un numero in forma binaria 0/1
/// </summary>
/// <param name="valore"></param>
/// <returns></returns>
public static string binaryForm(int valore)
{
string answ = "";
try
{
answ = string.Format(new BinaryFormatter(), "{0:B}", valore);
}
catch
{ }
return answ;
}
/// <summary>
/// imposta un bit al valore richiesto duplicando il valore IN come OUT
/// </summary>
/// <param name="original">valore originale da aggiornare</param>
/// <param name="bitBool">valore richiesto x il bit (0/1)</param>
/// <param name="bitIndex">indice bit, 0 based (es: 0..31 per 32bit)</param>
/// <returns></returns>
public static byte[] setBitOnStFlag(byte[] original, bool bitBool, int bitIndex)
{
int bitVal = 0;
if (bitBool) bitVal = 1;
// risposta è identica ad originale...
byte[] answ = original;
// verifico se il bit è 0/1b
if (bitVal <= 1 && bitVal >= 0)
{
// verifico se si possa aggiornare il bit richiesto (<= al totale dei bit...)
if (bitIndex <= original.Length * 8 - 1)
{
// calcolo byte
int byteIndex = bitIndex / 8;
// bit nel byte
int bitInByteIndex = bitIndex % 8;
// bit richiesto
byte mask = (byte)(bitVal << bitInByteIndex);
// imposto!
answ[byteIndex] |= mask;
}
}
return answ;
}
/// <summary>
/// Converte un bitarray a byte[]
/// </summary>
/// <param name="bits"></param>
/// <returns></returns>
public static byte[] ToByteArray(BitArray bits)
{
int numBytes = bits.Count / 8;
if (bits.Count % 8 != 0) numBytes++;
byte[] bytes = new byte[numBytes];
int byteIndex = 0, bitIndex = 0;
for (int i = 0; i < bits.Count; i++)
{
if (bits[i])
bytes[byteIndex] |= (byte)(1 << (7 - bitIndex));
bitIndex++;
if (bitIndex == 8)
{
bitIndex = 0;
byteIndex++;
}
}
return bytes;
}
/// <summary>
/// Scrittura dictionary su file
/// </summary>
/// <param name="dictionary"></param>
/// <param name="file"></param>
public static void WriteBin(Dictionary<string, string> dictionary, string file)
{
using (FileStream fs = File.OpenWrite(file))
using (BinaryWriter writer = new BinaryWriter(fs))
{
// Put count.
writer.Write(dictionary.Count);
// Write pairs.
foreach (var pair in dictionary)
{
writer.Write(pair.Key);
writer.Write(pair.Value);
}
}
}
/// <summary>
/// Lettura dictionary da file
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
public static Dictionary<string, string> ReadBin(string file)
{
var result = new Dictionary<string, string>();
// verifico file esista...
if (!File.Exists(file))
{
FileStream fs = File.Create(file);
fs.Close();
}
using (FileStream fs = File.OpenRead(file))
using (BinaryReader reader = new BinaryReader(fs))
{
// Get count.
int count = 0;
try
{
count = reader.ReadInt32();
}
catch
{ }
// Read in all pairs.
for (int i = 0; i < count; i++)
{
string key = reader.ReadString();
string value = reader.ReadString();
result[key] = value;
}
}
return result;
}
/// <summary>
/// Scrittura dictionary su file
/// </summary>
/// <param name="dictionary"></param>
/// <param name="file"></param>
public static void WritePlain(Dictionary<string, string> dictionary, string file)
{
string dirPath = file.Substring(0, file.LastIndexOf('\\'));
// verifico directory
if (!Directory.Exists(dirPath))
{
Directory.CreateDirectory(dirPath);
}
string[] lines = dictionary.OrderBy(i => i.Key).Select(kvp => kvp.Key + ":" + kvp.Value).ToArray();
try
{
File.WriteAllLines(file, lines);
}
catch (Exception exc)
{
lg.Info(exc, string.Format("Errore in scrittura file {0}", file));
}
}
/// <summary>
/// Lettura dictionary da file
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
public static Dictionary<string, string> ReadPlain(string file)
{
// inizializzo num righe lette...
int numRow = 0;
var result = new Dictionary<string, string>();
// verifico file esista...
if (!File.Exists(file))
{
FileStream fs = File.Create(file);
fs.Close();
}
try
{
string[] lines = File.ReadAllLines(file);
result = lines.Select(l => l.Split(':')).ToDictionary(a => a[0], a => a[1]);
numRow = result.Count;
}
catch
{ }
// se leggesse un valore NON coerente (senza righe) restituisce un file vuoto...
if (numRow == 0)
{
result = new Dictionary<string, string>();
}
return result;
}
}
/// <summary>
/// Oggetto timing x archiviazione dati perfomances
/// </summary>
public class TimeRec
{
/// <summary>
/// Codice univoco chiamata: tipo R4 (read 4 byte), W2 (write 2 Byte)
/// </summary>
public string codCall;
/// <summary>
/// Num chiamate totale
/// </summary>
public int numCall;
/// <summary>
/// Tempo medio chiamata
/// </summary>
public double avgMsec
{
get
{
return totMsec.TotalMilliseconds / numCall;
}
}
/// <summary>
/// Totale Msec accumulati
/// </summary>
public TimeSpan totMsec;
/// <summary>
/// Classe record timing
/// </summary>
public TimeRec()
{
codCall = "";
numCall = 0;
totMsec = new TimeSpan(0);
}
/// <summary>
/// Classe record timing
/// </summary>
/// <param name="codice"></param>
/// <param name="ticks"></param>
public TimeRec(string codice, long nTicks)
{
codCall = codice;
numCall = 1;
totMsec = new TimeSpan(nTicks);
}
}
public static class TimingData
{
public static List<TimeRec> results = new List<TimeRec>();
/// <summary>
/// aggiorno vettore aggiungendo risultato
/// </summary>
/// <param name="codice"></param>
/// <param name="ticks"></param>
public static void addResult(string codice, long ticks)
{
if (results.Count == 0)
{
results.Add(new TimeRec(codice, ticks));
}
int indice = -1;
for (int i = 0; i < results.Count; i++)
{
// se il codice è quello cercato...
if (results[i].codCall == codice) indice = i;
}
// se c'è aggiorno...
if (indice >= 0)
{
results[indice].numCall++;
results[indice].totMsec = results[indice].totMsec.Add(new TimeSpan(ticks));
}
// altrimenti aggiungo...
else
{
results.Add(new TimeRec(codice, ticks));
}
}
}
public enum tipoAdapter
{
/// <summary>
/// Adapter DB
/// </summary>
DB,
/// <summary>
/// Adapter generico/demo
/// </summary>
DEMO,
/// <summary>
/// Adapter ESAGV (SCM)
/// </summary>
ESAGV,
/// <summary>
/// adapter FANUC (CMS)
/// </summary>
FANUC,
/// <summary>
/// Adapter non specificato
/// </summary>
ND,
/// <summary>
/// Adapter OSAI
/// </summary>
OSAI,
/// <summary>
/// Adapter SIEMENS (CMS)
/// </summary>
SIEMENS
}
public enum gatherCycle
{
/// <summary>
/// lettura dati ad alta frequenza
/// </summary>
HF,
/// <summary>
/// lettura dati standard
/// </summary>
MF,
/// <summary>
/// lettura dati bassa freq
/// </summary>
LF,
/// <summary>
/// lettura dati bassissima priorità (re-sync stato allarmi)
/// </summary>
VLF
}
/// <summary>
/// informazioni di produzione
/// </summary>
public struct prodData
{
public string Operator;
public bool Status;
public int AccTime;
public int Power;
public string FuncMode;
public bool EmrStop;
public string MessageCode;
public string MessageText;
}
public struct PathData
{
public int PathSel;
public string PathType; // LAVOR/ASSERV
public string RunMode;
public string ExeMode;
public int pzTot;
public string ProgramName;
public string ProgrRow;
public string PartId;
public string ActiveAxes;
public string CodG_Act;
public string SubMode;
public int PathFeedrate;
public int PathFeedrateOver;
public int PathRapidOver;
public position PathPosAct;
}
public struct UnOpData
{
public int UnOpSel;
public int UnOpToolId;
public int UnOpNumCU;
public string UnOpStatus;
public int UnOpVitaRes;
public int UnOpSpeed;
public int UnOpLoad;
public int UnOpAccTime;
}
public struct AxisData
{
public int AxisSel;
public string AxisMainProc;
public bool AxisIsMaster;
public string AxisMastId;
public string AxisType;
public string AxisDir;
public int AxisLoad;
public int AxisPosAct;
public int AxisPosTgt;
public int AxisFeedAct;
public int AxisFeedOver;
public string AxisAccel;
public string AxisAccTime;
public string AxisBattery;
public string DistDone;
public string InvDDone;
}
/// <summary>
/// Vettore completo posizione (X-Y-Z con versori i-j-k)
/// </summary>
public class position
{
public float x;
public float y;
public float z;
public float i;
public float j;
public float k;
public position()
{
x = 0;
y = 0;
z = 0;
i = 0;
j = 0;
k = 0;
}
}
/// <summary>
/// Dati Prod SCM (per decodifica)
/// </summary>
public class datiProdSCM
{
public string area;
public string fileName;
public string dimensioni;
public DateTime start;
public DateTime stop;
public TimeSpan tEff;
public TimeSpan tTot;
public int qta;
public TimeSpan tMed;
public datiProdSCM()
{
area = "";
fileName = "";
dimensioni = "";
start = DateTime.Now;
stop = DateTime.Now;
tEff = new TimeSpan(0);
tTot = new TimeSpan(0);
qta = 0;
tMed = new TimeSpan(0);
}
/// <summary>
/// crea un nuovo oggetto a partire da un array di stringhe
/// </summary>
/// <param name="valori"></param>
public datiProdSCM(string[] valori)
{
try
{
area = valori[0];
fileName = valori[1];
dimensioni = string.Format("{0}x{1}x{2}", valori[3], valori[4], valori[5]);
start = DateTime.Today.AddHours(Convert.ToInt16(valori[6])).AddMinutes(Convert.ToInt16(valori[7])).AddSeconds(Convert.ToInt16(valori[8]));
stop = DateTime.Today.AddHours(Convert.ToInt16(valori[9])).AddMinutes(Convert.ToInt16(valori[10])).AddSeconds(Convert.ToInt16(valori[11]));
// se ore == 0 --> aggiungo 1 gg!!!
if (Convert.ToInt16(valori[9]) == 0) stop.AddDays(1);
tEff = new TimeSpan(Convert.ToInt16(valori[12]), Convert.ToInt16(valori[13]), Convert.ToInt16(valori[14]));
tTot = new TimeSpan(Convert.ToInt16(valori[15]), Convert.ToInt16(valori[16]), Convert.ToInt16(valori[17]));
qta = Convert.ToInt16(valori[18]);
tMed = new TimeSpan(Convert.ToInt16(valori[19]), Convert.ToInt16(valori[20]), Convert.ToInt16(valori[22]), Convert.ToInt16(valori[23]));
}
catch
{ }
}
}
/// <summary>
/// Allarme (per decodifica)
/// </summary>
public class allarme
{
public string codNum;
public string gruppo;
public string livello;
public string descrizione;
public allarme()
{
codNum = "";
gruppo = "";
livello = "";
descrizione = "";
}
public allarme(string _codNum, string _gruppo, string _livello, string _descrizione)
{
codNum = _codNum;
gruppo = _gruppo;
livello = _livello;
descrizione = _descrizione;
}
}
/// <summary>
/// Dato generico (per decodifica)
/// </summary>
public class otherData
{
public string codNum;
public string memAddr;
public string varName;
public string dataType;
public otherData()
{
codNum = "";
memAddr = "";
varName = "";
dataType = "";
}
public otherData(string _codNum, string _memAddr, string _varName, string _dataType)
{
codNum = _codNum;
memAddr = _memAddr;
varName = _varName;
dataType = _dataType;
}
}
/// <summary>
/// Strobe: contiene il set di strobe di comunicazione
///
/// rif: http://stackoverflow.com/questions/17209054/parse-bits-in-a-byte-to-enum
/// </summary>
[Flags]
public enum Strobe : int
{
NONE = 0,
M_CODE = 1 << 0,
S_CODE = 1 << 1,
T_CODE = 1 << 2,
PZ_OK = 1 << 3,
PZ_KO = 1 << 4,
FEED_SPEED = 1 << 5,
POS_ACT = 1 << 6,
SP07 = 1 << 7,
SP08 = 1 << 8,
SP09 = 1 << 9,
SP10 = 1 << 10,
SP11 = 1 << 11,
SP12 = 1 << 12,
SP13 = 1 << 13,
SP14 = 1 << 14,
SP15 = 1 << 15,
SP16 = 1 << 16,
SP17 = 1 << 17,
SP18 = 1 << 18,
SP19 = 1 << 19,
SP20 = 1 << 20,
SP21 = 1 << 21,
SP22 = 1 << 22,
SP23 = 1 << 23,
SP24 = 1 << 24,
SP25 = 1 << 25,
SP26 = 1 << 26,
SP27 = 1 << 27,
SP28 = 1 << 28,
SP29 = 1 << 29,
SP30 = 1 << 30,
SP31 = 1 << 31
}
/// <summary>
/// StFlag8: set di 8 bit (1 word) contente semaforo di variabili
/// </summary>
[Flags]
public enum StFlag8 : int
{
NONE = 0,
B0 = 1 << 0,
B1 = 1 << 1,
B2 = 1 << 2,
B3 = 1 << 3,
B4 = 1 << 4,
B5 = 1 << 5,
B6 = 1 << 6,
B7 = 1 << 7
}
/// <summary>
/// StFlag32: set di 32 bit (4 word) contente semaforo di variabili
/// </summary>
[Flags]
public enum StFlag32 : int
{
NONE = 0,
B00 = 1 << 0,
B01 = 1 << 1,
B02 = 1 << 2,
B03 = 1 << 3,
B04 = 1 << 4,
B05 = 1 << 5,
B06 = 1 << 6,
B07 = 1 << 7,
B08 = 1 << 8,
B09 = 1 << 9,
B10 = 1 << 10,
B11 = 1 << 11,
B12 = 1 << 12,
B13 = 1 << 13,
B14 = 1 << 14,
B15 = 1 << 15,
B16 = 1 << 16,
B17 = 1 << 17,
B18 = 1 << 18,
B19 = 1 << 19,
B20 = 1 << 20,
B21 = 1 << 21,
B22 = 1 << 22,
B23 = 1 << 23,
B24 = 1 << 24,
B25 = 1 << 25,
B26 = 1 << 26,
B27 = 1 << 27,
B28 = 1 << 28,
B29 = 1 << 29,
B30 = 1 << 30,
B31 = 1 << 31
}
/// <summary>
/// StatusBitMap: contiene il set di semafori/flag x status + allarmi (x classi)
/// </summary>
[Flags]
public enum StatusBitMap : int
{
NONE = 0,
ESTOP = 1 << 0,
RM_AUTO = 1 << 1,
RM_MANUAL = 1 << 2,
RM_MDI = 1 << 3,
RM_EDIT = 1 << 4,
EM_RUN = 1 << 5,
EM_READY = 1 << 6,
EM_STOP = 1 << 7,
EM_FEEDHOLD = 1 << 8,
HM = 1 << 9,
ST11 = 1 << 10,
ST12 = 1 << 11,
ST13 = 1 << 12,
ST14 = 1 << 13,
ST15 = 1 << 14,
ST16 = 1 << 15,
AL01 = 1 << 16,
AL02 = 1 << 17,
AL03 = 1 << 18,
AL04 = 1 << 19,
AL05 = 1 << 20,
AL06 = 1 << 21,
AL07 = 1 << 22,
AL08 = 1 << 23,
AL09 = 1 << 24,
AL10 = 1 << 25,
AL11 = 1 << 26,
AL12 = 1 << 27,
AL13 = 1 << 28,
AL14 = 1 << 29,
AL15 = 1 << 30,
AL16 = 1 << 31
}
}
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.4.4" targetFramework="net452" />
<package id="NLog.Config" version="4.4.4" targetFramework="net452" />
<package id="NLog.Schema" version="4.4.4" targetFramework="net452" />
</packages>
+43
View File
@@ -21,12 +21,17 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersGen", "VersGen\VersGen.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCMCncLib", "SCMCncLib\SCMCncLib.csproj", "{7A12FE26-9C58-4630-973D-D4872374DBAF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTC-ADB", "MTC-ADB\MTC-ADB.csproj", "{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTC", "MTC\MTC.csproj", "{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
CMS-FANUC|Any CPU = CMS-FANUC|Any CPU
CMS-OSAI|Any CPU = CMS-OSAI|Any CPU
CMS-SIEMENS|Any CPU = CMS-SIEMENS|Any CPU
Debug|Any CPU = Debug|Any CPU
MySql|Any CPU = MySql|Any CPU
Release|Any CPU = Release|Any CPU
SCM-ESA|Any CPU = SCM-ESA|Any CPU
EndGlobalSection
@@ -38,6 +43,8 @@ Global
{D8D08DBE-B511-4DE0-B5A9-563EBFC60C4F}.CMS-SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
{D8D08DBE-B511-4DE0-B5A9-563EBFC60C4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D8D08DBE-B511-4DE0-B5A9-563EBFC60C4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D8D08DBE-B511-4DE0-B5A9-563EBFC60C4F}.MySql|Any CPU.ActiveCfg = Release|Any CPU
{D8D08DBE-B511-4DE0-B5A9-563EBFC60C4F}.MySql|Any CPU.Build.0 = Release|Any CPU
{D8D08DBE-B511-4DE0-B5A9-563EBFC60C4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D8D08DBE-B511-4DE0-B5A9-563EBFC60C4F}.Release|Any CPU.Build.0 = Release|Any CPU
{D8D08DBE-B511-4DE0-B5A9-563EBFC60C4F}.SCM-ESA|Any CPU.ActiveCfg = Release|Any CPU
@@ -50,6 +57,8 @@ Global
{2D769FFD-1122-4276-A115-29246E6D23C5}.CMS-SIEMENS|Any CPU.Build.0 = Release|Any CPU
{2D769FFD-1122-4276-A115-29246E6D23C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D769FFD-1122-4276-A115-29246E6D23C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D769FFD-1122-4276-A115-29246E6D23C5}.MySql|Any CPU.ActiveCfg = Release|Any CPU
{2D769FFD-1122-4276-A115-29246E6D23C5}.MySql|Any CPU.Build.0 = Release|Any CPU
{2D769FFD-1122-4276-A115-29246E6D23C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D769FFD-1122-4276-A115-29246E6D23C5}.Release|Any CPU.Build.0 = Release|Any CPU
{2D769FFD-1122-4276-A115-29246E6D23C5}.SCM-ESA|Any CPU.ActiveCfg = Release|Any CPU
@@ -62,6 +71,8 @@ Global
{736DF121-11E6-4D46-835D-6560ACF241E4}.CMS-SIEMENS|Any CPU.Build.0 = CMS-SIEMENS|Any CPU
{736DF121-11E6-4D46-835D-6560ACF241E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{736DF121-11E6-4D46-835D-6560ACF241E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{736DF121-11E6-4D46-835D-6560ACF241E4}.MySql|Any CPU.ActiveCfg = Release|Any CPU
{736DF121-11E6-4D46-835D-6560ACF241E4}.MySql|Any CPU.Build.0 = Release|Any CPU
{736DF121-11E6-4D46-835D-6560ACF241E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{736DF121-11E6-4D46-835D-6560ACF241E4}.Release|Any CPU.Build.0 = Release|Any CPU
{736DF121-11E6-4D46-835D-6560ACF241E4}.SCM-ESA|Any CPU.ActiveCfg = SCM-ESA|Any CPU
@@ -74,6 +85,8 @@ Global
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.CMS-SIEMENS|Any CPU.Build.0 = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.MySql|Any CPU.ActiveCfg = Release|Any CPU
{58E399F3-9D4E-49D3-AB35-9ED536543D50}.MySql|Any CPU.Build.0 = Release|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}.SCM-ESA|Any CPU.ActiveCfg = Release|Any CPU
@@ -86,10 +99,40 @@ Global
{7A12FE26-9C58-4630-973D-D4872374DBAF}.CMS-SIEMENS|Any CPU.Build.0 = Release|Any CPU
{7A12FE26-9C58-4630-973D-D4872374DBAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A12FE26-9C58-4630-973D-D4872374DBAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A12FE26-9C58-4630-973D-D4872374DBAF}.MySql|Any CPU.ActiveCfg = Release|Any CPU
{7A12FE26-9C58-4630-973D-D4872374DBAF}.MySql|Any CPU.Build.0 = Release|Any CPU
{7A12FE26-9C58-4630-973D-D4872374DBAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A12FE26-9C58-4630-973D-D4872374DBAF}.Release|Any CPU.Build.0 = Release|Any CPU
{7A12FE26-9C58-4630-973D-D4872374DBAF}.SCM-ESA|Any CPU.ActiveCfg = Release|Any CPU
{7A12FE26-9C58-4630-973D-D4872374DBAF}.SCM-ESA|Any CPU.Build.0 = Release|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.CMS-FANUC|Any CPU.ActiveCfg = Release|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.CMS-FANUC|Any CPU.Build.0 = Release|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.CMS-OSAI|Any CPU.ActiveCfg = Release|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.CMS-OSAI|Any CPU.Build.0 = Release|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.CMS-SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.CMS-SIEMENS|Any CPU.Build.0 = Release|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.MySql|Any CPU.ActiveCfg = MySql|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.MySql|Any CPU.Build.0 = MySql|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.Release|Any CPU.Build.0 = Release|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.SCM-ESA|Any CPU.ActiveCfg = Release|Any CPU
{DF877E5E-8D04-4532-BA01-CEFD8636D4DA}.SCM-ESA|Any CPU.Build.0 = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.CMS-FANUC|Any CPU.ActiveCfg = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.CMS-FANUC|Any CPU.Build.0 = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.CMS-OSAI|Any CPU.ActiveCfg = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.CMS-OSAI|Any CPU.Build.0 = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.CMS-SIEMENS|Any CPU.ActiveCfg = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.CMS-SIEMENS|Any CPU.Build.0 = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.MySql|Any CPU.ActiveCfg = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.MySql|Any CPU.Build.0 = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.Release|Any CPU.Build.0 = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.SCM-ESA|Any CPU.ActiveCfg = Release|Any CPU
{EC83D80E-9F3B-4DE9-B16A-CA216543B7EC}.SCM-ESA|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+2 -1
View File
@@ -1,4 +1,5 @@
using System;
using MTC;
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml;
+2 -1
View File
@@ -1,4 +1,5 @@
using MTConnect;
using MTC;
using MTConnect;
using System;
namespace MTC_Adapter
+25 -7
View File
@@ -2,10 +2,9 @@
using System.Linq;
using System.Text;
using SCMCncLib;
using System.Windows.Forms;
using System.Threading;
using System.IO;
using System.Collections.Generic;
using MTC;
namespace MTC_Adapter
{
@@ -279,6 +278,8 @@ namespace MTC_Adapter
string status = "";
string pathExeMode = "";
string pathRunMode = "";
int progAreaSel = 0;
string currProgName = "";
bool isFeedHold = false;
bool isActive = false;
bool isReady = false;
@@ -444,8 +445,23 @@ namespace MTC_Adapter
// FARE!!!
}
}
else if (mapIOT_Byte[i].varName.StartsWith("IOT_EXEC_A_"))
{
// salvo SOLO SE ha bit = 1..
if (((StFlag8)currByte).HasFlag((StFlag8)Math.Pow(2, bitNum)))
{
// salvo area selezionata!
progAreaSel = bitNum + 1;
currProgName = vettMemArea[bitNum].mMemAreaProgName.Value.ToString();
}
}
}
}
// salvo progAreaSel e currProgName...
vettPath[idxPath].mPathCurrArea.Value = progAreaSel;
vettPath[idxPath].mPathCurrProg.Value = currProgName;
// imposto exe mode alla fine secondo gerarchia stati...
if (isFeedHold)
{
@@ -802,7 +818,7 @@ namespace MTC_Adapter
{
try
{
valString += Convert.ToChar(ncDevice.PLC_MemoryAreaIOT_String[j,i]).ToString().Replace("\0", " ");
valString += Convert.ToChar(ncDevice.PLC_MemoryAreaIOT_String[j, i]).ToString().Replace("\0", " ");
}
catch (Exception exc)
{
@@ -811,6 +827,8 @@ namespace MTC_Adapter
}
// trimmo!
valString = valString.Trim();
// salvo
vettMemArea[j].mMemAreaProgName.Value = valString;
// aggiungo feedrate
sb.AppendLine(string.Format("{0}: {1}", mapIOT_String[j].varName, valString));
}
@@ -819,7 +837,7 @@ namespace MTC_Adapter
}
public override void getGlobalData()
{
base.getGlobalData();
base.getGlobalData();
}
/// <summary>
@@ -830,18 +848,18 @@ namespace MTC_Adapter
// inizializzo data monitor su FORM
parentForm.dataMonitor = "";
// recupero le varie memorie
// recupero le varie memorie (prima string che mi serve x area selezionata --> programma selezionato)
getIotMem_String();
getIotMem_Byte();
getIotMem_Word();
getIotMem_DWord();
getIotMem_String();
// processo componenti specifici x info...
getUnOp();
getPath();
getAxis();
}
/// <summary>
/// Recupera la speed override x i mandrini (UnOp)
/// </summary>
+1
View File
@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using CMSCncLib.CNC;
using System.IO;
using MTC;
namespace MTC_Adapter
{
+11 -5
View File
@@ -7,6 +7,7 @@ using NLog;
namespace MTC_Adapter
{
using MTC;
using MTConnect;
using System.Configuration;
using System.Diagnostics;
@@ -227,6 +228,10 @@ namespace MTC_Adapter
/// </summary>
public Event mPathCurrProg;
/// <summary>
/// Area Programma corrente/selezionata
/// </summary>
public Event mPathCurrArea;
/// <summary>
/// num riga corrente
/// </summary>
public Event mPathCurrProgRowNum;
@@ -314,6 +319,7 @@ namespace MTC_Adapter
mPathRunMode = new Event(string.Format("{0}_RUN_MODE", ident));
mPathExeMode = new Event(string.Format("{0}_EXE_MODE", ident));
mPathCurrProg = new Event(string.Format("{0}_CurrProg", ident));
mPathCurrArea = new Event(string.Format("{0}_CurrArea", ident));
mPathCurrProgRowNum = new Event(string.Format("{0}_CurrProg_RowNum", ident));
mPathActiveAxes = new Event(string.Format("{0}_ActiveAxes", ident));
mPathCodG_Act = new MTConnect.Message(string.Format("{0}_CodG_Act", ident));
@@ -1063,6 +1069,7 @@ namespace MTC_Adapter
mAdapter.AddDataItem(vettPath[i].mPathRunMode);
mAdapter.AddDataItem(vettPath[i].mPathExeMode);
mAdapter.AddDataItem(vettPath[i].mPathCurrProg);
mAdapter.AddDataItem(vettPath[i].mPathCurrArea);
mAdapter.AddDataItem(vettPath[i].mPathCurrProgRowNum);
mAdapter.AddDataItem(vettPath[i].mPathActiveAxes);
mAdapter.AddDataItem(vettPath[i].mPathCodG_Act);
@@ -1223,7 +1230,7 @@ namespace MTC_Adapter
datiProdSCM answ = null;
if (valori.Length == 23)
{
answ = new MTC_Adapter.datiProdSCM(valori);
answ = new datiProdSCM(valori);
}
return answ;
}
@@ -1590,7 +1597,7 @@ namespace MTC_Adapter
catch (Exception exc)
{
// segnalo eccezione e indico disconnesso...
lg.Error(exc, "Errore in gestione ciclo principale ADP, fermo adapter");
lg.Error(exc, string.Format("Errore in gestione ciclo principale ADP, fermo adapter{0}{1}", Environment.NewLine, exc));
parentForm.fermaAdapter(true);
}
// tolgo flag running
@@ -1621,8 +1628,7 @@ namespace MTC_Adapter
// provo a riconnettere SE abilitato tryRestart...
if (adpTryRestart && !connectionOk)
{
//// aspetto un tempo di wait adatto
//Thread.Sleep(utils.CRI("waitRecMSec"));
lg.Info("ConnKO - tryConnect");
tryConnect();
}
}
@@ -2078,7 +2084,7 @@ namespace MTC_Adapter
return needSave;
}
/// <summary>
/// Processing del program nme
/// Processing del program name
/// </summary>
/// <param name="needSave"></param>
/// <returns></returns>
+8 -27
View File
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CMSCncLib.CNC;
using System.IO;
using MTC;
namespace MTC_Adapter
{
@@ -400,15 +400,15 @@ namespace MTC_Adapter
// check COD_M
bitNum = 0;
gestStrobeCodMST(bitNum, ref currACK_DW, 0, MemBlock, "M");
gestStrobeCodMST(currStrobe, bitNum, ref currACK_DW, 0, MemBlock, "M");
// check COD_S
bitNum = 1;
gestStrobeCodMST(bitNum, ref currACK_DW, 11, MemBlock, "S");
gestStrobeCodMST(currStrobe, bitNum, ref currACK_DW, 11, MemBlock, "S");
// check COD_T
bitNum = 2;
gestStrobeCodMST(bitNum, ref currACK_DW, 17, MemBlock, "T");
gestStrobeCodMST(currStrobe, bitNum, ref currACK_DW, 17, MemBlock, "T");
}
@@ -575,19 +575,19 @@ namespace MTC_Adapter
/// <summary>
/// Gestione STROBE --> ACK per codici M/S/T
/// </summary>
/// <param name="currStrobe">byte di strobe corrente</param>
/// <param name="bitNum">0/1/2</param>
/// <param name="retACK_DW1">vettore da restituire di ACK</param>
/// <param name="memShift">shift memoria x buffer dati da leggere</param>
/// <param name="MemBlock">Vettore completo dei valori + buffer code M/S/T</param>
/// <param name="Coda">Quale coda: M/S/T</param>
private void gestStrobeCodMST(int bitNum, ref byte[] retACK_DW1, int memShift, byte[] MemBlock, string Coda)
private void gestStrobeCodMST(StFlag8 currStrobe, int bitNum, ref byte[] retACK_DW1, int memShift, byte[] MemBlock, string Coda)
{
int numEv = 0;
int codEv = 0;
#if false
if (STRB_DW1.HasFlag((StFlag32)Math.Pow(2, bitNum)))
if (currStrobe.HasFlag((StFlag8)Math.Pow(2, bitNum)))
{
// verifico sia > 0 il numero di valori da leggere indice 0 sull'area...
// verifico sia > 0 il numero di valori da leggere - indice 0 sull'area...
numEv = BitConverter.ToUInt16(MemBlock, 2 * memShift);
if (numEv > 0)
{
@@ -603,7 +603,6 @@ namespace MTC_Adapter
// memorizzo allarme nel vettore ack....
retACK_DW1 = utils.setBitOnStFlag(retACK_DW1, true, bitNum);
}
#endif
}
/// <summary>
/// Ricarica dati da file di scambio con CMSConnect
@@ -791,21 +790,6 @@ namespace MTC_Adapter
inizio = DateTime.Now;
OsaiMemRW_DWord(R, OSAI.MemTypeWord.MW_CODE, memIndex + i * 2, ref MemBlock);
if (utils.CRB("recTime")) TimingData.addResult(string.Format("R{0}-STRB_DW0", MemBlock.Length * 4), DateTime.Now.Subtract(inizio).Ticks);
#if false
// da testare metodo copia alternativo !!!FARE!!!
if (true)
{
// aggiorno nel vettore allarmi i byte interessati
for (int j = 0; j < 4; j++)
{
// copy array o byte?!? !!!FARE!!! verifica
AlarmFlags[i * 4 + j] = MemBlock[j];
}
}
else
{
#endif
try
{
// aggiorno vettore allarmi x intero!
@@ -815,9 +799,6 @@ namespace MTC_Adapter
{
lg.Error(string.Format("Errore in BLOCKCOPY per indice i = {2},{0}{1}", Environment.NewLine, exc, i));
}
#if false
}
#endif
// segnalo allarme letto! memorizzo allarme nel vettore ack....
retACK_DW0 = utils.setBitOnStFlag(retACK_DW0, true, i);
+1 -3
View File
@@ -2,11 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CMSCncLib.CNC;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.IO;
using MTC;
namespace MTC_Adapter
{
+2 -2
View File
@@ -65,9 +65,9 @@
<add key="SubModeListFilePath" value="SubModeList.map"/>
<!--conf gestione "semplificata" accesso a tutta la memoria ogni volta-->
<!--conf x CMS-->
<add key="procIotMem" value="false"/>
<!--<add key="procIotMem" value="false"/>-->
<!--conf x ESA-KVARA-->
<!--<add key="procIotMem" value="true"/>-->
<add key="procIotMem" value="true"/>
<!--file configurazione IotMem (ESA KVARA)-->
<add key="IOTByteFilePath" value="IOT_ByteList.map"/>
<add key="IOTWordFilePath" value="IOT_WordList.map"/>
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<AdapterConf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Version>1</Version>
<NomeAdapt>ADAPTER_OSAI</NomeAdapt>
<TipoAdapt>OSAI</TipoAdapt>
<NomeAdapt>ADAPTER_ESAGV</NomeAdapt>
<TipoAdapt>ESAGV</TipoAdapt>
<ContOreMaccOn>0</ContOreMaccOn>
<ContOreMaccLav>0</ContOreMaccLav>
<VacuumPump>
@@ -24,6 +24,14 @@
<ident>VacAct_02</ident>
<dataRefList />
</element>
<element>
<ident>VacAct_03</ident>
<dataRefList />
</element>
<element>
<ident>VacAct_04</ident>
<dataRefList />
</element>
</VacuumAct>
<Lubro>
<element>
@@ -70,16 +78,40 @@
<ident>Path_01</ident>
<dataRefList />
</element>
<element>
<ident>Path_02</ident>
<dataRefList />
</element>
</Path>
<UnOp>
<element>
<ident>UnOp_01</ident>
<dataRefList />
</element>
<element>
<ident>UnOp_02</ident>
<dataRefList />
</element>
<element>
<ident>UnOp_03</ident>
<dataRefList />
</element>
<element>
<ident>UnOp_04</ident>
<dataRefList />
</element>
<element>
<ident>UnOp_05</ident>
<dataRefList />
</element>
<element>
<ident>UnOp_06</ident>
<dataRefList />
</element>
<element>
<ident>UnOp_07</ident>
<dataRefList />
</element>
<element>
<ident>UnOp_08</ident>
<dataRefList />
</element>
</UnOp>
<Axis>
<element>
@@ -136,5 +168,104 @@
</dataRef>
</dataRefList>
</element>
<element>
<ident>Axis_07</ident>
<dataRefList>
<dataRef>
<Key>Axis_07_Type</Key>
<Value>LINEAR</Value>
</dataRef>
</dataRefList>
</element>
<element>
<ident>Axis_08</ident>
<dataRefList>
<dataRef>
<Key>Axis_08_Type</Key>
<Value>LINEAR</Value>
</dataRef>
</dataRefList>
</element>
<element>
<ident>Axis_09</ident>
<dataRefList>
<dataRef>
<Key>Axis_09_Type</Key>
<Value>LINEAR</Value>
</dataRef>
</dataRefList>
</element>
<element>
<ident>Axis_10</ident>
<dataRefList>
<dataRef>
<Key>Axis_10_Type</Key>
<Value>LINEAR</Value>
</dataRef>
</dataRefList>
</element>
<element>
<ident>Axis_11</ident>
<dataRefList>
<dataRef>
<Key>Axis_11_Type</Key>
<Value>LINEAR</Value>
</dataRef>
</dataRefList>
</element>
<element>
<ident>Axis_12</ident>
<dataRefList>
<dataRef>
<Key>Axis_12_Type</Key>
<Value>LINEAR</Value>
</dataRef>
</dataRefList>
</element>
<element>
<ident>Axis_13</ident>
<dataRefList>
<dataRef>
<Key>Axis_13_Type</Key>
<Value>LINEAR</Value>
</dataRef>
</dataRefList>
</element>
<element>
<ident>Axis_14</ident>
<dataRefList>
<dataRef>
<Key>Axis_14_Type</Key>
<Value>LINEAR</Value>
</dataRef>
</dataRefList>
</element>
<element>
<ident>Axis_15</ident>
<dataRefList>
<dataRef>
<Key>Axis_15_Type</Key>
<Value>LINEAR</Value>
</dataRef>
</dataRefList>
</element>
</Axis>
<MemArea>
<element>
<ident>MemArea_01</ident>
<dataRefList />
</element>
<element>
<ident>MemArea_02</ident>
<dataRefList />
</element>
<element>
<ident>MemArea_03</ident>
<dataRefList />
</element>
<element>
<ident>MemArea_04</ident>
<dataRefList />
</element>
</MemArea>
</AdapterConf>
+425 -1
View File
@@ -1,3 +1,4 @@
<<<<<<< HEAD
"# Commenti con ""#"", elenco tipo COD_NUM|GRUPPO|LEVEL|DESCRIZIONE completa
000001|PLC|FAULT|[COD 001] - 152 AXIS X DRIVING GEAR NOT READY
000002|PLC|FAULT|[COD 002] - 152 AXIS Y DRIVING GEAR NOT READY
@@ -500,4 +501,427 @@
000499|PLC|FAULT|[COD 499] - 551 WAITING INPUT BULKHEAD CLOSE
000500|PLC|FAULT|[COD 500] - 551 WAITING OUTPUT BULKHEAD OPEN
000501|PLC|FAULT|[COD 501] - 551 WAITING OUTPUT BULKHEAD CLOSE
000502|PLC|FAULT|[COD 502] - 550 WAITING POPUP IN POSITION
000502|PLC|FAULT|[COD 502] - 550 WAITING POPUP IN POSITION
=======
# Commenti con "#", elenco tipo COD_NUM|GRUPPO|LEVEL|DESCRIZIONE completa
000001|PLC|FAULT|[1] MANDRINO 1 NON BLOCCATO
000002|PLC|FAULT|[2] MANDRINO 2 NON BLOCCATO
000003|PLC|FAULT|[3] MANDRINO SUPPLEMENTARE NON BLOCCATO
000004|PLC|FAULT|[4] ZONA DI COLLISIONE CON CAMBIO UTENSILE ESTERNO
000005|PLC|FAULT|[5] ZONA DI COLLISIONE CON CAMBIO UTENSILE LINEARE
000006|PLC|FAULT|[6] GRUPPO ASSI NON VALIDO
000007|PLC|FAULT|[7] INVERTER 1 NON OK
000008|PLC|FAULT|[8] INVERTER 2 NON OK
000009|PLC|FAULT|[9] INVERTER MANDRINO SUPPLEMENTARE NON OK
0000010|PLC|FAULT|[10] SAVE ENERGY ATTIVO
0000011|PLC|FAULT|[11] B,[WD] SUPERATO NUMERO PEZZI MASSIMO CARICABILE SU TRANSFER
0000012|PLC|FAULT|[12] VERIFICA CONTATTORI NON OK
0000013|PLC|FAULT|[13] TIMEOUT COMUNICAZIONE XILOG
0000014|PLC|WARNING|[14] INTERVENTO MAGNETOTERMICI
0000015|PLC|FAULT|[15] PORTE PROTEZIONE APERTE
0000016|PLC|FAULT|[16] TAPPETO CONVOGLIA TRUCIOLI NON IN POSIZIONE
0000017|PLC|FAULT|[17] COLLISIONE RILEVATA DAL SIMULATORE
0000018|PLC|FAULT|[18] BUMPER MOBILE NON IN POSIZIONE
0000019|PLC|FAULT|[19] FORATRICE NON IN POSIZIONE
0000020|PLC|WARNING|[20] STOP MACCHINA DA CODICI M SUPPLEMENTARI
0000021|PLC|WARNING|[21] M00 ATTIVO: START CICLO
0000022|PLC|WARNING|[22] BATTERIA SCARICA ENCODER ASSI YASKAWA
0000023|PLC|FAULT|[23] AZIONAMENTI ASSI XYZ... NON OK
0000024|PLC|FAULT|[24] AZIONAMENTI ASSI ROTATIVI NON OK
0000025|PLC|FAULT|[25] CNC NON OK
0000026|PLC|FAULT|[26] PRESSOSTATO ARIA INTERVENUTO
0000027|PLC|FAULT|[27] BATTERIA CNC NON CARICA
0000028|PLC|FAULT|[28] ERRORE CANOPEN RING 0
0000029|PLC|FAULT|[29] ERRORE CANOPEN RING 1
0000030|PLC|WARNING|[30] ABILITAZIONE BL/SBL UTENSILE MANDRINO 1
0000031|PLC|WARNING|[31] ABILITAZIONE BL/SBL UTENSILE MANDRINO 2
0000032|PLC|WARNING|[32] ABILITAZIONE BL/SBL UTENSILE MANDRINO SUPPLEMENTARE
0000033|PLC|WARNING|[33] CICLO ETICHETTATURA IN CORSO
0000034|PLC|FAULT|[34] ETICHETTATRICE NON PRONTA
0000035|PLC|FAULT|[35] ETICHETTATRICE NON IN POSIZIONE
0000036|PLC|FAULT|[36] ERRORE ETICHETTATRICE
0000037|PLC|FAULT|[37] SONDA TERMICA/VENTOLA MANDRINO 1
0000038|PLC|FAULT|[38] SONDA TERMICA/VENTOLA MANDRINO 2
0000039|PLC|FAULT|[39] SONDA TERMICA/VENTOLA MANDRINO SUPPLEMENTARE
0000040|PLC|FAULT|[40] INTERVENTO MAGNETOTERMICO GRUPPO LAMA
0000041|PLC|FAULT|[41] RICARICARE POMPA LUBRIFICAZIONE
0000042|PLC|FAULT|[42] LUBRIFICAZIONE ASSI NON OK
0000043|PLC|WARNING|[43] LUBRIFICAZIONE ASSI IN CORSO
0000044|PLC|WARNING|[44] RICHIESTA VUOTO/ATTREZZATURA
0000045|PLC|FAULT|[45] EMERGENZA CAUSA VUOTO ZONA 1
0000046|PLC|FAULT|[46] EMERGENZA CAUSA VUOTO ZONA 2
0000047|PLC|FAULT|[47] ASSI IN FINE CORSA
0000048|PLC|FAULT|[48] CUFFIA ESTERNA NON IN POSIZIONE
0000049|PLC|FAULT|[49] CUFFIA INTERNA NON IN POSIZIONE
0000050|PLC|FAULT|[50] CUFFIA PULIZIA PIANO NON IN POSIZIONE
0000051|PLC|FAULT|[51] EMERGENZA CAUSA VUOTO ZONA 3
0000052|PLC|FAULT|[52] EMERGENZA CAUSA VUOTO ZONA 4
0000053|PLC|WARNING|[53] ESEGUIRE RIFERIMENTO ASSI
0000054|PLC|FAULT|[54] ESEGUIRE RIFERIMENTO MAGAZZINO UTENSILE 1
0000055|PLC|FAULT|[55] ESEGUIRE RIFERIMENTO MAGAZZINO UTENSILE 2
0000056|PLC|FAULT|[56] ESEGUIRE RIFERIMENTO MAGAZZINO UTENSILE MANDRINO SUPPLEMENTARE
0000057|PLC|FAULT|[57] ESEGUIRE RIFERIMENTO MAGAZZINO ESTERNO 1
0000058|PLC|FAULT|[58] ESEGUIRE RIFERIMENTO NAVETTA HS
0000059|PLC|FAULT|[59] ESEGUIRE RIFERIMENTO PINZE ROBOT CELLA WD
0000060|PLC|FAULT|[60] CONVOGLIATORE TRUCIOLI NON OK
0000061|PLC|WARNING|[61] SERBATOIO LUBRIFICAZIONE CONVOGLIATORE TRUCIOLI VUOTO
0000062|PLC|FAULT|[62] ASSE X IN FINE CORSA
0000063|PLC|FAULT|[63] ASSE Y IN FINE CORSA
0000064|PLC|FAULT|[64] ASSE Z IN FINE CORSA
0000065|PLC|FAULT|[65] PALPATORE SYNCRO NON IN POSIZIONE
0000066|PLC|WARNING|[66] ALLINEAMENTO ASSI GANTRY IN CORSO
0000067|PLC|FAULT|[67] ASSE B IN FINE CORSA
0000068|PLC|FAULT|[68] ASSE C IN FINE CORSA
0000069|PLC|FAULT|[69] ASSE Y NON IN POSIZIONE
0000070|PLC|FAULT|[70] ESEGUIRE RIFERIMENTO PALPATORE SYNCRO
0000071|PLC|FAULT|[71] PERNO BLOCCAGGIO TAVOLO ELEVATORE NON IN POSIZIONE
0000072|PLC|FAULT|[72] FOTOCELLULA PRESENZA UTENSILE
0000073|PLC|FAULT|[73] MANDRINO 1 NON OK
0000074|PLC|FAULT|[74] MANDRINO 2 NON OK
0000075|PLC|FAULT|[75] MANDRINO SUPPLEMENTARE NON OK
0000076|PLC|FAULT|[76] FOTOCELLULA PRESENZA UTENSILE (CATENA)
0000077|PLC|FAULT|[77] ALLARME SENSORE ROTAZIONE MANDRINO 1
0000078|PLC|FAULT|[78] ALLARME SENSORE ROTAZIONE MANDRINO 2
0000079|PLC|FAULT|[79] ALLARME SENSORE ROTAZIONE MANDRINO SUPPLEMENTARE
0000080|PLC|FAULT|[80] CAMBIO UTENSILE TESTA 1(ONBOARD) NON IN POSIZIONE
0000081|PLC|FAULT|[81] CAMBIO UTENSILE MANDRINO SUPPLEMENTARE (ONBOARD) NON IN POSIZIONE
0000082|PLC|FAULT|[82] CAMBIO UTENSILE LINEARE NON IN POSIZIONE
0000083|PLC|FAULT|[83] CAMBIO UTENSILE HS NON IN POSIZIONE
0000084|PLC|FAULT|[84] [TM] NAVETTA TOOL MANAGEMENT NON IN POSIZIONE
0000085|PLC|FAULT|[85] [TM] LETTORE CHIP TOOL MANAGMENT NON IN POSIZIONE
0000086|PLC|FAULT|[86] [TM] LIBERARE PINZA DI CARICO TOOL MANAGMENT
0000087|PLC|FAULT|[87] [TM] COLLISIONE CON TOOL MANAGMENT
0000088|PLC|FAULT|[88] [TM] CARICARE UTENSILE SULLA PINZA DI CARICO DEL TOOL MANAGMENT
0000089|PLC|FAULT|[89] BANDELLA NON IN POSIZIONE
0000090|PLC|FAULT|[90] PANNELLO PRELEVATO FUORI ALLINEAMENTO
0000091|PLC|FAULT|[91] SCARICATORE NON IN POSIZIONE
0000092|PLC|FAULT|[92] SPONDE/BATTUTE DI SCARICO NON IN POSIZIONE
0000093|PLC|FAULT|[93] ZONA DI SCARICO OCCUPATA
0000094|PLC|FAULT|[94] VERIFICARE DIMENSIONI PILA
0000095|PLC|FAULT|[95] CARICARE NUOVA PILA
0000096|PLC|FAULT|[96] CARICATORE NON IN POSIZIONE
0000097|PLC|FAULT|[97] TAVOLO ELEVATORE NON OK
0000098|PLC|FAULT|[98] PANNELLO NON PRELEVATO DA TAVOLO ELEVATORE
0000099|PLC|FAULT|[99] FOTOCELLULA RIFERIMENTO PANNELLO NON OK
0000100|PLC|FAULT|[100] ALLARME CELLA WD
0000101|PLC|FAULT|[101] REFRIGERANTE MANDRINO 1 NON OK
0000102|PLC|FAULT|[102] REFRIGERANTE MANDRINO 2 NON OK
0000103|PLC|FAULT|[103] INVERTER NASTRO DI SCARICO NON OK
0000104|PLC|FAULT|[104] ARRESTO OPERATIVO: RESETTARE LE FOTOCELLULE DI SICUREZZA
0000105|PLC|WARNING|[105] C.UTENSILE LINEARE IN CORSO: ABBASSARE GLI INNALZATORI E RESETTARE LE FOTOCELLULE DI SICUREZZA
0000106|PLC|FAULT|[106] CARICO PANNELLO NON AMMESSO
0000107|PLC|FAULT|[107] BYPASS COLLISIONI ATTIVO
0000108|PLC|FAULT|[108] SPORTELLO CAMBIO UTENSILE LINEARE DESTRO NON IN POSIZIONE
0000109|PLC|FAULT|[109] VERIFICA FUNZIONAMENTO SICUREZZE
0000110|PLC|FAULT|[110] RESETTARE LE FOTOCELLULE DI SICUREZZA
0000111|PLC|FAULT|[111] INSERIMENTO UTENSILE NON OK
0000112|PLC|FAULT|[112] GUASTO MICRO CONTROLLO PEDANE
0000113|PLC|FAULT|[113] INSERIMENTO UTENSILE IN NAVETTA HS NON OK
0000114|PLC|WARNING|[114] TABELLA NON AGGIORNATA
0000115|PLC|FAULT|[115] MANDRINO 1 NON SBLOCCATO
0000116|PLC|FAULT|[116] MANDRINO SUPPLEMENTARE NON SBLOCCATO
0000117|PLC|FAULT|[117] CONTROLLARE CICLO CHIUSURA BORDO
0000118|PLC|WARNING|[118] PM: SETUP NON POSSIBILE ZONA 3 [Vuoto ON/Teste DW]
0000119|PLC|WARNING|[119] PM: SETUP NON POSSIBILE ZONA 4 [Vuoto ON/Teste DW]
0000120|PLC|WARNING|[120] UTENSILE SPECIALE: OPERAZIONE NON AMMESSA
0000121|PLC|FAULT|[121] ERRORE CICLO CHIUSURA BORDO
0000122|PLC|FAULT|[122] MAGAZZINO UTENSILE ESTERNO 1 NON IN POSIZIONE
0000123|PLC|FAULT|[123] SPORTELLO MAGAZZINO ESTERNO NON IN POSIZIONE
0000124|PLC|WARNING|[124] ERRATA PROGRAMMAZIONE
0000125|PLC|WARNING|[125] ERRORE UTENSILE TESTA 1
0000126|PLC|WARNING|[126] ERRORE UTENSILE TESTA 2
0000127|PLC|FAULT|[127] SPORTELLO CAMBIO UTENSILE LINEARE SINISTRO NON IN POSIZIONE
0000128|PLC|FAULT|[128] TIME OUT PIGNA MOBILE
0000129|PLC|WARNING|[129] CAMBIO MODALITA' MACCHINA (M103)
0000130|PLC|FAULT|[130] PORTE ARMADIO ELETTRICO APERTE
0000131|PLC|WARNING|[131] ESEGUIRE MANUTENZIONE CONDIZIONATORE ARMADIO ELETTRICO
0000132|PLC|FAULT|[132] AGGREGATO PRESSATORE/CONVOGLIATORE TRUCIOLI NON OK
0000133|PLC|FAULT|[133] SERBATOIO LUBROREFRIGERATORE UTENSILE VUOTO
0000134|PLC|WARNING|[134] BATTERIA SCARICA TASTATORE RADIO
0000135|PLC|FAULT|[135] RILEVATORE SPESSORE PEZZO NON IN POSIZIONE
0000136|PLC|FAULT|[136] CICLO TASTATURA NON OK
0000137|PLC|FAULT|[137] BATTUTE DI RIFERIMENTO ZONA 1 NON OK
0000138|PLC|FAULT|[138] BATTUTE DI RIFERIMENTO ZONA 2 NON OK
0000139|PLC|FAULT|[139] ASSI PRISMA BC NON IN POSIZIONE
0000140|PLC|FAULT|[140] AZIONAMENTI ASSI PRISMA BC NON OK
0000141|PLC|FAULT|[141] TASTATORE RADIO NON OK
0000142|PLC|FAULT|[142] AVVICINATORI NON IN POSIZIONE
0000143|PLC|FAULT|[143] AVVICINAMENTO PANNELLO NON AVVENUTO
0000144|PLC|FAULT|[144] PRESA PANNELLO NON OK
0000145|PLC|WARNING|[145] RIAGGANCIO MANDRINO IN CORSO
0000146|PLC|WARNING|[146] RIAGGANCIO MANDRINO FALLITO
0000147|PLC|WARNING|[147] RIAGGANCIO MANDRINO AVVENUTO
0000148|PLC|FAULT|[148] INTERVENTO FUNE DI SICUREZZA
0000149|PLC|FAULT|[149] INTERVENTO OVERSPEED ASSI
0000150|PLC|FAULT|[150] INTERVENTO BUMPERS
0000151|PLC|WARNING|[151] MACCHINA SPENTA
0000152|PLC|FAULT|[152] EMERGENZA PREMUTA
0000153|PLC|WARNING|[153] PM: SETUP NON POSSIBILE ZONA 1 [VUOTO ON / TESTE DW]
0000154|PLC|WARNING|[154] PM: SETUP NON POSSIBILE ZONA 2 [VUOTO ON / TESTE DW]
0000155|PLC|WARNING|[155] BARRA MOBILE CENTRALE 1 NON IN POSIZIONE
0000156|PLC|WARNING|[156] BARRA MOBILE CENTRALE 2 NON IN POSIZIONE
0000157|PLC|WARNING|[157] PM: COLLISIONE BATTUTE CON SUPPORTI VENTOSE / MORSETTI
0000158|PLC|WARNING|[158] CUFFIA MANDRINO SUPPLEMENTARE NON IN POSIZIONE
0000159|PLC|WARNING|[159] TESTA GRUPPO MANDRINO SUPPLEMENTARE NON IN POSIZIONE
0000160|PLC|WARNING|[160] TESTA GRUPPO LAMA NON IN POSIZIONE
0000161|PLC|WARNING|[161] CICLO DI CARICO IN CORSO
0000162|PLC|WARNING|[162] CICLO DI SCARICO IN CORSO
0000163|PLC|WARNING|[163] BATTUTE DI CARICO NON IN POSIZIONE ZONA 1
0000164|PLC|WARNING|[164] ATTESA ROBOT IN POSIZIONE
0000165|PLC|WARNING|[165] INVERTER GUASTO POMPA VUOTO 1 (MASTER)
0000166|PLC|WARNING|[166] INVERTER GUASTO POMPA VUOTO 2 (SLAVE)
0000167|PLC|WARNING|[167] BATTUTE DI CARICO NON IN POSIZIONE ZONA 2
0000168|PLC|WARNING|[168] SALITA CUFFIA DA OPERATORE
0000169|PLC|WARNING|[169] TRAVERSA 1 NON IN POSIZIONE
0000170|PLC|WARNING|[170] TRAVERSA 2 NON IN POSIZIONE
0000171|PLC|WARNING|[171] TRAVERSA 3 NON IN POSIZIONE
0000172|PLC|WARNING|[172] TRAVERSA 4 NON IN POSIZIONE
0000173|PLC|WARNING|[173] TRAVERSA 5 NON IN POSIZIONE
0000174|PLC|WARNING|[174] TRAVERSA 6 NON IN POSIZIONE
0000175|PLC|WARNING|[175] TRAVERSA 7 NON IN POSIZIONE
0000176|PLC|WARNING|[176] TRAVERSA 8 NON IN POSIZIONE
0000177|PLC|WARNING|[177] TRAVERSA 9 NON IN POSIZIONE
0000178|PLC|WARNING|[178] TRAVERSA 10 NON IN POSIZIONE
0000179|PLC|WARNING|[179] TRAVERSA 11 NON IN POSIZIONE
0000180|PLC|WARNING|[180] TRAVERSA 12 NON IN POSIZIONE
0000181|PLC|WARNING|[181] SOSTITUZIONE VENTOSE IN CORSO AREA 1
0000182|PLC|WARNING|[182] SOSTITUZIONE VENTOSE IN CORSO AREA 2
0000183|PLC|FAULT|[183] BATTUTE DI RIFERIMENTO ZONA 3 NON OK
0000184|PLC|FAULT|[184] BATTUTE DI RIFERIMENTO ZONA 4 NON OK
0000185|PLC|FAULT|[185] [BRC] GR5: GRUPPO FUSI ORIZZONTALI NON IN POSIZIONE (fori spine)
0000186|PLC|FAULT|[186] [BRC] GR6: GRUPPO FRESA VERTICALE NON IN POSIZIONE
0000187|PLC|FAULT|[187] [BRC] GR7: GRUPPO FRESA ORIZZONTALE NON IN POSIZIONE
0000188|PLC|FAULT|[188] [BRC] GR8: GRUPPO LAMA NON IN POSIZIONE
0000189|PLC|FAULT|[189] [BRC] ATTESA INNESTO PER ROTAZIONE GRUPPO LAMA
0000190|PLC|FAULT|[190] SELETTORI CONTROSAGOMA NON OK [AREA UNICA]
0000191|PLC|FAULT|[191] BATTUTE DI RIFERIMENTO BARRA 1 NON OK
0000192|PLC|FAULT|[192] BATTUTE DI RIFERIMENTO BARRA 2 NON OK
0000193|PLC|FAULT|[193] BATTUTE DI RIFERIMENTO BARRA 3 NON OK
0000194|PLC|FAULT|[194] BATTUTE DI RIFERIMENTO BARRA 4 NON OK
0000195|PLC|FAULT|[195] BATTUTE DI RIFERIMENTO BARRA 5 NON OK
0000196|PLC|FAULT|[196] BATTUTE DI RIFERIMENTO BARRA 6 NON OK
0000197|PLC|FAULT|[197] BATTUTE DI RIFERIMENTO BARRA 7 NON OK
0000198|PLC|FAULT|[198] BATTUTE DI RIFERIMENTO BARRA 8 NON OK
0000199|PLC|FAULT|[199] BATTUTE DI RIFERIMENTO BARRA 9 NON OK
0000200|PLC|FAULT|[200] BATTUTE DI RIFERIMENTO BARRA 10 NON OK
0000201|PLC|FAULT|[201] BATTUTE DI RIFERIMENTO BARRA 11 NON OK
0000202|PLC|FAULT|[202] BATTUTE DI RIFERIMENTO BARRA 12 NON OK
0000203|PLC|FAULT|[203] BATTUTE DI RIFERIMENTO BARRA FISSA SX NON OK
0000204|PLC|FAULT|[204] BATTUTE DI RIFERIMENTO BARRA FISSA DX NON OK
0000205|PLC|FAULT|[205] BASI NON BLOCCATE ZONA 1
0000206|PLC|FAULT|[206] BASI NON BLOCCATE ZONA 2
0000207|PLC|FAULT|[207] BASI NON BLOCCATE ZONA 3
0000208|PLC|FAULT|[208] BASI NON BLOCCATE ZONA 4
0000209|PLC|WARNING|[209] SOSTITUZIONE VENTOSE IN CORSO AREA 3
0000210|PLC|WARNING|[210] SOSTITUZIONE VENTOSE IN CORSO AREA 4
0000211|PLC|FAULT|[211] [BORDATORE POWER] ATTESA GRUPPO A BORDARE ALTO
0000212|PLC|FAULT|[212] [BORDATORE POWER] ATTESA GRUPPO A BORDARE BASSO
0000213|PLC|FAULT|[213] [BORDATORE POWER] ATTESA GRUPPO A BORDARE POSIZ. CAMBIO RULLO
0000214|PLC|FAULT|[214] [BORDATORE POWER] ATTESA PIANO CARICAMENTO BORDI ALTO
0000215|PLC|FAULT|[215] [BORDATORE POWER] ATTESA PIANO CARICAMENTO BORDI BASSO
0000216|PLC|FAULT|[216] [BORDATORE POWER] MANCATA LETTURA BORDO GIUNZIONE
0000217|PLC|FAULT|[217] [BORDATORE POWER] ERRORE BORDO SU FOTOCELLULA DI CARICO
0000218|PLC|FAULT|[218] VASCA COLLA NON IN TEMPERATURA
0000219|PLC|FAULT|[219] [BORDATORE POWER] ASSENZA BORDO IN MULTIROTOLO
0000220|PLC|FAULT|[220] [BORDATORE POWER] ATTESA CICLO CARICO COLLA DA PREFUSORE
0000221|PLC|FAULT|[221] [BORDATORE POWER] MANCATO TAGLIO TRANCIA MAGAZZINO BORDI
0000222|PLC|FAULT|[222] [BORDATORE POWER] ATTESA CARICO COLLA DA PREFUSORE
0000223|PLC|FAULT|[223] [BORDATORE POWER] ANOMALIA SENSORI CILINDRO TESTA A BORDARE
0000224|PLC|FAULT|[224] SENSORE TESTA A BORDARE IN COLLISIONE
0000225|PLC|FAULT|[225] [BORDATORE POWER] TIMEOUT INTESTATURA BORDO TESTA A BORDARE
0000226|PLC|FAULT|[226] INTERVENTO TERMICI VASCA COLLA
0000227|PLC|FAULT|[227] INTERVENTO TERMICI PREFUSORE
0000228|PLC|FAULT|[228] INTERVENTO TERMICI LAMPADE ONDE CORTE
0000229|PLC|FAULT|[229] ESEGUIRE RIFERIMENTO MOT. ALTEZZA BORDO TESTA B.
0000230|PLC|FAULT|[230] ESEGUIRE RIFERIMENTO MOT. ALTEZZA BORDO MAGAZZINO B.
0000231|PLC|FAULT|[231] ESEGUIRE RIFERIMENTO MOT. CAMBIO RULLO PRESSIONE
0000232|PLC|FAULT|[232] TIMEOUT SENSORE CHIUSURA CILINDRO PREFUSORE
0000233|PLC|FAULT|[233] ESEGUIRE TARATURA TRAVERSE/VENTOSE
0000234|PLC|FAULT|[234] VENTOSE NON BLOCCATE AREA 1
0000235|PLC|FAULT|[235] VENTOSE NON BLOCCATE AREA 2
0000236|PLC|WARNING|[236] ATTESA SBLOCCO VENTOSA
0000237|PLC|WARNING|[237] ATTESA BLOCCO VENTOSA
0000238|PLC|WARNING|[238] RIMUOVERE VENTOSA: START CICLO
0000239|PLC|WARNING|[239] INSERIRE VENTOSA: START CICLO
0000240|PLC|FAULT|[240] ANOMALIA FOTOCELLULA MAGAZZINO BORDI
0000241|PLC|WARNING|[241] BARRA 1
0000242|PLC|WARNING|[242] BARRA 2
0000243|PLC|WARNING|[243] BARRA 3
0000244|PLC|WARNING|[244] BARRA 4
0000245|PLC|WARNING|[245] BARRA 5
0000246|PLC|WARNING|[246] BARRA 6
0000247|PLC|WARNING|[247] BARRA 7
0000248|PLC|WARNING|[248] BARRA 8
0000249|PLC|WARNING|[249] BARRA 9
0000250|PLC|WARNING|[250] BARRA 10
0000251|PLC|WARNING|[251] BARRA 11
0000252|PLC|WARNING|[252] BARRA 12
0000253|PLC|WARNING|[253] RIMUOVERE/INSERIRE VENTOSA COME DA GRAFICA SU AREA 1: START CICLO
0000254|PLC|WARNING|[254] RIMUOVERE/INSERIRE VENTOSA COME DA GRAFICA SU AREA 2: START CICLO
0000255|PLC|FAULT|[255] PORTE PROTEZIONE SBLOCCATE
0000256|PLC|FAULT|[256] ERRORE MODULO ZERO SPEED MANDRINO
0000257|PLC|FAULT|[257] INTESTATORE NON IN POSIZIONE
0000258|PLC|FAULT|[258] INTESTATORE 92 VUOTO
0000259|PLC|FAULT|[259] INTESTATORE 93 VUOTO
0000260|PLC|FAULT|[260] LIVELLO COLLA BASSO B.BASIC
0000261|PLC|FAULT|[261] [WD]EMERGENZA TRANSFER PREMUTA
0000262|PLC|FAULT|[262] [WD]INTERVENTO MAGNETOTERMICI TRANSFER
0000263|PLC|FAULT|[263] [WD]PORTE ARMADIO ELETTRICO TRANSFER APERTE
0000264|PLC|FAULT|[264] [WD]SVUOTARE TRANSFER
0000265|PLC|FAULT|[265] [WD]PEZZO IN ZONA DI SCARICO
0000266|PLC|FAULT|[266] [WD]ATTESA ROBOT 1 IN POSIZIONE
0000267|PLC|FAULT|[267] [WD]ATTESA ROBOT 2 IN POSIZIONE
0000268|PLC|FAULT|[268] [WD]SVUOTARE RULLIERE
0000269|PLC|FAULT|[269] [WD]DIMENSIONI PEZZO NON OK
0000270|PLC|FAULT|[270] [WD]SVUOTARE PIANO MACCHINA E PINZE ROBOT
0000271|PLC|FAULT|[271] [WD]PINZA ROBOT 1 NON IN POSIZIONE
0000272|PLC|FAULT|[272] [WD]PINZA ROBOT 2 NON IN POSIZIONE
0000273|PLC|FAULT|[273] MORSETTI ZONA 1 ALTI PNEUMATICAMENTE
0000274|PLC|FAULT|[274] MORSETTI ZONA 2 ALTI PNEUMATICAMENTE
0000275|PLC|FAULT|[275] EMERGENZA CAUSA MORSETTI ZONA 1
0000276|PLC|FAULT|[276] EMERGENZA CAUSA MORSETTI ZONA 2
0000277|PLC|FAULT|[277] ZONA DI COLLISIONE REFILATORE / RAS
0000278|PLC|FAULT|[278] PERICOLO SPORTELLO PANTOGRAFO APERTO
0000279|PLC|FAULT|[279] ZONA DI COLLISIONE BORDATORE
0000280|PLC|FAULT|[280] POSIZIONE DEL SELETTORE DELLA PULSANTIERA NON OK
0000281|PLC|FAULT|[281] PREMERE PULSANTE UOMO-MORTO
0000282|PLC|FAULT|[282] METTERE LA MACCHINA IN EMERGENZA
0000283|PLC|FAULT|[283] EMERGENZA TAPPETO ZONA 1
0000284|PLC|FAULT|[284] EMERGENZA TAPPETO ZONA 2
0000285|PLC|FAULT|[285] ZONA DI COLLISIONE MAGAZZINO RULLI PRESSIONE
0000286|PLC|FAULT|[286] TAPPETO AREA 1 IMPEGNATO
0000287|PLC|FAULT|[287] TAPPETO CENTRALE IMPEGNATO
0000288|PLC|FAULT|[288] TAPPETO AREA 2 IMPEGNATO
0000289|PLC|FAULT|[289] NUMERO RULLO PRESSORE ERRATO
0000290|PLC|FAULT|[290] CHECK VASCA COLLA
0000291|PLC|FAULT|[291] TIMEOUT GRUPPO VENTOSE NON ESCLUSO
0000292|PLC|FAULT|[292] TIMEOUT GRUPPO VENTOSE NON INSERITO
0000293|PLC|FAULT|[293] ASSE C BORDATORE IN QUOTA COLLISIONE CON G.VENTOSE
0000294|PLC|FAULT|[294] CICLO INSERIMENTO SPINA GRUPPO 92 NON OK(MUOVERE IN JOG+ L'ASSE X)
0000295|PLC|FAULT|[295] CICLO INSERIMENTO SPINA GRUPPO 93 NON OK(MUOVERE IN JOG- L'ASSE X)
0000296|PLC|FAULT|[296] RULLI NON IN POSIZIONE
0000297|PLC|FAULT|[297] ASSE X FUORI LIMITE PER RULLI
0000298|PLC|FAULT|[298] COLLISIONE RULLI CON GRUPPO TESTE
0000299|PLC|FAULT|[299] LASCIARE LIBERO
0000300|PLC|FAULT|[300] PERICOLO COLLISIONE BORDATORE PIANO MULTIFUNZIONE
0000301|PLC|FAULT|[301] MODALITÀ CELLA NON ATTIVA
0000302|PLC|FAULT|[302] ZONA DI COLLISIONE BORDATORE IN Y
0000303|PLC|FAULT|[303] ERRORE SEQUENZA CAMBIO RULLO PRESSORE
0000304|PLC|FAULT|[304]
0000305|PLC|FAULT|[305]
0000306|PLC|FAULT|[306]
0000307|PLC|FAULT|[307]
0000308|PLC|FAULT|[308]
0000309|PLC|FAULT|[309]
0000310|PLC|FAULT|[310]
0000311|PLC|FAULT|[311]
0000312|PLC|FAULT|[312]
0000313|PLC|FAULT|[313] PRESSORE 1 TESTA 1 NON IN POSIZIONE
0000314|PLC|FAULT|[314] PRESSORE 2 TESTA 1 NON IN POSIZIONE
0000315|PLC|FAULT|[315] PRESSORE 3 TESTA 1 NON IN POSIZIONE
0000316|PLC|FAULT|[316] PRESSORE 4 TESTA 1 NON IN POSIZIONE
0000317|PLC|FAULT|[317] PRESSORE 1 TESTA 2 NON IN POSIZIONE
0000318|PLC|FAULT|[318] PRESSORE 2 TESTA 2 NON IN POSIZIONE
0000319|PLC|FAULT|[319] PRESSORE 3 TESTA 2 NON IN POSIZIONE
0000320|PLC|FAULT|[320] PRESSORE 4 TESTA 2 NON IN POSIZIONE
0000321|PLC|FAULT|[321] ATTESA FINE CAMBIO UTENSILE
0000322|PLC|FAULT|[322]
0000323|PLC|FAULT|[323] PERICOLO COLLISIONE ASSI X-U
0000324|PLC|FAULT|[324] PERICOLO COLLISIONE ASSI Y-V
0000325|PLC|FAULT|[325] ZERO FEED RATE
0000326|PLC|FAULT|[326] PIGNA MOBILE ATTIVA - PADDLE DISABILITATO
0000327|PLC|FAULT|[327] APERTURA PINZE BLOCCATO DA ASSI Z-W BASSI
0000328|PLC|FAULT|[328] ATTENZIONE! PERICOLO COLLISIONE
0000329|PLC|FAULT|[329] CUFFIA LAMA NON IN POSIZIONE
0000330|PLC|FAULT|[330] BATTUTA RIFERIMENTO NON ESCLUSA
0000331|PLC|FAULT|[331] SCARICO PANNELLO: CONFERMARE CON START CICLO
0000332|PLC|FAULT|[332] VELOCITA' RIDOTTA A 25MT/MIN
0000333|PLC|FAULT|[333] DISCESA PRESSORE BLOCCATA DA ASSI Z-W BASSI
0000334|PLC|FAULT|[334] DISCESA MANDRINO BLOCCATA DA ASSI Z-W BASSI
0000335|PLC|FAULT|[335] DISCESA FUSO/LAMA BLOCCATA DA ASSI Z-W BASSI
0000336|PLC|FAULT|[336] DISCESA BATTUTA RIFERIMENTO BLOCCATA DA ASSI Z-W BASSI
0000337|PLC|FAULT|[337] MOVIMENTO ASSI X BLOCCATO DA PINZA APERTA E TESTE BASSE
0000338|PLC|FAULT|[338] MOVIMENTO ASSI U BLOCCATO DA PINZA APERTA E TESTE BASSE
0000339|PLC|FAULT|[339] MOVIMENTO ASSI YZ BLOCCATO DA PINZE APERTE
0000340|PLC|FAULT|[340] MOVIMENTO ASSI VW BLOCCATO DA PINZE APERTE
0000341|PLC|FAULT|[341]
0000342|PLC|FAULT|[342]
0000343|PLC|FAULT|[343]
0000344|PLC|FAULT|[344]
0000345|PLC|FAULT|[345]
0000346|PLC|FAULT|[346]
0000347|PLC|FAULT|[347]
0000348|PLC|FAULT|[348]
0000349|PLC|FAULT|[349]
0000350|PLC|FAULT|[350]
0000351|PLC|FAULT|[351]
0000352|PLC|FAULT|[352]
0000353|PLC|FAULT|[353]
0000354|PLC|FAULT|[354]
0000355|PLC|FAULT|[355]
0000356|PLC|FAULT|[356]
0000357|PLC|FAULT|[357]
0000358|PLC|FAULT|[358]
0000359|PLC|FAULT|[359]
0000360|PLC|FAULT|[360]
0000361|PLC|FAULT|[361]
0000362|PLC|FAULT|[362]
0000363|PLC|FAULT|[363]
0000364|PLC|FAULT|[364]
0000365|PLC|FAULT|[365]
0000366|PLC|FAULT|[366]
0000367|PLC|FAULT|[367]
0000368|PLC|FAULT|[368]
0000369|PLC|FAULT|[369]
0000370|PLC|FAULT|[370]
0000371|PLC|FAULT|[371]
0000372|PLC|FAULT|[372]
0000373|PLC|FAULT|[373]
0000374|PLC|FAULT|[374]
0000375|PLC|FAULT|[375]
0000376|PLC|FAULT|[376]
0000377|PLC|FAULT|[377]
0000378|PLC|FAULT|[378]
0000379|PLC|FAULT|[379]
0000380|PLC|FAULT|[380]
0000381|PLC|FAULT|[381]
0000382|PLC|FAULT|[382]
0000383|PLC|FAULT|[383]
0000384|PLC|FAULT|[384]
0000385|PLC|FAULT|[385]
0000386|PLC|FAULT|[386]
0000387|PLC|FAULT|[387]
0000388|PLC|FAULT|[388]
0000389|PLC|FAULT|[389]
0000390|PLC|FAULT|[390]
0000391|PLC|FAULT|[391]
0000392|PLC|FAULT|[392]
0000393|PLC|FAULT|[393]
0000394|PLC|FAULT|[394]
0000395|PLC|FAULT|[395]
0000396|PLC|FAULT|[396]
0000397|PLC|FAULT|[397]
0000398|PLC|FAULT|[398]
0000399|PLC|FAULT|[399]
0000400|PLC|FAULT|[400]
0000401|PLC|FAULT|[401]
0000402|PLC|FAULT|[402]
0000403|PLC|FAULT|[403]
0000404|PLC|FAULT|[404]
0000405|PLC|FAULT|[405]
0000406|PLC|FAULT|[406]
0000407|PLC|FAULT|[407]
0000408|PLC|FAULT|[408]
0000409|PLC|FAULT|[409]
0000410|PLC|FAULT|[410]
0000411|PLC|FAULT|[411]
0000412|PLC|FAULT|[412]
0000413|PLC|FAULT|[413]
0000414|PLC|FAULT|[414]
0000415|PLC|FAULT|[415]
0000416|PLC|FAULT|[416]
0000417|PLC|FAULT|[417]
0000418|PLC|FAULT|[418]
0000419|PLC|FAULT|[419]
0000420|PLC|FAULT|[420]
>>>>>>> OSAI
@@ -7,7 +7,14 @@
0.5|IOT_READY |BOOL
0.6|libero |BOOL
0.7|libero |BOOL
001|libero |BYTE
1.0|IOT_EXEC_A_01 |BOOL
1.1|IOT_EXEC_A_02 |BOOL
1.2|IOT_EXEC_A_03 |BOOL
1.3|IOT_EXEC_A_04 |BOOL
1.4|libero |BOOL
1.5|libero |BOOL
1.6|libero |BOOL
1.7|libero |BOOL
002|libero |BYTE
003|IOT_MODECN |BYTE
004|IOT_OVRF |BYTE
@@ -17,8 +17,8 @@
015|IOT_T_MD_08 |WORD
016|IOT_C_H_VAC_01 |WORD
017|IOT_C_H_VAC_02 |WORD
018|IOT_C_H_VAC_03 |WORD
019|IOT_C_H_VAC_04 |WORD
#018|IOT_C_H_VAC_03 |WORD
#019|IOT_C_H_VAC_04 |WORD
020|IOT_C_TC_01 |WORD
021|IOT_C_TC_02 |WORD
022|IOT_C_TC_03 |WORD
+6 -9
View File
@@ -41,7 +41,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>true</UseVSHostingProcess>
<Prefer32Bit>false</Prefer32Bit>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -131,7 +131,6 @@
<Compile Include="AdapterGeneric.cs" />
<Compile Include="AdapterDemo.cs" />
<Compile Include="AdapterFanuc.cs" />
<Compile Include="BinaryFormatter.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
@@ -194,6 +193,7 @@
<IsTransformFile>True</IsTransformFile>
</None>
<None Include="DATA\CmsGeneralStatus.mtc" />
<None Include="DATA\CONF\EsaKvara.ini" />
<None Include="DATA\CONF\IOT_ByteList.map">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@@ -231,14 +231,10 @@
<Content Include="Resources\SCM\Appunti doc CFG.txt" />
<Content Include="Resources\SCM\Appunti SCM.txt" />
<Content Include="Resources\SCM\DecodFileProd.txt" />
<Content Include="Resources\SCM\Demo MonitorVariabili.avi" />
<Content Include="Resources\SCM\Demo ProView.avi" />
<Content Include="Resources\SCM\IstruzioniTestProd.txt" />
<Content Include="Resources\SCM\README.txt" />
<Content Include="Resources\SCM\scm_logo_blu.png" />
<Content Include="Resources\SCM\scm_logo_blu_resize.png" />
<Content Include="Resources\SCM\sfondo.jpg" />
<Content Include="Resources\SCM\Tutorial Metodi Lettura SeF.avi" />
<Content Include="Resources\SCM\VariabiliContatori.txt" />
<Content Include="Resources\CMS\CMS.ico" />
<Content Include="dump\dump.exe">
@@ -251,7 +247,6 @@
<Content Include="Resources\MTCA.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Resources\SCM\XSimGph.dll" />
<None Include="DATA\CONF\SubModeList.map">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@@ -272,8 +267,6 @@
<None Include="Resources\SCM\app.msg" />
<None Include="Resources\SCM\convertScmAlarm.ps1" />
<Content Include="Resources\SCM\EsaKvara_SIM.ini" />
<None Include="Resources\SCM\KvaraDb.doc" />
<None Include="Resources\SCM\KvaraDb.pdf" />
<None Include="dump\build.bat" />
<None Include="dump\dump.c" />
<None Include="dump\dump.obj" />
@@ -302,6 +295,10 @@
<Project>{2d769ffd-1122-4276-a115-29246e6d23c5}</Project>
<Name>CMSCncLib</Name>
</ProjectReference>
<ProjectReference Include="..\MTC\MTC.csproj">
<Project>{ec83d80e-9f3b-4de9-b16a-ca216543b7ec}</Project>
<Name>MTC</Name>
</ProjectReference>
<ProjectReference Include="..\SCMCncLib\SCMCncLib.csproj">
<Project>{7a12fe26-9c58-4630-973d-d4872374dbaf}</Project>
<Name>SCMCncLib</Name>
+9 -12
View File
@@ -6,25 +6,20 @@
* */
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Windows.Forms;
using NLog;
using MTC;
using NLog.Config;
using NLog.Targets;
using System.Collections;
using System.Configuration;
using System.Diagnostics;
using System.IO;
namespace MTC_Adapter
{
using MTConnect;
using NLog.Config;
using NLog.Targets;
using System.Collections;
using System.Configuration;
using System.Diagnostics;
using System.IO;
public partial class MainForm : Form
{
@@ -271,6 +266,7 @@ namespace MTC_Adapter
// controllo cosa devo mostrare...
if (WindowState == FormWindowState.Minimized)
{
notifyIcon1.Visible = false;
sendToTray();
}
else
@@ -684,6 +680,7 @@ namespace MTC_Adapter
try
{
MainProgrBar.PerformStep();
MainProgrBar.Invalidate();
}
catch
{ }
-3
View File
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MTC_Adapter
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 145 KiB

@@ -70,6 +70,9 @@ IOT_AreaAddressByte=IOT.BYTE
IOT_AreaAddressWord=IOT.WORD
IOT_AreaAddressDWord=IOT.DWORD
IOT_AreaAddressStringA=IOT.ProgramNameAreaA
IOT_AreaAddressStringB=IOT.ProgramNameAreaB
IOT_AreaAddressStringC=IOT.ProgramNameAreaC
IOT_AreaAddressStringD=IOT.ProgramNameAreaD
[XILOG]
Enable=1
@@ -7,7 +7,14 @@
0.5|IOT_READY |BOOL
0.6|libero |BOOL
0.7|libero |BOOL
001|libero |BYTE
1.0|IOT_EXEC_A_01 |BOOL
1.1|IOT_EXEC_A_02 |BOOL
1.2|IOT_EXEC_A_03 |BOOL
1.3|IOT_EXEC_A_04 |BOOL
1.4|libero |BOOL
1.5|libero |BOOL
1.6|libero |BOOL
1.7|libero |BOOL
002|libero |BYTE
003|IOT_MODECN |BYTE
004|IOT_OVRF |BYTE
@@ -17,8 +17,8 @@
015|IOT_T_MD_08 |WORD
016|IOT_C_H_VAC_01 |WORD
017|IOT_C_H_VAC_02 |WORD
018|IOT_C_H_VAC_03 |WORD
019|IOT_C_H_VAC_04 |WORD
#018|IOT_C_H_VAC_03 |WORD
#019|IOT_C_H_VAC_04 |WORD
020|IOT_C_TC_01 |WORD
021|IOT_C_TC_02 |WORD
022|IOT_C_TC_03 |WORD
+2 -1
View File
@@ -1,4 +1,5 @@
using System;
using MTC;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
-4
View File
@@ -29,8 +29,6 @@ echo CMS: copio files CMS - Zogno
del %2"Resources\MTCA.ico"
del %2"DATA\CONF\Adapter_ItemList.xml"
del %2"DATA\CONF\AlarmList.map"
del %2"DATA\CONF\EsaKvara.ini"
del %2"DATA\CONF\SCM_prodFile.pro"
REM del /F /Q %2"DATA\CONF\*.*"
copy %2"Resources\CMS\CMS.ico" %2"Resources\MTCA.ico"
REM ora verifico tipo controllo esatto...
@@ -44,7 +42,6 @@ del %2"Resources\MTCA.ico"
del %2"DATA\CONF\Adapter_ItemList.xml"
del %2"DATA\CONF\AlarmList.map"
del %2"DATA\CONF\EsaKvara.ini"
del %2"DATA\CONF\SCM_prodFile.pro"
del %2"DATA\CONF\IOT_ByteList.map"
del %2"DATA\CONF\IOT_WordList.map"
del %2"DATA\CONF\IOT_DWordList.map"
@@ -54,7 +51,6 @@ copy %2"Resources\SCM\SCM.ico" %2"Resources\MTCA.ico"
copy %2"Resources\SCM\SCM_ESA.xml" %2"DATA\CONF\Adapter_ItemList.xml"
copy %2"Resources\SCM\AlarmListEsaGv.map" %2"DATA\CONF\AlarmList.map"
copy %2"Resources\SCM\EsaKvara_PROD.ini" %2"DATA\CONF\EsaKvara.ini"
copy %2"Resources\SCM\SCM_prodFile.pro" %2"DATA\CONF\SCM_prodFile.pro"
copy %2"Resources\SCM\IOT_ByteList.map" %2"DATA\CONF\IOT_ByteList.map"
copy %2"Resources\SCM\IOT_WordList.map" %2"DATA\CONF\IOT_WordList.map"
copy %2"Resources\SCM\IOT_DWordList.map" %2"DATA\CONF\IOT_DWordList.map"
+3 -779
View File
@@ -1,315 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using NLog;
using System.Windows.Forms;
using MTC;
namespace MTC_Adapter
{
public class utils
public class utils : MTC.baseUtils
{
/// <summary>
/// classe logger
/// </summary>
public static Logger lg;
/// <summary>
/// legge conf in formato char
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static char CRC(string key)
{
char answ = '-';
try
{
answ = ConfigurationManager.AppSettings[key].ToCharArray()[0];
}
catch
{ }
return answ;
}
/// <summary>
/// legge conf in formato stringa
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static string CRS(string key)
{
string answ = "";
try
{
answ = ConfigurationManager.AppSettings[key].ToString();
}
catch
{ }
return answ;
}
/// <summary>
/// legge conf in formato INT
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static Int32 CRI(string key)
{
int answ = 0;
try
{
answ = Convert.ToInt32(CRS(key));
}
catch
{ }
return answ;
}
/// <summary>
/// legge conf in formato BOOLean
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static bool CRB(string key)
{
bool answ = false;
try
{
answ = Convert.ToBoolean(CRS(key));
}
catch
{ }
return answ;
}
/// <summary>
/// verifica se un dato bit sia alzato (come flag di strobe)
/// </summary>
/// <param name="value">valore da testare</param>
/// <param name="flag">valore cercato, può essere un singolo valore o un insieme in modalità AND</param>
/// <returns></returns>
public static bool IsSetAll(Strobe value, Strobe flag)
{
return ((value & flag) == flag);
}
/// <summary>
/// verifica se un dato bit sia alzato (come flag di strobe)
/// </summary>
/// <param name="value">valore da testare</param>
/// <param name="flag">valore cercato, può essere un singolo valore o un insieme in modalità OR</param>
/// <returns></returns>
public static bool IsSetAny(Strobe value, Strobe flag)
{
return ((value & flag) != 0);
}
/// <summary>
/// verifica se un dato bit sia alzato (come flag di strobe)
/// </summary>
/// <param name="value">valore da testare</param>
/// <param name="flag">valore cercato, può essere un singolo valore o un insieme in modalità AND</param>
/// <returns></returns>
public static bool IsSetAll(StatusBitMap value, StatusBitMap flag)
{
return ((value & flag) == flag);
}
/// <summary>
/// verifica se un dato bit sia alzato (come flag di strobe)
/// </summary>
/// <param name="value">valore da testare</param>
/// <param name="flag">valore cercato, può essere un singolo valore o un insieme in modalità OR</param>
/// <returns></returns>
public static bool IsSetAny(StatusBitMap value, StatusBitMap flag)
{
return ((value & flag) != 0);
}
/// <summary>
/// formatta un numero in forma binaria 0/1
/// </summary>
/// <param name="valore"></param>
/// <returns></returns>
public static string binaryForm(int valore)
{
string answ = "";
try
{
answ = string.Format(new BinaryFormatter(), "{0:B}", valore);
}
catch
{ }
return answ;
}
/// <summary>
/// imposta un bit al valore richiesto duplicando il valore IN come OUT
/// </summary>
/// <param name="original">valore originale da aggiornare</param>
/// <param name="bitBool">valore richiesto x il bit (0/1)</param>
/// <param name="bitIndex">indice bit, 0 based (es: 0..31 per 32bit)</param>
/// <returns></returns>
public static byte[] setBitOnStFlag(byte[] original, bool bitBool, int bitIndex)
{
int bitVal = 0;
if (bitBool) bitVal = 1;
// risposta è identica ad originale...
byte[] answ = original;
// verifico se il bit è 0/1b
if (bitVal <= 1 && bitVal >= 0)
{
// verifico se si possa aggiornare il bit richiesto (<= al totale dei bit...)
if (bitIndex <= original.Length * 8 - 1)
{
// calcolo byte
int byteIndex = bitIndex / 8;
// bit nel byte
int bitInByteIndex = bitIndex % 8;
// bit richiesto
byte mask = (byte)(bitVal << bitInByteIndex);
// imposto!
answ[byteIndex] |= mask;
}
}
return answ;
}
/// <summary>
/// Converte un bitarray a byte[]
/// </summary>
/// <param name="bits"></param>
/// <returns></returns>
public static byte[] ToByteArray(BitArray bits)
{
int numBytes = bits.Count / 8;
if (bits.Count % 8 != 0) numBytes++;
byte[] bytes = new byte[numBytes];
int byteIndex = 0, bitIndex = 0;
for (int i = 0; i < bits.Count; i++)
{
if (bits[i])
bytes[byteIndex] |= (byte)(1 << (7 - bitIndex));
bitIndex++;
if (bitIndex == 8)
{
bitIndex = 0;
byteIndex++;
}
}
return bytes;
}
/// <summary>
/// Scrittura dictionary su file
/// </summary>
/// <param name="dictionary"></param>
/// <param name="file"></param>
public static void WriteBin(Dictionary<string, string> dictionary, string file)
{
using (FileStream fs = File.OpenWrite(file))
using (BinaryWriter writer = new BinaryWriter(fs))
{
// Put count.
writer.Write(dictionary.Count);
// Write pairs.
foreach (var pair in dictionary)
{
writer.Write(pair.Key);
writer.Write(pair.Value);
}
}
}
/// <summary>
/// Lettura dictionary da file
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
public static Dictionary<string, string> ReadBin(string file)
{
var result = new Dictionary<string, string>();
// verifico file esista...
if (!File.Exists(file))
{
FileStream fs = File.Create(file);
fs.Close();
}
using (FileStream fs = File.OpenRead(file))
using (BinaryReader reader = new BinaryReader(fs))
{
// Get count.
int count = 0;
try
{
count = reader.ReadInt32();
}
catch
{ }
// Read in all pairs.
for (int i = 0; i < count; i++)
{
string key = reader.ReadString();
string value = reader.ReadString();
result[key] = value;
}
}
return result;
}
/// <summary>
/// Scrittura dictionary su file
/// </summary>
/// <param name="dictionary"></param>
/// <param name="file"></param>
public static void WritePlain(Dictionary<string, string> dictionary, string file)
{
string dirPath = file.Substring(0, file.LastIndexOf('\\'));
// verifico directory
if (!Directory.Exists(dirPath))
{
Directory.CreateDirectory(dirPath);
}
string[] lines = dictionary.OrderBy(i => i.Key).Select(kvp => kvp.Key + ":" + kvp.Value).ToArray();
try
{
File.WriteAllLines(file, lines);
}
catch (Exception exc)
{
lg.Info(exc, string.Format("Errore in scrittura file {0}", file));
}
}
/// <summary>
/// Lettura dictionary da file
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
public static Dictionary<string, string> ReadPlain(string file)
{
// inizializzo num righe lette...
int numRow = 0;
var result = new Dictionary<string, string>();
// verifico file esista...
if (!File.Exists(file))
{
FileStream fs = File.Create(file);
fs.Close();
}
try
{
string[] lines = File.ReadAllLines(file);
result = lines.Select(l => l.Split(':')).ToDictionary(a => a[0], a => a[1]);
numRow = result.Count;
}
catch
{ }
// se leggesse un valore NON coerente (senza righe) restituisce un file vuoto...
if (numRow == 0)
{
result = new Dictionary<string, string>();
}
return result;
}
/// <summary>
/// folder archiviazione dati configurazione (DATA\CONF)
/// </summary>
@@ -351,475 +46,4 @@ namespace MTC_Adapter
}
}
}
/// <summary>
/// Oggetto timing x archiviazione dati perfomances
/// </summary>
public class TimeRec
{
/// <summary>
/// Codice univoco chiamata: tipo R4 (read 4 byte), W2 (write 2 Byte)
/// </summary>
public string codCall;
/// <summary>
/// Num chiamate totale
/// </summary>
public int numCall;
/// <summary>
/// Tempo medio chiamata
/// </summary>
public double avgMsec
{
get
{
return totMsec.TotalMilliseconds / numCall;
}
}
/// <summary>
/// Totale Msec accumulati
/// </summary>
public TimeSpan totMsec;
/// <summary>
/// Classe record timing
/// </summary>
public TimeRec()
{
codCall = "";
numCall = 0;
totMsec = new TimeSpan(0);
}
/// <summary>
/// Classe record timing
/// </summary>
/// <param name="codice"></param>
/// <param name="ticks"></param>
public TimeRec(string codice, long nTicks)
{
codCall = codice;
numCall = 1;
totMsec = new TimeSpan(nTicks);
}
}
public static class TimingData
{
public static List<TimeRec> results = new List<TimeRec>();
/// <summary>
/// aggiorno vettore aggiungendo risultato
/// </summary>
/// <param name="codice"></param>
/// <param name="ticks"></param>
public static void addResult(string codice, long ticks)
{
if (results.Count == 0)
{
results.Add(new TimeRec(codice, ticks));
}
int indice = -1;
for (int i = 0; i < results.Count; i++)
{
// se il codice è quello cercato...
if (results[i].codCall == codice) indice = i;
}
// se c'è aggiorno...
if (indice >= 0)
{
results[indice].numCall++;
results[indice].totMsec = results[indice].totMsec.Add(new TimeSpan(ticks));
}
// altrimenti aggiungo...
else
{
results.Add(new TimeRec(codice, ticks));
}
}
}
public enum tipoAdapter
{
/// <summary>
/// Adapter generico/demo
/// </summary>
DEMO,
/// <summary>
/// adapter FANUC (CMS)
/// </summary>
FANUC,
/// <summary>
/// Adapter ESAGV (SCM)
/// </summary>
ESAGV,
/// <summary>
/// Adapter non specificato
/// </summary>
ND,
/// <summary>
/// Adapter OSAI
/// </summary>
OSAI,
/// <summary>
/// Adapter SIEMENS (CMS)
/// </summary>
SIEMENS
}
public enum gatherCycle
{
/// <summary>
/// lettura dati ad alta frequenza
/// </summary>
HF,
/// <summary>
/// lettura dati standard
/// </summary>
MF,
/// <summary>
/// lettura dati bassa freq
/// </summary>
LF,
/// <summary>
/// lettura dati bassissima priorità (re-sync stato allarmi)
/// </summary>
VLF
}
/// <summary>
/// informazioni di produzione
/// </summary>
public struct prodData
{
public string Operator;
public bool Status;
public int AccTime;
public int Power;
public string FuncMode;
public bool EmrStop;
public string MessageCode;
public string MessageText;
}
public struct PathData
{
public int PathSel;
public string PathType; // LAVOR/ASSERV
public string RunMode;
public string ExeMode;
public int pzTot;
public string ProgramName;
public string ProgrRow;
public string PartId;
public string ActiveAxes;
public string CodG_Act;
public string SubMode;
public int PathFeedrate;
public int PathFeedrateOver;
public int PathRapidOver;
public position PathPosAct;
}
public struct UnOpData
{
public int UnOpSel;
public int UnOpToolId;
public int UnOpNumCU;
public string UnOpStatus;
public int UnOpVitaRes;
public int UnOpSpeed;
public int UnOpLoad;
public int UnOpAccTime;
}
public struct AxisData
{
public int AxisSel;
public string AxisMainProc;
public bool AxisIsMaster;
public string AxisMastId;
public string AxisType;
public string AxisDir;
public int AxisLoad;
public int AxisPosAct;
public int AxisPosTgt;
public int AxisFeedAct;
public int AxisFeedOver;
public string AxisAccel;
public string AxisAccTime;
public string AxisBattery;
public string DistDone;
public string InvDDone;
}
/// <summary>
/// Vettore completo posizione (X-Y-Z con versori i-j-k)
/// </summary>
public class position
{
public float x;
public float y;
public float z;
public float i;
public float j;
public float k;
public position()
{
x = 0;
y = 0;
z = 0;
i = 0;
j = 0;
k = 0;
}
}
/// <summary>
/// Dati Prod SCM (per decodifica)
/// </summary>
public class datiProdSCM
{
public string area;
public string fileName;
public string dimensioni;
public DateTime start;
public DateTime stop;
public TimeSpan tEff;
public TimeSpan tTot;
public int qta;
public TimeSpan tMed;
public datiProdSCM()
{
area = "";
fileName = "";
dimensioni = "";
start = DateTime.Now;
stop = DateTime.Now;
tEff = new TimeSpan(0);
tTot = new TimeSpan(0);
qta = 0;
tMed = new TimeSpan(0);
}
/// <summary>
/// crea un nuovo oggetto a partire da un array di stringhe
/// </summary>
/// <param name="valori"></param>
public datiProdSCM(string[] valori)
{
try
{
area = valori[0];
fileName = valori[1];
dimensioni = string.Format("{0}x{1}x{2}", valori[3], valori[4], valori[5]);
start = DateTime.Today.AddHours(Convert.ToInt16(valori[6])).AddMinutes(Convert.ToInt16(valori[7])).AddSeconds(Convert.ToInt16(valori[8]));
stop = DateTime.Today.AddHours(Convert.ToInt16(valori[9])).AddMinutes(Convert.ToInt16(valori[10])).AddSeconds(Convert.ToInt16(valori[11]));
// se ore == 0 --> aggiungo 1 gg!!!
if (Convert.ToInt16(valori[9]) == 0) stop.AddDays(1);
tEff = new TimeSpan(Convert.ToInt16(valori[12]), Convert.ToInt16(valori[13]), Convert.ToInt16(valori[14]));
tTot = new TimeSpan(Convert.ToInt16(valori[15]), Convert.ToInt16(valori[16]), Convert.ToInt16(valori[17]));
qta = Convert.ToInt16(valori[18]);
tMed = new TimeSpan(Convert.ToInt16(valori[19]), Convert.ToInt16(valori[20]), Convert.ToInt16(valori[22]), Convert.ToInt16(valori[23]));
}
catch
{ }
}
}
/// <summary>
/// Allarme (per decodifica)
/// </summary>
public class allarme
{
public string codNum;
public string gruppo;
public string livello;
public string descrizione;
public allarme()
{
codNum = "";
gruppo = "";
livello = "";
descrizione = "";
}
public allarme(string _codNum, string _gruppo, string _livello, string _descrizione)
{
codNum = _codNum;
gruppo = _gruppo;
livello = _livello;
descrizione = _descrizione;
}
}
/// <summary>
/// Dato generico (per decodifica)
/// </summary>
public class otherData
{
public string codNum;
public string memAddr;
public string varName;
public string dataType;
public otherData()
{
codNum = "";
memAddr = "";
varName = "";
dataType = "";
}
public otherData(string _codNum, string _memAddr, string _varName, string _dataType)
{
codNum = _codNum;
memAddr = _memAddr;
varName = _varName;
dataType = _dataType;
}
}
/// <summary>
/// Strobe: contiene il set di strobe di comunicazione
///
/// rif: http://stackoverflow.com/questions/17209054/parse-bits-in-a-byte-to-enum
/// </summary>
[Flags]
public enum Strobe : int
{
NONE = 0,
M_CODE = 1 << 0,
S_CODE = 1 << 1,
T_CODE = 1 << 2,
PZ_OK = 1 << 3,
PZ_KO = 1 << 4,
FEED_SPEED = 1 << 5,
POS_ACT = 1 << 6,
SP07 = 1 << 7,
SP08 = 1 << 8,
SP09 = 1 << 9,
SP10 = 1 << 10,
SP11 = 1 << 11,
SP12 = 1 << 12,
SP13 = 1 << 13,
SP14 = 1 << 14,
SP15 = 1 << 15,
SP16 = 1 << 16,
SP17 = 1 << 17,
SP18 = 1 << 18,
SP19 = 1 << 19,
SP20 = 1 << 20,
SP21 = 1 << 21,
SP22 = 1 << 22,
SP23 = 1 << 23,
SP24 = 1 << 24,
SP25 = 1 << 25,
SP26 = 1 << 26,
SP27 = 1 << 27,
SP28 = 1 << 28,
SP29 = 1 << 29,
SP30 = 1 << 30,
SP31 = 1 << 31
}
/// <summary>
/// StFlag8: set di 8 bit (1 word) contente semaforo di variabili
/// </summary>
[Flags]
public enum StFlag8 : int
{
NONE = 0,
B0 = 1 << 0,
B1 = 1 << 1,
B2 = 1 << 2,
B3 = 1 << 3,
B4 = 1 << 4,
B5 = 1 << 5,
B6 = 1 << 6,
B7 = 1 << 7
}
/// <summary>
/// StFlag32: set di 32 bit (4 word) contente semaforo di variabili
/// </summary>
[Flags]
public enum StFlag32 : int
{
NONE = 0,
B00 = 1 << 0,
B01 = 1 << 1,
B02 = 1 << 2,
B03 = 1 << 3,
B04 = 1 << 4,
B05 = 1 << 5,
B06 = 1 << 6,
B07 = 1 << 7,
B08 = 1 << 8,
B09 = 1 << 9,
B10 = 1 << 10,
B11 = 1 << 11,
B12 = 1 << 12,
B13 = 1 << 13,
B14 = 1 << 14,
B15 = 1 << 15,
B16 = 1 << 16,
B17 = 1 << 17,
B18 = 1 << 18,
B19 = 1 << 19,
B20 = 1 << 20,
B21 = 1 << 21,
B22 = 1 << 22,
B23 = 1 << 23,
B24 = 1 << 24,
B25 = 1 << 25,
B26 = 1 << 26,
B27 = 1 << 27,
B28 = 1 << 28,
B29 = 1 << 29,
B30 = 1 << 30,
B31 = 1 << 31
}
/// <summary>
/// StatusBitMap: contiene il set di semafori/flag x status + allarmi (x classi)
/// </summary>
[Flags]
public enum StatusBitMap : int
{
NONE = 0,
ESTOP = 1 << 0,
RM_AUTO = 1 << 1,
RM_MANUAL = 1 << 2,
RM_MDI = 1 << 3,
RM_EDIT = 1 << 4,
EM_RUN = 1 << 5,
EM_READY = 1 << 6,
EM_STOP = 1 << 7,
EM_FEEDHOLD = 1 << 8,
HM = 1 << 9,
ST11 = 1 << 10,
ST12 = 1 << 11,
ST13 = 1 << 12,
ST14 = 1 << 13,
ST15 = 1 << 14,
ST16 = 1 << 15,
AL01 = 1 << 16,
AL02 = 1 << 17,
AL03 = 1 << 18,
AL04 = 1 << 19,
AL05 = 1 << 20,
AL06 = 1 << 21,
AL07 = 1 << 22,
AL08 = 1 << 23,
AL09 = 1 << 24,
AL10 = 1 << 25,
AL11 = 1 << 26,
AL12 = 1 << 27,
AL13 = 1 << 28,
AL14 = 1 << 29,
AL15 = 1 << 30,
AL16 = 1 << 31
}
}
+1
View File
@@ -23,6 +23,7 @@
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>true</UseVSHostingProcess>
<Prefer32Bit>false</Prefer32Bit>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
+2 -2
View File
@@ -5,7 +5,7 @@
using System.Reflection;
[assembly: AssemblyVersion("1.4.9999.125")]
[assembly: AssemblyFileVersion("1.4.9999.125")]
[assembly: AssemblyVersion("1.5.9999.129")]
[assembly: AssemblyFileVersion("1.5.9999.129")]
[assembly: AssemblyCopyright("Steamware-CMS-SCM © 2015-2017")]
[assembly: AssemblyCompany("Steamware-CMS-SCM")]
+2 -2
View File
@@ -6,8 +6,8 @@
using System.Reflection;
[assembly: AssemblyVersion("1.4.9999.<#= this.RevisionNumber #>")]
[assembly: AssemblyFileVersion("1.4.9999.<#= this.RevisionNumber #>")]
[assembly: AssemblyVersion("1.5.9999.<#= this.RevisionNumber #>")]
[assembly: AssemblyFileVersion("1.5.9999.<#= this.RevisionNumber #>")]
[assembly: AssemblyCopyright("Steamware-CMS-SCM © 2015-<#= DateTime.Now.Year #>")]
[assembly: AssemblyCompany("Steamware-CMS-SCM")]
<#+
+77
View File
@@ -0,0 +1,77 @@
6.9.9
- Fix for Nested transactions are not supported in Entity Framework (MySQL Bug #71502, Oracle Bug #22366266).
- Fix for EF5 and EF6 wrong SQL statement to set primary key (MySQL Bug 76292, Oracle Bug #20711384)
- Fixed problem where mysql.proc tables would not be used for metadata even though access was available (MySQL Bug #74116, Oracle Bug #20960373)
- Added support for TLSv1.1 and TLSv1.2
- Fixed Fix for "Aborted connection" (MySQL Bug #80997, Oracle Bug # 23346197).
6.9.8
- Added support for Chinese character set gb18030. (Oracle bug # 21098546).
- Added support for Json type. (WL # 8132).
- Added changes for metadata information in generated columns with 5.7 (WL #411)
6.9.7
- Changed default SSL mode to Preferred in connection string. Now the server connections will be using SSL if server allows it by default but it's possible to override this configuration.
- Changed handshake process to use bytes instead of encoded strings.
- Fix for Fabric connections (Oracle Bug #20983968).
- Fix for Fabric plugin: fabric server selection is broken when master is faulty (Oracle Bug #21203824).
6.9.6
- Fix for Incorrect query result with Entity Framework 6 (MySql bug #74918, Oracle bug #20129927).
- Fix for GetTimeZoneOffset to use date and time to calculate timediff (MySQL Bug #74905, Oracle Bug #20065691).
- Fix for MySqlSimpleMembershipProvider keeps database connections open on some operations (MySQL Bug #74662, Oracle Bug #20109419)
- Fix for Any Call to RoleExists() returns true whether or not the role exists (MySql bug #75397, Oracle bug #20325391).
- Fix for all dateTimes set as UTC Kind (MySQL Bug #74134, Oracle Bug #20200662).
- Fix for Invalid SQL query when eager loading two nested collections (MySQL Bug #70941, Oracle bug #18049862).
- Fix for chinese characters used in the connection string when connecting to MySql Server (MySQL Bug #70041, Oracle Bug #18141356).
6.9.5
- Disabled installation on-demand in Installer (Oracle Bug #19670596).
- Fix for Generated SQL requests column that doesn't exist in LINQ to Entities (MySql bug #72004, Oracle bug #19681348).
- Fix for MySQL Connector/NET generates incorrect SQL for LINQ 'StartsWith' queries (MySql bug #72058, Oracle bug #19680236).
- Fix for Exception when using IEnumerable.Contains(model.property) in Where predicate (MySql bug #73643, Oracle bug #19690370).
- Fix for Generated Sql does not contain ORDER BY statement whose is requested by LINQ (MySql bug #73549, Oracle bug #19698010).
- Fix for Web providers registration in machine.config (removed v20 suffix) (MySQL Bug #74080, Oracle Bug #19715398)
- Fix for Error of "Every derived table must have an alias" in LINQ to Entities when using EF6 + DbFirst + View + Take
(MySql Bug #72148, Oracle bug #19356006).
- Fix for 'the method or operation is not implemented' when using linq with orderby (MySQL Bug #70722, Oracle Bug #19681723).
- Fix for Exception "The given key was not present in the dictionary" when using utf16le charset in a query. (MySql #72737, Oracle Bug #19355906)
- Fix for Memory leak in a loop opening a connection to the database and executing a command (MySql Bug #73122, Oracle Bug #19467233).
- Fix for Multiple issues caused by trailing and leading white space character in params using MySql Membership Provider (MySql Bug #73411, Oracle Bug #19453313)
- Fix for bad assumption leads to modify query adding CALL statement to the beginning of the sql query even when CommandType.Text is specified (MySql Bug #72736, Oracle Bug #19325120).
6.9.4
- Added a new plugin for MySql Fabric 1.5 support
6.9.3
- Fix for Web Parts Personalization provider
- Fix for changing the PK between two int columns (MySql Bug #71418, Oracle bug #18923294).
- Fix for Error when Calling MySqlConnection.GetSchema("PROCEDURES WITH PARAMETERS", ...) (Oracle bug #19285959).
- Fix for EF provider reports ManifestProviderToken = 5.6 for server 5.7 (Oracle bug #19453814).
- Fix for Fluent API DbModelBuilder.HasColumnType is ignored in EF6 (Oracle bug #19456229).
- Fix for Setting a PK GUID identity in Code First in EF6 no longer works in Server 5.7 (Oracle bug #19456452).
- Non PKs declared as Identity GUID have no GUID autogenerated (Oracle bug #19456415).
6.9.2
- Add async/await compatible methods
- Fix for Unable to read geometry column when it has been set with a SRID value. (MySql Bug #71869, Oracle Bug #19137999)
- Fix for Exception adding a new column to an existing model as identity and PK fails when applying the migration (MySql Bug #71418, Oracle bug #18923294).
- Added SiteMap and Personalization configuration web providers to MySql.Web Nuget Package.
6.9.1
- Fix for Exception of "duplicate entry" in MySqlSessionProvider (MySql Bug #70409, Oracle bug #18657550).
6.9.0
- Added implementation of MySQLPersonalizationProvider.
- Added SiteMap Web provider.
- Added Simple Membership Web Provider.
- Fix for open sockets connections left when connection open fails, the error happens when the client try to get a connection when the max number of connections is reached in the server. (MySql #72025, Oracle Bug #18665388).
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
Connector/Net 6.9 Release Notes
------------------------------------
Welcome to the release notes for Connector/Net 6.9
What's new in 6.9
--------------------
- Simple Membership Web Provider
- Site Map Web Provider
- Personalization Web Provider
- MySql Fabric support
Be sure and check the documentation for more information on these new features.
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<!-- optional, add some variables
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="myvar" value="myvalue"/>
<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets>
<!--
add your targets here
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
-->
<!--
Write events to a file with the date in the filename.
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
-->
</targets>
<rules>
<!-- add your logging rules here -->
<!--
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
<logger name="*" minlevel="Debug" writeTo="f" />
-->
</rules>
</nlog>
@@ -0,0 +1,12 @@
param($installPath, $toolsPath, $package, $project)
$configItem = $project.ProjectItems.Item("NLog.config")
# set 'Copy To Output Directory' to 'Copy if newer'
$copyToOutput = $configItem.Properties.Item("CopyToOutputDirectory")
$copyToOutput.Value = 1
# set 'Build Action' to 'Content'
$buildAction = $configItem.Properties.Item("BuildAction")
$buildAction.Value = 2
Binary file not shown.
File diff suppressed because it is too large Load Diff