Compare commits

..

75 Commits

Author SHA1 Message Date
Emmanuele Sassi 88b9226bcb - gestione log macchina con timer
- aggiornamento log macchina durante produzione pezzi
2023-06-12 09:13:30 +02:00
Emmanuele Sassi 9f4e025305 - scrittura e lettura da ini dei filtri del log macchina
- Aggiunta testi per filtri log macchina
2023-06-09 17:48:57 +02:00
Emmanuele Sassi ecbd6ecd66 - modifiche per log macchina su supervisore 2023-06-09 14:57:53 +02:00
Emmanuele Sassi e701f54c07 EgtBEAMWALL 2.5e4 :
- ricompilazione con cambio versione
2023-06-01 17:43:27 +02:00
Emmanuele Sassi 2a2728505f Merge branch 'CorrezioneCreazioneGrezzi' 2023-06-01 17:38:08 +02:00
Emmanuele Sassi a5dc629e21 Merge branch 'master' of https://gitlab.steamware.net/egaltech/egtbeamwall 2023-06-01 17:37:33 +02:00
Emmanuele Sassi c7fbe8a26a - aggiornato componente EntityFramework 6 per Oracle
- corretto errore creazione grezzo
2023-06-01 17:37:15 +02:00
Emmanuele Sassi b43a8ff2bb - correzione creazione grezzi 2023-06-01 11:34:33 +02:00
DarioS 6cf303deca EgtBEAMWALL 2.5e3 :
- aggiunta gestione PRIORITY di Feature per sole pareti su macchine Wall
- aggiunta gestione chiave di rete.
2023-05-31 18:33:47 +02:00
DarioS 855762095f EgtBEAMWALL :
- aggiornati codici di protezione mensili e librerie di dipendenza.
2023-05-11 12:51:04 +02:00
Emmanuele Sassi 733fd4dc09 EgtBEAMWALL 2.5e2 :
- aggiornata versione
2023-05-11 11:23:09 +02:00
Emmanuele Sassi 71a4985392 Merge branch 'DataLayer' 2023-05-11 11:20:59 +02:00
Emmanuele Sassi 0d4d9a4520 - commento DumpDb di test che reintrodurro' per backup 2023-05-11 11:19:48 +02:00
Samuele Locatelli 622439de62 Update procedura DUMP BACKUP 2023-05-11 10:42:35 +02:00
Samuele Locatelli 618d02d7c6 Update DbConfig x DUMP 2023-05-11 10:35:23 +02:00
Emmanuele Sassi d37df9d0f4 agvgiunta test cxreazione backup db 2023-05-11 09:53:55 +02:00
Samuele Locatelli 011673510d Aggiunto dumpDB (da testare) 2023-05-11 09:28:23 +02:00
Samuele Locatelli ff52b9a79b Spostamento procedura riduzione elenco pezzi da eliminare 2023-05-10 17:53:35 +02:00
Samuele Locatelli 85a5200e6b ottimizzazione recupero dati da MG --> parts 2023-05-10 17:32:34 +02:00
Samuele Locatelli 0e665ef1b0 MG e PartList:
- update BtlPartId
- rimozione part non + esistenti
2023-05-10 17:29:35 +02:00
Samuele Locatelli 2b99df6238 Merge remote-tracking branch 'origin/master' into DataLayer 2023-05-09 19:21:35 +02:00
Samuele Locatelli 39ea11a8c4 Eliminazione metodi public static x possibile interferenza 2023-05-09 19:21:18 +02:00
DarioS 79c7e3e536 EgtBEAMWALL 2.5e1 :
- ricompilazione con cambio versione.
2023-05-04 17:50:59 +02:00
Emmanuele Sassi e4eb264abb EgtBEAMWALL 2.5d2 :
- aggiunto bottone per aggiungere piu' Proj alle stesso Prod
- reso AddProj attivabile da ini
2023-04-20 10:58:34 +02:00
DarioS 500aa2eacf EgtBEAMWALL :
- corretto posizionamenti pezzi aggiunti a progetto da BTL.
2023-04-17 17:19:50 +02:00
Emmanuele Sassi b55810f235 - modificate funzioni di gestione progetto da sub a function 2023-04-11 10:14:20 +02:00
DarioS b898346efb EgtBEAMWALL 2.5d1 :
- ricompilazione con cambio versione.
2023-04-07 18:48:43 +02:00
DarioS 586e4689ae Merge branch 'DataLayer' of https://gitlab.steamware.net/egaltech/egtbeamwall 2023-04-07 18:42:06 +02:00
DarioS 7668aa5766 Merge remote-tracking branch 'origin/develop' 2023-04-07 18:24:03 +02:00
Samuele Locatelli e64090bfaf MachGroupController: update x check errori su record missing 2023-04-06 16:32:42 +02:00
Samuele Locatelli 7c71fd4842 Update prod controller come prec 2023-04-06 16:20:33 +02:00
Samuele Locatelli 888bf0fcf8 Update partcontroller 2023-04-06 16:10:40 +02:00
Samuele Locatelli 009f22e146 ProjController
- modifica metodi update x evitare eccezioni quando il dato manca
2023-04-06 16:08:52 +02:00
Samuele Locatelli ef14b08737 Merge branch 'develop' into DataLayer 2023-04-06 15:18:35 +02:00
Emmanuele Sassi 8f9bd3ecb7 - correzioni per eccezioni nullRerference
- introdotte StringToDoubleAdv e StringToLenAdv per evitare conflitti tra thread sulla valutazione espressioni
2023-04-06 15:15:32 +02:00
Samuele Locatelli 3eb6518ea4 Merge branch 'develop' into DataLayer 2023-04-06 15:10:59 +02:00
Emmanuele Sassi b15eb92785 - eliminata conversione inutile in StringToDouble delle variabili lette da controllo
- aggiornate librerie
2023-04-05 12:30:50 +02:00
Emmanuele Sassi 96511ca335 Merge branch 'develop' 2023-03-31 15:12:12 +02:00
Emmanuele Sassi 974dee54da - correzione a scrittura file ini DataGrid con valore originale di ReadOnly 2023-03-31 15:11:43 +02:00
DarioS 7e52ce986f Merge remote-tracking branch 'origin/develop' 2023-03-31 15:00:39 +02:00
Emmanuele Sassi 4fc4875b91 Merge branch 'NestingParetiDaBtl' into develop 2023-03-31 13:00:14 +02:00
Emmanuele Sassi b3138d1982 - nella scrittura file ini DataGrid scrivo sempre valore originale di ReadOnly 2023-03-31 12:59:19 +02:00
DarioS e87622ef5d - Corretta lettura abilitazione stampa da Ini 2023-03-31 11:41:11 +02:00
DarioS aafe52d2da Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall 2023-03-31 11:05:46 +02:00
Emmanuele Sassi ffe53bf725 - aggiunto flag di stampa etichetta in configurazione 2023-03-31 11:03:13 +02:00
Emmanuele Sassi 832ea7aec5 Merge branch 'TestLmLegno' into develop 2023-03-31 10:41:41 +02:00
Emmanuele Sassi 6d9a157b35 EgtBEAMWALL 2.5c2 :
- aggiunti nuovi campi per etichetta
- aggiunta gestione salvataggio su singole pagine in configurazione
- corretto mancato ricaricamento progetto dopo modifica parametri Q di default
- correzione StartCut che manteneva valori errati
- corretta possibilita' di edit W su grezzi travi
- corretta visualizzazione solido clickando ShowAll
2023-03-31 10:41:26 +02:00
DarioS 71afc6554e EgtBEAMWALL :
- altre correzioni a nesting da BTL (interpretazione vari casi sulla base di esempi).
2023-03-30 10:40:27 +02:00
DarioS bc40da74ab EgtBEAMWALL :
- modifiche per nesting da BTL (per pannelli da HsbCAD nel piano BTL XY anzichè ZX)
- aggiunto flag da INI ( [Import] WallOppositeSideNesting=0/1) per ribaltare faccia sopra del nesting da BTL.
2023-03-28 11:19:51 +02:00
Emmanuele Sassi 405fde996c Merge branch 'ModificheOlandese' into TestLmLegno 2023-03-20 12:05:36 +01:00
DarioS 8321f09af8 EgtBeamWall 2.5c1 :
- sistemazioni per riferimenti su tavola di macchine pareti.
2023-03-13 08:21:04 +01:00
DarioS 391583b9ea Merge remote-tracking branch 'origin/develop' 2023-03-08 20:14:57 +01:00
Emmanuele Sassi 5cf0472806 - import del progetto compreso dei bwe di ottimizzazione se userlevel >5 e con flag nell'ini 2023-03-08 18:39:38 +01:00
Emmanuele Sassi 89598c154e Merge branch 'master' into develop 2023-03-07 10:40:58 +01:00
Emmanuele Sassi 785792d63b - correzione per interrompere nesting in caso di errore 2023-03-07 10:39:34 +01:00
DarioS 5874a39b25 EgtBEAMWALL 2.5b3 :
- ricompilazione con cambio versione.
2023-02-28 11:46:13 +01:00
DarioS 43f3f2f6d8 EgtBeamWall 2.5a2 :
- ricompilazione e alcune migliorie.
2023-01-17 11:35:28 +01:00
Emmanuele Sassi 79a883a303 EgtBEAMWALL 2.5a1 :
- correzione errore su salvataggio materiale in warehouse
- su creazione RawPart pareti senza misure aggiungo kerf a dimensioni pezzo
2023-01-10 16:30:14 +01:00
Emmanuele Sassi e3f88296e5 Merge branch 'master' of https://gitlab.steamware.net/egaltech/egtbeamwall 2022-12-23 17:55:30 +01:00
Emmanuele Sassi e207ed7ece - correzioni al warehouse con last material 2022-12-23 17:55:27 +01:00
DarioS e97175765b EgtBEAMWALL :
- correzioni per modifica angoli di Contorni Liberi e similia.
2022-12-23 17:42:35 +01:00
DarioS 6a0ebb9fee EgtBEAMWALL :
- completamento gestione PosZ di pannello in Ottimizzazione di Wall.
2022-12-22 16:25:59 +01:00
Emmanuele Sassi 0a698dae34 Merge branch 'AddBeamPosZ' 2022-12-22 15:34:19 +01:00
DarioS b74c052dd1 EgtBeamWall :
- modifiche e correzioni per gestione Solidi.
2022-12-20 16:46:18 +01:00
Emmanuele Sassi 330e501277 - gestione fallimento salvataggio 2022-12-19 19:31:25 +01:00
Emmanuele Sassi b7d62ace2c - correzione al funzionamento magazzino 2022-12-17 12:20:36 +01:00
Samuele Locatelli c6f353ec35 Modifica controller Prod
- salvataggio machGroup con controllo duplicati per ID
2022-12-17 12:17:10 +01:00
Samuele Locatelli 0b7bdd6ade Merge branch 'master' into DataLayer 2022-12-17 12:07:08 +01:00
Emmanuele Sassi 3febbbbcbf EgtBEAMWALL 2.4l2 :
- correzione precedente tentativo miglioramento comunicazione axium
- correzioni log macchina
- correzione inversione multipezzo in assemblato
- aggiornamento icone
2022-12-15 09:17:35 +01:00
Emmanuele Sassi 31874a8b92 - correzione non riconoscimento sezione su nuova lunghezza barra 2022-12-07 11:00:15 +01:00
Emmanuele Sassi c75d9d6bc2 Merge branch 'RawPartLastCreation' 2022-12-07 10:26:03 +01:00
DarioS 2b306763c6 EgtBEAMWALL 2.4l1 :
- mpostazione eventuale Cplane proprio di FreeContour quando si entra in Modifica
- all'uscita dalla Modifica di FreeContour ora si imposta Cplane globale.
2022-12-04 16:47:09 +01:00
DarioS f1b0a28e71 EgtBEAMWALL :
- corretto cambio ultimo parametro geometrico di feature (il tipo veniva sovrascritto dal booleano bDo).
2022-11-25 15:42:52 +01:00
Emmanuele Sassi 121f02fb0c Merge branch 'RawPartLastCreation' into AddBeamPosZ 2022-11-25 15:05:41 +01:00
Emmanuele Sassi b25d73c0cb - Estensione dati per etichette
- Traduzione errori della categoria CNC
- Verifica esistenza ed eventuale eliminazione vecchio gruppo in cui disegno FreeContour
2022-11-03 17:06:42 +01:00
106 changed files with 2930 additions and 13457 deletions
+14 -1
View File
@@ -90,6 +90,16 @@ Public Class BTLFeatureM
End Set End Set
End Property End Property
Protected m_nPriority As Integer = 0
Public Overridable Property nPriority As Integer
Get
Return m_nPriority
End Get
Set(value As Integer)
m_nPriority = value
End Set
End Property
' Nome ' Nome
Protected m_sName As String Protected m_sName As String
Public ReadOnly Property sName As String Public ReadOnly Property sName As String
@@ -244,10 +254,11 @@ Public Class BTLFeatureM
Dim NewBTLFeature As New BTLFeatureM Dim NewBTLFeature As New BTLFeatureM
NewBTLFeature.m_ParentPart = ParentPart NewBTLFeature.m_ParentPart = ParentPart
NewBTLFeature.m_nFeatureId = nFeatureId NewBTLFeature.m_nFeatureId = nFeatureId
' leggo gruppo, numero feature e lato ' leggo gruppo, numero feature, lato e priorità
EgtGetInfo(nFeatureId, BTL_FTR_GRP, NewBTLFeature.m_nSelGRP) EgtGetInfo(nFeatureId, BTL_FTR_GRP, NewBTLFeature.m_nSelGRP)
EgtGetInfo(nFeatureId, BTL_FTR_PRC, NewBTLFeature.m_nPRC) EgtGetInfo(nFeatureId, BTL_FTR_PRC, NewBTLFeature.m_nPRC)
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.m_nSelSIDE) EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.m_nSelSIDE)
EgtGetInfo(nFeatureId, BTL_FTR_PRIORITY, NewBTLFeature.m_nPRIORITY)
Dim nDO As Integer = 1 Dim nDO As Integer = 1
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
NewBTLFeature.m_bDO = (nDO <> 0) NewBTLFeature.m_bDO = (nDO <> 0)
@@ -309,6 +320,7 @@ Public Class BTLFeatureM
NewBTLFeature.m_nPRC = nPRC NewBTLFeature.m_nPRC = nPRC
NewBTLFeature.m_nSelGRP = nGRP NewBTLFeature.m_nSelGRP = nGRP
NewBTLFeature.m_nSelSIDE = nSIDE NewBTLFeature.m_nSelSIDE = nSIDE
NewBTLFeature.m_nPriority = 0
NewBTLFeature.m_bDO = True NewBTLFeature.m_bDO = True
' crea parametri per questa feature da file ini ' crea parametri per questa feature da file ini
NewBTLFeature.CreateFeatureParams(NewBTLFeature) NewBTLFeature.CreateFeatureParams(NewBTLFeature)
@@ -533,6 +545,7 @@ Public Class BTLFeatureM
For Each QPar In QBTLParamMList For Each QPar In QBTLParamMList
If QPar.bCustom Then EgtSetInfo(nFeatureId, QPar.sName & "A", 1) If QPar.bCustom Then EgtSetInfo(nFeatureId, QPar.sName & "A", 1)
Next Next
EgtSetInfo( nFeatureId, BTL_FTR_PRIORITY, nPriority)
SetFeatureId(nFeatureId) SetFeatureId(nFeatureId)
' imposto modificato per copie ' imposto modificato per copie
EgtDuploSetModified(ParentPart.nPartId) EgtDuploSetModified(ParentPart.nPartId)
+40 -40
View File
@@ -797,15 +797,15 @@ Public Class BTLPartM
Dim vtVersY As New Vector3d Dim vtVersY As New Vector3d
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries) sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 9 Then If sValArray.Count() >= 9 Then
StringToLen(sValArray(0), ptOri.x) StringToLenAdv(sValArray(0), ptOri.x)
StringToLen(sValArray(1), ptOri.y) StringToLenAdv(sValArray(1), ptOri.y)
StringToLen(sValArray(2), ptOri.z) StringToLenAdv(sValArray(2), ptOri.z)
StringToDouble(sValArray(3), vtVersX.x) StringToDoubleAdv(sValArray(3), vtVersX.x)
StringToDouble(sValArray(4), vtVersX.y) StringToDoubleAdv(sValArray(4), vtVersX.y)
StringToDouble(sValArray(5), vtVersX.z) StringToDoubleAdv(sValArray(5), vtVersX.z)
StringToDouble(sValArray(6), vtVersY.x) StringToDoubleAdv(sValArray(6), vtVersY.x)
StringToDouble(sValArray(7), vtVersY.y) StringToDoubleAdv(sValArray(7), vtVersY.y)
StringToDouble(sValArray(8), vtVersY.z) StringToDoubleAdv(sValArray(8), vtVersY.z)
NewBTLPart.m_refTransf.ChangeOrigin(ptOri) NewBTLPart.m_refTransf.ChangeOrigin(ptOri)
NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
End If End If
@@ -815,10 +815,10 @@ Public Class BTLPartM
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue) EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries) sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 10 Then If sValArray.Count() >= 10 Then
StringToLen(sValArray(3), NewBTLPart.m_dCamberLen1) StringToLenAdv(sValArray(3), NewBTLPart.m_dCamberLen1)
StringToLen(sValArray(5), NewBTLPart.m_dCamberLen2) StringToLenAdv(sValArray(5), NewBTLPart.m_dCamberLen2)
StringToLen(sValArray(7), NewBTLPart.m_dCamberLen3) StringToLenAdv(sValArray(7), NewBTLPart.m_dCamberLen3)
StringToLen(sValArray(9), NewBTLPart.m_dCamberCross3) StringToLenAdv(sValArray(9), NewBTLPart.m_dCamberCross3)
End If End If
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
Dim pTo As Integer = sValue.LastIndexOf(" P01") Dim pTo As Integer = sValue.LastIndexOf(" P01")
@@ -830,10 +830,10 @@ Public Class BTLPartM
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue) EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries) sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 10 Then If sValArray.Count() >= 10 Then
StringToLen(sValArray(3), NewBTLPart.m_dPartOffsetSide1) StringToLenAdv(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
StringToLen(sValArray(5), NewBTLPart.m_dPartOffsetSide2) StringToLenAdv(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
StringToLen(sValArray(7), NewBTLPart.m_dPartOffsetSide3) StringToLenAdv(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
StringToLen(sValArray(9), NewBTLPart.m_dPartOffsetSide4) StringToLenAdv(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
End If End If
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
pTo = sValue.LastIndexOf(" P11") pTo = sValue.LastIndexOf(" P11")
@@ -883,9 +883,9 @@ Public Class BTLPartM
NewBTLPart.m_refGrainDir = New Vector3d NewBTLPart.m_refGrainDir = New Vector3d
sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries) sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 4 Then If sValArray.Count() >= 4 Then
StringToDouble(sValArray(0), NewBTLPart.m_refGrainDir.x) StringToDoubleAdv(sValArray(0), NewBTLPart.m_refGrainDir.x)
StringToDouble(sValArray(1), NewBTLPart.m_refGrainDir.y) StringToDoubleAdv(sValArray(1), NewBTLPart.m_refGrainDir.y)
StringToDouble(sValArray(2), NewBTLPart.m_refGrainDir.z) StringToDoubleAdv(sValArray(2), NewBTLPart.m_refGrainDir.z)
NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1) NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
End If End If
@@ -1044,15 +1044,15 @@ Public Class BTLPartM
' Dim vtVersY As New Vector3d ' Dim vtVersY As New Vector3d
' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries) ' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 9 Then ' If sValArray.Count() >= 9 Then
' StringToLen(sValArray(0), ptOri.x) ' StringToLenAdv(sValArray(0), ptOri.x)
' StringToLen(sValArray(1), ptOri.y) ' StringToLenAdv(sValArray(1), ptOri.y)
' StringToLen(sValArray(2), ptOri.z) ' StringToLenAdv(sValArray(2), ptOri.z)
' StringToDouble(sValArray(3), vtVersX.x) ' StringToDoubleAdv(sValArray(3), vtVersX.x)
' StringToDouble(sValArray(4), vtVersX.y) ' StringToDoubleAdv(sValArray(4), vtVersX.y)
' StringToDouble(sValArray(5), vtVersX.z) ' StringToDoubleAdv(sValArray(5), vtVersX.z)
' StringToDouble(sValArray(6), vtVersY.x) ' StringToDoubleAdv(sValArray(6), vtVersY.x)
' StringToDouble(sValArray(7), vtVersY.y) ' StringToDoubleAdv(sValArray(7), vtVersY.y)
' StringToDouble(sValArray(8), vtVersY.z) ' StringToDoubleAdv(sValArray(8), vtVersY.z)
' m_refTransf.ChangeOrigin(ptOri) ' m_refTransf.ChangeOrigin(ptOri)
' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) ' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
' End If ' End If
@@ -1063,10 +1063,10 @@ Public Class BTLPartM
' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue) ' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries) ' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 5 Then ' If sValArray.Count() >= 5 Then
' StringToLen(sValArray(3), m_dCamberLen1) ' StringToLenAdv(sValArray(3), m_dCamberLen1)
' StringToLen(sValArray(5), m_dCamberLen2) ' StringToLenAdv(sValArray(5), m_dCamberLen2)
' StringToLen(sValArray(7), m_dCamberLen3) ' StringToLenAdv(sValArray(7), m_dCamberLen3)
' StringToLen(sValArray(9), m_dCamberCross3) ' StringToLenAdv(sValArray(9), m_dCamberCross3)
' End If ' End If
' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length ' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
' Dim pTo As Integer = sValue.LastIndexOf(" P01") ' Dim pTo As Integer = sValue.LastIndexOf(" P01")
@@ -1078,10 +1078,10 @@ Public Class BTLPartM
' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue) ' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries) ' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 5 Then ' If sValArray.Count() >= 5 Then
' StringToLen(sValArray(3), m_dPartOffsetSide1) ' StringToLenAdv(sValArray(3), m_dPartOffsetSide1)
' StringToLen(sValArray(5), m_dPartOffsetSide2) ' StringToLenAdv(sValArray(5), m_dPartOffsetSide2)
' StringToLen(sValArray(7), m_dPartOffsetSide3) ' StringToLenAdv(sValArray(7), m_dPartOffsetSide3)
' StringToLen(sValArray(9), m_dPartOffsetSide4) ' StringToLenAdv(sValArray(9), m_dPartOffsetSide4)
' End If ' End If
' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length ' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
' pTo = sValue.LastIndexOf(" P11") ' pTo = sValue.LastIndexOf(" P11")
@@ -1105,9 +1105,9 @@ Public Class BTLPartM
' m_refGrainDir = New Vector3d ' m_refGrainDir = New Vector3d
' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries) ' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 4 Then ' If sValArray.Count() >= 4 Then
' StringToDouble(sValArray(0), m_refGrainDir.x) ' StringToDoubleAdv(sValArray(0), m_refGrainDir.x)
' StringToDouble(sValArray(1), m_refGrainDir.y) ' StringToDoubleAdv(sValArray(1), m_refGrainDir.y)
' StringToDouble(sValArray(2), m_refGrainDir.z) ' StringToDoubleAdv(sValArray(2), m_refGrainDir.z)
' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1) ' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
' End If ' End If
+5
View File
@@ -175,8 +175,10 @@
Public Const BTL_PRT_REFSIDE = "REFERENCESIDE" Public Const BTL_PRT_REFSIDE = "REFERENCESIDE"
Public Const BTL_PRT_ALIGNMENT = "ALIGNMENT" Public Const BTL_PRT_ALIGNMENT = "ALIGNMENT"
Public Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE" Public Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE"
Public Const BTL_PRT_DESCRIPTION = "NAM"
' parametri generici ' parametri generici
Public Const BTL_GEN_BTLPATH = "BTL"
Public Const BTL_GEN_PROJNUM = "PROJECTNUMBER" Public Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
Public Const BTL_GEN_PROJNAME = "PROJECTNAME" Public Const BTL_GEN_PROJNAME = "PROJECTNAME"
Public Const BTL_GEN_PROJPART = "PROJECTPART" Public Const BTL_GEN_PROJPART = "PROJECTPART"
@@ -204,6 +206,7 @@
Public Const BTL_FTR_PRC As String = "PRC" Public Const BTL_FTR_PRC As String = "PRC"
Public Const BTL_FTR_DO As String = "DO" Public Const BTL_FTR_DO As String = "DO"
Public Const BTL_FTR_SIDE As String = "SIDE" Public Const BTL_FTR_SIDE As String = "SIDE"
Public Const BTL_FTR_PRIORITY As String = "PRIORITY"
Public Const BTL_FTR_NAME As String = "NAME" Public Const BTL_FTR_NAME As String = "NAME"
Public Const BTL_FTR_DES As String = "DES" Public Const BTL_FTR_DES As String = "DES"
Public Const BTL_FTR_PRID As String = "PRID" Public Const BTL_FTR_PRID As String = "PRID"
@@ -299,6 +302,8 @@
Public Const BTLFILENAME As String = "BTLFILENAME" Public Const BTLFILENAME As String = "BTLFILENAME"
Public Const EXP_PART As String = "ImportExport" Public Const EXP_PART As String = "ImportExport"
Public Const EXP_MACHINE As String = "Machine" Public Const EXP_MACHINE As String = "Machine"
' parametro che indica se il progetto e' stato appena importato e quindi bisogna riverificare i MachGroup
Public Const IMP_VERIFYMACHGROUP As String = "VerifyMachGroup"
' parametri modifica percorsi free contour ' parametri modifica percorsi free contour
Public Const PATH_SIDEANGLAYER As String = "SideAngLayer" Public Const PATH_SIDEANGLAYER As String = "SideAngLayer"
@@ -16,5 +16,6 @@
Public Const COL_TYPE As String = "colTYPE" Public Const COL_TYPE As String = "colTYPE"
Public Const COL_DESCRIPTION As String = "colDESCRIPTION" Public Const COL_DESCRIPTION As String = "colDESCRIPTION"
Public Const COL_SUPERVISORID As String = "colSUPERVISORID" Public Const COL_SUPERVISORID As String = "colSUPERVISORID"
Public Const COL_PRIORITY As String = "colPRIORITY"
End Module End Module
+1
View File
@@ -21,6 +21,7 @@ Public Module ConstGen
' File con dati di licenza ' File con dati di licenza
Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic" Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic"
Public Const S_LICENCE As String = "Licence" Public Const S_LICENCE As String = "Licence"
Public Const K_LOCKID As String = "LockId"
Public Const K_KEY As String = "Key" Public Const K_KEY As String = "Key"
Public Const K_NESTKEY As String = "NestKey" Public Const K_NESTKEY As String = "NestKey"
+11
View File
@@ -20,6 +20,7 @@ Public Module ConstIni
'Public Const K_LICENCE As String = "Licence" 'Public Const K_LICENCE As String = "Licence"
'Public Const K_USERLEVEL As String = "UserLevel" 'Public Const K_USERLEVEL As String = "UserLevel"
'Public Const K_MAXINST As String = "MaxInstances" 'Public Const K_MAXINST As String = "MaxInstances"
Public Const K_NETKEY As String = "NetKey"
Public Const K_MAXCAMINST As String = "MaxCamInstances" Public Const K_MAXCAMINST As String = "MaxCamInstances"
Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances" Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances"
Public Const K_SUPERVISOR_INSTANCES As String = "SupervisorInstances" Public Const K_SUPERVISOR_INSTANCES As String = "SupervisorInstances"
@@ -44,6 +45,7 @@ Public Module ConstIni
Public Const K_DATADIR As String = "DataDir" Public Const K_DATADIR As String = "DataDir"
Public Const K_ENABLEEDIT As String = "EnableEdit" Public Const K_ENABLEEDIT As String = "EnableEdit"
Public Const K_FASTPRODUCE As String = "FastProduce" Public Const K_FASTPRODUCE As String = "FastProduce"
Public Const K_ADDPROJ As String = "AddProj"
'Public Const S_LANGUAGES As String = "Languages" 'Public Const S_LANGUAGES As String = "Languages"
'Public Const K_LANGUAGE As String = "Language" 'Public Const K_LANGUAGE As String = "Language"
@@ -94,6 +96,7 @@ Public Module ConstIni
Public Const S_IMPORT As String = "Import" Public Const S_IMPORT As String = "Import"
Public Const K_BTLFLAG As String = "BtlFlag" Public Const K_BTLFLAG As String = "BtlFlag"
Public Const K_WALLBTLFLAG As String = "WallBtlFlag" Public Const K_WALLBTLFLAG As String = "WallBtlFlag"
Public Const K_WALLOPPOSITESIDENESTING As String = "WallOppositeSideNesting"
'Public Const S_MACH As String = "Mach" 'Public Const S_MACH As String = "Mach"
'Public Const K_MACHINESDIR As String = "MachinesDir" 'Public Const K_MACHINESDIR As String = "MachinesDir"
@@ -102,6 +105,7 @@ Public Module ConstIni
Public Const K_SUPERVISORMACH As String = "SupervisorMach" Public Const K_SUPERVISORMACH As String = "SupervisorMach"
Public Const K_PASSWORD As String = "Password" Public Const K_PASSWORD As String = "Password"
Public Const K_CHANGEMACH As String = "ChangeMach" Public Const K_CHANGEMACH As String = "ChangeMach"
Public Const K_EXPORTBWE As String = "ExpBwe"
'Public Const S_SIMUL As String = "Simul" 'Public Const S_SIMUL As String = "Simul"
'Public Const K_SLIDERX As String = "SliderX" 'Public Const K_SLIDERX As String = "SliderX"
@@ -116,6 +120,13 @@ Public Module ConstIni
Public Const K_WALLBASEDIR As String = "BaseDir" Public Const K_WALLBASEDIR As String = "BaseDir"
Public Const K_WALLBWEEXEC As String = "BweExec" Public Const K_WALLBWEEXEC As String = "BweExec"
Public Const S_MACHINELOGFILTER As String = "MachineLogFilters"
Public Const K_PARTEVENTTYPE As String = "PartEventType"
Public Const K_ENTITYTYPE As String = "EntityType"
Public Const K_DAYTYPE As String = "DayType"
Public Const K_STARTDATE As String = "StartDate"
Public Const K_ENDDATE As String = "EndDate"
'Public Const S_NEST As String = "Nest" 'Public Const S_NEST As String = "Nest"
Public Const K_NESTEXEC As String = "NestExec" Public Const K_NESTEXEC As String = "NestExec"
Public Const K_FLIPROT As String = "FlipRot" Public Const K_FLIPROT As String = "FlipRot"
@@ -28,7 +28,7 @@ Public Module DataGridColumnsIniFile
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1") Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
Dim Width As Double Dim Width As Double
Dim WidthType As DataGridLengthUnitType Dim WidthType As DataGridLengthUnitType
StringToDouble(sColumnParams(5), Width) StringToDoubleAdv(sColumnParams(5), Width)
Integer.TryParse(sColumnParams(6), WidthType) Integer.TryParse(sColumnParams(6), WidthType)
Dim bVisible As Boolean = sColumnParams(7).Equals("1") Dim bVisible As Boolean = sColumnParams(7).Equals("1")
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1") Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
@@ -65,7 +65,7 @@ Public Module DataGridColumnsIniFile
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1") Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
Dim Width As Double Dim Width As Double
Dim WidthType As DataGridLengthUnitType Dim WidthType As DataGridLengthUnitType
StringToDouble(sColumnParams(5), Width) StringToDoubleAdv(sColumnParams(5), Width)
Integer.TryParse(sColumnParams(6), WidthType) Integer.TryParse(sColumnParams(6), WidthType)
Dim bVisible As Boolean = sColumnParams(7).Equals("1") Dim bVisible As Boolean = sColumnParams(7).Equals("1")
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1") Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
@@ -424,6 +424,7 @@ Public Class EgtDataGridColumn
End Set End Set
End Property End Property
Private Property m_OrigIsReadOnly As Boolean = True
Private Property m_IsReadOnly As Boolean = True Private Property m_IsReadOnly As Boolean = True
Public Property IsReadOnly As Boolean Public Property IsReadOnly As Boolean
Get Get
@@ -561,6 +562,7 @@ Public Class EgtDataGridColumn
m_CanUserReorder = bCanUserReorder m_CanUserReorder = bCanUserReorder
m_CanUserResize = bCanUserResize m_CanUserResize = bCanUserResize
m_CanUserSort = bCanUserSort m_CanUserSort = bCanUserSort
m_OrigIsReadOnly = bIsReadOnly
m_IsReadOnly = bIsReadOnly m_IsReadOnly = bIsReadOnly
m_Width = Width m_Width = Width
m_Visible = bVisible m_Visible = bVisible
@@ -588,7 +590,7 @@ Public Class EgtDataGridColumn
Public Function SaveDataGridColumn() As Boolean Public Function SaveDataGridColumn() As Boolean
Dim bOk As Boolean Dim bOk As Boolean
Dim sColumnParams = String.Empty Dim sColumnParams = String.Empty
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection) sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(m_OrigIsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection)
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams) bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
Return bOk Return bOk
End Function End Function
@@ -420,7 +420,7 @@ Public Class MyMachGroupM
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo) EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c) sSplitInfo = sInfo.Split(","c)
StringToDouble(sSplitInfo(1), m_dStartCut) StringToDoubleAdv(sSplitInfo(1), m_dStartCut)
Else Else
m_dStartCut = 0 m_dStartCut = 0
End If End If
+1 -1
View File
@@ -508,7 +508,7 @@ Public Class PartM
Index += 1 Index += 1
End While End While
If bFound Then If bFound Then
StringToDouble(sSplitInfo(1), NewPartM.m_dPOSX) StringToDoubleAdv(sSplitInfo(1), NewPartM.m_dPOSX)
End If End If
Else Else
' leggo PosX, PosY, Rot e Flip ' leggo PosX, PosY, Rot e Flip
@@ -169,7 +169,7 @@ Public MustInherit Class MyMachGroupVM
Return LenToString(MyMachGroupM.dStartCut, 3) Return LenToString(MyMachGroupM.dStartCut, 3)
End Get End Get
Set(value As String) Set(value As String)
StringToLen(value, MyMachGroupM.dStartCut) StringToLenAdv(value, MyMachGroupM.dStartCut, True)
End Set End Set
End Property End Property
Public Property dStartCut As Double Public Property dStartCut As Double
+4 -4
View File
@@ -107,7 +107,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dPOSX, 3) Return LenToString(m_PartM.dPOSX, 3)
End Get End Get
Set(value As String) Set(value As String)
StringToLen(value, m_PartM.dPOSX) StringToLenAdv(value, m_PartM.dPOSX, True)
End Set End Set
End Property End Property
Public Property dPOSX As Double Public Property dPOSX As Double
@@ -217,7 +217,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dOffset, 3) Return LenToString(m_PartM.dOffset, 3)
End Get End Get
Set(value As String) Set(value As String)
StringToLen(value, m_PartM.dOffset) StringToLenAdv(value, m_PartM.dOffset, True)
End Set End Set
End Property End Property
Public ReadOnly Property dOffset As Double Public ReadOnly Property dOffset As Double
@@ -235,7 +235,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dPOSY, 3) Return LenToString(m_PartM.dPOSY, 3)
End Get End Get
Set(value As String) Set(value As String)
StringToLen(value, m_PartM.dPOSY) StringToLenAdv(value, m_PartM.dPOSY, True)
End Set End Set
End Property End Property
@@ -250,7 +250,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dROT, 3) & "°" Return LenToString(m_PartM.dROT, 3) & "°"
End Get End Get
Set(value As String) Set(value As String)
StringToLen(value, m_PartM.dROT) StringToLenAdv(value, m_PartM.dROT, True)
End Set End Set
End Property End Property
+3 -3
View File
@@ -16,7 +16,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("")> <Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("Egalware s.r.l.")> <Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("EgtBEAMWALL.Core")> <Assembly: AssemblyProduct("EgtBEAMWALL.Core")>
<Assembly: AssemblyCopyright("Copyright © 2020-2022 by Egalware s.r.l.")> <Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")> <Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)> <Assembly: ComVisible(False)>
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.11.3")> <Assembly: AssemblyVersion("2.5.5.4")>
<Assembly: AssemblyFileVersion("2.4.11.3")> <Assembly: AssemblyFileVersion("2.5.5.4")>
@@ -10,6 +10,9 @@ Public Class ProdFileM
Return m_nProjIdList Return m_nProjIdList
End Get End Get
End Property End Property
Public Sub SetProjIdList(value As List(Of Integer))
m_nProjIdList = value
End Sub
Protected m_sName As String Protected m_sName As String
Public ReadOnly Property sName As String Public ReadOnly Property sName As String
+6 -6
View File
@@ -147,9 +147,9 @@ Public Module BTLIniFile
Dim dMin As Double Dim dMin As Double
Dim dMax As Double Dim dMax As Double
Dim dDefault As Double Dim dDefault As Double
StringToDouble(sBTLParamParams(2), dMin) StringToDoubleAdv(sBTLParamParams(2), dMin)
StringToDouble(sBTLParamParams(3), dMax) StringToDoubleAdv(sBTLParamParams(3), dMax)
StringToDouble(sBTLParamParams(4), dDefault) StringToDoubleAdv(sBTLParamParams(4), dDefault)
Dim ParamType As BTLParamType Dim ParamType As BTLParamType
If sBTLParamParams(0) = "d" Then If sBTLParamParams(0) = "d" Then
ParamType = BTLParamType.DOUBLE_ ParamType = BTLParamType.DOUBLE_
@@ -200,9 +200,9 @@ Public Module BTLIniFile
Dim dMin As Double Dim dMin As Double
Dim dMax As Double Dim dMax As Double
Dim dDefault As Double Dim dDefault As Double
StringToDouble(sBTLParamParams(2), dMin) StringToDoubleAdv(sBTLParamParams(2), dMin)
StringToDouble(sBTLParamParams(3), dMax) StringToDoubleAdv(sBTLParamParams(3), dMax)
StringToDouble(sBTLParamParams(4), dDefault) StringToDoubleAdv(sBTLParamParams(4), dDefault)
Dim ParamType As BTLParamType Dim ParamType As BTLParamType
If sBTLParamParams(0) = "d" Then If sBTLParamParams(0) = "d" Then
ParamType = BTLParamType.DOUBLE_ ParamType = BTLParamType.DOUBLE_
@@ -27,7 +27,7 @@ Public Module DimensionsIniFile
Dim GridLenType As GridUnitType Dim GridLenType As GridUnitType
Integer.TryParse(sValueParams(0), nDimIndex) Integer.TryParse(sValueParams(0), nDimIndex)
Integer.TryParse(sValueParams(1), nDimType) Integer.TryParse(sValueParams(1), nDimType)
StringToDouble(sValueParams(2), GridLenValue) StringToDoubleAdv(sValueParams(2), GridLenValue)
Integer.TryParse(sValueParams(3), GridLenType) Integer.TryParse(sValueParams(3), GridLenType)
GridDimsList.Add(New GridDimension(GridName, nDimIndex, nDimType, New GridLength(GridLenValue, GridLenType))) GridDimsList.Add(New GridDimension(GridName, nDimIndex, nDimType, New GridLength(GridLenValue, GridLenType)))
End If End If
+46 -42
View File
@@ -1,45 +1,49 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections> </configSections>
<entityFramework> <entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" /> <!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
<providers> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> <providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"> </provider>
</provider></providers> </providers>
</entityFramework> </entityFramework>
<connectionStrings> <connectionStrings>
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=Egalware_24068!;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" /> <add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=steamware;password=Egalware_24068!;Persist Security Info=True;database=EgtBwDb_000470;SslMode=none" providerName="MySql.Data.MySqlClient" />
</connectionStrings> </connectionStrings>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" /> <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" /> <bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" /> <assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" /> <bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" /> <assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.6.0" newVersion="1.2.6.0" /> <bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" /> <assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" /> <bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> <dependentAssembly>
</runtime> <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<startup> <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> </dependentAssembly>
</startup> </assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration> </configuration>
@@ -24,7 +24,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <param name="corePart"></param> /// <param name="corePart"></param>
/// <param name="currProjDbId"></param> /// <param name="currProjDbId"></param>
/// <returns></returns> /// <returns></returns>
public static BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId) public BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId)
{ {
BTLPartModel answ = new BTLPartModel(); BTLPartModel answ = new BTLPartModel();
if (corePart != null) if (corePart != null)
@@ -23,7 +23,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// </summary> /// </summary>
/// <param name="coreMacLog"></param> /// <param name="coreMacLog"></param>
/// <returns></returns> /// <returns></returns>
public static LogMachineModel ConvertFromCore(Core.MachLog coreMacLog) public LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
{ {
LogMachineModel answ = new LogMachineModel(); LogMachineModel answ = new LogMachineModel();
if (coreMacLog != null) if (coreMacLog != null)
@@ -53,7 +53,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// </summary> /// </summary>
/// <param name="dbLog"></param> /// <param name="dbLog"></param>
/// <returns></returns> /// <returns></returns>
public static Core.MachLog ConvertToCore(LogMachineModel dbLog) public Core.MachLog ConvertToCore(LogMachineModel dbLog)
{ {
var newRecord = Core.MachLog.CreateMachLog(dbLog.AlarmCode, dbLog.AlarmDatetime, dbLog.AlarmMessage, dbLog.AlarmOperation, dbLog.AlarmType, dbLog.CommandExecutedCorrectly, dbLog.CommandState, dbLog.CommandType, dbLog.Description, dbLog.NewOpState, dbLog.ResultType, dbLog.VarAddress, dbLog.VarValue); var newRecord = Core.MachLog.CreateMachLog(dbLog.AlarmCode, dbLog.AlarmDatetime, dbLog.AlarmMessage, dbLog.AlarmOperation, dbLog.AlarmType, dbLog.CommandExecutedCorrectly, dbLog.CommandState, dbLog.CommandType, dbLog.Description, dbLog.NewOpState, dbLog.ResultType, dbLog.VarAddress, dbLog.VarValue);
return newRecord; return newRecord;
@@ -8,12 +8,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{ {
public class MachGroupController : IDisposable public class MachGroupController : IDisposable
{ {
#region Public Fields
public static MachGroupController man = new MachGroupController();
#endregion Public Fields
#region Public Constructors #region Public Constructors
public MachGroupController() public MachGroupController()
@@ -30,7 +24,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <param name="coreMachGroup"></param> /// <param name="coreMachGroup"></param>
/// <param name="currProdDbId"></param> /// <param name="currProdDbId"></param>
/// <returns></returns> /// <returns></returns>
public static MachGroupModel ConvertFromCore(Core.MyMachGroupM coreMachGroup, int currProdDbId) public MachGroupModel ConvertFromCore(Core.MyMachGroupM coreMachGroup, int currProdDbId)
{ {
MachGroupModel answ = new MachGroupModel(); MachGroupModel answ = new MachGroupModel();
if (coreMachGroup != null) if (coreMachGroup != null)
@@ -63,6 +57,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{ {
ProdModel currData = new ProdModel(); ProdModel currData = new ProdModel();
List<PartModel> PartList2Add = new List<PartModel>(); List<PartModel> PartList2Add = new List<PartModel>();
var myPartCtrl = new PartController();
var myStatusMapCtrl = new StatusMapController();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
// Recupero il PROD nel contesto // Recupero il PROD nel contesto
@@ -72,7 +68,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.SingleOrDefault(); .SingleOrDefault();
try try
{ {
var convCurrMG = MachGroupController.ConvertFromCore(newMachGroup, currData.ProdDbId); var locMGCtrl = new MachGroupController();
var convCurrMG = locMGCtrl.ConvertFromCore(newMachGroup, currData.ProdDbId);
convCurrMG.ProdIndex = 1; convCurrMG.ProdIndex = 1;
@@ -81,15 +78,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
// Commit changes // Commit changes
localDbCtx.SaveChanges(); localDbCtx.SaveChanges();
int MachGroupDbId = MachGroupController.man.FindByMachGroupId(ProdId, newMachGroup.Id).MachGroupDbId; int MachGroupDbId = FindByMachGroupId(ProdId, newMachGroup.Id).MachGroupDbId;
// 2023.05.10 leggo elenco part in una sola volta
var currMgPartList = localDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id)
.ToList();
// verifico se uguali o meno... // verifico se uguali o meno...
foreach (var currPartM in newMachGroup.PartMList) foreach (var currPartM in newMachGroup.PartMList)
{ {
var currPart = localDbCtx //var currPart = localDbCtx
.PartList // .PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id && x.PartId == currPartM.nPartId) // .Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id && x.PartId == currPartM.nPartId)
// .SingleOrDefault();
var currPart = currMgPartList
.Where(x => x.PartId == currPartM.nPartId)
.SingleOrDefault(); .SingleOrDefault();
var convCurrPartM = PartController.ConvertFromCore(currPartM, MachGroupDbId);
var convCurrPartM = myPartCtrl.ConvertFromCore(currPartM, MachGroupDbId);
if (currPart != null) if (currPart != null)
{ {
// se non identico x equality limitata a ViewOptim... // se non identico x equality limitata a ViewOptim...
@@ -125,7 +132,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
// Commit changes // Commit changes
localDbCtx.SaveChanges(); localDbCtx.SaveChanges();
// aggiorno info sullo status // aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, newMachGroup.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, ""); myStatusMapCtrl.UpdateAction("", ProdId, newMachGroup.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -177,6 +184,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
// inizio eliminando le part // inizio eliminando le part
var parts2del = localDbCtx var parts2del = localDbCtx
.PartList .PartList
@@ -197,7 +205,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
localDbCtx.SaveChanges(); localDbCtx.SaveChanges();
// registro modifica StatusMap // registro modifica StatusMap
StatusMapController.man.UpdateAction(MG2Del.SupervisorId, ProdId, MG2Del.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, ""); myStatusMapCtrl.UpdateAction(MG2Del.SupervisorId, ProdId, MG2Del.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
done = true; done = true;
} }
@@ -209,7 +217,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
} }
// se fatto aggiorno info sullo status // se fatto aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, ""); myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
} }
return done; return done;
} }
@@ -393,6 +401,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
try try
{ {
// aggiorno // aggiorno
@@ -405,13 +414,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
currRecord.State = Core.ItemState.ND; currRecord.State = Core.ItemState.ND;
currRecord.SupervisorId = ""; currRecord.SupervisorId = "";
currRecord.ProdIndex = 0; currRecord.ProdIndex = 0;
} // Commit changes
// Commit changes localDbCtx.SaveChanges();
localDbCtx.SaveChanges(); // aggiorno info sullo status
// aggiorno info sullo status myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
done = true; done = true;
}
else
{
string errMessage = $"ERROR on MachGroup.RemoveFromSupervisor: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -435,23 +450,33 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
try try
{ {
// aggiorno // aggiorno
localDbCtx var item2upd = localDbCtx
.MachGroupList .MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId) .Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault() .FirstOrDefault();
.State = newState; if (item2upd != null)
// Commit changes {
localDbCtx.SaveChanges(); item2upd.State = newState;
done = true; // Commit changes
// aggiorno info sullo status localDbCtx.SaveChanges();
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value); done = true;
// aggiorno info sullo status
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value);
}
else
{
string errMessage = $"ERROR on MachGroup.SetNeedRedo: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newState {newState} | Value {Value}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
string errMessage = $"EXCEPTION on MachGroup.UpdateStatus: {Environment.NewLine}{exc}"; string errMessage = $"EXCEPTION on MachGroup.SetNeedRedo: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage); Console.WriteLine(errMessage);
Log.Error(errMessage); Log.Error(errMessage);
} }
@@ -469,20 +494,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var item2update = localDbCtx var myStatusMapCtrl = new StatusMapController();
.MachGroupList
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
.SingleOrDefault();
try try
{ {
// update, vers 1... var item2update = localDbCtx
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem); .MachGroupList
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
.SingleOrDefault();
if (item2update != null)
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
// Commit changes // Commit changes
localDbCtx.SaveChanges(); localDbCtx.SaveChanges();
done = true; done = true;
// aggiorno info sullo status // aggiorno info sullo status
StatusMapController.man.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, ""); myStatusMapCtrl.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
else
{
string errMessage = $"ERROR on MachGroup.Update: req item was not found | ProdDbId {updItem.ProdDbId} | MachGroupId {updItem.MachGroupId} | ProdIndex {updItem.ProdIndex}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -506,6 +541,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
try try
{ {
// aggiorno // aggiorno
@@ -513,15 +549,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.MachGroupList .MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId) .Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault(); .FirstOrDefault();
if (currRecord != null)
currRecord.DtEnd = DtEnd; {
currRecord.DtEnd = DtEnd;
// Commit changes // Commit changes
localDbCtx.SaveChanges(); localDbCtx.SaveChanges();
done = true;
done = true; // aggiorno info sullo status
// aggiorno info sullo status myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, ""); }
else
{
string errMessage = $"ERROR on MachGroup.UpdateEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtEnd {DtEnd}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -548,15 +590,23 @@ namespace EgtBEAMWALL.DataLayer.Controllers
try try
{ {
// aggiorno // aggiorno
localDbCtx var item2upd = localDbCtx
.MachGroupList .MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId) .Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault() .FirstOrDefault();
.ProdIndex = newProdIndex; if (item2upd != null)
// Commit changes {
localDbCtx.SaveChanges(); item2upd.ProdIndex = newProdIndex;
// Commit changes
done = true; localDbCtx.SaveChanges();
done = true;
}
else
{
string errMessage = $"ERROR on MachGroup.UpdateOrder: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newProdIndex {newProdIndex}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -581,6 +631,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
try try
{ {
// aggiorno // aggiorno
@@ -588,15 +639,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.MachGroupList .MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId) .Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault(); .FirstOrDefault();
if (currRecord != null)
currRecord.DtStart = DtStart; {
currRecord.DtStart = DtStart;
// Commit changes // Commit changes
localDbCtx.SaveChanges(); localDbCtx.SaveChanges();
done = true;
done = true; // aggiorno info sullo status
// aggiorno info sullo status myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, ""); }
else
{
string errMessage = $"ERROR on MachGroup.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtStart {DtStart}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -621,6 +678,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
try try
{ {
// aggiorno // aggiorno
@@ -628,15 +686,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.MachGroupList .MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId) .Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault(); .FirstOrDefault();
if (currRecord != null)
currRecord.DtStart = DtStart; {
currRecord.DtEnd = DtEnd; currRecord.DtStart = DtStart;
currRecord.DtEnd = DtEnd;
// Commit changes // Commit changes
localDbCtx.SaveChanges(); localDbCtx.SaveChanges();
done = true; done = true;
// aggiorno info sullo status // aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, ""); myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
else
{
string errMessage = $"ERROR on MachGroup.UpdateStartEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | DtStart {DtStart} | DtEnd {DtEnd}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -659,20 +724,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
try try
{ {
// aggiorno // aggiorno
localDbCtx var item2upd = localDbCtx
.MachGroupList .MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId) .Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault() .FirstOrDefault();
.State = newState; if (item2upd != null)
// Commit changes {
localDbCtx.SaveChanges(); item2upd.State = newState;
// Commit changes
done = true; localDbCtx.SaveChanges();
// aggiorno info sullo status done = true;
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, ""); // aggiorno info sullo status
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
else
{
string errMessage = $"ERROR on MachGroup.UpdateStatus: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | newState {newState}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -691,23 +765,32 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
try try
{ {
// aggiorno // aggiorno
var currRecord = localDbCtx var item2upd = localDbCtx
.MachGroupList .MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId) .Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault(); .FirstOrDefault();
if (item2upd != null)
{
item2upd.SupervisorId = SupervisorId;
item2upd.State = Core.ItemState.Assigned;
currRecord.SupervisorId = SupervisorId; // Commit changes
currRecord.State = Core.ItemState.Assigned; localDbCtx.SaveChanges();
done = true;
// Commit changes // aggiorno info sullo status
localDbCtx.SaveChanges(); myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
}
done = true; else
// aggiorno info sullo status {
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, ""); string errMessage = $"ERROR on MachGroup.UpdateSupervisor: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | SupervisorId {SupervisorId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -7,17 +7,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{ {
public class PartController : IDisposable public class PartController : IDisposable
{ {
#region Public Fields
public static PartController man = new PartController();
#endregion Public Fields
#region Public Constructors #region Public Constructors
public PartController() public PartController()
{ { }
}
#endregion Public Constructors #endregion Public Constructors
@@ -29,12 +22,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <param name="corePart"></param> /// <param name="corePart"></param>
/// <param name="currMachGroupDbId"></param> /// <param name="currMachGroupDbId"></param>
/// <returns></returns> /// <returns></returns>
public static PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId) public PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
{ {
PartModel answ = new PartModel(); PartModel answ = new PartModel();
if (corePart != null) if (corePart != null)
{ {
int BTLPartId = man.FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId); int BTLPartId = FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
answ = new PartModel() answ = new PartModel()
{ {
PartId = corePart.nPartId, PartId = corePart.nPartId,
@@ -74,23 +67,34 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
var item2del = localDbCtx var item2del = localDbCtx
.PartList .PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId) .Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.SingleOrDefault(); .SingleOrDefault();
try
if (item2del != null)
{ {
// Remove from database try
localDbCtx.PartList.Remove(item2del); {
// Commit changes // Remove from database
localDbCtx.SaveChanges(); localDbCtx.PartList.Remove(item2del);
done = true; // Commit changes
// aggiorno info sullo status localDbCtx.SaveChanges();
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, ""); done = true;
// aggiorno info sullo status
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId} | PartId: {PartId}{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) else
{ {
string errMessage = $"EXCEPTION on Part.Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId} | PartId: {PartId}{Environment.NewLine}{exc}"; string errMessage = $"ERROR on Part.Delete (01): req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId}";
Console.WriteLine(errMessage); Console.WriteLine(errMessage);
Log.Error(errMessage); Log.Error(errMessage);
} }
@@ -112,17 +116,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.PartList .PartList
.Where(x => x.PartDbId == PartDbId) .Where(x => x.PartDbId == PartDbId)
.SingleOrDefault(); .SingleOrDefault();
try
if (item2del != null)
{ {
// Add to database try
localDbCtx.PartList.Remove(item2del); {
// Commit changes // Add to database
localDbCtx.SaveChanges(); localDbCtx.PartList.Remove(item2del);
done = true; // Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.Delete: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) else
{ {
string errMessage = $"EXCEPTION on Part.Delete: {Environment.NewLine}{exc}"; string errMessage = $"ERROR on Part.Delete (02): req item was not found | PartDbId {PartDbId}";
Console.WriteLine(errMessage); Console.WriteLine(errMessage);
Log.Error(errMessage); Log.Error(errMessage);
} }
@@ -209,28 +223,38 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var item2update = locallocalDbCtx var myStatusMapCtrl = new StatusMapController();
var item2upd = locallocalDbCtx
.PartList .PartList
.Where(x => x.PartDbId == updItem.PartDbId) .Where(x => x.PartDbId == updItem.PartDbId)
.SingleOrDefault(); .SingleOrDefault();
try if (item2upd != null)
{ {
// update, vers 1... try
locallocalDbCtx.Entry(item2update).CurrentValues.SetValues(updItem); {
// update, vers 1...
locallocalDbCtx.Entry(item2upd).CurrentValues.SetValues(updItem);
//// update, vers 2 //// update, vers 2
//localDbCtx.PartList.Remove(item2del); //localDbCtx.PartList.Remove(item2del);
//localDbCtx.PartList.Add(updItem); //localDbCtx.PartList.Add(updItem);
// Commit changes // Commit changes
locallocalDbCtx.SaveChanges(); locallocalDbCtx.SaveChanges();
done = true; done = true;
// aggiorno info sullo status // aggiorno info sullo status
StatusMapController.man.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, ""); myStatusMapCtrl.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.Update: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) else
{ {
string errMessage = $"EXCEPTION on Part.Update: {Environment.NewLine}{exc}"; string errMessage = $"ERROR on Part.Update (01): req item was not found | PartId {updItem.PartId} | PartDbId {updItem.PartDbId} | BTLPartDbId {updItem.BTLPartDbId}";
Console.WriteLine(errMessage); Console.WriteLine(errMessage);
Log.Error(errMessage); Log.Error(errMessage);
} }
@@ -249,19 +273,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
try try
{ {
// aggiorno // aggiorno
locallocalDbCtx var item2upd = locallocalDbCtx
.PartList .PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId) .Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.FirstOrDefault() .FirstOrDefault();
.DtEnd = DtEnd;
// Commit changes if (item2upd != null)
locallocalDbCtx.SaveChanges(); {
done = true; item2upd.DtEnd = DtEnd;
// aggiorno info sullo status // Commit changes
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, ""); locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
}
else
{
string errMessage = $"ERROR on Part.UpdateEnd: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | DtEnd {DtEnd}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -284,19 +319,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
try try
{ {
// aggiorno // aggiorno
locallocalDbCtx var item2upd = locallocalDbCtx
.PartList .PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId) .Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.FirstOrDefault() .FirstOrDefault();
.DtStart = DtStart; if (item2upd != null)
// Commit changes {
locallocalDbCtx.SaveChanges(); item2upd.DtStart = DtStart;
done = true; // Commit changes
// aggiorno info sullo status locallocalDbCtx.SaveChanges();
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, ""); done = true;
// aggiorno info sullo status
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
}
else
{
string errMessage = $"ERROR on Part.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | DtStart {DtStart}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -320,19 +365,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var myStatusMapCtrl = new StatusMapController();
try try
{ {
// aggiorno // aggiorno
locallocalDbCtx var item2upd = locallocalDbCtx
.PartList .PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId) .Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.FirstOrDefault() .FirstOrDefault();
.State = newState; if (item2upd != null)
// Commit changes {
locallocalDbCtx.SaveChanges(); item2upd.State = newState;
done = true; // Commit changes
// aggiorno info sullo status locallocalDbCtx.SaveChanges();
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, ""); done = true;
// aggiorno info sullo status
myStatusMapCtrl.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, "");
}
else
{
string errMessage = $"ERROR on Part.UpdateStart: req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId} | newState {newState}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
catch (Exception exc) catch (Exception exc)
{ {
@@ -1,5 +1,6 @@
using EgtBEAMWALL.DataLayer.DatabaseModels; using EgtBEAMWALL.DataLayer.DatabaseModels;
using NLog; using NLog;
using NLog.LayoutRenderers;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -9,17 +10,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{ {
public class ProdController : IDisposable public class ProdController : IDisposable
{ {
#region Public Fields
public static ProdController man = new ProdController();
#endregion Public Fields
#region Public Constructors #region Public Constructors
public ProdController() public ProdController()
{ {
Log.Info("ProdController istance Started"); Log.Info("ProdController instance Started");
} }
#endregion Public Constructors #endregion Public Constructors
@@ -353,25 +348,39 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false; bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
var item2update = localDbCtx
.ProdList
.Where(x => x.ProdDbId == updItem.ProdDbId)
.SingleOrDefault();
try try
{ {
// update, vers 1... var item2update = localDbCtx
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem); .ProdList
.Where(x => x.ProdDbId == updItem.ProdDbId)
.SingleOrDefault();
//// update, vers 2 if (item2update != null)
//localDbCtx.PartList.Remove(item2del); {
//localDbCtx.PartList.Add(updItem); // update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
// Commit changes //// update, vers 2
localDbCtx.SaveChanges(); //localDbCtx.PartList.Remove(item2del);
done = true; //localDbCtx.PartList.Add(updItem);
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
else
{
string errMessage = $"ERROR on Prod.Update: req item was not found | ProdId {updItem.ProdId} | ProdDbId {updItem.ProdDbId} | Description {updItem.Description}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Prod.Update: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
} }
catch
{ }
} }
return done; return done;
} }
@@ -384,137 +393,182 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// </summary> /// </summary>
/// <param name="ProdId">Id del Prod</param> /// <param name="ProdId">Id del Prod</param>
/// <param name="MachGroupList">Elenco MachGroup da associare</param> /// <param name="MachGroupList">Elenco MachGroup da associare</param>
/// <returns></returns> /// <returns>Bool esecuzione con successo o meno</returns>
public ProdModel UpdateMachGroup(int ProdId, List<Core.MyMachGroupM> MachGroupList) public bool UpdateMachGroup(int ProdId, List<Core.MyMachGroupM> MachGroupList)
{ {
ProdModel currData = new ProdModel(); bool testOk = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) // calcolo occorrenze x ogni ID della barra...
var listaCheck = MachGroupList
.GroupBy(x => x.Id)
.Select(n => new
{
PartId = n.Key,
PartCount = n.Count()
})
.OrderBy(n => n.PartCount);
// controllo: nell'elenco delle barre MachGroupList NON devono esserci duplicati per
// l'ID (esterno) che deve essere univoco...
testOk = listaCheck.Where(x => x.PartCount > 1).Count() == 0;
if (testOk)
{ {
// Recupero il PROD nel contesto DB attuale ProdModel currData = new ProdModel();
currData = localDbCtx using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
.ProdList
.Where(x => x.ProdId == ProdId)
.SingleOrDefault();
try
{ {
// preparo elenco var myStatusMapCtrl = new StatusMapController();
List<MachGroupModel> itemsMG2Add = new List<MachGroupModel>(); try
List<Core.MyMachGroupM> MachGroupList2Add = new List<Core.MyMachGroupM>();
List<PartModel> PartList2Add = new List<PartModel>();
// cerco le MG esistenti --> aggiorno
foreach (var item in MachGroupList)
{ {
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id); // Recupero il PROD nel contesto DB attuale
var convCurrMG = MachGroupController.ConvertFromCore(item, currData.ProdDbId); currData = localDbCtx
if (currMG != null) .ProdList
.Where(x => x.ProdId == ProdId)
.SingleOrDefault();
if (currData != null)
{ {
// se non identico x equality limitata a ViewOptim... // preparo elenco
if (!currMG.ViewOptimEquals(convCurrMG)) List<MachGroupModel> itemsMG2Add = new List<MachGroupModel>();
List<Core.MyMachGroupM> MachGroupList2Add = new List<Core.MyMachGroupM>();
List<PartModel> PartList2Add = new List<PartModel>();
List<PartModel> PartList2Rem = new List<PartModel>();
var logMGCtrl = new MachGroupController();
// cerco le MG esistenti --> aggiorno
foreach (var item in MachGroupList)
{ {
// aggiorno con nuovi valori ricevuti var currMG = logMGCtrl.FindByMachGroupId(ProdId, item.Id);
currMG.H = convCurrMG.H; var convCurrMG = logMGCtrl.ConvertFromCore(item, currData.ProdDbId);
currMG.L = convCurrMG.L; if (currMG != null)
currMG.W = convCurrMG.W; {
currMG.Material = convCurrMG.Material; // se non identico x equality limitata a ViewOptim...
currMG.Name = convCurrMG.Name; if (!currMG.ViewOptimEquals(convCurrMG))
// salvo {
localDbCtx.SaveChanges(); // aggiorno con nuovi valori ricevuti
// registro modifica StatusMap currMG.H = convCurrMG.H;
StatusMapController.man.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, ""); currMG.L = convCurrMG.L;
currMG.W = convCurrMG.W;
currMG.Material = convCurrMG.Material;
currMG.Name = convCurrMG.Name;
// salvo
localDbCtx.SaveChanges();
// registro modifica StatusMap
myStatusMapCtrl.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
}
else
{
itemsMG2Add.Add(convCurrMG);
// registro modifica StatusMap
myStatusMapCtrl.UpdateAction("", ProdId, item.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
}
} }
// aggiungo MachGroup
localDbCtx.MachGroupList.AddRange(itemsMG2Add);
// Commit changes
localDbCtx.SaveChanges();
// verifico di nuovo l'elenco delle MG x le relative PART...
foreach (var item in MachGroupList)
{
var currMG = logMGCtrl.FindByMachGroupId(ProdId, item.Id);
int MachGroupDbId = currMG.MachGroupDbId;
bool modMg = false;
// 2023.05.10: recupero TUTTE le part del MachGroup e poi lavoro...
var currMgPartList = localDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == item.Id)
.ToList();
// preparo elenco PartList x eventuale rimozione
var currPartList2Rem = new List<PartModel>();
currPartList2Rem.AddRange(currMgPartList);
// verifico se uguali o meno...
foreach (var currPartM in item.PartMList)
{
var myPartCtrl = new PartController();
var currPart = currMgPartList
.Where(x => x.PartId == currPartM.nPartId)
.SingleOrDefault();
var convCurrPartM = myPartCtrl.ConvertFromCore(currPartM, MachGroupDbId);
if (currPart != null)
{
// se non identico x equality limitata a ViewOptim...
if (!currPart.ViewOptimEquals(convCurrPartM))
{
// aggiorno con nuovi valori ricevuti
currPart.H = convCurrPartM.H;
currPart.L = convCurrPartM.L;
currPart.W = convCurrPartM.W;
currPart.Material = convCurrPartM.Material;
currPart.CALC_State = convCurrPartM.CALC_State;
currPart.ROT = convCurrPartM.ROT;
currPart.PDN = convCurrPartM.PDN;
currPart.NAM = convCurrPartM.NAM;
// aggiorno anche il BtlPartId
currPart.BTLPartDbId = convCurrPartM.BTLPartDbId;
// salvo
localDbCtx.SaveChanges();
modMg = true;
}
// tolgo da elenco di rimozione...
currPartList2Rem.Remove(currPart);
}
else
{
PartList2Add.Add(convCurrPartM);
modMg = true;
}
}
// verifico se salvare...
if (modMg)
{
myStatusMapCtrl.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
// aggiungo le part esistenti nel MG non ricevute...
PartList2Rem.AddRange(currPartList2Rem);
}
// elimino parti da rimuovere..
localDbCtx.PartList.RemoveRange(PartList2Rem);
// aggiungo PartList
localDbCtx.PartList.AddRange(PartList2Add);
// Commit changes
localDbCtx.SaveChanges();
// sel dei MachGroup da prod OLD
List<MachGroupModel> itemsMGOld = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId)
.ToList();
// elenco degli ID del MachGroup NON trovati
List<int> MgId2rem = itemsMGOld.Select(x => x.MachGroupId).Except(MachGroupList.Select(y => y.Id)).ToList();
// processo i MachGroup eliminati
foreach (var item in MgId2rem)
{
logMGCtrl.Delete(ProdId, item);
}
// aggiorno valore isNew a false x PROD
currData.IsNew = false;
// Commit changes
localDbCtx.SaveChanges();
} }
else else
{ {
itemsMG2Add.Add(convCurrMG); string errMessage = $"ERROR on Prod.UpdateMachGroup: req item was not found | ProdId {ProdId} | MachGroupList {MachGroupList.Count} rec";
// registro modifica StatusMap Console.WriteLine(errMessage);
StatusMapController.man.UpdateAction("", ProdId, item.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, ""); Log.Error(errMessage);
} }
} }
// aggiungo MachGroup catch (Exception exc)
localDbCtx.MachGroupList.AddRange(itemsMG2Add);
// Commit changes
localDbCtx.SaveChanges();
// verifico di nuovo l'elenco delle MG x le relative PART...
foreach (var item in MachGroupList)
{ {
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id); string errMessage = $"EXCEPTION on Prod.UpdateMachGroup: {Environment.NewLine}{exc}";
int MachGroupDbId = currMG.MachGroupDbId; Console.WriteLine(errMessage);
bool modMg = false; Log.Error(errMessage);
// verifico se uguali o meno...
foreach (var currPartM in item.PartMList)
{
var currPart = localDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == item.Id && x.PartId == currPartM.nPartId)
.SingleOrDefault();
var convCurrPartM = PartController.ConvertFromCore(currPartM, MachGroupDbId);
if (currPart != null)
{
// se non identico x equality limitata a ViewOptim...
if (!currPart.ViewOptimEquals(convCurrPartM))
{
// aggiorno con nuovi valori ricevuti
currPart.H = convCurrPartM.H;
currPart.L = convCurrPartM.L;
currPart.W = convCurrPartM.W;
currPart.Material = convCurrPartM.Material;
currPart.CALC_State = convCurrPartM.CALC_State;
currPart.ROT = convCurrPartM.ROT;
currPart.PDN = convCurrPartM.PDN;
currPart.NAM = convCurrPartM.NAM;
// salvo
localDbCtx.SaveChanges();
modMg = true;
}
}
else
{
PartList2Add.Add(convCurrPartM);
modMg = true;
}
}
// verifico se salvare...
if (modMg)
{
StatusMapController.man.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
}
} }
// aggiungo PartList
localDbCtx.PartList.AddRange(PartList2Add);
// Commit changes
localDbCtx.SaveChanges();
// sel dei MachGroup da prod OLD
List<MachGroupModel> itemsMGOld = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId)
.ToList();
// elenco degli ID del MachGroup NON trovati
List<int> MgId2rem = itemsMGOld.Select(x => x.MachGroupId).Except(MachGroupList.Select(y => y.Id)).ToList();
// processo i MachGroup eliminati
foreach (var item in MgId2rem)
{
MachGroupController.man.Delete(ProdId, item);
}
// aggiorno valore isNew a false x PROD
currData.IsNew = false;
// Commit changes
localDbCtx.SaveChanges();
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Prod.UpdateMachGroup: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
} }
} }
return currData; return testOk;
} }
/// <summary> /// <summary>
@@ -525,18 +579,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns> /// <returns></returns>
public Core.ProdFileM UpdateMachine(int ProdId, String Machine) public Core.ProdFileM UpdateMachine(int ProdId, String Machine)
{ {
ProdModel currData; ProdModel currData = new ProdModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
currData = localDbCtx try
{
currData = localDbCtx
.ProdList .ProdList
.Where(x => x.ProdId == ProdId) .Where(x => x.ProdId == ProdId)
.SingleOrDefault(); .SingleOrDefault();
// aggiorno valore BTL if (currData != null)
currData.Machine = Machine; {
// aggiorno valore BTL
currData.Machine = Machine;
// Commit changes // Commit changes
localDbCtx.SaveChanges(); localDbCtx.SaveChanges();
}
else
{
string errMessage = $"ERROR on Prod.UpdateMachine: req item was not found | ProdId {ProdId} | Machine {Machine}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Prod.UpdateMachine: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
return coreConv(currData); return coreConv(currData);
} }
@@ -549,18 +621,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns> /// <returns></returns>
public Core.ProdFileM UpdatePType(int ProdId, BWType PType) public Core.ProdFileM UpdatePType(int ProdId, BWType PType)
{ {
ProdModel currData; ProdModel currData = new ProdModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
currData = localDbCtx try
{
currData = localDbCtx
.ProdList .ProdList
.Where(x => x.ProdId == ProdId) .Where(x => x.ProdId == ProdId)
.SingleOrDefault(); .SingleOrDefault();
// aggiorno valore BTL if (currData != null)
currData.PType = PType; {
// aggiorno valore BTL
currData.PType = PType;
// Commit changes // Commit changes
localDbCtx.SaveChanges(); localDbCtx.SaveChanges();
}
else
{
string errMessage = $"ERROR on Prod.UpdatePType: req item was not found | ProdId {ProdId} | PType {PType}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Prod.UpdatePType: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
return coreConv(currData); return coreConv(currData);
} }
@@ -572,25 +662,40 @@ namespace EgtBEAMWALL.DataLayer.Controllers
string LockBy = ""; string LockBy = "";
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
// seleziono il prod... try
var currProd = localDbCtx {
// seleziono il prod...
var currProd = localDbCtx
.ProdList .ProdList
.Where(x => x.ProdId == ProdId) .Where(x => x.ProdId == ProdId)
.FirstOrDefault(); .FirstOrDefault();
if (currProd != null) if (currProd != null)
{
LockBy = currProd.LockedBy;
var currProj = localDbCtx
.ProjList
.Where(x => x.ProdDbId == currProd.ProdDbId)
.ToList();
if (currProj != null && string.IsNullOrEmpty(LockBy))
{ {
LockBy = currProj.FirstOrDefault(x => !string.IsNullOrEmpty(x.LockedBy)).LockedBy; LockBy = currProd.LockedBy;
var currProj = localDbCtx
.ProjList
.Where(x => x.ProdDbId == currProd.ProdDbId)
.ToList();
if (currProj != null && string.IsNullOrEmpty(LockBy))
{
LockBy = currProj.FirstOrDefault(x => !string.IsNullOrEmpty(x.LockedBy)).LockedBy;
}
} }
else
{
string errMessage = $"ERROR on Prod.UserLockByProdId: req item was not found | ProdId {ProdId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Prod.UserLockByProdId: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
} }
} }
return LockBy; return LockBy;
@@ -636,7 +741,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
protected List<int> ProjIdByProd(int ProdId) protected List<int> ProjIdByProd(int ProdId)
{ {
return DbManager.obj.ProjCtr.GetByProdAsc(ProdId).Select(y => y.nProjId).ToList(); var ProjCtr = new ProjController();
return ProjCtr.GetByProdAsc(ProdId).Select(y => y.nProjId).ToList();
//return DbManager.obj.ProjCtr.GetByProdAsc(ProdId).Select(y => y.nProjId).ToList();
} }
#endregion Protected Methods #endregion Protected Methods
@@ -452,22 +452,35 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.ProjList .ProjList
.Where(x => x.ProjId == updItem.ProjId) .Where(x => x.ProjId == updItem.ProjId)
.SingleOrDefault(); .SingleOrDefault();
try if (item2update != null)
{ {
updItem.ProjDbId = item2update.ProjDbId; try
// update, vers 1... {
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem); updItem.ProjDbId = item2update.ProjDbId;
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
//// update, vers 2 //// update, vers 2
//dbCtx.PartList.Remove(item2del); //dbCtx.PartList.Remove(item2del);
//dbCtx.PartList.Add(updItem); //dbCtx.PartList.Add(updItem);
// Commit changes // Commit changes
localDbCtx.SaveChanges(); localDbCtx.SaveChanges();
done = true; done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.Update{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
else
{
string errMessage = $"ERROR on Proj.Update: req item was not found | ProjId {updItem.ProjId} | ProjDbId {updItem.ProjDbId} | ProdDbId {updItem.ProdDbId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
} }
catch (Exception)
{ }
} }
return done; return done;
} }
@@ -493,64 +506,73 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.BTLPartList .BTLPartList
.Where(x => x.ProjDbId == currData.ProjDbId) .Where(x => x.ProjDbId == currData.ProjDbId)
.ToList(); .ToList();
if (oldBtlParts != null)
// converto le BtlParts da core --> DB
List<BTLPartModel> newBtlParts = BtlPartList.Select(x => BTLPartController.ConvertFromCore(x, currData.ProjDbId)).ToList();
try
{ {
// elementi BtlPartId NON + presenti da eliminare var locBtlCtrl = new BTLPartController();
List<int> bpi2rem = oldBtlParts.Select(x => x.PartId).Except(newBtlParts.Select(y => y.PartId)).ToList(); // converto le BtlParts da core --> DB
List<int> bpi2add = newBtlParts.Select(x => x.PartId).Except(oldBtlParts.Select(y => y.PartId)).ToList(); List<BTLPartModel> newBtlParts = BtlPartList.Select(x => locBtlCtrl.ConvertFromCore(x, currData.ProjDbId)).ToList();
List<int> bpiExis = newBtlParts.Select(x => x.PartId).Intersect(oldBtlParts.Select(y => y.PartId)).ToList();
// aggiorno existing... try
foreach (var currPartId in bpiExis)
{ {
// recupero item da aggiornare... // elementi BtlPartId NON + presenti da eliminare
var oldItem = oldBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault(); List<int> bpi2rem = oldBtlParts.Select(x => x.PartId).Except(newBtlParts.Select(y => y.PartId)).ToList();
// dati nuovo item List<int> bpi2add = newBtlParts.Select(x => x.PartId).Except(oldBtlParts.Select(y => y.PartId)).ToList();
var newItem = newBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault(); List<int> bpiExis = newBtlParts.Select(x => x.PartId).Intersect(oldBtlParts.Select(y => y.PartId)).ToList();
if (newItem != null && oldItem != null)
// aggiorno existing...
foreach (var currPartId in bpiExis)
{ {
oldItem.CALC_State = newItem.CALC_State; // recupero item da aggiornare...
oldItem.CNT = newItem.CNT; var oldItem = oldBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
oldItem.DO = newItem.DO; // dati nuovo item
oldItem.H = newItem.H; var newItem = newBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
oldItem.L = newItem.L; if (newItem != null && oldItem != null)
oldItem.W = newItem.W; {
oldItem.Material = newItem.Material; oldItem.CALC_State = newItem.CALC_State;
oldItem.NAM = newItem.NAM; oldItem.CNT = newItem.CNT;
oldItem.PDN = newItem.PDN; oldItem.DO = newItem.DO;
oldItem.H = newItem.H;
oldItem.L = newItem.L;
oldItem.W = newItem.W;
oldItem.Material = newItem.Material;
oldItem.NAM = newItem.NAM;
oldItem.PDN = newItem.PDN;
}
}
// aggiungo le nuove part
foreach (var newPartId in bpi2add)
{
var newItem = newBtlParts.Where(x => x.PartId == newPartId).FirstOrDefault();
localDbCtx.BTLPartList.Add(newItem);
}
// elimino dal DB i non + esistenti
foreach (var oldPartId in bpi2rem)
{
// elimino parts nei MachGroup
var oldIstPartList = localDbCtx.PartList.Where(x => x.BTLPart.PartId == oldPartId).ToList();
localDbCtx.PartList.RemoveRange(oldIstPartList);
// elimino BtlParts
var oldItem = oldBtlParts.Where(x => x.PartId == oldPartId).FirstOrDefault();
localDbCtx.BTLPartList.Remove(oldItem);
} }
} }
catch
{ }
// aggiungo le nuove part // aggiorno valore isNew a false
foreach (var newPartId in bpi2add) currData.IsNew = false;
{
var newItem = newBtlParts.Where(x => x.PartId == newPartId).FirstOrDefault();
localDbCtx.BTLPartList.Add(newItem);
}
// elimino dal DB i non + esistenti // Commit changes
foreach (var oldPartId in bpi2rem) localDbCtx.SaveChanges();
{ }
// elimino parts nei MachGroup else
var oldIstPartList = localDbCtx.PartList.Where(x => x.BTLPart.PartId == oldPartId).ToList(); {
localDbCtx.PartList.RemoveRange(oldIstPartList); string errMessage = $"ERROR on Proj.UpdateBtlParts: req item was not found | ProjId {ProjId} | BtlPartList {BtlPartList.Count} items";
// elimino BtlParts Console.WriteLine(errMessage);
var oldItem = oldBtlParts.Where(x => x.PartId == oldPartId).FirstOrDefault(); Log.Error(errMessage);
localDbCtx.BTLPartList.Remove(oldItem);
}
} }
catch
{ }
// aggiorno valore isNew a false
currData.IsNew = false;
// Commit changes
localDbCtx.SaveChanges();
} }
return currData; return currData;
} }
@@ -573,50 +595,67 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.ProjList .ProjList
.Where(x => x.ProjId == ProjId) .Where(x => x.ProjId == ProjId)
.SingleOrDefault(); .SingleOrDefault();
if (currData != null)
// 2022.01.24: verifico UNIVOCITA' nel nome del file: SE fosse duplicato --> nuovo
// nome, nel formato nomeOriginale_idx, dove idx è il contatore libero successivo
var duplicateList = FindByBtlFileName(BTLFileName);
// devo verificare SOLO SE la lista non è vuota
if (duplicateList != null && duplicateList.Count > 0)
{ {
// se ne ho esattamente 1 nel DB allora DEVE essere il record Parent try
if (duplicateList.Count == 1)
{ {
// verifico se ProjId variato // 2022.01.24: verifico UNIVOCITA' nel nome del file: SE fosse duplicato -->
if (!duplicateList[0].ProjId.Equals(currData.ProjId)) // nuovo nome, nel formato nomeOriginale_idx, dove idx è il contatore libero successivo
var duplicateList = FindByBtlFileName(BTLFileName);
// devo verificare SOLO SE la lista non è vuota
if (duplicateList != null && duplicateList.Count > 0)
{ {
// in questo caso ho il PRIMO duplicato // se ne ho esattamente 1 nel DB allora DEVE essere il record Parent
BTLFileName = $"{BTLFileName}_1"; if (duplicateList.Count == 1)
{
// verifico se ProjId variato
if (!duplicateList[0].ProjId.Equals(currData.ProjId))
{
// in questo caso ho il PRIMO duplicato
BTLFileName = $"{BTLFileName}_1";
}
}
// se ne ho + di 1 --> so che il maxId interno avrò il valore ULTIMO x
// prendere il successivo
else
{
var lastRec = duplicateList.OrderByDescending(x => x.ProjDbId).FirstOrDefault();
// cerco indice
string maybeNumber = lastRec.BTLFileName.Replace($"{BTLFileName}_", "");
int index = 0;
bool isNumber = int.TryParse(maybeNumber, out index);
// fasccio comunque verifica sia numerico
if (isNumber)
{
// in questo caso ho il l'ULTIMO duplicato e faccio +1
BTLFileName = $"{BTLFileName}_{index + 1}";
}
}
} }
// aggiorno valore BTL
currData.BTLFileName = BTLFileName;
currData.DtExported = DtExported;
currData.ListName = ListName;
currData.PType = PType;
currData.Machine = Machine;
// Commit changes
localDbCtx.SaveChanges();
} }
// se ne ho + di 1 --> so che il maxId interno avrò il valore ULTIMO x prendere catch (Exception exc)
// il successivo
else
{ {
var lastRec = duplicateList.OrderByDescending(x => x.ProjDbId).FirstOrDefault(); string errMessage = $"EXCEPTION on Part.UpdateInfo:{Environment.NewLine}{exc}";
// cerco indice Console.WriteLine(errMessage);
string maybeNumber = lastRec.BTLFileName.Replace($"{BTLFileName}_", ""); Log.Error(errMessage);
int index = 0;
bool isNumber = int.TryParse(maybeNumber, out index);
// fasccio comunque verifica sia numerico
if (isNumber)
{
// in questo caso ho il l'ULTIMO duplicato e faccio +1
BTLFileName = $"{BTLFileName}_{index + 1}";
}
} }
} }
else
// aggiorno valore BTL {
currData.BTLFileName = BTLFileName; string errMessage = $"ERROR on Proj.UpdateInfo: req item was not found | ProjId {ProjId} | BTLFileName {BTLFileName} | ListName {ListName} | DtExported {DtExported} | PType {PType} | Machine {Machine}";
currData.DtExported = DtExported; Console.WriteLine(errMessage);
currData.ListName = ListName; Log.Error(errMessage);
currData.PType = PType; }
currData.Machine = Machine;
// Commit changes
localDbCtx.SaveChanges();
} }
return coreConv(currData); return coreConv(currData);
@@ -630,18 +669,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns> /// <returns></returns>
public Core.ProjFileM UpdateListName(int ProjId, string ListName) public Core.ProjFileM UpdateListName(int ProjId, string ListName)
{ {
ProjModel currData; ProjModel currData = new ProjModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
currData = localDbCtx try
.ProjList {
.Where(x => x.ProjId == ProjId) currData = localDbCtx
.SingleOrDefault(); .ProjList
// aggiorno valore BTL .Where(x => x.ProjId == ProjId)
currData.ListName = ListName; .SingleOrDefault();
if (currData != null)
{
// aggiorno valore BTL
currData.ListName = ListName;
// Commit changes // Commit changes
localDbCtx.SaveChanges(); localDbCtx.SaveChanges();
}
else
{
string errMessage = $"ERROR on Proj.UpdateListName: req item was not found | ProjId {ProjId} | ListName {ListName}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.UpdateListName:{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
return coreConv(currData); return coreConv(currData);
} }
@@ -654,18 +711,37 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns> /// <returns></returns>
public Core.ProjFileM UpdateMachine(int ProjId, String Machine) public Core.ProjFileM UpdateMachine(int ProjId, String Machine)
{ {
ProjModel currData; ProjModel currData = new ProjModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING)) using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{ {
currData = localDbCtx try
{
currData = localDbCtx
.ProjList .ProjList
.Where(x => x.ProjId == ProjId) .Where(x => x.ProjId == ProjId)
.SingleOrDefault(); .SingleOrDefault();
// aggiorno valore BTL
currData.Machine = Machine;
// Commit changes if (currData != null)
localDbCtx.SaveChanges(); {
// aggiorno valore BTL
currData.Machine = Machine;
// Commit changes
localDbCtx.SaveChanges();
}
else
{
string errMessage = $"ERROR on Proj.UpdateMachine: req item was not found | ProjId {ProjId} | Machine {Machine}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.UpdateMachine:{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
} }
return coreConv(currData); return coreConv(currData);
} }
@@ -8,15 +8,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{ {
public class StatusMapController : IDisposable public class StatusMapController : IDisposable
{ {
#region Public Fields
/// <summary>
/// Oggetto statico per gestione chiamate da altre classi
/// </summary>
public static StatusMapController man = new StatusMapController();
#endregion Public Fields
#region Public Constructors #region Public Constructors
public StatusMapController() public StatusMapController()
@@ -97,6 +97,8 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
if (!(obj is PartModel item)) if (!(obj is PartModel item))
return false; return false;
if (BTLPartDbId != item.BTLPartDbId)
return false;
if (H != item.H) if (H != item.H)
return false; return false;
if (L != item.L) if (L != item.L)
+65 -1
View File
@@ -1,4 +1,6 @@
using System.IO; using System.Diagnostics;
using System;
using System.IO;
using System.Reflection; using System.Reflection;
namespace EgtBEAMWALL.DataLayer namespace EgtBEAMWALL.DataLayer
@@ -70,6 +72,68 @@ namespace EgtBEAMWALL.DataLayer
// esecuzione script di install locale // esecuzione script di install locale
return Controllers.DbController.man.refreshViews(DATABASE_NAME); return Controllers.DbController.man.refreshViews(DATABASE_NAME);
} }
/// <summary>
/// Effettua DUMP del DB dato utente admin + percorso salvataggio
/// </summary>
/// <param name="outFilePath">Percorso di salvataggio del dump (*.sql)</param>
/// <returns></returns>
public static bool DumpDB(string mysqlDumpPath, string outFilePath)
{
bool fatto = false;
// aggiungo sql finale
if (!outFilePath.EndsWith(".sql"))
{
outFilePath = $"{outFilePath}.sql";
}
// esecuzione script x dump del DB
string dirPath = Path.GetDirectoryName(outFilePath);
if (!Directory.Exists(dirPath))
{
Directory.CreateDirectory(dirPath);
}
// se ci fosse già file elimino...
if (File.Exists(outFilePath))
{
File.Delete(outFilePath);
}
// chiamo script esterno...
string callScript = $"\"{mysqlDumpPath}\" -u{DATABASE_USER} -p{DATABASE_PWD} {DATABASE_NAME} > {outFilePath}";
ExecuteCommand(callScript);
return fatto;
}
/// <summary>
/// Esecuzione di un comando esterno
/// </summary>
/// <param name="command"></param>
public static void ExecuteCommand(string command)
{
int exitCode;
ProcessStartInfo processInfo;
Process process;
processInfo = new ProcessStartInfo("cmd.exe", "/c " + command);
processInfo.CreateNoWindow = true;
processInfo.UseShellExecute = false;
// *** Redirect the output ***
processInfo.RedirectStandardError = true;
processInfo.RedirectStandardOutput = true;
process = Process.Start(processInfo);
process.WaitForExit();
// *** Read the streams ***
// Warning: This approach can lead to deadlocks, see Edit #2
string output = process.StandardOutput.ReadToEnd();
string error = process.StandardError.ReadToEnd();
exitCode = process.ExitCode;
Console.WriteLine("output>>" + (String.IsNullOrEmpty(output) ? "(none)" : output));
Console.WriteLine("error>>" + (String.IsNullOrEmpty(error) ? "(none)" : error));
Console.WriteLine("ExitCode: " + exitCode.ToString(), "ExecuteCommand");
process.Close();
}
/// <summary> /// <summary>
/// Metodo di init standard per DB in rete con Master_Key /// Metodo di init standard per DB in rete con Master_Key
-1
View File
@@ -9,7 +9,6 @@ namespace EgtBEAMWALL.DataLayer
{ {
#region Public Fields #region Public Fields
public static DbManager obj = new DbManager();
public Controllers.BTLPartController BtlPartCtr = new Controllers.BTLPartController(); public Controllers.BTLPartController BtlPartCtr = new Controllers.BTLPartController();
public Controllers.LogMachineController LogMacCtr = new Controllers.LogMachineController(); public Controllers.LogMachineController LogMacCtr = new Controllers.LogMachineController();
public Controllers.LogSupportController LogSupCtr = new Controllers.LogSupportController(); public Controllers.LogSupportController LogSupCtr = new Controllers.LogSupportController();
@@ -37,8 +37,8 @@
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942"> <Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath> <HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference> </Reference>
<Reference Include="EgtWPFLib5"> <Reference Include="EgtWPFLib5">
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath> <HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
@@ -49,17 +49,17 @@
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath> <HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference> </Reference>
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL"> <Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath> <HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
</Reference> </Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL"> <Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath> <HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference> </Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL"> <Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath> <HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
</Reference> </Reference>
<Reference Include="MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"> <Reference Include="MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.8.0.21\lib\net452\MySql.Data.dll</HintPath> <HintPath>..\packages\MySql.Data.8.0.21\lib\net452\MySql.Data.dll</HintPath>
@@ -88,20 +88,26 @@
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" /> <Reference Include="System.Drawing.Design" />
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Management" /> <Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath> <HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Numerics" /> <Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath> <HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Security" /> <Reference Include="System.Security" />
<Reference Include="System.ServiceModel" /> <Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceProcess" /> <Reference Include="System.ServiceProcess" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" /> <Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Egalware s.r.l.")] [assembly: AssemblyCompany("Egalware s.r.l.")]
[assembly: AssemblyProduct("EgtBEAMWALL.DataLayer")] [assembly: AssemblyProduct("EgtBEAMWALL.DataLayer")]
[assembly: AssemblyCopyright("Copyright © 2020-2022 by Egalware s.r.l.")] [assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.11.3")] [assembly: AssemblyVersion("2.5.5.4")]
[assembly: AssemblyFileVersion("2.4.11.3")] [assembly: AssemblyFileVersion("2.5.5.4")]
+9 -6
View File
@@ -2,17 +2,20 @@
<packages> <packages>
<package id="BouncyCastle" version="1.8.5" targetFramework="net472" /> <package id="BouncyCastle" version="1.8.5" targetFramework="net472" />
<package id="EntityFramework" version="6.4.4" targetFramework="net452" /> <package id="EntityFramework" version="6.4.4" targetFramework="net452" />
<package id="Google.Protobuf" version="3.19.4" targetFramework="net472" /> <package id="Google.Protobuf" version="3.21.9" targetFramework="net472" />
<package id="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" /> <package id="K4os.Compression.LZ4" version="1.3.5" targetFramework="net472" />
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" /> <package id="K4os.Compression.LZ4.Streams" version="1.3.5" targetFramework="net472" />
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" /> <package id="K4os.Hash.xxHash" version="1.0.8" targetFramework="net472" />
<package id="MySql.Data" version="8.0.21" targetFramework="net472" /> <package id="MySql.Data" version="8.0.21" targetFramework="net472" />
<package id="MySql.Data.EntityFramework" version="8.0.21" targetFramework="net472" /> <package id="MySql.Data.EntityFramework" version="8.0.21" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" /> <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" />
<package id="NLog" version="5.0.1" targetFramework="net472" /> <package id="NLog" version="5.0.1" targetFramework="net472" />
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
<package id="SSH.NET" version="2016.1.0" targetFramework="net472" /> <package id="SSH.NET" version="2016.1.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" /> <package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" /> <package id="System.IO.Pipelines" version="5.0.2" targetFramework="net472" />
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" /> <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" /> <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
</packages> </packages>
+18 -15
View File
@@ -118,6 +118,7 @@ Public Class CALCPanelVM
End Sub End Sub
Private Shared Sub ProcessResults(Bar As Bar) Private Shared Sub ProcessResults(Bar As Bar)
If IsNothing(Bar) Then Return
' disabilito impostazione modificato ' disabilito impostazione modificato
Dim DisableMgr As New DisableModifiedMgr Dim DisableMgr As New DisableModifiedMgr
@@ -148,7 +149,7 @@ Public Class CALCPanelVM
If line.StartsWith("ERR=") Then If line.StartsWith("ERR=") Then
Dim nVal As Integer? = GetVal(line, "ERR") Dim nVal As Integer? = GetVal(line, "ERR")
nErr = (If(nVal IsNot Nothing, nVal.Value, 0)) nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
sMsg = "" sMsg = ""
dRot = 0 dRot = 0
nFall = 0 nFall = 0
@@ -156,24 +157,24 @@ Public Class CALCPanelVM
taskId = 0 taskId = 0
ElseIf line.StartsWith("ROT=") Then ElseIf line.StartsWith("ROT=") Then
Dim nVal As Integer? = GetVal(line, "ROT") Dim nVal As Integer? = GetVal(line, "ROT")
Dim nRot As Integer = (If(nVal IsNot Nothing, nVal.Value, 0)) Dim nRot As Integer = (If(Not IsNothing(nVal), nVal.Value, 0))
dRot = Math.Abs(((4 - nRot) Mod 4) * 90) dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
dPartRot = Math.Max(dPartRot, dRot) dPartRot = Math.Max(dPartRot, dRot)
dTotRot = Math.Max(dTotRot, dRot) dTotRot = Math.Max(dTotRot, dRot)
ElseIf line.StartsWith("CUTID=") Then ElseIf line.StartsWith("CUTID=") Then
Dim nVal As Integer? = GetVal(line, "CUTID") Dim nVal As Integer? = GetVal(line, "CUTID")
cutId = If(nVal IsNot Nothing, nVal.Value, 0) cutId = If(Not IsNothing(nVal), nVal.Value, 0)
ElseIf line.StartsWith("TASKID=") Then ElseIf line.StartsWith("TASKID=") Then
Dim nVal As Integer? = GetVal(line, "TASKID") Dim nVal As Integer? = GetVal(line, "TASKID")
taskId = (If(nVal IsNot Nothing, nVal.Value, 0)) taskId = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), Bar) ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), Bar)
ElseIf line.StartsWith("FALL=") Then ElseIf line.StartsWith("FALL=") Then
Dim nVal As Integer? = GetVal(line, "FALL") Dim nVal As Integer? = GetVal(line, "FALL")
nFall = (If(nVal IsNot Nothing, nVal.Value, 0)) nFall = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall)) ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
ElseIf line.StartsWith("TIME=") Then ElseIf line.StartsWith("TIME=") Then
Dim nVal As Integer? = GetVal(line, "TIME") Dim nVal As Integer? = GetVal(line, "TIME")
nTotTime = (If(nVal IsNot Nothing, nVal.Value, 0)) nTotTime = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime)) ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then 'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True) ' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
@@ -216,23 +217,25 @@ Public Class CALCPanelVM
End If End If
Select Case Line.Type Select Case Line.Type
Case ProcessResult.ProcessResultTypes.BAR Case ProcessResult.ProcessResultTypes.BAR
CurrMachgroupVM.CalcMachGroupUpdate(Line.nERR, Line.dROT, Line.sMSG) If Not IsNothing(CurrMachgroupVM) Then CurrMachgroupVM.CalcMachGroupUpdate(Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.PART Case ProcessResult.ProcessResultTypes.PART
CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG) If Not IsNothing(CurrPartVM) Then CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.TASKID Case ProcessResult.ProcessResultTypes.TASKID
CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG) If Not IsNothing(CurrBTLFeatureVM) Then CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.FALL Case ProcessResult.ProcessResultTypes.FALL
CurrPartVM.CalcFallUpdate(Line.nFALL) If Not IsNothing(CurrPartVM) Then CurrPartVM.CalcFallUpdate(Line.nFALL)
Case ProcessResult.ProcessResultTypes.TIME Case ProcessResult.ProcessResultTypes.TIME
If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId) If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
CurrMachgroupVM.CalcTimeUpdate(Line.nTIME) If Not IsNothing(CurrMachgroupVM) Then CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
End Select End Select
Next Next
Machgroup = GetMachgroupVMFromMachgroupId(Bar.nBarId) Machgroup = GetMachgroupVMFromMachgroupId(Bar.nBarId)
For Each Part In Machgroup.PartVMList If Not IsNothing(Machgroup) Then
Part.CalcGlobalUpdate() For Each Part In Machgroup.PartVMList
Next Part.CalcGlobalUpdate()
Machgroup.CalcGlobalUpdate() Next
Machgroup.CalcGlobalUpdate()
End If
End If End If
+1 -1
View File
@@ -474,7 +474,7 @@ Public Class NUMAxiumComm
Friend Sub WriteNCVariables(Address As String, value As String) Friend Sub WriteNCVariables(Address As String, value As String)
Try Try
Dim dValue As Double = 0 Dim dValue As Double = 0
StringToDouble(value, dValue) StringToDoubleAdv(value, dValue)
Dim rc As Short = objDVariables.WriteVariables(objDGroupManager.Handle, Address, value) Dim rc As Short = objDVariables.WriteVariables(objDGroupManager.Handle, Address, value)
'If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc) 'If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
@@ -467,7 +467,7 @@ Public Class NUMAxiumPcToolkitComm
Friend Sub WritePlcVariables(Address As String, value As String) Friend Sub WritePlcVariables(Address As String, value As String)
Try Try
Dim dValue As Double = 0 Dim dValue As Double = 0
StringToDouble(value, dValue) StringToDoubleAdv(value, dValue)
Select Case Address Select Case Address
Case "E30099" ' in realta' per scrivere si usa la %RD0C.L Case "E30099" ' in realta' per scrivere si usa la %RD0C.L
Dim nRes = WriteLadderVar(m_nPortWVariables, RL, &HD0C, 1, dValue) Dim nRes = WriteLadderVar(m_nPortWVariables, RL, &HD0C, 1, dValue)
@@ -641,7 +641,6 @@ Public Class NUMAxiumPcToolkitComm
Dim FileTransferThread As New Thread(Sub() Dim FileTransferThread As New Thread(Sub()
' leggo variabile E30099 ' leggo variabile E30099
Dim SendPermissionVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = SENDPERMISSION) Dim SendPermissionVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = SENDPERMISSION)
Dim dTemp As Double = 0
Dim nSendPermission As Integer = 0 Dim nSendPermission As Integer = 0
EgtOutLog("Inizio invio programma") EgtOutLog("Inizio invio programma")
While nSendPermission <> 2 While nSendPermission <> 2
@@ -649,8 +648,7 @@ Public Class NUMAxiumPcToolkitComm
EgtOutLog("Inizio ciclo verifica diverso da 2") EgtOutLog("Inizio ciclo verifica diverso da 2")
' leggo valore ' leggo valore
If Not IsNothing(SendPermissionVariable.sValue) Then If Not IsNothing(SendPermissionVariable.sValue) Then
StringToDouble(SendPermissionVariable.sValue, dTemp) Integer.TryParse(SendPermissionVariable.sValue, nSendPermission)
Integer.TryParse(dTemp, nSendPermission)
EgtOutLog("Lettura variabile E30099: " & nSendPermission) EgtOutLog("Lettura variabile E30099: " & nSendPermission)
Else Else
EgtOutLog("nSendPermission = -1") EgtOutLog("nSendPermission = -1")
@@ -701,9 +699,12 @@ Public Class NUMAxiumPcToolkitComm
Try Try
ISONumVariable.sValue = SentMachGroup.Name ISONumVariable.sValue = SentMachGroup.Name
ISOSentVariable.sValue = 0 ISOSentVariable.sValue = 0
While ISOSentVariable.sValue <> 0 'Dim TempISOSentVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_SENT)
Threading.Thread.Sleep(100) 'While ISOSentVariable.sValue <> "0"
End While ' Threading.Thread.Sleep(100)
' EgtOutLog("Bloccato - Sent(80046): " & TempISOSentVariable.sValue & " Num(80045): " & ISONumVariable.sValue)
' TempISOSentVariable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_SENT)
'End While
SentMachGroup.SetSentToMachine(True) SentMachGroup.SetSentToMachine(True)
Catch ex As Exception Catch ex As Exception
EgtOutLog("Error write var after download: " & ex.Message) EgtOutLog("Error write var after download: " & ex.Message)
@@ -713,7 +714,7 @@ Public Class NUMAxiumPcToolkitComm
nRes = DownLoadFileAsyn(nPortFileTransfer, nFileType, sFilePath, DNC_MODE_ABORT, nIndex) nRes = DownLoadFileAsyn(nPortFileTransfer, nFileType, sFilePath, DNC_MODE_ABORT, nIndex)
SendPermissionVariable.sValue = 0 SendPermissionVariable.sValue = 0
m_BytesTransferedCounter = 0 m_BytesTransferedCounter = 0
Threading.Thread.Sleep(500) Threading.Thread.Sleep(1000)
m_bIsTransferActive = False m_bIsTransferActive = False
Return Return
End Sub) End Sub)
@@ -795,7 +796,7 @@ Public Class NUMAxiumPcToolkitComm
Friend Sub WriteNCVariables(Address As String, value As String) Friend Sub WriteNCVariables(Address As String, value As String)
Try Try
Dim dValue As Double = 0 Dim dValue As Double = 0
StringToDouble(value, dValue) StringToDoubleAdv(value, dValue)
Dim nType As eVarious4 Dim nType As eVarious4
Dim nValue As Integer = 0 Dim nValue As Integer = 0
Dim MyData As New My_data_struct Dim MyData As New My_data_struct
@@ -378,7 +378,7 @@ Public Class NUMFlexiumComm
' EgtOutLog("Inizio ciclo verifica diverso da 2") ' EgtOutLog("Inizio ciclo verifica diverso da 2")
' ' leggo valore ' ' leggo valore
' If Not IsNothing(SendPermissionVariable.sValue) Then ' If Not IsNothing(SendPermissionVariable.sValue) Then
' StringToDouble(SendPermissionVariable.sValue, dTemp) ' StringToDoubleAdv(SendPermissionVariable.sValue, dTemp)
' Integer.TryParse(dTemp, nSendPermission) ' Integer.TryParse(dTemp, nSendPermission)
' EgtOutLog("Lettura variabile E30099: " & nSendPermission) ' EgtOutLog("Lettura variabile E30099: " & nSendPermission)
' Else ' Else
@@ -449,7 +449,7 @@ Public Class NUMFlexiumComm
Friend Sub WriteNCVariables(Address As String, value As String) Friend Sub WriteNCVariables(Address As String, value As String)
Try Try
Dim dValue As Double = 0 Dim dValue As Double = 0
StringToDouble(value, dValue) StringToDoubleAdv(value, dValue)
Dim rc As Short = objDVariables.WriteVariables2(2, objDGroupManager.Handle, Address, dValue) Dim rc As Short = objDVariables.WriteVariables2(2, objDGroupManager.Handle, Address, dValue)
If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc) If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
@@ -102,6 +102,38 @@
<PropertyGroup> <PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\RemoteDebug\</OutputPath>
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x64'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x64\RemoteDebug\</OutputPath>
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x86\RemoteDebug\</OutputPath>
<DocumentationFile>EgtBEAMWALL.Supervisor.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="APLog"> <Reference Include="APLog">
<HintPath>..\ExtLibs\APLog.dll</HintPath> <HintPath>..\ExtLibs\APLog.dll</HintPath>
@@ -111,8 +143,8 @@
<HintPath>..\ExtLibs\APServer.dll</HintPath> <HintPath>..\ExtLibs\APServer.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes> <EmbedInteropTypes>True</EmbedInteropTypes>
</Reference> </Reference>
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942"> <Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath> <HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference> </Reference>
<Reference Include="Csv, Version=1.0.31.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Csv, Version=1.0.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Csv.1.0.31\lib\net40\Csv.dll</HintPath> <HintPath>..\packages\Csv.1.0.31\lib\net40\Csv.dll</HintPath>
@@ -134,8 +166,8 @@
<Reference Include="FluentFTP, Version=19.2.2.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL"> <Reference Include="FluentFTP, Version=19.2.2.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
<HintPath>..\packages\FluentFTP.19.2.2\lib\net45\FluentFTP.dll</HintPath> <HintPath>..\packages\FluentFTP.19.2.2\lib\net45\FluentFTP.dll</HintPath>
</Reference> </Reference>
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="Interop.FXLog"> <Reference Include="Interop.FXLog">
<HintPath>..\ExtLibs\Interop.FXLog.dll</HintPath> <HintPath>..\ExtLibs\Interop.FXLog.dll</HintPath>
@@ -151,14 +183,14 @@
<Reference Include="ISOCNC.Remoting"> <Reference Include="ISOCNC.Remoting">
<HintPath>..\ExtLibs\ISOCNC.Remoting.dll</HintPath> <HintPath>..\ExtLibs\ISOCNC.Remoting.dll</HintPath>
</Reference> </Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL"> <Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath> <HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
</Reference> </Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL"> <Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath> <HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference> </Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL"> <Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath> <HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.DotNet.PlatformAbstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.DotNet.PlatformAbstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
@@ -210,9 +242,12 @@
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" /> <Reference Include="System.Drawing.Design" />
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Management" /> <Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath> <HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Net.NameResolution, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Net.NameResolution, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll</HintPath> <HintPath>..\packages\System.Net.NameResolution.4.3.0\lib\net46\System.Net.NameResolution.dll</HintPath>
@@ -228,8 +263,8 @@
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath> <HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.0.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath> <HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.0.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
@@ -238,6 +273,9 @@
</Reference> </Reference>
<Reference Include="System.Runtime.Remoting" /> <Reference Include="System.Runtime.Remoting" />
<Reference Include="System.Security" /> <Reference Include="System.Security" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" /> <Reference Include="System.Transactions" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
@@ -1,4 +1,5 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.Globalization
Imports System.IO Imports System.IO
Imports System.Windows.Threading Imports System.Windows.Threading
Imports EgtBEAMWALL.Core Imports EgtBEAMWALL.Core
@@ -560,6 +561,8 @@ Public Class LeftPanelVM
If CurrentMachine.Flow = FlowTypes.ONEBYONE Then If CurrentMachine.Flow = FlowTypes.ONEBYONE Then
MyMachGroupVM.UpdateProduceIsEnabledForAll() MyMachGroupVM.UpdateProduceIsEnabledForAll()
End If End If
' aggiorno log macchina
Map.refMachineLogPageVM.UpdateMachineLogList(False)
End Sub End Sub
#End Region ' DoneRawPart #End Region ' DoneRawPart
@@ -799,6 +802,8 @@ Public Class LeftPanelVM
Next Next
SetDonePart(SelMachGroup, SelMachGroup.SelPart) SetDonePart(SelMachGroup, SelMachGroup.SelPart)
Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup = SelMachGroup Map.refProjectVM.SupervisorMachGroupPanelVM.SelectedMachGroup = SelMachGroup
' aggiorno log macchina
Map.refMachineLogPageVM.UpdateMachineLogList(False)
End Sub End Sub
Public Sub SetDonePart(MachGroup As MyMachGroupVM, Part As PartVM) Public Sub SetDonePart(MachGroup As MyMachGroupVM, Part As PartVM)
@@ -1003,14 +1008,48 @@ Public Class LeftPanelVM
Private Sub CreateDataFile(sFilePath As String, SelPart As PartVM, SelMachGroup As MyMachGroupVM) Private Sub CreateDataFile(sFilePath As String, SelPart As PartVM, SelMachGroup As MyMachGroupVM)
Dim sFileText As New List(Of String) Dim sFileText As New List(Of String)
Dim nBtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
Dim sInfo As String = ""
Dim bOk As Boolean = False
' inserisco il capitolo del [Main] ' inserisco il capitolo del [Main]
sFileText.Add("[Main]") sFileText.Add("[Main]")
sFileText.Add("Var1=$PRODID$," & Map.refSupervisorManagerVM.CurrProd.sProdId) sFileText.Add("Var1=$PRODID$," & Map.refSupervisorManagerVM.CurrProd.sProdId)
sFileText.Add("Var2=$MACHGROUPID$," & SelMachGroup.Id) sFileText.Add("Var2=$MACHGROUPID$," & SelMachGroup.nName)
sFileText.Add("Var3=$PARTID$," & SelPart.nPDN) sFileText.Add("Var3=$PARTID$," & SelPart.nPDN)
sFileText.Add("Var4=$MATERIAL$," & SelPart.sMATERIAL) sFileText.Add("Var4=$MATERIAL$," & SelPart.sMATERIAL)
'sFileText.Add("Var5=$Thickness$," & SelPart.Thickness) bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_PROJNUM, sInfo)
'sFileText.Add("Var6=$Storage$," & SelPart.WarehousePosition) sFileText.Add("Var5=$PROJECTNUMBER$," & If(bOk, sInfo, ""))
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_PROJNAME, sInfo)
sFileText.Add("Var6=$PROJECTNAME$," & If(bOk, sInfo, ""))
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_CUSTOMER, sInfo)
sFileText.Add("Var7=$CUSTOMER$," & If(bOk, sInfo, ""))
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_ASSEMBLYNUM, sInfo)
sFileText.Add("Var8=$ASSEMBLYNUMBER$," & If(bOk, sInfo, ""))
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_ORDERNUM, sInfo)
sFileText.Add("Var9=$ORDERNUMBER$," & If(bOk, sInfo, ""))
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_DESIGNATION, sInfo)
sFileText.Add("Var10=$DESIGNATION$," & If(bOk, sInfo, ""))
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_ANNOTATION, sInfo)
sFileText.Add("Var11=$ANNOTATION$," & If(bOk, sInfo, ""))
sFileText.Add("Var12=$STOREY$," & SelPart.sSTOREY)
sFileText.Add("Var13=$GROUP$," & SelPart.sGROUP)
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_PACKAGE, sInfo)
sFileText.Add("Var14=$PACKAGE$," & If(bOk, sInfo, ""))
sFileText.Add("Var15=$WHL$," & SelPart.sW & "x" & SelPart.sH & "x" & SelPart.sL)
sFileText.Add("Var16=$PRODUCTIONDATE$," & Date.Now().ToString("yyyy-MM-dd"))
' calcolo numero settimana corrente secondo ISO 8601
Dim time As Date = Date.Now()
Dim Day As DayOfWeek = CultureInfo.InvariantCulture.Calendar.GetDayOfWeek(time)
If Day >= DayOfWeek.Monday AndAlso Day <= DayOfWeek.Wednesday Then time = time.AddDays(3)
Dim nWeekOfYear As Integer = CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(time, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday)
sFileText.Add("Var17=$PRODUCTIONWEEK$," & nWeekOfYear)
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_DESCRIPTION, sInfo)
sFileText.Add("Var18=$DESCRIPTION$," & If(bOk, sInfo, ""))
bOk = EgtGetInfo(SelPart.nPartId, BTL_PRT_QUALITYGRADE, sInfo)
sFileText.Add("Var19=$QUALITYGRADE$," & If(bOk, sInfo, ""))
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_BTLPATH, sInfo)
sFileText.Add("Var20=$BTLPATH$," & If(bOk, Path.GetFileNameWithoutExtension(sInfo), ""))
Try Try
File.WriteAllLines(sFilePath, sFileText) File.WriteAllLines(sFilePath, sFileText)
Catch ex As Exception Catch ex As Exception
@@ -666,10 +666,17 @@ Public Class MachCommandMessagePanelVM
ErrorAdditionalMsg = "Line Number" ErrorAdditionalMsg = "Line Number"
ErrorNumberMsg = "CN:" ErrorNumberMsg = "CN:"
End If End If
Dim sErrorMessage As String = ErrorMessage
If bMsgTranslationActive Then
Dim sTranslatedMsg = MachMsg(MsgParagraphs.CNC, nErrorNumber)
If Not String.IsNullOrWhiteSpace(sTranslatedMsg) Then
sErrorMessage = sTranslatedMsg
End If
End If
ErrorLineMsg = "Number from the Cnc Block" ErrorLineMsg = "Number from the Cnc Block"
AlarmMessage = If(nErrorNumber <> 0, ErrorNumberMsg & ": " & nErrorNumber & " - ", "") & AlarmMessage = If(nErrorNumber <> 0, ErrorNumberMsg & ": " & nErrorNumber & " - ", "") &
If(nErrorExtNumber <> 0, " - " & ErrorExtNumberMsg & ": " & nErrorExtNumber, "") & If(nErrorExtNumber <> 0, " - " & ErrorExtNumberMsg & ": " & nErrorExtNumber, "") &
" " & ErrorMessage " " & sErrorMessage
Case NUM_ErrorTypes.Drive_Error Case NUM_ErrorTypes.Drive_Error
ErrorIndexMsg = "Azionamento: Asse" ErrorIndexMsg = "Azionamento: Asse"
ErrorNumberMsg = "Ext" ErrorNumberMsg = "Ext"
@@ -132,7 +132,7 @@ Public Class MyMachGroupVM
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo) EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c) sSplitInfo = sInfo.Split(","c)
StringToDouble(sSplitInfo(1), MyMachGroupM.dStartCut) StringToDoubleAdv(sSplitInfo(1), MyMachGroupM.dStartCut)
Else Else
MyMachGroupM.dStartCut = 0 MyMachGroupM.dStartCut = 0
End If End If
@@ -286,70 +286,59 @@ Public Class MachManaging
Dim dTemp As Double = 0 Dim dTemp As Double = 0
Dim nTemp As Integer = 0 Dim nTemp As Integer = 0
If Not IsNothing(ResetVariable.sValue) Then If Not IsNothing(ResetVariable.sValue) Then
StringToDouble(ResetVariable.sValue, dTemp) Integer.TryParse(ResetVariable.sValue, nReset_State)
Integer.TryParse(dTemp, nReset_State)
Else Else
nReset_State = 1 nReset_State = 1
End If End If
If Not IsNothing(StartVariable.sValue) Then If Not IsNothing(StartVariable.sValue) Then
StringToDouble(StartVariable.sValue, dTemp) Integer.TryParse(StartVariable.sValue, nTemp)
Integer.TryParse(dTemp, nTemp)
nStart_State = (nTemp = 1) nStart_State = (nTemp = 1)
Else Else
nStart_State = -1 nStart_State = -1
End If End If
If Not IsNothing(StopVariable.sValue) Then If Not IsNothing(StopVariable.sValue) Then
StringToDouble(StopVariable.sValue, dTemp) Integer.TryParse(StopVariable.sValue, nTemp)
Integer.TryParse(dTemp, nTemp)
nStop_State = (nTemp = 1) nStop_State = (nTemp = 1)
Else Else
nStop_State = -1 nStop_State = -1
End If End If
If Not IsNothing(ProdVariable.sValue) Then If Not IsNothing(ProdVariable.sValue) Then
StringToDouble(ProdVariable.sValue, dTemp) Integer.TryParse(ProdVariable.sValue, nP_Prod)
Integer.TryParse(dTemp, nP_Prod)
Else Else
nP_Prod = -1 nP_Prod = -1
End If End If
If Not IsNothing(MachGroupVariable.sValue) Then If Not IsNothing(MachGroupVariable.sValue) Then
StringToDouble(MachGroupVariable.sValue, dTemp) Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
Integer.TryParse(dTemp, nP_Machgroup)
Else Else
nP_Machgroup = -1 nP_Machgroup = -1
End If End If
If Not IsNothing(PartVariable.sValue) Then If Not IsNothing(PartVariable.sValue) Then
StringToDouble(PartVariable.sValue, dTemp) Integer.TryParse(PartVariable.sValue, nP_Part)
Integer.TryParse(dTemp, nP_Part)
Else Else
nP_Part = -1 nP_Part = -1
End If End If
If Not IsNothing(StateVariable.sValue) Then If Not IsNothing(StateVariable.sValue) Then
StringToDouble(StateVariable.sValue, dTemp) Integer.TryParse(StateVariable.sValue, nP_State)
Integer.TryParse(dTemp, nP_State)
Else Else
nP_State = -1 nP_State = -1
End If End If
If Not IsNothing(ISONumVariable.sValue) Then If Not IsNothing(ISONumVariable.sValue) Then
StringToDouble(ISONumVariable.sValue, dTemp) Integer.TryParse(ISONumVariable.sValue, nISO_Num)
Integer.TryParse(dTemp, nISO_Num)
Else Else
nISO_Num = -1 nISO_Num = -1
End If End If
If Not IsNothing(ISOSentVariable.sValue) Then If Not IsNothing(ISOSentVariable.sValue) Then
StringToDouble(ISOSentVariable.sValue, dTemp) Integer.TryParse(ISOSentVariable.sValue, nISO_Sent)
Integer.TryParse(dTemp, nISO_Sent)
Else Else
nISO_Sent = -1 nISO_Sent = -1
End If End If
If Not IsNothing(RunningVariable.sValue) Then If Not IsNothing(RunningVariable.sValue) Then
StringToDouble(RunningVariable.sValue, dTemp) Integer.TryParse(RunningVariable.sValue, nRunning)
Integer.TryParse(dTemp, nRunning)
Else Else
nRunning = -1 nRunning = -1
End If End If
If Not IsNothing(MachIndexVariable.sValue) Then If Not IsNothing(MachIndexVariable.sValue) Then
StringToDouble(MachIndexVariable.sValue, dTemp) Integer.TryParse(MachIndexVariable.sValue, nCurrMachIndex)
Integer.TryParse(dTemp, nCurrMachIndex)
Else Else
nCurrMachIndex = -1 nCurrMachIndex = -1
End If End If
@@ -366,70 +355,59 @@ Public Class MachManaging
Dim dTemp As Double = 0 Dim dTemp As Double = 0
Dim nTemp As Integer = 0 Dim nTemp As Integer = 0
If Not IsNothing(ResetVariable.sValue) Then If Not IsNothing(ResetVariable.sValue) Then
StringToDouble(ResetVariable.sValue, dTemp) Integer.TryParse(ResetVariable.sValue, nReset_State)
Integer.TryParse(dTemp, nReset_State)
Else Else
nReset_State = 1 nReset_State = 1
End If End If
If Not IsNothing(StartVariable.sValue) Then If Not IsNothing(StartVariable.sValue) Then
StringToDouble(StartVariable.sValue, dTemp) Integer.TryParse(StartVariable.sValue, nTemp)
Integer.TryParse(dTemp, nTemp)
nStart_State = (nTemp = 1) nStart_State = (nTemp = 1)
Else Else
nStart_State = -1 nStart_State = -1
End If End If
If Not IsNothing(StopVariable.sValue) Then If Not IsNothing(StopVariable.sValue) Then
StringToDouble(StopVariable.sValue, dTemp) Integer.TryParse(StopVariable.sValue, nTemp)
Integer.TryParse(dTemp, nTemp)
nStop_State = (nTemp = 1) nStop_State = (nTemp = 1)
Else Else
nStop_State = -1 nStop_State = -1
End If End If
If Not IsNothing(ProdVariable.sValue) Then If Not IsNothing(ProdVariable.sValue) Then
StringToDouble(ProdVariable.sValue, dTemp) Integer.TryParse(ProdVariable.sValue, nP_Prod)
Integer.TryParse(dTemp, nP_Prod)
Else Else
nP_Prod = -1 nP_Prod = -1
End If End If
If Not IsNothing(MachGroupVariable.sValue) Then If Not IsNothing(MachGroupVariable.sValue) Then
StringToDouble(MachGroupVariable.sValue, dTemp) Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
Integer.TryParse(dTemp, nP_Machgroup)
Else Else
nP_Machgroup = -1 nP_Machgroup = -1
End If End If
If Not IsNothing(PartVariable.sValue) Then If Not IsNothing(PartVariable.sValue) Then
StringToDouble(PartVariable.sValue, dTemp) Integer.TryParse(PartVariable.sValue, nP_Part)
Integer.TryParse(dTemp, nP_Part)
Else Else
nP_Part = -1 nP_Part = -1
End If End If
If Not IsNothing(StateVariable.sValue) Then If Not IsNothing(StateVariable.sValue) Then
StringToDouble(StateVariable.sValue, dTemp) Integer.TryParse(StateVariable.sValue, nP_State)
Integer.TryParse(dTemp, nP_State)
Else Else
nP_State = -1 nP_State = -1
End If End If
If Not IsNothing(ISONumVariable.sValue) Then If Not IsNothing(ISONumVariable.sValue) Then
StringToDouble(ISONumVariable.sValue, dTemp) Integer.TryParse(ISONumVariable.sValue, nISO_Num)
Integer.TryParse(dTemp, nISO_Num)
Else Else
nISO_Num = -1 nISO_Num = -1
End If End If
If Not IsNothing(ISOSentVariable.sValue) Then If Not IsNothing(ISOSentVariable.sValue) Then
StringToDouble(ISOSentVariable.sValue, dTemp) Integer.TryParse(ISOSentVariable.sValue, nISO_Sent)
Integer.TryParse(dTemp, nISO_Sent)
Else Else
nISO_Sent = -1 nISO_Sent = -1
End If End If
If Not IsNothing(RunningVariable.sValue) Then If Not IsNothing(RunningVariable.sValue) Then
StringToDouble(RunningVariable.sValue, dTemp) Integer.TryParse(RunningVariable.sValue, nRunning)
Integer.TryParse(dTemp, nRunning)
Else Else
nRunning = -1 nRunning = -1
End If End If
If Not IsNothing(MachIndexVariable.sValue) Then If Not IsNothing(MachIndexVariable.sValue) Then
StringToDouble(MachIndexVariable.sValue, dTemp) Integer.TryParse(MachIndexVariable.sValue, nCurrMachIndex)
Integer.TryParse(dTemp, nCurrMachIndex)
Else Else
nCurrMachIndex = -1 nCurrMachIndex = -1
End If End If
@@ -469,7 +447,7 @@ Public Class MachManaging
Else Else
OpState = OPStates.End OpState = OPStates.End
End If End If
If OpState <> Map.refLeftPanelVM.SelOPState.Id Then If IsNothing(Map.refLeftPanelVM.SelOPState) OrElse OpState <> Map.refLeftPanelVM.SelOPState.Id Then
m_OpStateCallbackDlg(OpState) m_OpStateCallbackDlg(OpState)
End If End If
End If End If
@@ -540,27 +518,33 @@ Public Class MachManaging
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup) Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
' se pezzo = -1 devo dare start a tutti i pezzi del MachGroup ' se pezzo = -1 devo dare start a tutti i pezzi del MachGroup
If nP_Part = -1 Then If nP_Part = -1 Then
For Each Part In MachGroup.PartVMList If Not IsNothing(MachGroup) Then
' scrivo data start su Db pezzo For Each Part In MachGroup.PartVMList
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart) ' scrivo data start su Db pezzo
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.WIP) DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
' scrivo stato start DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.WIP)
Part.nProduction_State = ItemState.WIP ' scrivo stato start
Part.dtStartTime = dtStart Part.nProduction_State = ItemState.WIP
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State)) Part.dtStartTime = dtStart
' scrivo evento inizio pezzo su DB Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId)) ' scrivo evento inizio pezzo su DB
Next DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
Next
End If
Else Else
' scrivo data start su Db pezzo ' scrivo data start su Db pezzo
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, nP_Part, dtStart) DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, nP_Part, dtStart)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.WIP) DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.WIP)
' recupero pezzo If Not IsNothing(MachGroup) Then
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part) ' recupero pezzo
' scrivo stato start Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
Part.nProduction_State = ItemState.WIP If Not IsNothing(Part) Then
Part.dtStartTime = dtStart ' scrivo stato start
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State)) Part.nProduction_State = ItemState.WIP
Part.dtStartTime = dtStart
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
End If
End If
' scrivo evento inizio pezzo su DB ' scrivo evento inizio pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId)) DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
End If End If
@@ -577,12 +561,16 @@ Public Class MachManaging
DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart) DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart)
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.WIP) DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.WIP)
' scrivo stato start ' scrivo stato start
MachGroup.MyMachGroupM.SetProductionState(ItemState.WIP) If Not IsNothing(MachGroup) Then
MachGroup.dtStartTime = dtStart MachGroup.MyMachGroupM.SetProductionState(ItemState.WIP)
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State)) MachGroup.dtStartTime = dtStart
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
End If
' scrivo evento inizio MachGroup su DB ' scrivo evento inizio MachGroup su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(dtStart, nP_Prod, nP_Machgroup, nP_State, DbControllers.SupervisorId)) DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(dtStart, nP_Prod, nP_Machgroup, nP_State, DbControllers.SupervisorId))
End If End If
' flag di aggiornamento log macchina
Map.refMachineLogPageVM.UpdateMachineLogList(False)
' attesa per essere sicuro che abbia scritto e riletto variabili ' attesa per essere sicuro che abbia scritto e riletto variabili
Threading.Thread.Sleep(300) Threading.Thread.Sleep(300)
ElseIf nP_State = PartState.END_ Then ElseIf nP_State = PartState.END_ Then
@@ -591,44 +579,50 @@ Public Class MachManaging
Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup) Dim MachGroup As MyMachGroupVM = Map.refProjectVM.SupervisorMachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nP_Machgroup)
' se pezzo = -1 devo dare end a tutti i pezzi del MachGroup ' se pezzo = -1 devo dare end a tutti i pezzi del MachGroup
If nP_Part = -1 Then If nP_Part = -1 Then
For Each Part In MachGroup.PartVMList If Not IsNothing(MachGroup) Then
' scrivo data end su Db pezzo For Each Part In MachGroup.PartVMList
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, Part.nPartId, dtEnd) ' scrivo data end su Db pezzo
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.Produced) DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, Part.nPartId, dtEnd)
' scrivo stato end DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.Produced)
Part.nProduction_State = ItemState.Produced ' scrivo stato end
Part.dtEndTime = dtEnd Part.nProduction_State = ItemState.Produced
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State)) Part.dtEndTime = dtEnd
' resetto stato redo Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
Part.bRedo = False ' resetto stato redo
' se non impostata data start Part.bRedo = False
If Part.dtStartTime = DateTime.MinValue Then ' se non impostata data start
' scrivo data start su Db pezzo If Part.dtStartTime = DateTime.MinValue Then
Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60) ' scrivo data start su Db pezzo
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart) Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
Part.dtStartTime = dtStart DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
End If Part.dtStartTime = dtStart
' scrivo evento fine pezzo su DB End If
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId)) ' scrivo evento fine pezzo su DB
Next DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
Next
End If
Else Else
' scrivo data end su Db pezzo ' scrivo data end su Db pezzo
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, nP_Part, dtEnd) DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, nP_Part, dtEnd)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.Produced) DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.Produced)
' recupero pezzo If Not IsNothing(MachGroup) Then
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part) ' recupero pezzo
' scrivo stato end Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
Part.nProduction_State = ItemState.Produced If Not IsNothing(Part) Then
Part.dtEndTime = dtEnd ' scrivo stato end
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State)) Part.nProduction_State = ItemState.Produced
' resetto stato redo Part.dtEndTime = dtEnd
Part.bRedo = False Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' resetto stato redo
Part.bRedo = False
End If
End If
' scrivo evento fine pezzo su DB ' scrivo evento fine pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId)) DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
End If End If
' se tutti i pezzi della barra sono in end ' se tutti i pezzi della barra sono in end
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= 2) Then If Not IsNothing(MachGroup) AndAlso MachGroup.PartVMList.All(Function(x) x.nProduction_State >= 2) Then
' scrivo data end su Db barra ' scrivo data end su Db barra
DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, dtEnd) DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, dtEnd)
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.Produced) DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.Produced)
@@ -674,14 +668,20 @@ Public Class MachManaging
End If End If
' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup ' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup
If nP_Part = -1 Then If nP_Part = -1 Then
For Each Part In MachGroup.PartVMList If Not IsNothing(MachGroup) Then
Map.refLeftPanelVM.PrintLabel(MachGroup, Part) For Each Part In MachGroup.PartVMList
Next Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
Next
End If
Else Else
' recupero pezzo ' recupero pezzo
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part) Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
Map.refLeftPanelVM.PrintLabel(MachGroup, Part) If Not IsNothing(Part) Then
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
End If
End If End If
' flag di aggiornamento log macchina
Map.refMachineLogPageVM.UpdateMachineLogList(False)
' attesa per essere sicuro che abbia scritto e riletto variabili ' attesa per essere sicuro che abbia scritto e riletto variabili
Threading.Thread.Sleep(300) Threading.Thread.Sleep(300)
End If End If
@@ -706,7 +706,7 @@ Public Class MachManaging
For VParIndex = 1 To sVs.Length - 1 For VParIndex = 1 To sVs.Length - 1
Dim VPar() As String = sVs(VParIndex).Split("="c) Dim VPar() As String = sVs(VParIndex).Split("="c)
VPar(1) = VPar(1).Trim VPar(1) = VPar(1).Trim
StringToDouble(VPar(1), dVPars(VParIndex - 1)) StringToDoubleAdv(VPar(1), dVPars(VParIndex - 1))
Next Next
' li scrivo nel CN ' li scrivo nel CN
For Index As Integer = 1 To 10 For Index As Integer = 1 To 10
@@ -807,6 +807,7 @@ Public Class MachManaging
Case CommandTypes.READ_TPA Case CommandTypes.READ_TPA
Tpa.RWVariableManager.RefreshVar(Command.sVariable) Tpa.RWVariableManager.RefreshVar(Command.sVariable)
Case CommandTypes.WRITE Case CommandTypes.WRITE
'EgtOutLog("Write" & Command.sVariable & " " & Command.sVariables(1) & " " & Command.nVariable)
WriteVar(Command.sVariable, Command.sVariables(1), Command.nVariable) WriteVar(Command.sVariable, Command.sVariables(1), Command.nVariable)
Case CommandTypes.DELETEALARMS Case CommandTypes.DELETEALARMS
DeleteAlarms() DeleteAlarms()
@@ -1227,10 +1228,8 @@ Public Class MachManaging
Dim nIndex As Integer = Index Dim nIndex As Integer = Index
Dim PLCMessagesVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = PLC_MESSAGES & nIndex) Dim PLCMessagesVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = PLC_MESSAGES & nIndex)
If IsNothing(PLCMessagesVariable) OrElse IsNothing(PLCMessagesVariable.sValue) Then Return If IsNothing(PLCMessagesVariable) OrElse IsNothing(PLCMessagesVariable.sValue) Then Return
Dim dTemp As Double = 0
Dim nTemp As Integer = 0 Dim nTemp As Integer = 0
StringToDouble(PLCMessagesVariable.sValue, dTemp) Integer.TryParse(PLCMessagesVariable.sValue, nTemp)
Integer.TryParse(dTemp, nTemp)
Dim Bytes As Byte() = BitConverter.GetBytes(nTemp) Dim Bytes As Byte() = BitConverter.GetBytes(nTemp)
Dim NewBytes As Byte() = BitConverter.GetBytes(nTemp) Dim NewBytes As Byte() = BitConverter.GetBytes(nTemp)
For nBIndex = Bytes.Count - 1 To 0 Step -1 For nBIndex = Bytes.Count - 1 To 0 Step -1
@@ -148,7 +148,7 @@ Public Class RWVariableManager
Public Sub ReadVar(Name As String, ByRef Value As Double) Public Sub ReadVar(Name As String, ByRef Value As Double)
Dim nIndex As Integer = GetIndexFromName(Name) Dim nIndex As Integer = GetIndexFromName(Name)
If nIndex >= 0 Then If nIndex >= 0 Then
Value = StringToDouble(m_ReadedVars(nIndex), 5) Value = StringToDoubleAdv(m_ReadedVars(nIndex), 5)
Else Else
Value = -999999999 Value = -999999999
End If End If
@@ -25,16 +25,37 @@
</Grid> </Grid>
<StackPanel Orientation="Horizontal" Height="30"> <StackPanel Orientation="Horizontal" Height="30">
<TextBlock Text="Entità"
Style="{StaticResource Log_TextBlock}"/>
<ComboBox ItemsSource="{Binding EntityTypeList}" <ComboBox ItemsSource="{Binding EntityTypeList}"
SelectedIndex="{Binding SelEntityType}" SelectedIndex="{Binding SelEntityType}"
Width="70" Width="70"
Margin="0,0,2.5,0" Margin="0,0,2.5,0"
Style="{StaticResource PartParam_ComboBox}"/> Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="Evento"
Style="{StaticResource Log_TextBlock}"/>
<ComboBox ItemsSource="{Binding PartEventTypeList}" <ComboBox ItemsSource="{Binding PartEventTypeList}"
SelectedIndex="{Binding SelPartEventType}" SelectedIndex="{Binding SelPartEventType}"
Width="70" Width="70"
Margin="0,0,2.5,0" Margin="0,0,2.5,0"
Style="{StaticResource PartParam_ComboBox}"/> Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="Data"
Style="{StaticResource Log_TextBlock}"/>
<ComboBox ItemsSource="{Binding DayTypeList}"
SelectedIndex="{Binding SelDayType}"
Width="70"
Margin="0,0,2.5,0"
Style="{StaticResource PartParam_ComboBox}"/>
<StackPanel Orientation="Horizontal" Visibility="{Binding Date_Visibility}">
<TextBlock Text="Dal"
Style="{StaticResource Log_TextBlock}"/>
<DatePicker SelectedDate="{Binding dtStartDate}"
Style="{StaticResource Log_DatePicker}"/>
<TextBlock Text="Al"
Style="{StaticResource Log_TextBlock}"/>
<DatePicker SelectedDate="{Binding dtEndDate}"
Style="{StaticResource Log_DatePicker}"/>
</StackPanel>
<!--<TextBox Text="{Binding MaxRowNumber}"/>--> <!--<TextBox Text="{Binding MaxRowNumber}"/>-->
<Button Grid.Column="1" <Button Grid.Column="1"
Command="{Binding Refresh_Command}" Command="{Binding Refresh_Command}"
@@ -9,6 +9,16 @@ Imports EgtBEAMWALL.Core.MachLog
Public Class MachineLogPageVM Public Class MachineLogPageVM
Inherits VMBase Inherits VMBase
Private m_Lock_LogList As New Object
Private m_MachineLog_Timer As New DispatcherTimer
Private Enum DayTypes As Integer
TODAY = 0
YESTERDAY = 1
PERIOD = 2
End Enum
Private m_colMachineLog_Type As EgtDataGridColumn Private m_colMachineLog_Type As EgtDataGridColumn
Public ReadOnly Property colMachineLog_Type As EgtDataGridColumn Public ReadOnly Property colMachineLog_Type As EgtDataGridColumn
Get Get
@@ -76,6 +86,7 @@ Public Class MachineLogPageVM
End Get End Get
Set(value As Integer) Set(value As Integer)
m_SelPartEventType = value m_SelPartEventType = value
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_PARTEVENTTYPE, m_SelPartEventType.ToString())
m_MachineLogList_View.Refresh() m_MachineLogList_View.Refresh()
End Set End Set
End Property End Property
@@ -94,10 +105,75 @@ Public Class MachineLogPageVM
End Get End Get
Set(value As Integer) Set(value As Integer)
m_SelEntityType = value m_SelEntityType = value
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_ENTITYTYPE, m_SelEntityType.ToString())
m_MachineLogList_View.Refresh() m_MachineLogList_View.Refresh()
End Set End Set
End Property End Property
Private m_DayTypeList As New List(Of String)({"Oggi", "Ieri", "Periodo"})
Public ReadOnly Property DayTypeList As List(Of String)
Get
Return m_DayTypeList
End Get
End Property
Private m_SelDayType As DayTypes = DayTypes.TODAY
Public Property SelDayType As Integer
Get
Return m_SelDayType
End Get
Set(value As Integer)
Dim PrevSelDayType As DayTypes = m_SelDayType
m_SelDayType = value
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_DAYTYPE, Convert.ToInt32(m_SelDayType))
m_Date_Visibility = If(m_SelDayType = DayTypes.PERIOD, Visibility.Visible, Visibility.Collapsed)
If m_SelDayType = DayTypes.PERIOD Then
m_dtStartDate = If(PrevSelDayType = DayTypes.TODAY, DateTime.Today, DateTime.Today - TimeSpan.FromDays(1))
m_dtEndDate = If(PrevSelDayType = DayTypes.TODAY, DateTime.Today, DateTime.Today - TimeSpan.FromDays(1))
NotifyPropertyChanged(NameOf(dtStartDate))
NotifyPropertyChanged(NameOf(dtEndDate))
End If
NotifyPropertyChanged(NameOf(Date_Visibility))
' aggiorno lista da Db
UpdateMachineLogList(True)
End Set
End Property
Private m_dtStartDate As DateTime = DateTime.Today
Public Property dtStartDate As DateTime
Get
Return m_dtStartDate
End Get
Set(value As DateTime)
m_dtStartDate = value
Dim lStartDate As Long = m_dtStartDate.ToFileTimeUtc()
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_STARTDATE, lStartDate.ToString())
' aggiorno lista da Db
UpdateMachineLogList(True)
End Set
End Property
Private m_dtEndDate As DateTime = DateTime.Today
Public Property dtEndDate As DateTime
Get
Return m_dtEndDate
End Get
Set(value As DateTime)
m_dtEndDate = value
Dim lEndDate As Long = m_dtEndDate.ToFileTimeUtc()
WriteMainPrivateProfileString(S_MACHINELOGFILTER, K_ENDDATE, lEndDate.ToString())
' aggiorno lista da Db
UpdateMachineLogList(True)
End Set
End Property
Private m_Date_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Date_Visibility As Visibility
Get
Return m_Date_Visibility
End Get
End Property
' Definizione comandi ' Definizione comandi
Private m_cmdRefresh As ICommand Private m_cmdRefresh As ICommand
@@ -167,41 +243,66 @@ Public Class MachineLogPageVM
m_colMachineLog_Type = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_TYPE) m_colMachineLog_Type = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_TYPE)
m_colMachineLog_Description = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_DESCRIPTION) m_colMachineLog_Description = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_DESCRIPTION)
m_colMachineLog_SupervisorId = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_SUPERVISORID) m_colMachineLog_SupervisorId = m_MachineLogColumns.FirstOrDefault(Function(x) x.Name = COL_SUPERVISORID)
' imposto valori filtri da ini
m_SelPartEventType = GetMainPrivateProfileInt(S_MACHINELOGFILTER, K_PARTEVENTTYPE, 2)
m_SelEntityType = GetMainPrivateProfileInt(S_MACHINELOGFILTER, K_ENTITYTYPE, 1)
m_SelDayType = GetMainPrivateProfileInt(S_MACHINELOGFILTER, K_DAYTYPE, 0)
Select Case m_SelDayType
Case DayTypes.TODAY
m_dtStartDate = DateTime.Today
m_dtEndDate = DateTime.Today
Case DayTypes.YESTERDAY
m_dtStartDate = DateTime.Today - TimeSpan.FromDays(1)
m_dtEndDate = DateTime.Today - TimeSpan.FromDays(1)
Case DayTypes.PERIOD
Dim sStartDate As String = "0"
Dim lStartDate As Long = 0
GetMainPrivateProfileString(S_MACHINELOGFILTER, K_STARTDATE, 0, sStartDate)
Long.TryParse(sStartDate, lStartDate)
m_dtStartDate = If(lStartDate > 0, DateTime.FromFileTimeUtc(lStartDate), DateTime.Today)
Dim sEndDate As String = "0"
Dim lEndDate As Long = 0
GetMainPrivateProfileString(S_MACHINELOGFILTER, K_ENDDATE, 0, sEndDate)
Long.TryParse(sEndDate, lEndDate)
m_dtEndDate = If(lEndDate > 0, DateTime.FromFileTimeUtc(lEndDate), DateTime.Today)
m_Date_Visibility = Visibility.Visible
End Select
m_MachineLog_Timer.Interval = TimeSpan.FromMilliseconds(100)
AddHandler m_MachineLog_Timer.Tick, AddressOf MachineLog_Timer_Tick
m_MachineLog_Timer.Start()
End Sub End Sub
#End Region ' CONSTRUCTORS #End Region ' CONSTRUCTORS
#Region "METHODS" #Region "METHODS"
Private Function MachineLogFilter(LogEvent As Object) As Boolean Private Function MachineLogFilter(CurrEvent As Object) As Boolean
Dim CurrLogEvent As LogEvent = DirectCast(LogEvent, LogEvent) Dim CurrLogEvent As LogEvent = DirectCast(CurrEvent, LogEvent)
Dim bOk As Boolean = True Dim bOk As Boolean = True
Select Case m_SelEntityType
Case 0
bOk = bOk And True
Case 1
bOk = bOk And CurrLogEvent.EventType = MachLogTypes.PART_STATUS
Case 2
bOk = bOk And CurrLogEvent.EventType = MachLogTypes.MACHGROUP_STATUS
End Select
If CurrLogEvent.EventType = MachLogTypes.PART_STATUS OrElse CurrLogEvent.EventType = MachLogTypes.MACHGROUP_STATUS Then
Select Case m_SelPartEventType
Case 0
bOk = bOk And True
Case 1
bOk = bOk And CurrLogEvent.nStatus = 1
Case 2
bOk = bOk And CurrLogEvent.nStatus = 2
End Select
End If
' se livello utente inferiore a 5, mostro solo eventi pezzo e machgroup ' se livello utente inferiore a 5, mostro solo eventi pezzo e machgroup
If Map.refMainWindowVM.MainWindowM.nUserLevel < 5 Then If Map.refMainWindowVM.MainWindowM.nUserLevel < 5 Then
bOk = bOk And CurrLogEvent.EventType = MachLogTypes.PART_STATUS OrElse CurrLogEvent.EventType = MachLogTypes.MACHGROUP_STATUS If CurrLogEvent.EventType <> LogEvent.MachLogTypes.PART_STATUS AndAlso CurrLogEvent.EventType <> LogEvent.MachLogTypes.MACHGROUP_STATUS Then
Else Return False
If Not CurrLogEvent.EventType = MachLogTypes.PART_STATUS AndAlso Not CurrLogEvent.EventType = MachLogTypes.MACHGROUP_STATUS Then
bOk = True
End If End If
End If End If
Select Case m_SelEntityType
Case 0 ' ""
bOk = bOk And True
Case 1 ' "Pezzo"
bOk = bOk And CurrLogEvent.EventType = LogEvent.MachLogTypes.PART_STATUS
Case 2 ' "Barra"
bOk = bOk And CurrLogEvent.EventType = LogEvent.MachLogTypes.MACHGROUP_STATUS
End Select
If CurrLogEvent.EventType = LogEvent.MachLogTypes.PART_STATUS OrElse CurrLogEvent.EventType = LogEvent.MachLogTypes.MACHGROUP_STATUS Then
Select Case m_SelPartEventType
Case 0 ' ""
bOk = bOk And True
Case 1 ' "Inizio"
bOk = bOk And CurrLogEvent.nStatus = 1
Case 2 ' "Fine"
bOk = bOk And CurrLogEvent.nStatus = 2
End Select
End If
Return bOk Return bOk
End Function End Function
@@ -211,13 +312,69 @@ Public Class MachineLogPageVM
m_colMachineLog_Description.ColumnVisibility = Visibility.Collapsed m_colMachineLog_Description.ColumnVisibility = Visibility.Collapsed
m_colMachineLog_SupervisorId.ColumnVisibility = Visibility.Collapsed m_colMachineLog_SupervisorId.ColumnVisibility = Visibility.Collapsed
End If End If
UpdateMachineLogList() UpdateMachineLogList(True)
m_MachineLogList_View = CollectionViewSource.GetDefaultView(m_MachineLogList) m_MachineLogList_View = CollectionViewSource.GetDefaultView(m_MachineLogList)
m_MachineLogList_View.Filter = AddressOf MachineLogFilter m_MachineLogList_View.Filter = AddressOf MachineLogFilter
End Sub End Sub
Friend Sub UpdateMachineLogList() ' indice di aggiornamento della lista rispetto a Db
m_MachineLogList = New ObservableCollection(Of LogEvent)(DbControllers.m_LogMachineController.GetCoreDesc(DateTime.Now - TimeSpan.FromDays(300), DateTime.Now).Select(Of LogEvent)(Function(x) New LogEvent(x)).ToList()) Private m_nUpdateIndex As Integer
' indice di ricaricamento completo della lista dal Db
Private m_nRefreshIndex As Integer
' indice dell'ultimo update/refresh
Private m_nLastLogUpdate As Integer
Friend Sub UpdateMachineLogList(bRefresh As Boolean)
Dim nMaxIndex As Integer = Math.Max(m_nUpdateIndex, m_nRefreshIndex)
If bRefresh Then
m_nRefreshIndex = nMaxIndex + 1
Else
m_nUpdateIndex = nMaxIndex + 1
End If
End Sub
Private Sub MachineLog_Timer_Tick(sender As Object, e As EventArgs)
SyncLock m_Lock_LogList
Dim nRefresh As Integer = m_nRefreshIndex
Dim nUpdate As Integer = m_nUpdateIndex
If nRefresh > m_nLastLogUpdate Then
m_nLastLogUpdate = nRefresh
UpdateFromDb(True)
ElseIf nUpdate > m_nLastLogUpdate Then
m_nLastLogUpdate = nUpdate
UpdateFromDb(False)
End If
End SyncLock
End Sub
Friend Sub UpdateFromDb(bRefresh As Boolean)
'm_MachineLogList = New ObservableCollection(Of LogEvent)(DbControllers.m_LogMachineController.GetCoreDesc(DateTime.Now - TimeSpan.FromDays(300), DateTime.Now).Select(Of LogEvent)(Function(x) New LogEvent(x)).ToList())
Dim DbList As List(Of LogEvent)
Select Case m_SelDayType
Case DayTypes.PERIOD
DbList = DbControllers.m_LogMachineController.GetCoreDesc(m_dtStartDate, m_dtEndDate + TimeSpan.FromDays(1)).Select(Of LogEvent)(Function(x) New LogEvent(x)).ToList()
Case DayTypes.YESTERDAY
DbList = DbControllers.m_LogMachineController.GetCoreDesc(DateTime.Today - TimeSpan.FromDays(1), DateTime.Today).Select(Of LogEvent)(Function(x) New LogEvent(x)).ToList()
Case Else ' DayTypes.TODAY
DbList = DbControllers.m_LogMachineController.GetCoreDesc(DateTime.Today, DateTime.Today + TimeSpan.FromDays(1)).Select(Of LogEvent)(Function(x) New LogEvent(x)).ToList()
End Select
If bRefresh OrElse m_MachineLogList.Count < 1 Then
m_MachineLogList = New ObservableCollection(Of LogEvent)(DbList)
Else
' cerco in lista Db ultimo elemento della mia lista
Dim LastItem As LogEvent = m_MachineLogList(0)
Dim CommonItem As LogEvent = DbList.FirstOrDefault(Function(x) x.EventDateTime = LastItem.EventDateTime AndAlso x.EventType = LastItem.EventType AndAlso x.SupervisorId = LastItem.SupervisorId AndAlso x.Value = LastItem.Value)
Dim nCommonItemIndex As Integer
If Not IsNothing(CommonItem) Then
nCommonItemIndex = DbList.IndexOf(CommonItem)
End If
' aggiorno i successivi
If nCommonItemIndex >= 0 Then
For Index = nCommonItemIndex - 1 To 0 Step -1
m_MachineLogList.Insert(0, DbList(Index))
Next
End If
End If
NotifyPropertyChanged(NameOf(MachineLogList)) NotifyPropertyChanged(NameOf(MachineLogList))
m_MachineLogList_View = CollectionViewSource.GetDefaultView(m_MachineLogList) m_MachineLogList_View = CollectionViewSource.GetDefaultView(m_MachineLogList)
m_MachineLogList_View.Filter = AddressOf MachineLogFilter m_MachineLogList_View.Filter = AddressOf MachineLogFilter
@@ -245,7 +402,7 @@ Public Class MachineLogPageVM
''' Execute the Open. This method is invoked by the OpenCommand. ''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary> ''' </summary>
Friend Sub Refresh() Friend Sub Refresh()
UpdateMachineLogList() UpdateMachineLogList(False)
End Sub End Sub
#End Region ' Refresh #End Region ' Refresh
@@ -239,9 +239,17 @@ Public Class MainWindowM
EgtSetNestKey(sNestKey) EgtSetNestKey(sNestKey)
' Verifico abilitazione nesting automatico ' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey) m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
' Impostazioni per chiave di rete
Dim bNetKey As Boolean = ( GetMainPrivateProfileInt( S_GENERAL, K_NETKEY, 0) = 1)
EgtSetNetHwKey( bNetKey)
Dim sLockId As String = ""
EgtUILib.GetPrivateProfileString( S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
If Not String.IsNullOrEmpty( sLockId) Then
EgtSetLockId( sLockId)
End If
' Recupero livello e opzioni della chiave ' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2411, 1, m_nKeyLevel) And Dim bKey As Boolean = EgtGetKeyLevel(5327, 2505, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2411, 1, m_nKeyOptions) EgtGetKeyOptions(5327, 2505, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface ' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString()) m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
@@ -30,7 +30,7 @@ Imports System.Windows
#End if #End if
<Assembly: AssemblyCompany("Egalware s.r.l.")> <Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("EgtBEAMWALL.Supervisor")> <Assembly: AssemblyProduct("EgtBEAMWALL.Supervisor")>
<Assembly: AssemblyCopyright("Copyright © 2020-2022 by Egalware s.r.l.")> <Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")> <Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)> <Assembly: ComVisible(false)>
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.11.3")> <Assembly: AssemblyVersion("2.5.5.4")>
<Assembly: AssemblyFileVersion("2.4.11.3")> <Assembly: AssemblyFileVersion("2.5.5.4")>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 889 B

After

Width:  |  Height:  |  Size: 1016 B

@@ -178,13 +178,14 @@ Public Class MySceneHostVM
#Region "ProjectManager" #Region "ProjectManager"
Public Overrides Sub NewProject() Public Overrides Function NewProject() As Boolean
EgtSetCurrentContext(MainScene.GetCtx()) EgtSetCurrentContext(MainScene.GetCtx())
Dim bOk As Boolean = MainController.NewProject() Dim bOk As Boolean = MainController.NewProject()
MainScene.SetStatusNull() MainScene.SetStatusNull()
End Sub Return bOk
End Function
Public Overrides Sub OpenProject(sFilePath As String) Public Overrides Function OpenProject(sFilePath As String) As Boolean
EgtSetCurrentContext(MainScene.GetCtx()) EgtSetCurrentContext(MainScene.GetCtx())
Dim bOk As Boolean = False Dim bOk As Boolean = False
If String.IsNullOrEmpty(sFilePath) Then If String.IsNullOrEmpty(sFilePath) Then
@@ -201,29 +202,32 @@ Public Class MySceneHostVM
bOk = MainController.OpenProject(sFilePath, False) bOk = MainController.OpenProject(sFilePath, False)
End If End If
MainScene.SetStatusNull() MainScene.SetStatusNull()
End Sub Return bOk
End Function
Public Overrides Sub SaveProject() Public Overrides Function SaveProject() As Boolean
MyBase.SaveProject() Dim bOk As Boolean = MyBase.SaveProject()
' Imposto stato gestione mouse diretto della scena a nessuno ' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull() MainScene.SetStatusNull()
End Sub Return bOk
End Function
Public Overrides Sub SaveAsProject() Public Overrides Function SaveAsProject() As Boolean
MyBase.SaveAsProject() Dim bOk As Boolean = MyBase.SaveAsProject()
' Imposto stato gestione mouse diretto della scena a nessuno ' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull() MainScene.SetStatusNull()
End Sub Return bOk
End Function
Public Overrides Sub ImportProject() Public Overrides Function ImportProject() As Boolean
Dim sDir As String = String.Empty Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir) GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
If Not String.IsNullOrWhiteSpace(sDir) Then If Not String.IsNullOrWhiteSpace(sDir) Then
sDir = Path.GetDirectoryName(sDir) sDir = Path.GetDirectoryName(sDir)
End If End If
sDir.TrimEnd("\"c) sDir.TrimEnd("\"c)
MainController.ImportProject(sDir) Return MainController.ImportProject(sDir)
End Sub End Function
#End Region ' ProjectManager #End Region ' ProjectManager
@@ -343,6 +343,11 @@
<Setter Property="Margin" Value="10,0,10,0"/> <Setter Property="Margin" Value="10,0,10,0"/>
</Style> </Style>
<Style x:Key="Log_TextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Margin" Value="5,0,5,0"/>
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ --> <!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- TextBox --> <!-- TextBox -->
@@ -720,4 +725,13 @@
<!-- ______________________________________________________________________________________________________________________________________________ --> <!-- ______________________________________________________________________________________________________________________________________________ -->
<!-- DatePicker -->
<Style x:Key="Log_DatePicker" TargetType="{x:Type DatePicker}">
<Setter Property="Height" Value="22" />
</Style>
<!-- ______________________________________________________________________________________________________________________________________________ -->
</ResourceDictionary> </ResourceDictionary>
+18 -3
View File
@@ -147,12 +147,27 @@ Public Class LogEvent
Select Case m_EventType Select Case m_EventType
Case MachLogTypes.PART_STATUS Case MachLogTypes.PART_STATUS
m_ProdId = sValues(0) m_ProdId = sValues(0)
m_MachGroupId = DbControllers.m_MachGroupController.FindByMachGroupId(m_ProdId, sValues(1)).Name Dim MachGroup As DataLayer.DatabaseModels.MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(m_ProdId, sValues(1))
m_PartId = DbControllers.m_PartController.FindByPartId(m_ProdId, sValues(2)).PDN If Not IsNothing(MachGroup) Then
m_MachGroupId = MachGroup.Name
Else
m_MachGroupId = -1
End If
Dim Part As DataLayer.DatabaseModels.PartModel = DbControllers.m_PartController.FindByPartId(m_ProdId, sValues(2))
If Not IsNothing(Part) Then
m_PartId = Part.PDN
Else
m_PartId = -1
End If
m_Status = sValues(3) m_Status = sValues(3)
Case MachLogTypes.MACHGROUP_STATUS Case MachLogTypes.MACHGROUP_STATUS
m_ProdId = sValues(0) m_ProdId = sValues(0)
m_MachGroupId = DbControllers.m_MachGroupController.FindByMachGroupId(m_ProdId, sValues(1)).Name Dim MachGroup As DataLayer.DatabaseModels.MachGroupModel = DbControllers.m_MachGroupController.FindByMachGroupId(m_ProdId, sValues(1))
If Not IsNothing(MachGroup) Then
m_MachGroupId = MachGroup.Name
Else
m_MachGroupId = -1
End If
m_Status = sValues(2) m_Status = sValues(2)
Case MachLogTypes.MACHINE_COMMAND Case MachLogTypes.MACHINE_COMMAND
+57 -50
View File
@@ -1,52 +1,59 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections> </configSections>
<entityFramework> <entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" /> <!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
<providers> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"> </provider>
</provider></providers> </providers>
</entityFramework> </entityFramework>
<connectionStrings> <connectionStrings>
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=root;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient" /> <add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=root;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient" />
</connectionStrings> </connectionStrings>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" /> <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" /> <bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" /> <assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" /> <bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" /> <assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" /> <bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" /> <assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.6.0" newVersion="1.2.6.0" /> <bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
</dependentAssembly> </dependentAssembly>
</assemblyBinding> <dependentAssembly>
</runtime> <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<system.data> <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
<DbProviderFactories> </dependentAssembly>
<remove invariant="MySql.Data.MySqlClient" /> </assemblyBinding>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </runtime>
</DbProviderFactories> <system.data>
</system.data> <DbProviderFactories>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration> <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=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
+9 -7
View File
@@ -4,11 +4,11 @@
<package id="Csv" version="1.0.31" targetFramework="net472" /> <package id="Csv" version="1.0.31" targetFramework="net472" />
<package id="EntityFramework" version="6.4.4" targetFramework="net452" /> <package id="EntityFramework" version="6.4.4" targetFramework="net452" />
<package id="FluentFTP" version="19.2.2" targetFramework="net472" /> <package id="FluentFTP" version="19.2.2" targetFramework="net472" />
<package id="Google.Protobuf" version="3.19.4" targetFramework="net472" /> <package id="Google.Protobuf" version="3.21.9" targetFramework="net472" />
<package id="Ionic.Zip" version="1.9.1.8" targetFramework="net472" /> <package id="Ionic.Zip" version="1.9.1.8" targetFramework="net472" />
<package id="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" /> <package id="K4os.Compression.LZ4" version="1.3.5" targetFramework="net472" />
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" /> <package id="K4os.Compression.LZ4.Streams" version="1.3.5" targetFramework="net472" />
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" /> <package id="K4os.Hash.xxHash" version="1.0.8" targetFramework="net472" />
<package id="Lextm.SharpSnmpLib" version="10.0.9" targetFramework="net472" /> <package id="Lextm.SharpSnmpLib" version="10.0.9" targetFramework="net472" />
<package id="Microsoft.DotNet.PlatformAbstractions" version="2.1.0" targetFramework="net472" /> <package id="Microsoft.DotNet.PlatformAbstractions" version="2.1.0" targetFramework="net472" />
<package id="Microsoft.Extensions.DependencyModel" version="2.1.0" targetFramework="net472" /> <package id="Microsoft.Extensions.DependencyModel" version="2.1.0" targetFramework="net472" />
@@ -16,16 +16,18 @@
<package id="MySql.Data.EntityFramework" version="8.0.21" targetFramework="net472" /> <package id="MySql.Data.EntityFramework" version="8.0.21" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" /> <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
<package id="NLog" version="5.0.1" targetFramework="net472" /> <package id="NLog" version="5.0.1" targetFramework="net472" />
<package id="Portable.BouncyCastle" version="1.8.2" targetFramework="net472" /> <package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
<package id="SSH.NET" version="2016.1.0" targetFramework="net472" /> <package id="SSH.NET" version="2016.1.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" /> <package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Collections.Specialized" version="4.3.0" targetFramework="net472" /> <package id="System.Collections.Specialized" version="4.3.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" /> <package id="System.IO.Pipelines" version="5.0.2" targetFramework="net472" />
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
<package id="System.Net.NameResolution" version="4.3.0" targetFramework="net472" /> <package id="System.Net.NameResolution" version="4.3.0" targetFramework="net472" />
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net472" /> <package id="System.Net.Sockets" version="4.3.0" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" /> <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" /> <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.0.0" targetFramework="net472" /> <package id="System.Runtime.InteropServices.RuntimeInformation" version="4.0.0" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
<package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net472" /> <package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net472" />
<package id="Zebra.Printer.SDK" version="2.15.2634" targetFramework="net472" /> <package id="Zebra.Printer.SDK" version="2.15.2634" targetFramework="net472" />
</packages> </packages>
@@ -40,7 +40,7 @@ Public Class AddPartWndVM
End Get End Get
Set(value As String) Set(value As String)
Dim dTempL As Double Dim dTempL As Double
If StringToLen(value, dTempL) AndAlso dTempL > 0 Then If StringToLenAdv(value, dTempL, True) AndAlso dTempL > 0 Then
m_dL = dTempL m_dL = dTempL
Else Else
NotifyPropertyChanged("sL") NotifyPropertyChanged("sL")
@@ -60,7 +60,7 @@ Public Class AddPartWndVM
End Get End Get
Set(value As String) Set(value As String)
Dim dTempW As Double Dim dTempW As Double
If StringToLen(value, dTempW) AndAlso dTempW > 0 Then If StringToLenAdv(value, dTempW, True) AndAlso dTempW > 0 Then
EgtDraw() EgtDraw()
m_dW = dTempW m_dW = dTempW
Else Else
@@ -81,7 +81,7 @@ Public Class AddPartWndVM
End Get End Get
Set(value As String) Set(value As String)
Dim dTempH As Double Dim dTempH As Double
If StringToLen(value, dTempH) AndAlso dTempH > 0 Then If StringToLenAdv(value, dTempH, True) AndAlso dTempH > 0 Then
EgtDraw() EgtDraw()
m_dH = dTempH m_dH = dTempH
Else Else
@@ -106,7 +106,12 @@ Public Class AddRawPartWndVM
If IsNothing(LastMaterial) Then If IsNothing(LastMaterial) Then
SelDimension = m_DimensionsList(0) SelDimension = m_DimensionsList(0)
Else Else
SelDimension = m_DimensionsList.FirstOrDefault(Function(x) x.SectXMat = LastMaterial.SectXMat AndAlso x.dL = LastMaterial.dL AndAlso x.dW = LastMaterial.dW AndAlso x.nQuantity = LastMaterial.nQuantity) Dim TempDimension As SParam = m_DimensionsList.FirstOrDefault(Function(x) x.SectXMat = LastMaterial.SectXMat AndAlso x.dL = LastMaterial.dL AndAlso x.dW = LastMaterial.dW AndAlso x.nQuantity = LastMaterial.nQuantity)
If Not IsNothing(TempDimension) Then
SelDimension = TempDimension
Else
SelDimension = m_DimensionsList(0)
End If
End If End If
End If End If
' riduco lista parametri a solo quelli che utilizzati ' riduco lista parametri a solo quelli che utilizzati
@@ -227,14 +232,14 @@ Public Class Variable
m_sValue = value m_sValue = value
Case VariableType.LENGTH Case VariableType.LENGTH
Dim dTempValue As Double Dim dTempValue As Double
If StringToLen(value, dTempValue) Then If StringToLenAdv(value, dTempValue, True) Then
m_dValue = dTempValue m_dValue = dTempValue
Else Else
NotifyPropertyChanged("sValue") NotifyPropertyChanged("sValue")
End If End If
Case Else ' VariableType.DOUBLE_ Case Else ' VariableType.DOUBLE_
Dim dTempValue As Double Dim dTempValue As Double
If StringToDouble(value, dTempValue) Then If StringToDoubleAdv(value, dTempValue, True) Then
m_dValue = dTempValue m_dValue = dTempValue
Else Else
NotifyPropertyChanged("sValue") NotifyPropertyChanged("sValue")
+53 -45
View File
@@ -1,47 +1,55 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections> </configSections>
<entityFramework> <entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" /> <!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
<providers> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> <providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
</providers> </provider>
</entityFramework> </providers>
<connectionStrings> </entityFramework>
<add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=EgtUser;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient" /> <connectionStrings>
</connectionStrings> <add name="DefaultConnection" connectionString="server=localhost;port=3306;User Id=EgtUser;password=viacremasca;Persist Security Info=True;database=EgtBwDb;SslMode=none" providerName="MySql.Data.MySqlClient" />
<runtime> </connectionStrings>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <runtime>
<dependentAssembly> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" /> <dependentAssembly>
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" /> <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
</dependentAssembly> <bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
<dependentAssembly> </dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <dependentAssembly>
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
</dependentAssembly> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
<dependentAssembly> </dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" /> <dependentAssembly>
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" /> <assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
</dependentAssembly> <bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
<dependentAssembly> </dependentAssembly>
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" /> <dependentAssembly>
<bindingRedirect oldVersion="0.0.0.0-1.2.6.0" newVersion="1.2.6.0" /> <assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
</dependentAssembly> <bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
<dependentAssembly> </dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" /> <dependentAssembly>
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" /> <assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
</dependentAssembly> <bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
</assemblyBinding> </dependentAssembly>
</runtime> <dependentAssembly>
<system.data> <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<DbProviderFactories> <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
<remove invariant="MySql.Data.MySqlClient" /> </dependentAssembly>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </assemblyBinding>
</DbProviderFactories> </runtime>
</system.data> <system.data>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration> <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=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
@@ -25,7 +25,7 @@ Public Class BTLFeatureVM
If value <> -1 Then If value <> -1 Then
' verifico se solido attivo ' verifico se solido attivo
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
' aggiorno la feature con nuovo valore ' aggiorno la feature con nuovo valore
Dim vPar() As Double = Nothing Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty Dim sPar As String = String.Empty
@@ -41,8 +41,8 @@ Public Class BTLFeatureVM
ResetCalcFeature() ResetCalcFeature()
End If End If
NotifyPropertyChanged(NameOf(nSelGRP)) NotifyPropertyChanged(NameOf(nSelGRP))
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
EgtDraw() EgtDraw()
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
End If End If
End Set End Set
End Property End Property
@@ -65,7 +65,7 @@ Public Class BTLFeatureVM
If value <> -1 Then If value <> -1 Then
' verifico se solido attivo ' verifico se solido attivo
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
' se freecontour ' se freecontour
If Me.m_BTLFeatureM.IsFreeContour() Then If Me.m_BTLFeatureM.IsFreeContour() Then
' cambio faccia alla geometria ' cambio faccia alla geometria
@@ -108,12 +108,25 @@ Public Class BTLFeatureVM
ResetCalcFeature() ResetCalcFeature()
End If End If
NotifyPropertyChanged("nSelSIDE") NotifyPropertyChanged("nSelSIDE")
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
EgtDraw() EgtDraw()
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
End If End If
End Set End Set
End Property End Property
Public Property sPriority As String
Get
Return m_BTLFeatureM.nPriority.ToString()
End Get
Set(value As String)
Dim nTemp As Integer = 0
If Integer.TryParse(value, nTemp) Then
m_BTLFeatureM.nPriority = nTemp
EgtSetInfo( nFeatureId, BTL_FTR_PRIORITY, m_BTLFeatureM.nPriority)
End If
NotifyPropertyChanged(NameOf(sPriority))
End Set
End Property
' proprieta' che indica se e' attivo l'update del parametro bDO su piu' feature (attiva/disattiva tutti su pezzo, o per tipo con tasto destro) ' proprieta' che indica se e' attivo l'update del parametro bDO su piu' feature (attiva/disattiva tutti su pezzo, o per tipo con tasto destro)
' necessario per evitare ricalcolo della grafica sulla modifica del parametro per ogni feature ' necessario per evitare ricalcolo della grafica sulla modifica del parametro per ogni feature
Private Shared m_bDO_MultipleUpdate As Boolean = False Private Shared m_bDO_MultipleUpdate As Boolean = False
@@ -135,7 +148,7 @@ Public Class BTLFeatureVM
If value <> m_BTLFeatureM.bDO Then If value <> m_BTLFeatureM.bDO Then
If Map.refMainMenuVM.SelPage = Pages.VIEW Then If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' verifico se solido attivo ' verifico se solido attivo
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
End If End If
If EgtBeamEnableProcess(nFeatureId, value, Not m_bDO_MultipleUpdate) Then If EgtBeamEnableProcess(nFeatureId, value, Not m_bDO_MultipleUpdate) Then
m_BTLFeatureM.bDO = value m_BTLFeatureM.bDO = value
@@ -154,7 +167,7 @@ Public Class BTLFeatureVM
End If End If
If Map.refMainMenuVM.SelPage = Pages.VIEW Then If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' eventualmente ripristino solido ' eventualmente ripristino solido
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
End If End If
If Not m_bDO_MultipleUpdate Then EgtDraw() If Not m_bDO_MultipleUpdate Then EgtDraw()
' aggiorno stato abilitazione del bottone modifica free contour ' aggiorno stato abilitazione del bottone modifica free contour
@@ -372,6 +385,8 @@ Public Class BTLFeatureVM
For Each QPar In QBTLParamVMList For Each QPar In QBTLParamVMList
If QPar.bCustom Then EgtSetInfo(nNewFeatureId, QPar.sName & "A", 1) If QPar.bCustom Then EgtSetInfo(nNewFeatureId, QPar.sName & "A", 1)
Next Next
' Riporto priority
EgtSetInfo(nNewFeatureId, BTL_FTR_PRIORITY, m_BTLFeatureM.nPriority)
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId) Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
' la aggiungo a struttura BTL pezzo di destinazione ' la aggiungo a struttura BTL pezzo di destinazione
DestBTLPart.AddBTLFeature(NewFeat) DestBTLPart.AddBTLFeature(NewFeat)
@@ -121,9 +121,9 @@ Public Class BTLParamVM
' trasformo valori ' trasformo valori
Select Case m_BTLParamM.nType Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_ Case BTLParamType.DOUBLE_
StringToDouble(value, dNewValue) StringToDoubleAdv(value, dNewValue, True)
Case BTLParamType.LENGTH Case BTLParamType.LENGTH
StringToLen(value, dNewValue) StringToLenAdv(value, dNewValue, True)
Case Else Case Else
' per string non faccio nulla ' per string non faccio nulla
End Select End Select
@@ -168,9 +168,9 @@ Public Class BTLParamVM
' trasformo valori ' trasformo valori
Select Case m_BTLParamM.nType Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_ Case BTLParamType.DOUBLE_
StringToDouble(value, dNewValue) StringToDoubleAdv(value, dNewValue, True)
Case BTLParamType.LENGTH Case BTLParamType.LENGTH
StringToLen(value, dNewValue) StringToLenAdv(value, dNewValue, True)
Case Else Case Else
' per string non faccio nulla ' per string non faccio nulla
End Select End Select
@@ -277,7 +277,7 @@ Public Class BTLParamVM
Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True) Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True)
' verifico se solido attivo ' verifico se solido attivo
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
' Recupero i parametri attuali della feature ' Recupero i parametri attuali della feature
Dim vPar() As Double = Nothing Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty Dim sPar As String = String.Empty
@@ -335,7 +335,7 @@ Public Class BTLParamVM
End If End If
End If End If
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
If bDraw Then EgtDraw() If bDraw Then EgtDraw()
End Sub End Sub
@@ -118,7 +118,7 @@ Public Class BTLPartVM
' verifico se solido attivo ' verifico se solido attivo
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
If Not EgtBeamSetPartBox(dBtlL, dBtlH, dBtlW, False) Then Return False If Not EgtBeamSetPartBox(dBtlL, dBtlH, dBtlW, False) Then Return False
@@ -134,7 +134,7 @@ Public Class BTLPartVM
' aggiorno sezioni ' aggiorno sezioni
Map.refProjectVM.BTLStructureVM.UpdateSection(Section, OldSection) Map.refProjectVM.BTLStructureVM.UpdateSection(Section, OldSection)
' eventualmente ripristino solido ' eventualmente ripristino solido
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
EgtDraw() EgtDraw()
Return True Return True
@@ -171,7 +171,7 @@ Public Class BTLPartVM
End Get End Get
Set(value As String) Set(value As String)
Dim dVal As Double Dim dVal As Double
If StringToLen(value, dVal) Then If StringToLenAdv(value, dVal, True) Then
Dim dBtlL = m_BTLPartM.dBtlL Dim dBtlL = m_BTLPartM.dBtlL
Dim dBtlW = m_BTLPartM.dBtlW Dim dBtlW = m_BTLPartM.dBtlW
Dim dBtlH = m_BTLPartM.dBtlH Dim dBtlH = m_BTLPartM.dBtlH
@@ -229,7 +229,7 @@ Public Class BTLPartVM
End Get End Get
Set(value As String) Set(value As String)
Dim dVal As Double Dim dVal As Double
If StringToLen(value, dVal) Then If StringToLenAdv(value, dVal, True) Then
Dim dBtlL = m_BTLPartM.dBtlL Dim dBtlL = m_BTLPartM.dBtlL
Dim dBtlW = m_BTLPartM.dBtlW Dim dBtlW = m_BTLPartM.dBtlW
Dim dBtlH = m_BTLPartM.dBtlH Dim dBtlH = m_BTLPartM.dBtlH
@@ -287,7 +287,7 @@ Public Class BTLPartVM
End Get End Get
Set(value As String) Set(value As String)
Dim dVal As Double Dim dVal As Double
If StringToLen(value, dVal) Then If StringToLenAdv(value, dVal, True) Then
Dim dBtlL = m_BTLPartM.dBtlL Dim dBtlL = m_BTLPartM.dBtlL
Dim dBtlW = m_BTLPartM.dBtlW Dim dBtlW = m_BTLPartM.dBtlW
Dim dBtlH = m_BTLPartM.dBtlH Dim dBtlH = m_BTLPartM.dBtlH
@@ -550,7 +550,7 @@ Public Class BTLPartVM
End Get End Get
Set(value As String) Set(value As String)
Dim dTempPlaningLen As Double Dim dTempPlaningLen As Double
If StringToLen(value, dTempPlaningLen) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PLANINGLENGTH, dTempPlaningLen) Then If StringToLenAdv(value, dTempPlaningLen, True) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PLANINGLENGTH, dTempPlaningLen) Then
m_BTLPartM.dPLANINGLEN = dTempPlaningLen m_BTLPartM.dPLANINGLEN = dTempPlaningLen
Else Else
NotifyPropertyChanged("dPLANINGLEN") NotifyPropertyChanged("dPLANINGLEN")
@@ -564,7 +564,7 @@ Public Class BTLPartVM
End Get End Get
Set(value As String) Set(value As String)
Dim dTempStartOffset As Double Dim dTempStartOffset As Double
If StringToLen(value, dTempStartOffset) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_STARTOFFSET, dTempStartOffset) Then If StringToLenAdv(value, dTempStartOffset, True) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_STARTOFFSET, dTempStartOffset) Then
m_BTLPartM.dSTARTOFFSET = dTempStartOffset m_BTLPartM.dSTARTOFFSET = dTempStartOffset
Else Else
NotifyPropertyChanged("dSTARTOFFSET") NotifyPropertyChanged("dSTARTOFFSET")
@@ -578,7 +578,7 @@ Public Class BTLPartVM
End Get End Get
Set(value As String) Set(value As String)
Dim dTempEndOffset As Double Dim dTempEndOffset As Double
If StringToLen(value, dTempEndOffset) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_ENDOFFSET, dTempEndOffset) Then If StringToLenAdv(value, dTempEndOffset, True) AndAlso EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_ENDOFFSET, dTempEndOffset) Then
m_BTLPartM.dENDOFFSET = dTempEndOffset m_BTLPartM.dENDOFFSET = dTempEndOffset
Else Else
NotifyPropertyChanged("dENDOFFSET") NotifyPropertyChanged("dENDOFFSET")
@@ -625,9 +625,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",") Dim sValArray() As String = value.Split(",")
Dim ptOri As New Point3d Dim ptOri As New Point3d
If sValArray.Count() >= 3 AndAlso If sValArray.Count() >= 3 AndAlso
StringToLen(sValArray(0), ptOri.x) AndAlso StringToLenAdv(sValArray(0), ptOri.x, True) AndAlso
StringToLen(sValArray(1), ptOri.y) AndAlso StringToLenAdv(sValArray(1), ptOri.y, True) AndAlso
StringToLen(sValArray(2), ptOri.z) AndAlso StringToLenAdv(sValArray(2), ptOri.z, True) AndAlso
m_BTLPartM.refTransf.ChangeOrigin(ptOri) Then m_BTLPartM.refTransf.ChangeOrigin(ptOri) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," & EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," & LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
@@ -661,9 +661,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",") Dim sValArray() As String = value.Split(",")
Dim vtVersX As New Vector3d Dim vtVersX As New Vector3d
If sValArray.Count() >= 3 AndAlso If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), vtVersX.x) AndAlso StringToDoubleAdv(sValArray(0), vtVersX.x, True) AndAlso
StringToDouble(sValArray(1), vtVersX.y) AndAlso StringToDoubleAdv(sValArray(1), vtVersX.y, True) AndAlso
StringToDouble(sValArray(2), vtVersX.z) AndAlso StringToDoubleAdv(sValArray(2), vtVersX.z, True) AndAlso
m_BTLPartM.refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then m_BTLPartM.refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," & EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," & LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
@@ -699,9 +699,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",") Dim sValArray() As String = value.Split(",")
Dim vtVersY As New Vector3d Dim vtVersY As New Vector3d
If sValArray.Count() >= 3 AndAlso If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), vtVersY.x) AndAlso StringToDoubleAdv(sValArray(0), vtVersY.x, True) AndAlso
StringToDouble(sValArray(1), vtVersY.y) AndAlso StringToDoubleAdv(sValArray(1), vtVersY.y, True) AndAlso
StringToDouble(sValArray(2), vtVersY.z) AndAlso StringToDoubleAdv(sValArray(2), vtVersY.z, True) AndAlso
m_BTLPartM.refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then m_BTLPartM.refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," & EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," & LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
@@ -733,10 +733,10 @@ Public Class BTLPartVM
Set(value As Integer) Set(value As Integer)
Dim sValArray() As String = CamberParams.Split(",") Dim sValArray() As String = CamberParams.Split(",")
If sValArray.Count() >= 4 AndAlso If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dCamberLen1) AndAlso StringToLenAdv(sValArray(0), m_BTLPartM.m_dCamberLen1, True) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dCamberLen2) AndAlso StringToLenAdv(sValArray(1), m_BTLPartM.m_dCamberLen2, True) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dCamberLen3) AndAlso StringToLenAdv(sValArray(2), m_BTLPartM.m_dCamberLen3, True) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dCamberCross3) AndAlso StringToLenAdv(sValArray(3), m_BTLPartM.m_dCamberCross3, True) AndAlso
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, "SIDE: " & (value + 1) & EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, "SIDE: " & (value + 1) &
" P01: " & sValArray(0) & " P01: " & sValArray(0) &
" P02: " & sValArray(1) & " P02: " & sValArray(1) &
@@ -759,10 +759,10 @@ Public Class BTLPartVM
Set(value As String) Set(value As String)
Dim sValArray() As String = value.Split(",") Dim sValArray() As String = value.Split(",")
If sValArray.Count() >= 4 AndAlso If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dCamberLen1) AndAlso StringToLenAdv(sValArray(0), m_BTLPartM.m_dCamberLen1, True) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dCamberLen2) AndAlso StringToLenAdv(sValArray(1), m_BTLPartM.m_dCamberLen2, True) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dCamberLen3) AndAlso StringToLenAdv(sValArray(2), m_BTLPartM.m_dCamberLen3, True) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dCamberCross3) Then StringToLenAdv(sValArray(3), m_BTLPartM.m_dCamberCross3, True) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, " SIDE: " & (SelCAMBERSIDE + 1) & EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, " SIDE: " & (SelCAMBERSIDE + 1) &
" P01: " & sValArray(0) & " P01: " & sValArray(0) &
" P02: " & sValArray(1) & " P02: " & sValArray(1) &
@@ -790,10 +790,10 @@ Public Class BTLPartVM
Dim sValArray() As String = PartOffsetParams.Split(",") Dim sValArray() As String = PartOffsetParams.Split(",")
If sValArray.Count() >= 4 AndAlso If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dPartOffsetSide1) AndAlso StringToLenAdv(sValArray(0), m_BTLPartM.m_dPartOffsetSide1, True) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dPartOffsetSide2) AndAlso StringToLenAdv(sValArray(1), m_BTLPartM.m_dPartOffsetSide2, True) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dPartOffsetSide3) AndAlso StringToLenAdv(sValArray(2), m_BTLPartM.m_dPartOffsetSide3, True) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dPartOffsetSide4) AndAlso StringToLenAdv(sValArray(3), m_BTLPartM.m_dPartOffsetSide4, True) AndAlso
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue & EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
" P11: " & sValArray(0) & " P11: " & sValArray(0) &
" P12: " & sValArray(1) & " P12: " & sValArray(1) &
@@ -819,10 +819,10 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",") Dim sValArray() As String = value.Split(",")
If sValArray.Count() >= 4 AndAlso If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dPartOffsetSide1) AndAlso StringToLenAdv(sValArray(0), m_BTLPartM.m_dPartOffsetSide1, True) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dPartOffsetSide2) AndAlso StringToLenAdv(sValArray(1), m_BTLPartM.m_dPartOffsetSide2, True) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dPartOffsetSide3) AndAlso StringToLenAdv(sValArray(2), m_BTLPartM.m_dPartOffsetSide3, True) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dPartOffsetSide4) Then StringToLenAdv(sValArray(3), m_BTLPartM.m_dPartOffsetSide4, True) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue & EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
" P11: " & sValArray(0) & " P11: " & sValArray(0) &
" P12: " & sValArray(1) & " P12: " & sValArray(1) &
@@ -973,9 +973,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",") Dim sValArray() As String = value.Split(",")
Dim dX, dY, dZ As Double Dim dX, dY, dZ As Double
If sValArray.Count() >= 3 AndAlso If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), dX) AndAlso StringToDoubleAdv(sValArray(0), dX, True) AndAlso
StringToDouble(sValArray(1), dY) AndAlso StringToDoubleAdv(sValArray(1), dY, True) AndAlso
StringToDouble(sValArray(2), dZ) Then StringToDoubleAdv(sValArray(2), dZ, True) Then
m_BTLPartM.refGrainDir = New Vector3d(dX, dY, dZ) m_BTLPartM.refGrainDir = New Vector3d(dX, dY, dZ)
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," & EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
sValArray(1) & "," & sValArray(1) & "," &
@@ -994,9 +994,9 @@ Public Class BTLPartVM
Set(value As Boolean) Set(value As Boolean)
Dim sValArray() As String = GrainDirection.Split(",") Dim sValArray() As String = GrainDirection.Split(",")
If sValArray.Count() >= 3 AndAlso If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), m_BTLPartM.refGrainDir.x) AndAlso StringToDoubleAdv(sValArray(0), m_BTLPartM.refGrainDir.x, True) AndAlso
StringToDouble(sValArray(1), m_BTLPartM.refGrainDir.y) AndAlso StringToDoubleAdv(sValArray(1), m_BTLPartM.refGrainDir.y, True) AndAlso
StringToDouble(sValArray(2), m_BTLPartM.refGrainDir.z) AndAlso StringToDoubleAdv(sValArray(2), m_BTLPartM.refGrainDir.z, True) AndAlso
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," & EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
sValArray(1) & "," & sValArray(1) & "," &
sValArray(2) & ";" & sValArray(2) & ";" &
@@ -1530,6 +1530,7 @@ Public Class BTLPartVM
m_SelBTLFeatureVM.RefreshFCMBtnVisibility() m_SelBTLFeatureVM.RefreshFCMBtnVisibility()
' aggiorno stato abilitazione del bottone modifica free contour ' aggiorno stato abilitazione del bottone modifica free contour
Map.refFeatureManagerVM.SetEditIsEnabled() Map.refFeatureManagerVM.SetEditIsEnabled()
Map.refFeatureManagerVM.NotifyPropertyChanged(NameOf(Map.refFeatureManagerVM.Priority_Visibility))
Else Else
EgtDeselectAll() EgtDeselectAll()
End If End If
@@ -243,7 +243,7 @@ Public Class BTLStructureVM
If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
' tolgo eventuale indicazione solido rimasta da pezzo precedente ' tolgo eventuale indicazione solido rimasta da pezzo precedente
Map.refShowBeamPanelVM.SetShowSolid(False) Map.refShowBeamPanelVM.SetShowSolid(False)
Map.refProjectVM.BTLStructureVM.ShowSolid(False, BtlPart.nPartId) Map.refProjectVM.BTLStructureVM.ShowSolid(BtlPart.nPartId, False, False)
End If End If
If m_SelBTLPart Is BtlPart Then If m_SelBTLPart Is BtlPart Then
EgtBeamShowFacesName( False) EgtBeamShowFacesName( False)
@@ -1083,7 +1083,7 @@ Public Class BTLStructureVM
If Not IsNothing(SelBTLPart) Then If Not IsNothing(SelBTLPart) Then
' se pezzo solido, lo riporto normale ' se pezzo solido, lo riporto normale
If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
ShowSolid(False) ShowSolid(GDB_ID.NULL, False, False)
Map.refShowBeamPanelVM.SetShowSolid(False) Map.refShowBeamPanelVM.SetShowSolid(False)
End If End If
' tolgo pezzo selezionato ' tolgo pezzo selezionato
@@ -1132,12 +1132,12 @@ Public Class BTLStructureVM
EgtZoom(ZM.ALL, bRedraw) EgtZoom(ZM.ALL, bRedraw)
End Sub End Sub
Friend Sub ShowSolid(Optional bRedraw As Boolean = True, Optional nPartId As Integer = GDB_ID.NULL) Friend Sub ShowSolid(nPartId As Integer, bShow As Boolean, Optional bRedraw As Boolean = True)
' se non viene passato, recupero il pezzo del primo oggetto selezionato ' se non viene passato, recupero il pezzo del primo oggetto selezionato
If nPartId = GDB_ID.NULL Then If nPartId = GDB_ID.NULL And Not IsNothing(SelBTLPart) Then
nPartId = If(Not IsNothing(SelBTLPart), SelBTLPart.nPartId, GDB_ID.NULL) nPartId = SelBTLPart.nPartId
End If End If
If nPartId = GDB_ID.NULL Or Not EgtIsPart(nPartId) Then If Not EgtIsPart(nPartId) Then
Dim nLayerId As Integer = EgtGetParent(nPartId) Dim nLayerId As Integer = EgtGetParent(nPartId)
Dim sLayerName As String = "" Dim sLayerName As String = ""
EgtGetName(nLayerId, sLayerName) EgtGetName(nLayerId, sLayerName)
@@ -1151,17 +1151,11 @@ Public Class BTLStructureVM
' disabilito impostazione modificato ' disabilito impostazione modificato
Dim DisableMgr As New DisableModifiedMgr Dim DisableMgr As New DisableModifiedMgr
Dim nSolId As Integer = EgtBeamGetSolid(nPartId) If bShow Then EgtBeamCalcSolid(nPartId)
If nSolId = GDB_ID.NULL OrElse Not EgtExistsInfo(nSolId, "VALID") Then
EgtBeamCalcSolid(nPartId)
EgtBeamShowSolid(nPartId, True)
Else
Dim nStat As Integer
EgtGetStatus(EgtGetParent(nSolId), nStat)
EgtBeamShowSolid(nPartId, (nStat = GDB_ST.OFF))
End If
EgtBeamShowSolid(nPartId, bShow)
If bRedraw Then EgtDraw() If bRedraw Then EgtDraw()
' ripristino precedente impostazione modificato ' ripristino precedente impostazione modificato
DisableMgr.ReEnable() DisableMgr.ReEnable()
End Sub End Sub
@@ -280,8 +280,8 @@ Public Class CALCPanelVM
End Sub End Sub
Private Shared Sub ProcessResults(Bar As Bar) Private Shared Sub ProcessResults(Bar As Bar)
If IsNothing(Bar) Then Return
ProcessResults(Bar.sBarPath, Bar.nProgramPage, Bar.nBarId) ProcessResults(Bar.sBarPath, Bar.nProgramPage, Bar.nBarId)
End Sub End Sub
Private Shared Sub ProcessResults(BtlPath As String, nProgramPage As ProjectType, nBarId As Integer) Private Shared Sub ProcessResults(BtlPath As String, nProgramPage As ProjectType, nBarId As Integer)
@@ -312,7 +312,7 @@ Public Class CALCPanelVM
If line.StartsWith("ERR=") Then If line.StartsWith("ERR=") Then
Dim nVal As Integer? = GetVal(line, "ERR") Dim nVal As Integer? = GetVal(line, "ERR")
nErr = (If(nVal IsNot Nothing, nVal.Value, 0)) nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
sMsg = "" sMsg = ""
dRot = 0 dRot = 0
nFall = 0 nFall = 0
@@ -320,24 +320,24 @@ Public Class CALCPanelVM
taskId = 0 taskId = 0
ElseIf line.StartsWith("ROT=") Then ElseIf line.StartsWith("ROT=") Then
Dim nVal As Integer? = GetVal(line, "ROT") Dim nVal As Integer? = GetVal(line, "ROT")
Dim nRot As Integer = (If(nVal IsNot Nothing, nVal.Value, 0)) Dim nRot As Integer = (If(Not IsNothing(nVal), nVal.Value, 0))
dRot = Math.Abs(((4 - nRot) Mod 4) * 90) dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
dPartRot = Math.Max(dPartRot, dRot) dPartRot = Math.Max(dPartRot, dRot)
dTotRot = Math.Max(dTotRot, dRot) dTotRot = Math.Max(dTotRot, dRot)
ElseIf line.StartsWith("CUTID=") Then ElseIf line.StartsWith("CUTID=") Then
Dim nVal As Integer? = GetVal(line, "CUTID") Dim nVal As Integer? = GetVal(line, "CUTID")
cutId = If(nVal IsNot Nothing, nVal.Value, 0) cutId = If(Not IsNothing(nVal), nVal.Value, 0)
ElseIf line.StartsWith("TASKID=") Then ElseIf line.StartsWith("TASKID=") Then
Dim nVal As Integer? = GetVal(line, "TASKID") Dim nVal As Integer? = GetVal(line, "TASKID")
taskId = (If(nVal IsNot Nothing, nVal.Value, 0)) taskId = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), nProgramPage) ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), nProgramPage)
ElseIf line.StartsWith("FALL=") Then ElseIf line.StartsWith("FALL=") Then
Dim nVal As Integer? = GetVal(line, "FALL") Dim nVal As Integer? = GetVal(line, "FALL")
nFall = (If(nVal IsNot Nothing, nVal.Value, 0)) nFall = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall)) ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
ElseIf line.StartsWith("TIME=") Then ElseIf line.StartsWith("TIME=") Then
Dim nVal As Integer? = GetVal(line, "TIME") Dim nVal As Integer? = GetVal(line, "TIME")
nTotTime = (If(nVal IsNot Nothing, nVal.Value, 0)) nTotTime = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime)) ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then 'If Bar.nBarType = ProjectType.PROJ AndAlso Not IsNothing(currBTLPart) Then
' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True) ' EgtSetInfo(currBTLPart.nPartId, If(Bar.nBarType = ProjectType.PROJ, ITG_PROJ_TIME, ITG_PROD_TIME), nTotTime, True)
@@ -35,7 +35,7 @@ Public Class ChangeParameterWndVM
ParamIndex += 1 ParamIndex += 1
End While End While
' aggiungo bDO come parametro ' aggiungo bDO come parametro
m_ParamList.Add(New Parameters(NewBTLParam, True)) m_ParamList.Add(New Parameters(BTLParamM.CreateNewBTLParam(), True))
' seleziono parametro vuoto per dargli un valore iniziale ed evitare che visualizzi sia text che check ' seleziono parametro vuoto per dargli un valore iniziale ed evitare che visualizzi sia text che check
m_SelParam = New Parameters(BTLParamM.CreateNewBTLParam()) m_SelParam = New Parameters(BTLParamM.CreateNewBTLParam())
NotifyPropertyChanged(NameOf(SelParam)) NotifyPropertyChanged(NameOf(SelParam))
@@ -142,9 +142,9 @@ Public Class Parameters
Set(value As String) Set(value As String)
Select Case m_BTLParamM.nType Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_ Case BTLParamType.DOUBLE_
StringToDouble(value, m_dActualValue) StringToDoubleAdv(value, m_dActualValue, True)
Case BTLParamType.LENGTH Case BTLParamType.LENGTH
StringToLen(value, m_dActualValue) StringToLenAdv(value, m_dActualValue, True)
Case Else ' BTLParamType.STRING_ Case Else ' BTLParamType.STRING_
m_sActualValue = value m_sActualValue = value
End Select End Select
@@ -172,9 +172,9 @@ Public Class Parameters
Set(value As String) Set(value As String)
Select Case m_BTLParamM.nType Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_ Case BTLParamType.DOUBLE_
StringToDouble(value, m_dNewValue) StringToDoubleAdv(value, m_dNewValue, True)
Case BTLParamType.LENGTH Case BTLParamType.LENGTH
StringToLen(value, m_dNewValue) StringToLenAdv(value, m_dNewValue, True)
Case Else ' BTLParamType.STRING_ Case Else ' BTLParamType.STRING_
m_sNewValue = value m_sNewValue = value
End Select End Select
@@ -5,225 +5,232 @@
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"> xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/> <ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="6*"/> <RowDefinition Height="6*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"> <TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
<TabItem Header="General"> SelectedIndex="{Binding SelConfigSubPage}">
<TabItem.Content> <TabItem Header="General">
<Grid> <TabItem.Content>
<Grid.ColumnDefinitions> <Grid>
<ColumnDefinition Width="1*"/> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> <ColumnDefinition Width="1*"/>
<Grid.RowDefinitions> </Grid.ColumnDefinitions>
<RowDefinition Height="1*"/> <Grid.RowDefinitions>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
</Grid.RowDefinitions> <RowDefinition Height="1*"/>
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0"> </Grid.RowDefinitions>
<GroupBox Header="{Binding CurrentLanguage_Msg}" <StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
<GroupBox Header="{Binding CurrentLanguage_Msg}"
Margin="0,0,0,5"> Margin="0,0,0,5">
<UniformGrid Rows="2" Margin="3,3,3,3"> <UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25" <ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
Margin="0,0,0,5"/> Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap" <TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
TextAlignment="Center"/> TextAlignment="Center"/>
</UniformGrid> </UniformGrid>
</GroupBox> </GroupBox>
<UniformGrid Columns="2" <UniformGrid Columns="2"
Margin="0,0,0,5"> Margin="0,0,0,5">
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/> <TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}" <ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
SelectedIndex="{Binding SelMeasureUnit}" Height="25" SelectedIndex="{Binding SelMeasureUnit}" Height="25"
Margin="0,5,0,0"/> Margin="0,5,0,0"/>
</UniformGrid> </UniformGrid>
<GroupBox Header="{Binding Nesting_Msg}" <GroupBox Header="{Binding Nesting_Msg}"
Margin="0,0,0,5"> Margin="0,0,0,5">
<StackPanel> <StackPanel>
<UniformGrid Columns="2" <UniformGrid Columns="2"
Margin="0,0,0,5"> Margin="0,0,0,5">
<TextBlock Text="{Binding SectionTime_Msg}" <TextBlock Text="{Binding SectionTime_Msg}"
Grid.Row="0" Grid.Column="0"/> Grid.Row="0" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SectionTime, UpdateSourceTrigger=Explicit}" <EgtWPFLib5:EgtTextBox Text="{Binding SectionTime, UpdateSourceTrigger=Explicit}"
Grid.Row="0" Grid.Column="1"/> Grid.Row="0" Grid.Column="1"/>
</UniformGrid> </UniformGrid>
<UniformGrid Columns="2" <UniformGrid Columns="2"
Margin="0,0,0,5"> Margin="0,0,0,5">
<TextBlock Text="{Binding PartTime_Msg}" <TextBlock Text="{Binding PartTime_Msg}"
Grid.Row="1" Grid.Column="0"/> Grid.Row="1" Grid.Column="0"/>
<EgtWPFLib5:EgtTextBox Text="{Binding PartTime, UpdateSourceTrigger=Explicit}" <EgtWPFLib5:EgtTextBox Text="{Binding PartTime, UpdateSourceTrigger=Explicit}"
Grid.Row="1" Grid.Column="1"/> Grid.Row="1" Grid.Column="1"/>
</UniformGrid> </UniformGrid>
</StackPanel>
</GroupBox>
</StackPanel> </StackPanel>
</Grid> </GroupBox>
</TabItem.Content> <UniformGrid Columns="2"
</TabItem> Margin="0,0,0,5">
<TabItem Header="Parametri Q"> <TextBlock Text="{Binding PrintLabel_Msg}" VerticalAlignment="Center"/>
<TabItem.Content> <CheckBox IsChecked="{Binding bPrintLabel_IsChecked}"
<Grid> Margin="0,5,0,0"/>
<Grid.ColumnDefinitions> </UniformGrid>
<ColumnDefinition Width="2*"/> </StackPanel>
<ColumnDefinition Width="1*"/> </Grid>
</Grid.ColumnDefinitions> </TabItem.Content>
<Grid.RowDefinitions> </TabItem>
<RowDefinition Height="1*"/> <TabItem Header="Parametri Q">
</Grid.RowDefinitions> <TabItem.Content>
<EgtBEAMWALL:QParamListV DataContext="{Binding}" <Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
ItemsSource="{Binding QBTLParamVMList}" ItemsSource="{Binding QBTLParamVMList}"
SelectedItem="{Binding SelQParam}" SelectedItem="{Binding SelQParam}"
Grid.Column="0" Grid.Column="0"
Margin="5"> Margin="5">
<DataGrid.GroupStyle> <DataGrid.GroupStyle>
<GroupStyle> <GroupStyle>
<GroupStyle.Panel> <GroupStyle.Panel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<DataGridRowsPresenter/> <DataGridRowsPresenter/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</GroupStyle.Panel> </GroupStyle.Panel>
<GroupStyle.HeaderTemplate> <GroupStyle.HeaderTemplate>
<DataTemplate> <DataTemplate>
<StackPanel> <StackPanel>
<TextBlock Text="{Binding Path=Name}"/> <TextBlock Text="{Binding Path=Name}"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</GroupStyle.HeaderTemplate> </GroupStyle.HeaderTemplate>
<GroupStyle.ContainerStyle> <GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}"> <Style TargetType="{x:Type GroupItem}">
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}"> <ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True"> <Expander IsExpanded="True">
<Expander.Background> <Expander.Background>
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush> <SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
</Expander.Background> </Expander.Background>
<Expander.Header> <Expander.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" /> <TextBlock Text="{Binding Path=Name}" />
</StackPanel> </StackPanel>
</Expander.Header> </Expander.Header>
<ItemsPresenter /> <ItemsPresenter />
</Expander> </Expander>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
</GroupStyle.ContainerStyle> </GroupStyle.ContainerStyle>
</GroupStyle> </GroupStyle>
<GroupStyle> <GroupStyle>
<GroupStyle.ContainerStyle> <GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}"> <Style TargetType="{x:Type GroupItem}">
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}"> <ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True"> <Expander IsExpanded="True">
<Expander.Background> <Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush> <SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background> </Expander.Background>
<Expander.Header> <Expander.Header>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" /> <TextBlock Text="{Binding Path=Name}" />
</StackPanel> </StackPanel>
</Expander.Header> </Expander.Header>
<ItemsPresenter /> <ItemsPresenter />
</Expander> </Expander>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
</GroupStyle.ContainerStyle> </GroupStyle.ContainerStyle>
</GroupStyle> </GroupStyle>
</DataGrid.GroupStyle> </DataGrid.GroupStyle>
</EgtBEAMWALL:QParamListV> </EgtBEAMWALL:QParamListV>
</Grid> </Grid>
</TabItem.Content> </TabItem.Content>
</TabItem> </TabItem>
<TabItem Header="Macchina"> <TabItem Header="Macchina">
<TabItem.Content> <TabItem.Content>
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/> <RowDefinition Height="10*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal"> <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5"> <GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/> <EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
</GroupBox> </GroupBox>
</StackPanel> </StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal"> <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
<ItemsControl ItemsSource="{Binding ConfigMachTableList}"> <ItemsControl ItemsSource="{Binding ConfigMachTableList}">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/> <StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto"> <GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0"> <ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
<ItemsControl.ItemsPanel> <ItemsControl.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/> <WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ItemsControl.ItemsPanel> </ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid Margin="0,0,5,5"> <Grid Margin="0,0,5,5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}" <TextBlock Text="{Binding sName}"
TextWrapping="WrapWithOverflow" TextWrapping="WrapWithOverflow"
Width="100" Width="100"
Style="{StaticResource MachParamTextBlock}"/> Style="{StaticResource MachParamTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}" <EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
Grid.Column="1" Grid.Column="1"
Width="70"/> Width="70"/>
<TextBlock Text="{Binding sDescription}" <TextBlock Text="{Binding sDescription}"
TextWrapping="WrapWithOverflow" TextWrapping="WrapWithOverflow"
Width="200" Width="200"
Style="{StaticResource MachParamTextBlock}" Style="{StaticResource MachParamTextBlock}"
Grid.Column="2"/> Grid.Column="2"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</GroupBox> </GroupBox>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</StackPanel> </StackPanel>
</Grid> </Grid>
</TabItem.Content> </TabItem.Content>
</TabItem> </TabItem>
</TabControl> </TabControl>
<Button Command="{Binding SaveCommand}" <Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}" ToolTip="{Binding SaveToolTip}"
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Style="{StaticResource OptionPanel_Button}"> Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/> <Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button> </Button>
</Grid> </Grid>
</DockPanel> </DockPanel>
@@ -7,6 +7,32 @@ Imports EgtBEAMWALL.Core
Public Class ConfigurationPageVM Public Class ConfigurationPageVM
Inherits VMBase Inherits VMBase
Public Enum ConfigSubPages As Integer
GENERAL = 0
QPARAMETERS = 1
MACHINE = 2
End Enum
Private m_QParametersModified As Boolean = False
Friend ReadOnly Property QParametersModified As Boolean
Get
Return m_QParametersModified
End Get
End Property
Friend Sub ResetQParametersModified()
m_QParametersModified = False
End Sub
Private m_SelConfigSubPage As ConfigSubPages = ConfigSubPages.GENERAL
Public Property SelConfigSubPage As Integer
Get
Return m_SelConfigSubPage
End Get
Set(value As Integer)
m_SelConfigSubPage = value
End Set
End Property
' flag modifica parametri Macchina ' flag modifica parametri Macchina
Friend bModifyMachParam As Boolean Friend bModifyMachParam As Boolean
@@ -105,7 +131,7 @@ Public Class ConfigurationPageVM
End Get End Get
Set(value As String) Set(value As String)
Dim dVal As Double = 0 Dim dVal As Double = 0
If StringToDouble(value, dVal) AndAlso dVal > 0 Then If StringToDoubleAdv(value, dVal, True) AndAlso dVal > 0 Then
m_SectionTime = dVal m_SectionTime = dVal
End If End If
End Set End Set
@@ -118,12 +144,22 @@ Public Class ConfigurationPageVM
End Get End Get
Set(value As String) Set(value As String)
Dim dVal As Double = 0 Dim dVal As Double = 0
If StringToDouble(value, dVal) AndAlso dVal > 0 Then If StringToDoubleAdv(value, dVal, True) AndAlso dVal > 0 Then
m_PartTime = dVal m_PartTime = dVal
End If End If
End Set End Set
End Property End Property
Private m_bPrintLabel_IsChecked As Boolean
Public Property bPrintLabel_IsChecked As String
Get
Return m_bPrintLabel_IsChecked
End Get
Set(value As String)
m_bPrintLabel_IsChecked = value
End Set
End Property
#Region "Messages" #Region "Messages"
Public ReadOnly Property L_Msg As String Public ReadOnly Property L_Msg As String
@@ -251,6 +287,12 @@ Public Class ConfigurationPageVM
End Get End Get
End Property End Property
Public ReadOnly Property PrintLabel_Msg As String
Get
Return EgtMsg(61894)
End Get
End Property
#End Region ' Messages #End Region ' Messages
#Region "Constructor" #Region "Constructor"
@@ -285,6 +327,7 @@ Public Class ConfigurationPageVM
' leggo SectionTime e PartTime ' leggo SectionTime e PartTime
GetMainPrivateProfileString(S_NEST, K_SECTIONTIME, "", SectionTime) GetMainPrivateProfileString(S_NEST, K_SECTIONTIME, "", SectionTime)
GetMainPrivateProfileString(S_NEST, K_PARTTIME, "", PartTime) GetMainPrivateProfileString(S_NEST, K_PARTTIME, "", PartTime)
m_bPrintLabel_IsChecked = ( GetMainPrivateProfileInt(S_PRINTER, K_ENABLE, 0) <> 0)
' assegno le liste dei parametri della macchina corrente alla ConfigMachTableList alla pagina di Configurazione ' assegno le liste dei parametri della macchina corrente alla ConfigMachTableList alla pagina di Configurazione
ConfigMachTableList = CurrentMachine.MachTableList ConfigMachTableList = CurrentMachine.MachTableList
' carico i parametri Q dei Process letti dall'ini ' carico i parametri Q dei Process letti dall'ini
@@ -325,13 +368,7 @@ Public Class ConfigurationPageVM
''' Execute the Save. This method is invoked by the SaveCommand. ''' Execute the Save. This method is invoked by the SaveCommand.
''' </summary> ''' </summary>
Public Sub Save() Public Sub Save()
WriteMachParams() VerifyConfigPageModification()
WriteMachParamsLua()
WriteProcessParams(PRCList.ToList())
WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
WriteMainPrivateProfileString(S_NEST, K_SECTIONTIME, DoubleToString(m_SectionTime, 5))
WriteMainPrivateProfileString(S_NEST, K_PARTTIME, DoubleToString(m_PartTime, 5))
End Sub End Sub
#End Region ' SaveCommand #End Region ' SaveCommand
@@ -415,58 +452,69 @@ Public Class ConfigurationPageVM
' funzione che verifica la modifica dei valori in Configurazione e ne chiede il salvataggio ' funzione che verifica la modifica dei valori in Configurazione e ne chiede il salvataggio
Friend Sub VerifyConfigPageModification() Friend Sub VerifyConfigPageModification()
' Prima ciclo sui parametri Macchina
Dim bExitFor = False Dim bExitFor = False
For Each MachTableItem In ConfigMachTableList Select Case m_SelConfigSubPage
For Each MachParamItem In MachTableItem.MachParamList Case ConfigSubPages.GENERAL
If MachParamItem.IsModified Then ' aggiorno tutti i valori senza verificare modifiche
If MessageBox.Show(EgtMsg(61860), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
' scrivo i parametri Macchina WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
WriteMachParams() WriteMainPrivateProfileString(S_NEST, K_SECTIONTIME, DoubleToString(m_SectionTime, 5))
WriteMachParamsLua() WriteMainPrivateProfileString(S_NEST, K_PARTTIME, DoubleToString(m_PartTime, 5))
Else WriteMainPrivateProfileString(S_PRINTER, K_ENABLE, If(m_bPrintLabel_IsChecked, 1, 0))
' se da non salvare li resetto ed esco dai For Case ConfigSubPages.QPARAMETERS
CreateMachParams() ' ciclo sui parametri Q
bExitFor = True Dim bAskToSaveDefaultValues As Boolean = False
Exit For For Each PRCItem In PRCList
End If For Each QParam In PRCItem.QBTLParamVMList
End If If QParam.bIsModified Then
Next bAskToSaveDefaultValues = True
If bExitFor Then Exit For ' esco dai For
Next bExitFor = True
' Ora ciclo sui parametri Q Exit For
Dim bAskToSaveDefaultValues As Boolean = False End If
bExitFor = False Next
For Each PRCItem In PRCList If bExitFor Then Exit For
For Each QParam In PRCItem.QBTLParamVMList
If QParam.bIsModified Then
bAskToSaveDefaultValues = True
' esco dai For
bExitFor = True
Exit For
End If
Next
If bExitFor Then Exit For
Next
' se nel ciclo è stato trovato almeno un valore modificato chiedo il salvataggio
If bAskToSaveDefaultValues Then
If MessageBox.Show(EgtMsg(61861), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
' se si è scelto di salvare i valori li scrivo
WriteProcessParams(PRCList.ToList())
End If
' in ogni caso ricarico i valori (in modo da resettare i flag di modifica)
GetQParamsList()
' carico la lista di tutti i parametri Q ciclando su ogni Process di PRCList
If Not IsNothing(QBTLParamVMList) Then
QBTLParamVMList.Clear()
End If
For Each PRCItem In PRCList
For Each QBTLParam In PRCItem.QBTLParamVMList
QBTLParamVMList.Add(QBTLParam)
Next Next
Next ' se nel ciclo è stato trovato almeno un valore modificato chiedo il salvataggio
NotifyPropertyChanged(NameOf(QBTLParamVMList)) If bAskToSaveDefaultValues Then
End If If MessageBox.Show(EgtMsg(61861), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
' se si è scelto di salvare i valori li scrivo
WriteProcessParams(PRCList.ToList())
m_QParametersModified = True
End If
' in ogni caso ricarico i valori (in modo da resettare i flag di modifica)
GetQParamsList()
' carico la lista di tutti i parametri Q ciclando su ogni Process di PRCList
If Not IsNothing(QBTLParamVMList) Then
QBTLParamVMList.Clear()
End If
For Each PRCItem In PRCList
For Each QBTLParam In PRCItem.QBTLParamVMList
QBTLParamVMList.Add(QBTLParam)
Next
Next
NotifyPropertyChanged(NameOf(QBTLParamVMList))
End If
Case ConfigSubPages.MACHINE
' ciclo sui parametri Macchina
For Each MachTableItem In ConfigMachTableList
For Each MachParamItem In MachTableItem.MachParamList
If MachParamItem.IsModified Then
If MessageBox.Show(EgtMsg(61860), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
' scrivo i parametri Macchina
WriteMachParams()
WriteMachParamsLua()
Else
' se da non salvare li resetto ed esco dai For
CreateMachParams()
bExitFor = True
Exit For
End If
End If
Next
If bExitFor Then Exit For
Next
End Select
End Sub End Sub
' funzione che verifica l'inserimento della password quando si edita un parametro Macchina ' funzione che verifica l'inserimento della password quando si edita un parametro Macchina
@@ -638,11 +686,11 @@ Public Class MachParam
' trasformo valori ' trasformo valori
Select Case nType Select Case nType
Case MachParamType.DOUBLE_ Case MachParamType.DOUBLE_
StringToDouble(value, dNewValue) StringToDoubleAdv(value, dNewValue, True)
StringToDouble(sOrigValue, dOrigValue) StringToDoubleAdv(sOrigValue, dOrigValue, True)
Case MachParamType.LENGTH Case MachParamType.LENGTH
StringToLen(value, dNewValue) StringToLenAdv(value, dNewValue, True)
StringToLen(sOrigValue, dOrigValue) StringToLenAdv(sOrigValue, dOrigValue, True)
Case Else Case Else
' per string non faccio nulla ' per string non faccio nulla
End Select End Select
@@ -105,9 +105,41 @@
<PropertyGroup> <PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\RemoteDebug\</OutputPath>
<DocumentationFile>EgtBEAMWALL.ViewerOptimizer.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x64'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x64\RemoteDebug\</OutputPath>
<DocumentationFile>EgtBEAMWALL.ViewerOptimizer.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'RemoteDebug|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x86\RemoteDebug\</OutputPath>
<DocumentationFile>EgtBEAMWALL.ViewerOptimizer.xml</DocumentationFile>
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942"> <Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath> <HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference> </Reference>
<Reference Include="EgtUILib, Version=2.4.3.1, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="EgtUILib, Version=2.4.3.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@@ -123,20 +155,20 @@
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath> <HintPath>..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference> </Reference>
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL"> <Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath> <HintPath>..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath>
</Reference> </Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL"> <Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath> <HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
</Reference> </Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL"> <Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath> <HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference> </Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL"> <Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath> <HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="MigraDoc.DocumentObjectModel-wpf, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL"> <Reference Include="MigraDoc.DocumentObjectModel-wpf, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
@@ -177,18 +209,24 @@
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" /> <Reference Include="System.Drawing.Design" />
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Management" /> <Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath> <HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Numerics" /> <Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath> <HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Security" /> <Reference Include="System.Security" />
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" /> <Reference Include="System.Transactions" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
@@ -955,6 +993,9 @@
<ItemGroup> <ItemGroup>
<Resource Include="Resources\TopPanel\RemoveAllRawPart.png" /> <Resource Include="Resources\TopPanel\RemoveAllRawPart.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Resources\ProjectManager\AddProj.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe <PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe
@@ -20,6 +20,16 @@
SelectedItem="{Binding Tag.nSelGRP, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}" SelectedItem="{Binding Tag.nSelGRP, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
IsEnabled="{Binding FeatureManager_IsEnabled}" IsEnabled="{Binding FeatureManager_IsEnabled}"
Style="{StaticResource FeatureComboBox}"/> Style="{StaticResource FeatureComboBox}"/>
<TextBlock Text="{Binding Priority_Msg}"
IsEnabled="{Binding FeatureManager_IsEnabled}"
Visibility="{Binding Priority_Visibility}"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding Tag.sPriority,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}},
UpdateSourceTrigger=Explicit}"
IsEnabled="{Binding FeatureManager_IsEnabled}"
Visibility="{Binding Priority_Visibility}"
Width="45"/>
<TextBlock Text="{Binding Tag.sName, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}" <TextBlock Text="{Binding Tag.sName, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureManagerV}}}"
Style="{StaticResource OptionTextBlock}"/> Style="{StaticResource OptionTextBlock}"/>
<Button Content="{Binding Edit_Msg}" <Button Content="{Binding Edit_Msg}"
@@ -27,6 +27,12 @@ Public Class FeatureManagerVM
End Get End Get
End Property End Property
Public ReadOnly Property Priority_Visibility As Visibility
Get
Return if(CurrentMachine.nType = Core.ConstBeam.MachineType.WALL, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
#Region "Messages" #Region "Messages"
Public ReadOnly Property Face_Msg As String Public ReadOnly Property Face_Msg As String
@@ -41,6 +47,12 @@ Public Class FeatureManagerVM
End Get End Get
End Property End Property
Public ReadOnly Property Priority_Msg As String
Get
Return EgtMsg(61895)
End Get
End Property
Public ReadOnly Property Edit_Msg As String Public ReadOnly Property Edit_Msg As String
Get Get
Return EgtMsg(61826) Return EgtMsg(61826)
@@ -271,12 +271,12 @@ Public Class FreeContourManagerVM
Private m_cmdDelete As ICommand Private m_cmdDelete As ICommand
Private m_cmdModifyCurve As ICommand Private m_cmdModifyCurve As ICommand
Private m_cmdAddPointCurve As ICommand Private m_cmdAddPointCurve As ICommand
Private m_cmdRemovePointCurve As ICommand
Private m_cmdArcflip As ICommand Private m_cmdArcflip As ICommand
Private m_cmdMove As ICommand Private m_cmdMove As ICommand
Private m_cmdRotate As ICommand Private m_cmdRotate As ICommand
Private m_cmdMirror As ICommand Private m_cmdMirror As ICommand
Private m_cmdScale As ICommand Private m_cmdScale As ICommand
Private m_cmdRemovePointCurve As ICommand
Private m_cmdChangeStart As ICommand Private m_cmdChangeStart As ICommand
Private m_cmdInvertCurve As ICommand Private m_cmdInvertCurve As ICommand
Private m_cmdTextAngle As ICommand Private m_cmdTextAngle As ICommand
@@ -324,7 +324,7 @@ Public Class FreeContourManagerVM
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility)) Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
' verifico se solido attivo ' verifico se solido attivo
m_bPrevShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked m_bPrevShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If m_bPrevShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If m_bPrevShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
' attivo visualizzazione direzione curve ' attivo visualizzazione direzione curve
EgtSetShowCurveDirection(True) EgtSetShowCurveDirection(True)
' elimino eventuale vecchio layer testi ' elimino eventuale vecchio layer testi
@@ -367,7 +367,7 @@ Public Class FreeContourManagerVM
m_SelType = FreeContourTypes.TWO m_SelType = FreeContourTypes.TWO
End If End If
End If End If
' se nuova senza percorsi ' se nuova senza percorsi
Else Else
' imposto modalita' un percorso ' imposto modalita' un percorso
m_SelType = FreeContourTypes.ONE m_SelType = FreeContourTypes.ONE
@@ -424,10 +424,12 @@ Public Class FreeContourManagerVM
NotifyPropertyChanged(NameOf(Line2P_IsEnabled)) NotifyPropertyChanged(NameOf(Line2P_IsEnabled))
NotifyPropertyChanged(NameOf(TextAngle_Visibility)) NotifyPropertyChanged(NameOf(TextAngle_Visibility))
NotifyPropertyChanged(NameOf(PathList_Visibility)) NotifyPropertyChanged(NameOf(PathList_Visibility))
' posiziono la griglia sulla faccia attiva ' posiziono la griglia sul riferimento del contorno libero
Dim frFace As New Frame3d Dim frFace As New Frame3d
EgtBeamGetSideData(SelFeature.nSelSIDE, frFace) EgtBeamGetSideData(SelFeature.nSelSIDE, frFace)
EgtSetGridFrame(frFace) Dim frFrame As Frame3d = SelFeature.BTLFeatureM.frFRAME
frFrame.ToGlob( frFace)
EgtSetGridFrame(frFrame)
EgtSetGridShow(True, True) EgtSetGridShow(True, True)
Map.refSceneHostVM.MainScene.CPlaneView() Map.refSceneHostVM.MainScene.CPlaneView()
' rimetto la selezione scena a null ' rimetto la selezione scena a null
@@ -442,11 +444,8 @@ Public Class FreeContourManagerVM
End Sub End Sub
Friend Sub Close(bSave As Boolean) Friend Sub Close(bSave As Boolean)
If m_bIsActive Then If not m_bIsActive Then Return
m_bIsActive = False m_bIsActive = False
Else
Return
End If
' gestisco modifiche ai percorsi ' gestisco modifiche ai percorsi
If bSave Then If bSave Then
Select Case m_SelType Select Case m_SelType
@@ -459,7 +458,8 @@ Public Class FreeContourManagerVM
Dim sSideAngInfo As String = "" Dim sSideAngInfo As String = ""
For Index = 0 To SideAngValues.Count - 1 For Index = 0 To SideAngValues.Count - 1
If Index > 0 Then sSideAngInfo &= "," If Index > 0 Then sSideAngInfo &= ","
sSideAngInfo &= SideAngValues(Index).dValue Dim sAng As String = DoubleToString(SideAngValues(Index).dValue, 2)
sSideAngInfo &= sAng
Next Next
EgtSetInfo(m_nNewPathId, "SideAngs", sSideAngInfo) EgtSetInfo(m_nNewPathId, "SideAngs", sSideAngInfo)
EgtSetInfo(nSelFeatureId, "AUXID", (m_nNewPathId - nSelFeatureId).ToString("+#;-#;0")) EgtSetInfo(nSelFeatureId, "AUXID", (m_nNewPathId - nSelFeatureId).ToString("+#;-#;0"))
@@ -474,7 +474,7 @@ Public Class FreeContourManagerVM
Dim BTLFeatureM As BTLFeatureM = SelFeature.BTLFeatureM Dim BTLFeatureM As BTLFeatureM = SelFeature.BTLFeatureM
BTLFeatureM.CalcParamArray(vPar, sPar, vParQ) BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
Dim bOK As Boolean = BTLFeatureM.UpdateParams(BTLFeatureM.nSelGRP, BTLFeatureM.nPRC, BTLFeatureM.nSelSIDE, BTLFeatureM.sDES, BTLFeatureM.nPRID, Dim bOK As Boolean = BTLFeatureM.UpdateParams(BTLFeatureM.nSelGRP, BTLFeatureM.nPRC, BTLFeatureM.nSelSIDE, BTLFeatureM.sDES, BTLFeatureM.nPRID,
BTLFeatureM.frFRAME, vPar, sPar, vParQ) BTLFeatureM.frFRAME, vPar, sPar, vParQ)
If bOK Then If bOK Then
SelFeature.SelGeomFeature() SelFeature.SelGeomFeature()
' rendo non calcolata questa feature ' rendo non calcolata questa feature
@@ -519,7 +519,8 @@ Public Class FreeContourManagerVM
' elimino eventuale layer dei testi angoli ' elimino eventuale layer dei testi angoli
EgtErase(nSideAngTextLayer) EgtErase(nSideAngTextLayer)
nSideAngTextLayer = GDB_ID.NULL nSideAngTextLayer = GDB_ID.NULL
' nascondo la griglia ' riporto griglia globale e la nascondo
EgtSetGridFrame( New Frame3d())
EgtSetGridShow(False, False) EgtSetGridShow(False, False)
' se il progetto non era modificato ed esco senza salvare, resetto lo stato di modificato ' se il progetto non era modificato ed esco senza salvare, resetto lo stato di modificato
If Not m_bAlreadyModified And Not bSave Then If Not m_bAlreadyModified And Not bSave Then
@@ -539,7 +540,7 @@ Public Class FreeContourManagerVM
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility)) Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
' disattivo modifiche su scena ' disattivo modifiche su scena
Map.refSceneHostVM.MainScene.SetStatusNull() Map.refSceneHostVM.MainScene.SetStatusNull()
If m_bPrevShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If m_bPrevShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
' disattivo visualizzazione direzione curve ' disattivo visualizzazione direzione curve
EgtSetShowCurveDirection(False) EgtSetShowCurveDirection(False)
' reimposto filtro selezione ' reimposto filtro selezione
@@ -649,9 +650,10 @@ Public Class FreeContourManagerVM
EgtAtParamPoint(m_nNewPathId, Index + 0.5, ptText) EgtAtParamPoint(m_nNewPathId, Index + 0.5, ptText)
Dim dSideAng As Double = 0 Dim dSideAng As Double = 0
If sSideAngSplit.Count - 1 >= Index Then If sSideAngSplit.Count - 1 >= Index Then
StringToDouble(sSideAngSplit(Index), dSideAng) StringToDoubleAdv(sSideAngSplit(Index), dSideAng, True)
End If End If
Dim TextId As Integer = EgtCreateText(nSideAngTextLayer, ptText, dSideAng & "°", 20) Dim sSideAng As String = DoubleToString( dSideAng, 2) & "°"
Dim TextId As Integer = EgtCreateText(nSideAngTextLayer, ptText, sSideAng, 20)
EgtSetInfo(TextId, "SideAng", dSideAng) EgtSetInfo(TextId, "SideAng", dSideAng)
SideAngValues.Add(New SideAngle(TextId, Index, dSideAng)) SideAngValues.Add(New SideAngle(TextId, Index, dSideAng))
Next Next
@@ -744,7 +746,7 @@ Public Class FreeContourManagerVM
End If End If
ElseIf bChangedStart Then ElseIf bChangedStart Then
' non faccio nulla perche' gestito sopra ' non faccio nulla perche' gestito sopra
' se apro percorso ' se apro percorso
ElseIf Not bNewIsClosed AndAlso bOldIsClosed AndAlso Index = NewAngleList.Count Then ElseIf Not bNewIsClosed AndAlso bOldIsClosed AndAlso Index = NewAngleList.Count Then
' cancello il testo del lato rimosso ' cancello il testo del lato rimosso
nMovedIndex = OldAngleList.FindIndex(Function(x) AreSamePointApprox(x, NewAngleList(CurrIndex - 1))) nMovedIndex = OldAngleList.FindIndex(Function(x) AreSamePointApprox(x, NewAngleList(CurrIndex - 1)))
@@ -752,7 +754,7 @@ Public Class FreeContourManagerVM
Dim NewIndex As Integer = (nPointsQty + nOffset) Mod nPointsQty Dim NewIndex As Integer = (nPointsQty + nOffset) Mod nPointsQty
EgtErase(SideAngValues(nOffset).nId) EgtErase(SideAngValues(nOffset).nId)
NewSideAngValues.RemoveAt(NewSideAngValues.Count - 1) NewSideAngValues.RemoveAt(NewSideAngValues.Count - 1)
' se chiudo percorso ' se chiudo percorso
ElseIf bNewIsClosed AndAlso Not bOldIsClosed AndAlso Index = OldAngleList.Count Then ElseIf bNewIsClosed AndAlso Not bOldIsClosed AndAlso Index = OldAngleList.Count Then
' creo il testo del lato aggiunto ' creo il testo del lato aggiunto
Dim ptText As Point3d Dim ptText As Point3d
@@ -761,20 +763,21 @@ Public Class FreeContourManagerVM
' aggiungo punto e incremento indice di confronto per riallineare successivo ' aggiungo punto e incremento indice di confronto per riallineare successivo
NewSideAngValues.Add(New SideAngle(TextId, NewSideAngValues.Count - 1, 0)) NewSideAngValues.Add(New SideAngle(TextId, NewSideAngValues.Count - 1, 0))
'' percorso aperto '' percorso aperto
' punti coincidono: verifico che i punti coincidano e non siano il centro del percorso simmetrico ' punti coincidono: verifico che i punti coincidano e non siano il centro del percorso simmetrico
ElseIf Not bNewIsClosed AndAlso nNewIndex <= NewAngleList.Count - 1 AndAlso nOldIndex <= OldAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso ElseIf Not bNewIsClosed AndAlso nNewIndex <= NewAngleList.Count - 1 AndAlso nOldIndex <= OldAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso
Not (Index = nPointsQty / 2 AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1))) Then Not (Index = nPointsQty / 2 AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1))) Then
If Index < nPointsQty AndAlso nOldIndex <= SideAngValues.Count - 1 Then If Index < nPointsQty AndAlso nOldIndex <= SideAngValues.Count - 1 Then
NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue)) NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue))
End If End If
' punti simmetrici: verifico se sono simmetrici o se coincidono ma i precedenti sono simmetrici ' punti simmetrici: verifico se sono simmetrici o se coincidono ma i precedenti sono simmetrici
ElseIf Not bNewIsClosed AndAlso Not bOldIsClosed AndAlso NewAngleList.Count = OldAngleList.Count AndAlso (AreSamePointApprox(NewAngleList(Index), OldAngleList(nPointsQty - Index)) OrElse ElseIf Not bNewIsClosed AndAlso Not bOldIsClosed AndAlso NewAngleList.Count = OldAngleList.Count AndAlso (AreSamePointApprox(NewAngleList(Index), OldAngleList(nPointsQty - Index)) OrElse
(AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1)))) Then (AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1)))) Then
If Index < nPointsQty Then If Index < nPointsQty Then
EgtModifyText(SideAngValues(Index).nId, SideAngValues(nPointsQty - 1 - Index).dValue) Dim sText As String = DoubleToString( SideAngValues(nPointsQty - 1 - Index).dValue, 2)
EgtModifyText(SideAngValues(Index).nId, sText)
NewSideAngValues.Add(New SideAngle(SideAngValues(nPointsQty - 1 - Index).nId, NewSideAngValues.Count, SideAngValues(nPointsQty - 1 - Index).dValue)) NewSideAngValues.Add(New SideAngle(SideAngValues(nPointsQty - 1 - Index).nId, NewSideAngValues.Count, SideAngValues(nPointsQty - 1 - Index).dValue))
End If End If
' punto spostato: verifico che non coincidano ma che i precedenti o i successivi coincidano ' punto spostato: verifico che non coincidano ma che i precedenti o i successivi coincidano
ElseIf Not bNewIsClosed AndAlso ElseIf Not bNewIsClosed AndAlso
((Index = nPointsQty AndAlso Index <= OldAngleList.Count - 1 AndAlso Not AreSamePointApprox(NewAngleList(Index), OldAngleList(Index)) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(Index - 1))) OrElse ((Index = nPointsQty AndAlso Index <= OldAngleList.Count - 1 AndAlso Not AreSamePointApprox(NewAngleList(Index), OldAngleList(Index)) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(Index - 1))) OrElse
(nOldIndex + 1 <= OldAngleList.Count - 1 AndAlso nNewIndex + 1 <= NewAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex + 1), OldAngleList(nOldIndex + 1)))) Then (nOldIndex + 1 <= OldAngleList.Count - 1 AndAlso nNewIndex + 1 <= NewAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex + 1), OldAngleList(nOldIndex + 1)))) Then
@@ -797,20 +800,20 @@ Public Class FreeContourManagerVM
NewSideAngValues.Add(New SideAngle(SideAngValues(Index).nId, NewSideAngValues.Count, SideAngValues(Index).dValue)) NewSideAngValues.Add(New SideAngle(SideAngValues(Index).nId, NewSideAngValues.Count, SideAngValues(Index).dValue))
End If End If
'' percorso chiuso '' percorso chiuso
' punti coincidono: verifico che i punti coincidano e non siano inizio, fine o centro del percorso simmetrico ' punti coincidono: verifico che i punti coincidano e non siano inizio, fine o centro del percorso simmetrico
ElseIf bNewIsClosed AndAlso nNewIndex <= NewAngleList.Count - 1 AndAlso nOldIndex <= OldAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso ElseIf bNewIsClosed AndAlso nNewIndex <= NewAngleList.Count - 1 AndAlso nOldIndex <= OldAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso
Not ((Index = 0 AndAlso AreSamePointApprox(NewAngleList(Index + 1), OldAngleList(nPointsQty - 1))) OrElse Not ((Index = 0 AndAlso AreSamePointApprox(NewAngleList(Index + 1), OldAngleList(nPointsQty - 1))) OrElse
((Index = nPointsQty / 2 OrElse Index = nPointsQty) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1)))) Then ((Index = nPointsQty / 2 OrElse Index = nPointsQty) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1)))) Then
If Index < nPointsQty AndAlso nOldIndex < SideAngValues.Count Then If Index < nPointsQty AndAlso nOldIndex < SideAngValues.Count Then
NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue)) NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue))
End If End If
' punti simmetrici: verifico se sono simmetrici o se coincidono ma i precedenti sono simmetrici ' punti simmetrici: verifico se sono simmetrici o se coincidono ma i precedenti sono simmetrici
ElseIf bNewIsClosed AndAlso bOldIsClosed AndAlso (AreSamePointApprox(NewAngleList(Index), OldAngleList(nPointsQty - Index)) OrElse ElseIf bNewIsClosed AndAlso bOldIsClosed AndAlso (AreSamePointApprox(NewAngleList(Index), OldAngleList(nPointsQty - Index)) OrElse
(AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1)))) Then (AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1)))) Then
If Index < nPointsQty Then If Index < nPointsQty Then
NewSideAngValues.Add(New SideAngle(SideAngValues(nPointsQty - 1 - Index).nId, NewSideAngValues.Count, SideAngValues(nPointsQty - 1 - Index).dValue)) NewSideAngValues.Add(New SideAngle(SideAngValues(nPointsQty - 1 - Index).nId, NewSideAngValues.Count, SideAngValues(nPointsQty - 1 - Index).dValue))
End If End If
' punto spostato: verifico che non coincidano ma che i precedenti o i successivi coincidano ' punto spostato: verifico che non coincidano ma che i precedenti o i successivi coincidano
ElseIf (nOldIndex + 1 <= OldAngleList.Count - 1 AndAlso nNewIndex + 1 <= NewAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex + 1), OldAngleList(nOldIndex + 1))) OrElse ElseIf (nOldIndex + 1 <= OldAngleList.Count - 1 AndAlso nNewIndex + 1 <= NewAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex + 1), OldAngleList(nOldIndex + 1))) OrElse
(bNewIsClosed AndAlso nOldIndex + 1 = OldAngleList.Count AndAlso nNewIndex + 1 = NewAngleList.Count AndAlso AreSamePointApprox(NewAngleList(1), OldAngleList(1))) Then (bNewIsClosed AndAlso nOldIndex + 1 = OldAngleList.Count AndAlso nNewIndex + 1 = NewAngleList.Count AndAlso AreSamePointApprox(NewAngleList(1), OldAngleList(1))) Then
' aggiorno posizione testo precedente ' aggiorno posizione testo precedente
@@ -831,7 +834,7 @@ Public Class FreeContourManagerVM
EgtMove(SideAngValues(nOldIndex).nId, vtDistance) EgtMove(SideAngValues(nOldIndex).nId, vtDistance)
NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue)) NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue))
End If End If
' punto aggiunto: Verifico che il punto successivo coincida con il vecchio corrente o che sia stato aggiunto in fondo ' punto aggiunto: Verifico che il punto successivo coincida con il vecchio corrente o che sia stato aggiunto in fondo
ElseIf (nNewIndex + 1 <= NewAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex + 1), OldAngleList(nOldIndex))) OrElse ElseIf (nNewIndex + 1 <= NewAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex + 1), OldAngleList(nOldIndex))) OrElse
(nOldIndex = OldAngleList.Count AndAlso OldAngleList.Count < NewAngleList.Count) Then (nOldIndex = OldAngleList.Count AndAlso OldAngleList.Count < NewAngleList.Count) Then
' se non e' percorso aperto e primo punto ' se non e' percorso aperto e primo punto
@@ -853,7 +856,7 @@ Public Class FreeContourManagerVM
' aggiungo punto e incremento indice di confronto per riallineare successivo ' aggiungo punto e incremento indice di confronto per riallineare successivo
NewSideAngValues.Insert(TextIndex, New SideAngle(TextId, TextIndex, 0)) NewSideAngValues.Insert(TextIndex, New SideAngle(TextId, TextIndex, 0))
nOldIndex -= 1 nOldIndex -= 1
' punto tolto: verifico che il punto coincida con il vecchio successivo o che sia stato tolto in fondo ' punto tolto: verifico che il punto coincida con il vecchio successivo o che sia stato tolto in fondo
ElseIf (nOldIndex + 1 <= OldAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex + 1))) OrElse ElseIf (nOldIndex + 1 <= OldAngleList.Count - 1 AndAlso AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex + 1))) OrElse
(nNewIndex = NewAngleList.Count AndAlso OldAngleList.Count > NewAngleList.Count) Then (nNewIndex = NewAngleList.Count AndAlso OldAngleList.Count > NewAngleList.Count) Then
' non aggiungo nulla, ma cancello testo ' non aggiungo nulla, ma cancello testo
@@ -866,7 +869,7 @@ Public Class FreeContourManagerVM
EgtAtParamPoint(m_nNewPathId, If(Index = 0, NewAngleList.Count, Index) - 0.5, ptNew) EgtAtParamPoint(m_nNewPathId, If(Index = 0, NewAngleList.Count, Index) - 0.5, ptNew)
Dim vtDistance As Vector3d = ptNew - ptOld Dim vtDistance As Vector3d = ptNew - ptOld
EgtMove(SideAngValues(If(Index = 0, OldAngleList.Count, Index) - 1).nId, vtDistance) EgtMove(SideAngValues(If(Index = 0, OldAngleList.Count, Index) - 1).nId, vtDistance)
' spostato o ruotato intero percorso ' spostato o ruotato intero percorso
Else Else
' aggiorno posizione testo successivo ' aggiorno posizione testo successivo
Dim ptOld As Point3d Dim ptOld As Point3d
@@ -895,9 +898,10 @@ Public Class FreeContourManagerVM
If bResult Then If bResult Then
' scrivo info con nuova inclinazione ' scrivo info con nuova inclinazione
Dim dAng As Double Dim dAng As Double
StringToDouble(Map.refFreeContourInputVM.Text, dAng) StringToDoubleAdv(Map.refFreeContourInputVM.Text, dAng, True)
EgtSetInfo(m_nSelTextId, "SideAng", dAng) EgtSetInfo(m_nSelTextId, "SideAng", dAng)
EgtModifyText(m_nSelTextId, dAng & "°") Dim sAng As String = DoubleToString( dAng, 2) & "°"
EgtModifyText(m_nSelTextId, sAng)
Dim SideAngValue As SideAngle = SideAngValues.First(Function(x) x.nId = m_nSelTextId) Dim SideAngValue As SideAngle = SideAngValues.First(Function(x) x.nId = m_nSelTextId)
SideAngValue.dValue = dAng SideAngValue.dValue = dAng
End If End If
@@ -944,8 +948,9 @@ Public Class FreeContourManagerVM
Map.refFreeContourInputVM.PrepareInputBox(EgtMsg(62007), EgtMsg(62008), "", False, False) Map.refFreeContourInputVM.PrepareInputBox(EgtMsg(62007), EgtMsg(62008), "", False, False)
Dim dSideAng As Double = 0 Dim dSideAng As Double = 0
EgtGetInfo(nId, "SideAng", dSideAng) EgtGetInfo(nId, "SideAng", dSideAng)
Map.refFreeContourInputVM.SetInputBoxText(dSideAng) Dim sSideAng As String = DoubleToString( dSideAng, 2)
' se sto aprendo percorso chiuso Map.refFreeContourInputVM.SetInputBoxText(sSideAng)
' se sto aprendo percorso chiuso
ElseIf Map.refFreeContourManagerVM.bIsOpeningCurveCompo Then ElseIf Map.refFreeContourManagerVM.bIsOpeningCurveCompo Then
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.OPENCOMPO) Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.OPENCOMPO)
m_bIsOpeningCurveCompo = False m_bIsOpeningCurveCompo = False
@@ -982,13 +987,21 @@ Public Class FreeContourManagerVM
''' Execute the Line2P. This method is invoked by the Line2PCommand. ''' Execute the Line2P. This method is invoked by the Line2PCommand.
''' </summary> ''' </summary>
Public Sub Line2P(ByVal param As Object) Public Sub Line2P(ByVal param As Object)
Dim nNewPathLayerId As Integer = EgtCreateGroup(nSelPartId) ' cancello eventuale gruppo precedente
Dim nNewPathLayerId As Integer = EgtGetFirstNameInGroup(nSelPartId, "NewPathLayer")
If nNewPathLayerId <> GDB_ID.NULL Then
EgtEmptyGroup(nNewPathLayerId)
Else
nNewPathLayerId = EgtCreateGroup(nSelPartId)
End If
EgtSetName(nNewPathLayerId, "NewPathLayer") EgtSetName(nNewPathLayerId, "NewPathLayer")
EgtSetCurrPartLayer(nSelPartId, nNewPathLayerId) EgtSetCurrPartLayer(nSelPartId, nNewPathLayerId)
InitCommand(True) InitCommand(False)
Map.refSceneHostVM.MainController.SetContinue() Map.refSceneHostVM.MainController.SetContinue()
If Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.LINE2P) Then If Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.LINE2P) Then
m_bIsCreatingPath = True m_bIsCreatingPath = True
Else
EgtErase(nNewPathLayerId)
End If End If
End Sub End Sub
@@ -213,49 +213,17 @@ Public Class MyInstrumentPanelVM
For Each Param In ParamList.Where(Function(x) x.sName = ChangeParameterWndVM.SelParam.sName) For Each Param In ParamList.Where(Function(x) x.sName = ChangeParameterWndVM.SelParam.sName)
Select Case Param.nType Select Case Param.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
If Param.dValue = ChangeParameterWndVM.SelParam.dActualValue Then If Math.Abs( Param.dValue - ChangeParameterWndVM.SelParam.dActualValue) < EPS_SMALL Then
Param.UpdateParamValue(ChangeParameterWndVM.SelParam.dNewValue, "") Param.UpdateParamValue(ChangeParameterWndVM.SelParam.dNewValue, "")
'' rinfresco valori parametri feature correntemente selezionata
'If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso
' Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) AndAlso
' Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM Is Feature Then
' Param.NotifyPropertyChanged("sValue")
'End If
End If End If
Case BTLParamType.STRING_ Case BTLParamType.STRING_
If Param.sValue = ChangeParameterWndVM.SelParam.sActualValue Then If Param.sValue = ChangeParameterWndVM.SelParam.sActualValue Then
Param.UpdateParamValue(0, ChangeParameterWndVM.SelParam.sNewValue) Param.UpdateParamValue(0, ChangeParameterWndVM.SelParam.sNewValue)
'' rinfresco valori parametri feature correntemente selezionata
'If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso
' Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) AndAlso
' Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.nPRC = ChangeParameterWndVM.SelPRC.nPRC AndAlso
' Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.nSelGRP = ChangeParameterWndVM.SelPRC.nGRP Then
' Param.NotifyPropertyChanged("sValue")
'End If
End If End If
End Select End Select
Next Next
End If End If
Next Next
'' faccio passare feature
'For Each Feature In Part.FeatureList
' If Feature.nPRC = ChangeParameterWndVM.SelPRC.nPRC Then
' For Each Param In Feature.PParamList
' If Param.sName = ChangeParameterWndVM.SelParam.sName Then
' Select Case Param.nType
' Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
' If Param.dValue = ChangeParameterWndVM.SelParam.dActualValue Then
' Param.dValue = ChangeParameterWndVM.SelParam.dValue
' End If
' Case BTLParamType.STRING_
' If Param.sValue = ChangeParameterWndVM.SelParam.sActualValue Then
' Param.sValue = ChangeParameterWndVM.SelParam.sValue
' End If
' End Select
' End If
' Next
' End If
'Next
Next Next
End If End If
LoadingWndHelper.CloseLoadingWnd(ActiveIds.CHANGEPARAM) LoadingWndHelper.CloseLoadingWnd(ActiveIds.CHANGEPARAM)
@@ -83,10 +83,16 @@
<!--Descrizione--> <!--Descrizione-->
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDesc}"> <DataGridTextColumn x:Key="colDESC" Binding="{Binding sDesc}">
<DataGridTextColumn.Header> <DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/> <TextBlock Text="{Binding Path=DataContext.Description_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGridTextColumn.Header> </DataGridTextColumn.Header>
</DataGridTextColumn> </DataGridTextColumn>
</DataGrid.Resources> <!--Descrizione-->
<DataGridTextColumn x:Key="colPRIORITY" Binding="{Binding sPriority}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Priority_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:FeatureInPartInRawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Resources>
</EgtBEAMWALLCORE:EgtDataGrid> </EgtBEAMWALLCORE:EgtDataGrid>
<!--<TextBlock Grid.Row="1" <!--<TextBlock Grid.Row="1"
@@ -11,6 +11,13 @@ Public Class FeatureInPartInRawPartListVM
End Get End Get
End Property End Property
Private m_colFeatureInPartInRawPart_Priority As EgtDataGridColumn
Public ReadOnly Property colFeatureInPartInRawPart_Priority As EgtDataGridColumn
Get
Return m_colFeatureInPartInRawPart_Priority
End Get
End Property
Private m_FeatureInPartInRawPartColumns As New ObservableCollection(Of EgtDataGridColumn) Private m_FeatureInPartInRawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property FeatureInPartInRawPartColumns As ObservableCollection(Of EgtDataGridColumn) Public Property FeatureInPartInRawPartColumns As ObservableCollection(Of EgtDataGridColumn)
Get Get
@@ -35,6 +42,12 @@ Public Class FeatureInPartInRawPartListVM
End Get End Get
End Property End Property
Public ReadOnly Property Priority_Msg As String
Get
Return EgtMsg(61895)
End Get
End Property
#End Region ' Messages #End Region ' Messages
Sub New() Sub New()
@@ -44,6 +57,13 @@ Public Class FeatureInPartInRawPartListVM
GetPrivateProfileColumns(S_FEATUREINPARTINRAWPARTLIST, FeatureInPartInRawPartColumns) GetPrivateProfileColumns(S_FEATUREINPARTINRAWPARTLIST, FeatureInPartInRawPartColumns)
' recupero riferimento a colonna Do ' recupero riferimento a colonna Do
m_colFeatureInPartInRawPart_Do = FeatureInPartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DO) m_colFeatureInPartInRawPart_Do = FeatureInPartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_DO)
m_colFeatureInPartInRawPart_Priority = FeatureInPartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_PRIORITY)
End Sub
Friend Sub UpdateColumns(nMachType As MachineType)
If Not IsNothing(m_colFeatureInPartInRawPart_Priority) Then
m_colFeatureInPartInRawPart_Priority.Visible = (nMachType=MachineType.WALL)
End If
End Sub End Sub
End Class End Class
@@ -280,7 +280,7 @@ Public Class LeftPanelVM
Public Sub NewRawPart(bLast As Boolean) Public Sub NewRawPart(bLast As Boolean)
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart 'Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList() Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
If IsNothing(SelParts) OrElse SelParts.Count <= 0 Then Return If IsNothing(SelParts) OrElse SelParts.Count <= 0 Then Return
' verifico che abbiano tutti la stessa sezione ' verifico che abbiano tutti la stessa sezione
@@ -366,6 +366,11 @@ Public Class LeftPanelVM
End If End If
Else Else
If SParamlist.Count = 0 Then If SParamlist.Count = 0 Then
' se pareti aumento dimensioni del kerf
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
dRawW += (2 * dKerf)
dRawL += (2 * dKerf)
End If
' apro finestra con solo edit ' apro finestra con solo edit
If AddRawPartWnd(AddRawPartWndVM.EditTypes.ONLY_TEXT, SParamlist, dRawW, dRawL, dStartOffset, dOffset, dKerf) Then If AddRawPartWnd(AddRawPartWndVM.EditTypes.ONLY_TEXT, SParamlist, dRawW, dRawL, dStartOffset, dOffset, dKerf) Then
WarehouseHelper.SetOffset(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dOffset) WarehouseHelper.SetOffset(Map.refProjectVM.BTLStructureVM.nPROJTYPE, dOffset)
@@ -431,7 +436,7 @@ Public Class LeftPanelVM
Next Next
' scrivo dati costruzione grezzo in gruppo di lavorazione ' scrivo dati costruzione grezzo in gruppo di lavorazione
EgtSetInfo(nCurrMachGroup, MGR_RPT_BARLEN, dRawL) EgtSetInfo(nCurrMachGroup, MGR_RPT_BARLEN, dRawL)
EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, SelPart.sMATERIAL) EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, SelParts(0).sMATERIAL)
' scrivo dati di tutti i pezzi ' scrivo dati di tutti i pezzi
Dim dPosX As Double = WarehouseHelper.GetStartOffset() Dim dPosX As Double = WarehouseHelper.GetStartOffset()
' ciclo sui pezzi ' ciclo sui pezzi
@@ -482,13 +487,13 @@ Public Class LeftPanelVM
BeamMachGroup.UpdateUsage() BeamMachGroup.UpdateUsage()
Core.ViewPanelVM.BWSetView(VT.ISO_SW, False) Core.ViewPanelVM.BWSetView(VT.ISO_SW, False)
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
Dim nPartDuploId As Integer = EgtDuploNew(SelPart.nPartId) Dim nPartDuploId As Integer = EgtDuploNew(SelParts(0).nPartId)
' scrivo dati in gruppo di lavorazione ' scrivo dati in gruppo di lavorazione
Dim dPosX As Double = dKerf Dim dPosX As Double = dKerf
Dim dPosY As Double = dKerf Dim dPosY As Double = dKerf
EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELLEN, dRawL) EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELLEN, dRawL)
EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELWIDTH, dRawW) EgtSetInfo(nCurrMachGroup, MGR_RPT_PANELWIDTH, dRawW)
EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, SelPart.sMATERIAL) EgtSetInfo(nCurrMachGroup, MGR_RPT_MATERIAL, SelParts(0).sMATERIAL)
EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & 1, EgtSetInfo(nCurrMachGroup, MGR_RPT_PART & 1,
nPartDuploId & "," & DoubleToString(dPosX, 3) & "," & DoubleToString(dPosY, 3) & ",0,0") nPartDuploId & "," & DoubleToString(dPosX, 3) & "," & DoubleToString(dPosY, 3) & ",0,0")
Dim WallMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(Map.refMachGroupPanelVM.MachGroupVMList.Count - 1) Dim WallMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(Map.refMachGroupPanelVM.MachGroupVMList.Count - 1)
@@ -514,10 +519,10 @@ Public Class LeftPanelVM
' scrivo dati pezzo ' scrivo dati pezzo
EgtSetInfo(nPartDuploId, MGR_PRT_POSX, dPosX) EgtSetInfo(nPartDuploId, MGR_PRT_POSX, dPosX)
EgtSetInfo(nPartDuploId, MGR_PRT_POSY, dPosY) EgtSetInfo(nPartDuploId, MGR_PRT_POSY, dPosY)
EgtSetInfo(nPartDuploId, MGR_PRT_ROT, SelPart.nROTATED) EgtSetInfo(nPartDuploId, MGR_PRT_ROT, SelParts(0).nROTATED)
EgtSetInfo(nPartDuploId, MGR_PRT_FLIP, SelPart.nINVERTED) EgtSetInfo(nPartDuploId, MGR_PRT_FLIP, SelParts(0).nINVERTED)
' aggiorno contatore pezzi usati in Prod ' aggiorno contatore pezzi usati in Prod
SelPart.RefreshPartInProd() SelParts(0).RefreshPartInProd()
' aggiorno lista pezzi ' aggiorno lista pezzi
WallMachGroup.MyMachGroupM.RefreshPartList() WallMachGroup.MyMachGroupM.RefreshPartList()
WallMachGroup.MyMachGroupM.RefreshGroupData() WallMachGroup.MyMachGroupM.RefreshGroupData()
@@ -547,7 +552,7 @@ Public Class LeftPanelVM
dOffset = AddRawPartWndVM.VariableList(3).dValue dOffset = AddRawPartWndVM.VariableList(3).dValue
End Select End Select
' verifico se il materiale esiste in magazzino o devo aggiungerlo ' verifico se il materiale esiste in magazzino o devo aggiungerlo
Dim CurrSParam As SParam Dim CurrSParam As SParam = Nothing
Select Case EditType Select Case EditType
Case AddRawPartWndVM.EditTypes.ONLY_TEXT Case AddRawPartWndVM.EditTypes.ONLY_TEXT
' lo aggiungo a lista materiali in magazzino ' lo aggiungo a lista materiali in magazzino
@@ -580,25 +585,21 @@ Public Class LeftPanelVM
Dim sL As String = String.Empty Dim sL As String = String.Empty
sL = LenToString(CurrSParam.dL, 3) sL = LenToString(CurrSParam.dL, 3)
' ricavo l'indice del SecionXMaterial dalla Beam_List ' ricavo l'indice del SecionXMaterial dalla Beam_List
Dim SectXMatIndex As Integer = 1 Dim SectXMatIndex As Integer = GetSectIndexFromSection(MachineType.BEAM, CurrSParam.SectXMat)
Dim sSxMValue As String = ""
While EgtUILib.GetPrivateProfileString(S_BEAM_LIST, SectXMatIndex, String.Empty, sSxMValue, sWarehousePath)
If sSxMValue = CurrSParam.sValue Then
' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo
Exit While
End If
SectXMatIndex += 1
End While
' ricavo nuovo indice materiale ' ricavo nuovo indice materiale
Dim ParamIndex As Integer = 1 Dim ParamIndex As Integer = 1
Dim sParam As String = "" Dim sParam As String = ""
While GetPrivateProfileString(S_BEAM, K_L & ParamIndex, "", sParam, sWarehousePath) > 0 While GetPrivateProfileString(S_BEAM, K_L & ParamIndex, "", sParam, sWarehousePath) > 0
ParamIndex += 1 ParamIndex += 1
End While End While
' lo aggiungo in warehouse If SectXMatIndex > 0 Then
WritePrivateProfileString(S_BEAM, K_L & ParamIndex, ' lo aggiungo in warehouse
WritePrivateProfileString(S_BEAM, K_L & ParamIndex,
SectXMatIndex & "," & sL & "," & CurrSParam.nQuantity & "," & If(CurrSParam.bActive, 1, 0), SectXMatIndex & "," & sL & "," & CurrSParam.nQuantity & "," & If(CurrSParam.bActive, 1, 0),
sWarehousePath) sWarehousePath)
Else
EgtOutLog("Error in material creation, section not found!")
End If
Return CurrSParam Return CurrSParam
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
' creo sParam ' creo sParam
@@ -620,7 +621,7 @@ Public Class LeftPanelVM
' ricavo nuovo indice materiale ' ricavo nuovo indice materiale
Dim ParamIndex As Integer = 1 Dim ParamIndex As Integer = 1
Dim sParam As String = "" Dim sParam As String = ""
While GetPrivateProfileString(S_WALL, K_S & ParamIndex, "", sParam, sWarehousePath) = 0 While GetPrivateProfileString(S_WALL, K_S & ParamIndex, "", sParam, sWarehousePath) > 0
ParamIndex += 1 ParamIndex += 1
End While End While
' lo aggiungo in warehouse ' lo aggiungo in warehouse
@@ -629,6 +630,8 @@ Public Class LeftPanelVM
sWarehousePath) sWarehousePath)
Return CurrSParam Return CurrSParam
End If End If
Return Nothing
End Function End Function
Private Function VerifyPartCount(SelParts As List(Of BTLPartVM)) As Boolean Private Function VerifyPartCount(SelParts As List(Of BTLPartVM)) As Boolean
@@ -843,6 +846,8 @@ Public Class LeftPanelVM
dPosX += WarehouseHelper.GetOffset(BeamMachGroup.nType) dPosX += WarehouseHelper.GetOffset(BeamMachGroup.nType)
' lo aggiungo in fondo ' lo aggiungo in fondo
EgtSetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + nPartIndex + 1, nPartDuploIdList(nPartIndex) & "," & DoubleToString(dPosX, 3)) EgtSetInfo(BeamMachGroup.Id, MGR_RPT_PART & nIndex + nPartIndex + 1, nPartDuploIdList(nPartIndex) & "," & DoubleToString(dPosX, 3))
' incremento posizione della sua lunghezza
dPosX += PartsToAdd(nPartIndex).dL
' conservo indice d'inserimento ' conservo indice d'inserimento
nInsertIndex = nIndex nInsertIndex = nIndex
nPartIndex += 1 nPartIndex += 1
@@ -1135,9 +1140,18 @@ Public Class LeftPanelVM
''' </summary> ''' </summary>
Public Sub Invert() Public Sub Invert()
If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return If IsNothing(Map.refProjManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di ruotare le travi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
' inverto i pezzi selezionati
For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
Part.Invert() Part.Invert()
Next Next
' se assemblato lo ripristino
If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False)
End Sub End Sub
#End Region ' BackRotation #End Region ' BackRotation
@@ -46,7 +46,7 @@ Public Class MyMachGroupVM
End Get End Get
Set(value As String) Set(value As String)
Dim dValue As Double Dim dValue As Double
If StringToLen(value, dValue) Then If StringToLenAdv(value, dValue, True) Then
Dim nRawPartId As Integer = EgtGetFirstRawPart() Dim nRawPartId As Integer = EgtGetFirstRawPart()
If dValue <> MyMachGroupM.dL Then If dValue <> MyMachGroupM.dL Then
Select Case nType Select Case nType
@@ -104,14 +104,14 @@ Public Class MyMachGroupVM
EgtGetTableArea(1, b3Tab) EgtGetTableArea(1, b3Tab)
Dim p3OrigOnTab As Point3d Dim p3OrigOnTab As Point3d
Select Case CurrentMachine.OrigCorner Select Case CurrentMachine.OrigCorner
'Case MCH_CR.BL Case MCH_CR.BL
' p3OrigOnTab = New Point3d(0, 0, 0) p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.BR Case MCH_CR.BR
p3OrigOnTab = New Point3d(b3Tab.DimX(), 0, 0) p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
'Case MCH_CR.TL Case MCH_CR.TL
' p3OrigOnTab = New Point3d(0, b3Tab.DimY(), 0) p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TR Case MCH_CR.TR
p3OrigOnTab = New Point3d(b3Tab.DimX(), b3Tab.DimY(), 0) p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
End Select End Select
EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner) EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner)
' sposto tutti i pezzi di quanto si e' accorciato il grezzo ' sposto tutti i pezzi di quanto si e' accorciato il grezzo
@@ -140,7 +140,7 @@ Public Class MyMachGroupVM
End Get End Get
Set(value As String) Set(value As String)
Dim dValue As Double Dim dValue As Double
If StringToLen(value, dValue) Then If StringToLenAdv(value, dValue, True) Then
If nType = BWType.WALL Then If nType = BWType.WALL Then
Dim nRawPartId As Integer = EgtGetFirstRawPart() Dim nRawPartId As Integer = EgtGetFirstRawPart()
If dValue <> MyMachGroupM.dW Then If dValue <> MyMachGroupM.dW Then
@@ -175,14 +175,14 @@ Public Class MyMachGroupVM
EgtGetTableArea(1, b3Tab) EgtGetTableArea(1, b3Tab)
Dim p3OrigOnTab As Point3d Dim p3OrigOnTab As Point3d
Select Case CurrentMachine.OrigCorner Select Case CurrentMachine.OrigCorner
'Case MCH_CR.BL Case MCH_CR.BL
' p3OrigOnTab = New Point3d(0, 0, 0) p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
'Case MCH_CR.BR Case MCH_CR.BR
' p3OrigOnTab = New Point3d(b3Tab.DimX(), 0, 0) p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TL Case MCH_CR.TL
p3OrigOnTab = New Point3d(0, b3Tab.DimY(), 0) p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TR Case MCH_CR.TR
p3OrigOnTab = New Point3d(b3Tab.DimX(), b3Tab.DimY(), 0) p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
End Select End Select
EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner) EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner)
' sposto tutti i pezzi di quanto si e' accorciato il grezzo ' sposto tutti i pezzi di quanto si e' accorciato il grezzo
@@ -211,7 +211,7 @@ Public Class MyMachGroupVM
End Get End Get
Set(value As String) Set(value As String)
Dim dValue As Double Dim dValue As Double
If StringToLen(value, dValue) Then If StringToLenAdv(value, dValue, True) Then
MyMachGroupM.dH = value MyMachGroupM.dH = value
End If End If
End Set End Set
@@ -248,15 +248,29 @@ Public Class MyMachGroupVM
End Get End Get
Set(value As String) Set(value As String)
Dim dValue As Double Dim dValue As Double
If StringToLen(value, dValue) Then If StringToLenAdv(value, dValue, True) Then
Dim dOldValue As Double = MyMachGroupM.dStartCut Dim dOldValue As Double = MyMachGroupM.dStartCut
' verifico se con il nuovo StartCut tutti i pezzi stanno nella barra
Dim dTotLength As Double = 0
For PartIndex = 0 To m_PartVMList.Count - 1
Dim Part As PartVM = m_PartVMList(PartIndex)
If PartIndex = 0 Then
dTotLength += Part.dL + dValue
Else
dTotLength += Part.dL + Part.dOffset
End If
Next
If Me.dL < dTotLength Then
NotifyPropertyChanged(NameOf(sStartCut))
Return
End If
MyMachGroupM.dStartCut = dValue MyMachGroupM.dStartCut = dValue
If Not ReDrawBeamMachgroup() Then If Not ReDrawBeamMachgroup() Then
' rispristino vecchio valore ' rispristino vecchio valore
MyMachGroupM.dStartCut = dOldValue MyMachGroupM.dStartCut = dOldValue
ReDrawBeamMachgroup() ReDrawBeamMachgroup()
NotifyPropertyChanged(NameOf(sStartCut))
End If End If
MyMachGroupM.dStartCut = dValue
EgtDraw() EgtDraw()
If PartVMList.Count > 0 Then If PartVMList.Count > 0 Then
Dim Beam As PartVM = PartVMList(0) Dim Beam As PartVM = PartVMList(0)
@@ -286,15 +300,15 @@ Public Class MyMachGroupVM
End Get End Get
Set(value As String) Set(value As String)
Dim dValue As Double Dim dValue As Double
If StringToLen(value, dValue) Then If StringToLenAdv(value, dValue, True) Then
Dim nRawPartId As Integer = EgtGetFirstRawPart() Dim nRawPartId As Integer = EgtGetFirstRawPart()
If dValue <> MyMachGroupM.dPosZ Then If Math.Abs(dValue - MyMachGroupM.dPosZ) > EPS_SMALL Then
Select Case nType Select Case nType
Case BWType.BEAM Case BWType.BEAM
' non utilizzato ' non utilizzato
Case BWType.WALL Case BWType.WALL
' se operazione di spostamento in z ha successo ' se operazione di spostamento in z ha successo
If True Then If dValue >= 0 AndAlso EgtMoveRawPart(nRawPartId, New Vector3d(0, 0, dValue - MyMachGroupM.dPosZ)) Then
EgtSetInfo(Id, MGR_RPT_PANELPOSZ, dValue) EgtSetInfo(Id, MGR_RPT_PANELPOSZ, dValue)
EgtDraw() EgtDraw()
MyMachGroupM.dPosZ = dValue MyMachGroupM.dPosZ = dValue
@@ -512,9 +526,7 @@ Public Class MyMachGroupVM
nRawId = EgtGetFirstRawPart() nRawId = EgtGetFirstRawPart()
End While End While
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt" Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then Return False Return ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False)
Return True
End Function End Function
Friend Sub MoveBeam(Beam As PartVM, MoveDirection As MoveDirections) Friend Sub MoveBeam(Beam As PartVM, MoveDirection As MoveDirections)
@@ -794,7 +806,7 @@ Public Class MyMachGroupVM
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo) EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c) sSplitInfo = sInfo.Split(","c)
StringToDouble(sSplitInfo(1), MyMachGroupM.dStartCut) StringToDoubleAdv(sSplitInfo(1), MyMachGroupM.dStartCut)
Else Else
MyMachGroupM.dStartCut = 0 MyMachGroupM.dStartCut = 0
End If End If
@@ -54,14 +54,14 @@ Public Class PartVM
End Get End Get
Set(value As String) Set(value As String)
Dim dValue As Double Dim dValue As Double
If StringToLen(value, dValue) Then If StringToLenAdv(value, dValue, True) Then
Dim dOldValue As Double = m_PartM.dOffset Dim dOldValue As Double = m_PartM.dOffset
Dim BeamMachGroup As MyMachGroupVM = DirectCast(ParentMachGroupVM, MyMachGroupVM) Dim BeamMachGroup As MyMachGroupVM = DirectCast(ParentMachGroupVM, MyMachGroupVM)
' se prima trave della barra sostituisco valore anche a startoffset ' se prima trave della barra sostituisco valore anche a startoffset
If ParentMachGroupVM.PartVMList(0) Is Me Then If ParentMachGroupVM.PartVMList(0) Is Me Then
m_PartM.dOffset = dValue m_PartM.dOffset = dValue
BeamMachGroup.dStartCut = dValue BeamMachGroup.dStartCut = dValue
ElseIf value > CurrentMachine.dMinOffset Then ElseIf dValue > CurrentMachine.dMinOffset Then
m_PartM.dOffset = dValue m_PartM.dOffset = dValue
Else Else
m_PartM.dOffset = CurrentMachine.dMinOffset m_PartM.dOffset = CurrentMachine.dMinOffset
@@ -103,7 +103,7 @@ Public Class PartVM
End Get End Get
Set(value As String) Set(value As String)
Dim dValue As Double Dim dValue As Double
If StringToLen(value, dValue) Then If StringToLenAdv(value, dValue, True) Then
Dim dOldValue As Double = m_PartM.dPOSX Dim dOldValue As Double = m_PartM.dPOSX
Dim dNewValue As Double = dValue Dim dNewValue As Double = dValue
Select Case Map.refProjectVM.BTLStructureVM.nPROJTYPE Select Case Map.refProjectVM.BTLStructureVM.nPROJTYPE
@@ -151,7 +151,7 @@ Public Class PartVM
End Get End Get
Set(value As String) Set(value As String)
Dim dValue As Double Dim dValue As Double
If StringToLen(value, dValue) Then If StringToLenAdv(value, dValue, True) Then
Dim dOldValue As Double = m_PartM.dPOSY Dim dOldValue As Double = m_PartM.dPOSY
Dim dNewValue As Double = dValue Dim dNewValue As Double = dValue
' valuto angolo di posizionamento ' valuto angolo di posizionamento
@@ -38,7 +38,7 @@ Public Class MainMenuVM
Set(value As Boolean) Set(value As Boolean)
If value Then If value Then
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso
Map.refProjManagerVM.CurrProj.nProdId = Map.refProdManagerVM.CurrProd.nProdId Then Map.refProjManagerVM.CurrProj.nProdId = Map.refProdManagerVM.CurrProd.nProdId Then
Map.refProjManagerVM.CurrProj.SetReloadProject(False) Map.refProjManagerVM.CurrProj.SetReloadProject(False)
End If End If
SelPage = Pages.VIEW SelPage = Pages.VIEW
@@ -53,7 +53,7 @@ Public Class MainMenuVM
Set(value As Boolean) Set(value As Boolean)
If value Then If value Then
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso
Map.refProjManagerVM.CurrProj.nProdId = Map.refProdManagerVM.CurrProd.nProdId Then Map.refProjManagerVM.CurrProj.nProdId = Map.refProdManagerVM.CurrProd.nProdId Then
Map.refProdManagerVM.CurrProd.SetReloadProject(False) Map.refProdManagerVM.CurrProd.SetReloadProject(False)
End If End If
SelPage = Pages.MACHINING SelPage = Pages.MACHINING
@@ -244,19 +244,23 @@ Public Class MainMenuVM
DimensionsIniFile.ReadGridDimensions(ConstDims.LEFTPANEL_VIEW, Map.refLeftPanelVM.GridDims) DimensionsIniFile.ReadGridDimensions(ConstDims.LEFTPANEL_VIEW, Map.refLeftPanelVM.GridDims)
' apro progetto proj ' apro progetto proj
If Not IsNothing(Map.refProjManagerVM.CurrProj) Then If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
If Map.refProjManagerVM.CurrProj.bReloadProject Then If Map.refProjManagerVM.CurrProj.bReloadProject OrElse Map.refConfigurationPageVM.QParametersModified Then
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROJ, 2, EgtMsg(63005), 10, 100) ' Loading parts LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROJ, 2, EgtMsg(63005), 10, 100) ' Loading parts
Map.refProjManagerVM.OpenProject(Map.refProjManagerVM.CurrProj) Map.refProjManagerVM.OpenProject(Map.refProjManagerVM.CurrProj)
' aggiorno le colonne in base al tipo progetto ' aggiorno le colonne in base al tipo progetto
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM) Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
Else Else
Map.refRawPartListVM.UpdateColumns(BWType.BEAM) Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
Map.refTopPanelVM.ManageQParamsRowVisibility(BWType.BEAM) Map.refTopPanelVM.ManageQParamsRowVisibility(BWType.BEAM)
Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM) Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM)
End If End If
' resetto modifica parametri Q default
Map.refConfigurationPageVM.ResetQParametersModified()
DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) DbControllers.m_ProjController.LockByProjId(Map.refProjManagerVM.CurrProj.nProjId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames)) Map.refProjManagerVM.NotifyPropertyChanged(NameOf(Map.refProjManagerVM.MruFileNames))
Else Else
@@ -329,14 +333,17 @@ Public Class MainMenuVM
If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd.nProdId) AndAlso Map.refProdManagerVM.CurrProd.nProdId > 0 Then If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso Not IsNothing(Map.refProdManagerVM.CurrProd.nProdId) AndAlso Map.refProdManagerVM.CurrProd.nProdId > 0 Then
If File.Exists(Map.refProdManagerVM.CurrProd.sProdPath) Then If File.Exists(Map.refProdManagerVM.CurrProd.sProdPath) Then
' apro progetto ' apro progetto
If Map.refProdManagerVM.CurrProd.bReloadProject Then If Map.refProdManagerVM.CurrProd.bReloadProject OrElse Map.refConfigurationPageVM.QParametersModified Then
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 50) ' Loading parts LoadingWndHelper.UpdateLoadingWnd(ActiveIds.GOTOPROD, 2, EgtMsg(63005), 10, 50) ' Loading parts
Map.refProdManagerVM.TempCurrProd = Map.refProdManagerVM.CurrProd Map.refProdManagerVM.TempCurrProd = Map.refProdManagerVM.CurrProd
If Map.refSceneHostVM.MainController.OpenProject(Map.refProdManagerVM.CurrProd.sProdPath, False) Then If Map.refSceneHostVM.MainController.OpenProject(Map.refProdManagerVM.CurrProd.sProdPath, False) Then
' aggiorno le colonne in base al tipo progetto ' aggiorno le colonne in base al tipo progetto
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM) Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' resetto modifica parametri Q default
Map.refConfigurationPageVM.ResetQParametersModified()
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames)) Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
End If End If
@@ -369,9 +376,29 @@ Public Class MainMenuVM
Map.refProdManagerVM.CurrProd.SetReloadProject(True) Map.refProdManagerVM.CurrProd.SetReloadProject(True)
End If End If
'DbControllers.m_ProdController.ResetController() 'DbControllers.m_ProdController.ResetController()
' se Warehouse di tipo Medium e piu' di un progetto collegato
Dim nDefault As Integer = 2
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM AndAlso Map.refProdManagerVM.CurrProd.nProjIdList.Count > 1 Then
' confronto le Sezioni del BTL importato con quelle in Warehouse
WarehouseWndVM.UpdateSectionXMaterial()
End If
' aggiorno titolo ' aggiorno titolo
Map.refMainWindowVM.UpdateTitle() Map.refMainWindowVM.UpdateTitle()
DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber()) DbControllers.m_ProdController.LockByProdId(Map.refProdManagerVM.CurrProd.nProdId, True, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
' controllo se devo lanciare verifica perche' importato
Dim bGetVerifyResult As Boolean = False
Dim bVerifyMach As Boolean = False
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
While nBTLInfoLayerId <> GDB_ID.NULL
If EgtGetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, bGetVerifyResult) AndAlso bGetVerifyResult Then
If Not bVerifyMach Then bVerifyMach = True
EgtSetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, False)
End If
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
End While
If bVerifyMach Then
Map.refCALCPanelVM.VerifyAll()
End If
' seleziono prima barra ' seleziono prima barra
Map.refProjectVM.MachGroupPanelVM.SelFirstMachGroup() Map.refProjectVM.MachGroupPanelVM.SelFirstMachGroup()
Else Else
@@ -460,10 +487,12 @@ Public Class MainMenuVM
Map.refConfigurationPageVM.bModifyMachParam = False Map.refConfigurationPageVM.bModifyMachParam = False
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM) Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE <> BWType.BEAM)
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE) Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
Else Else
Map.refRawPartListVM.UpdateColumns(BWType.BEAM) Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
Map.refTopPanelVM.ManageQParamsRowVisibility(BWType.BEAM) Map.refTopPanelVM.ManageQParamsRowVisibility(BWType.BEAM)
Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM) Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM)
End If End If
@@ -150,7 +150,7 @@ Public Class MainWindowM
End Get End Get
End Property End Property
Private m_sWarehouseDir As String Private m_sWarehouseDir As String = ""
Friend ReadOnly Property sWarehouseDir As String Friend ReadOnly Property sWarehouseDir As String
Get Get
Return m_sWarehouseDir Return m_sWarehouseDir
@@ -226,9 +226,17 @@ Public Class MainWindowM
EgtSetNestKey(sNestKey) EgtSetNestKey(sNestKey)
' Verifico abilitazione nesting automatico ' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey) m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
' Impostazioni per chiave di rete
Dim bNetKey As Boolean = ( GetMainPrivateProfileInt( S_GENERAL, K_NETKEY, 0) = 1)
EgtSetNetHwKey( bNetKey)
Dim sLockId As String = ""
EgtUILib.GetPrivateProfileString( S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
If Not String.IsNullOrEmpty( sLockId) Then
EgtSetLockId( sLockId)
End If
' Recupero livello e opzioni della chiave ' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2411, 1, m_nKeyLevel) And Dim bKey As Boolean = EgtGetKeyLevel(5327, 2505, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2411, 1, m_nKeyOptions) EgtGetKeyOptions(5327, 2505, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface ' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & VWOPTGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString()) m_sLogFile = m_sTempDir & "\" & VWOPTGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
@@ -20,7 +20,7 @@ Public Class MovePartInRawPartWndVM
End Get End Get
Set(value As String) Set(value As String)
Dim dTempMoveLen As Double Dim dTempMoveLen As Double
If StringToLen(value, dTempMoveLen) AndAlso dTempMoveLen > 0 Then If StringToLenAdv(value, dTempMoveLen, True) AndAlso dTempMoveLen > 0 Then
m_dMoveLen = dTempMoveLen m_dMoveLen = dTempMoveLen
Else Else
m_dMoveLen = 0 m_dMoveLen = 0
@@ -30,7 +30,7 @@ Imports System.Windows
#End If #End If
<Assembly: AssemblyCompany("Egalware s.r.l.")> <Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("EgtBEAMWALL.ViewerOptimizer")> <Assembly: AssemblyProduct("EgtBEAMWALL.ViewerOptimizer")>
<Assembly: AssemblyCopyright("Copyright © 2020-2022 by Egalware s.r.l.")> <Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")> <Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)> <Assembly: ComVisible(false)>
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.11.3")> <Assembly: AssemblyVersion("2.5.5.4")>
<Assembly: AssemblyFileVersion("2.4.11.3")> <Assembly: AssemblyFileVersion("2.5.5.4")>
@@ -366,6 +366,12 @@ Public Class NestingRunningWndVM
End If End If
nOutlineId = EgtGetNext(nOutlineId) nOutlineId = EgtGetNext(nOutlineId)
End While End While
' verifico se nesting XZ tipo BTL o XY standar
Dim dRawPartBtlH As Double
EgtGetInfo( nRawPartId, "H", dRawPartBtlH)
Dim dRawPartBtlW As Double
EgtGetInfo( nRawPartId, "W", dRawPartBtlW)
Dim bRefBtl As Boolean = ( Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso dRawPartBtlW > dRawPartBtlH)
' recupero i pezzi con frame ' recupero i pezzi con frame
Dim PartList As New List(Of NestPartWithFrame) Dim PartList As New List(Of NestPartWithFrame)
Dim nPartPlaceHolderId As Integer = EgtGetFirstInGroup(nRawPartId) Dim nPartPlaceHolderId As Integer = EgtGetFirstInGroup(nRawPartId)
@@ -392,7 +398,12 @@ Public Class NestingRunningWndVM
' calcolo riferimento ' calcolo riferimento
Dim frPlaceHolder As New Frame3d Dim frPlaceHolder As New Frame3d
EgtFrame(nPartPlaceHolderId, nRawPartId, frPlaceHolder) EgtFrame(nPartPlaceHolderId, nRawPartId, frPlaceHolder)
Dim p3Origin As Point3d = New Point3d(frPlaceHolder.Orig.x, frPlaceHolder.Orig.z, 0) Dim p3Origin As Point3d
If bRefBtl Then
p3Origin = New Point3d(frPlaceHolder.Orig.x, frPlaceHolder.Orig.z, 0)
Else
p3Origin = New Point3d(frPlaceHolder.Orig.x, frPlaceHolder.Orig.y, 0)
End If
' lo rendo std ' lo rendo std
EgtSetMode(nPartDuploId, GDB_MD.STD) EgtSetMode(nPartDuploId, GDB_MD.STD)
PartList.Add(New NestPartWithFrame(nPartPlaceHolderId, p3Origin, frPlaceHolder, nPartDuploId, nSourceId)) PartList.Add(New NestPartWithFrame(nPartPlaceHolderId, p3Origin, frPlaceHolder, nPartDuploId, nSourceId))
@@ -424,7 +435,8 @@ Public Class NestingRunningWndVM
Dim dPosX As Double = NestPart.p3Orig.x Dim dPosX As Double = NestPart.p3Orig.x
Dim dPosY As Double = NestPart.p3Orig.y Dim dPosY As Double = NestPart.p3Orig.y
Dim b3Duplo As New BBox3d Dim b3Duplo As New BBox3d
EgtGetBBoxGlob(NestPart.nPartDuploId, GDB_BB.STANDARD, b3Duplo) Dim nBoxLayId As Integer = EgtGetFirstNameInGroup( NestPart.nPartDuploId, "Box")
EgtGetBBoxGlob(nBoxLayId, GDB_BB.STANDARD, b3Duplo)
' calcolo rot ed invert da frame ' calcolo rot ed invert da frame
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
If AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.X_AX) Then If AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.X_AX) Then
@@ -442,30 +454,138 @@ Public Class NestingRunningWndVM
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.X_AX, dRot) EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.X_AX, dRot)
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.Z_AX, dFlip) EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.Z_AX, dFlip)
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL Then
'Dim frPlaceHolder As New Frame3d If bRefBtl Then
'EgtFrame(NestPart.nPartId, GDB_ID.ROOT, frPlaceHolder) Dim vtFrVersX As Vector3d = NestPart.frFrame.VersX
'Dim frDuplo As New Frame3d Dim vtFrVersY As Vector3d = NestPart.frFrame.VersY
'EgtFrame(NestPart.nPartDuploId, GDB_ID.ROOT, frDuplo) If Math.Abs( vtFrVersX.z) > EPS_SMALL Or
'Dim dDuploRot As Double = GetAngle(frDuplo.VersX, frPlaceHolder.VersX) Math.Abs( vtFrVersX.z) > EPS_SMALL Then
'Dim dDuploFlip As Double = GetAngle(frDuplo.VersY, frPlaceHolder.VersY) vtFrVersX = New Vector3d( vtFrVersX.y, vtFrVersX.z, 0)
'If dDuploFlip > 180 - 10 * EPS_SMALL AndAlso dDuploFlip < 180 + 10 * EPS_SMALL Then vtFrVersY = New Vector3d( vtFrVersY.y, vtFrVersY.z, 0)
' dDuploRot -= 180 End If
'End If If AreSameVectorApprox(vtFrVersX, Vector3d.X_AX) AndAlso
If NestPart.frFrame.GetEgtType() = Frame3d.TYPE.TOP Then AreSameVectorApprox(vtFrVersY, Vector3d.Y_AX) Then
dFlip = 180 dFlip = 0
dRot = 180 dRot = 0
dPosX = b3Box.DimX() - b3Duplo.DimX() - dPosX dPosX = dPosX
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.X_AX) AndAlso AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.Y_AX) Then dPosY = dPosY
dFlip = 180 ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.X_AX) AndAlso
dRot = 0 AreSameVectorApprox(vtFrVersY, Vector3d.Y_AX) Then
dPosX = b3Box.DimX() - dPosX dFlip = 0
dPosY -= b3Duplo.DimY() dRot = 180
dPosX = dPosX - b3Duplo.DimX()
dPosY = dPosY - b3Duplo.DimY()
ElseIf AreSameVectorApprox(vtFrVersX, Vector3d.X_AX) AndAlso
AreSameVectorApprox(vtFrVersY, -Vector3d.Y_AX) Then
dFlip = 180
dRot = 0
dPosX = dPosX
dPosY = dPosY - b3Duplo.DimY()
ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.X_AX) AndAlso
AreSameVectorApprox(vtFrVersY, -Vector3d.Y_AX) Then
dFlip = 180
dRot = 180
dPosX = dPosX - b3Duplo.DimX()
dPosY = dPosY
ElseIf AreSameVectorApprox(vtFrVersX, Vector3d.Y_AX) AndAlso
AreSameVectorApprox(vtFrVersY, Vector3d.X_AX) Then
dFlip = 0
dRot = -90
dPosX = dPosX - b3Duplo.DimY()
dPosY = dPosY
ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.Y_AX) AndAlso
AreSameVectorApprox(vtFrVersY, Vector3d.X_AX) Then
dFlip = 0
dRot = 90
dPosX = dPosX
dPosY = dPosY - b3Duplo.DimX()
ElseIf AreSameVectorApprox(vtFrVersX, Vector3d.Y_AX) AndAlso
AreSameVectorApprox(vtFrVersY, -Vector3d.X_AX) Then
dFlip = 180
dRot = -90
dPosX = dPosX
dPosY = dPosY
ElseIf AreSameVectorApprox(vtFrVersX, -Vector3d.Y_AX) AndAlso
AreSameVectorApprox(vtFrVersY, -Vector3d.X_AX) Then
dFlip = 180
dRot = 90
dPosX = dPosX - b3Duplo.DimY()
dPosY = dPosY - b3Duplo.DimX()
Else
' errore, la parete deve stare nel piano del grezzo
EgtOutLog(String.Format("Errore in BTL nesting, pezzo {0} non giace nel piano XY ({1})", NestPart.nPartDuploId, NestPart.frFrame.VersZ))
Continue For
End If
Else Else
' errore, la parete deve stare nel piano del grezzo If AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.X_AX) AndAlso
EgtOutLog(String.Format("Errore in BTL nesting, pezzo {0} non giace nel piano XY ({1})", NestPart.nPartDuploId, NestPart.frFrame.VersZ)) AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.Y_AX) Then
Continue For dFlip = 0
dRot = 0
dPosX = dPosX
dPosY = dPosY
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.X_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.Y_AX) Then
dFlip = 180
dRot = 180
dPosX = dPosX - b3Duplo.DimX()
dPosY = dPosY
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.X_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.Y_AX) Then
dFlip = 180
dRot = 0
dPosX = dPosX
dPosY = dPosY - b3Duplo.DimY()
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.X_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.Y_AX) Then
dFlip = 0
dRot = 180
dPosX = dPosX - b3Duplo.DimX()
dPosY = dPosY - b3Duplo.DimY()
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.Y_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.X_AX) Then
dFlip = 180
dRot = -90
dPosX = dPosX
dPosY = dPosY
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.Y_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, Vector3d.X_AX) Then
dFlip = 0
dRot = 90
dPosX = dPosX
dPosY = dPosY - b3Duplo.DimX()
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, Vector3d.Y_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.X_AX) Then
dFlip = 0
dRot = -90
dPosX = dPosX - b3Duplo.DimY()
dPosY = dPosY
ElseIf AreSameVectorApprox(NestPart.frFrame.VersX, -Vector3d.Y_AX) AndAlso
AreSameVectorApprox(NestPart.frFrame.VersY, -Vector3d.X_AX) Then
dFlip = 180
dRot = 90
dPosX = dPosX - b3Duplo.DimY()
dPosY = dPosY - b3Duplo.DimX()
Else
' errore, la parete deve stare nel piano del grezzo
EgtOutLog(String.Format("Errore in BTL nesting, pezzo {0} non giace nel piano XY ({1})", NestPart.nPartDuploId, NestPart.frFrame.VersZ))
Continue For
End If
End If End If
' faccio rotazioni ' Se pannello ribaltato
Dim bSideOppo As Boolean = (GetMainPrivateProfileInt(S_IMPORT, K_WALLOPPOSITESIDENESTING, 0) <> 0)
If bSideOppo Then
dFlip = ( dFlip + 180) Mod 360
Dim bUseX As Boolean
If Math.Abs( dRot Mod 180) < EPS_ANG_SMALL Then
dRot = ( dRot + 180) Mod 360
bUseX = True
Else
dRot = dRot
bUseX = False
End If
dPosX = -dPosX - If( bUseX, b3Duplo.DimX(), b3Duplo.DimY()) + b3Box.DimX()
dPosY = dPosY
End If
' Applico le rotazioni
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.X_AX, dFlip) EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, Vector3d.X_AX, dFlip)
EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, -Vector3d.Z_AX, dRot) EgtRotate(NestPart.nPartDuploId, b3Duplo.Center, -Vector3d.Z_AX, dRot)
End If End If
@@ -499,7 +619,7 @@ Public Class NestingRunningWndVM
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then
Map.refProjectVM.BTLStructureVM.HideAll(True) Map.refProjectVM.BTLStructureVM.HideAll(True)
End If End If
Return Exit While
End If End If
' passo al prossimo RawPart ' passo al prossimo RawPart
@@ -126,28 +126,40 @@ Public Class OpenProjectFileDialogVM
If nTempCtx <> 0 Then If nTempCtx <> 0 Then
' inizializzo gestore lavorazioni ' inizializzo gestore lavorazioni
EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir) EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir)
EgtOpenFile(SelProject.sProdPath) ' apro, ripulisco e salvo il progetto in tutti i proj correlati
' cancello tutti i gruppi di lavorazione
Dim nMachGroupId As Integer = EgtGetFirstMachGroup()
While nMachGroupId <> GDB_ID.NULL
EgtSetCurrMachGroup(nMachGroupId)
Dim nRawPartId As Integer = EgtGetFirstRawPart()
While nRawPartId <> GDB_ID.NULL
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
While nPartId <> GDB_ID.NULL
EgtRemovePartFromRawPart(nPartId)
' elimino pezzo copia
EgtErase(nPartId)
nPartId = EgtGetFirstPartInRawPart(nRawPartId)
End While
nRawPartId = EgtGetNextRawPart(nRawPartId)
End While
EgtRemoveMachGroup(nMachGroupId)
nMachGroupId = EgtGetFirstMachGroup()
End While
' lo salvo in tutti i proj correlati
Dim ProdFile As ProdFileVM = DirectCast(SelProject, ProdFileVM) Dim ProdFile As ProdFileVM = DirectCast(SelProject, ProdFileVM)
For Each nProjId In ProdFile.nProjIdList For Each nProjId In ProdFile.nProjIdList
EgtOpenFile(SelProject.sProdPath)
' cancello tutti i gruppi di lavorazione
Dim nMachGroupId As Integer = EgtGetFirstMachGroup()
While nMachGroupId <> GDB_ID.NULL
EgtSetCurrMachGroup(nMachGroupId)
Dim nRawPartId As Integer = EgtGetFirstRawPart()
While nRawPartId <> GDB_ID.NULL
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
While nPartId <> GDB_ID.NULL
EgtRemovePartFromRawPart(nPartId)
' elimino pezzo copia
EgtErase(nPartId)
nPartId = EgtGetFirstPartInRawPart(nRawPartId)
End While
nRawPartId = EgtGetNextRawPart(nRawPartId)
End While
EgtRemoveMachGroup(nMachGroupId)
nMachGroupId = EgtGetFirstMachGroup()
End While
' cancello tutti i gruppi che sono di un progetto diverso da questo
Dim nGroupId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
While nGroupId <> GDB_ID.NULL
Dim nGroupProjId As Integer = GDB_ID.NULL
Dim nNextGroupId As Integer = EgtGetNext(nGroupId)
If EgtGetInfo(nGroupId, BTL_PRT_PROJ, nGroupProjId) Then
If nGroupProjId <> nProjId Then
EgtErase(nGroupId)
End If
End If
nGroupId = nNextGroupId
End While
EgtSaveFile(ProdFile.GetProjPath(nProjId), NGE.CMPTEXT) EgtSaveFile(ProdFile.GetProjPath(nProjId), NGE.CMPTEXT)
Next Next
' torno sul contesto corrente ' torno sul contesto corrente
@@ -39,9 +39,9 @@
</Button>--> </Button>-->
<Button Command="{Binding AddProj_Command}" <Button Command="{Binding AddProj_Command}"
ToolTip="{Binding AddProj_ToolTip}" ToolTip="{Binding AddProj_ToolTip}"
Visibility="Collapsed" Visibility="{Binding AddProj_Visibility}"
Style="{StaticResource ToolBar_Button}"> Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/> <Image Source="/Resources/ProjectManager/AddProj.png" Stretch="Uniform"/>
</Button> </Button>
<Button Command="{Binding GoToProj_Command}" <Button Command="{Binding GoToProj_Command}"
ToolTip="{Binding GoToProj_ToolTip}" ToolTip="{Binding GoToProj_ToolTip}"
@@ -84,10 +84,18 @@ Public Class ProdManagerVM
End Get End Get
End Property End Property
Private m_AddProj_Visibility As Visibility
Public ReadOnly Property AddProj_Visibility As Visibility
Get
Return m_AddProj_Visibility
End Get
End Property
' Definizione comandi ' Definizione comandi
Private m_cmdOpen As ICommand Private m_cmdOpen As ICommand
Private m_cmdOpenMruFile As ICommand Private m_cmdOpenMruFile As ICommand
Private m_cmdSave As ICommand Private m_cmdSave As ICommand
Private m_cmdAddProj As ICommand
Private m_cmdGoToProj As ICommand Private m_cmdGoToProj As ICommand
Private m_cmdGoToSupervisor As ICommand Private m_cmdGoToSupervisor As ICommand
@@ -135,6 +143,12 @@ Public Class ProdManagerVM
Else Else
m_GoToSupervisor_Visibility = Visibility.Collapsed m_GoToSupervisor_Visibility = Visibility.Collapsed
End If End If
' attivo bottone AddProj
If GetMainPrivateProfileInt(S_GENERAL, K_ADDPROJ, 0) = 1 Then
m_AddProj_Visibility = Visibility.Visible
Else
m_AddProj_Visibility = Visibility.Collapsed
End If
' Leggo ultimo indice di progetto ' Leggo ultimo indice di progetto
m_nLastProdId = GetMainPrivateProfileInt(S_GENERAL, K_PRODSINDEX, 1) m_nLastProdId = GetMainPrivateProfileInt(S_GENERAL, K_PRODSINDEX, 1)
' Impostazioni MruLists ' Impostazioni MruLists
@@ -372,10 +386,10 @@ Public Class ProdManagerVM
Save(True) Save(True)
End Sub End Sub
Public Sub Save(Optional bShowLoading As Boolean = False) Public Function Save(Optional bShowLoading As Boolean = False) As Boolean
If IsNothing(m_CurrProd) Then Return If IsNothing(m_CurrProd) Then Return False
If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63007), EgtMsg(63012), 70) ' Project saving ' Saving geometry If bShowLoading Then LoadingWndHelper.OpenLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63007), EgtMsg(63012), 70) ' Project saving ' Saving geometry
Map.refSceneHostVM.SaveProject() Dim bOk As Boolean = Map.refSceneHostVM.SaveProject()
If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63013), 70, 100) ' Saving data on Db If bShowLoading Then LoadingWndHelper.UpdateLoadingWnd(ActiveIds.SAVEPROD, 2, EgtMsg(63013), 70, 100) ' Saving data on Db
Dim MyMachGroupList As New List(Of MyMachGroupM) Dim MyMachGroupList As New List(Of MyMachGroupM)
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
@@ -384,7 +398,10 @@ Public Class ProdManagerVM
Next Next
End If End If
' aggiorno pezzi su Db ' aggiorno pezzi su Db
DbControllers.m_ProdController.UpdateMachGroup(CurrProd.nProdId, MyMachGroupList) If Not DbControllers.m_ProdController.UpdateMachGroup(CurrProd.nProdId, MyMachGroupList) And bShowLoading Then
LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD)
Return False
End If
' verifico se Reset Macchina modificato e nel caso aggiorno DB e CurrProj ' verifico se Reset Macchina modificato e nel caso aggiorno DB e CurrProj
If Map.refCALCPanelVM.IsMachineModified() Then If Map.refCALCPanelVM.IsMachineModified() Then
DbControllers.m_ProdController.UpdateMachine(Map.refProdManagerVM.CurrProd.nProdId, Map.refCALCPanelVM.SelectedMachine.Name) DbControllers.m_ProdController.UpdateMachine(Map.refProdManagerVM.CurrProd.nProdId, Map.refCALCPanelVM.SelectedMachine.Name)
@@ -408,10 +425,103 @@ Public Class ProdManagerVM
Map.refMainWindowVM.UpdateTitle() Map.refMainWindowVM.UpdateTitle()
NotifyPropertyChanged(NameOf(MruFileNames)) NotifyPropertyChanged(NameOf(MruFileNames))
If bShowLoading Then LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD) If bShowLoading Then LoadingWndHelper.CloseLoadingWnd(ActiveIds.SAVEPROD)
End Sub Return bOk
End Function
#End Region ' SaveCommand #End Region ' SaveCommand
#Region "AddProj"
''' <summary>
''' Returns a command that do Save.
''' </summary>
Public ReadOnly Property AddProj_Command As ICommand
Get
If m_cmdAddProj Is Nothing Then
m_cmdAddProj = New Command(AddressOf AddProj)
End If
Return m_cmdAddProj
End Get
End Property
''' <summary>
''' Execute the Save. This method is invoked by the SaveCommand.
''' </summary>
Public Sub AddProj()
' verifico se progetto modificato, e chiedo se salvare
If IsNothing(CurrProd) Then Return
Dim bNewProject As Boolean = False
Dim sProjectDirPath As String = ""
sProjectDirPath = CurrProd.sProdDirPath
Dim VerifyResult As MessageBoxResult = MessageBoxResult.None
' verifico se progetto modificato, e chiedo se salvare
If EgtGetModified() OrElse CurrProd.bIsNew OrElse Map.refCALCPanelVM.IsMachineModified() Then
VerifyResult = MessageBox.Show(EgtMsg(61875), "", If(CurrProd.bIsNew, MessageBoxButton.OKCancel, MessageBoxButton.YesNoCancel), MessageBoxImage.Question)
Select Case VerifyResult
Case MessageBoxResult.Yes, MessageBoxResult.OK
' salvo proj
Map.refProdManagerVM.Save()
Case MessageBoxResult.Cancel
Return
Case Else ' No
EgtResetModified()
OpenProject(CurrProd)
End Select
Else
EgtResetModified()
End If
' faccio scegliere proj da aggiungere
Dim OpenProjectFileDialogVM As New OpenProjectFileDialogVM
Dim ChooseProdFileDialog As New OpenProjectFileDialogV(Application.Current.MainWindow, OpenProjectFileDialogVM)
Dim DialogResult As Boolean? = ChooseProdFileDialog.EgtShowDialog(ProjectType.PROJ, True)
If IsNothing(DialogResult) OrElse Not DialogResult Then Return
If IsNothing(OpenProjectFileDialogVM.SelProject.nProjId) OrElse OpenProjectFileDialogVM.SelProject.nProjId <= 0 Then Return
' verifico che il proj selezionato non abbia prod
If Not IsNothing(OpenProjectFileDialogVM.SelProject.nProdId) AndAlso OpenProjectFileDialogVM.SelProject.nProdId > 0 Then
' verifico che non sia uno di quelli gia' collegati a questo Prod
Dim bFound As Boolean = False
For Each nProjId As Integer In CurrProd.nProjIdList
If nProjId = OpenProjectFileDialogVM.SelProject.nProjId Then
bFound = True
Exit For
End If
Next
If bFound Then
MessageBox.Show("Selezionato progetto che fa gia' parte di questa produzione!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
Else
MessageBox.Show("Progetto gia' collegato ad una produzione!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
End If
Return
End If
' verifico che sia associato alla stessa macchina
If OpenProjectFileDialogVM.SelProject.sMachine <> CurrProd.sMachine Then
MessageBox.Show("Progetto per una macchina diversa da quella del progetto corrente!", "Errore", MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' inserisco proj nel prod corrente
Dim bOk As Boolean = EgtInsertFile(OpenProjectFileDialogVM.SelProject.sProjPath)
' lo salvo
bOk = bOk AndAlso Save(False)
If bOk Then
' riporto aggiunta proj a prod su Db
DbControllers.m_ProdController.AddProj(CurrProd.nProdId, OpenProjectFileDialogVM.SelProject.nProjId)
End If
' Ricavo il tipo di Warehouse settato nell'INI
Dim nDefault As Integer = 2
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM Then
' Se di tipo Medium confronto le Sezioni del BTL importato con quelle in Warehouse
WarehouseWndVM.UpdateSectionXMaterial()
End If
' aggiorno CurrProd
Dim PdFileM = DbControllers.m_ProdController.FindCoreByProdId(CurrProd.nProdId)
CurrProd.ProdFileM.SetProjIdList(PdFileM.nProjIdList)
' ricarico BTLPartList
OpenProject(CurrProd)
End Sub
#End Region ' AddProj
#Region "GoToProj" #Region "GoToProj"
''' <summary> ''' <summary>
@@ -535,7 +535,7 @@ Public Class ProjManagerVM
' se vista singolo pezzo ' se vista singolo pezzo
Else Else
bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
End If End If
' imposto ProjId di caricamento ' imposto ProjId di caricamento
m_nLoadingProjId = CurrProj.nProjId m_nLoadingProjId = CurrProj.nProjId
@@ -551,7 +551,7 @@ Public Class ProjManagerVM
End If End If
' se assemblato lo ripristino ' se assemblato lo ripristino
If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False) If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False)
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
' verifico se Reset Macchina modificato e nel caso aggiorno DB e CurrProj ' verifico se Reset Macchina modificato e nel caso aggiorno DB e CurrProj
If Map.refCALCPanelVM.IsMachineModified() Then If Map.refCALCPanelVM.IsMachineModified() Then
DbControllers.m_ProjController.UpdateMachine(Map.refProjManagerVM.CurrProj.nProjId, Map.refCALCPanelVM.SelectedMachine.Name) DbControllers.m_ProjController.UpdateMachine(Map.refProjManagerVM.CurrProj.nProjId, Map.refCALCPanelVM.SelectedMachine.Name)
@@ -596,7 +596,7 @@ Public Class ProjManagerVM
.DefaultExt = ".btl", .DefaultExt = ".btl",
.Filter = "BTL (*.btl)|*.btl" & .Filter = "BTL (*.btl)|*.btl" &
"|BTLX (*.btlx)|*.btlx", "|BTLX (*.btlx)|*.btlx",
.InitialDirectory = If( Directory.Exists( sDir), sDir, ""), .InitialDirectory = If(Directory.Exists(sDir), sDir, ""),
.CheckFileExists = True, .CheckFileExists = True,
.ValidateNames = True} .ValidateNames = True}
If BTLDlg.ShowDialog() Then If BTLDlg.ShowDialog() Then
@@ -831,7 +831,7 @@ Public Class ProjManagerVM
' se vista singolo pezzo ' se vista singolo pezzo
Else Else
bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked bShowSolid = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
' se pezzo selezionato lo segno e metto vista tutti ' se pezzo selezionato lo segno e metto vista tutti
nSelPartId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId nSelPartId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId
Map.refProjectVM.BTLStructureVM.ShowAll(False) Map.refProjectVM.BTLStructureVM.ShowAll(False)
@@ -845,7 +845,7 @@ Public Class ProjManagerVM
.DefaultExt = ".btl", .DefaultExt = ".btl",
.Filter = "BTL (*.btl)|*.btl" & .Filter = "BTL (*.btl)|*.btl" &
"|BTLX (*.btlx)|*.btlx", "|BTLX (*.btlx)|*.btlx",
.InitialDirectory = If( Directory.Exists( sDir), sDir, ""), .InitialDirectory = If(Directory.Exists(sDir), sDir, ""),
.CheckFileExists = True, .CheckFileExists = True,
.ValidateNames = True} .ValidateNames = True}
If BTLDlg.ShowDialog() Then If BTLDlg.ShowDialog() Then
@@ -857,7 +857,7 @@ Public Class ProjManagerVM
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId) Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId)
If Not IsNothing(SelPart) Then If Not IsNothing(SelPart) Then
SelPart.IsSelected = True SelPart.IsSelected = True
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
End If End If
End If End If
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
@@ -974,7 +974,7 @@ Public Class ProjManagerVM
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId) Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId)
If Not IsNothing(SelPart) Then If Not IsNothing(SelPart) Then
SelPart.IsSelected = True SelPart.IsSelected = True
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
End If End If
End If End If
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
@@ -1039,7 +1039,7 @@ Public Class ProjManagerVM
Dim b3Part As New BBox3d Dim b3Part As New BBox3d
EgtGetBBoxGlob(nAddedPartId, 1, b3Part) EgtGetBBoxGlob(nAddedPartId, 1, b3Part)
' sposto il pezzo per distanziarlo dall'ultimo di un offset pari a 500 ' sposto il pezzo per distanziarlo dall'ultimo di un offset pari a 500
bOk = bOk AndAlso EgtMove(nAddedPartId, New Vector3d(0, If(bFirstLoop, b3Parts.DimY(), LastPartMaxY - b3Part.Min.y) + 500, 0)) bOk = bOk AndAlso EgtMove(nAddedPartId, New Vector3d(0, If(bFirstLoop, b3Parts.Max.y, LastPartMaxY - b3Part.Min.y) + 500, 0))
bFirstLoop = False bFirstLoop = False
' ricaviamo il box globale del part appena spostato, salviamo la sua Y massima e lo aggiungiamo al box globale di tutti i part ' ricaviamo il box globale del part appena spostato, salviamo la sua Y massima e lo aggiungiamo al box globale di tutti i part
EgtGetBBoxGlob(nAddedPartId, 1, b3Part) EgtGetBBoxGlob(nAddedPartId, 1, b3Part)
@@ -1089,7 +1089,7 @@ Public Class ProjManagerVM
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId) Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId)
If Not IsNothing(SelPart) Then If Not IsNothing(SelPart) Then
SelPart.IsSelected = True SelPart.IsSelected = True
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
End If End If
End If End If
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
@@ -1296,7 +1296,7 @@ Public Class ProjManagerVM
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId) Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nSelPartId)
If Not IsNothing(SelPart) Then If Not IsNothing(SelPart) Then
SelPart.IsSelected = True SelPart.IsSelected = True
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False) If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
End If End If
End If End If
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
@@ -1444,7 +1444,7 @@ Public Class ProjManagerVM
' apro finestra scelta file ' apro finestra scelta file
Dim ImportDlg As New Microsoft.Win32.OpenFileDialog() With {.DefaultExt = ".ngexp", Dim ImportDlg As New Microsoft.Win32.OpenFileDialog() With {.DefaultExt = ".ngexp",
.Filter = "ProjectExport (*.ngexp)|*.ngexp", .Filter = "ProjectExport (*.ngexp)|*.ngexp",
.InitialDirectory = If( Directory.Exists( sDir), sDir, ""), .InitialDirectory = If(Directory.Exists(sDir), sDir, ""),
.CheckFileExists = True, .CheckFileExists = True,
.ValidateNames = True} .ValidateNames = True}
If ImportDlg.ShowDialog() <> True Then Return If ImportDlg.ShowDialog() <> True Then Return
@@ -1621,9 +1621,19 @@ Public Class ProjManagerVM
For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' aggiorno ProdId sui MachGroup ' aggiorno ProdId sui MachGroup
EgtSetInfo(MachGroup.Id, MGR_RPT_PRODID, nProdId) EgtSetInfo(MachGroup.Id, MGR_RPT_PRODID, nProdId)
' resetto tutti gli stati di CALC If Map.refMainWindowVM.MainWindowM.nUserLevel < 5 OrElse GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) <> 1 Then
MachGroup.ResetCalcTotalMachGroup() ' resetto tutti gli stati di CALC
MachGroup.ResetCalcTotalMachGroup()
End If
Next Next
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 AndAlso GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) = 1 Then
' riporto info di futuro aggiornamento machgroup
nBTLInfoLayerId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
While nBTLInfoLayerId <> GDB_ID.NULL
EgtSetInfo(nBTLInfoLayerId, IMP_VERIFYMACHGROUP, True)
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
End While
End If
' salvo il progetto PROD ' salvo il progetto PROD
EgtSaveFile(sProjFromPath(0), NGE.CMPTEXT) EgtSaveFile(sProjFromPath(0), NGE.CMPTEXT)
' copio file progetto ' copio file progetto
@@ -1639,6 +1649,14 @@ Public Class ProjManagerVM
bOk = False bOk = False
End Try End Try
End If End If
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 AndAlso GetMainPrivateProfileInt(S_MACH, K_EXPORTBWE, 0) = 1 Then
' copio tutti i bwe
For Each CurrFile In Directory.GetFiles(sProjectimportDir)
If Path.GetExtension(CurrFile) = ".bwe" OrElse Path.GetExtension(CurrFile) = ".html" Then
File.Copy(CurrFile, sProdDir & "\" & Path.GetFileName(CurrFile))
End If
Next
End If
If bOk Then If bOk Then
' aggiungo altri proj a prod ' aggiungo altri proj a prod
For Each nProjId In NewProjIdList For Each nProjId In NewProjIdList
@@ -261,7 +261,7 @@ Public Class ProjectVM
If Not IsNothing(Map.refRawPartListVM.colRawPart_StartCut) Then If Not IsNothing(Map.refRawPartListVM.colRawPart_StartCut) Then
Map.refRawPartListVM.colRawPart_StartCut.IsReadOnly = True Map.refRawPartListVM.colRawPart_StartCut.IsReadOnly = True
End If End If
If m_BTLStructureVM.nPROJTYPE <> BWType.BEAM AndAlso Not IsNothing(Map.refRawPartListVM.colRawPart_W) Then If Not IsNothing(Map.refRawPartListVM.colRawPart_W) Then
Map.refRawPartListVM.colRawPart_W.IsReadOnly = True Map.refRawPartListVM.colRawPart_W.IsReadOnly = True
End If End If
If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then
@@ -285,6 +285,9 @@ Public Class ProjectVM
If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then
Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.IsReadOnly = True Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.IsReadOnly = True
End If End If
If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Priority) Then
Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Priority.IsReadOnly = True
End If
m_bLockUX = True m_bLockUX = True
' se calcolo finito ' se calcolo finito
Else Else
@@ -308,7 +311,7 @@ Public Class ProjectVM
If Not IsNothing(Map.refRawPartListVM.colRawPart_StartCut) Then If Not IsNothing(Map.refRawPartListVM.colRawPart_StartCut) Then
Map.refRawPartListVM.colRawPart_StartCut.IsReadOnly = False Map.refRawPartListVM.colRawPart_StartCut.IsReadOnly = False
End If End If
If Not IsNothing(Map.refRawPartListVM.colRawPart_W) Then If m_BTLStructureVM.nPROJTYPE <> BWType.BEAM AndAlso Not IsNothing(Map.refRawPartListVM.colRawPart_W) Then
Map.refRawPartListVM.colRawPart_W.IsReadOnly = False Map.refRawPartListVM.colRawPart_W.IsReadOnly = False
End If End If
If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then If Not IsNothing(Map.refRawPartListVM.colRawPart_L) Then
@@ -332,6 +335,9 @@ Public Class ProjectVM
If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do) Then
Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.IsReadOnly = False Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Do.IsReadOnly = False
End If End If
If Not IsNothing(Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Priority) Then
Map.refFeatureInPartInRawPartListVM.colFeatureInPartInRawPart_Priority.IsReadOnly = False
End If
' fermo il timer ' fermo il timer
If Not m_bCalcRunning Then If Not m_bCalcRunning Then
m_Calc_Timer.Stop() m_Calc_Timer.Stop()
@@ -139,7 +139,10 @@ Public Class ProdFileVM
Map.refCALCPanelVM.RevertToOriginalMachine() Map.refCALCPanelVM.RevertToOriginalMachine()
If CurrProject.bIsNew Then If CurrProject.bIsNew Then
' lo elimino ' lo elimino
Directory.Delete(sProjectDirPath, True) Try
Directory.Delete(sProjectDirPath, True)
Catch ex As Exception
End Try
Map.refProdManagerVM.m_MruFiles.Remove(CurrProject.sProdPath) Map.refProdManagerVM.m_MruFiles.Remove(CurrProject.sProdPath)
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames)) Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId) DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 889 B

After

Width:  |  Height:  |  Size: 1016 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 B

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 756 B

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 508 B

After

Width:  |  Height:  |  Size: 609 B

@@ -202,13 +202,14 @@ Public Class MySceneHostVM
#Region "ProjectManager" #Region "ProjectManager"
Public Overrides Sub NewProject() Public Overrides Function NewProject() As Boolean
EgtSetCurrentContext(MainScene.GetCtx()) EgtSetCurrentContext(MainScene.GetCtx())
Dim bOk As Boolean = MainController.NewProject() Dim bOk As Boolean = MainController.NewProject()
MainScene.SetStatusNull() MainScene.SetStatusNull()
End Sub Return bOk
End Function
Public Overrides Sub OpenProject(sFilePath As String) Public Overrides Function OpenProject(sFilePath As String) As Boolean
EgtSetCurrentContext(MainScene.GetCtx()) EgtSetCurrentContext(MainScene.GetCtx())
Dim bOk As Boolean = False Dim bOk As Boolean = False
If String.IsNullOrEmpty(sFilePath) Then If String.IsNullOrEmpty(sFilePath) Then
@@ -225,29 +226,32 @@ Public Class MySceneHostVM
bOk = MainController.OpenProject(sFilePath, False) bOk = MainController.OpenProject(sFilePath, False)
End If End If
MainScene.SetStatusNull() MainScene.SetStatusNull()
End Sub Return bOk
End Function
Public Overrides Sub SaveProject() Public Overrides Function SaveProject() As Boolean
MyBase.SaveProject() Dim bOk As Boolean = MyBase.SaveProject()
' Imposto stato gestione mouse diretto della scena a nessuno ' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull() MainScene.SetStatusNull()
End Sub Return bOk
End Function
Public Overrides Sub SaveAsProject() Public Overrides Function SaveAsProject() As Boolean
MyBase.SaveAsProject() Dim bOk As Boolean = MyBase.SaveAsProject()
' Imposto stato gestione mouse diretto della scena a nessuno ' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull() MainScene.SetStatusNull()
End Sub Return bOk
End Function
Public Overrides Sub ImportProject() Public Overrides Function ImportProject() As Boolean
Dim sDir As String = String.Empty Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir) GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
If Not String.IsNullOrWhiteSpace(sDir) Then If Not String.IsNullOrWhiteSpace(sDir) Then
sDir = Path.GetDirectoryName(sDir) sDir = Path.GetDirectoryName(sDir)
End If End If
sDir.TrimEnd("\"c) sDir.TrimEnd("\"c)
MainController.ImportProject(sDir) Return MainController.ImportProject(sDir)
End Sub End Function
#End Region ' ProjectManager #End Region ' ProjectManager
@@ -285,8 +289,10 @@ Public Class MySceneHostVM
Select Case Map.refMainMenuVM.SelPage Select Case Map.refMainMenuVM.SelPage
Case Pages.VIEW Case Pages.VIEW
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
If Map.refFreeContourManagerVM.bIsActive AndAlso Map.refFreeContourManagerVM.SelType = FreeContourManagerVM.FreeContourTypes.ONEWITHANGLES Then If Map.refFreeContourManagerVM.bIsActive AndAlso
' passo testo selezionato ( Map.refFreeContourManagerVM.SelType = FreeContourManagerVM.FreeContourTypes.ONEWITHANGLES Or
Map.refFreeContourManagerVM.bIsOpeningCurveCompo) Then
' passo entità selezionata
Map.refFreeContourManagerVM.OnMouseSelectedObj(EgtGetFirstSelectedObj(), True) Map.refFreeContourManagerVM.OnMouseSelectedObj(EgtGetFirstSelectedObj(), True)
ElseIf Map.refShowBeamPanelVM.bShowAll Then ElseIf Map.refShowBeamPanelVM.bShowAll Then
View_Part_OnMouseDownScene(sender, e) View_Part_OnMouseDownScene(sender, e)
@@ -541,6 +547,7 @@ Public Class MySceneHostVM
Map.refMachinePanelVM.SelectedMachine = Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.TempCurrProj.sMachine) Map.refMachinePanelVM.SelectedMachine = Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.TempCurrProj.sMachine)
' aggiorno le colonne in base al tipo progetto ' aggiorno le colonne in base al tipo progetto
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM) Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
Map.refProjManagerVM.CurrProj = Map.refProjManagerVM.TempCurrProj Map.refProjManagerVM.CurrProj = Map.refProjManagerVM.TempCurrProj
@@ -554,12 +561,13 @@ Public Class MySceneHostVM
End If End If
' imposto macchina del progetto ' imposto macchina del progetto
Map.refMachinePanelVM.SelectedMachine = If(Not IsNothing(Map.refProdManagerVM.TempCurrProd), Map.refMachinePanelVM.SelectedMachine = If(Not IsNothing(Map.refProdManagerVM.TempCurrProd),
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine), Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProdManagerVM.TempCurrProd.sMachine),
Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.CurrProj.sMachine)) Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refProjManagerVM.CurrProj.sMachine))
SectionXMaterial.SetType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) SectionXMaterial.SetType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
Core.ViewPanelVM.UpdateBWType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) Core.ViewPanelVM.UpdateBWType(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
' aggiorno le colonne in base al tipo progetto ' aggiorno le colonne in base al tipo progetto
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
Map.refFeatureInPartInRawPartListVM.UpdateColumns(CurrentMachine.nType)
Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM) Map.refTopPanelVM.ManageQParamsRowVisibility(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE <> BWType.BEAM)
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE) Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.BTLStructureM.nPROJTYPE)
If Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then Map.refProdManagerVM.CurrProd = Map.refProdManagerVM.TempCurrProd If Not IsNothing(Map.refProdManagerVM.TempCurrProd) Then Map.refProdManagerVM.CurrProd = Map.refProdManagerVM.TempCurrProd
@@ -34,7 +34,7 @@ Public Class ShowBeamPanelVM
End Get End Get
Set(value As Boolean) Set(value As Boolean)
m_bShowSolid = value m_bShowSolid = value
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refProjectVM.BTLStructureVM.ShowSolid() If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refProjectVM.BTLStructureVM.ShowSolid( GDB_ID.NULL, m_bShowSolid)
End Set End Set
End Property End Property
Friend Sub SetShowSolid(bValue As Boolean) Friend Sub SetShowSolid(bValue As Boolean)
@@ -164,6 +164,7 @@ Public Class ShowBeamPanelVM
' se necessario tolgo solido dal precedentemente selezionato ' se necessario tolgo solido dal precedentemente selezionato
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso m_bShowSolid Then If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso m_bShowSolid Then
Map.refShowBeamPanelVM.SetShowSolid(False) Map.refShowBeamPanelVM.SetShowSolid(False)
Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
End If End If
' nascondo barra del pezzo ' nascondo barra del pezzo
Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.NULL) Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.NULL)
@@ -403,6 +403,7 @@ Public Class TopPanelVM
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
SelMachGroup.DeleteMachGroup() SelMachGroup.DeleteMachGroup()
End If End If
EgtDraw()
' se nessun grezzo, rimetto tutti i pezzi invisibili ' se nessun grezzo, rimetto tutti i pezzi invisibili
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count = 0 Then
Map.refProjectVM.BTLStructureVM.HideAll(True) Map.refProjectVM.BTLStructureVM.HideAll(True)
@@ -39,6 +39,19 @@ Public Module CurrentMachine
Return m_OrigCorner Return m_OrigCorner
End Get End Get
End Property End Property
' Offset da origine tavola verso l'interno in X e Y
Private m_dOrigOffsX As Double = 0
Public ReadOnly Property OrigOffsX As Double
Get
Return m_dOrigOffsX
End Get
End Property
Private m_dOrigOffsY As Double = 0
Public ReadOnly Property OrigOffsY As Double
Get
Return m_dOrigOffsY
End Get
End Property
' Posizione origine del grezzo per posizionamento pezzi ' Posizione origine del grezzo per posizionamento pezzi
Private m_NestingCorner As MCH_CR Private m_NestingCorner As MCH_CR
Public ReadOnly Property NestingCorner As MCH_CR Public ReadOnly Property NestingCorner As MCH_CR
@@ -267,9 +280,13 @@ Public Module CurrentMachine
m_OrigCorner = MCH_CR.TR m_OrigCorner = MCH_CR.TR
Case "BL" Case "BL"
m_OrigCorner = MCH_CR.BL m_OrigCorner = MCH_CR.BL
Case "BR" Case Else ' "BR"
m_OrigCorner = MCH_CR.BR m_OrigCorner = MCH_CR.BR
End Select End Select
m_dOrigOffsX = 0
EgtLuaGetGlobNumVar("GWD.DELTA_X", m_dOrigOffsX)
m_dOrigOffsY = 0
EgtLuaGetGlobNumVar("GWD.DELTA_Y", m_dOrigOffsY)
EgtLuaGetGlobStringVar("GWD.NESTING_CORNER", sTemp) EgtLuaGetGlobStringVar("GWD.NESTING_CORNER", sTemp)
Select Case sTemp Select Case sTemp
Case "TL" Case "TL"
@@ -278,15 +295,17 @@ Public Module CurrentMachine
m_NestingCorner = MCH_CR.TR m_NestingCorner = MCH_CR.TR
Case "BL" Case "BL"
m_NestingCorner = MCH_CR.BL m_NestingCorner = MCH_CR.BL
Case "BR" Case Else ' "BR"
m_NestingCorner = MCH_CR.BR m_NestingCorner = MCH_CR.BR
End Select End Select
EgtLuaGetGlobNumVar("GWD.MIN_HEIGHT", m_dMinRawH) EgtLuaGetGlobNumVar("GWD.MIN_HEIGHT", m_dMinRawH)
EgtLuaGetGlobNumVar("GWD.MAX_HEIGHT", m_dMaxRawH) EgtLuaGetGlobNumVar("GWD.MAX_HEIGHT", m_dMaxRawH)
Else Else
m_nViewDir = VT.ISO_SW m_nViewDir = VT.ISO_SW
m_OrigCorner = MCH_CR.BL m_OrigCorner = MCH_CR.BR
m_NestingCorner = MCH_CR.BL m_dOrigOffsX = 0
m_dOrigOffsY = 0
m_NestingCorner = MCH_CR.BR
m_dMinRawH = 5 m_dMinRawH = 5
m_dMaxRawH = 500 m_dMaxRawH = 500
End If End If
@@ -68,6 +68,8 @@ Public Module DbControllers
DataLayer.DbConfig.CheckMigrateDb() DataLayer.DbConfig.CheckMigrateDb()
DataLayer.DbConfig.CheckUser(sUser, sPwd, m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK)) DataLayer.DbConfig.CheckUser(sUser, sPwd, m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK))
DataLayer.DbConfig.CheckViews(sUser, sPwd) DataLayer.DbConfig.CheckViews(sUser, sPwd)
' riattivare il dump per il backup
'DataLayer.DbConfig.DumpDB("C:\Program Files\MariaDB 10.5\bin\mysqldump", "c:\Temp\Pippo.sql")
If m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then If m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
' imposto cartella condivisa ' imposto cartella condivisa
GetMainPrivateProfileString(S_GENERAL, K_SHAREDFOLDER, Map.refMainWindowVM.MainWindowM.sDataDir, sSharedFolder) GetMainPrivateProfileString(S_GENERAL, K_SHAREDFOLDER, Map.refMainWindowVM.MainWindowM.sDataDir, sSharedFolder)
@@ -99,8 +99,6 @@ Module LuaExec
EgtLuaSetGlobStringVar("NEST.BASEDIR", sRoot) EgtLuaSetGlobStringVar("NEST.BASEDIR", sRoot)
EgtLuaSetGlobStringVar("NEST.FILE", sFile) EgtLuaSetGlobStringVar("NEST.FILE", sFile)
EgtLuaSetGlobStringVar("NEST.MACHINE", sMachine) EgtLuaSetGlobStringVar("NEST.MACHINE", sMachine)
'EgtLuaSetGlobNumVar("NEST.LEN", dLength)
'EgtLuaSetGlobNumVar("NEST.WIDTH", dWidth)
EgtLuaSetGlobNumVar("NEST.STARTOFFSET", dStartOffset) EgtLuaSetGlobNumVar("NEST.STARTOFFSET", dStartOffset)
EgtLuaSetGlobNumVar("NEST.OFFSET", dOffset) EgtLuaSetGlobNumVar("NEST.OFFSET", dOffset)
EgtLuaSetGlobNumVar("NEST.KERF", dKerf) EgtLuaSetGlobNumVar("NEST.KERF", dKerf)
@@ -119,7 +117,6 @@ Module LuaExec
End Select End Select
EgtLuaSetGlobNumVar("NEST.CORNER", nNestCorner) EgtLuaSetGlobNumVar("NEST.CORNER", nNestCorner)
EgtLuaSetGlobStringVar("NEST.MATERIAL", PartList(0).sMATERIAL) EgtLuaSetGlobStringVar("NEST.MATERIAL", PartList(0).sMATERIAL)
'EgtLuaSetGlobNumVar("NEST.QTY", nQty)
EgtLuaSetGlobNumVar("NEST.TIME", nNestTime) EgtLuaSetGlobNumVar("NEST.TIME", nNestTime)
EgtLuaSetGlobNumVar("NEST.PRODID", Map.refProdManagerVM.CurrProd.nProdId) EgtLuaSetGlobNumVar("NEST.PRODID", Map.refProdManagerVM.CurrProd.nProdId)
EgtLuaCreateGlobTable("PART") EgtLuaCreateGlobTable("PART")
@@ -128,19 +125,19 @@ Module LuaExec
Next Next
EgtLuaCreateGlobTable("LEN") EgtLuaCreateGlobTable("LEN")
For SectionIndex = 0 To SectionList.Count - 1 For SectionIndex = 0 To SectionList.Count - 1
EgtLuaSetGlobNumVar("LEN." & SectionIndex + 1, SectionList(SectionIndex).dL) EgtLuaSetGlobNumVar("LEN." & (SectionIndex + 1).ToString(), SectionList(SectionIndex).dL)
Next Next
EgtLuaCreateGlobTable("WIDTH") EgtLuaCreateGlobTable("WIDTH")
For SectionIndex = 0 To SectionList.Count - 1 For SectionIndex = 0 To SectionList.Count - 1
EgtLuaSetGlobNumVar("WIDTH." & SectionIndex + 1, SectionList(SectionIndex).dW) EgtLuaSetGlobNumVar("WIDTH." & (SectionIndex + 1).ToString(), SectionList(SectionIndex).dW)
Next Next
EgtLuaCreateGlobTable("QTY") EgtLuaCreateGlobTable("QTY")
For SectionIndex = 0 To SectionList.Count - 1 For SectionIndex = 0 To SectionList.Count - 1
EgtLuaSetGlobNumVar("QTY." & SectionIndex + 1, SectionList(SectionIndex).nQuantity) EgtLuaSetGlobNumVar("QTY." & (SectionIndex + 1).ToString(), SectionList(SectionIndex).nQuantity)
Next Next
EgtLuaCreateGlobTable("MATERIAL") EgtLuaCreateGlobTable("MATERIAL")
For SectionIndex = 0 To SectionList.Count - 1 For SectionIndex = 0 To SectionList.Count - 1
EgtLuaSetGlobStringVar("MATERIAL." & SectionIndex + 1, SectionList(SectionIndex).SectXMat.sSectionXMaterial) EgtLuaSetGlobStringVar("MATERIAL." & (SectionIndex + 1).ToString(), SectionList(SectionIndex).SectXMat.sSectionXMaterial)
Next Next
' Eseguo lo script ' Eseguo lo script
Dim bOk As Boolean = False Dim bOk As Boolean = False
@@ -17,7 +17,7 @@ Friend Module MachParamIniFile
' creo parametro ' creo parametro
If sMachParamParams(0) = "d" OrElse sMachParamParams(0) = "l" Then If sMachParamParams(0) = "d" OrElse sMachParamParams(0) = "l" Then
Dim dDefault As Double Dim dDefault As Double
StringToDouble(sMachParamParams(2), dDefault) StringToDoubleAdv(sMachParamParams(2), dDefault)
Dim ParamType As MachParamType Dim ParamType As MachParamType
If sMachParamParams(0) = "d" Then If sMachParamParams(0) = "d" Then
ParamType = MachParamType.DOUBLE_ ParamType = MachParamType.DOUBLE_
@@ -41,7 +41,7 @@ Public Class SectionXMaterialToBeAdded
End Get End Get
Set(value As String) Set(value As String)
Dim dTempNewW As Double Dim dTempNewW As Double
If StringToLen(value, dTempNewW) AndAlso dTempNewW > 0 Then If StringToLenAdv(value, dTempNewW, True) AndAlso dTempNewW > 0 Then
dNewW = dTempNewW dNewW = dTempNewW
Else Else
NotifyPropertyChanged(NameOf(sNewW)) NotifyPropertyChanged(NameOf(sNewW))
@@ -55,7 +55,7 @@ Public Class SectionXMaterialToBeAdded
End Get End Get
Set(value As String) Set(value As String)
Dim dTempNewL As Double Dim dTempNewL As Double
If StringToLen(value, dTempNewL) AndAlso dTempNewL > 0 Then If StringToLenAdv(value, dTempNewL, True) AndAlso dTempNewL > 0 Then
dNewL = dTempNewL dNewL = dTempNewL
Else Else
NotifyPropertyChanged(NameOf(sNewL)) NotifyPropertyChanged(NameOf(sNewL))
@@ -52,9 +52,9 @@ Module WarehouseHelper
Dim sRanges() As String = sRange.Split(","c) Dim sRanges() As String = sRange.Split(","c)
If sRanges.Count() >= 2 Then If sRanges.Count() >= 2 Then
Dim dMaxThickness As Double = 0 Dim dMaxThickness As Double = 0
StringToDouble(sRanges(1), dMaxThickness) StringToDoubleAdv(sRanges(1), dMaxThickness)
If dHeight <= dMaxThickness Then If dHeight <= dMaxThickness Then
If StringToDouble(sRanges(0), dOffset) Then Return dOffset If StringToDoubleAdv(sRanges(0), dOffset) Then Return dOffset
End If End If
End If End If
nRangeIndex += 1 nRangeIndex += 1
@@ -106,7 +106,7 @@ Module WarehouseHelper
GenInterface.GetPrivateProfileString(WRH_WALL, WRH_S & nCurrentS, "", sPanelDim, GetWarehouseIniPath()) GenInterface.GetPrivateProfileString(WRH_WALL, WRH_S & nCurrentS, "", sPanelDim, GetWarehouseIniPath())
If String.IsNullOrWhiteSpace(sPanelDim) Then Return False If String.IsNullOrWhiteSpace(sPanelDim) Then Return False
sPanelDims = sPanelDim.Split(","c) sPanelDims = sPanelDim.Split(","c)
If Not sPanelDims.Count = 2 OrElse Not StringToDouble(sPanelDims(0), dW) OrElse Not StringToDouble(sPanelDims(1), dL) Then Return False If Not sPanelDims.Count = 2 OrElse Not StringToDoubleAdv(sPanelDims(0), dW) OrElse Not StringToDoubleAdv(sPanelDims(1), dL) Then Return False
Return True Return True
End If End If
End Function End Function
@@ -128,14 +128,14 @@ Module WarehouseHelper
Select Case Type Select Case Type
Case BWType.BEAM Case BWType.BEAM
If dW = sSectionValues(0) AndAlso dH = sSectionValues(1) AndAlso Material = sSectionValues(2) Then If dW = sSectionValues(0) AndAlso dH = sSectionValues(1) AndAlso Material = sSectionValues(2) Then
If Not StringToDouble(sSectionValues(3), dL) Then Return False If Not StringToDoubleAdv(sSectionValues(3), dL) Then Return False
If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False
Return True Return True
End If End If
Case BWType.WALL Case BWType.WALL
If dH = sSectionValues(0) AndAlso Material = sSectionValues(1) Then If dH = sSectionValues(0) AndAlso Material = sSectionValues(1) Then
If Not StringToDouble(sSectionValues(2), dW) Then Return False If Not StringToDoubleAdv(sSectionValues(2), dW) Then Return False
If Not StringToDouble(sSectionValues(3), dL) Then Return False If Not StringToDoubleAdv(sSectionValues(3), dL) Then Return False
If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False
Return True Return True
End If End If
@@ -162,12 +162,12 @@ Module WarehouseHelper
Dim SectionData() As String = sSectionData.Split(","c) Dim SectionData() As String = sSectionData.Split(","c)
Select Case Type Select Case Type
Case BWType.BEAM Case BWType.BEAM
Dim dSectionW As Double = 0 : StringToDouble( SectionData(0), dSectionW) Dim dSectionW As Double = 0 : StringToDoubleAdv( SectionData(0), dSectionW)
Dim dSectionH As Double = 0 : StringToDouble( SectionData(1), dSectionH) Dim dSectionH As Double = 0 : StringToDoubleAdv( SectionData(1), dSectionH)
For Each SectionProgress In SectionList For Each SectionProgress In SectionList
If Math.Abs( SectionProgress.Section.dW - dSectionW) < 0.1 AndAlso If Math.Abs( SectionProgress.Section.dW - dSectionW) < 0.1 AndAlso
Math.Abs( SectionProgress.Section.dH - dSectionH) < 0.1 AndAlso SectionProgress.Section.sMaterial.Contains(SectionData(2)) Then Math.Abs( SectionProgress.Section.dH - dSectionH) < 0.1 AndAlso SectionProgress.Section.sMaterial.Contains(SectionData(2)) Then
If Not StringToDouble(sSectionValues(1), dL) Then Continue While If Not StringToDoubleAdv(sSectionValues(1), dL) Then Continue While
If Not Integer.TryParse(sSectionValues(2), nQty) Then Continue While If Not Integer.TryParse(sSectionValues(2), nQty) Then Continue While
If sSectionValues.Count >= 4 AndAlso Integer.TryParse(sSectionValues(3), nActive) Then If sSectionValues.Count >= 4 AndAlso Integer.TryParse(sSectionValues(3), nActive) Then
If nActive > 0 Then SectionProgress.SParamList.Add(New SParam(SectionProgress.Section, dL, nQty, nActive > 0)) If nActive > 0 Then SectionProgress.SParamList.Add(New SParam(SectionProgress.Section, dL, nQty, nActive > 0))
@@ -179,11 +179,11 @@ Module WarehouseHelper
End If End If
Next Next
Case BWType.WALL Case BWType.WALL
Dim dSectionH As Double = 0 : StringToDouble( SectionData(0), dSectionH) Dim dSectionH As Double = 0 : StringToDoubleAdv( SectionData(0), dSectionH)
For Each SectionProgress In SectionList For Each SectionProgress In SectionList
If Math.Abs( SectionProgress.Section.dH - dSectionH) < 0.1 AndAlso SectionProgress.Section.sMaterial.Contains(SectionData(1)) Then If Math.Abs( SectionProgress.Section.dH - dSectionH) < 0.1 AndAlso SectionProgress.Section.sMaterial.Contains(SectionData(1)) Then
If Not StringToDouble(sSectionValues(1), dW) Then Continue While If Not StringToDoubleAdv(sSectionValues(1), dW) Then Continue While
If Not StringToDouble(sSectionValues(2), dL) Then Continue While If Not StringToDoubleAdv(sSectionValues(2), dL) Then Continue While
If Not Integer.TryParse(sSectionValues(3), nQty) Then Continue While If Not Integer.TryParse(sSectionValues(3), nQty) Then Continue While
If Not Integer.TryParse(sSectionValues(4), nActive) Then Continue While If Not Integer.TryParse(sSectionValues(4), nActive) Then Continue While
If nActive > 0 Then SectionProgress.SParamList.Add(New SParam(SectionProgress.Section, dW, dL, nQty, nActive > 0)) If nActive > 0 Then SectionProgress.SParamList.Add(New SParam(SectionProgress.Section, dW, dL, nQty, nActive > 0))
@@ -222,14 +222,14 @@ Module WarehouseHelper
' Sectionlist.Add(New SectionXMaterial(sSectionValues(0), sSectionValues(1), sSectionValues(3), sSectionValues(2))) ' Sectionlist.Add(New SectionXMaterial(sSectionValues(0), sSectionValues(1), sSectionValues(3), sSectionValues(2)))
' End If ' End If
' If dW = sSectionValues(0) AndAlso dH = sSectionValues(1) AndAlso Material = sSectionValues(2) Then ' If dW = sSectionValues(0) AndAlso dH = sSectionValues(1) AndAlso Material = sSectionValues(2) Then
' If Not StringToDouble(sSectionValues(3), dL) Then Return False ' If Not StringToDoubleAdv(sSectionValues(3), dL) Then Return False
' If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False ' If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False
' Return True ' Return True
' End If ' End If
' Case BWType.WALL ' Case BWType.WALL
' If dH = sSectionValues(1) AndAlso Material = sSectionValues(2) Then ' If dH = sSectionValues(1) AndAlso Material = sSectionValues(2) Then
' If Not StringToDouble(sSectionValues(2), dW) Then Return False ' If Not StringToDoubleAdv(sSectionValues(2), dW) Then Return False
' If Not StringToDouble(sSectionValues(3), dL) Then Return False ' If Not StringToDoubleAdv(sSectionValues(3), dL) Then Return False
' If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False ' If Not Integer.TryParse(sSectionValues(4), nQuantity) Then Return False
' Return True ' Return True
' End If ' End If
@@ -261,8 +261,8 @@ Module WarehouseHelper
Dim dW As Double = 0 Dim dW As Double = 0
Dim dH As Double = 0 Dim dH As Double = 0
Dim sMaterial As String = sSectXMatValues(2) Dim sMaterial As String = sSectXMatValues(2)
StringToLen(sSectXMatValues(0), dW) StringToLenAdv(sSectXMatValues(0), dW)
StringToLen(sSectXMatValues(1), dH) StringToLenAdv(sSectXMatValues(1), dH)
If SectXMat.dW = dW AndAlso SectXMat.dH = dH AndAlso SectXMat.sMaterial(0) = sMaterial Then If SectXMat.dW = dW AndAlso SectXMat.dH = dH AndAlso SectXMat.sMaterial(0) = sMaterial Then
If sSectXMatValues.Length <= 3 Then Return Nothing If sSectXMatValues.Length <= 3 Then Return Nothing
Dim sValue As String = "" Dim sValue As String = ""
@@ -277,7 +277,7 @@ Module WarehouseHelper
Dim dL As Double = 0 Dim dL As Double = 0
Dim nQty As Integer = 0 Dim nQty As Integer = 0
Dim nActive As Integer = 1 Dim nActive As Integer = 1
StringToLen(sParamValues(1), dL) StringToLenAdv(sParamValues(1), dL)
If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(2), nQty) If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(2), nQty)
If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nActive) If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nActive)
Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(2)), dL, nQty, nActive > 0) Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(2)), dL, nQty, nActive > 0)
@@ -285,64 +285,42 @@ Module WarehouseHelper
End If End If
ParamIndex += 1 ParamIndex += 1
End While End While
Else
Dim ParamIndex As Integer = 1
Dim sSxMValue As String = ""
While EgtUILib.GetPrivateProfileString(S_WALL_LIST, ParamIndex, String.Empty, sSxMValue, sWarehousePath) > 0
'If EgtUILib.GetPrivateProfileString(S_BEAM, "L" & ParamIndex, String.Empty, sValue, sWarehousePath) Then Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' Dim sParamValues() As String = sValue.Split(","c) ' creo parametro
' ' verifico numero minimo di parametri Dim dH As Double = 0
' If sParamValues.Count < 2 Then Return Nothing Dim sMaterial As String = sSectXMatValues(1)
' ' cancello spazi StringToLenAdv(sSectXMatValues(0), dH)
' For Index = 0 To sParamValues.Count - 1 If SectXMat.dH = dH AndAlso SectXMat.sMaterial(0) = sMaterial Then
' sParamValues(Index) = sParamValues(Index).Trim() If sSectXMatValues.Length <= 2 Then Return Nothing
' Next Dim sValue As String = ""
' ' ricavo SectionXMaterial tramite Beam_List If EgtUILib.GetPrivateProfileString(S_WALL, "S" & sSectXMatValues(2), String.Empty, sValue, sWarehousePath) Then
' If EgtUILib.GetPrivateProfileString(S_BEAM_LIST, sParamValues(0), String.Empty, sSxMValue, sWarehousePath) Then Dim sParamValues() As String = sValue.Split(","c)
' Dim sSectXMatValues() As String = sSxMValue.Split(","c) ' verifico numero minimo di parametri
' ' creo parametro If sParamValues.Count < 3 Then Return Nothing
' Dim dW As Double = 0 ' cancello spazi
' Dim dH As Double = 0 For Index = 0 To sParamValues.Count - 1
' Dim dL As Double = 0 sParamValues(Index) = sParamValues(Index).Trim()
' Dim nQty As Integer = 0 Next
' Dim nActive As Integer = 1 Dim dW As Double = 0
' StringToLen(sSectXMatValues(0), dW) Dim dL As Double = 0
' StringToLen(sSectXMatValues(1), dH) Dim nQty As Integer = 0
' StringToLen(sParamValues(1), dL) Dim nActive As Integer = 1
' If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(2), nQty) StringToLenAdv(sParamValues(1), dW)
' If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nActive) StringToLenAdv(sParamValues(2), dL)
' Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(2)), dL, nQty, nActive > 0) If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(3), nQty)
' End If If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(4), nActive)
'End If Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(1)), dW, dL, nQty, nActive > 0)
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then End If
'If EgtUILib.GetPrivateProfileString(S_WALL, "S" & ParamIndex, String.Empty, sValue, sWarehousePath) Then End If
' Dim sParamValues() As String = sValue.Split(","c) ParamIndex += 1
' ' verifico numero minimo di parametri End While
' If sParamValues.Count >= 3 Then
' ' cancello spazi
' For Index = 0 To sParamValues.Count - 1
' sParamValues(Index) = sParamValues(Index).Trim()
' Next
' ' ricavo SectionXMaterial tramite Wall_List
' If EgtUILib.GetPrivateProfileString(S_WALL_LIST, sParamValues(0), String.Empty, sSxMValue, sWarehousePath) Then
' Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' ' creo parametro
' Dim dH As Double = 0
' Dim dW As Double = 0
' Dim dL As Double = 0
' Dim nQty As Integer = 0
' Dim nActive As Integer = 1
' StringToLen(sSectXMatValues(0), dH)
' StringToLen(sParamValues(1), dW)
' StringToLen(sParamValues(2), dL)
' If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nQty)
' If sParamValues.Count >= 5 Then Integer.TryParse(sParamValues(4), nActive)
' Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(1)), dW, dL, nQty, nActive > 0)
' End If
' End If
'End If
End If End If
Return Nothing
End Function End Function
Friend Sub SetLastMaterial(SectXMat As SectionXMaterial, SParam As SParam) Friend Sub SetLastMaterial(SectXMat As SectionXMaterial, SParam As SParam)
@@ -357,8 +335,8 @@ Module WarehouseHelper
Dim dW As Double = 0 Dim dW As Double = 0
Dim dH As Double = 0 Dim dH As Double = 0
Dim sMaterial As String = sSectXMatValues(2) Dim sMaterial As String = sSectXMatValues(2)
StringToLen(sSectXMatValues(0), dW) StringToLenAdv(sSectXMatValues(0), dW)
StringToLen(sSectXMatValues(1), dH) StringToLenAdv(sSectXMatValues(1), dH)
If SectXMat.dW = dW AndAlso SectXMat.dH = dH AndAlso SectXMat.sMaterial(0) = sMaterial Then If SectXMat.dW = dW AndAlso SectXMat.dH = dH AndAlso SectXMat.sMaterial(0) = sMaterial Then
' recupero indice di SParam ' recupero indice di SParam
Dim SParamIndex As Integer = 1 Dim SParamIndex As Integer = 1
@@ -375,7 +353,7 @@ Module WarehouseHelper
Dim nSectIndex As Integer = sParamValues(0) Dim nSectIndex As Integer = sParamValues(0)
Dim nQty As Integer = 0 Dim nQty As Integer = 0
Dim nActive As Integer = 1 Dim nActive As Integer = 1
StringToLen(sParamValues(1), dL) StringToLenAdv(sParamValues(1), dL)
If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(2), nQty) If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(2), nQty)
If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nActive) If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nActive)
Dim bActive As Boolean = nActive = 1 Dim bActive As Boolean = nActive = 1
@@ -391,7 +369,82 @@ Module WarehouseHelper
End If End If
SectIndex += 1 SectIndex += 1
End While End While
Else
' cerco sezione
Dim SectIndex As Integer = 1
Dim sSxMValue As String = ""
While EgtUILib.GetPrivateProfileString(S_WALL_LIST, SectIndex, String.Empty, sSxMValue, sWarehousePath) > 0
Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' creo parametro
Dim dH As Double = 0
Dim sMaterial As String = sSectXMatValues(1)
StringToLenAdv(sSectXMatValues(0), dH)
If SectXMat.dH = dH AndAlso SectXMat.sMaterial(0) = sMaterial Then
' recupero indice di SParam
Dim SParamIndex As Integer = 1
Dim sValue As String = ""
While EgtUILib.GetPrivateProfileString(S_WALL, "S" & SParamIndex, String.Empty, sValue, sWarehousePath)
Dim sParamValues() As String = sValue.Split(","c)
' verifico numero minimo di parametri
If sParamValues.Count < 3 Then Return
' cancello spazi
For Index = 0 To sParamValues.Count - 1
sParamValues(Index) = sParamValues(Index).Trim()
Next
Dim dW As Double = 0
Dim dL As Double = 0
Dim nSectIndex As Integer = sParamValues(0)
Dim nQty As Integer = 0
Dim nActive As Integer = 1
StringToLenAdv(sParamValues(1), dW)
StringToLenAdv(sParamValues(2), dL)
If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nQty)
If sParamValues.Count >= 5 Then Integer.TryParse(sParamValues(4), nActive)
Dim bActive As Boolean = nActive = 1
If dW = SParam.dW AndAlso dL = SParam.dL AndAlso nQty = SParam.nQuantity AndAlso bActive = SParam.bActive Then
' scrivo indice ultimo materiale
EgtUILib.WritePrivateProfileString(S_WALL_LIST, SectIndex,
LenToString(dH, 3) & "," &
sMaterial & "," &
SParamIndex, sWarehousePath)
End If
SParamIndex += 1
End While
End If
SectIndex += 1
End While
End If End If
End Sub End Sub
Friend Function GetSectIndexFromSection(Type As BWType, Section As SectionXMaterial) As Integer
Dim nIndex As Integer = 1
Dim sSectionData As String = ""
While GetPrivateProfileString(If(Type = BWType.BEAM, S_BEAM_LIST, S_WALL_LIST), nIndex, "", sSectionData, GetWarehouseIniPath()) > 0
If String.IsNullOrWhiteSpace(sSectionData) Then Continue While
Dim sSectionValues() As String = sSectionData.Split(","c)
Select Case Type
Case BWType.BEAM
Dim dW As Double = 0
Dim dH As Double = 0
Dim sMaterial As String = sSectionValues(2)
StringToLenAdv(sSectionValues(0), dW)
StringToLenAdv(sSectionValues(1), dH)
If Section.dW = dW AndAlso Section.dH = dH AndAlso Section.sMaterial(0) = sMaterial Then
' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo
Return nIndex
End If
Case BWType.WALL
Dim dH As Double = 0
Dim sMaterial As String = sSectionValues(1)
StringToLenAdv(sSectionValues(0), dH)
If Section.dH = dH AndAlso Section.sMaterial(0) = sMaterial Then
' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo
Return nIndex
End If
End Select
nIndex += 1
End While
Return -1
End Function
End Module End Module
@@ -462,9 +462,9 @@ Public Class WarehouseWndVM
Offset_Visibility = Visibility.Visible Offset_Visibility = Visibility.Visible
EgtUILib.GetPrivateProfileString(S_BEAM, K_STARTOFFSET, String.Empty, sValue, sWarehousePath) EgtUILib.GetPrivateProfileString(S_BEAM, K_STARTOFFSET, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dStartOffset) StringToLenAdv(sValue, dStartOffset)
EgtUILib.GetPrivateProfileString(S_BEAM, K_OFFSET, String.Empty, sValue, sWarehousePath) EgtUILib.GetPrivateProfileString(S_BEAM, K_OFFSET, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dOffset) StringToLenAdv(sValue, dOffset)
EgtUILib.GetPrivateProfileString(S_BEAM, K_QUANTITY, String.Empty, sValue, sWarehousePath) EgtUILib.GetPrivateProfileString(S_BEAM, K_QUANTITY, String.Empty, sValue, sWarehousePath)
Integer.TryParse(sValue, nQuantity) Integer.TryParse(sValue, nQuantity)
@@ -482,9 +482,9 @@ Public Class WarehouseWndVM
Offset_Visibility = Visibility.Visible Offset_Visibility = Visibility.Visible
EgtUILib.GetPrivateProfileString(S_WALL, K_KERF, String.Empty, sValue, sWarehousePath) EgtUILib.GetPrivateProfileString(S_WALL, K_KERF, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dKerf) StringToLenAdv(sValue, dKerf)
EgtUILib.GetPrivateProfileString(S_WALL, K_OFFSET, String.Empty, sValue, sWarehousePath) EgtUILib.GetPrivateProfileString(S_WALL, K_OFFSET, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dOffset) StringToLenAdv(sValue, dOffset)
EgtUILib.GetPrivateProfileString(S_WALL, K_QUANTITY, String.Empty, sValue, sWarehousePath) EgtUILib.GetPrivateProfileString(S_WALL, K_QUANTITY, String.Empty, sValue, sWarehousePath)
Integer.TryParse(sValue, nQuantity) Integer.TryParse(sValue, nQuantity)
@@ -511,14 +511,17 @@ Public Class WarehouseWndVM
Offset_Visibility = Visibility.Visible Offset_Visibility = Visibility.Visible
EgtUILib.GetPrivateProfileString(S_BEAM, K_STARTOFFSET, String.Empty, sValue, sWarehousePath) EgtUILib.GetPrivateProfileString(S_BEAM, K_STARTOFFSET, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dStartOffset) StringToLenAdv(sValue, dStartOffset)
EgtUILib.GetPrivateProfileString(S_BEAM, K_OFFSET, String.Empty, sValue, sWarehousePath) EgtUILib.GetPrivateProfileString(S_BEAM, K_OFFSET, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dOffset) StringToLenAdv(sValue, dOffset)
SParamList = New ObservableCollection(Of SParam) SParamList = New ObservableCollection(Of SParam)
SectionXMaterialList = New ObservableCollection(Of SectionXMaterial)(GetSectionXMaterialsFromWarehouse()) SectionXMaterialList = New ObservableCollection(Of SectionXMaterial)(GetSectionXMaterialsFromWarehouse())
While EgtUILib.GetPrivateProfileString(S_BEAM, "L" & ParamIndex, String.Empty, sValue, sWarehousePath) While EgtUILib.GetPrivateProfileString(S_BEAM, "L" & ParamIndex, String.Empty, sValue, sWarehousePath)
SParamList.Add(GetSParamFromWarehouse(ParamIndex)) Dim SParam = GetSParamFromWarehouse(ParamIndex)
If Not IsNothing(SParam) Then
SParamList.Add(SParam)
End If
ParamIndex += 1 ParamIndex += 1
End While End While
@@ -539,7 +542,7 @@ Public Class WarehouseWndVM
MediumWall_Visibility = Visibility.Visible MediumWall_Visibility = Visibility.Visible
EgtUILib.GetPrivateProfileString(S_WALL, K_KERF, String.Empty, sValue, sWarehousePath) EgtUILib.GetPrivateProfileString(S_WALL, K_KERF, String.Empty, sValue, sWarehousePath)
StringToLen(sValue, dKerf) StringToLenAdv(sValue, dKerf)
' carico la lista degli Spessori Min/Max e Offset compresi tra di essi ' carico la lista degli Spessori Min/Max e Offset compresi tra di essi
While EgtUILib.GetPrivateProfileString(S_WALL, K_RANGE & ParamIndex, String.Empty, sValue, sWarehousePath) While EgtUILib.GetPrivateProfileString(S_WALL, K_RANGE & ParamIndex, String.Empty, sValue, sWarehousePath)
@@ -679,21 +682,32 @@ Public Class WarehouseWndVM
Dim sL As String = String.Empty Dim sL As String = String.Empty
sL = LenToString(SParamList(ParamIndex - 1).dL, 3) sL = LenToString(SParamList(ParamIndex - 1).dL, 3)
' ricavo l'indice del SecionXMaterial dalla Beam_List
Dim SectXMatIndex As Integer = 1
Dim sSxMValue As String = ""
While EgtUILib.GetPrivateProfileString(S_BEAM_LIST, SectXMatIndex, String.Empty, sSxMValue, sWarehousePath)
If sSxMValue = SParamList(ParamIndex - 1).sValue Then
' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo
Exit While
End If
SectXMatIndex += 1
End While
WritePrivateProfileString(S_BEAM, K_L & ParamIndex, ' ricavo l'indice del SecionXMaterial dalla Beam_List
Dim SectXMatIndex As Integer = GetSectIndexFromSection(MachineType.BEAM, SParamList(ParamIndex - 1).SectXMat)
'Dim sSxMValue As String = ""
'While EgtUILib.GetPrivateProfileString(S_BEAM_LIST, SectXMatIndex, String.Empty, sSxMValue, sWarehousePath)
' Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' ' creo parametro
' Dim dW As Double = 0
' Dim dH As Double = 0
' Dim sMaterial As String = sSectXMatValues(2)
' StringToLenAdv(sSectXMatValues(0), dW)
' StringToLenAdv(sSectXMatValues(1), dH)
' If SParamList(ParamIndex - 1).SectXMat.dW = dW AndAlso SParamList(ParamIndex - 1).SectXMat.dH = dH AndAlso SParamList(ParamIndex - 1).SectXMat.sMaterial(0) = sMaterial Then
' ' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo
' Exit While
' End If
' SectXMatIndex += 1
'End While
If SectXMatIndex > 0 Then
WritePrivateProfileString(S_BEAM, K_L & ParamIndex,
SectXMatIndex & "," & sL & "," & SParamList(ParamIndex - 1).nQuantity & "," & If(SParamList(ParamIndex - 1).bActive, 1, 0), SectXMatIndex & "," & sL & "," & SParamList(ParamIndex - 1).nQuantity & "," & If(SParamList(ParamIndex - 1).bActive, 1, 0),
sWarehousePath) sWarehousePath)
ParamIndex += 1 ParamIndex += 1
Else
EgtOutLog("Error in material creation, section not found!")
End If
Next Next
' Se ci sono parametri da rimuovere li rimuovo ' Se ci sono parametri da rimuovere li rimuovo
For Index = ParamIndex To ParamIndex + m_RemovedParamsCount For Index = ParamIndex To ParamIndex + m_RemovedParamsCount
@@ -735,20 +749,23 @@ Public Class WarehouseWndVM
sL = LenToString(SParamList(ParamIndex - 1).dL, 3) sL = LenToString(SParamList(ParamIndex - 1).dL, 3)
' ricavo l'indice del SecionXMaterial dalla Wall_List ' ricavo l'indice del SecionXMaterial dalla Wall_List
Dim SectXMatIndex As Integer = 1 Dim SectXMatIndex As Integer = GetSectIndexFromSection(MachineType.WALL, SParamList(ParamIndex - 1).SectXMat)
Dim sSxMValue As String = "" 'Dim sSxMValue As String = ""
While EgtUILib.GetPrivateProfileString(S_WALL_LIST, SectXMatIndex, String.Empty, sSxMValue, sWarehousePath) 'While EgtUILib.GetPrivateProfileString(S_WALL_LIST, SectXMatIndex, String.Empty, sSxMValue, sWarehousePath)
If sSxMValue = SParamList(ParamIndex - 1).sValue Then ' If sSxMValue = SParamList(ParamIndex - 1).sValue Then
' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo ' ' se l'ho trovato esco dal while, il SectXMatIndex è l'indice che cercavamo
Exit While ' Exit While
End If ' End If
SectXMatIndex += 1 ' SectXMatIndex += 1
End While 'End While
If SectXMatIndex > 0 Then
WritePrivateProfileString(S_WALL, K_S & ParamIndex, WritePrivateProfileString(S_WALL, K_S & ParamIndex,
SectXMatIndex & "," & sW & "," & sL & "," & SParamList(ParamIndex - 1).nQuantity & "," & If(SParamList(ParamIndex - 1).bActive, 1, 0), SectXMatIndex & "," & sW & "," & sL & "," & SParamList(ParamIndex - 1).nQuantity & "," & If(SParamList(ParamIndex - 1).bActive, 1, 0),
sWarehousePath) sWarehousePath)
ParamIndex += 1 ParamIndex += 1
Else
EgtOutLog("Error in material creation, section not found!")
End If
Next Next
' Se ci sono parametri da rimuovere li rimuovo ' Se ci sono parametri da rimuovere li rimuovo
For Index = ParamIndex To ParamIndex + m_RemovedParamsCount For Index = ParamIndex To ParamIndex + m_RemovedParamsCount
@@ -822,7 +839,7 @@ Public Class WarehouseWndVM
Dim dLValue As Double = 0 Dim dLValue As Double = 0
Select Case Map.refProjectVM.BTLStructureVM.nPROJTYPE Select Case Map.refProjectVM.BTLStructureVM.nPROJTYPE
Case MachineType.BEAM Case MachineType.BEAM
If Not IsNothing(sNewL) Then StringToLen(sNewL, dLValue) If Not IsNothing(sNewL) Then StringToLenAdv(sNewL, dLValue, True)
If dLValue > 0 Then If dLValue > 0 Then
' controllo il valore immesso non sia già presente ' controllo il valore immesso non sia già presente
Dim bExist As Boolean = False Dim bExist As Boolean = False
@@ -843,8 +860,8 @@ Public Class WarehouseWndVM
MessageBox.Show(IncorrectValue_Msg, Error_Msg) MessageBox.Show(IncorrectValue_Msg, Error_Msg)
End If End If
Case MachineType.WALL Case MachineType.WALL
If Not IsNothing(sNewW) Then StringToLen(sNewW, dWValue) If Not IsNothing(sNewW) Then StringToLenAdv(sNewW, dWValue, True)
If Not IsNothing(sNewL) Then StringToLen(sNewL, dLValue) If Not IsNothing(sNewL) Then StringToLenAdv(sNewL, dLValue, True)
If dWValue > 0 AndAlso dLValue > 0 Then If dWValue > 0 AndAlso dLValue > 0 Then
' controllo che la coppia di valori immessa non sia già presente ' controllo che la coppia di valori immessa non sia già presente
Dim bExist As Boolean = False Dim bExist As Boolean = False
@@ -1082,8 +1099,8 @@ Public Class WarehouseWndVM
' creo parametro ' creo parametro
Dim dW As Double = 0 Dim dW As Double = 0
Dim dH As Double = 0 Dim dH As Double = 0
StringToLen(sSectXMatValues(0), dW) StringToLenAdv(sSectXMatValues(0), dW)
StringToLen(sSectXMatValues(1), dH) StringToLenAdv(sSectXMatValues(1), dH)
If Not SectXMatList.Any(Function(x) x.dW = dW AndAlso x.dH = dH AndAlso x.sMaterial(0) = sSectXMatValues(2)) Then If Not SectXMatList.Any(Function(x) x.dW = dW AndAlso x.dH = dH AndAlso x.sMaterial(0) = sSectXMatValues(2)) Then
SectXMatList.Add(New SectionXMaterial(dW, dH, 0, sSectXMatValues(2))) SectXMatList.Add(New SectionXMaterial(dW, dH, 0, sSectXMatValues(2)))
End If End If
@@ -1097,8 +1114,10 @@ Public Class WarehouseWndVM
Dim sSectXMatValues() As String = sSxMValue.Split(","c) Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' creo parametro ' creo parametro
Dim dH As Double = 0 Dim dH As Double = 0
StringToLen(sSectXMatValues(0), dH) StringToLenAdv(sSectXMatValues(0), dH)
SectXMatList.Add(New SectionXMaterial(0, dH, 0, sSectXMatValues(1))) If Not SectXMatList.Any(Function(x) x.dH = dH AndAlso x.sMaterial(0) = sSectXMatValues(1)) Then
SectXMatList.Add(New SectionXMaterial(0, dH, 0, sSectXMatValues(1)))
End If
sSectXMatIndex += 1 sSectXMatIndex += 1
End While End While
End If End If
@@ -1119,8 +1138,8 @@ Public Class WarehouseWndVM
' creo parametro ' creo parametro
Dim dW As Double = 0 Dim dW As Double = 0
Dim dH As Double = 0 Dim dH As Double = 0
StringToLen(sSectXMatValues(0), dW) StringToLenAdv(sSectXMatValues(0), dW)
StringToLen(sSectXMatValues(1), dH) StringToLenAdv(sSectXMatValues(1), dH)
Dim ReadSection As New SectionXMaterial(dW, dH, 0, sSectXMatValues(2)) Dim ReadSection As New SectionXMaterial(dW, dH, 0, sSectXMatValues(2))
If ReadSection = SectionXMaterial Then Return False If ReadSection = SectionXMaterial Then Return False
sSectXMatIndex += 1 sSectXMatIndex += 1
@@ -1134,7 +1153,7 @@ Public Class WarehouseWndVM
Dim sSectXMatValues() As String = sSxMValue.Split(","c) Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' creo parametro ' creo parametro
Dim dH As Double = 0 Dim dH As Double = 0
StringToLen(sSectXMatValues(0), dH) StringToLenAdv(sSectXMatValues(0), dH)
Dim ReadSection As New SectionXMaterial(0, dH, 0, sSectXMatValues(1)) Dim ReadSection As New SectionXMaterial(0, dH, 0, sSectXMatValues(1))
If ReadSection = SectionXMaterial Then Return False If ReadSection = SectionXMaterial Then Return False
sSectXMatIndex += 1 sSectXMatIndex += 1
@@ -1156,7 +1175,7 @@ Public Class WarehouseWndVM
Dim sWarehousePath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_BASIC_INI_FILE_NAME Dim sWarehousePath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_BASIC_INI_FILE_NAME
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
If EgtUILib.GetPrivateProfileString(S_BEAM, "L" & ParamIndex, String.Empty, sValue, sWarehousePath) Then If EgtUILib.GetPrivateProfileString(S_BEAM, "L" & ParamIndex, String.Empty, sValue, sWarehousePath) Then
StringToLen(sValue, dValue) StringToLenAdv(sValue, dValue)
Return New SParam(dValue) Return New SParam(dValue)
End If End If
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
@@ -1171,8 +1190,8 @@ Public Class WarehouseWndVM
' creo parametro ' creo parametro
Dim dW As Double = 0 Dim dW As Double = 0
Dim dL As Double = 0 Dim dL As Double = 0
StringToLen(sParamValues(0), dW) StringToLenAdv(sParamValues(0), dW)
StringToLen(sParamValues(1), dL) StringToLenAdv(sParamValues(1), dL)
Return New SParam(dW, dL) Return New SParam(dW, dL)
End If End If
End If End If
@@ -1197,9 +1216,9 @@ Public Class WarehouseWndVM
Dim dL As Double = 0 Dim dL As Double = 0
Dim nQty As Integer = 0 Dim nQty As Integer = 0
Dim nActive As Integer = 1 Dim nActive As Integer = 1
StringToLen(sSectXMatValues(0), dW) StringToLenAdv(sSectXMatValues(0), dW)
StringToLen(sSectXMatValues(1), dH) StringToLenAdv(sSectXMatValues(1), dH)
StringToLen(sParamValues(1), dL) StringToLenAdv(sParamValues(1), dL)
If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(2), nQty) If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(2), nQty)
If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nActive) If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nActive)
Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(2)), dL, nQty, nActive > 0) Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(2)), dL, nQty, nActive > 0)
@@ -1224,9 +1243,9 @@ Public Class WarehouseWndVM
Dim dL As Double = 0 Dim dL As Double = 0
Dim nQty As Integer = 0 Dim nQty As Integer = 0
Dim nActive As Integer = 1 Dim nActive As Integer = 1
StringToLen(sSectXMatValues(0), dH) StringToLenAdv(sSectXMatValues(0), dH)
StringToLen(sParamValues(1), dW) StringToLenAdv(sParamValues(1), dW)
StringToLen(sParamValues(2), dL) StringToLenAdv(sParamValues(2), dL)
If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nQty) If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nQty)
If sParamValues.Count >= 5 Then Integer.TryParse(sParamValues(4), nActive) If sParamValues.Count >= 5 Then Integer.TryParse(sParamValues(4), nActive)
Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(1)), dW, dL, nQty, nActive > 0) Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(1)), dW, dL, nQty, nActive > 0)
@@ -1265,8 +1284,8 @@ Public Class WarehouseWndVM
' creo parametro ' creo parametro
Dim dOffset As Double = 0 Dim dOffset As Double = 0
Dim dMaxThickness As Double = 0 Dim dMaxThickness As Double = 0
StringToLen(sParamValues(0), dOffset) StringToLenAdv(sParamValues(0), dOffset)
StringToLen(sParamValues(1), dMaxThickness) StringToLenAdv(sParamValues(1), dMaxThickness)
Return New WhWallParam(dOffset, dMaxThickness) Return New WhWallParam(dOffset, dMaxThickness)
End If End If
End If End If

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