Integration 2.5g1 :
- aggiunta dll con codice nativo usata per scrittura BTL.
This commit is contained in:
@@ -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
|
||||
+142
-105
@@ -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) ;
|
||||
|
||||
@@ -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")]
|
||||
|
||||
@@ -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) ;
|
||||
}
|
||||
@@ -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 <windows.h>
|
||||
|
||||
//----------------------- 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
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{69c15767-8e9e-42be-b8f8-aea49dc572ce}</ProjectGuid>
|
||||
<RootNamespace>IntegrationEgaltech2</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>7.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141_xp</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<TargetName>$(ProjectName)R$(PlatformArchitecture)</TargetName>
|
||||
<OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)$(PlatformArchitecture)\</OutDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IntDir>$(Configuration)$(PlatformArchitecture)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<TargetName>$(ProjectName)D$(PlatformArchitecture)</TargetName>
|
||||
<OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)$(PlatformArchitecture)\</OutDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IntDir>$(Configuration)$(PlatformArchitecture)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;I_AM_INT2;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<OpenMPSupport>false</OpenMPSupport>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>C:\EgtDev\Extern\OxySec\Lib\x32\xnodus32.obj;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(TargetPath) \EgtProg\Integration
|
||||
copy $(TargetPath) \TechnoEssetre7</Command>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;I_AM_INT2;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
<OmitFramePointers>true</OmitFramePointers>
|
||||
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
<OpenMPSupport>false</OpenMPSupport>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalDependencies>C:\EgtDev\Extern\OxySec\Lib\x32\xnodus32.obj;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>copy $(TargetPath) \EgtProg\Integration
|
||||
copy $(TargetPath) \TechnoEssetre7</Command>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Int2API.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BtlWriter.cpp" />
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="IntegrationEgaltech2.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Int2API.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BtlWriter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="IntegrationEgaltech2.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -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 <windows.h>
|
||||
#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 ;
|
||||
}
|
||||
@@ -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
|
||||
@@ -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.
|
||||
@@ -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 <cstdio>
|
||||
#include <tchar.h>
|
||||
#include <cfloat>
|
||||
#include <cmath>
|
||||
|
||||
// in Debug riconoscimento memory leakage
|
||||
#if defined( _DEBUG)
|
||||
#define _CRTDBG_MAP_ALLOC
|
||||
#include <stdlib.h>
|
||||
#include <crtdbg.h>
|
||||
#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")
|
||||
Reference in New Issue
Block a user