diff --git a/Integration2.sln b/Integration2.sln new file mode 100644 index 0000000..e2aab5f --- /dev/null +++ b/Integration2.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33829.357 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IntegrationEgaltech2", "IntegrationEgaltech2\IntegrationEgaltech2.vcxproj", "{69C15767-8E9E-42BE-B8F8-AEA49DC572CE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {69C15767-8E9E-42BE-B8F8-AEA49DC572CE}.Debug|x86.ActiveCfg = Debug|Win32 + {69C15767-8E9E-42BE-B8F8-AEA49DC572CE}.Debug|x86.Build.0 = Debug|Win32 + {69C15767-8E9E-42BE-B8F8-AEA49DC572CE}.Release|x86.ActiveCfg = Release|Win32 + {69C15767-8E9E-42BE-B8F8-AEA49DC572CE}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B24E2322-2BD8-49B9-AB2D-818585C5CAED} + EndGlobalSection +EndGlobal diff --git a/IntegrationEgaltech/BTL.cs b/IntegrationEgaltech/BTL.cs index bee0ead..88ebdbb 100644 --- a/IntegrationEgaltech/BTL.cs +++ b/IntegrationEgaltech/BTL.cs @@ -1,8 +1,11 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; +using System.Runtime.InteropServices; +using System.Security; using System.Text; using System.Threading.Tasks; @@ -24,11 +27,29 @@ namespace ib.essetre.integration.egaltech // Contatore entità di contorno libero private int _FcEnt ; +#if DEBUG + [DllImport("IntegrationEgaltech2D32.dll", CharSet = CharSet.Unicode)] + private static extern bool EgtInitBtlWriter() ; + [DllImport("IntegrationEgaltech2D32.dll", CharSet = CharSet.Unicode)] + private static extern int EgtStartBtlWriter() ; + [DllImport("IntegrationEgaltech2D32.dll", CharSet = CharSet.Unicode)] + private static extern bool EgtEndBtlWriter() ; +#else + [DllImport("IntegrationEgaltech2R32.dll", CharSet = CharSet.Unicode)] + private static extern bool EgtInitBtlWriter() ; + [DllImport("IntegrationEgaltech2R32.dll", CharSet = CharSet.Unicode)] + private static extern int EgtStartBtlWriter() ; + [DllImport("IntegrationEgaltech2R32.dll", CharSet = CharSet.Unicode)] + private static extern bool EgtEndBtlWriter() ; +#endif public BTL() {} public bool WriteIntoFile( string BtlPath, bool IsFromProject) { + // Inizializzo libreria di base + bool bInit = EgtInitBtlWriter() ; + // Se un file txt (contenente messaggio di errore) con lo stesso nome esiste già viene cancellato if ( File.Exists( Path.ChangeExtension( BtlPath, ".txt"))) File.Delete( Path.ChangeExtension( BtlPath, ".txt")) ; @@ -36,14 +57,19 @@ namespace ib.essetre.integration.egaltech // Se non esistono pezzi, non faccio alcunché if ( parts == null) return false ; + int nStart = 0 ; // Reset entità di contorno libero _FcEnt = Constants.FcBaseId ; // Il seguente blocco 'using' si occupa della scrittura del file di testo, poi salvato in .btl - try { + try + { using ( var tw = new StreamWriter( BtlPath, false)) { + // Avvio scrittura parte geometrica + nStart = (bInit ? EgtStartBtlWriter() : 0); + tw.WriteLine( Constants.VERSION) ; tw.WriteLine( Constants.BUILD) ; tw.WriteLine( Constants.GENERAL) ; @@ -57,108 +83,114 @@ namespace ib.essetre.integration.egaltech tw.WriteLine( Constants.USERATTRIBUTE + "\"REFPOS\":" + "\"" + RefPos.ToString() + "\"") ; tw.WriteLine( Constants.USERATTRIBUTE + "\"PROJECT\":" + "\"" + ( IsFromProject ? "1" : "0") + "\"") ; - foreach ( Part singlePart in parts) { - tw.WriteLine( Constants.PART) ; - tw.WriteLine( Constants.SINGLE_MEMBER_NUMBER + singlePart.singleMemberNumber) ; - tw.WriteLine( Constants.MATERIAL + singlePart.Material) ; - tw.WriteLine( Constants.COUNT + singlePart.count) ; + if ( nStart <= 0) { + tw.WriteLine(Constants.USERATTRIBUTE + "\"PROGID\":" + "\"" + (bInit ? "1" : "0") + "\"") ; + } - double len = Convert.ToDouble( singlePart.length) * Math.Pow( 10, Constants.scaleUnit) ; - int intLen = Convert.ToInt32( len) ; - tw.WriteLine( Constants.LENGTH + intLen.ToString( "D8")) ; - - double hei = Convert.ToDouble( singlePart.height) * Math.Pow( 10, Constants.scaleUnit) ; - int intHei = Convert.ToInt32( hei) ; - tw.WriteLine( Constants.HEIGHT + intHei.ToString( "D8")) ; - - double wid = Convert.ToDouble( singlePart.width) * Math.Pow( 10, Constants.scaleUnit) ; - int intWid = Convert.ToInt32( wid) ; - tw.WriteLine( Constants.WIDTH + intWid.ToString( "D8")) ; - - string posX = singlePart.x.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; - tw.WriteLine( Constants.USERATTRIBUTE + "\"POSX\":" + "\"" + posX + "\"") ; - - string posY = singlePart.y.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; - tw.WriteLine( Constants.USERATTRIBUTE + "\"POSY\":" + "\"" + posY + "\"") ; - - string posZ = singlePart.z.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; - tw.WriteLine( Constants.USERATTRIBUTE + "\"POSZ\":" + "\"" + posZ + "\"") ; - - string inv = singlePart.inverted.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; - tw.WriteLine( Constants.USERATTRIBUTE + "\"INVERTED\":" + "\"" + inv + "\"") ; - - string rot = singlePart.rotated.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; - tw.WriteLine( Constants.USERATTRIBUTE + "\"ROTATED\":" + "\"" + rot + "\"") ; - - tw.WriteLine( Constants.USERATTRIBUTE + "\"TYPE\":" + "\"" + singlePart.Type + "\"") ; - - string CutId = ( IsFromProject ? singlePart.elementId : singlePart.cutId).ToString() ; - tw.WriteLine( Constants.USERATTRIBUTE + "\"CUTID\":" + "\"" + CutId + "\"") ; - - // Scrivo eventuale Outline - foreach ( Feature singleFeature in singlePart.features) { - // Assegno identificativo del processo - string TaskId = (IsFromProject ? singleFeature.processId : singleFeature.taskId).ToString() ; - // Se Outline (processo "251") elaborazione speciale - if ( singleFeature.processKey.Contains( "251")) { - WriteOutlineAperture( true, singleFeature, TaskId, tw) ; + if ( nStart > 0) { + foreach ( Part singlePart in parts) { + tw.WriteLine( Constants.PART) ; + tw.WriteLine( Constants.SINGLE_MEMBER_NUMBER + singlePart.singleMemberNumber) ; + tw.WriteLine( Constants.MATERIAL + singlePart.Material) ; + tw.WriteLine( Constants.COUNT + singlePart.count) ; + + double len = Convert.ToDouble( singlePart.length) * Math.Pow( 10, Constants.scaleUnit) ; + int intLen = Convert.ToInt32( len) ; + tw.WriteLine( Constants.LENGTH + intLen.ToString( "D8")) ; + + double hei = Convert.ToDouble( singlePart.height) * Math.Pow( 10, Constants.scaleUnit) ; + int intHei = Convert.ToInt32( hei) ; + tw.WriteLine( Constants.HEIGHT + intHei.ToString( "D8")) ; + + double wid = Convert.ToDouble( singlePart.width) * Math.Pow( 10, Constants.scaleUnit) ; + int intWid = Convert.ToInt32( wid) ; + tw.WriteLine( Constants.WIDTH + intWid.ToString( "D8")) ; + + string posX = singlePart.x.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; + tw.WriteLine( Constants.USERATTRIBUTE + "\"POSX\":" + "\"" + posX + "\"") ; + + string posY = singlePart.y.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; + tw.WriteLine( Constants.USERATTRIBUTE + "\"POSY\":" + "\"" + posY + "\"") ; + + string posZ = singlePart.z.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; + tw.WriteLine( Constants.USERATTRIBUTE + "\"POSZ\":" + "\"" + posZ + "\"") ; + + string inv = singlePart.inverted.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; + tw.WriteLine( Constants.USERATTRIBUTE + "\"INVERTED\":" + "\"" + inv + "\"") ; + + string rot = singlePart.rotated.ToString( "0.00", System.Globalization.CultureInfo.InvariantCulture) ; + tw.WriteLine( Constants.USERATTRIBUTE + "\"ROTATED\":" + "\"" + rot + "\"") ; + + tw.WriteLine( Constants.USERATTRIBUTE + "\"TYPE\":" + "\"" + singlePart.Type + "\"") ; + + string CutId = ( IsFromProject ? singlePart.elementId : singlePart.cutId).ToString() ; + tw.WriteLine( Constants.USERATTRIBUTE + "\"CUTID\":" + "\"" + CutId + "\"") ; + + // Scrivo eventuale Outline + foreach ( Feature singleFeature in singlePart.features) { + // Assegno identificativo del processo + string TaskId = (IsFromProject ? singleFeature.processId : singleFeature.taskId).ToString() ; + // Se Outline (processo "251") elaborazione speciale + if ( singleFeature.processKey.Contains( "251")) { + WriteOutlineAperture( true, singleFeature, TaskId, tw) ; + } } - } - - // Scrivo eventuali Aperture - foreach ( Feature singleFeature in singlePart.features) { - // Assegno identificativo del processo - string TaskId = (IsFromProject ? singleFeature.processId : singleFeature.taskId).ToString() ; - // Se Aperture (processo "252") elaborazione speciale - if ( singleFeature.processKey.Contains( "252")) { - WriteOutlineAperture( false, singleFeature, TaskId, tw) ; + + // Scrivo eventuali Aperture + foreach ( Feature singleFeature in singlePart.features) { + // Assegno identificativo del processo + string TaskId = (IsFromProject ? singleFeature.processId : singleFeature.taskId).ToString() ; + // Se Aperture (processo "252") elaborazione speciale + if ( singleFeature.processKey.Contains( "252")) { + WriteOutlineAperture( false, singleFeature, TaskId, tw) ; + } } - } - - // Scrivo tutti gli altri processi - foreach ( Feature singleFeature in singlePart.features) { - // Assegno identificativo del processo - string TaskId = ( IsFromProject ? singleFeature.processId : singleFeature.taskId).ToString() ; - // Se Outline (processo "251") o Aperture (processo "252") salto - if ( singleFeature.processKey.Contains( "251") || - singleFeature.processKey.Contains( "252")) { - ; - } - // Se Free Contour (processo "250") elaborazione speciale - else if ( singleFeature.processKey.Contains( "250")) { - WriteFreeContour( singleFeature, TaskId, tw) ; - } - // Altri processi - else { - bool bIsVariant = singleFeature.processKey.Contains("-900-") ; - // Tipo di Process - if ( bIsVariant) - tw.WriteLine( Constants.PROCESS_KEY + singleFeature.processKey + " " + singleFeature.processParameters[26]) ; - else - tw.WriteLine( Constants.PROCESS_KEY + singleFeature.processKey + " " + singleFeature.designation) ; - // Eventuale sistema di riferimto - WriteReference( singleFeature, tw) ; - // Parametri standard del Process ( 1 .. 26) - tw.Write( Constants.PROCESS_PARAMETERS) ; - for ( int i = 1 ; i <= 26 ; ++ i) { - string singleParameter = singleFeature.processParameters[i-1] ; - if ( i != 15 || ! ( singleFeature.processKey.Contains( "060") || singleFeature.processKey.Contains( "061"))) - tw.Write( "P" + i.ToString( "D2") + ":" + MultAndConvertTo8( singleParameter) + " ") ; + + // Scrivo tutti gli altri processi + foreach ( Feature singleFeature in singlePart.features) { + // Assegno identificativo del processo + string TaskId = ( IsFromProject ? singleFeature.processId : singleFeature.taskId).ToString() ; + // Se Outline (processo "251") o Aperture (processo "252") salto + if ( singleFeature.processKey.Contains( "251") || + singleFeature.processKey.Contains( "252")) { + ; + } + // Se Free Contour (processo "250") elaborazione speciale + else if ( singleFeature.processKey.Contains( "250")) { + WriteFreeContour( singleFeature, TaskId, tw) ; + } + // Altri processi + else { + bool bIsVariant = singleFeature.processKey.Contains("-900-") ; + // Tipo di Process + if ( bIsVariant) + tw.WriteLine( Constants.PROCESS_KEY + singleFeature.processKey + " " + singleFeature.processParameters[26]) ; else - tw.Write( "P" + i.ToString( "D2") + ":" + "\"" + singleFeature.text + "\" ") ; - } - tw.WriteLine( "") ; - // Parametri speciali Q diversi da 0, preceduti da "USERATTRIBUTE:" - for ( int i = 1 ; i <= 20 ; ++ i) { - string singleParameter = singleFeature.processParameters[i+25] ; - if ( ! singleParameter.Equals( "0") && ( ! bIsVariant || i != 1)) { - singleParameter = singleParameter.Replace( ",", ".") ; - tw.WriteLine( Constants.USERATTRIBUTE + "\"Q" + i.ToString( "D2") + "\":\"" + singleParameter + "\" ") ; + tw.WriteLine( Constants.PROCESS_KEY + singleFeature.processKey + " " + singleFeature.designation) ; + // Eventuale sistema di riferimto + WriteReference( singleFeature, tw) ; + // Parametri standard del Process ( 1 .. 26) + tw.Write( Constants.PROCESS_PARAMETERS) ; + for ( int i = 1 ; i <= 26 ; ++ i) { + string singleParameter = singleFeature.processParameters[i-1] ; + if ( i != 15 || ! ( singleFeature.processKey.Contains( "060") || singleFeature.processKey.Contains( "061"))) + tw.Write( "P" + i.ToString( "D2") + ":" + MultAndConvertTo8( singleParameter) + " ") ; + else + tw.Write( "P" + i.ToString( "D2") + ":" + "\"" + singleFeature.text + "\" ") ; } + tw.WriteLine( "") ; + // Parametri speciali Q diversi da 0, preceduti da "USERATTRIBUTE:" + for ( int i = 1 ; i <= 20 ; ++ i) { + string singleParameter = singleFeature.processParameters[i+25] ; + if ( ! singleParameter.Equals( "0") && ( ! bIsVariant || i != 1)) { + singleParameter = singleParameter.Replace( ",", ".") ; + tw.WriteLine( Constants.USERATTRIBUTE + "\"Q" + i.ToString( "D2") + "\":\"" + singleParameter + "\" ") ; + } + } + tw.WriteLine( Constants.PROCESS_IDENT + singleFeature.processIdent) ; + tw.WriteLine( Constants.PROCESS + singleFeature.process) ; + tw.WriteLine( Constants.USERATTRIBUTE + "\"TASKID\":" + "\"" + TaskId + "\"") ; } - tw.WriteLine( Constants.PROCESS_IDENT + singleFeature.processIdent) ; - tw.WriteLine( Constants.PROCESS + singleFeature.process) ; - tw.WriteLine( Constants.USERATTRIBUTE + "\"TASKID\":" + "\"" + TaskId + "\"") ; } } } @@ -168,11 +200,16 @@ namespace ib.essetre.integration.egaltech return false ; } - // Scrittura file ausiliario con dati che non fanno ricalcolare le lavorazioni - try { + // Concludo scrittura parte geometrica + bool bEnd = (bInit && EgtEndBtlWriter()) ; + + // Scrittura file ausiliario con dati che non fanno ricalcolare le lavorazioni + try + { using ( var tw = new StreamWriter( Path.ChangeExtension( BtlPath, ".btm"), false)) { tw.WriteLine( "[AuxData]") ; tw.WriteLine( "LOAD90=" + barLoad90) ; + tw.WriteLine( "PROGID=" + nStart.ToString()); } } catch { @@ -184,7 +221,7 @@ namespace ib.essetre.integration.egaltech // Il seguente metodo analizza il campo sag1 della singleFeature passata: se non è vuoto allora la stringa // viene splittata nei parametri P di POLY ed analizzata - public void WriteOutlineAperture( bool bOutline, Feature singleFeature, String TaskId, StreamWriter tw) + private void WriteOutlineAperture( bool bOutline, Feature singleFeature, String TaskId, StreamWriter tw) { // Se non ci sono dati, esco if (singleFeature.sag1 == "") @@ -306,7 +343,7 @@ namespace ib.essetre.integration.egaltech // Il seguente metodo analizza il campo sag1 della singleFeature passata: se non è vuoto allora la stringa // viene splittata nei parametri P di POLY ed analizzata - public void WriteFreeContour( Feature singleFeature, String TaskId, StreamWriter tw) + private void WriteFreeContour( Feature singleFeature, String TaskId, StreamWriter tw) { // Se non ci sono dati, esco if ( singleFeature.sag1 == "") { @@ -532,7 +569,7 @@ namespace ib.essetre.integration.egaltech } // Verifico se riferimento definito - public bool VerifyReference( Feature singleFeature) + private bool VerifyReference( Feature singleFeature) { bool bToEmit = false ; for ( int i = 1 ; i <= 9 ; ++ i) { @@ -546,7 +583,7 @@ namespace ib.essetre.integration.egaltech } // Se definito, scrittura del riferimento - public void WriteReference( Feature singleFeature, StreamWriter tw) + private void WriteReference( Feature singleFeature, StreamWriter tw) { // Se non definito esco if ( ! VerifyReference( singleFeature)) @@ -576,7 +613,7 @@ namespace ib.essetre.integration.egaltech // Il seguente metodo prende il valore di un Process Parameter, lo moltiplica per 10^scaleUnit // e lo converte in una stringa di 8 caratteri (i caratteri mancanti sono degli 0) - public string MultAndConvertTo8( string processParameter) + private string MultAndConvertTo8( string processParameter) { string rp = processParameter.Replace( ",", ".") ; double sp = Convert.ToDouble( rp, CultureInfo.InvariantCulture) * Math.Pow( 10, Constants.scaleUnit) ; @@ -585,7 +622,7 @@ namespace ib.essetre.integration.egaltech return s8 ; } - public string MultAndConvertTo8( double dVal) + private string MultAndConvertTo8( double dVal) { double sp = dVal * Math.Pow( 10, Constants.scaleUnit) ; int intSp = Convert.ToInt32( sp) ; diff --git a/IntegrationEgaltech/Properties/AssemblyInfo.cs b/IntegrationEgaltech/Properties/AssemblyInfo.cs index a8e1631..aceb688 100644 --- a/IntegrationEgaltech/Properties/AssemblyInfo.cs +++ b/IntegrationEgaltech/Properties/AssemblyInfo.cs @@ -12,9 +12,9 @@ using System.Runtime.InteropServices; #endif [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("EgalTech s.r.l.")] -[assembly: AssemblyProduct("IntegrationEgaltech")] -[assembly: AssemblyCopyright("Copyright © 2018-2023 by EgalTech s.r.l.")] +[assembly: AssemblyCompany("Egalware s.r.l.")] +[assembly: AssemblyProduct("Beam & Wall")] +[assembly: AssemblyCopyright("Copyright © 2018-2023 by Egalware s.r.l.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -36,5 +36,5 @@ using System.Runtime.InteropServices; // È 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("2.5.1.1")] -[assembly: AssemblyFileVersion("2.5.1.1")] +[assembly: AssemblyVersion("2.5.7.1")] +[assembly: AssemblyFileVersion("2.5.7.1")] diff --git a/IntegrationEgaltech2/BtlWriter.cpp b/IntegrationEgaltech2/BtlWriter.cpp new file mode 100644 index 0000000..0985a08 --- /dev/null +++ b/IntegrationEgaltech2/BtlWriter.cpp @@ -0,0 +1,81 @@ +//---------------------------------------------------------------------------- +// EgalTech 2023-2023 +//---------------------------------------------------------------------------- +// File : BtlWriter.cpp Data : 28.07.23 Versione : 2.5g1 +// Contenuto : Implementazione funzioni scrittura BTL. +// +// +// Modifiche : 28.07.23 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +//--------------------------- Include ---------------------------------------- +#include "stdafx.h" +#include "Int2API.h" +#include "/EgtDev/Include/SELkLockId.h" + +using namespace std ; + +//---------------------------------------------------------------------------- +static int s_nLockSN = 0 ; +static int s_nLockId = 0 ; + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtInitBtlWriter( void) +{ + // ammessa solo chiave di tipo hardware + if ( ! SetLockType( KEY_LOCK_TYPE_HW)) + return FALSE ; + + // non ammesse chiavi di rete + if ( ! SetNetHwKey( false, 0)) + return FALSE ; + + // verifico esistenza chiave OxySec + int nLockSN = 0 ; + if ( ! GetLockSN( nLockSN)) + nLockSN = 0 ; + s_nLockSN = nLockSN ; + + bool bOk = ( nLockSN > 0) ; + + return ( bOk ? TRUE : FALSE) ; +} + +//---------------------------------------------------------------------------- +int +__stdcall EgtStartBtlWriter( void) +{ + // verifico esistenza chiave OxySec inizializzata Egalware + string sLockId ; + if ( ! GetLockId( sLockId)) + sLockId = "" ; + + // eseguo test + bool bOk = ( ! sLockId.empty()) ; + + // recupero Id numerico della chiave + int nLockId = 0 ; + if ( bOk) { + if ( sLockId.find( KEY_LOCK_HW_START) != string::npos) { + sLockId = sLockId.substr( 7, 6) ; + nLockId = stoi( sLockId) ; + s_nLockId = nLockId ; + } + } + + return nLockId ; +} + +//---------------------------------------------------------------------------- +BOOL +__stdcall EgtEndBtlWriter( void) +{ + if ( s_nLockSN <= 0) + return FALSE ; + if ( s_nLockId <= 0) + return FALSE ; + return ( s_nLockSN > 0 && s_nLockId > 0) ; +} diff --git a/IntegrationEgaltech2/Int2API.h b/IntegrationEgaltech2/Int2API.h new file mode 100644 index 0000000..78000a8 --- /dev/null +++ b/IntegrationEgaltech2/Int2API.h @@ -0,0 +1,39 @@ +//---------------------------------------------------------------------------- +// EgalTech 2023-2023 +//---------------------------------------------------------------------------- +// File : Int2API.h Data : 28.07.23 Versione : 2.5g1 +// Contenuto : API (application programming interface). +// +// +// +// Modifiche : 28.07.23 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#define NOMINMAX +#include + +//----------------------- Macro per import/export ---------------------------- +#undef INT2_EXPORT +#if defined( I_AM_INT2) // da definirsi solo nella DLL + #define INT2_EXPORT __declspec( dllexport) +#else + #define INT2_EXPORT __declspec( dllimport) +#endif + +//----------------------------------------------------------------------------- +#ifdef __cplusplus +extern "C" { +#endif + +// API +INT2_EXPORT BOOL __stdcall EgtInitBtlWriter( void) ; +INT2_EXPORT int __stdcall EgtStartBtlWriter( void) ; +INT2_EXPORT BOOL __stdcall EgtEndBtlWriter( void) ; + +#ifdef __cplusplus +} +#endif diff --git a/IntegrationEgaltech2/IntegrationEgaltech2.aps b/IntegrationEgaltech2/IntegrationEgaltech2.aps new file mode 100644 index 0000000..c18483e Binary files /dev/null and b/IntegrationEgaltech2/IntegrationEgaltech2.aps differ diff --git a/IntegrationEgaltech2/IntegrationEgaltech2.rc b/IntegrationEgaltech2/IntegrationEgaltech2.rc new file mode 100644 index 0000000..d62828f Binary files /dev/null and b/IntegrationEgaltech2/IntegrationEgaltech2.rc differ diff --git a/IntegrationEgaltech2/IntegrationEgaltech2.vcxproj b/IntegrationEgaltech2/IntegrationEgaltech2.vcxproj new file mode 100644 index 0000000..8f1bd1d --- /dev/null +++ b/IntegrationEgaltech2/IntegrationEgaltech2.vcxproj @@ -0,0 +1,138 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + 16.0 + Win32Proj + {69c15767-8e9e-42be-b8f8-aea49dc572ce} + IntegrationEgaltech2 + 7.0 + + + + DynamicLibrary + true + v141_xp + Unicode + + + DynamicLibrary + false + v141_xp + true + Unicode + + + + + + + + + + + + + + + $(ProjectName)R$(PlatformArchitecture) + $(SolutionDir)$(ProjectName)\$(Configuration)$(PlatformArchitecture)\ + false + $(Configuration)$(PlatformArchitecture)\ + + + $(ProjectName)D$(PlatformArchitecture) + $(SolutionDir)$(ProjectName)\$(Configuration)$(PlatformArchitecture)\ + false + $(Configuration)$(PlatformArchitecture)\ + + + + Level3 + true + WIN32;I_AM_INT2;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + false + Use + stdafx.h + ProgramDatabase + stdcpp17 + false + + + Windows + true + false + C:\EgtDev\Extern\OxySec\Lib\x32\xnodus32.obj;%(AdditionalDependencies) + + + copy $(TargetPath) \EgtProg\Integration +copy $(TargetPath) \TechnoEssetre7 + + + _DEBUG;%(PreprocessorDefinitions) + + + + + Level3 + true + true + true + WIN32;I_AM_INT2;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + false + Use + stdafx.h + AnySuitable + Speed + true + true + true + false + stdcpp17 + + + Windows + true + true + false + false + C:\EgtDev\Extern\OxySec\Lib\x32\xnodus32.obj;%(AdditionalDependencies) + UseLinkTimeCodeGeneration + + + copy $(TargetPath) \EgtProg\Integration +copy $(TargetPath) \TechnoEssetre7 + + + NDEBUG;%(PreprocessorDefinitions) + + + + + + + + + + + + Create + Create + + + + + + + + + \ No newline at end of file diff --git a/IntegrationEgaltech2/IntegrationEgaltech2.vcxproj.filters b/IntegrationEgaltech2/IntegrationEgaltech2.vcxproj.filters new file mode 100644 index 0000000..6bff7f0 --- /dev/null +++ b/IntegrationEgaltech2/IntegrationEgaltech2.vcxproj.filters @@ -0,0 +1,44 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/IntegrationEgaltech2/dllmain.cpp b/IntegrationEgaltech2/dllmain.cpp new file mode 100644 index 0000000..f70eecd --- /dev/null +++ b/IntegrationEgaltech2/dllmain.cpp @@ -0,0 +1,37 @@ +//---------------------------------------------------------------------------- +// EgalTech 2023-2023 +//---------------------------------------------------------------------------- +// File : Int2DllMain.cpp Data : 28.07.23 Versione : 2.5g3 +// Contenuto : Inizializzazione della DLL. +// +// +// +// Modifiche : 28.07.23 DS Creazione modulo. +// +// +// +//---------------------------------------------------------------------------- + +//--------------------------- Include ---------------------------------------- +#include "stdafx.h" +#define NOMINMAX +#include +#include "/EgtDev/Include/EgtTrace.h" + +//---------------------------------------------------------------------------- +BOOL APIENTRY +DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved) +{ + switch ( dwReason) { + case DLL_PROCESS_ATTACH : + EGT_TRACE( "IntegrationEgaltech2.dll Initializing!\n") ; + break ; + case DLL_THREAD_ATTACH : + case DLL_THREAD_DETACH : + case DLL_PROCESS_DETACH : + EGT_TRACE( "IntegrationEgaltech2.dll Terminating!\n") ; + break ; + } + + return TRUE ; +} diff --git a/IntegrationEgaltech2/resource.h b/IntegrationEgaltech2/resource.h new file mode 100644 index 0000000..94312d3 --- /dev/null +++ b/IntegrationEgaltech2/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by IntegrationEgaltech2.rc +// +#define VS_VERSION_INFO1 2 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/IntegrationEgaltech2/stdafx.cpp b/IntegrationEgaltech2/stdafx.cpp new file mode 100644 index 0000000..447c795 --- /dev/null +++ b/IntegrationEgaltech2/stdafx.cpp @@ -0,0 +1,5 @@ +// stdafx.cpp: source file corresponding to the pre-compiled header + +#include "stdafx.h" + +// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/IntegrationEgaltech2/stdafx.h b/IntegrationEgaltech2/stdafx.h new file mode 100644 index 0000000..dfcb511 --- /dev/null +++ b/IntegrationEgaltech2/stdafx.h @@ -0,0 +1,32 @@ +// stdafx.h: This is a precompiled header file. +// Files listed below are compiled only once, improving build performance for future builds. +// This also affects IntelliSense performance, including code completion and many code browsing features. +// However, files listed here are ALL re-compiled if any one of them is updated between builds. +// Do not add files here that you will be updating frequently as this negates the performance advantage. + +#pragma once + +#include "/EgtDev/Include/EgtTargetVer.h" + +#include +#include +#include +#include + +// in Debug riconoscimento memory leakage +#if defined( _DEBUG) + #define _CRTDBG_MAP_ALLOC + #include + #include +#endif + +// in Debug controllo iteratori +#if defined( _DEBUG) + #define _SECURE_SCL 1 +#else + #define _SECURE_SCL 0 +#endif + +#include "/EgtDev/Include/EgtLibVer.h" + +#pragma comment(lib, EGTLIBDIR "SEgtLock" EGTLIBVER ".lib")