Compare commits

...

143 Commits

Author SHA1 Message Date
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
Emmanuele Sassi 96dd92c3d3 - aggiunta pausa di rilettura variabile programma inviato su cn Axium 2022-12-07 09:45:31 +01:00
Emmanuele Sassi ebc41183bc - correzione lettura dimensioni se bottone assemblato premuto ma progetto in stato non assemblato per esecuzione calcoli 2022-12-07 09:44:45 +01:00
Emmanuele Sassi feb7982bef - Modifica icone 2022-12-07 09:43:18 +01:00
Emmanuele Sassi f241b72453 - Aggiunta gestione ultimo grezzo utilizzato
- Migliorata gestione bottone cancella tutti
2022-12-06 18:30:20 +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 848b6d98a5 - correzione creazione pezzi durante creazione grezzi 2022-11-25 15:02:09 +01:00
Emmanuele Sassi 0589565b8e Merge branch 'AddBeamPosZ' into RawPartLastCreation 2022-11-25 14:46:19 +01:00
Emmanuele Sassi 1109a91dd9 - Aggiunta colonna PosZ per Wall su Gruppo di lavorazione 2022-11-25 13:33:23 +01:00
DarioS 37cb1dbb6a EgtBEAMWALL 2.4k3 :
- correzione gestione spessori per nesting manuale pareti (ora si usano sempre operatori di SectionXMaterial).
2022-11-25 08:04:27 +01:00
Emmanuele Sassi 152788fe1b - modifiche per aggiunta grezzo durante definizione se non definito
- WIP modifiche per salvataggio ultimo usato per sezione
2022-11-24 16:30:56 +01:00
Emmanuele Sassi 534b363a04 Merge branch 'master' of https://gitlab.steamware.net/egaltech/egtbeamwall 2022-11-21 18:33:26 +01:00
DarioS 3f13706b97 EgtBEAMWALL 2.4k2 :
- ricompilazione di tutto con cambio versione.
2022-11-21 12:48:29 +01:00
Emmanuele Sassi 1f804ab6fc Merge branch 'develop' 2022-11-21 11:12:27 +01:00
Emmanuele Sassi 21dd6fbbb1 Merge branch 'RawPartCreation' 2022-11-18 14:15:41 +01:00
Emmanuele Sassi da73acc8a0 - Aggiunti tooltip su statistiche ed ultimi bottoni aggiunti
- Aggiunto bottone cancella tutti i grezzi
2022-11-18 14:15:11 +01:00
Emmanuele Sassi f9825db2ac - Modificata creazione grezzi con due bottoni 2022-11-18 11:44:38 +01:00
Emmanuele Sassi a3ea3bd1eb - Correzione problema check su cambio parametri
- Correzione indentazione DbController ViewerOptimizer
- Aggiornamento DbControllers Supervisor per gestione corretta network
-
2022-11-18 10:30:41 +01:00
DarioS 805a3acf54 EgtBEAMWALL :
- corretta gestione licenza con opzione rete abilitata quando si vuole lavorare con DB locale.
2022-11-08 19:13:10 +01:00
DarioS f21f2a6422 EgtBEAMWALL 2.4k1 :
- modifiche per visualizzazione numeri facce
- modifiche per visualizzazione lato di carico per travi.
2022-11-08 16:45:08 +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
Emmanuele Sassi 50d9603598 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-10-06 11:59:19 +02:00
Samuele Locatelli fae8018df9 Merge branch 'DataLayer' into develop 2022-09-19 19:41:46 +02:00
Samuele Locatelli 3b2715ee58 Merge branch 'DataLayer' 2022-09-19 19:41:37 +02:00
Samuele Locatelli d7c8e8e21d Gestione viste ext:
- aggiunto drop utente x RO
- fix solo 1 vistsa permessa
2022-09-19 19:41:18 +02:00
Samuele Locatelli 9d11e6e9ca Update chiamate da vb x avvio sw 2022-09-19 17:42:25 +02:00
Samuele Locatelli 8d90714a82 DB view readonly:
- Update x nuovo metodo creazione view
- check utente readonly + grant
2022-09-19 17:42:10 +02:00
Samuele Locatelli 429d7f58e4 Merge remote-tracking branch 'origin/master' into DataLayer 2022-09-19 12:36:55 +02:00
Emmanuele Sassi 7e15ef9dd1 Merge remote-tracking branch 'gitlab.seriate/master' into develop 2022-09-02 11:23:42 +02:00
DarioS 6060746412 EgtBEAMWALL 2.4h2 :
- sistemato nome file di log per calcolo grezzo in tutti i casi
- aggiunta ridisegna dopo ricalcolo grezzo.
2022-09-01 09:20:59 +02:00
Emmanuele Sassi 2b4f3d93dc Merge remote-tracking branch 'gitlab.seriate/master' into develop 2022-08-25 21:06:11 +02:00
DarioS f365c7a593 EgtBEAMWALL :
- correzione per modifica Outline e Aperture (riconoscimento chiusura automatica).
2022-08-25 21:03:34 +02:00
DarioS fc797ff4a7 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall 2022-08-25 19:53:37 +02:00
Emmanuele Sassi 63b1f1532a - lettura da messaggi descrizione input ed output
- ampliamento spazio variabili da leggere
- correzione lettura log su selezione pagina
- aggiunte immaginin su parametri Q
2022-08-25 18:10:56 +02:00
DarioS b861c647fc EgtBEAMWALL 2.4h1 :
- sistemato AboutBox di Supervisor (grazie a app.manifest) come ViewerOptimizer
- aggiunti Tooltip a >> e << dove mancanti.
2022-08-18 10:11:04 +02:00
DarioS fa7d95cc53 EgtBEAMWALL :
- aggiunto app.manifest non inserito nel commit precedente.
2022-08-11 20:40:41 +02:00
DarioS cdb0414097 EgtBEAMWALL :
- sistemato aggiornamento disegno esplicativo parametro al cambio di gruppo della Feature
- aggiunto app.manifest per riconoscere correttamente il sistema operativo
- aggiunta ad AboutBox delle info sul sistema operativo.
2022-08-11 20:39:45 +02:00
Emmanuele Sassi 48ac0a878f - reso visibile a tutti bottone freecontour 2022-08-03 12:51:04 +02:00
Emmanuele Sassi 804992e485 - reso visibile a tutti bottone modifica freecontour 2022-08-03 12:50:34 +02:00
Emmanuele Sassi 4ef9497514 - Aggiornata versione a 2.4g5 2022-08-03 12:00:07 +02:00
Emmanuele Sassi 3c939a9e5b - aggiunta lettura vaolre di default feature testo 2022-08-03 11:39:24 +02:00
Emmanuele Sassi aaddb6897f - correzione visibilita' bottone edit freecontour 2022-08-03 10:02:23 +02:00
Emmanuele Sassi b0db630d56 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into develop 2022-08-03 09:59:21 +02:00
Emmanuele Sassi e608fd3a52 - Introdotta multiselezione per creazione nuova barra ed aggiunta a barra 2022-08-03 09:57:25 +02:00
Emmanuele Sassi 573cc1478a - corretto errore in rotazione multipezzo con assemblato attivo
- Aggiunti eventi inizio fine pezzo su comandi manuali
- aggiunti filtri in log macchina
2022-08-02 12:19:59 +02:00
DarioS 25d7516c7a EgtBEAMWALL 2.4g4 :
- ricompilazione con cambio versione
- modifiche per eliminare alcuni crash
- modifiche per eliminare i warning.
2022-08-01 17:08:40 +02:00
DarioS 8ac3c4879b EgtBEAMWALL :
- aggiunto controllo in salvataggio dati macchina.
2022-07-27 15:42:48 +02:00
DarioS b551120fcc EgtBEAMWALL
- sistemazione lancio simulazione in Supervisore
- sistemazione AboutBox in ViewerOptimizer
- sistemazione info programma in Supervisore
- eliminato file di costanti duplicato in ViewerOptimizer.
2022-07-25 10:49:56 +02:00
DarioS b1846bb804 EgtBEAMWALL :
- piccole modifiche ad AboutBox di ViewerOptimizer.
2022-07-24 19:56:03 +02:00
DarioS 399a1f466f EgtBeamWall :
- cambio a versione 2.4g3.
2022-07-24 16:36:06 +02:00
DarioS c1ca70adce Merge branch 'master' of https://gitlab.steamware.net/egaltech/egtbeamwall into develop 2022-07-24 16:34:50 +02:00
Emmanuele Sassi 364520f9a3 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-07-23 11:27:59 +02:00
Emmanuele Sassi c0bfe75fd7 - Correzione scrittura variabili V 2022-07-23 11:27:11 +02:00
DarioS 1d9618d797 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into develop 2022-07-22 08:31:33 +02:00
Emmanuele Sassi 1ac9f823a4 - Aggiornato numero di versione 2022-07-22 08:30:21 +02:00
DarioS 73950690ff Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into develop 2022-07-22 08:27:58 +02:00
Emmanuele Sassi 2bc79ad2de - Aggiunto cutid e taskid a barra di ripartenza
- Modifiche per log eventi nuovo
- Introdotta gestione cartelle con numero chiave in supervisore
- Aggiunta opzione AnyDb in supervisore
2022-07-22 08:03:32 +02:00
Samuele Locatelli 9ad45b9ea4 Merge branch 'develop' into DataLayer 2022-07-21 10:00:33 +02:00
Samuele Locatelli 89cb9e06f1 Refresh config setup in app.config 2022-07-21 10:00:20 +02:00
DarioS 3b77f647a6 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into develop 2022-07-21 07:08:09 +02:00
Samuele Locatelli 71c5b20782 Refresh configurazioni x EF6 2022-07-20 10:27:49 +02:00
Samuele Locatelli 08ac48d16e Merge branch 'DataLayer' into develop 2022-07-20 09:57:50 +02:00
Samuele Locatelli 90ac144f2a ancora cleanup EF6 2022-07-20 09:57:42 +02:00
Samuele Locatelli f5b98f803c Tolti riferimenti EF6 2022-07-20 09:57:36 +02:00
Samuele Locatelli 8f05ef25f6 Merge branch 'develop' into DataLayer 2022-07-20 09:43:51 +02:00
Samuele Locatelli 0022aacbd3 MySql EF:
- fix riferimenti 8.0.29 --> 8.0.21
2022-07-20 09:43:35 +02:00
Emmanuele Sassi ba64c8e231 Merge branch 'Selection&Highlight' into develop 2022-07-19 17:27:35 +02:00
DarioS 431c30935c Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into develop 2022-07-19 16:53:18 +02:00
Emmanuele Sassi 47d0fef508 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into Selection&Highlight 2022-07-19 16:43:25 +02:00
Emmanuele Sassi 6decc2f690 Merge branch 'Selection&Highlight' into develop 2022-07-19 16:42:31 +02:00
Emmanuele Sassi 2bbd407019 - Correzione in assenza di macchine 2022-07-19 16:42:10 +02:00
Samuele Locatelli abc2c4fe07 Merge branch 'TestOracleMysql' into DataLayer 2022-07-19 16:40:29 +02:00
DarioS 402e17b57d Merge branch 'Selection&Highlight' of https://gitlab.steamware.net/egaltech/egtbeamwall into develop 2022-07-13 18:20:22 +02:00
Samuele Locatelli 08ae91e412 Merge branch 'develop' 2022-05-10 10:20:32 +02:00
186 changed files with 4162 additions and 14159 deletions
+15 -2
View File
@@ -90,6 +90,16 @@ Public Class BTLFeatureM
End Set
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
Protected m_sName As String
Public ReadOnly Property sName As String
@@ -244,10 +254,11 @@ Public Class BTLFeatureM
Dim NewBTLFeature As New BTLFeatureM
NewBTLFeature.m_ParentPart = ParentPart
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_PRC, NewBTLFeature.m_nPRC)
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.m_nSelSIDE)
EgtGetInfo(nFeatureId, BTL_FTR_PRIORITY, NewBTLFeature.m_nPRIORITY)
Dim nDO As Integer = 1
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
NewBTLFeature.m_bDO = (nDO <> 0)
@@ -309,6 +320,7 @@ Public Class BTLFeatureM
NewBTLFeature.m_nPRC = nPRC
NewBTLFeature.m_nSelGRP = nGRP
NewBTLFeature.m_nSelSIDE = nSIDE
NewBTLFeature.m_nPriority = 0
NewBTLFeature.m_bDO = True
' crea parametri per questa feature da file ini
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
@@ -467,7 +479,7 @@ Public Class BTLFeatureM
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
Param.SetValue(Param.dDefault)
ElseIf Param.nType = BTLParamType.STRING_ Then
Param.SetValue("")
Param.SetValue(Param.sDefault)
ElseIf Param.nType = BTLParamType.COMBO Then
Param.nSelValue = Param.dDefault
End If
@@ -533,6 +545,7 @@ Public Class BTLFeatureM
For Each QPar In QBTLParamMList
If QPar.bCustom Then EgtSetInfo(nFeatureId, QPar.sName & "A", 1)
Next
EgtSetInfo( nFeatureId, BTL_FTR_PRIORITY, nPriority)
SetFeatureId(nFeatureId)
' imposto modificato per copie
EgtDuploSetModified(ParentPart.nPartId)
+17 -2
View File
@@ -129,6 +129,16 @@ Public Class BTLParamM
End Set
End Property
Protected m_sDefault As String
Public Property sDefault As String
Get
Return m_sDefault
End Get
Set(value As String)
m_sDefault = value
End Set
End Property
' tipo della variabile
Protected m_nType As BTLParamType
Public ReadOnly Property nType As BTLParamType
@@ -136,6 +146,9 @@ Public Class BTLParamM
Return m_nType
End Get
End Property
Public Sub SetType(value As BTLParamType)
m_nType = value
End Sub
' Feature a cui appartiene il parametro
Protected m_ParentFeature As BTLFeatureM
@@ -245,16 +258,18 @@ Public Class BTLParamM
End Function
' new per stringhe
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String)
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDefault As String, sDescription As String)
Dim NewBTLParam As New BTLParamM
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
NewBTLParam.m_sDefault = sDefault
Return NewBTLParam
End Function
' new per stringhe (con tipo Beam o Wall)
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDescription As String, sBWType As String)
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, sDefault As String, sDescription As String, sBWType As String)
Dim NewBTLParam As New BTLParamM
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
NewBTLParam.m_sDefault = sDefault
NewBTLParam.m_sBWType = sBWType
Return NewBTLParam
End Function
+42 -42
View File
@@ -797,15 +797,15 @@ Public Class BTLPartM
Dim vtVersY As New Vector3d
sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 9 Then
StringToLen(sValArray(0), ptOri.x)
StringToLen(sValArray(1), ptOri.y)
StringToLen(sValArray(2), ptOri.z)
StringToDouble(sValArray(3), vtVersX.x)
StringToDouble(sValArray(4), vtVersX.y)
StringToDouble(sValArray(5), vtVersX.z)
StringToDouble(sValArray(6), vtVersY.x)
StringToDouble(sValArray(7), vtVersY.y)
StringToDouble(sValArray(8), vtVersY.z)
StringToLenAdv(sValArray(0), ptOri.x)
StringToLenAdv(sValArray(1), ptOri.y)
StringToLenAdv(sValArray(2), ptOri.z)
StringToDoubleAdv(sValArray(3), vtVersX.x)
StringToDoubleAdv(sValArray(4), vtVersX.y)
StringToDoubleAdv(sValArray(5), vtVersX.z)
StringToDoubleAdv(sValArray(6), vtVersY.x)
StringToDoubleAdv(sValArray(7), vtVersY.y)
StringToDoubleAdv(sValArray(8), vtVersY.z)
NewBTLPart.m_refTransf.ChangeOrigin(ptOri)
NewBTLPart.m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
End If
@@ -815,10 +815,10 @@ Public Class BTLPartM
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 10 Then
StringToLen(sValArray(3), NewBTLPart.m_dCamberLen1)
StringToLen(sValArray(5), NewBTLPart.m_dCamberLen2)
StringToLen(sValArray(7), NewBTLPart.m_dCamberLen3)
StringToLen(sValArray(9), NewBTLPart.m_dCamberCross3)
StringToLenAdv(sValArray(3), NewBTLPart.m_dCamberLen1)
StringToLenAdv(sValArray(5), NewBTLPart.m_dCamberLen2)
StringToLenAdv(sValArray(7), NewBTLPart.m_dCamberLen3)
StringToLenAdv(sValArray(9), NewBTLPart.m_dCamberCross3)
End If
Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
Dim pTo As Integer = sValue.LastIndexOf(" P01")
@@ -830,10 +830,10 @@ Public Class BTLPartM
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 10 Then
StringToLen(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
StringToLen(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
StringToLen(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
StringToLen(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
StringToLenAdv(sValArray(3), NewBTLPart.m_dPartOffsetSide1)
StringToLenAdv(sValArray(5), NewBTLPart.m_dPartOffsetSide2)
StringToLenAdv(sValArray(7), NewBTLPart.m_dPartOffsetSide3)
StringToLenAdv(sValArray(9), NewBTLPart.m_dPartOffsetSide4)
End If
pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
pTo = sValue.LastIndexOf(" P11")
@@ -883,9 +883,9 @@ Public Class BTLPartM
NewBTLPart.m_refGrainDir = New Vector3d
sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 4 Then
StringToDouble(sValArray(0), NewBTLPart.m_refGrainDir.x)
StringToDouble(sValArray(1), NewBTLPart.m_refGrainDir.y)
StringToDouble(sValArray(2), NewBTLPart.m_refGrainDir.z)
StringToDoubleAdv(sValArray(0), NewBTLPart.m_refGrainDir.x)
StringToDoubleAdv(sValArray(1), NewBTLPart.m_refGrainDir.y)
StringToDoubleAdv(sValArray(2), NewBTLPart.m_refGrainDir.z)
NewBTLPart.m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
End If
@@ -1044,15 +1044,15 @@ Public Class BTLPartM
' Dim vtVersY As New Vector3d
' sValArray = sValue.Split({","}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 9 Then
' StringToLen(sValArray(0), ptOri.x)
' StringToLen(sValArray(1), ptOri.y)
' StringToLen(sValArray(2), ptOri.z)
' StringToDouble(sValArray(3), vtVersX.x)
' StringToDouble(sValArray(4), vtVersX.y)
' StringToDouble(sValArray(5), vtVersX.z)
' StringToDouble(sValArray(6), vtVersY.x)
' StringToDouble(sValArray(7), vtVersY.y)
' StringToDouble(sValArray(8), vtVersY.z)
' StringToLenAdv(sValArray(0), ptOri.x)
' StringToLenAdv(sValArray(1), ptOri.y)
' StringToLenAdv(sValArray(2), ptOri.z)
' StringToDoubleAdv(sValArray(3), vtVersX.x)
' StringToDoubleAdv(sValArray(4), vtVersX.y)
' StringToDoubleAdv(sValArray(5), vtVersX.z)
' StringToDoubleAdv(sValArray(6), vtVersY.x)
' StringToDoubleAdv(sValArray(7), vtVersY.y)
' StringToDoubleAdv(sValArray(8), vtVersY.z)
' m_refTransf.ChangeOrigin(ptOri)
' m_refTransf.Setup(ptOri, ptOri + vtVersX, ptOri + vtVersY)
' End If
@@ -1063,10 +1063,10 @@ Public Class BTLPartM
' EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 5 Then
' StringToLen(sValArray(3), m_dCamberLen1)
' StringToLen(sValArray(5), m_dCamberLen2)
' StringToLen(sValArray(7), m_dCamberLen3)
' StringToLen(sValArray(9), m_dCamberCross3)
' StringToLenAdv(sValArray(3), m_dCamberLen1)
' StringToLenAdv(sValArray(5), m_dCamberLen2)
' StringToLenAdv(sValArray(7), m_dCamberLen3)
' StringToLenAdv(sValArray(9), m_dCamberCross3)
' End If
' Dim pFrom As Integer = sValue.IndexOf("SIDE: ") + "SIDE: ".Length
' Dim pTo As Integer = sValue.LastIndexOf(" P01")
@@ -1078,10 +1078,10 @@ Public Class BTLPartM
' EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
' sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 5 Then
' StringToLen(sValArray(3), m_dPartOffsetSide1)
' StringToLen(sValArray(5), m_dPartOffsetSide2)
' StringToLen(sValArray(7), m_dPartOffsetSide3)
' StringToLen(sValArray(9), m_dPartOffsetSide4)
' StringToLenAdv(sValArray(3), m_dPartOffsetSide1)
' StringToLenAdv(sValArray(5), m_dPartOffsetSide2)
' StringToLenAdv(sValArray(7), m_dPartOffsetSide3)
' StringToLenAdv(sValArray(9), m_dPartOffsetSide4)
' End If
' pFrom = sValue.IndexOf("P04: ") + "P04: ".Length
' pTo = sValue.LastIndexOf(" P11")
@@ -1105,9 +1105,9 @@ Public Class BTLPartM
' m_refGrainDir = New Vector3d
' sValArray = sValue.Split(New String() {",", ";"}, StringSplitOptions.RemoveEmptyEntries)
' If sValArray.Count() >= 4 Then
' StringToDouble(sValArray(0), m_refGrainDir.x)
' StringToDouble(sValArray(1), m_refGrainDir.y)
' StringToDouble(sValArray(2), m_refGrainDir.z)
' StringToDoubleAdv(sValArray(0), m_refGrainDir.x)
' StringToDoubleAdv(sValArray(1), m_refGrainDir.y)
' StringToDoubleAdv(sValArray(2), m_refGrainDir.z)
' m_bGRAINDIRALIGN = (CInt(sValArray(3)) = 1)
' End If
@@ -1210,7 +1210,7 @@ Public Class BTLPartM
Return New List(Of BTLFeatureM)(m_BTLFeatureMList)
End Function
Public Function Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional dAng As Double = 90) As Boolean
Public Function Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional bRedraw As Boolean = True, Optional dAng As Double = 90) As Boolean
' recupero il box del pezzo
Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
Dim b3Solid As New BBox3d
@@ -1249,7 +1249,7 @@ Public Class BTLPartM
' ripristino inversione
Inversion(SelectedMachineType)
End If
EgtDraw()
If bRedraw Then EgtDraw()
Return bOk
End Function
+14 -4
View File
@@ -65,7 +65,7 @@ Public Module CalcIntegration
End If
ElseIf Bar.nProgramPage = ProjectType.PROD Then
If Bar.nGlobState = CalcStates.NOTCALCULATED Then
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath)
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath, Bar.nGlobState)
Else
Dim sMachGroupName As String = ""
EgtGetMachGroupName(Bar.nBarId, sMachGroupName)
@@ -78,7 +78,7 @@ Public Module CalcIntegration
If Bar.nProgramPage = ProjectType.PROJ Then
Bar.sBarPath = CreateNewProjectFromPart(Bar.nBarId, sProjDirPath)
ElseIf Bar.nProgramPage = ProjectType.PROD Then
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath)
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath, Bar.nGlobState)
End If
Next
End If
@@ -355,8 +355,14 @@ Public Module CalcIntegration
Return If(bOk, sPartFilePath, String.Empty)
End Function
Private Function CreateNewProjectFromMachGroup(nMachGroupId As Integer, sProjDirPath As String) As String
If Not m_bIsSupervisor Then
Private Function CreateNewProjectFromMachGroup(nMachGroupId As Integer, sProjDirPath As String, nGlobState As Integer) As String
' aggiorno cutid e taskid solo fuori dal supervisore o se pezzo ricalcolato
If Not m_bIsSupervisor OrElse nGlobState = CalcStates.NOTCALCULATED Then
Dim DisableMgr As DisableModifiedMgr = Nothing
If m_bIsSupervisor Then
' Disabilito segnalazione modificato
DisableMgr = New DisableModifiedMgr
End If
' Aggiorno identificativi per segnalazione errori
Dim nOldMachGroup As Integer = EgtGetCurrMachGroup()
If nMachGroupId <> nOldMachGroup Then EgtSetCurrMachGroup(nMachGroupId)
@@ -378,6 +384,10 @@ Public Module CalcIntegration
EgtResetCurrMachGroup()
End If
End If
If m_bIsSupervisor Then
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
End If
End If
' Salvo gruppo di lavorazione nel suo progetto
+6
View File
@@ -175,8 +175,10 @@
Public Const BTL_PRT_REFSIDE = "REFERENCESIDE"
Public Const BTL_PRT_ALIGNMENT = "ALIGNMENT"
Public Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE"
Public Const BTL_PRT_DESCRIPTION = "NAM"
' parametri generici
Public Const BTL_GEN_BTLPATH = "BTL"
Public Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
Public Const BTL_GEN_PROJNAME = "PROJECTNAME"
Public Const BTL_GEN_PROJPART = "PROJECTPART"
@@ -204,6 +206,7 @@
Public Const BTL_FTR_PRC As String = "PRC"
Public Const BTL_FTR_DO As String = "DO"
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_DES As String = "DES"
Public Const BTL_FTR_PRID As String = "PRID"
@@ -251,6 +254,7 @@
Public Const MGR_RPT_PANELLEN As String = "PANELLEN"
Public Const MGR_RPT_PANELWIDTH As String = "PANELWIDTH"
Public Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT"
Public Const MGR_RPT_PANELPOSZ As String = "PANELPOSZ"
Public Const MGR_RPT_PART As String = "PART"
' parametri P per comunicazione con la macchina
@@ -298,6 +302,8 @@
Public Const BTLFILENAME As String = "BTLFILENAME"
Public Const EXP_PART As String = "ImportExport"
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
Public Const PATH_SIDEANGLAYER As String = "SideAngLayer"
@@ -6,6 +6,7 @@
Public Const COL_STARTCUT As String = "colSTARTCUT"
Public Const COL_W As String = "colW"
Public Const COL_L As String = "colL"
Public Const COL_POSZ As String = "colPOSZ"
Public Const COL_ROT As String = "colROT"
Public Const COL_FLIP As String = "colFLIP"
Public Const COL_POSX As String = "colPOSX"
@@ -15,5 +16,6 @@
Public Const COL_TYPE As String = "colTYPE"
Public Const COL_DESCRIPTION As String = "colDESCRIPTION"
Public Const COL_SUPERVISORID As String = "colSUPERVISORID"
Public Const COL_PRIORITY As String = "colPRIORITY"
End Module
+1
View File
@@ -21,6 +21,7 @@ Public Module ConstGen
' File con dati di licenza
Public Const LIC_FILE_NAME As String = "EgtBEAMWALL.lic"
Public Const S_LICENCE As String = "Licence"
Public Const K_LOCKID As String = "LockId"
Public Const K_KEY As String = "Key"
Public Const K_NESTKEY As String = "NestKey"
+4
View File
@@ -20,6 +20,7 @@ Public Module ConstIni
'Public Const K_LICENCE As String = "Licence"
'Public Const K_USERLEVEL As String = "UserLevel"
'Public Const K_MAXINST As String = "MaxInstances"
Public Const K_NETKEY As String = "NetKey"
Public Const K_MAXCAMINST As String = "MaxCamInstances"
Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances"
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_ENABLEEDIT As String = "EnableEdit"
Public Const K_FASTPRODUCE As String = "FastProduce"
Public Const K_ADDPROJ As String = "AddProj"
'Public Const S_LANGUAGES As String = "Languages"
'Public Const K_LANGUAGE As String = "Language"
@@ -94,6 +96,7 @@ Public Module ConstIni
Public Const S_IMPORT As String = "Import"
Public Const K_BTLFLAG As String = "BtlFlag"
Public Const K_WALLBTLFLAG As String = "WallBtlFlag"
Public Const K_WALLOPPOSITESIDENESTING As String = "WallOppositeSideNesting"
'Public Const S_MACH As String = "Mach"
'Public Const K_MACHINESDIR As String = "MachinesDir"
@@ -102,6 +105,7 @@ Public Module ConstIni
Public Const K_SUPERVISORMACH As String = "SupervisorMach"
Public Const K_PASSWORD As String = "Password"
Public Const K_CHANGEMACH As String = "ChangeMach"
Public Const K_EXPORTBWE As String = "ExpBwe"
'Public Const S_SIMUL As String = "Simul"
'Public Const K_SLIDERX As String = "SliderX"
@@ -28,7 +28,7 @@ Public Module DataGridColumnsIniFile
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
Dim Width As Double
Dim WidthType As DataGridLengthUnitType
StringToDouble(sColumnParams(5), Width)
StringToDoubleAdv(sColumnParams(5), Width)
Integer.TryParse(sColumnParams(6), WidthType)
Dim bVisible As Boolean = sColumnParams(7).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 Width As Double
Dim WidthType As DataGridLengthUnitType
StringToDouble(sColumnParams(5), Width)
StringToDoubleAdv(sColumnParams(5), Width)
Integer.TryParse(sColumnParams(6), WidthType)
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
@@ -424,6 +424,7 @@ Public Class EgtDataGridColumn
End Set
End Property
Private Property m_OrigIsReadOnly As Boolean = True
Private Property m_IsReadOnly As Boolean = True
Public Property IsReadOnly As Boolean
Get
@@ -561,6 +562,7 @@ Public Class EgtDataGridColumn
m_CanUserReorder = bCanUserReorder
m_CanUserResize = bCanUserResize
m_CanUserSort = bCanUserSort
m_OrigIsReadOnly = bIsReadOnly
m_IsReadOnly = bIsReadOnly
m_Width = Width
m_Visible = bVisible
@@ -588,7 +590,7 @@ Public Class EgtDataGridColumn
Public Function SaveDataGridColumn() As Boolean
Dim bOk As Boolean
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)
Return bOk
End Function
@@ -149,6 +149,16 @@ Public Class MyMachGroupM
End Get
End Property
Protected m_dPosZ As Double = 0
Public Property dPosZ As Double
Get
Return m_dPosZ
End Get
Set(value As Double)
m_dPosZ = value
End Set
End Property
#End Region ' Wall
#Region "Calc"
@@ -311,6 +321,7 @@ Public Class MyMachGroupM
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELPOSZ, NewMachGroupM.m_dPosZ)
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW * NewMachGroupM.m_dH
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
For Each Part In NewMachGroupM.m_PartMList
@@ -343,6 +354,7 @@ Public Class MyMachGroupM
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELLEN, NewMachGroupM.m_dL)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELWIDTH, NewMachGroupM.m_dW)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELHEIGHT, NewMachGroupM.m_dH)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_PANELPOSZ, NewMachGroupM.m_dPosZ)
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
For Each Part In NewMachGroupM.m_PartMList
@@ -408,7 +420,7 @@ Public Class MyMachGroupM
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c)
StringToDouble(sSplitInfo(1), m_dStartCut)
StringToDoubleAdv(sSplitInfo(1), m_dStartCut)
Else
m_dStartCut = 0
End If
@@ -395,6 +395,7 @@ Public Class MyMachGroupPanelM
nPartId = EgtGetNextPart(nPartId)
End While
EgtResetCurrMachGroup()
Return ToRedrawMachGroupList
End Function
Friend Shared Function DuploGetToDelete(nSouId As Integer, ByRef bToDelete As Boolean) As Boolean
+1 -1
View File
@@ -508,7 +508,7 @@ Public Class PartM
Index += 1
End While
If bFound Then
StringToDouble(sSplitInfo(1), NewPartM.m_dPOSX)
StringToDoubleAdv(sSplitInfo(1), NewPartM.m_dPOSX)
End If
Else
' leggo PosX, PosY, Rot e Flip
@@ -169,7 +169,7 @@ Public MustInherit Class MyMachGroupVM
Return LenToString(MyMachGroupM.dStartCut, 3)
End Get
Set(value As String)
StringToLen(value, MyMachGroupM.dStartCut)
StringToLenAdv(value, MyMachGroupM.dStartCut, True)
End Set
End Property
Public Property dStartCut As Double
@@ -632,13 +632,17 @@ Public MustInherit Class MyMachGroupVM
Public ReadOnly Property DeleteMachGroup_Command As ICommand
Get
If m_cmdDeleteMachGroup Is Nothing Then
m_cmdDeleteMachGroup = New Command(AddressOf DeleteMachGroup)
m_cmdDeleteMachGroup = New Command(AddressOf DeleteMachGroupCmd)
End If
Return m_cmdDeleteMachGroup
End Get
End Property
Public Overridable Sub DeleteMachGroup()
Public Sub DeleteMachGroupCmd()
DeleteMachGroup()
End Sub
Public Overridable Sub DeleteMachGroup(Optional bMultipleCommand As Boolean = False)
' elimino tutte le copie
Dim nRawPartId As Integer = EgtGetFirstRawPart()
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
+4 -4
View File
@@ -107,7 +107,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dPOSX, 3)
End Get
Set(value As String)
StringToLen(value, m_PartM.dPOSX)
StringToLenAdv(value, m_PartM.dPOSX, True)
End Set
End Property
Public Property dPOSX As Double
@@ -217,7 +217,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dOffset, 3)
End Get
Set(value As String)
StringToLen(value, m_PartM.dOffset)
StringToLenAdv(value, m_PartM.dOffset, True)
End Set
End Property
Public ReadOnly Property dOffset As Double
@@ -235,7 +235,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dPOSY, 3)
End Get
Set(value As String)
StringToLen(value, m_PartM.dPOSY)
StringToLenAdv(value, m_PartM.dPOSY, True)
End Set
End Property
@@ -250,7 +250,7 @@ Public MustInherit Class PartVM
Return LenToString(m_PartM.dROT, 3) & "°"
End Get
Set(value As String)
StringToLen(value, m_PartM.dROT)
StringToLenAdv(value, m_PartM.dROT, True)
End Set
End Property
+3 -3
View File
@@ -16,7 +16,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<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: ComVisible(False)>
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.7.1")>
<Assembly: AssemblyFileVersion("2.4.7.1")>
<Assembly: AssemblyVersion("2.5.5.4")>
<Assembly: AssemblyFileVersion("2.5.5.4")>
@@ -10,6 +10,9 @@ Public Class ProdFileM
Return m_nProjIdList
End Get
End Property
Public Sub SetProjIdList(value As List(Of Integer))
m_nProjIdList = value
End Sub
Protected m_sName As String
Public ReadOnly Property sName As String
+8 -8
View File
@@ -147,9 +147,9 @@ Public Module BTLIniFile
Dim dMin As Double
Dim dMax As Double
Dim dDefault As Double
StringToDouble(sBTLParamParams(2), dMin)
StringToDouble(sBTLParamParams(3), dMax)
StringToDouble(sBTLParamParams(4), dDefault)
StringToDoubleAdv(sBTLParamParams(2), dMin)
StringToDoubleAdv(sBTLParamParams(3), dMax)
StringToDoubleAdv(sBTLParamParams(4), dDefault)
Dim ParamType As BTLParamType
If sBTLParamParams(0) = "d" Then
ParamType = BTLParamType.DOUBLE_
@@ -159,7 +159,7 @@ Public Module BTLIniFile
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5))
Return Not IsNothing(IpBTLParam)
ElseIf sBTLParamParams(0) = "s" Then
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(5))
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(4), sBTLParamParams(5))
Return Not IsNothing(IpBTLParam)
ElseIf sBTLParamParams(0) = "c" Then
Dim nMin As Integer
@@ -200,9 +200,9 @@ Public Module BTLIniFile
Dim dMin As Double
Dim dMax As Double
Dim dDefault As Double
StringToDouble(sBTLParamParams(2), dMin)
StringToDouble(sBTLParamParams(3), dMax)
StringToDouble(sBTLParamParams(4), dDefault)
StringToDoubleAdv(sBTLParamParams(2), dMin)
StringToDoubleAdv(sBTLParamParams(3), dMax)
StringToDoubleAdv(sBTLParamParams(4), dDefault)
Dim ParamType As BTLParamType
If sBTLParamParams(0) = "d" Then
ParamType = BTLParamType.DOUBLE_
@@ -212,7 +212,7 @@ Public Module BTLIniFile
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, ParamType, sBTLParamParams(1), dMin, dMax, dDefault, sBTLParamParams(5), sBWQParam)
Return Not IsNothing(IpBTLParam)
ElseIf sBTLParamParams(0) = "s" Then
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(5), sBWQParam)
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.STRING_, sBTLParamParams(1), sBTLParamParams(4), sBTLParamParams(5), sBWQParam)
Return Not IsNothing(IpBTLParam)
ElseIf sBTLParamParams(0) = "c" Then
Dim nMin As Integer
@@ -27,7 +27,7 @@ Public Module DimensionsIniFile
Dim GridLenType As GridUnitType
Integer.TryParse(sValueParams(0), nDimIndex)
Integer.TryParse(sValueParams(1), nDimType)
StringToDouble(sValueParams(2), GridLenValue)
StringToDoubleAdv(sValueParams(2), GridLenValue)
Integer.TryParse(sValueParams(3), GridLenType)
GridDimsList.Add(New GridDimension(GridName, nDimIndex, nDimType, New GridLength(GridLenValue, GridLenType)))
End If
+46 -42
View File
@@ -1,45 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<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></providers>
</entityFramework>
<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" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.29.0" newVersion="8.0.29.0" />
</dependentAssembly>
<dependentAssembly>
<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" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" />
</dependentAssembly>
<dependentAssembly>
<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" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
</provider>
</providers>
</entityFramework>
<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" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<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" />
<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" />
<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" />
<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" />
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
@@ -24,7 +24,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <param name="corePart"></param>
/// <param name="currProjDbId"></param>
/// <returns></returns>
public static BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId)
public BTLPartModel ConvertFromCore(Core.BTLPartM corePart, int currProjDbId)
{
BTLPartModel answ = new BTLPartModel();
if (corePart != null)
+125 -26
View File
@@ -22,6 +22,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
// Initialize database context for ADMIN
adbCtx = new AdminContext(DbConfig.ADMIN_CONNECTION_STRING);
// DB standard utente
dbCtx = new AdminContext(DbConfig.CONNECTION_STRING);
}
#endregion Public Constructors
@@ -39,33 +41,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
bool answ = false;
string domain = isNetwork ? "%" : "localhost";
// ricerca utente...
var numUser = adbCtx
.UserList
.Where(x => x.User == username)
.ToList()
.Count;
if (numUser > 0)
answ = doCheckCreate(username, pwd, answ, domain, false);
if (answ)
{
answ = true;
}
if (!answ)
{
// creo utente
string sqlCommand = "FLUSH PRIVILEGES;";
//string sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}'; GRANT ALL ON *.* TO '{username}'@'localhost'; FLUSH PRIVILEGES;";
//string sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}'; GRANT ALL ON *.* TO '{username}'@'localhost'; FLUSH PRIVILEGES;";
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}';";
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
sqlCommand = $"GRANT ALL ON *.* TO '{username}'@'{domain}';";
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
sqlCommand = "FLUSH PRIVILEGES;";
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
doGrantPriv(username, domain, "ALL ON *.*");
}
return answ;
}
@@ -85,6 +64,51 @@ namespace EgtBEAMWALL.DataLayer.Controllers
adbCtx.Dispose();
}
/// <summary>
/// Verifica esistenza views + utente relativo eventualmente ricreandole + fornendo accesso
/// all'utente ReadOnly Essetre
/// </summary>
/// <param name="dbName"></param>
/// <param name="username"></param>
/// <param name="pwd"></param>
/// <returns></returns>
public bool refreshViews(string dbName, string username = "S3_User", string pwd = "S3_P4ssw0rd")
{
bool answ = false;
// in primis refresh delle view
string sqlCommand = @"CREATE OR REPLACE VIEW v_expProdRaw AS
SELECT DbId, AlarmDtEvent AS DtEvent, VarValue,
SUBSTRING_INDEX(VarValue, ';', 1) AS Prod,
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', 2), ';', -1) AS MachGroupId,
SUBSTRING_INDEX(SUBSTRING_INDEX(VarValue, ';', -2), ';', 1) AS PartId,
SUBSTRING_INDEX(VarValue, ';', -1) AS Status
FROM logmachine
WHERE ResultType = 1
AND VarAddress = 1;
CREATE OR REPLACE VIEW v_expProd AS
SELECT vp.DtEvent, vp.Prod, mgl.Name AS mgName, pl.PDN, vp.`Status`
FROM v_expProdRaw AS vp
INNER JOIN MachGroupList mgl ON vp.MachGroupId = mgl.Id
INNER JOIN partlist pl ON vp.PartId = pl.Id;";
dbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
// ora setup parametri x utente
string domain = "%";
// ora controllo utente con diritti
answ = doCheckCreate(username, pwd, answ, domain, true);
if (answ)
{
doGrantPriv(username, domain, "USAGE ON *.*");
doGrantPriv(username, domain, $"SELECT ON {dbName}.v_expProd");
}
return answ;
}
/// <summary>
/// ATTENZIONE!!!! Procedura di Reset del DB
/// </summary>
@@ -117,6 +141,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
#region Private Fields
private AdminContext adbCtx;
private AdminContext dbCtx;
/// <summary>
/// Istanza logger
@@ -124,5 +149,79 @@ namespace EgtBEAMWALL.DataLayer.Controllers
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Private Methods
/// <summary>
/// Procedura interna effettiva di check utente ed eventuale creazione + grant level
/// </summary>
/// <param name="username"></param>
/// <param name="pwd"></param>
/// <param name="answ"></param>
/// <param name="domain"></param>
/// <param name="force">Force = esegue un drop prima...</param>
/// <returns></returns>
private bool doCheckCreate(string username, string pwd, bool answ, string domain, bool force)
{
// ricerca utente...
var numUser = adbCtx
.UserList
.Where(x => x.User == username)
.ToList()
.Count;
if (numUser > 0)
{
answ = true;
}
if (!answ)
{
// creo utente
string sqlCommand = $"DROP USER IF EXISTS {username};";
if (force)
{
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
}
sqlCommand = "FLUSH PRIVILEGES;";
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
sqlCommand = $"CREATE USER '{username}'@'{domain}' IDENTIFIED BY '{pwd}';";
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
sqlCommand = "FLUSH PRIVILEGES;";
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
answ = true;
}
return answ;
}
/// <summary>
/// Procedura interna effettiva di grant level x utente
/// </summary>
/// <param name="username"></param>
/// <param name="domain"></param>
/// <param name="grantLevel"></param>
/// <returns></returns>
private bool doGrantPriv(string username, string domain, string grantLevel)
{
bool answ = false;
string sqlCommand = "FLUSH PRIVILEGES;";
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
sqlCommand = $"GRANT {grantLevel} TO '{username}'@'{domain}';";
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
sqlCommand = "FLUSH PRIVILEGES;";
adbCtx.Database.ExecuteSqlCommand(System.Data.Entity.TransactionalBehavior.DoNotEnsureTransaction, sqlCommand);
Thread.Sleep(100);
answ = true;
return answ;
}
#endregion Private Methods
}
}
@@ -23,7 +23,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// </summary>
/// <param name="coreMacLog"></param>
/// <returns></returns>
public static LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
public LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
{
LogMachineModel answ = new LogMachineModel();
if (coreMacLog != null)
@@ -53,7 +53,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// </summary>
/// <param name="dbLog"></param>
/// <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);
return newRecord;
@@ -8,12 +8,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
public class MachGroupController : IDisposable
{
#region Public Fields
public static MachGroupController man = new MachGroupController();
#endregion Public Fields
#region Public Constructors
public MachGroupController()
@@ -30,7 +24,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <param name="coreMachGroup"></param>
/// <param name="currProdDbId"></param>
/// <returns></returns>
public static MachGroupModel ConvertFromCore(Core.MyMachGroupM coreMachGroup, int currProdDbId)
public MachGroupModel ConvertFromCore(Core.MyMachGroupM coreMachGroup, int currProdDbId)
{
MachGroupModel answ = new MachGroupModel();
if (coreMachGroup != null)
@@ -63,6 +57,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
ProdModel currData = new ProdModel();
List<PartModel> PartList2Add = new List<PartModel>();
var myPartCtrl = new PartController();
var myStatusMapCtrl = new StatusMapController();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// Recupero il PROD nel contesto
@@ -72,7 +68,8 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.SingleOrDefault();
try
{
var convCurrMG = MachGroupController.ConvertFromCore(newMachGroup, currData.ProdDbId);
var locMGCtrl = new MachGroupController();
var convCurrMG = locMGCtrl.ConvertFromCore(newMachGroup, currData.ProdDbId);
convCurrMG.ProdIndex = 1;
@@ -81,15 +78,25 @@ namespace EgtBEAMWALL.DataLayer.Controllers
// Commit changes
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...
foreach (var currPartM in newMachGroup.PartMList)
{
var currPart = localDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == newMachGroup.Id && x.PartId == currPartM.nPartId)
//var currPart = localDbCtx
// .PartList
// .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();
var convCurrPartM = PartController.ConvertFromCore(currPartM, MachGroupDbId);
var convCurrPartM = myPartCtrl.ConvertFromCore(currPartM, MachGroupDbId);
if (currPart != null)
{
// se non identico x equality limitata a ViewOptim...
@@ -125,7 +132,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
// Commit changes
localDbCtx.SaveChanges();
// 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)
{
@@ -177,6 +184,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
// inizio eliminando le part
var parts2del = localDbCtx
.PartList
@@ -197,7 +205,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
localDbCtx.SaveChanges();
// 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;
}
@@ -209,7 +217,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
}
// 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;
}
@@ -393,6 +401,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
@@ -405,13 +414,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
currRecord.State = Core.ItemState.ND;
currRecord.SupervisorId = "";
currRecord.ProdIndex = 0;
}
// Commit changes
localDbCtx.SaveChanges();
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
// Commit changes
localDbCtx.SaveChanges();
// aggiorno info sullo status
myStatusMapCtrl.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)
{
@@ -435,23 +450,33 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
localDbCtx
var item2upd = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault()
.State = newState;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupNeedRedo, Value);
.FirstOrDefault();
if (item2upd != null)
{
item2upd.State = newState;
// Commit changes
localDbCtx.SaveChanges();
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)
{
string errMessage = $"EXCEPTION on MachGroup.UpdateStatus: {Environment.NewLine}{exc}";
string errMessage = $"EXCEPTION on MachGroup.SetNeedRedo: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
@@ -469,20 +494,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var item2update = localDbCtx
.MachGroupList
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
.SingleOrDefault();
var myStatusMapCtrl = new StatusMapController();
try
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
var item2update = localDbCtx
.MachGroupList
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
.SingleOrDefault();
if (item2update != null)
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", updItem.Prod.ProdId, updItem.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
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)
{
@@ -506,6 +541,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
@@ -513,15 +549,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
currRecord.DtEnd = DtEnd;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
if (currRecord != null)
{
currRecord.DtEnd = DtEnd;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
myStatusMapCtrl.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)
{
@@ -548,15 +590,23 @@ namespace EgtBEAMWALL.DataLayer.Controllers
try
{
// aggiorno
localDbCtx
var item2upd = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault()
.ProdIndex = newProdIndex;
// Commit changes
localDbCtx.SaveChanges();
done = true;
.FirstOrDefault();
if (item2upd != null)
{
item2upd.ProdIndex = newProdIndex;
// Commit changes
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)
{
@@ -581,6 +631,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
@@ -588,15 +639,21 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
currRecord.DtStart = DtStart;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
if (currRecord != null)
{
currRecord.DtStart = DtStart;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
myStatusMapCtrl.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)
{
@@ -621,6 +678,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
@@ -628,15 +686,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
currRecord.DtStart = DtStart;
currRecord.DtEnd = DtEnd;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
if (currRecord != null)
{
currRecord.DtStart = DtStart;
currRecord.DtEnd = DtEnd;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
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)
{
@@ -659,20 +724,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
localDbCtx
var item2upd = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault()
.State = newState;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
.FirstOrDefault();
if (item2upd != null)
{
item2upd.State = newState;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// 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)
{
@@ -691,23 +765,32 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
var currRecord = localDbCtx
var item2upd = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
if (item2upd != null)
{
item2upd.SupervisorId = SupervisorId;
item2upd.State = Core.ItemState.Assigned;
currRecord.SupervisorId = SupervisorId;
currRecord.State = Core.ItemState.Assigned;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
// aggiorno info sullo status
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAssignedToSupervisor, "");
}
else
{
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)
{
@@ -7,17 +7,10 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
public class PartController : IDisposable
{
#region Public Fields
public static PartController man = new PartController();
#endregion Public Fields
#region Public Constructors
public PartController()
{
}
{ }
#endregion Public Constructors
@@ -29,12 +22,12 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <param name="corePart"></param>
/// <param name="currMachGroupDbId"></param>
/// <returns></returns>
public static PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
public PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
{
PartModel answ = new PartModel();
if (corePart != null)
{
int BTLPartId = man.FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
int BTLPartId = FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
answ = new PartModel()
{
PartId = corePart.nPartId,
@@ -74,23 +67,34 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
var item2del = localDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.SingleOrDefault();
try
if (item2del != null)
{
// Remove from database
localDbCtx.PartList.Remove(item2del);
// Commit changes
localDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
try
{
// Remove from database
localDbCtx.PartList.Remove(item2del);
// Commit changes
localDbCtx.SaveChanges();
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);
Log.Error(errMessage);
}
@@ -112,17 +116,27 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.PartList
.Where(x => x.PartDbId == PartDbId)
.SingleOrDefault();
try
if (item2del != null)
{
// Add to database
localDbCtx.PartList.Remove(item2del);
// Commit changes
localDbCtx.SaveChanges();
done = true;
try
{
// Add to database
localDbCtx.PartList.Remove(item2del);
// 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);
Log.Error(errMessage);
}
@@ -209,28 +223,38 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var item2update = locallocalDbCtx
var myStatusMapCtrl = new StatusMapController();
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.PartDbId == updItem.PartDbId)
.SingleOrDefault();
try
if (item2upd != null)
{
// update, vers 1...
locallocalDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
try
{
// update, vers 1...
locallocalDbCtx.Entry(item2upd).CurrentValues.SetValues(updItem);
//// update, vers 2
//localDbCtx.PartList.Remove(item2del);
//localDbCtx.PartList.Add(updItem);
//// update, vers 2
//localDbCtx.PartList.Remove(item2del);
//localDbCtx.PartList.Add(updItem);
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", updItem.MachGroup.Prod.ProdId, updItem.PartId, Core.StatusMapItemType.Part, Core.StatusMapOpType.MachGroupMod, "");
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
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);
Log.Error(errMessage);
}
@@ -249,19 +273,30 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
locallocalDbCtx
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.FirstOrDefault()
.DtEnd = DtEnd;
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtEnd == DateTime.MinValue ? Core.StatusMapOpType.ResetPartEnd : Core.StatusMapOpType.PartEnd, "");
.FirstOrDefault();
if (item2upd != null)
{
item2upd.DtEnd = DtEnd;
// Commit changes
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)
{
@@ -284,19 +319,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
locallocalDbCtx
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.FirstOrDefault()
.DtStart = DtStart;
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, DtStart == DateTime.MinValue ? Core.StatusMapOpType.ResetPartStart : Core.StatusMapOpType.PartStart, "");
.FirstOrDefault();
if (item2upd != null)
{
item2upd.DtStart = DtStart;
// Commit changes
locallocalDbCtx.SaveChanges();
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)
{
@@ -320,19 +365,29 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
locallocalDbCtx
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.FirstOrDefault()
.State = newState;
// Commit changes
locallocalDbCtx.SaveChanges();
done = true;
// aggiorno info sullo status
StatusMapController.man.UpdateAction("", ProdId, PartId, Core.StatusMapItemType.Part, newState == Core.ItemState.Scrapped ? Core.StatusMapOpType.SetPartScrapped : Core.StatusMapOpType.MachGroupMod, "");
.FirstOrDefault();
if (item2upd != null)
{
item2upd.State = newState;
// Commit changes
locallocalDbCtx.SaveChanges();
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)
{
@@ -1,5 +1,6 @@
using EgtBEAMWALL.DataLayer.DatabaseModels;
using NLog;
using NLog.LayoutRenderers;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -9,17 +10,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
public class ProdController : IDisposable
{
#region Public Fields
public static ProdController man = new ProdController();
#endregion Public Fields
#region Public Constructors
public ProdController()
{
Log.Info("ProdController istance Started");
Log.Info("ProdController instance Started");
}
#endregion Public Constructors
@@ -353,25 +348,39 @@ namespace EgtBEAMWALL.DataLayer.Controllers
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var item2update = localDbCtx
.ProdList
.Where(x => x.ProdDbId == updItem.ProdDbId)
.SingleOrDefault();
try
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
var item2update = localDbCtx
.ProdList
.Where(x => x.ProdDbId == updItem.ProdDbId)
.SingleOrDefault();
//// update, vers 2
//localDbCtx.PartList.Remove(item2del);
//localDbCtx.PartList.Add(updItem);
if (item2update != null)
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
// Commit changes
localDbCtx.SaveChanges();
done = true;
//// update, vers 2
//localDbCtx.PartList.Remove(item2del);
//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;
}
@@ -384,137 +393,182 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// </summary>
/// <param name="ProdId">Id del Prod</param>
/// <param name="MachGroupList">Elenco MachGroup da associare</param>
/// <returns></returns>
public ProdModel UpdateMachGroup(int ProdId, List<Core.MyMachGroupM> MachGroupList)
/// <returns>Bool esecuzione con successo o meno</returns>
public bool UpdateMachGroup(int ProdId, List<Core.MyMachGroupM> MachGroupList)
{
ProdModel currData = new ProdModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
bool testOk = false;
// 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
currData = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.SingleOrDefault();
try
ProdModel currData = new ProdModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// preparo elenco
List<MachGroupModel> itemsMG2Add = new List<MachGroupModel>();
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 myStatusMapCtrl = new StatusMapController();
try
{
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id);
var convCurrMG = MachGroupController.ConvertFromCore(item, currData.ProdDbId);
if (currMG != null)
// Recupero il PROD nel contesto DB attuale
currData = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.SingleOrDefault();
if (currData != null)
{
// se non identico x equality limitata a ViewOptim...
if (!currMG.ViewOptimEquals(convCurrMG))
// preparo elenco
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
currMG.H = convCurrMG.H;
currMG.L = convCurrMG.L;
currMG.W = convCurrMG.W;
currMG.Material = convCurrMG.Material;
currMG.Name = convCurrMG.Name;
// salvo
localDbCtx.SaveChanges();
// registro modifica StatusMap
StatusMapController.man.UpdateAction(currMG.SupervisorId, ProdId, currMG.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupMod, "");
var currMG = logMGCtrl.FindByMachGroupId(ProdId, item.Id);
var convCurrMG = logMGCtrl.ConvertFromCore(item, currData.ProdDbId);
if (currMG != null)
{
// se non identico x equality limitata a ViewOptim...
if (!currMG.ViewOptimEquals(convCurrMG))
{
// aggiorno con nuovi valori ricevuti
currMG.H = convCurrMG.H;
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
{
itemsMG2Add.Add(convCurrMG);
// registro modifica StatusMap
StatusMapController.man.UpdateAction("", ProdId, item.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
string errMessage = $"ERROR on Prod.UpdateMachGroup: req item was not found | ProdId {ProdId} | MachGroupList {MachGroupList.Count} rec";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
// 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)
catch (Exception exc)
{
var currMG = MachGroupController.man.FindByMachGroupId(ProdId, item.Id);
int MachGroupDbId = currMG.MachGroupDbId;
bool modMg = false;
// 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, "");
}
string errMessage = $"EXCEPTION on Prod.UpdateMachGroup: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
// 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>
@@ -525,18 +579,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public Core.ProdFileM UpdateMachine(int ProdId, String Machine)
{
ProdModel currData;
ProdModel currData = new ProdModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
currData = localDbCtx
try
{
currData = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.SingleOrDefault();
// aggiorno valore BTL
currData.Machine = Machine;
if (currData != null)
{
// aggiorno valore BTL
currData.Machine = Machine;
// Commit changes
localDbCtx.SaveChanges();
// Commit changes
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);
}
@@ -549,18 +621,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public Core.ProdFileM UpdatePType(int ProdId, BWType PType)
{
ProdModel currData;
ProdModel currData = new ProdModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
currData = localDbCtx
try
{
currData = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.SingleOrDefault();
// aggiorno valore BTL
currData.PType = PType;
if (currData != null)
{
// aggiorno valore BTL
currData.PType = PType;
// Commit changes
localDbCtx.SaveChanges();
// Commit changes
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);
}
@@ -572,25 +662,40 @@ namespace EgtBEAMWALL.DataLayer.Controllers
string LockBy = "";
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// seleziono il prod...
var currProd = localDbCtx
try
{
// seleziono il prod...
var currProd = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.FirstOrDefault();
if (currProd != null)
{
LockBy = currProd.LockedBy;
var currProj = localDbCtx
.ProjList
.Where(x => x.ProdDbId == currProd.ProdDbId)
.ToList();
if (currProj != null && string.IsNullOrEmpty(LockBy))
if (currProd != null)
{
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;
@@ -636,7 +741,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
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
@@ -452,22 +452,35 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.ProjList
.Where(x => x.ProjId == updItem.ProjId)
.SingleOrDefault();
try
if (item2update != null)
{
updItem.ProjDbId = item2update.ProjDbId;
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
try
{
updItem.ProjDbId = item2update.ProjDbId;
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
//// update, vers 2
//dbCtx.PartList.Remove(item2del);
//dbCtx.PartList.Add(updItem);
//// update, vers 2
//dbCtx.PartList.Remove(item2del);
//dbCtx.PartList.Add(updItem);
// Commit changes
localDbCtx.SaveChanges();
done = true;
// Commit changes
localDbCtx.SaveChanges();
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;
}
@@ -493,64 +506,73 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.BTLPartList
.Where(x => x.ProjDbId == currData.ProjDbId)
.ToList();
// converto le BtlParts da core --> DB
List<BTLPartModel> newBtlParts = BtlPartList.Select(x => BTLPartController.ConvertFromCore(x, currData.ProjDbId)).ToList();
try
if (oldBtlParts != null)
{
// elementi BtlPartId NON + presenti da eliminare
List<int> bpi2rem = oldBtlParts.Select(x => x.PartId).Except(newBtlParts.Select(y => y.PartId)).ToList();
List<int> bpi2add = newBtlParts.Select(x => x.PartId).Except(oldBtlParts.Select(y => y.PartId)).ToList();
List<int> bpiExis = newBtlParts.Select(x => x.PartId).Intersect(oldBtlParts.Select(y => y.PartId)).ToList();
var locBtlCtrl = new BTLPartController();
// converto le BtlParts da core --> DB
List<BTLPartModel> newBtlParts = BtlPartList.Select(x => locBtlCtrl.ConvertFromCore(x, currData.ProjDbId)).ToList();
// aggiorno existing...
foreach (var currPartId in bpiExis)
try
{
// recupero item da aggiornare...
var oldItem = oldBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
// dati nuovo item
var newItem = newBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
if (newItem != null && oldItem != null)
// elementi BtlPartId NON + presenti da eliminare
List<int> bpi2rem = oldBtlParts.Select(x => x.PartId).Except(newBtlParts.Select(y => y.PartId)).ToList();
List<int> bpi2add = newBtlParts.Select(x => x.PartId).Except(oldBtlParts.Select(y => y.PartId)).ToList();
List<int> bpiExis = newBtlParts.Select(x => x.PartId).Intersect(oldBtlParts.Select(y => y.PartId)).ToList();
// aggiorno existing...
foreach (var currPartId in bpiExis)
{
oldItem.CALC_State = newItem.CALC_State;
oldItem.CNT = newItem.CNT;
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;
// recupero item da aggiornare...
var oldItem = oldBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
// dati nuovo item
var newItem = newBtlParts.Where(x => x.PartId == currPartId).FirstOrDefault();
if (newItem != null && oldItem != null)
{
oldItem.CALC_State = newItem.CALC_State;
oldItem.CNT = newItem.CNT;
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
foreach (var newPartId in bpi2add)
{
var newItem = newBtlParts.Where(x => x.PartId == newPartId).FirstOrDefault();
localDbCtx.BTLPartList.Add(newItem);
}
// aggiorno valore isNew a false
currData.IsNew = false;
// 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);
}
// Commit changes
localDbCtx.SaveChanges();
}
else
{
string errMessage = $"ERROR on Proj.UpdateBtlParts: req item was not found | ProjId {ProjId} | BtlPartList {BtlPartList.Count} items";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
catch
{ }
// aggiorno valore isNew a false
currData.IsNew = false;
// Commit changes
localDbCtx.SaveChanges();
}
return currData;
}
@@ -573,50 +595,67 @@ namespace EgtBEAMWALL.DataLayer.Controllers
.ProjList
.Where(x => x.ProjId == ProjId)
.SingleOrDefault();
// 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)
if (currData != null)
{
// se ne ho esattamente 1 nel DB allora DEVE essere il record Parent
if (duplicateList.Count == 1)
try
{
// verifico se ProjId variato
if (!duplicateList[0].ProjId.Equals(currData.ProjId))
// 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)
{
// in questo caso ho il PRIMO duplicato
BTLFileName = $"{BTLFileName}_1";
// se ne ho esattamente 1 nel DB allora DEVE essere il record Parent
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
// il successivo
else
catch (Exception exc)
{
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}";
}
string errMessage = $"EXCEPTION on Part.UpdateInfo:{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
// aggiorno valore BTL
currData.BTLFileName = BTLFileName;
currData.DtExported = DtExported;
currData.ListName = ListName;
currData.PType = PType;
currData.Machine = Machine;
// Commit changes
localDbCtx.SaveChanges();
else
{
string errMessage = $"ERROR on Proj.UpdateInfo: req item was not found | ProjId {ProjId} | BTLFileName {BTLFileName} | ListName {ListName} | DtExported {DtExported} | PType {PType} | Machine {Machine}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return coreConv(currData);
@@ -630,18 +669,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public Core.ProjFileM UpdateListName(int ProjId, string ListName)
{
ProjModel currData;
ProjModel currData = new ProjModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
currData = localDbCtx
.ProjList
.Where(x => x.ProjId == ProjId)
.SingleOrDefault();
// aggiorno valore BTL
currData.ListName = ListName;
try
{
currData = localDbCtx
.ProjList
.Where(x => x.ProjId == ProjId)
.SingleOrDefault();
if (currData != null)
{
// aggiorno valore BTL
currData.ListName = ListName;
// Commit changes
localDbCtx.SaveChanges();
// Commit changes
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);
}
@@ -654,18 +711,37 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public Core.ProjFileM UpdateMachine(int ProjId, String Machine)
{
ProjModel currData;
ProjModel currData = new ProjModel();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
currData = localDbCtx
try
{
currData = localDbCtx
.ProjList
.Where(x => x.ProjId == ProjId)
.SingleOrDefault();
// aggiorno valore BTL
currData.Machine = Machine;
// Commit changes
localDbCtx.SaveChanges();
if (currData != null)
{
// 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);
}
@@ -8,15 +8,6 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
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
public StatusMapController()
@@ -97,6 +97,8 @@ namespace EgtBEAMWALL.DataLayer.DatabaseModels
if (!(obj is PartModel item))
return false;
if (BTLPartDbId != item.BTLPartDbId)
return false;
if (H != item.H)
return false;
if (L != item.L)
+78 -1
View File
@@ -1,4 +1,6 @@
using System.IO;
using System.Diagnostics;
using System;
using System.IO;
using System.Reflection;
namespace EgtBEAMWALL.DataLayer
@@ -58,6 +60,81 @@ namespace EgtBEAMWALL.DataLayer
return Controllers.DbController.man.checkCreateUser(DATABASE_USER, DATABASE_PWD, isNetwork);
}
/// <summary>
/// Effettua verifica presenza view prod + relativo utente
/// </summary>
/// <param name="nKey"></param>
/// <param name="sKey"></param>
/// <param name="isNetwork"></param>
/// <returns></returns>
public static bool CheckViews(string nKey, string sKey)
{
// esecuzione script di install locale
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>
/// Metodo di init standard per DB in rete con Master_Key
/// </summary>
-1
View File
@@ -9,7 +9,6 @@ namespace EgtBEAMWALL.DataLayer
{
#region Public Fields
public static DbManager obj = new DbManager();
public Controllers.BTLPartController BtlPartCtr = new Controllers.BTLPartController();
public Controllers.LogMachineController LogMacCtr = new Controllers.LogMachineController();
public Controllers.LogSupportController LogSupCtr = new Controllers.LogSupportController();
@@ -37,8 +37,8 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="EgtWPFLib5">
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
@@ -49,17 +49,17 @@
<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>
</Reference>
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
</Reference>
<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>
@@ -88,20 +88,26 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" />
<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.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<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>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.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>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Security" />
<Reference Include="System.ServiceModel" />
<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.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Egalware s.r.l.")]
[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: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.7.1")]
[assembly: AssemblyFileVersion("2.4.7.1")]
[assembly: AssemblyVersion("2.5.5.4")]
[assembly: AssemblyFileVersion("2.5.5.4")]
+9 -6
View File
@@ -2,17 +2,20 @@
<packages>
<package id="BouncyCastle" version="1.8.5" targetFramework="net472" />
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
<package id="Google.Protobuf" version="3.19.4" targetFramework="net472" />
<package id="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" />
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" />
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" />
<package id="Google.Protobuf" version="3.21.9" targetFramework="net472" />
<package id="K4os.Compression.LZ4" version="1.3.5" targetFramework="net472" />
<package id="K4os.Compression.LZ4.Streams" version="1.3.5" 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.EntityFramework" version="8.0.21" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" />
<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="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.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>
+1 -1
View File
@@ -8,7 +8,7 @@
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6"/>
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
</providers>
</entityFramework>
<connectionStrings>
@@ -3,8 +3,7 @@ Imports EgtBEAMWALL.Core
Public Class AboutBoxV
Private Sub AboutBoxWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
Me.Owner = Application.Current.MainWindow
Private Sub AboutBoxWD_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
DescriptionLbl.Text = My.Application.Info.Description.ToString()
VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
"." & My.Application.Info.Version.Minor.ToString() &
@@ -25,6 +24,9 @@ Public Class AboutBoxV
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
Dim sOpSys As String = String.Empty
EgtGetOsInfo( sOpSys)
sInfo &= sOpSys & Environment.NewLine
Dim sCPU As String = String.Empty
EgtGetCpuInfo( sCPU)
sInfo &= sCPU & Environment.NewLine
@@ -32,7 +34,7 @@ Public Class AboutBoxV
EgtGetSceneInfo(sScene)
sInfo &= sScene
InfoLbl.Text = sInfo
ExitBtn.Content = EgtMsg(constmsg.MSG_MISSINGKEYWD + 4) 'Ok
ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
End Sub
End Class
+21 -17
View File
@@ -118,6 +118,7 @@ Public Class CALCPanelVM
End Sub
Private Shared Sub ProcessResults(Bar As Bar)
If IsNothing(Bar) Then Return
' disabilito impostazione modificato
Dim DisableMgr As New DisableModifiedMgr
@@ -148,7 +149,7 @@ Public Class CALCPanelVM
If line.StartsWith("ERR=") Then
Dim nVal As Integer? = GetVal(line, "ERR")
nErr = (If(nVal IsNot Nothing, nVal.Value, 0))
nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
sMsg = ""
dRot = 0
nFall = 0
@@ -156,24 +157,24 @@ Public Class CALCPanelVM
taskId = 0
ElseIf line.StartsWith("ROT=") Then
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)
dPartRot = Math.Max(dPartRot, dRot)
dTotRot = Math.Max(dTotRot, dRot)
ElseIf line.StartsWith("CUTID=") Then
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
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)
ElseIf line.StartsWith("FALL=") Then
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))
ElseIf line.StartsWith("TIME=") Then
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))
'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)
@@ -216,23 +217,25 @@ Public Class CALCPanelVM
End If
Select Case Line.Type
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
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
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
CurrPartVM.CalcFallUpdate(Line.nFALL)
If Not IsNothing(CurrPartVM) Then CurrPartVM.CalcFallUpdate(Line.nFALL)
Case ProcessResult.ProcessResultTypes.TIME
If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(Bar.nBarId)
CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
If Not IsNothing(CurrMachgroupVM) Then CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
End Select
Next
Machgroup = GetMachgroupVMFromMachgroupId(Bar.nBarId)
For Each Part In Machgroup.PartVMList
Part.CalcGlobalUpdate()
Next
Machgroup.CalcGlobalUpdate()
If Not IsNothing(Machgroup) Then
For Each Part In Machgroup.PartVMList
Part.CalcGlobalUpdate()
Next
Machgroup.CalcGlobalUpdate()
End If
End If
@@ -377,7 +380,8 @@ Public Class CALCPanelVM
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName}
.nMachineName = MachineName,
.nGlobState = MachGroup.nGlobalState}
Select Case MachGroup.nGlobalState
Case Core.CalcStates.OK, Core.CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
@@ -500,7 +504,7 @@ Public Class CALCPanelVM
.bBarOk = True,
.nMachineName = MachineName,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE}
If SelMachGroup.nGlobalState <> Core.CalcStates.OK Then
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
Dim sMachGroupFilePath As String = Map.refSupervisorManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
+4 -2
View File
@@ -474,7 +474,7 @@ Public Class NUMAxiumComm
Friend Sub WriteNCVariables(Address As String, value As String)
Try
Dim dValue As Double = 0
StringToDouble(value, dValue)
StringToDoubleAdv(value, dValue)
Dim rc As Short = objDVariables.WriteVariables(objDGroupManager.Handle, Address, value)
'If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
@@ -501,7 +501,9 @@ Public Class NUMAxiumComm
Private Sub objDGeneralFunction_ProgramActivated(ByVal nerrorCode As Short)
EgtOutLog("Part program activated:" & " " & nerrorCode)
DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & nerrorCode))
'DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & nerrorCode))
' scrivo evento programma attivato
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.PROGRAM_ACTIVATION, "", nerrorCode, DbControllers.SupervisorId))
End Sub
Private Sub objDGeneralFunction_OnCncStart(ByVal errorCode As Short)
@@ -255,11 +255,11 @@ Public Class NUMAxiumPcToolkitComm
m_MachManaging.SetConnected(True)
m_ResultCallbackDlg(CommandTypes.CONNECT, CommandStates.OK, ResultTypes.RESULT, "")
End If
'''EgtOutLog("Activating program 9000")
'EgtOutLog("Activating program 9000")
' attivo programma main
Map.refMachManaging.Num_Axium_PCToolkit.ActivateProg(9000)
'''EgtOutLog("Activated program 9000")
'EgtOutLog("Activated program 9000")
Return True
End Function
@@ -391,9 +391,11 @@ Public Class NUMAxiumPcToolkitComm
nRes = WriteObjectVarious2(nPortFileTransfer, ACTIVE_PROG, PartProgramNumberActivate)
If nRes <> 0 Then
EgtOutLog("Error Activate Program: " & nRes.ToString())
Else
DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & PartProgramNumberActivate))
'Else
' DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & PartProgramNumberActivate))
End If
' scrivo evento programma attivato
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.PROGRAM_ACTIVATION, PartProgramNumberActivate, nRes <> 0, DbControllers.SupervisorId))
End Sub
Private Sub ChangeChannel(Channel As Short)
@@ -449,23 +451,23 @@ Public Class NUMAxiumPcToolkitComm
End Sub
Friend Sub CloseReadList()
'''objDPlcVariables.CloseReadList()
'objDPlcVariables.CloseReadList()
End Sub
Private Sub ReadVariablesOnce(Address As String)
'Dim _ReadSymbolicPlcVariableOnetime As String = "Application.IOCONFIG_GLOBALS.Flexium_NCK.RCNC.General.Mode"
'''Dim _FXReturn As Int16 = objDPlcVariables.ReadVariablesOnce(10, Address)
'Dim _FXReturn As Int16 = objDPlcVariables.ReadVariablesOnce(10, Address)
'''If _FXReturn <> 0 Then
''' EgtOutLog("Error ReadVariablesOnce:" & " " & _FXReturn.ToString())
'''End If
'If _FXReturn <> 0 Then
' EgtOutLog("Error ReadVariablesOnce:" & " " & _FXReturn.ToString())
'End If
End Sub
Friend Sub WritePlcVariables(Address As String, value As String)
Try
Dim dValue As Double = 0
StringToDouble(value, dValue)
StringToDoubleAdv(value, dValue)
Select Case Address
Case "E30099" ' in realta' per scrivere si usa la %RD0C.L
Dim nRes = WriteLadderVar(m_nPortWVariables, RL, &HD0C, 1, dValue)
@@ -512,7 +514,7 @@ Public Class NUMAxiumPcToolkitComm
End Sub
Friend Sub CloseReadELS()
'''objDPlcVariables.CloseReadList()
'objDPlcVariables.CloseReadList()
End Sub
Public Sub RefreshAllVars()
@@ -574,11 +576,11 @@ Public Class NUMAxiumPcToolkitComm
Case "%R3.2"
nRet = ReadLadderVar(nPortVariables, R2, &H3, 1, MyData, SYN)
nRes = If(MyData.data(0) <> 0, 1, 0)
'''EgtOutLog("Variabile: " & Var.sAddress & "DVal: " & nRes & " Valore: " & MyData.data(0) & "," & MyData.data(1) & "," & MyData.data(2) & "," & MyData.data(3))
'EgtOutLog("Variabile: " & Var.sAddress & "DVal: " & nRes & " Valore: " & MyData.data(0) & "," & MyData.data(1) & "," & MyData.data(2) & "," & MyData.data(3))
Case "%R3.1"
nRet = ReadLadderVar(nPortVariables, R1, &H3, 1, MyData, SYN)
nRes = If(MyData.data(0) <> 0, 1, 0)
'''EgtOutLog("Variabile: " & Var.sAddress & "DVal: " & nRes & " Valore: " & MyData.data(0) & "," & MyData.data(1) & "," & MyData.data(2) & "," & MyData.data(3))
'EgtOutLog("Variabile: " & Var.sAddress & "DVal: " & nRes & " Valore: " & MyData.data(0) & "," & MyData.data(1) & "," & MyData.data(2) & "," & MyData.data(3))
Case "%V800.L"
nRet = ReadLadderVar(nPortVariables, VL, &H800, 4, MyData, SYN)
nRes = BitConverter.ToInt32(MyData.data, 0)
@@ -639,7 +641,6 @@ Public Class NUMAxiumPcToolkitComm
Dim FileTransferThread As New Thread(Sub()
' leggo variabile E30099
Dim SendPermissionVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = SENDPERMISSION)
Dim dTemp As Double = 0
Dim nSendPermission As Integer = 0
EgtOutLog("Inizio invio programma")
While nSendPermission <> 2
@@ -647,8 +648,7 @@ Public Class NUMAxiumPcToolkitComm
EgtOutLog("Inizio ciclo verifica diverso da 2")
' leggo valore
If Not IsNothing(SendPermissionVariable.sValue) Then
StringToDouble(SendPermissionVariable.sValue, dTemp)
Integer.TryParse(dTemp, nSendPermission)
Integer.TryParse(SendPermissionVariable.sValue, nSendPermission)
EgtOutLog("Lettura variabile E30099: " & nSendPermission)
Else
EgtOutLog("nSendPermission = -1")
@@ -699,6 +699,12 @@ Public Class NUMAxiumPcToolkitComm
Try
ISONumVariable.sValue = SentMachGroup.Name
ISOSentVariable.sValue = 0
'Dim TempISOSentVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = ISO_SENT)
'While ISOSentVariable.sValue <> "0"
' 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)
Catch ex As Exception
EgtOutLog("Error write var after download: " & ex.Message)
@@ -708,6 +714,7 @@ Public Class NUMAxiumPcToolkitComm
nRes = DownLoadFileAsyn(nPortFileTransfer, nFileType, sFilePath, DNC_MODE_ABORT, nIndex)
SendPermissionVariable.sValue = 0
m_BytesTransferedCounter = 0
Threading.Thread.Sleep(1000)
m_bIsTransferActive = False
Return
End Sub)
@@ -789,7 +796,7 @@ Public Class NUMAxiumPcToolkitComm
Friend Sub WriteNCVariables(Address As String, value As String)
Try
Dim dValue As Double = 0
StringToDouble(value, dValue)
StringToDoubleAdv(value, dValue)
Dim nType As eVarious4
Dim nValue As Integer = 0
Dim MyData As New My_data_struct
@@ -900,10 +907,11 @@ Public Class NUMAxiumPcToolkitComm
Next
For index As Integer = 0 To ErrorNumber.Count - 1
Dim Ind As Integer = index
Dim NewMessageInList As ReadMessages = m_ReadFXMessages.FirstOrDefault(Function(x) x.CMsgCncNumber = 0.ToString() AndAlso
x.CMsgErrorType = 6.ToString() AndAlso
x.CMsgErrorIndex = "" AndAlso
x.CMsgErrorNumber = ErrorNumber(index).ToString() AndAlso
x.CMsgErrorNumber = ErrorNumber(Ind).ToString() AndAlso
x.CMsgErrorLine = "" AndAlso
x.CMsgErrorMessage = "")
' se il messaggio e' gia' in lista
@@ -1113,9 +1121,9 @@ Public Class NUMAxiumPcToolkitComm
Friend Sub ReadCncMode()
Dim nRet As Short = -1
Dim nMode As UInt16
'''EgtOutLog("Pre ReadObjectVarious2")
'EgtOutLog("Pre ReadObjectVarious2")
nRet = ReadObjectVarious2(nPortVariables, eVarious2.MODE, nMode, SYN)
'''EgtOutLog("ReadObjectVarious2 Ret: " & nRet & " Mode: " & nMode)
'EgtOutLog("ReadObjectVarious2 Ret: " & nRet & " Mode: " & nMode)
If nRet <> 0 Then
EgtOutLog("Reading CncMode failed! Error: " & nRet)
Return
+30 -3
View File
@@ -53,7 +53,7 @@ Public Class NUMFlexiumComm
Private m_ReadFXMessages As New List(Of ReadMessages)
Private m_ReadOperatorMessages As New List(Of ReadMessages)
' lista variabili in lettura
Private Shared m_ReadingVars(100) As CommVar
Private Shared m_ReadingVars(230) As CommVar
Private m_BytesTransferedCounter As Integer
Private m_LinearAxisPrecision As Integer
@@ -368,6 +368,31 @@ Public Class NUMFlexiumComm
Friend Sub FileDownload(sFileType As String, sFilePath As String)
Dim _Return_Download As Short
'' leggo variabile E30099
'Dim SendPermissionVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = SENDPERMISSION)
'Dim dTemp As Double = 0
'Dim nSendPermission As Integer = 0
'EgtOutLog("Inizio invio programma")
'While nSendPermission <> 2
' Dim bFirstWriteOne = True
' EgtOutLog("Inizio ciclo verifica diverso da 2")
' ' leggo valore
' If Not IsNothing(SendPermissionVariable.sValue) Then
' StringToDoubleAdv(SendPermissionVariable.sValue, dTemp)
' Integer.TryParse(dTemp, nSendPermission)
' EgtOutLog("Lettura variabile E30099: " & nSendPermission)
' Else
' EgtOutLog("nSendPermission = -1")
' nSendPermission = -1
' End If
' ' se uguale a zero ci scrivo uno
' If nSendPermission = 0 And bFirstWriteOne Then
' bFirstWriteOne = False
' SendPermissionVariable.sValue = 1
' EgtOutLog("Scrittura variabile E30099 = 1")
' End If
' Threading.Thread.Sleep(1000)
'End While
_Return_Download = objDFileTransfer.FileDownload2(10, sFileType, sFilePath, "", 1, 0)
@@ -424,7 +449,7 @@ Public Class NUMFlexiumComm
Friend Sub WriteNCVariables(Address As String, value As String)
Try
Dim dValue As Double = 0
StringToDouble(value, dValue)
StringToDoubleAdv(value, dValue)
Dim rc As Short = objDVariables.WriteVariables2(2, objDGroupManager.Handle, Address, dValue)
If rc <> 0 Then EgtOutLog(" objDVariables.WriteVariables2() Error : " & rc)
@@ -451,7 +476,9 @@ Public Class NUMFlexiumComm
Private Sub objDGeneralFunction_ProgramActivated(ByVal nerrorCode As Short)
EgtOutLog("Part program activated:" & " " & nerrorCode)
DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & nerrorCode))
'DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandTypes.SENDPROG, CommandStates.OK, ResultTypes.EXECUTED, "Part program activated:" & " " & nerrorCode))
' scrivo evento programma attivato
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.PROGRAM_ACTIVATION, "", nerrorCode, DbControllers.SupervisorId))
End Sub
Private Sub objDGeneralFunction_OnCncStart(ByVal errorCode As Short)
@@ -3,5 +3,7 @@
Public Const MDI_MSG As String = "MDI"
Public Const PLC_MSG As String = "PLC"
Public Const CNC_MSG As String = "CNC"
Public Const INPUT_MSG As String = "INPUT"
Public Const OUTPUT_MSG As String = "OUTPUT"
End Module
@@ -99,6 +99,41 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</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>
<Reference Include="APLog">
<HintPath>..\ExtLibs\APLog.dll</HintPath>
@@ -108,8 +143,8 @@
<HintPath>..\ExtLibs\APServer.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Csv, Version=1.0.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Csv.1.0.31\lib\net40\Csv.dll</HintPath>
@@ -131,8 +166,8 @@
<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>
</Reference>
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="Interop.FXLog">
<HintPath>..\ExtLibs\Interop.FXLog.dll</HintPath>
@@ -148,14 +183,14 @@
<Reference Include="ISOCNC.Remoting">
<HintPath>..\ExtLibs\ISOCNC.Remoting.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.DotNet.PlatformAbstractions, Version=2.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
@@ -207,9 +242,12 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" />
<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.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<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>
@@ -225,8 +263,8 @@
<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>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.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>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<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>
@@ -235,6 +273,9 @@
</Reference>
<Reference Include="System.Runtime.Remoting" />
<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.Web" />
<Reference Include="System.Windows.Forms" />
@@ -543,6 +584,7 @@
<CustomToolNamespace>My.Resources</CustomToolNamespace>
</EmbeddedResource>
<None Include="app.config" />
<None Include="app.manifest" />
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
@@ -81,6 +81,13 @@
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!--PosZ - Posizione in Z-->
<DataGridTextColumn x:Key="colPOSZ" Binding="{Binding sPosZ}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.PosZ_Msg,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!--MAT - Materiale-->
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
<DataGridTextColumn.Header>
@@ -13,6 +13,13 @@ Public Class RawPartListVM
End Get
End Property
Private m_colRawPart_PosZ As EgtDataGridColumn
Public ReadOnly Property colRawPart_PosZ As EgtDataGridColumn
Get
Return m_colRawPart_PosZ
End Get
End Property
Private m_RawPartColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property RawPartColumns As ObservableCollection(Of EgtDataGridColumn)
Get
@@ -55,6 +62,12 @@ Public Class RawPartListVM
End Get
End Property
Public ReadOnly Property PosZ_Msg As String
Get
Return EgtMsg(61728)
End Get
End Property
Public ReadOnly Property Material_Msg As String
Get
Return EgtMsg(61607)
@@ -84,23 +97,27 @@ Public Class RawPartListVM
Map.SetRefRawPartListVM(Me)
' carico le colonne della datagrid
GetPrivateProfileColumns(S_RAWPARTLIST_SUPERVISOR, RawPartColumns)
' recupero riferimento a colonna StartCut
' recupero riferimento a colonna StartCut e PosZ
m_colRawPart_StartCut = m_RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_STARTCUT)
m_colRawPart_PosZ = m_RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSZ)
End Sub
#End Region ' CONSTRUCTOR
Friend Sub UpdateColumns(nMachType As MachineType)
If nMachType = MachineType.BEAM Then
If Not IsNothing(m_colRawPart_StartCut) Then
m_colRawPart_StartCut.ColumnVisibility = Visibility.Visible
End If
'RawPartColumns.Clear()
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
' aggiorno la visibilità delle colonne
For Each col In RawPartColumns
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
Next
If Not IsNothing(m_colRawPart_StartCut) Then
m_colRawPart_StartCut.ColumnVisibility = Visibility.Visible
End If
If Not IsNothing(m_colRawPart_PosZ) Then
m_colRawPart_PosZ.ColumnVisibility = Visibility.Collapsed
End If
'RawPartColumns.Clear()
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
ElseIf nMachType = MachineType.WALL Then
' aggiorno la visibilità delle colonne
For Each col In RawPartColumns
@@ -109,6 +126,9 @@ Public Class RawPartListVM
If Not IsNothing(m_colRawPart_StartCut) Then
m_colRawPart_StartCut.ColumnVisibility = Visibility.Collapsed
End If
If Not IsNothing(m_colRawPart_PosZ) Then
m_colRawPart_PosZ.ColumnVisibility = Visibility.Visible
End If
'RawPartColumns.Clear()
'GetPrivateProfileColumns(S_RAWPARTLIST_WALL, RawPartColumns)
End If
@@ -1,4 +1,5 @@
Imports System.Collections.ObjectModel
Imports System.Globalization
Imports System.IO
Imports System.Windows.Threading
Imports EgtBEAMWALL.Core
@@ -810,6 +811,8 @@ Public Class LeftPanelVM
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.WIP)
Part.dtStartTime = Time
Part.nProduction_State = ItemState.WIP
' scrivo evento inizio pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(Time - TimeSpan.FromSeconds(1), Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, 1, DbControllers.SupervisorId))
' se e' il primo ad essere lavorato
If Not MachGroup.PartVMList.Any(Function(x) x IsNot Part AndAlso x.dtStartTime > DateTime.MinValue) Then
' se non e' gia' in coda per essere prodotto
@@ -837,6 +840,8 @@ Public Class LeftPanelVM
MachGroup.dtStartTime = Time
MachGroup.nProduction_State = ItemState.WIP
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.Production_Background))
' scrivo evento inizio MachGroup su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(Time - TimeSpan.FromSeconds(1), Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, 1, DbControllers.SupervisorId))
' blocco produzione di tutti gli altri perche' iniziato questo
MyMachGroupVM.UpdateProduceIsEnabledForAll()
End If
@@ -846,6 +851,8 @@ Public Class LeftPanelVM
DbControllers.m_PartController.UpdateStatus(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, ItemState.Produced)
Part.dtEndTime = Time
Part.nProduction_State = ItemState.Produced
' scrivo evento fine pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(Time, Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Part.nPartId, 2, DbControllers.SupervisorId))
If MachGroup.PartVMList.All(Function(x) x.nProduction_State >= ItemState.Produced) Then
'aggiorno anche fine MachGroup
DbControllers.m_MachGroupController.UpdateEnd(Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, Time)
@@ -861,6 +868,8 @@ Public Class LeftPanelVM
NotifyPropertyChanged(NameOf(DoneRawPart_IsEnabled))
NotifyPropertyChanged(NameOf(MoveRawPart_IsEnabled))
NotifyPropertyChanged(NameOf(ResetRawPart_IsEnabled))
' scrivo evento fine MachGroup su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(Time, Map.refSupervisorManagerVM.CurrProd.nProdId, MachGroup.Id, 2, DbControllers.SupervisorId))
' se avanzamento singolo, sblocco produzione di tutti gli altri
If CurrentMachine.Flow = FlowTypes.ONEBYONE Then
MyMachGroupVM.UpdateProduceIsEnabledForAll()
@@ -995,14 +1004,48 @@ Public Class LeftPanelVM
Private Sub CreateDataFile(sFilePath As String, SelPart As PartVM, SelMachGroup As MyMachGroupVM)
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]
sFileText.Add("[Main]")
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("Var4=$MATERIAL$," & SelPart.sMATERIAL)
'sFileText.Add("Var5=$Thickness$," & SelPart.Thickness)
'sFileText.Add("Var6=$Storage$," & SelPart.WarehousePosition)
bOk = EgtGetInfo(nBtlInfoId, BTL_GEN_PROJNUM, sInfo)
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
File.WriteAllLines(sFilePath, sFileText)
Catch ex As Exception
@@ -541,14 +541,18 @@ Public Class MachCommandMessagePanelVM
Map.refMachManaging.Num_Axium_APServer.GetGeneralFunctions()
End If
End If
' scrivo evento programma attivato
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.CONNECTION, "", 0, DbControllers.SupervisorId))
End If
Case CommandTypes.DISCONNECT
If CommandState = CommandStates.OK Then
_Connected = False
NotifyPropertyChanged(NameOf(Connect_Background))
' scrivo evento programma attivato
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachCommandLog(LogEvent.MachineCommands.DISCONNECTION, "", 0, DbControllers.SupervisorId))
End If
End Select
DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandType, CommandState, ResultType, Params))
'DbControllers.m_LogMachineController.Create(MachLog.CreateResultLog(CommandType, CommandState, ResultType, Params))
End Sub
Friend Sub CloseCallbackDlg(ByRef bCancel As Boolean)
' serve?
@@ -615,7 +619,8 @@ Public Class MachCommandMessagePanelVM
' fermo timer degli allarmi
m_AlarmTimer.Stop()
End If
DbControllers.m_LogMachineController.Create(MachLog.CreateAlarmLog(AlarmOperation, AlarmType, AlarmMessage, AlarmCode, AlarmDateTime))
'DbControllers.m_LogMachineController.Create(MachLog.CreateAlarmLog(AlarmOperation, AlarmType, AlarmMessage, AlarmCode, AlarmDateTime))
DbControllers.m_LogMachineController.Create(LogEvent.CreateAlarmLog(DateTime.Now(), AlarmOperation & LogEvent.cSeparator & AlarmType & LogEvent.cSeparator & AlarmMessage & LogEvent.cSeparator & AlarmCode & LogEvent.cSeparator & AlarmDateTime, DbControllers.m_SupervisorId))
End Sub
Friend Sub NUMAlarmCallbackDlg(ByVal CncNumber As Integer, ByVal AlarmOperation As Integer, ByVal ErrorTyp As String, ByVal ErrorIndex As String, ByVal ErrorNumber As String, ByVal ErrorLine As String, ByVal ErrorMessage As String, ByVal ErrorAdditional As String)
@@ -661,10 +666,17 @@ Public Class MachCommandMessagePanelVM
ErrorAdditionalMsg = "Line Number"
ErrorNumberMsg = "CN:"
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"
AlarmMessage = If(nErrorNumber <> 0, ErrorNumberMsg & ": " & nErrorNumber & " - ", "") &
If(nErrorExtNumber <> 0, " - " & ErrorExtNumberMsg & ": " & nErrorExtNumber, "") &
" " & ErrorMessage
" " & sErrorMessage
Case NUM_ErrorTypes.Drive_Error
ErrorIndexMsg = "Azionamento: Asse"
ErrorNumberMsg = "Ext"
@@ -785,7 +797,8 @@ Public Class MachCommandMessagePanelVM
' fermo timer degli allarmi
m_AlarmTimer.Stop()
End If
DbControllers.m_LogMachineController.Create(MachLog.CreateAlarmLog(AlarmOperation, ErrorTyp, AlarmMessage, AlarmCode, DateTime.Now))
'DbControllers.m_LogMachineController.Create(MachLog.CreateAlarmLog(AlarmOperation, ErrorTyp, AlarmMessage, AlarmCode, DateTime.Now))
DbControllers.m_LogMachineController.Create(LogEvent.CreateAlarmLog(DateTime.Now(), AlarmOperation & LogEvent.cSeparator & ErrorTyp & LogEvent.cSeparator & AlarmMessage & LogEvent.cSeparator & AlarmCode & LogEvent.cSeparator, DbControllers.m_SupervisorId))
End Sub
Friend Sub AxisCoordinatesCallbackDlg(AxisValue As Double, AxisIndex As Integer)
@@ -808,7 +821,8 @@ Public Class MachCommandMessagePanelVM
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
Map.refLeftPanelVM.SetOPState(NewState)
End Select
DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
'DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachineStateLog(newOpState, DbControllers.m_SupervisorId))
End Sub
Friend Sub OpModeCallbackDlg(newOpState As Integer)
@@ -821,7 +835,8 @@ Public Class MachCommandMessagePanelVM
Case NCTypes.NUM_FLEXIUM, NCTypes.NUM_AXIUM_APSERVER, NCTypes.NUM_AXIUM_PCTOOLKIT
Map.refLeftPanelVM.SetOPMode(NewState)
End Select
DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
'DbControllers.m_LogMachineController.Create(MachLog.CreateOPStateLog(newOpState))
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachineModeLog(newOpState, DbControllers.m_SupervisorId))
End Sub
Friend Sub ChannelCallbackDlg(NewChannelId As Short)
@@ -840,8 +855,9 @@ Public Class MachCommandMessagePanelVM
Case "AsseX", "AsseY", "AsseZ", "AsseC", "AsseB"
SetAxisValue(VarName, VarValue)
End Select
'DbControllers.m_LogMachineController.Create(MachLog.CreateReadLog(CommandExecutedCorrectly, VarAddress, VarValue))
DbControllers.m_LogMachineController.Create(LogEvent.CreateReadVarLog(VarAddress, VarValue, DbControllers.SupervisorId))
End If
DbControllers.m_LogMachineController.Create(MachLog.CreateReadLog(CommandExecutedCorrectly, VarAddress, VarValue))
End Sub
Private Sub SetAxisValue(VarName As String, VarValue As String)
@@ -132,7 +132,7 @@ Public Class MyMachGroupVM
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c)
StringToDouble(sSplitInfo(1), MyMachGroupM.dStartCut)
StringToDoubleAdv(sSplitInfo(1), MyMachGroupM.dStartCut)
Else
MyMachGroupM.dStartCut = 0
End If
@@ -286,70 +286,59 @@ Public Class MachManaging
Dim dTemp As Double = 0
Dim nTemp As Integer = 0
If Not IsNothing(ResetVariable.sValue) Then
StringToDouble(ResetVariable.sValue, dTemp)
Integer.TryParse(dTemp, nReset_State)
Integer.TryParse(ResetVariable.sValue, nReset_State)
Else
nReset_State = 1
End If
If Not IsNothing(StartVariable.sValue) Then
StringToDouble(StartVariable.sValue, dTemp)
Integer.TryParse(dTemp, nTemp)
Integer.TryParse(StartVariable.sValue, nTemp)
nStart_State = (nTemp = 1)
Else
nStart_State = -1
End If
If Not IsNothing(StopVariable.sValue) Then
StringToDouble(StopVariable.sValue, dTemp)
Integer.TryParse(dTemp, nTemp)
Integer.TryParse(StopVariable.sValue, nTemp)
nStop_State = (nTemp = 1)
Else
nStop_State = -1
End If
If Not IsNothing(ProdVariable.sValue) Then
StringToDouble(ProdVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Prod)
Integer.TryParse(ProdVariable.sValue, nP_Prod)
Else
nP_Prod = -1
End If
If Not IsNothing(MachGroupVariable.sValue) Then
StringToDouble(MachGroupVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Machgroup)
Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
Else
nP_Machgroup = -1
End If
If Not IsNothing(PartVariable.sValue) Then
StringToDouble(PartVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Part)
Integer.TryParse(PartVariable.sValue, nP_Part)
Else
nP_Part = -1
End If
If Not IsNothing(StateVariable.sValue) Then
StringToDouble(StateVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_State)
Integer.TryParse(StateVariable.sValue, nP_State)
Else
nP_State = -1
End If
If Not IsNothing(ISONumVariable.sValue) Then
StringToDouble(ISONumVariable.sValue, dTemp)
Integer.TryParse(dTemp, nISO_Num)
Integer.TryParse(ISONumVariable.sValue, nISO_Num)
Else
nISO_Num = -1
End If
If Not IsNothing(ISOSentVariable.sValue) Then
StringToDouble(ISOSentVariable.sValue, dTemp)
Integer.TryParse(dTemp, nISO_Sent)
Integer.TryParse(ISOSentVariable.sValue, nISO_Sent)
Else
nISO_Sent = -1
End If
If Not IsNothing(RunningVariable.sValue) Then
StringToDouble(RunningVariable.sValue, dTemp)
Integer.TryParse(dTemp, nRunning)
Integer.TryParse(RunningVariable.sValue, nRunning)
Else
nRunning = -1
End If
If Not IsNothing(MachIndexVariable.sValue) Then
StringToDouble(MachIndexVariable.sValue, dTemp)
Integer.TryParse(dTemp, nCurrMachIndex)
Integer.TryParse(MachIndexVariable.sValue, nCurrMachIndex)
Else
nCurrMachIndex = -1
End If
@@ -362,78 +351,67 @@ Public Class MachManaging
Case NCTypes.NUM_AXIUM_PCTOOLKIT
' leggo tutte le variabili
Num_Axium_PCToolkit.RefreshAllVars()
'''EgtOutLog("Post lettura variabili")
'EgtOutLog("Post lettura variabili")
Dim dTemp As Double = 0
Dim nTemp As Integer = 0
If Not IsNothing(ResetVariable.sValue) Then
StringToDouble(ResetVariable.sValue, dTemp)
Integer.TryParse(dTemp, nReset_State)
Integer.TryParse(ResetVariable.sValue, nReset_State)
Else
nReset_State = 1
End If
If Not IsNothing(StartVariable.sValue) Then
StringToDouble(StartVariable.sValue, dTemp)
Integer.TryParse(dTemp, nTemp)
Integer.TryParse(StartVariable.sValue, nTemp)
nStart_State = (nTemp = 1)
Else
nStart_State = -1
End If
If Not IsNothing(StopVariable.sValue) Then
StringToDouble(StopVariable.sValue, dTemp)
Integer.TryParse(dTemp, nTemp)
Integer.TryParse(StopVariable.sValue, nTemp)
nStop_State = (nTemp = 1)
Else
nStop_State = -1
End If
If Not IsNothing(ProdVariable.sValue) Then
StringToDouble(ProdVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Prod)
Integer.TryParse(ProdVariable.sValue, nP_Prod)
Else
nP_Prod = -1
End If
If Not IsNothing(MachGroupVariable.sValue) Then
StringToDouble(MachGroupVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Machgroup)
Integer.TryParse(MachGroupVariable.sValue, nP_Machgroup)
Else
nP_Machgroup = -1
End If
If Not IsNothing(PartVariable.sValue) Then
StringToDouble(PartVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_Part)
Integer.TryParse(PartVariable.sValue, nP_Part)
Else
nP_Part = -1
End If
If Not IsNothing(StateVariable.sValue) Then
StringToDouble(StateVariable.sValue, dTemp)
Integer.TryParse(dTemp, nP_State)
Integer.TryParse(StateVariable.sValue, nP_State)
Else
nP_State = -1
End If
If Not IsNothing(ISONumVariable.sValue) Then
StringToDouble(ISONumVariable.sValue, dTemp)
Integer.TryParse(dTemp, nISO_Num)
Integer.TryParse(ISONumVariable.sValue, nISO_Num)
Else
nISO_Num = -1
End If
If Not IsNothing(ISOSentVariable.sValue) Then
StringToDouble(ISOSentVariable.sValue, dTemp)
Integer.TryParse(dTemp, nISO_Sent)
Integer.TryParse(ISOSentVariable.sValue, nISO_Sent)
Else
nISO_Sent = -1
End If
If Not IsNothing(RunningVariable.sValue) Then
StringToDouble(RunningVariable.sValue, dTemp)
Integer.TryParse(dTemp, nRunning)
Integer.TryParse(RunningVariable.sValue, nRunning)
Else
nRunning = -1
End If
If Not IsNothing(MachIndexVariable.sValue) Then
StringToDouble(MachIndexVariable.sValue, dTemp)
Integer.TryParse(dTemp, nCurrMachIndex)
Integer.TryParse(MachIndexVariable.sValue, nCurrMachIndex)
Else
nCurrMachIndex = -1
End If
'''EgtOutLog("Post scrittura variabili lette")
'EgtOutLog("Post scrittura variabili lette")
' se indice lavorazione positivo, lo aggiorno
If nCurrMachIndex > 0 AndAlso nReset_State = 0 Then
m_nMachIndex = nCurrMachIndex
@@ -469,7 +447,7 @@ Public Class MachManaging
Else
OpState = OPStates.End
End If
If OpState <> Map.refLeftPanelVM.SelOPState.Id Then
If IsNothing(Map.refLeftPanelVM.SelOPState) OrElse OpState <> Map.refLeftPanelVM.SelOPState.Id Then
m_OpStateCallbackDlg(OpState)
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)
' se pezzo = -1 devo dare start a tutti i pezzi del MachGroup
If nP_Part = -1 Then
For Each Part In MachGroup.PartVMList
' scrivo data start su Db pezzo
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.WIP)
' scrivo stato start
Part.nProduction_State = ItemState.WIP
Part.dtStartTime = dtStart
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' scrivo evento inizio pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
Next
If Not IsNothing(MachGroup) Then
For Each Part In MachGroup.PartVMList
' scrivo data start su Db pezzo
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.WIP)
' scrivo stato start
Part.nProduction_State = ItemState.WIP
Part.dtStartTime = dtStart
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' scrivo evento inizio pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
Next
End If
Else
' scrivo data start su Db pezzo
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, nP_Part, dtStart)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.WIP)
' recupero pezzo
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
' scrivo stato start
Part.nProduction_State = ItemState.WIP
Part.dtStartTime = dtStart
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
If Not IsNothing(MachGroup) Then
' recupero pezzo
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
If Not IsNothing(Part) Then
' scrivo stato start
Part.nProduction_State = ItemState.WIP
Part.dtStartTime = dtStart
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
End If
End If
' scrivo evento inizio pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtStart, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
End If
@@ -577,9 +561,11 @@ Public Class MachManaging
DbControllers.m_MachGroupController.UpdateStart(nP_Prod, nP_Machgroup, dtStart)
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.WIP)
' scrivo stato start
MachGroup.MyMachGroupM.SetProductionState(ItemState.WIP)
MachGroup.dtStartTime = dtStart
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
If Not IsNothing(MachGroup) Then
MachGroup.MyMachGroupM.SetProductionState(ItemState.WIP)
MachGroup.dtStartTime = dtStart
MachGroup.NotifyPropertyChanged(NameOf(MachGroup.nProduction_State))
End If
' scrivo evento inizio MachGroup su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreateMachGroupStateLog(dtStart, nP_Prod, nP_Machgroup, nP_State, DbControllers.SupervisorId))
End If
@@ -591,44 +577,50 @@ Public Class MachManaging
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
If nP_Part = -1 Then
For Each Part In MachGroup.PartVMList
' scrivo data end su Db pezzo
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, Part.nPartId, dtEnd)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.Produced)
' scrivo stato end
Part.nProduction_State = ItemState.Produced
Part.dtEndTime = dtEnd
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' resetto stato redo
Part.bRedo = False
' se non impostata data start
If Part.dtStartTime = DateTime.MinValue Then
' scrivo data start su Db pezzo
Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
Part.dtStartTime = dtStart
End If
' scrivo evento fine pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
Next
If Not IsNothing(MachGroup) Then
For Each Part In MachGroup.PartVMList
' scrivo data end su Db pezzo
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, Part.nPartId, dtEnd)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, Part.nPartId, ItemState.Produced)
' scrivo stato end
Part.nProduction_State = ItemState.Produced
Part.dtEndTime = dtEnd
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' resetto stato redo
Part.bRedo = False
' se non impostata data start
If Part.dtStartTime = DateTime.MinValue Then
' scrivo data start su Db pezzo
Dim dtStart As DateTime = Part.dtEndTime - TimeSpan.FromSeconds(60)
DbControllers.m_PartController.UpdateStart(nP_Prod, nP_Machgroup, Part.nPartId, dtStart)
Part.dtStartTime = dtStart
End If
' scrivo evento fine pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, Part.nPartId, nP_State, DbControllers.SupervisorId))
Next
End If
Else
' scrivo data end su Db pezzo
DbControllers.m_PartController.UpdateEnd(nP_Prod, nP_Machgroup, nP_Part, dtEnd)
DbControllers.m_PartController.UpdateStatus(nP_Prod, nP_Machgroup, nP_Part, ItemState.Produced)
' recupero pezzo
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
' scrivo stato end
Part.nProduction_State = ItemState.Produced
Part.dtEndTime = dtEnd
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' resetto stato redo
Part.bRedo = False
If Not IsNothing(MachGroup) Then
' recupero pezzo
Dim Part As PartVM = MachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nP_Part)
If Not IsNothing(Part) Then
' scrivo stato end
Part.nProduction_State = ItemState.Produced
Part.dtEndTime = dtEnd
Part.NotifyPropertyChanged(NameOf(Part.nProduction_State))
' resetto stato redo
Part.bRedo = False
End If
End If
' scrivo evento fine pezzo su DB
DbControllers.m_LogMachineController.Create(LogEvent.CreatePartStateLog(dtEnd, nP_Prod, nP_Machgroup, nP_Part, nP_State, DbControllers.SupervisorId))
End If
' 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
DbControllers.m_MachGroupController.UpdateEnd(nP_Prod, nP_Machgroup, dtEnd)
DbControllers.m_MachGroupController.UpdateStatus(nP_Prod, nP_Machgroup, ItemState.Produced)
@@ -674,13 +666,17 @@ Public Class MachManaging
End If
' se pezzo = -1 stampo etichette di tutti i pezzi del MachGroup
If nP_Part = -1 Then
For Each Part In MachGroup.PartVMList
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
Next
If Not IsNothing(MachGroup) Then
For Each Part In MachGroup.PartVMList
Map.refLeftPanelVM.PrintLabel(MachGroup, Part)
Next
End If
Else
' recupero pezzo
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
' attesa per essere sicuro che abbia scritto e riletto variabili
Threading.Thread.Sleep(300)
@@ -706,12 +702,12 @@ Public Class MachManaging
For VParIndex = 1 To sVs.Length - 1
Dim VPar() As String = sVs(VParIndex).Split("="c)
VPar(1) = VPar(1).Trim
StringToDouble(VPar(1), dVPars(VParIndex))
StringToDoubleAdv(VPar(1), dVPars(VParIndex - 1))
Next
' li scrivo nel CN
For Index As Integer = 1 To 10
Dim sValue As String = ""
DoubleToString(dVPars(Index), sValue)
sValue = DoubleToString(dVPars(Index - 1), 2)
Tpa.RWVariableManager.WriteVarByName(VPAR & Index.ToString(), sValue)
Next
m_NextBarId = MyMachGroup.Id
@@ -807,6 +803,7 @@ Public Class MachManaging
Case CommandTypes.READ_TPA
Tpa.RWVariableManager.RefreshVar(Command.sVariable)
Case CommandTypes.WRITE
'EgtOutLog("Write" & Command.sVariable & " " & Command.sVariables(1) & " " & Command.nVariable)
WriteVar(Command.sVariable, Command.sVariables(1), Command.nVariable)
Case CommandTypes.DELETEALARMS
DeleteAlarms()
@@ -1169,7 +1166,7 @@ Public Class MachManaging
EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, "", sVariable, IpFileName)
If String.IsNullOrWhiteSpace(sVariable) Then Return Nothing
Dim sVariableValues() As String = sVariable.Split(","c)
If Not sVariableValues.Count >= 4 Then Return Nothing
'If Not sVariableValues.Count >= 4 Then Return Nothing
For Index As Integer = 0 To sVariableValues.Count - 1
sVariableValues(Index) = sVariableValues(Index).Trim()
Next
@@ -1200,7 +1197,25 @@ Public Class MachManaging
Case S_OUTPUTVARIABLES
Paragraph = Paragraphs.OUTPUT
End Select
Return New CommVar(sVariableValues(0), sVariableValues(1), ReadType, Type, Paragraph)
Dim sDescription As String = ""
If sVariableValues.Length >= 5 Then
Dim nDescription As Integer
If Integer.TryParse(sVariableValues(4), nDescription) Then
Dim MsgParagraph As MsgParagraphs
Select Case Paragraph
Case Paragraphs.INPUT
MsgParagraph = MsgParagraphs.INPUT
Case Paragraphs.OUTPUT
MsgParagraph = MsgParagraphs.OUTPUT
Case Else
MsgParagraph = MsgParagraphs.INPUT
End Select
sDescription = MachMsg(MsgParagraph, nDescription)
Else
sDescription = sVariableValues(4)
End If
End If
Return New CommVar(sVariableValues(0), sVariableValues(1), ReadType, Type, Paragraph, sDescription)
End Function
Private Sub ReadPLCMessages()
@@ -1209,10 +1224,8 @@ Public Class MachManaging
Dim nIndex As Integer = Index
Dim PLCMessagesVariable As Variable = Map.refMachCommandMessagePanelVM.MainVariablesList.FirstOrDefault(Function(x) x.sName = PLC_MESSAGES & nIndex)
If IsNothing(PLCMessagesVariable) OrElse IsNothing(PLCMessagesVariable.sValue) Then Return
Dim dTemp As Double = 0
Dim nTemp As Integer = 0
StringToDouble(PLCMessagesVariable.sValue, dTemp)
Integer.TryParse(dTemp, nTemp)
Integer.TryParse(PLCMessagesVariable.sValue, nTemp)
Dim Bytes As Byte() = BitConverter.GetBytes(nTemp)
Dim NewBytes As Byte() = BitConverter.GetBytes(nTemp)
For nBIndex = Bytes.Count - 1 To 0 Step -1
@@ -59,7 +59,7 @@ Public Class RWVariableManager
Public Shared Function InitVar(Name As String, Address As String, Type As CommVar.ReadTypes) As Integer
Dim Index As Integer = Array.IndexOf(m_ReadingVars, Nothing)
m_ReadingVars(Index) = New CommVar(Name, Address, Type, CommVar.Types.NULL, CommVar.Paragraphs.NULL)
m_ReadingVars(Index) = New CommVar(Name, Address, Type, CommVar.Types.NULL, CommVar.Paragraphs.NULL, "")
Return Index
End Function
@@ -101,7 +101,7 @@ Public Class RWVariableManager
Case S_OUTPUTVARIABLES
Paragraph = Paragraphs.OUTPUT
End Select
Return New CommVar(sVariableValues(0), sVariableValues(1), Type, CommVar.Types.NULL, Paragraph)
Return New CommVar(sVariableValues(0), sVariableValues(1), Type, CommVar.Types.NULL, Paragraph, "")
End Function
Public Sub RefreshVar(Name As String)
@@ -148,7 +148,7 @@ Public Class RWVariableManager
Public Sub ReadVar(Name As String, ByRef Value As Double)
Dim nIndex As Integer = GetIndexFromName(Name)
If nIndex >= 0 Then
Value = StringToDouble(m_ReadedVars(nIndex), 5)
Value = StringToDoubleAdv(m_ReadedVars(nIndex), 5)
Else
Value = -999999999
End If
@@ -266,6 +266,7 @@ Public Class CommVar
m_sName = value
End Set
End Property
Private m_sAddress As String
Public Property sAddress As String
Get
@@ -275,12 +276,14 @@ Public Class CommVar
m_sAddress = value
End Set
End Property
Private m_nReadType As ReadTypes
Public ReadOnly Property nReadType As ReadTypes
Get
Return m_nReadType
End Get
End Property
Private m_nType As Types
Public ReadOnly Property nType As Types
Get
@@ -306,6 +309,13 @@ Public Class CommVar
If bNewValue Then RaiseEvent NewValue(Me, New NewValueEventArgs(Value))
End Sub
Private m_sDescription As String
Public ReadOnly Property sDescription As String
Get
Return m_sDescription
End Get
End Property
Private m_bReaded As Boolean
Public ReadOnly Property bReaded As Boolean
Get
@@ -324,12 +334,13 @@ Public Class CommVar
' indice usato in liste lettura NUM
Friend Index As Integer = -1
Sub New(Name As String, Address As String, ReadType As ReadTypes, Type As Types, Paragraph As Paragraphs)
Sub New(Name As String, Address As String, ReadType As ReadTypes, Type As Types, Paragraph As Paragraphs, sDescription As String)
m_sName = Name
m_sAddress = Address
m_nReadType = ReadType
m_nType = Type
m_Paragraph = Paragraph
m_sDescription = sDescription
End Sub
Friend Sub ResetReading()
@@ -24,6 +24,26 @@
</Button>
</Grid>
<StackPanel Orientation="Horizontal" Height="30">
<ComboBox ItemsSource="{Binding EntityTypeList}"
SelectedIndex="{Binding SelEntityType}"
Width="70"
Margin="0,0,2.5,0"
Style="{StaticResource PartParam_ComboBox}"/>
<ComboBox ItemsSource="{Binding PartEventTypeList}"
SelectedIndex="{Binding SelPartEventType}"
Width="70"
Margin="0,0,2.5,0"
Style="{StaticResource PartParam_ComboBox}"/>
<!--<TextBox Text="{Binding MaxRowNumber}"/>-->
<Button Grid.Column="1"
Command="{Binding Refresh_Command}"
Margin="2.5,0,5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MDIPage/Send.png" Stretch="Uniform"/>
</Button>
</StackPanel>
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding MachineLogList}"
Grid.Row="1"
AutoGenerateColumns="False"
@@ -37,7 +57,8 @@
BindingColumns="{Binding MachineLogColumns}">
<DataGrid.Resources>
<!-- Data/ora -->
<DataGridTextColumn x:Key="colDATETIME" Binding="{Binding sEventDateTime}">
<DataGridTextColumn x:Key="colDATETIME" Binding="{Binding sEventDateTime}"
SortMemberPath="sEventTick">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.EventDateTime_Msg,
@@ -61,7 +82,7 @@
<TextBlock Text="{Binding Path=DataContext.EventValue_Msg,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:MachineLogPageV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- SupervisorId -->
<DataGridTextColumn x:Key="colSUPERVISORID" Binding="{Binding SupervisorId}">
@@ -91,7 +112,7 @@
<DataGridTextColumn x:Key="colPART" Binding="{Binding PartId}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.PartId_Msg,
<TextBlock Text="{Binding Path=DataContext.PartId_Msg,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:MachineLogPageV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
@@ -62,6 +62,42 @@ Public Class MachineLogPageVM
End Set
End Property
Private m_PartEventTypeList As New List(Of String)({"", "Inizio", "Fine"})
Public ReadOnly Property PartEventTypeList As List(Of String)
Get
Return m_PartEventTypeList
End Get
End Property
Private m_SelPartEventType As Integer
Public Property SelPartEventType As Integer
Get
Return m_SelPartEventType
End Get
Set(value As Integer)
m_SelPartEventType = value
m_MachineLogList_View.Refresh()
End Set
End Property
Private m_EntityTypeList As New List(Of String)({"", "Pezzo", "Barra"})
Public ReadOnly Property EntityTypeList As List(Of String)
Get
Return m_EntityTypeList
End Get
End Property
Private m_SelEntityType As Integer
Public Property SelEntityType As Integer
Get
Return m_SelEntityType
End Get
Set(value As Integer)
m_SelEntityType = value
m_MachineLogList_View.Refresh()
End Set
End Property
' Definizione comandi
Private m_cmdRefresh As ICommand
@@ -137,18 +173,34 @@ Public Class MachineLogPageVM
#Region "METHODS"
Private Function MachineLogFilter(LogEvent As Object) As Boolean
Dim CurrLogEvent As LogEvent = DirectCast(LogEvent, LogEvent)
Private Function MachineLogFilter(CurrEvent As Object) As Boolean
Dim CurrLogEvent As LogEvent = DirectCast(CurrEvent, LogEvent)
Dim bOk As Boolean = True
' se livello utente inferiore a 5, mostro solo eventi pezzo e machgroup
If Map.refMainWindowVM.MainWindowM.nUserLevel < 5 Then
If CurrLogEvent.EventType = MachLogTypes.PART_STATUS Then
Return True
Else
If CurrLogEvent.EventType <> LogEvent.MachLogTypes.PART_STATUS AndAlso CurrLogEvent.EventType <> LogEvent.MachLogTypes.MACHGROUP_STATUS Then
Return False
End If
Else
Return True
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
End Function
Friend Sub LoadMachineLogList()
@@ -157,6 +209,12 @@ Public Class MachineLogPageVM
m_colMachineLog_Description.ColumnVisibility = Visibility.Collapsed
m_colMachineLog_SupervisorId.ColumnVisibility = Visibility.Collapsed
End If
UpdateMachineLogList()
m_MachineLogList_View = CollectionViewSource.GetDefaultView(m_MachineLogList)
m_MachineLogList_View.Filter = AddressOf MachineLogFilter
End Sub
Friend Sub UpdateMachineLogList()
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())
NotifyPropertyChanged(NameOf(MachineLogList))
m_MachineLogList_View = CollectionViewSource.GetDefaultView(m_MachineLogList)
@@ -185,7 +243,7 @@ Public Class MachineLogPageVM
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Refresh()
m_MachineLogList_View.Refresh()
UpdateMachineLogList()
End Sub
#End Region ' Refresh
@@ -195,6 +253,7 @@ Public Class MachineLogPageVM
End Class
Public Class MachLogType
Inherits VMBase
Private m_nId As Integer
Public ReadOnly Property nId As Integer
@@ -3,6 +3,7 @@ Imports System.Math
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Imports System.IO
Public Class MainWindowM
@@ -18,6 +19,13 @@ Public Class MainWindowM
End Get
End Property
Private m_sDataDir As String = String.Empty
Friend ReadOnly Property sDataDir As String
Get
Return m_sDataDir
End Get
End Property
Private m_sConfigDir As String = String.Empty
Public ReadOnly Property sConfigDir As String
Get
@@ -190,6 +198,8 @@ Public Class MainWindowM
IniFile.m_sIniFile = m_sConfigDir & "\" & Core.ConstIni.INI_FILE_NAME
' Impostazione path BTL Ini File
BTLIniFile.m_sBTLIniFile = m_sConfigDir & "\" & BTLFEATURES_FILE_NAME
' Impostazione path Ini file DataGrid
DataGridColumnsIniFile.m_sDataGridColumnsIniFile = m_sConfigDir & "\" & DATAGRIDCOLUMNS_FILE_NAME
' Impostazione path Ini file Dimensioni
DimensionsIniFile.m_sDimensionsIniFile = m_sConfigDir & "\" & ConstDims.DIMENSIONS_FILE_NAME
' Impostazione path resources dir
@@ -209,13 +219,10 @@ Public Class MainWindowM
If GetMainPrivateProfileString(S_WALL, K_WALLBASEDIR, "", m_sWallRoot) = 0 Then
m_sWallRoot = m_sDataRoot & "\" & WALL_DIR
End If
m_sProjsDir = m_sDataRoot & "\" & PROJS_DIR
m_sProdsDir = m_sDataRoot & "\" & PRODS_DIR
m_sWarehouseRoot = m_sDataRoot & "\" & WAREHOUSE_DIR
' imposto cartelle dei progetti
ProjectFileVM.Init(sProjsDir, sProdsDir)
' Impostazione path Ini file DataGrid
Core.DataGridColumnsIniFile.m_sDataGridColumnsIniFile = m_sConfigDir & "\" & DATAGRIDCOLUMNS_FILE_NAME
' Impostazione direttorio magazzino grezzi
If GetMainPrivateProfileString(S_GENERAL, K_DATADIR, "", m_sDataDir) = 0 Then
m_sDataDir = m_sDataRoot
End If
' Verifico indice di istanza
ManageInstance()
' Imposto tipo di chiave
@@ -232,9 +239,17 @@ Public Class MainWindowM
EgtSetNestKey(sNestKey)
' Verifico abilitazione nesting automatico
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
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2407, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2407, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5327, 2505, 1, m_nKeyLevel) And
EgtGetKeyOptions(5327, 2505, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & SUPGENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
@@ -387,6 +402,30 @@ Public Class MainWindowM
Core.ProjectFileVM.Init(sProjsDir, sProdsDir)
End Sub
Friend Sub UpdatePathForKey(sKey As String)
m_sProjsDir = m_sDataDir & "\" & sKey & "\" & PROJS_DIR
m_sProdsDir = m_sDataDir & "\" & sKey & "\" & PRODS_DIR
If Not Directory.Exists(m_sDataDir & "\" & sKey) Then
Directory.CreateDirectory(m_sDataDir & "\" & sKey & "\" & PROJS_DIR)
Directory.CreateDirectory(m_sDataDir & "\" & sKey & "\" & PRODS_DIR)
End If
' imposto cartelle dei progetti
Core.ProjectFileVM.Init(sProjsDir, sProdsDir)
End Sub
Friend Function GetKeyNumber() As Integer
Dim sKey As String = ""
Dim nKey As Integer = 0
EgtGetKeyInfo(sKey)
sKey = sKey.Replace(" ", "")
If Not IsNothing(sKey) AndAlso sKey.Length > 11 Then
If Integer.TryParse(sKey.Substring(3, 6), nKey) AndAlso nKey > 0 Then
Return nKey
End If
End If
Return -1
End Function
Friend Sub Close()
' Terminazione generale di EgtInterface
EgtExit()
@@ -11,11 +11,26 @@ Imports System.Windows
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("EgtBEAMWALL.Supervisor")>
<Assembly: AssemblyDescription("")>
#If PLATFORM = "x64" Then
#If DEBUG Then
<Assembly: AssemblyTitle("EgtBEAMWALL.SupervisorD64.exe")>
<Assembly: AssemblyDescription("EgtBEAMWALL S Debug 32 bit")>
#Else
<Assembly: AssemblyTitle("EgtBEAMWALL.SupervisorR64.exe")>
<Assembly: AssemblyDescription("EgtBEAMWALL S 32 bit")>
#End if
#Else
#If DEBUG Then
<Assembly: AssemblyTitle("EgtBEAMWALL.SupervisorD32.exe")>
<Assembly: AssemblyDescription("EgtBEAMWALL S Debug 32 bit")>
#Else
<Assembly: AssemblyTitle("EgtBEAMWALL.SupervisorR32.exe")>
<Assembly: AssemblyDescription("EgtBEAMWALL S 32 bit")>
#End if
#End if
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<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: ComVisible(false)>
@@ -55,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.7.1")>
<Assembly: AssemblyFileVersion("2.4.7.1")>
<Assembly: AssemblyVersion("2.5.5.4")>
<Assembly: AssemblyFileVersion("2.5.5.4")>
+1 -1
View File
@@ -28,7 +28,7 @@ Public Class ProjectVM
If m_SelTabPage = TabPages.MACHINELOG Then
Map.refCALCPanelVM.SetMachineLog(False)
End If
If SelTabPage Then
If SelTabPage = TabPages.MACHINELOG Then
Map.refMachineLogPageVM.LoadMachineLogList()
End If
m_SelTabPage = SelTabPage
Binary file not shown.

Before

Width:  |  Height:  |  Size: 812 B

After

Width:  |  Height:  |  Size: 1016 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 832 B

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 832 B

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 B

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 899 B

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 622 B

After

Width:  |  Height:  |  Size: 782 B

@@ -178,13 +178,14 @@ Public Class MySceneHostVM
#Region "ProjectManager"
Public Overrides Sub NewProject()
Public Overrides Function NewProject() As Boolean
EgtSetCurrentContext(MainScene.GetCtx())
Dim bOk As Boolean = MainController.NewProject()
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())
Dim bOk As Boolean = False
If String.IsNullOrEmpty(sFilePath) Then
@@ -201,29 +202,32 @@ Public Class MySceneHostVM
bOk = MainController.OpenProject(sFilePath, False)
End If
MainScene.SetStatusNull()
End Sub
Return bOk
End Function
Public Overrides Sub SaveProject()
MyBase.SaveProject()
Public Overrides Function SaveProject() As Boolean
Dim bOk As Boolean = MyBase.SaveProject()
' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull()
End Sub
Return bOk
End Function
Public Overrides Sub SaveAsProject()
MyBase.SaveAsProject()
Public Overrides Function SaveAsProject() As Boolean
Dim bOk As Boolean = MyBase.SaveAsProject()
' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull()
End Sub
Return bOk
End Function
Public Overrides Sub ImportProject()
Public Overrides Function ImportProject() As Boolean
Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
If Not String.IsNullOrWhiteSpace(sDir) Then
sDir = Path.GetDirectoryName(sDir)
End If
sDir.TrimEnd("\"c)
MainController.ImportProject(sDir)
End Sub
Return MainController.ImportProject(sDir)
End Function
#End Region ' ProjectManager
@@ -77,21 +77,21 @@ Public Class SupervisorManagerVM
'Private m_cmdSave As ICommand
Private m_cmdGoToProd As ICommand
'#Region "ToolTip"
#Region "ToolTip"
' 'Proprietà ToolTip
' Public ReadOnly Property OpenToolTip As String
' Get
' Return EgtMsg(MSG_TOPCOMMANDBAR + 2)
' End Get
' End Property
' Public ReadOnly Property SaveToolTip As String
' Get
' Return EgtMsg(MSG_TOPCOMMANDBAR + 3)
' End Get
' End Property
'Proprietà ToolTip
Public ReadOnly Property OpenToolTip As String
Get
Return EgtMsg(MSG_TOPCOMMANDBAR + 2)
End Get
End Property
Public ReadOnly Property GoToProd_ToolTip As String
Get
Return EgtMsg(61835)
End Get
End Property
'#End Region ' ToolTip
#End Region ' ToolTip
#End Region ' Fields & Properties
@@ -219,6 +219,8 @@ Public Class SupervisorManagerVM
CurrProd = Nothing
Map.refMainWindowVM.UpdateTitle()
m_bLoadingProd = False
NotifyPropertyChanged(NameOf(MruFileNames))
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
Return
End If
LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63000), EgtMsg(63001), 50) 'Project opening 'Loading project geometries
@@ -239,11 +241,19 @@ Public Class SupervisorManagerVM
MessageBox.Show("Impossibile aprire il file!!")
Map.refSceneHostVM.MainController.NewProject()
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
m_bLoadingProd = False
NotifyPropertyChanged(NameOf(MruFileNames))
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
Return
End If
Else
MessageBox.Show("File non trovato!!")
Map.refSceneHostVM.MainController.NewProject()
Map.refMainWindowVM.SetTitle("New - EgtBEAMWALL")
m_bLoadingProd = False
NotifyPropertyChanged(NameOf(MruFileNames))
LoadingWndHelper.CloseLoadingWnd(ActiveIds.OPENPROD)
Return
End If
LoadingWndHelper.UpdateLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63004), 70, 100) ' Loading production data
Map.refProjectVM.SupervisorMachGroupPanelVM = New SupervisorMachGroupPanelVM(MachGroupPanelM.CreateNewMachGroupPanel())
@@ -16,6 +16,8 @@ Public Module CurrentMachine
MDI = 1
PLC = 2
CNC = 3
INPUT = 4
OUTPUT = 5
End Enum
' Nome macchina corrente
@@ -305,6 +307,10 @@ Public Module CurrentMachine
sPar = PLC_MSG
Case MsgParagraphs.CNC
sPar = CNC_MSG
Case MsgParagraphs.INPUT
sPar = INPUT_MSG
Case MsgParagraphs.OUTPUT
sPar = OUTPUT_MSG
End Select
EgtGetStringUtf8FromIni(sPar, nId, nId, sMsg, m_sMachMessagesFile)
Return sMsg
+83 -65
View File
@@ -4,81 +4,99 @@ Imports EgtBEAMWALL.Core
Module DbControllers
Friend m_SupervisorId As String = "1"
Public ReadOnly Property SupervisorId As String
Get
Return m_SupervisorId
End Get
End Property
Friend m_SupervisorId As String = "1"
Public ReadOnly Property SupervisorId As String
Get
Return m_SupervisorId
End Get
End Property
Public m_ProjController As DataLayer.Controllers.ProjController
Public m_ProdController As DataLayer.Controllers.ProdController
Public m_MachGroupController As DataLayer.Controllers.MachGroupController
Public m_PartController As DataLayer.Controllers.PartController
Public m_LogMachineController As DataLayer.Controllers.LogMachineController
Public m_StatusMapController As DataLayer.Controllers.StatusMapController
Private m_bNetwork As Boolean = False
Friend ReadOnly Property bNetwork As Boolean
Get
Return m_bNetwork
End Get
End Property
Sub New()
Public m_ProjController As DataLayer.Controllers.ProjController
Public m_ProdController As DataLayer.Controllers.ProdController
Public m_MachGroupController As DataLayer.Controllers.MachGroupController
Public m_PartController As DataLayer.Controllers.PartController
Public m_LogMachineController As DataLayer.Controllers.LogMachineController
Public m_StatusMapController As DataLayer.Controllers.StatusMapController
' se demo--> server = db.steamware.net, nKey e sKey come le hai...
Sub New()
Dim sKey = "", sUser = "", sPwd = ""
' se demo--> server = db.steamware.net, nKey e sKey come le hai...
EgtGetKeyInfo(sKey)
sKey = sKey.Replace(" ", "")
If Not IsNothing(sKey) AndAlso sKey.Length > 11 Then
sUser = sKey.Substring(3, 6)
sPwd = sKey.Substring(10, sKey.Length - 10).Replace("(", "").Replace(")", "")
End If
Try
Dim DbAddress As String = "127.0.0.1"
Dim DbMasterKey As Integer = 0
Dim sDbMasterKey As String = ""
Dim sSharedFolder As String = ""
Dim bNetwork As Boolean = False
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
GetMainPrivateProfileString(S_GENERAL, K_DBADDRESS, "", DbAddress)
DbMasterKey = GetMainPrivateProfileInt(S_GENERAL, K_DBMASTERKEY, 0)
If DbMasterKey > 0 Then
sDbMasterKey = DbMasterKey.ToString("000000")
End If
If String.IsNullOrWhiteSpace(DbAddress) OrElse DbMasterKey <= 0 Then
DbAddress = "127.0.0.1"
DbMasterKey = 0
Else
bNetwork = True
End If
Dim sKey = "", sUser = "", sPwd = ""
EgtGetKeyInfo(sKey)
sKey = sKey.Replace(" ", "")
If Not IsNothing(sKey) AndAlso sKey.Length > 11 Then
sUser = sKey.Substring(3, 6)
sPwd = sKey.Substring(10, sKey.Length - 10).Replace("(", "").Replace(")", "")
End If
Try
Dim DbAddress As String = "127.0.0.1"
Dim DbMasterKey As Integer = 0
Dim sDbMasterKey As String = ""
Dim sSharedFolder As String = ""
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
GetMainPrivateProfileString(S_GENERAL, K_DBADDRESS, "", DbAddress)
DbMasterKey = GetMainPrivateProfileInt(S_GENERAL, K_DBMASTERKEY, 0)
If DbMasterKey > 0 Then
sDbMasterKey = DbMasterKey.ToString("000000")
End If
DataLayer.DbConfig.InitDb(DbAddress, sUser, sPwd, sDbMasterKey)
DataLayer.DbConfig.SetupLogDir(Map.refMainWindowVM.MainWindowM.sTempDir)
DataLayer.DbConfig.CheckMigrateDb()
DataLayer.DbConfig.CheckUser(sUser, sPwd, Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK))
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) And bNetwork Then
' imposto cartella condivisa
GetMainPrivateProfileString(S_GENERAL, K_SHAREDFOLDER, Map.refMainWindowVM.MainWindowM.sDataRoot, sSharedFolder)
Map.refMainWindowVM.MainWindowM.UpdatePathForNetwork(sSharedFolder)
Dim sSupervisorMachName As String = ""
GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, "", sSupervisorMachName)
If Not String.IsNullOrWhiteSpace(sSupervisorMachName) Then m_SupervisorId = sSupervisorMachName
If String.IsNullOrWhiteSpace(DbAddress) OrElse DbMasterKey <= 0 Then
DbAddress = "127.0.0.1"
DbMasterKey = 0
Else
m_bNetwork = True
End If
Catch ex As Exception
EgtOutLog("InitDb error: " & ex.ToString())
MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error")
End
End Try
If Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
End If
If Not m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ANY_DB) Then
DbMasterKey = GetMainPrivateProfileInt(S_GENERAL, K_DBMASTERKEY, 0)
If DbMasterKey > 0 Then
sDbMasterKey = DbMasterKey.ToString("000000")
End If
ElseIf GetMainPrivateProfileInt(S_GENERAL, K_DBMASTERKEY, 0) = 0 Then
Dim nKey As Integer = 0
If Integer.TryParse(sKey.Substring(3, 6), nKey) AndAlso nKey > 0 Then
WriteMainPrivateProfileString(S_GENERAL, K_DBMASTERKEY, nKey)
End If
End If
DataLayer.DbConfig.InitDb(DbAddress, sUser, sPwd, sDbMasterKey)
DataLayer.DbConfig.SetupLogDir(Map.refMainWindowVM.MainWindowM.sTempDir)
DataLayer.DbConfig.CheckMigrateDb()
DataLayer.DbConfig.CheckUser(sUser, sPwd, m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK))
DataLayer.DbConfig.CheckViews(sUser, sPwd)
If m_bNetwork AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NETWORK) Then
' imposto cartella condivisa
GetMainPrivateProfileString(S_GENERAL, K_SHAREDFOLDER, Map.refMainWindowVM.MainWindowM.sDataRoot, sSharedFolder)
Map.refMainWindowVM.MainWindowM.UpdatePathForNetwork(sSharedFolder)
Dim sSupervisorMachName As String = ""
GetMainPrivateProfileString(S_MACH, K_SUPERVISORMACH, "", sSupervisorMachName)
If Not String.IsNullOrWhiteSpace(sSupervisorMachName) Then m_SupervisorId = sSupervisorMachName
End If
ElseIf Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.ANY_DB) Then
' imposto cartella chiave master
Map.refMainWindowVM.MainWindowM.UpdatePathForKey(sDbMasterKey)
Else
' imposto cartella chiave locale
Map.refMainWindowVM.MainWindowM.UpdatePathForKey(sKey.Substring(3, 6))
End If
Catch ex As Exception
EgtOutLog("InitDb error: " & ex.ToString())
MessageBox.Show(Application.Current.MainWindow, "Db connection error!!", "Error")
End
End Try
m_ProjController = New DataLayer.Controllers.ProjController
m_ProdController = New DataLayer.Controllers.ProdController
m_MachGroupController = New DataLayer.Controllers.MachGroupController
m_PartController = New DataLayer.Controllers.PartController
m_LogMachineController = New DataLayer.Controllers.LogMachineController
m_StatusMapController = New DataLayer.Controllers.StatusMapController
End Sub
m_ProjController = New DataLayer.Controllers.ProjController
m_ProdController = New DataLayer.Controllers.ProdController
m_MachGroupController = New DataLayer.Controllers.MachGroupController
m_PartController = New DataLayer.Controllers.PartController
m_LogMachineController = New DataLayer.Controllers.LogMachineController
m_StatusMapController = New DataLayer.Controllers.StatusMapController
End Sub
End Module
+57 -10
View File
@@ -4,13 +4,7 @@ Imports EgtBEAMWALL.Core
Public Class LogEvent
Inherits VMBase
Public ReadOnly Property MachGroupId_Msg As String
Get
Return "MachGroup"
End Get
End Property
Const cSeparator As Char = ";"c
Public Const cSeparator As Char = ";"c
Public Enum MachLogTypes
PART_STATUS = 1
@@ -25,6 +19,12 @@ Public Class LogEvent
PROGRAM_SEND = 10
End Enum
Public Enum MachineCommands As Integer
CONNECTION = 1
DISCONNECTION = 2
PROGRAM_ACTIVATION = 3
End Enum
Private m_EventDateTime As DateTime
Public ReadOnly Property EventDateTime As DateTime
Get
@@ -68,6 +68,11 @@ Public Class LogEvent
End Get
End Property
Private m_Status As Integer
Public ReadOnly Property nStatus As Integer
Get
Return m_Status
End Get
End Property
Public ReadOnly Property Status As String
Get
Select Case m_Status
@@ -119,6 +124,11 @@ Public Class LogEvent
Return m_Value
End Get
End Property
Public ReadOnly Property sEventTick As Double
Get
Return m_EventDateTime.Ticks
End Get
End Property
Public ReadOnly Property sPROD As String
Get
@@ -137,13 +147,30 @@ Public Class LogEvent
Select Case m_EventType
Case MachLogTypes.PART_STATUS
m_ProdId = sValues(0)
m_MachGroupId = DbControllers.m_MachGroupController.FindByMachGroupId(m_ProdId, sValues(1)).Name
m_PartId = DbControllers.m_PartController.FindByPartId(m_ProdId, sValues(2)).PDN
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
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)
Case MachLogTypes.MACHGROUP_STATUS
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)
Case MachLogTypes.MACHINE_COMMAND
End Select
End If
End Sub
@@ -168,4 +195,24 @@ Public Class LogEvent
Return CreateMachLog(MachLogTypes.MACHGROUP_STATUS, dtEvent, Prod & cSeparator & MachGroup & cSeparator & State, SupervisorID)
End Function
Public Shared Function CreateMachCommandLog(Command As MachineCommands, sProgramId As String, nError As Integer, SupervisorID As String)
Return CreateMachLog(MachLogTypes.MACHINE_COMMAND, DateTime.Now(), Command & cSeparator & sProgramId & cSeparator & nError, SupervisorID)
End Function
Public Shared Function CreateAlarmLog(dtEvent As DateTime, Alarm As String, SupervisorID As String)
Return CreateMachLog(MachLogTypes.ALARM, dtEvent, Alarm, SupervisorID)
End Function
Public Shared Function CreateMachineModeLog(MachineMode As Integer, SupervisorID As String)
Return CreateMachLog(MachLogTypes.MACHINE_MODE, DateTime.Now(), MachineMode, SupervisorID)
End Function
Public Shared Function CreateMachineStateLog(MachineStatus As Integer, SupervisorID As String)
Return CreateMachLog(MachLogTypes.MACHINE_STATUS, DateTime.Now(), MachineStatus, SupervisorID)
End Function
Public Shared Function CreateReadVarLog(VarAddress As String, VarValue As String, SupervisorID As String)
Return CreateMachLog(MachLogTypes.READ_VAR, DateTime.Now(), VarAddress & cSeparator & VarValue, SupervisorID)
End Function
End Class
@@ -5,7 +5,7 @@
<DataGrid ItemsSource="{Binding VariablesList}"
AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Binding="{Binding sName}" Width="1*"/>
<DataGridTextColumn Header="Name" Binding="{Binding sDescription}" Width="1*"/>
<DataGridTextColumn Header="Address" Binding="{Binding sAddress}" Width="1*"/>
<DataGridTextColumn Header="Value" Binding="{Binding sValue}" Width="1*"/>
</DataGrid.Columns>
@@ -44,6 +44,12 @@ Public Class Variable
End Set
End Property
Public ReadOnly Property sDescription As String
Get
Return CommVar.sDescription
End Get
End Property
Public Property sAddress As String
Get
Return CommVar.sAddress
+57 -50
View File
@@ -1,52 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<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></providers>
</entityFramework>
<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" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.29.0" newVersion="8.0.29.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" />
</dependentAssembly>
<dependentAssembly>
<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" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
</provider>
</providers>
</entityFramework>
<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" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.21.0" newVersion="8.0.21.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<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" />
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
+79
View File
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config.
Makes the application long-path aware. See https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
+9 -7
View File
@@ -4,11 +4,11 @@
<package id="Csv" version="1.0.31" targetFramework="net472" />
<package id="EntityFramework" version="6.4.4" targetFramework="net452" />
<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="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" />
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" />
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" />
<package id="K4os.Compression.LZ4" version="1.3.5" targetFramework="net472" />
<package id="K4os.Compression.LZ4.Streams" version="1.3.5" 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="Microsoft.DotNet.PlatformAbstractions" 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="Newtonsoft.Json" version="13.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="System.Buffers" version="4.5.1" 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.Sockets" version="4.3.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.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
<package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net472" />
<package id="Zebra.Printer.SDK" version="2.15.2634" targetFramework="net472" />
</packages>
@@ -43,7 +43,7 @@
<TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" FontSize="12" IsReadOnly="True" TextWrapping="Wrap"/>
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="8" IsCancel="True"
Margin="100,0"/>
Margin="100,0"/>
</Grid>
@@ -1,9 +1,9 @@
Imports EgtUILib
Imports EgtBEAMWALL.Core
Public Class AboutBoxV
Private Sub AboutBoxWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
Me.Owner = Application.Current.MainWindow
Private Sub AboutBoxWD_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
DescriptionLbl.Text = My.Application.Info.Description.ToString()
VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
"." & My.Application.Info.Version.Minor.ToString() &
@@ -24,6 +24,9 @@ Public Class AboutBoxV
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
Dim sOpSys As String = String.Empty
EgtGetOsInfo( sOpSys)
sInfo &= sOpSys & Environment.NewLine
Dim sCPU As String = String.Empty
EgtGetCpuInfo( sCPU)
sInfo &= sCPU & Environment.NewLine
@@ -40,7 +40,7 @@ Public Class AddPartWndVM
End Get
Set(value As String)
Dim dTempL As Double
If StringToLen(value, dTempL) AndAlso dTempL > 0 Then
If StringToLenAdv(value, dTempL, True) AndAlso dTempL > 0 Then
m_dL = dTempL
Else
NotifyPropertyChanged("sL")
@@ -60,7 +60,7 @@ Public Class AddPartWndVM
End Get
Set(value As String)
Dim dTempW As Double
If StringToLen(value, dTempW) AndAlso dTempW > 0 Then
If StringToLenAdv(value, dTempW, True) AndAlso dTempW > 0 Then
EgtDraw()
m_dW = dTempW
Else
@@ -81,7 +81,7 @@ Public Class AddPartWndVM
End Get
Set(value As String)
Dim dTempH As Double
If StringToLen(value, dTempH) AndAlso dTempH > 0 Then
If StringToLenAdv(value, dTempH, True) AndAlso dTempH > 0 Then
EgtDraw()
m_dH = dTempH
Else
@@ -102,7 +102,17 @@ Public Class AddRawPartWndVM
End Select
m_DimensionsList = DimensionsList
If m_DimensionsList.Count > 0 Then
SelDimension = m_DimensionsList(0)
Dim LastMaterial As SParam = WarehouseHelper.GetLastMaterial(DimensionsList(0).SectXMat)
If IsNothing(LastMaterial) Then
SelDimension = m_DimensionsList(0)
Else
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
' riduco lista parametri a solo quelli che utilizzati
m_VariableList_View = CollectionViewSource.GetDefaultView(m_VariableList)
@@ -222,14 +232,14 @@ Public Class Variable
m_sValue = value
Case VariableType.LENGTH
Dim dTempValue As Double
If StringToLen(value, dTempValue) Then
If StringToLenAdv(value, dTempValue, True) Then
m_dValue = dTempValue
Else
NotifyPropertyChanged("sValue")
End If
Case Else ' VariableType.DOUBLE_
Dim dTempValue As Double
If StringToDouble(value, dTempValue) Then
If StringToDoubleAdv(value, dTempValue, True) Then
m_dValue = dTempValue
Else
NotifyPropertyChanged("sValue")
@@ -132,7 +132,7 @@ Public Class AddSectionXMaterialWndVM
' carico le colonne della datagrid
LoadColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
NewSectionXMaterialList = New ObservableCollection(Of SectionXMaterialToBeAdded)(SectXMatList)
WhSectXMatList = Map.refWarehouseWndVM.GetSectionXMaterialsFromWarehouse()
WhSectXMatList = WarehouseWndVM.GetSectionXMaterialsFromWarehouse()
' Prendo i SectionXMaterial appena messi nella Lista di questa finestra e li confronto con ciascuno di quelli presenti in Warehouse.
' Se le sezioni sono uguali carico i materiali relativi alla medesima sezione.
' Se i materiali di quella medesima sezione non ci sono disabilito la CheckBox Alias.
+53 -46
View File
@@ -1,48 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
<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></providers>
</entityFramework>
<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" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.29.0" newVersion="8.0.29.0" />
</dependentAssembly>
<dependentAssembly>
<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" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.19.4.0" newVersion="3.19.4.0" />
</dependentAssembly>
<dependentAssembly>
<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" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.5.0" newVersion="1.8.5.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.29.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<!--<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.EntityFramework" />-->
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
<providers>
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.21.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
</provider>
</providers>
</entityFramework>
<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" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<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" />
<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" />
<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" />
<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" />
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=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
' verifico se solido attivo
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
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
@@ -40,10 +40,9 @@ Public Class BTLFeatureVM
' rendo non calcolata questa feature
ResetCalcFeature()
End If
NotifyPropertyChanged("nSelGRP")
NotifyPropertyChanged(NameOf(nSelGRP))
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
EgtDraw()
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
End If
End Set
End Property
@@ -66,7 +65,7 @@ Public Class BTLFeatureVM
If value <> -1 Then
' verifico se solido attivo
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
If Me.m_BTLFeatureM.IsFreeContour() Then
' cambio faccia alla geometria
@@ -109,12 +108,25 @@ Public Class BTLFeatureVM
ResetCalcFeature()
End If
NotifyPropertyChanged("nSelSIDE")
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
EgtDraw()
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
End If
End Set
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)
' necessario per evitare ricalcolo della grafica sulla modifica del parametro per ogni feature
Private Shared m_bDO_MultipleUpdate As Boolean = False
@@ -136,7 +148,7 @@ Public Class BTLFeatureVM
If value <> m_BTLFeatureM.bDO Then
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' 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
If EgtBeamEnableProcess(nFeatureId, value, Not m_bDO_MultipleUpdate) Then
m_BTLFeatureM.bDO = value
@@ -155,7 +167,7 @@ Public Class BTLFeatureVM
End If
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' 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
If Not m_bDO_MultipleUpdate Then EgtDraw()
' aggiorno stato abilitazione del bottone modifica free contour
@@ -214,7 +226,7 @@ Public Class BTLFeatureVM
m_SelQParam = value
If Not IsNothing(m_SelQParam) Then
' imposto path disegno da mostrare in BottomPanel
Map.refBottomPanelVM.SetCurrDraw(sDrawPath)
Map.refBottomPanelVM.SetCurrDraw(m_SelQParam.sDrawPath)
End If
NotifyPropertyChanged(NameOf(SelQBTLParam))
End Set
@@ -222,7 +234,7 @@ Public Class BTLFeatureVM
Public ReadOnly Property Edit_Visibility As Visibility
Get
Return If(Map.refMainWindowVM.MainWindowM.nUserLevel > 5 AndAlso BTLFeatureM.IsFreeContour AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
Return If(BTLFeatureM.IsFreeContour AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Public ReadOnly Property SaveCancel_Visibility As Visibility
@@ -373,6 +385,8 @@ Public Class BTLFeatureVM
For Each QPar In QBTLParamVMList
If QPar.bCustom Then EgtSetInfo(nNewFeatureId, QPar.sName & "A", 1)
Next
' Riporto priority
EgtSetInfo(nNewFeatureId, BTL_FTR_PRIORITY, m_BTLFeatureM.nPriority)
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
' la aggiungo a struttura BTL pezzo di destinazione
DestBTLPart.AddBTLFeature(NewFeat)
@@ -121,9 +121,9 @@ Public Class BTLParamVM
' trasformo valori
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDouble(value, dNewValue)
StringToDoubleAdv(value, dNewValue, True)
Case BTLParamType.LENGTH
StringToLen(value, dNewValue)
StringToLenAdv(value, dNewValue, True)
Case Else
' per string non faccio nulla
End Select
@@ -168,9 +168,9 @@ Public Class BTLParamVM
' trasformo valori
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDouble(value, dNewValue)
StringToDoubleAdv(value, dNewValue, True)
Case BTLParamType.LENGTH
StringToLen(value, dNewValue)
StringToLenAdv(value, dNewValue, True)
Case Else
' per string non faccio nulla
End Select
@@ -277,7 +277,7 @@ Public Class BTLParamVM
Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True)
' verifico se solido attivo
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
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
@@ -335,7 +335,7 @@ Public Class BTLParamVM
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()
End Sub
@@ -118,7 +118,7 @@ Public Class BTLPartVM
' verifico se solido attivo
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
@@ -134,7 +134,7 @@ Public Class BTLPartVM
' aggiorno sezioni
Map.refProjectVM.BTLStructureVM.UpdateSection(Section, OldSection)
' eventualmente ripristino solido
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(False)
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
EgtDraw()
Return True
@@ -156,7 +156,7 @@ Public Class BTLPartVM
Public Property sL As String
Get
Dim nOrigGroupId As Integer = nPartId
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso EgtBeamGetBuildingIsOn() AndAlso Map.refShowBeamPanelVM.bShowAll Then
nOrigGroupId = GetOrigFrameGroup(nPartId)
End If
Dim frBeam As New Frame3d
@@ -171,7 +171,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
Dim dVal As Double
If StringToLen(value, dVal) Then
If StringToLenAdv(value, dVal, True) Then
Dim dBtlL = m_BTLPartM.dBtlL
Dim dBtlW = m_BTLPartM.dBtlW
Dim dBtlH = m_BTLPartM.dBtlH
@@ -214,7 +214,7 @@ Public Class BTLPartVM
Public Property sW As String
Get
Dim nOrigGroupId As Integer = nPartId
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso EgtBeamGetBuildingIsOn() AndAlso Map.refShowBeamPanelVM.bShowAll Then
nOrigGroupId = GetOrigFrameGroup(nPartId)
End If
Dim frBeam As New Frame3d
@@ -229,7 +229,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
Dim dVal As Double
If StringToLen(value, dVal) Then
If StringToLenAdv(value, dVal, True) Then
Dim dBtlL = m_BTLPartM.dBtlL
Dim dBtlW = m_BTLPartM.dBtlW
Dim dBtlH = m_BTLPartM.dBtlH
@@ -272,7 +272,7 @@ Public Class BTLPartVM
Public Property sH As String
Get
Dim nOrigGroupId As Integer = nPartId
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso EgtBeamGetBuildingIsOn() AndAlso Map.refShowBeamPanelVM.bShowAll Then
nOrigGroupId = GetOrigFrameGroup(nPartId)
End If
Dim frBeam As New Frame3d
@@ -287,7 +287,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
Dim dVal As Double
If StringToLen(value, dVal) Then
If StringToLenAdv(value, dVal, True) Then
Dim dBtlL = m_BTLPartM.dBtlL
Dim dBtlW = m_BTLPartM.dBtlW
Dim dBtlH = m_BTLPartM.dBtlH
@@ -550,7 +550,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
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
Else
NotifyPropertyChanged("dPLANINGLEN")
@@ -564,7 +564,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
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
Else
NotifyPropertyChanged("dSTARTOFFSET")
@@ -578,7 +578,7 @@ Public Class BTLPartVM
End Get
Set(value As String)
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
Else
NotifyPropertyChanged("dENDOFFSET")
@@ -625,9 +625,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",")
Dim ptOri As New Point3d
If sValArray.Count() >= 3 AndAlso
StringToLen(sValArray(0), ptOri.x) AndAlso
StringToLen(sValArray(1), ptOri.y) AndAlso
StringToLen(sValArray(2), ptOri.z) AndAlso
StringToLenAdv(sValArray(0), ptOri.x, True) AndAlso
StringToLenAdv(sValArray(1), ptOri.y, True) AndAlso
StringToLenAdv(sValArray(2), ptOri.z, True) AndAlso
m_BTLPartM.refTransf.ChangeOrigin(ptOri) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_TRANSFORMATION & (SelUID + 1), LenToString(m_BTLPartM.refTransf.Orig.x, 3) & "," &
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
@@ -661,9 +661,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",")
Dim vtVersX As New Vector3d
If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), vtVersX.x) AndAlso
StringToDouble(sValArray(1), vtVersX.y) AndAlso
StringToDouble(sValArray(2), vtVersX.z) AndAlso
StringToDoubleAdv(sValArray(0), vtVersX.x, True) AndAlso
StringToDoubleAdv(sValArray(1), vtVersX.y, True) AndAlso
StringToDoubleAdv(sValArray(2), vtVersX.z, True) AndAlso
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) & "," &
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
@@ -699,9 +699,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",")
Dim vtVersY As New Vector3d
If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), vtVersY.x) AndAlso
StringToDouble(sValArray(1), vtVersY.y) AndAlso
StringToDouble(sValArray(2), vtVersY.z) AndAlso
StringToDoubleAdv(sValArray(0), vtVersY.x, True) AndAlso
StringToDoubleAdv(sValArray(1), vtVersY.y, True) AndAlso
StringToDoubleAdv(sValArray(2), vtVersY.z, True) AndAlso
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) & "," &
LenToString(m_BTLPartM.refTransf.Orig.y, 3) & "," &
@@ -733,10 +733,10 @@ Public Class BTLPartVM
Set(value As Integer)
Dim sValArray() As String = CamberParams.Split(",")
If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dCamberLen1) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dCamberLen2) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dCamberLen3) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dCamberCross3) AndAlso
StringToLenAdv(sValArray(0), m_BTLPartM.m_dCamberLen1, True) AndAlso
StringToLenAdv(sValArray(1), m_BTLPartM.m_dCamberLen2, True) AndAlso
StringToLenAdv(sValArray(2), m_BTLPartM.m_dCamberLen3, True) AndAlso
StringToLenAdv(sValArray(3), m_BTLPartM.m_dCamberCross3, True) AndAlso
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, "SIDE: " & (value + 1) &
" P01: " & sValArray(0) &
" P02: " & sValArray(1) &
@@ -759,10 +759,10 @@ Public Class BTLPartVM
Set(value As String)
Dim sValArray() As String = value.Split(",")
If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dCamberLen1) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dCamberLen2) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dCamberLen3) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dCamberCross3) Then
StringToLenAdv(sValArray(0), m_BTLPartM.m_dCamberLen1, True) AndAlso
StringToLenAdv(sValArray(1), m_BTLPartM.m_dCamberLen2, True) AndAlso
StringToLenAdv(sValArray(2), m_BTLPartM.m_dCamberLen3, True) AndAlso
StringToLenAdv(sValArray(3), m_BTLPartM.m_dCamberCross3, True) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_CAMBER, " SIDE: " & (SelCAMBERSIDE + 1) &
" P01: " & sValArray(0) &
" P02: " & sValArray(1) &
@@ -790,10 +790,10 @@ Public Class BTLPartVM
Dim sValArray() As String = PartOffsetParams.Split(",")
If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dPartOffsetSide1) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dPartOffsetSide2) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dPartOffsetSide3) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dPartOffsetSide4) AndAlso
StringToLenAdv(sValArray(0), m_BTLPartM.m_dPartOffsetSide1, True) AndAlso
StringToLenAdv(sValArray(1), m_BTLPartM.m_dPartOffsetSide2, True) AndAlso
StringToLenAdv(sValArray(2), m_BTLPartM.m_dPartOffsetSide3, True) AndAlso
StringToLenAdv(sValArray(3), m_BTLPartM.m_dPartOffsetSide4, True) AndAlso
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
" P11: " & sValArray(0) &
" P12: " & sValArray(1) &
@@ -819,10 +819,10 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",")
If sValArray.Count() >= 4 AndAlso
StringToLen(sValArray(0), m_BTLPartM.m_dPartOffsetSide1) AndAlso
StringToLen(sValArray(1), m_BTLPartM.m_dPartOffsetSide2) AndAlso
StringToLen(sValArray(2), m_BTLPartM.m_dPartOffsetSide3) AndAlso
StringToLen(sValArray(3), m_BTLPartM.m_dPartOffsetSide4) Then
StringToLenAdv(sValArray(0), m_BTLPartM.m_dPartOffsetSide1, True) AndAlso
StringToLenAdv(sValArray(1), m_BTLPartM.m_dPartOffsetSide2, True) AndAlso
StringToLenAdv(sValArray(2), m_BTLPartM.m_dPartOffsetSide3, True) AndAlso
StringToLenAdv(sValArray(3), m_BTLPartM.m_dPartOffsetSide4, True) Then
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_PARTOFFSET, " P04: " & sValue &
" P11: " & sValArray(0) &
" P12: " & sValArray(1) &
@@ -973,9 +973,9 @@ Public Class BTLPartVM
Dim sValArray() As String = value.Split(",")
Dim dX, dY, dZ As Double
If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), dX) AndAlso
StringToDouble(sValArray(1), dY) AndAlso
StringToDouble(sValArray(2), dZ) Then
StringToDoubleAdv(sValArray(0), dX, True) AndAlso
StringToDoubleAdv(sValArray(1), dY, True) AndAlso
StringToDoubleAdv(sValArray(2), dZ, True) Then
m_BTLPartM.refGrainDir = New Vector3d(dX, dY, dZ)
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
sValArray(1) & "," &
@@ -994,9 +994,9 @@ Public Class BTLPartVM
Set(value As Boolean)
Dim sValArray() As String = GrainDirection.Split(",")
If sValArray.Count() >= 3 AndAlso
StringToDouble(sValArray(0), m_BTLPartM.refGrainDir.x) AndAlso
StringToDouble(sValArray(1), m_BTLPartM.refGrainDir.y) AndAlso
StringToDouble(sValArray(2), m_BTLPartM.refGrainDir.z) AndAlso
StringToDoubleAdv(sValArray(0), m_BTLPartM.refGrainDir.x, True) AndAlso
StringToDoubleAdv(sValArray(1), m_BTLPartM.refGrainDir.y, True) AndAlso
StringToDoubleAdv(sValArray(2), m_BTLPartM.refGrainDir.z, True) AndAlso
EgtSetInfo(m_BTLPartM.nPartId, BTL_PRT_GRAINDIR, sValArray(0) & "," &
sValArray(1) & "," &
sValArray(2) & ";" &
@@ -1395,7 +1395,7 @@ Public Class BTLPartVM
Public ReadOnly Property Section As SectionXMaterial
Get
Dim nOrigGroupId As Integer = nPartId
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso EgtBeamGetBuildingIsOn() AndAlso Map.refShowBeamPanelVM.bShowAll Then
nOrigGroupId = GetOrigFrameGroup(nPartId)
End If
Dim frBeam As New Frame3d
@@ -1530,6 +1530,7 @@ Public Class BTLPartVM
m_SelBTLFeatureVM.RefreshFCMBtnVisibility()
' aggiorno stato abilitazione del bottone modifica free contour
Map.refFeatureManagerVM.SetEditIsEnabled()
Map.refFeatureManagerVM.NotifyPropertyChanged(NameOf(Map.refFeatureManagerVM.Priority_Visibility))
Else
EgtDeselectAll()
End If
@@ -1629,9 +1630,9 @@ Public Class BTLPartVM
AddHandler m_BTLFeatureVMList.CollectionChanged, AddressOf OnBTLFeatureVMListChanged
End Sub
Public Sub Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional dAng As Double = 90, Optional bVerifyDuplo As Boolean = True)
Public Sub Rotation(IsPositive As Boolean, SelectedMachineType As MachineType, Optional bRedraw As Boolean = True, Optional dAng As Double = 90, Optional bVerifyDuplo As Boolean = True)
Dim OldSection As SectionXMaterial = Section
If m_BTLPartM.Rotation(IsPositive, SelectedMachineType, dAng) Then
If m_BTLPartM.Rotation(IsPositive, SelectedMachineType, bRedraw, dAng) Then
' aggiorno visualizzazione dimensioni
NotifyPropertyChanged(NameOf(sW))
NotifyPropertyChanged(NameOf(sH))
@@ -1985,11 +1986,11 @@ Public Class BTLPartVM
BackRotation(True)
End Sub
Public Sub BackRotation(Optional bUpdateSection As Boolean = False)
Public Sub BackRotation(Optional bUpdateSection As Boolean = False, Optional bRedraw As Boolean = True)
' salvo sezione impostata
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
' ruoto
Rotation(False, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
Rotation(False, Map.refProjectVM.BTLStructureVM.nPROJTYPE, bRedraw)
' imposto lock
bLockRotation = True
' se progetto travi e sezione precedente diversa da vuota (tutti i pezzi)
@@ -2017,10 +2018,10 @@ Public Class BTLPartVM
ForwardRotation(True)
End Sub
Public Sub ForwardRotation(Optional bUpdateSection As Boolean = False)
Public Sub ForwardRotation(Optional bUpdateSection As Boolean = False, Optional bRedraw As Boolean = True)
' salvo sezione impostata
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
Rotation(True, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
Rotation(True, Map.refProjectVM.BTLStructureVM.nPROJTYPE, bRedraw)
' imposto lock
bLockRotation = True
' se progetto travi e sezione precedente diversa da vuota (tutti i pezzi)
@@ -2160,6 +2161,9 @@ Public Class BTLPartVM
Select Case e.PropertyName
Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
CalcGlobalUpdate(True)
' imposto path disegno da mostrare in BottomPanel
Dim SelPBTLParam As BTLParamVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam
If Not IsNothing(SelPBTLParam) Then Map.refBottomPanelVM.SetCurrDraw(SelPBTLParam.sDrawPath)
Case NameOf(sender.bDO)
NotifyPropertyChanged(NameOf(bDOALL))
' setto pezzo da ricalcolare
@@ -79,7 +79,8 @@ Public Class BTLStructureVM
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
Case SelectionTypes.HIGHLIGHT
If m_PrevSelectionType = SelectionTypes.SELECT_ Then
EgtBeamShowFacesName( False)
EgtBeamShowLoadingSide( False, False)
End If
If Not IsNothing(m_SelBTLPart) Then
m_SelBTLPart = Nothing
@@ -181,6 +182,8 @@ Public Class BTLStructureVM
End Sub
Private Sub SelectBTLPart(BtlPart As BTLPartVM)
EgtBeamShowFacesName( False)
EgtBeamShowLoadingSide( False, False)
m_SelBTLPart = BtlPart
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' se modalità building, la tolgo
@@ -191,6 +194,10 @@ Public Class BTLStructureVM
SceneSelPartSelection()
' seleziono pezzo in Db geometrico
EgtBeamSetPart(BtlPart.nPartId)
EgtBeamShowFacesName( True)
Dim bLoadingSideShow As Boolean = (nPROJTYPE = BWType.BEAM)
Dim bLeftToRight As Boolean = Not ( CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE)
EgtBeamShowLoadingSide( bLoadingSideShow, bLeftToRight)
' seleziono pagina BottomPanel
Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART)
'' mostro barra di gestione pezzo
@@ -236,9 +243,11 @@ Public Class BTLStructureVM
If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
' tolgo eventuale indicazione solido rimasta da pezzo precedente
Map.refShowBeamPanelVM.SetShowSolid(False)
Map.refProjectVM.BTLStructureVM.ShowSolid(False, BtlPart.nPartId)
Map.refProjectVM.BTLStructureVM.ShowSolid(BtlPart.nPartId, False, False)
End If
If m_SelBTLPart Is BtlPart Then
EgtBeamShowFacesName( False)
EgtBeamShowLoadingSide( False, False)
m_SelBTLPart = Nothing
NotifyPropertyChanged(NameOf(SelBTLPart))
End If
@@ -1074,7 +1083,7 @@ Public Class BTLStructureVM
If Not IsNothing(SelBTLPart) Then
' se pezzo solido, lo riporto normale
If Map.refShowBeamPanelVM.ShowSolid_IsChecked Then
ShowSolid(False)
ShowSolid(GDB_ID.NULL, False, False)
Map.refShowBeamPanelVM.SetShowSolid(False)
End If
' tolgo pezzo selezionato
@@ -1123,12 +1132,12 @@ Public Class BTLStructureVM
EgtZoom(ZM.ALL, bRedraw)
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
If nPartId = GDB_ID.NULL Then
nPartId = If(Not IsNothing(SelBTLPart), SelBTLPart.nPartId, GDB_ID.NULL)
If nPartId = GDB_ID.NULL And Not IsNothing(SelBTLPart) Then
nPartId = SelBTLPart.nPartId
End If
If nPartId = GDB_ID.NULL Or Not EgtIsPart(nPartId) Then
If Not EgtIsPart(nPartId) Then
Dim nLayerId As Integer = EgtGetParent(nPartId)
Dim sLayerName As String = ""
EgtGetName(nLayerId, sLayerName)
@@ -1142,17 +1151,11 @@ Public Class BTLStructureVM
' disabilito impostazione modificato
Dim DisableMgr As New DisableModifiedMgr
Dim nSolId As Integer = EgtBeamGetSolid(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
If bShow Then EgtBeamCalcSolid(nPartId)
EgtBeamShowSolid(nPartId, bShow)
If bRedraw Then EgtDraw()
' ripristino precedente impostazione modificato
DisableMgr.ReEnable()
End Sub
@@ -280,8 +280,8 @@ Public Class CALCPanelVM
End Sub
Private Shared Sub ProcessResults(Bar As Bar)
If IsNothing(Bar) Then Return
ProcessResults(Bar.sBarPath, Bar.nProgramPage, Bar.nBarId)
End Sub
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
Dim nVal As Integer? = GetVal(line, "ERR")
nErr = (If(nVal IsNot Nothing, nVal.Value, 0))
nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
sMsg = ""
dRot = 0
nFall = 0
@@ -320,24 +320,24 @@ Public Class CALCPanelVM
taskId = 0
ElseIf line.StartsWith("ROT=") Then
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)
dPartRot = Math.Max(dPartRot, dRot)
dTotRot = Math.Max(dTotRot, dRot)
ElseIf line.StartsWith("CUTID=") Then
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
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)
ElseIf line.StartsWith("FALL=") Then
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))
ElseIf line.StartsWith("TIME=") Then
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))
'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)
@@ -34,14 +34,8 @@ Public Class ChangeParameterWndVM
m_ParamList.Add(New Parameters(NewBTLParam))
ParamIndex += 1
End While
'' leggo tutti i Q della feature
'ParamIndex = 1
'While BTLIniFile.GetBeamPrivateProfileParam(m_SelPRC.nGRP, m_SelPRC.nPRC, False, ParamIndex, Nothing, NewBTLParam)
' m_ParamList.Add(New Parameters(NewBTLParam))
' ParamIndex += 1
'End While
' 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
m_SelParam = New Parameters(BTLParamM.CreateNewBTLParam())
NotifyPropertyChanged(NameOf(SelParam))
@@ -148,9 +142,9 @@ Public Class Parameters
Set(value As String)
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDouble(value, m_dActualValue)
StringToDoubleAdv(value, m_dActualValue, True)
Case BTLParamType.LENGTH
StringToLen(value, m_dActualValue)
StringToLenAdv(value, m_dActualValue, True)
Case Else ' BTLParamType.STRING_
m_sActualValue = value
End Select
@@ -178,9 +172,9 @@ Public Class Parameters
Set(value As String)
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDouble(value, m_dNewValue)
StringToDoubleAdv(value, m_dNewValue, True)
Case BTLParamType.LENGTH
StringToLen(value, m_dNewValue)
StringToLenAdv(value, m_dNewValue, True)
Case Else ' BTLParamType.STRING_
m_sNewValue = value
End Select
@@ -188,21 +182,21 @@ Public Class Parameters
End Property
Private m_bActualValue As Boolean
Public Property bActualValue As String
Public Property bActualValue As Boolean
Get
Return m_bActualValue
End Get
Set(value As String)
Set(value As Boolean)
m_bActualValue = value
End Set
End Property
Private m_bNewValue As String
Public Property bNewValue As String
Private m_bNewValue As Boolean
Public Property bNewValue As Boolean
Get
Return m_bNewValue
End Get
Set(value As String)
Set(value As Boolean)
m_bNewValue = value
End Set
End Property
@@ -234,6 +228,7 @@ Public Class Parameters
Sub New(BTLParamM As BTLParamM, Optional IsCheckBox As Boolean = False)
MyBase.New(BTLParamM)
m_bIsCheckBox = IsCheckBox
If IsCheckBox Then m_BTLParamM.SetType(BTLParamType.CHECKBOX)
End Sub
'Shared Operator =(ByVal S1 As Parameters, ByVal S2 As BTLParam) As Boolean
@@ -5,225 +5,232 @@
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2">
<TabItem Header="General">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
<GroupBox Header="{Binding CurrentLanguage_Msg}"
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="6*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TabControl Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2"
SelectedIndex="{Binding SelConfigSubPage}">
<TabItem Header="General">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Margin="5,5,5,0">
<GroupBox Header="{Binding CurrentLanguage_Msg}"
Margin="0,0,0,5">
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
<TextBlock Text="{Binding LanguageAdvert_Msg}" TextWrapping="Wrap"
TextAlignment="Center"/>
</UniformGrid>
</GroupBox>
<UniformGrid Columns="2"
</UniformGrid>
</GroupBox>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
<TextBlock Text="{Binding MMUnits_Msg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
SelectedIndex="{Binding SelMeasureUnit}" Height="25"
Margin="0,5,0,0"/>
</UniformGrid>
<GroupBox Header="{Binding Nesting_Msg}"
</UniformGrid>
<GroupBox Header="{Binding Nesting_Msg}"
Margin="0,0,0,5">
<StackPanel>
<UniformGrid Columns="2"
<StackPanel>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding SectionTime_Msg}"
<TextBlock Text="{Binding SectionTime_Msg}"
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"/>
</UniformGrid>
<UniformGrid Columns="2"
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding PartTime_Msg}"
<TextBlock Text="{Binding PartTime_Msg}"
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"/>
</UniformGrid>
</StackPanel>
</GroupBox>
</UniformGrid>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="Parametri Q">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<EgtBEAMWALL:QParamListV DataContext="{Binding}"
</GroupBox>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding PrintLabel_Msg}" VerticalAlignment="Center"/>
<CheckBox IsChecked="{Binding bPrintLabel_IsChecked}"
Margin="0,5,0,0"/>
</UniformGrid>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="Parametri Q">
<TabItem.Content>
<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}"
SelectedItem="{Binding SelQParam}"
Grid.Column="0"
Margin="5">
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}"/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</EgtBEAMWALL:QParamListV>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="Macchina">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
</GroupBox>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
<ItemsControl ItemsSource="{Binding ConfigMachTableList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}"/>
</StackPanel>
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="#FFBABABA"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander.Background>
<SolidColorBrush Color="LightGray"></SolidColorBrush>
</Expander.Background>
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</Expander.Header>
<ItemsPresenter />
</Expander>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</DataGrid.GroupStyle>
</EgtBEAMWALL:QParamListV>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="Macchina">
<TabItem.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
<EgtBEAMWALL:MachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
</GroupBox>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
<ItemsControl ItemsSource="{Binding ConfigMachTableList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto">
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
TextWrapping="WrapWithOverflow"
Width="100"
Style="{StaticResource MachParamTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
<EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Width="70"/>
<TextBlock Text="{Binding sDescription}"
<TextBlock Text="{Binding sDescription}"
TextWrapping="WrapWithOverflow"
Width="200"
Style="{StaticResource MachParamTextBlock}"
Grid.Column="2"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
</TabControl>
<Button Command="{Binding SaveCommand}"
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
</TabItem.Content>
</TabItem>
</TabControl>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Grid.Row="1"
Grid.Column="1"
Style="{StaticResource OptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</Grid>
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</Grid>
</DockPanel>
@@ -7,6 +7,32 @@ Imports EgtBEAMWALL.Core
Public Class ConfigurationPageVM
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
Friend bModifyMachParam As Boolean
@@ -105,7 +131,7 @@ Public Class ConfigurationPageVM
End Get
Set(value As String)
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
End If
End Set
@@ -118,12 +144,22 @@ Public Class ConfigurationPageVM
End Get
Set(value As String)
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
End If
End Set
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"
Public ReadOnly Property L_Msg As String
@@ -251,6 +287,12 @@ Public Class ConfigurationPageVM
End Get
End Property
Public ReadOnly Property PrintLabel_Msg As String
Get
Return EgtMsg(61894)
End Get
End Property
#End Region ' Messages
#Region "Constructor"
@@ -285,6 +327,7 @@ Public Class ConfigurationPageVM
' leggo SectionTime e PartTime
GetMainPrivateProfileString(S_NEST, K_SECTIONTIME, "", SectionTime)
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
ConfigMachTableList = CurrentMachine.MachTableList
' 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.
''' </summary>
Public Sub Save()
WriteMachParams()
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))
VerifyConfigPageModification()
End Sub
#End Region ' SaveCommand
@@ -400,7 +437,7 @@ Public Class ConfigurationPageVM
Dim FilePath As String = CurrentMachine.sMachDir & "\" & If(CurrentMachine.nType = MachineType.BEAM, BEAM_DIR, WALL_DIR) & "\" & TS3DATA_FILE
Dim sBakFilePath As String = Path.ChangeExtension(FilePath, ".bak")
If File.Exists(sBakFilePath) Then File.Delete(sBakFilePath)
File.Move(FilePath, sBakFilePath)
If File.Exists(FilePath) Then File.Move(FilePath, sBakFilePath)
File.WriteAllLines(FilePath, NewTs3DataFileContent, Text.Encoding.UTF8)
' se macchina di tipo BOTH copio il file appena scritto nella cartella Wall nella cartella Beam
If CurrentMachine.nType = MachineType.BOTH Then
@@ -415,58 +452,69 @@ Public Class ConfigurationPageVM
' funzione che verifica la modifica dei valori in Configurazione e ne chiede il salvataggio
Friend Sub VerifyConfigPageModification()
' Prima ciclo sui parametri Macchina
Dim bExitFor = False
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
' Ora ciclo sui parametri Q
Dim bAskToSaveDefaultValues As Boolean = False
bExitFor = False
For Each PRCItem In PRCList
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)
Select Case m_SelConfigSubPage
Case ConfigSubPages.GENERAL
' aggiorno tutti i valori senza verificare modifiche
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))
WriteMainPrivateProfileString(S_PRINTER, K_ENABLE, If(m_bPrintLabel_IsChecked, 1, 0))
Case ConfigSubPages.QPARAMETERS
' ciclo sui parametri Q
Dim bAskToSaveDefaultValues As Boolean = False
For Each PRCItem In PRCList
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
Next
NotifyPropertyChanged(NameOf(QBTLParamVMList))
End If
' 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())
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
' funzione che verifica l'inserimento della password quando si edita un parametro Macchina
@@ -638,11 +686,11 @@ Public Class MachParam
' trasformo valori
Select Case nType
Case MachParamType.DOUBLE_
StringToDouble(value, dNewValue)
StringToDouble(sOrigValue, dOrigValue)
StringToDoubleAdv(value, dNewValue, True)
StringToDoubleAdv(sOrigValue, dOrigValue, True)
Case MachParamType.LENGTH
StringToLen(value, dNewValue)
StringToLen(sOrigValue, dOrigValue)
StringToLenAdv(value, dNewValue, True)
StringToLenAdv(sOrigValue, dOrigValue, True)
Case Else
' per string non faccio nulla
End Select
@@ -1,54 +0,0 @@
Module ConstMsg
Public Const MSG_SETUPERRORS As Integer = 5000 + 1470
Public Const MSG_MISSINGKEYWD As Integer = 10100
Public Const MSG_NUMERICKEYBOARDWD As Integer = 10200
Public Const MSG_MESSAGEBOX As Integer = 15000
Public Const MSG_EGTSAVEFILEDIALOG As Integer = 30000
Public Const MSG_OMAGCUT As Integer = 90000
Public Const MSG_GENERAL As Integer = MSG_OMAGCUT
Public Const MSG_WORKINPROGRESSPAGEUC As Integer = MSG_OMAGCUT + 100
Public Const MSG_DIRECTCUTPAGEUC As Integer = MSG_OMAGCUT + 200
Public Const MSG_MANUALAXESMOVEPAGEUC As Integer = MSG_OMAGCUT + 220
Public Const MSG_CADCUTPAGEUC As Integer = MSG_OMAGCUT + 300
Public Const MSG_NESTPAGEUC As Integer = MSG_OMAGCUT + 330
Public Const MSG_SPLITPAGEUC As Integer = MSG_OMAGCUT + 340
Public Const MSG_MOVERAWPAGEUC As Integer = MSG_OMAGCUT + 360
Public Const MSG_DRAWPAGEUC As Integer = MSG_OMAGCUT + 380
Public Const MSG_COMPONENTPAGEUC As Integer = MSG_OMAGCUT + 400
Public Const MSG_IMPORTPAGEUC As Integer = MSG_OMAGCUT + 450
Public Const MSG_OPENPAGEUC As Integer = MSG_OMAGCUT + 490
Public Const MSG_RAWPARTPAGEUC As Integer = MSG_OMAGCUT + 500
Public Const MSG_CHOOSEMACHININGPAGEUC As Integer = MSG_OMAGCUT + 535
Public Const MSG_SIMULATIONPAGEUC As Integer = MSG_OMAGCUT + 550
Public Const MSG_FRAMECUTPAGEUC As Integer = MSG_OMAGCUT + 600
Public Const MSG_MACHINEPAGEUC As Integer = MSG_OMAGCUT + 700
Public Const MSG_TOOLSDBPAGEUC As Integer = MSG_OMAGCUT + 720
Public Const MSG_MACHININGSDBPAGEUC As Integer = MSG_OMAGCUT + 760
Public Const MSG_COMBOBOXPARAM As Integer = MSG_OMAGCUT + 800
Public Const MSG_ALARMSPAGEUC As Integer = MSG_OMAGCUT + 900
Public Const MSG_MACHINECNPAGEUC As Integer = MSG_OMAGCUT + 950
Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 980
Public Const MSG_EGTMSGBOX As Integer = MSG_OMAGCUT + 1100
Public Const MSG_CSVPAGEUC As Integer = MSG_OMAGCUT + 1200
Public Const MSG_OMAGOFFICE As Integer = 91400
Public Const MSG_OPTIONPANEL As Integer = MSG_OMAGOFFICE
Public Const MSG_MYMACHININGDBWINDOW As Integer = MSG_OMAGOFFICE + 50
Public Const MSG_TOPCMDBAR As Integer = MSG_OMAGOFFICE + 100
Public Const MSG_RAWPARTTAB As Integer = MSG_OMAGOFFICE + 150
Public Const MSG_VEINMATCHING As Integer = MSG_OMAGOFFICE + 200
Public Const MSG_GENERIC As Integer = MSG_OMAGOFFICE + 250
Public Const MSG_EGTWPFLIB5 As Integer = 30000
Public Const MSG_TOPCOMMANDBAR As Integer = MSG_EGTWPFLIB5 + 500
Public Const MSG_GRIDVIEWPANEL As Integer = MSG_EGTWPFLIB5 + 800
Public Const MSG_TOOLDB As Integer = MSG_EGTWPFLIB5 + 1000
Public Const MSG_TOOLDBERRORS As Integer = MSG_EGTWPFLIB5 + 1100
Public Const MSG_MACHININGDB As Integer = MSG_EGTWPFLIB5 + 1200
Public Const MSG_MACHININGDBERRORS As Integer = MSG_EGTWPFLIB5 + 1400
Public Const MSG_SIMULATION As Integer = MSG_EGTWPFLIB5 + 1600
End Module
@@ -102,9 +102,44 @@
<PropertyGroup>
<ApplicationIcon>Resources\EgtBEAMWALL.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</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>
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="EgtUILib, Version=2.4.3.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -120,20 +155,20 @@
<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>
</Reference>
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<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>
</Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
<Reference Include="K4os.Compression.LZ4, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.3.5\lib\net462\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.5.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.5\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="MigraDoc.DocumentObjectModel-wpf, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
@@ -174,18 +209,24 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" />
<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.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<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>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.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>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<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.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
@@ -615,7 +656,6 @@
<Compile Include="ItemParamList\RawPartListV.xaml.vb">
<DependentUpon>RawPartListV.xaml</DependentUpon>
</Compile>
<Compile Include="Constants\ConstMsg.vb" />
<Compile Include="FeatureManager\FeatureManagerV.xaml.vb">
<DependentUpon>FeatureManagerV.xaml</DependentUpon>
</Compile>
@@ -732,6 +772,7 @@
<CustomToolNamespace>My.Resources</CustomToolNamespace>
</EmbeddedResource>
<None Include="App.config" />
<None Include="app.manifest" />
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
@@ -946,6 +987,15 @@
<ItemGroup>
<Resource Include="Resources\PartManager\Clock.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\LeftPanel\NewRawPartAuto.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TopPanel\RemoveAllRawPart.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ProjectManager\AddProj.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<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}}}"
IsEnabled="{Binding FeatureManager_IsEnabled}"
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}}}"
Style="{StaticResource OptionTextBlock}"/>
<Button Content="{Binding Edit_Msg}"
@@ -18,8 +18,18 @@ Public Class FeatureManagerVM
Public ReadOnly Property Edit_IsEnabled As Boolean
Get
Return m_FeatureManager_IsEnabled AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 AndAlso
Map.refProjectVM.BTLStructureVM.SelBTLParts(0).SelBTLFeatureVM.BTLFeatureM.IsFreeContour() AndAlso Map.refProjectVM.BTLStructureVM.SelBTLParts(0).SelBTLFeatureVM.bDO
Return m_FeatureManager_IsEnabled AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso
Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 AndAlso
Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLParts(0)) AndAlso
Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLParts(0).SelBTLFeatureVM) AndAlso
Map.refProjectVM.BTLStructureVM.SelBTLParts(0).SelBTLFeatureVM.BTLFeatureM.IsFreeContour() AndAlso
Map.refProjectVM.BTLStructureVM.SelBTLParts(0).SelBTLFeatureVM.bDO
End Get
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
@@ -37,6 +47,12 @@ Public Class FeatureManagerVM
End Get
End Property
Public ReadOnly Property Priority_Msg As String
Get
Return EgtMsg(61895)
End Get
End Property
Public ReadOnly Property Edit_Msg As String
Get
Return EgtMsg(61826)
@@ -19,7 +19,8 @@
Style="{StaticResource OptionTextBlock}"/>
<TextBox Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}"
Width="200"
Visibility="{Binding Text_Visibility}" Margin="5,0,5,0">
Visibility="{Binding Text_Visibility}" Margin="5,0,5,0"
Style="{StaticResource FreeContour_TextBox}">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding Done_Command, UpdateSourceTrigger=PropertyChanged}"/>
<KeyBinding Key="S" Modifiers="Control" Command="{Binding Show_Command}"/>
@@ -271,12 +271,12 @@ Public Class FreeContourManagerVM
Private m_cmdDelete As ICommand
Private m_cmdModifyCurve As ICommand
Private m_cmdAddPointCurve As ICommand
Private m_cmdRemovePointCurve As ICommand
Private m_cmdArcflip As ICommand
Private m_cmdMove As ICommand
Private m_cmdRotate As ICommand
Private m_cmdMirror As ICommand
Private m_cmdScale As ICommand
Private m_cmdRemovePointCurve As ICommand
Private m_cmdChangeStart As ICommand
Private m_cmdInvertCurve As ICommand
Private m_cmdTextAngle As ICommand
@@ -324,7 +324,7 @@ Public Class FreeContourManagerVM
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
' verifico se solido attivo
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
EgtSetShowCurveDirection(True)
' elimino eventuale vecchio layer testi
@@ -367,7 +367,7 @@ Public Class FreeContourManagerVM
m_SelType = FreeContourTypes.TWO
End If
End If
' se nuova senza percorsi
' se nuova senza percorsi
Else
' imposto modalita' un percorso
m_SelType = FreeContourTypes.ONE
@@ -424,10 +424,12 @@ Public Class FreeContourManagerVM
NotifyPropertyChanged(NameOf(Line2P_IsEnabled))
NotifyPropertyChanged(NameOf(TextAngle_Visibility))
NotifyPropertyChanged(NameOf(PathList_Visibility))
' posiziono la griglia sulla faccia attiva
' posiziono la griglia sul riferimento del contorno libero
Dim frFace As New Frame3d
EgtBeamGetSideData(SelFeature.nSelSIDE, frFace)
EgtSetGridFrame(frFace)
Dim frFrame As Frame3d = SelFeature.BTLFeatureM.frFRAME
frFrame.ToGlob( frFace)
EgtSetGridFrame(frFrame)
EgtSetGridShow(True, True)
Map.refSceneHostVM.MainScene.CPlaneView()
' rimetto la selezione scena a null
@@ -442,11 +444,8 @@ Public Class FreeContourManagerVM
End Sub
Friend Sub Close(bSave As Boolean)
If m_bIsActive Then
m_bIsActive = False
Else
Return
End If
If not m_bIsActive Then Return
m_bIsActive = False
' gestisco modifiche ai percorsi
If bSave Then
Select Case m_SelType
@@ -459,7 +458,8 @@ Public Class FreeContourManagerVM
Dim sSideAngInfo As String = ""
For Index = 0 To SideAngValues.Count - 1
If Index > 0 Then sSideAngInfo &= ","
sSideAngInfo &= SideAngValues(Index).dValue
Dim sAng As String = DoubleToString(SideAngValues(Index).dValue, 2)
sSideAngInfo &= sAng
Next
EgtSetInfo(m_nNewPathId, "SideAngs", sSideAngInfo)
EgtSetInfo(nSelFeatureId, "AUXID", (m_nNewPathId - nSelFeatureId).ToString("+#;-#;0"))
@@ -474,7 +474,7 @@ Public Class FreeContourManagerVM
Dim BTLFeatureM As BTLFeatureM = SelFeature.BTLFeatureM
BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
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
SelFeature.SelGeomFeature()
' rendo non calcolata questa feature
@@ -519,7 +519,8 @@ Public Class FreeContourManagerVM
' elimino eventuale layer dei testi angoli
EgtErase(nSideAngTextLayer)
nSideAngTextLayer = GDB_ID.NULL
' nascondo la griglia
' riporto griglia globale e la nascondo
EgtSetGridFrame( New Frame3d())
EgtSetGridShow(False, False)
' se il progetto non era modificato ed esco senza salvare, resetto lo stato di modificato
If Not m_bAlreadyModified And Not bSave Then
@@ -539,7 +540,7 @@ Public Class FreeContourManagerVM
Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility))
' disattivo modifiche su scena
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
EgtSetShowCurveDirection(False)
' reimposto filtro selezione
@@ -596,6 +597,12 @@ Public Class FreeContourManagerVM
Friend Sub UpdateUi()
' se attiva operazione in piu' passaggi, esco
If Map.refSceneHostVM.MainController.GetContinue() Then Return
' se finita creazione curva (è stata chiusa)
If Map.refFreeContourManagerVM.bIsCreatingPath Then
Dim nNewPathLayerId As Integer = EgtGetFirstNameInGroup(nSelPartId, "NewPathLayer")
Dim nNewPathId As Integer = EgtGetFirstInGroup(nNewPathLayerId)
If EgtGetType(nNewPathId) = GDB_TY.CRV_COMPO Then Map.refFreeContourManagerVM.CreatingPathEnd()
End If
' se non ci sono piu' i percorsi, permetto di aggiungerli
If EgtGetType(m_nNewPathId) = GDB_TY.NONE Then
m_nNewPathId = GDB_ID.NULL
@@ -643,9 +650,10 @@ Public Class FreeContourManagerVM
EgtAtParamPoint(m_nNewPathId, Index + 0.5, ptText)
Dim dSideAng As Double = 0
If sSideAngSplit.Count - 1 >= Index Then
StringToDouble(sSideAngSplit(Index), dSideAng)
StringToDoubleAdv(sSideAngSplit(Index), dSideAng, True)
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)
SideAngValues.Add(New SideAngle(TextId, Index, dSideAng))
Next
@@ -738,7 +746,7 @@ Public Class FreeContourManagerVM
End If
ElseIf bChangedStart Then
' non faccio nulla perche' gestito sopra
' se apro percorso
' se apro percorso
ElseIf Not bNewIsClosed AndAlso bOldIsClosed AndAlso Index = NewAngleList.Count Then
' cancello il testo del lato rimosso
nMovedIndex = OldAngleList.FindIndex(Function(x) AreSamePointApprox(x, NewAngleList(CurrIndex - 1)))
@@ -746,7 +754,7 @@ Public Class FreeContourManagerVM
Dim NewIndex As Integer = (nPointsQty + nOffset) Mod nPointsQty
EgtErase(SideAngValues(nOffset).nId)
NewSideAngValues.RemoveAt(NewSideAngValues.Count - 1)
' se chiudo percorso
' se chiudo percorso
ElseIf bNewIsClosed AndAlso Not bOldIsClosed AndAlso Index = OldAngleList.Count Then
' creo il testo del lato aggiunto
Dim ptText As Point3d
@@ -755,20 +763,21 @@ Public Class FreeContourManagerVM
' aggiungo punto e incremento indice di confronto per riallineare successivo
NewSideAngValues.Add(New SideAngle(TextId, NewSideAngValues.Count - 1, 0))
'' 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
Not (Index = nPointsQty / 2 AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1))) Then
If Index < nPointsQty AndAlso nOldIndex <= SideAngValues.Count - 1 Then
NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue))
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
(AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1)))) 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))
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
((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
@@ -791,20 +800,20 @@ Public Class FreeContourManagerVM
NewSideAngValues.Add(New SideAngle(SideAngValues(Index).nId, NewSideAngValues.Count, SideAngValues(Index).dValue))
End If
'' 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
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
If Index < nPointsQty AndAlso nOldIndex < SideAngValues.Count Then
NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue))
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
(AreSamePointApprox(NewAngleList(nNewIndex), OldAngleList(nOldIndex)) AndAlso AreSamePointApprox(NewAngleList(Index - 1), OldAngleList(nPointsQty - Index + 1)))) Then
If Index < nPointsQty Then
NewSideAngValues.Add(New SideAngle(SideAngValues(nPointsQty - 1 - Index).nId, NewSideAngValues.Count, SideAngValues(nPointsQty - 1 - Index).dValue))
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
(bNewIsClosed AndAlso nOldIndex + 1 = OldAngleList.Count AndAlso nNewIndex + 1 = NewAngleList.Count AndAlso AreSamePointApprox(NewAngleList(1), OldAngleList(1))) Then
' aggiorno posizione testo precedente
@@ -825,7 +834,7 @@ Public Class FreeContourManagerVM
EgtMove(SideAngValues(nOldIndex).nId, vtDistance)
NewSideAngValues.Add(New SideAngle(SideAngValues(nOldIndex).nId, NewSideAngValues.Count, SideAngValues(nOldIndex).dValue))
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
(nOldIndex = OldAngleList.Count AndAlso OldAngleList.Count < NewAngleList.Count) Then
' se non e' percorso aperto e primo punto
@@ -847,7 +856,7 @@ Public Class FreeContourManagerVM
' aggiungo punto e incremento indice di confronto per riallineare successivo
NewSideAngValues.Insert(TextIndex, New SideAngle(TextId, TextIndex, 0))
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
(nNewIndex = NewAngleList.Count AndAlso OldAngleList.Count > NewAngleList.Count) Then
' non aggiungo nulla, ma cancello testo
@@ -860,7 +869,7 @@ Public Class FreeContourManagerVM
EgtAtParamPoint(m_nNewPathId, If(Index = 0, NewAngleList.Count, Index) - 0.5, ptNew)
Dim vtDistance As Vector3d = ptNew - ptOld
EgtMove(SideAngValues(If(Index = 0, OldAngleList.Count, Index) - 1).nId, vtDistance)
' spostato o ruotato intero percorso
' spostato o ruotato intero percorso
Else
' aggiorno posizione testo successivo
Dim ptOld As Point3d
@@ -889,9 +898,10 @@ Public Class FreeContourManagerVM
If bResult Then
' scrivo info con nuova inclinazione
Dim dAng As Double
StringToDouble(Map.refFreeContourInputVM.Text, dAng)
StringToDoubleAdv(Map.refFreeContourInputVM.Text, dAng, True)
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)
SideAngValue.dValue = dAng
End If
@@ -925,6 +935,8 @@ Public Class FreeContourManagerVM
Return sLayerName = PATH_SIDEANGLAYER
ElseIf Map.refFreeContourManagerVM.bIsOpeningCurveCompo Then
Return nId = m_nNewPathId
Else
Return False
End If
End Function
@@ -936,8 +948,9 @@ Public Class FreeContourManagerVM
Map.refFreeContourInputVM.PrepareInputBox(EgtMsg(62007), EgtMsg(62008), "", False, False)
Dim dSideAng As Double = 0
EgtGetInfo(nId, "SideAng", dSideAng)
Map.refFreeContourInputVM.SetInputBoxText(dSideAng)
' se sto aprendo percorso chiuso
Dim sSideAng As String = DoubleToString( dSideAng, 2)
Map.refFreeContourInputVM.SetInputBoxText(sSideAng)
' se sto aprendo percorso chiuso
ElseIf Map.refFreeContourManagerVM.bIsOpeningCurveCompo Then
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.OPENCOMPO)
m_bIsOpeningCurveCompo = False
@@ -974,13 +987,21 @@ Public Class FreeContourManagerVM
''' Execute the Line2P. This method is invoked by the Line2PCommand.
''' </summary>
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")
EgtSetCurrPartLayer(nSelPartId, nNewPathLayerId)
InitCommand(True)
InitCommand(False)
Map.refSceneHostVM.MainController.SetContinue()
If Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.LINE2P) Then
m_bIsCreatingPath = True
Else
EgtErase(nNewPathLayerId)
End If
End Sub
@@ -213,49 +213,17 @@ Public Class MyInstrumentPanelVM
For Each Param In ParamList.Where(Function(x) x.sName = ChangeParameterWndVM.SelParam.sName)
Select Case Param.nType
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, "")
'' 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
Case BTLParamType.STRING_
If Param.sValue = ChangeParameterWndVM.SelParam.sActualValue Then
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 Select
Next
End If
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
End If
LoadingWndHelper.CloseLoadingWnd(ActiveIds.CHANGEPARAM)
@@ -83,10 +83,16 @@
<!--Descrizione-->
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDesc}">
<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>
</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>
<!--<TextBlock Grid.Row="1"
@@ -11,6 +11,13 @@ Public Class FeatureInPartInRawPartListVM
End Get
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)
Public Property FeatureInPartInRawPartColumns As ObservableCollection(Of EgtDataGridColumn)
Get
@@ -35,6 +42,12 @@ Public Class FeatureInPartInRawPartListVM
End Get
End Property
Public ReadOnly Property Priority_Msg As String
Get
Return EgtMsg(61895)
End Get
End Property
#End Region ' Messages
Sub New()
@@ -44,6 +57,13 @@ Public Class FeatureInPartInRawPartListVM
GetPrivateProfileColumns(S_FEATUREINPARTINRAWPARTLIST, FeatureInPartInRawPartColumns)
' recupero riferimento a colonna 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 Class
@@ -131,6 +131,18 @@
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
<!--PosZ - Posizione in Z-->
<DataGridTextColumn x:Key="colPOSZ" Binding="{Binding sPosZ}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.PosZ_Msg,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:RawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Blue" />
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
<!--MAT - Materiale-->
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
<DataGridTextColumn.Header>
@@ -69,6 +69,12 @@ Public Class RawPartListVM
End Get
End Property
Public ReadOnly Property PosZ_Msg As String
Get
Return EgtMsg(61728)
End Get
End Property
Public ReadOnly Property Material_Msg As String
Get
Return EgtMsg(61607)
@@ -90,6 +90,13 @@
Style="{StaticResource LeftPanel_Button}">
<Image Source="/Resources/LeftPanel/NewRawPart.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding NewRawPartLast_Command}"
Visibility="{Binding MachiningPage_Visibility}"
ToolTip="{Binding NewRawPartLast_ToolTip}"
IsEnabled="{Binding LeftPanel_IsEnabled}"
Style="{StaticResource LeftPanel_Button}">
<Image Source="/Resources/LeftPanel/NewRawPartAuto.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding AddToRawPart_Command}"
Visibility="{Binding MachiningPage_Visibility}"
ToolTip="{Binding AddToRawPart_ToolTip}"

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