Compare commits

...

956 Commits

Author SHA1 Message Date
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
Samuele Locatelli 2b8342111a Update mysql
- non impiegate dll locali
- impiego nuget ufficiali
- limite vers 8.21 per problema report versione mariadb < 5.6
2022-07-19 15:11:34 +02:00
Samuele Locatelli d57dd30fa0 Merge remote-tracking branch 'origin/develop' into DataLayer 2022-07-19 14:07:46 +02:00
Emmanuele Sassi 06d3c53122 Merge branch 'Selection&Highlight' into develop 2022-07-19 12:22:25 +02:00
Emmanuele Sassi 5a20897641 - Introdotta modalita' chiave operatore con opzione AnyDb
- Gestito lock con abilitazione all'apertura dei file
- Gestione nuovi campi Db per lock negli oggetti vb
- Aggiunto id chiave su lock
2022-07-19 11:35:03 +02:00
Emmanuele Sassi ae65d448a9 - gestiti rotazione e traslazione prima per evitare problemi con rotazione su punto del percorso 2022-07-18 09:22:17 +02:00
Emmanuele Sassi df9395e808 - Correzioni e miglioramenti a modifica contorni liberi 2022-07-15 14:53:55 +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 3d867dfa3a Merge branch 'develop' into DataLayer 2022-07-13 11:51:56 +02:00
Emmanuele Sassi 03a6936f8a - Rimosso check da input FreeContour
- Aggiunta possibilita' di fare sort su casella calc di BTLPart
2022-07-12 20:03:13 +02:00
Emmanuele Sassi a4a48f3c3b - Completata implementazione base della modifica dei FreeContour
- Abilitato bottone edit FreeContour solo su feature attive
- Implementazione blocco interfaccia durante modifica FreeContour
2022-07-12 18:48:59 +02:00
Emmanuele Sassi 1d7c390180 Merge branch 'Selection&Highlight' into develop 2022-07-07 21:00:07 +02:00
Emmanuele Sassi adb4636513 Merge remote-tracking branch 'gitlab.seriate/develop' into Selection&Highlight 2022-07-07 20:59:25 +02:00
Emmanuele Sassi fb0c02e790 - correzione a selezione superfici
- correzione impostazioni parametri griglia
2022-07-07 20:59:14 +02:00
DarioS b5ef4567b6 EgtBEAMWALL 2.4g1 :
- modifiche per cambio faccia FreeContour
- modifiche per vista da griglia in modifica FreeContour.
2022-07-07 20:57:39 +02:00
Emmanuele Sassi 1a6c2fa340 - migliorie modifica freecontour 2022-07-07 19:08:50 +02:00
Emmanuele Sassi 21784ab491 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into Selection&Highlight 2022-07-06 16:21:52 +02:00
Samuele Locatelli d5147e3dd1 Fix init valori DB in migration 2022-07-06 16:18:32 +02:00
Emmanuele Sassi bfb1dea84b Merge remote-tracking branch 'gitlab.seriate/DataLayer' into Selection&Highlight 2022-07-06 15:43:10 +02:00
Emmanuele Sassi e927a5334a - prosecuzione implementazione modifica L250 2022-07-06 15:36:51 +02:00
Samuele Locatelli 3310eb039c Typo e formattazioni varie 2022-07-06 13:07:06 +02:00
Samuele Locatelli 946b4e0e42 Upgrade DataLayer:
- fix init NLog
- MAJOR fix x gestione migrations della struttura dati
- cambio organizzazione interna processo migration
2022-07-06 12:58:48 +02:00
Samuele Locatelli ff7661f1e0 Merge remote-tracking branch 'origin/Selection&Highlight' into DataLayer 2022-07-06 11:11:53 +02:00
Samuele Locatelli f4eaaf2d59 refresh x testing migrazione DB 2022-07-06 11:10:02 +02:00
Samuele Locatelli b5fef75133 update modelli e metodi x novi campi LockBy 2022-07-06 11:09:54 +02:00
Samuele Locatelli 09035439bd Aggiunta migrazioni modello 2022-07-06 11:09:35 +02:00
Emmanuele Sassi 22ed5c599c - Aggiunta verifica automatica quando si manda barra al supervisore 2022-07-06 09:28:47 +02:00
Emmanuele Sassi 8822da5d09 - Evitato di scrivere cutid a taskid da supervisor per non modificare il progetto
- Gestita dimensione eposizione finestra supervisor
- Gestita visibilita' bottone cambio macchina da ini
- Introdotto log degli eventi macchina
- Disattivo bottoni macchina durante ricalcolo cn in supervisore
- Agiunta lettura variabili E80000, E80001, E80002 per Num
- Correzioni e migliorie a passaggio barre tra vieoptim e supervisore e vice versa
- Corretto stato delle feature su ripartenza
- Introduzione configurazione cartelle prod e proj da path per funzionamento in rete
-  Aggiunta impostazione ccartella condivisa per funzionamento in rete
- Interruzione lettura statusmap durante ricaricamento progetto
- Modificata finestra di blocco per gestione con salvataggio diretto se versione non di rete
- Evidenziazione copie in visualizzazione struttura in visualizzatore
- Aggiornamento dei risultati di verifica anche in ottimizzatore quando mandato programma cna alla macchina
- Correzione a indica di modifica progetto in pagina view
- Correzione aggiornamento titolo prod su salvataggio
- Correzione a selezione pezzi su scena
2022-07-05 17:52:48 +02:00
Emmanuele Sassi c4d01b7aff Merge remote-tracking branch 'gitlab.seriate/DataLayer' into Selection&Highlight 2022-07-05 16:13:23 +02:00
Samuele Locatelli c8e962d709 Update campo IsNew su DB
- corretto azione x machGroupUpdate
- corretto azione x REDO

x entrambi i casi il problema era il dato esterno al context salvato
2022-07-05 16:13:03 +02:00
Emmanuele Sassi cb7819c687 - modifiche per log eventi su macchina 2022-06-28 11:06:43 +02:00
Emmanuele Sassi ebd9092565 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into Selection&Highlight 2022-06-27 18:50:58 +02:00
Samuele Locatelli 167c6bf39d Gestione LogProduzione
- aggiunta metodi da DB
- traduzione implicita da DB a core model
2022-06-27 18:50:14 +02:00
Samuele Locatelli def20a48a3 fix copy if newer x NLog 2022-06-27 15:52:20 +02:00
Samuele Locatelli 0945aaf9d0 Fix procedura di LOG
- aggiunta file NLog.config
- aggiorna gestione scrittura dir
- aggiunto log caso x caso su file
2022-06-27 15:51:34 +02:00
Samuele Locatelli 07dbd89849 Merge remote-tracking branch 'origin/develop' into DataLayer 2022-06-27 15:09:05 +02:00
Emmanuele Sassi fa511c5c2c Merge remote-tracking branch 'gitlab.seriate/develop' into Selection&Highlight 2022-06-27 13:35:07 +02:00
Emmanuele Sassi 6c065fedfc - Correzione lettura parametro btl camber
- Spostata variabile warehouse in file ini ed aggiunto minimo di default
- Abilitata riselezione su barra
- Su ripartenza barra, fissato startoffset a 0.1
- Correzione a parametri V su Tpa che venivano castati sbagliati in automatico
- Girata vista su macchine rovescie anche per travi
- Correzione su selezione dopo creazione nuovo pezzo
2022-06-27 13:33:05 +02:00
Emmanuele Sassi 7858480cde Merge branch 'Selection&Highlight' into develop 2022-06-22 14:15:43 +02:00
Emmanuele Sassi c388cb7b21 Merge remote-tracking branch 'gitlab.seriate/develop' into Selection&Highlight 2022-06-22 13:42:04 +02:00
Emmanuele Sassi 4d11248b0e - aggiornamento numero versione 2022-06-22 13:39:47 +02:00
Emmanuele Sassi e2040f2153 - gestito scarto travi come avanzo
- corretta cancellazione duplo
- gestita vista macchine rovesciate travi come pareti
- aggiunto grassetto su BTLPart quando inserito in grezzo
- migliorata selezione BTLPart
- gestito offset minimo su pezzi nei grezzi
2022-06-22 13:26:31 +02:00
Emmanuele Sassi b19b44f86d - gestione solido su modifica dimensione Part e dis/attivazione feature
- correzione a modifica dimensioni pezzi che sono gia' nei grezzi
- Correzione gestione filtri sezione su rotazione pezzo
- Creazione PartsObsColl per gestire correttamente aggiunta e rimozione senza creare duplicati
2022-06-21 12:03:59 +02:00
Emmanuele Sassi eb37f8bb8f - Miglioramenti a selezione nuova
- Miglioramenti a lista syncro con Db
2022-06-20 16:24:35 +02:00
Emmanuele Sassi b83a03e36a - correzione path mancante
- correzione porta usata per scrivere variabili su pctoolkit num
2022-06-17 17:45:55 +02:00
Emmanuele Sassi 6d11f6345f - correzione per cambio BTLPart con solido attivo
- aggiornamento versione
2022-06-15 21:06:15 +02:00
Emmanuele Sassi 32e8cf7923 - Inizio sviluppo selezione e highlight 2022-06-15 16:37:57 +02:00
Emmanuele Sassi ac2167f5ea - Modifica per funzionamento network al primo accesso con creazione Db
- Impedisco sort della tabella dei pezzi nei grezzi
2022-06-15 16:30:49 +02:00
Emmanuele Sassi 8236b0ff96 - inizio gestione versione di rete 2022-06-14 13:04:58 +02:00
Emmanuele Sassi 78cde47c01 - aggiunta attivazione edit da file ini
- gestione lettura e scrittura variabile E30099 su axium con PcToolkit
- Impostata modifica duplo su aggiungi, copia e rimuovi feature
- aggiunto tempo di lavorazione pezzo in PartManager
- correzione su lista mru dei prod nuovi non ancora salvati
2022-06-08 18:30:37 +02:00
Emmanuele Sassi 2d51bbaeb5 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into develop 2022-05-27 09:42:34 +02:00
Emmanuele Sassi 620a87105a - Correzione offset in warehouse
- Correzione startoffset che non veniva aggiornato dopo spostamento primo pezzo
2022-05-27 09:42:32 +02:00
DarioS ab40ad056c EgtBEAMWALL :
- correzione problema selezione pezzo in vista ultimo selezionato prima di tornare a tutti.
2022-05-24 20:23:13 +02:00
Emmanuele Sassi 62f85d6f92 - aggiunto reset calc su aggiungi, togli o duplica feature
- aggiunto reset calc su modifica side e group
2022-05-19 10:56:24 +02:00
Emmanuele Sassi 01ac9d36da - Correzioni a commit precedente 2022-05-18 10:10:50 +02:00
Emmanuele Sassi a466e85b70 - Aggiunta gestione parametro E30099 e attesa per invio cn
- Correzione su visibilita' PartManager
- Aggiunta gestione minimo Offset travi in warehouse
2022-05-18 09:37:23 +02:00
Emmanuele Sassi 5c9fd216bc Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-05-13 12:55:17 +02:00
Emmanuele Sassi 4685717a8a - Implementazione comunicazione Axium PcToolkit
- Aggiornato scarto grezzi per travi e pareti
- Aggiunto tempo reale pezzi gia' prodotti
- Correzione in dialogo open
- Nascoste tutte le finestre del programma da taskbar tranne la principale
- Stampa pdf in ottimizzazione stampa solo i dati di ottimizzazione
- Aggiunti tempi di stimati o reali in view e optim
2022-05-13 12:52:04 +02:00
Samuele Locatelli 08ae91e412 Merge branch 'develop' 2022-05-10 10:20:32 +02:00
Samuele Locatelli 145b3ccbe8 Merge remote-tracking branch 'origin/develop' into develop 2022-05-10 10:20:00 +02:00
Samuele Locatelli 4cea9959c9 Corretto pubblicazione: solo develop/master x testing 2022-05-10 10:19:56 +02:00
DarioS 7118efbc2d EgtBEAMWALL :
- modifiche al lancio script Beam e Wall per passare direttorio di esecuzione.
2022-05-09 19:40:47 +02:00
DarioS 4a4613454d EgtBEAMWALL :
- correzione controllo esistenza direttorio all'apertura progetto
- correzione per eliminazione crash in import o merge file btl e in import progetti esportati.
2022-05-05 19:36:32 +02:00
DarioS 45464ab85d EgtBEAMWALL 2.4e2 :
- ricompilazione con cambio versione.
2022-05-05 10:26:50 +02:00
Emmanuele Sassi 22539226e6 - Gestita assenza cartella in progetto presente su Db
- Correzione su solido con multiselezione
- Correzione su sezione selezionata dopo rotazione con selezione multipla
- Progetti Db senza cartella di progetto vengono eliminati da Db
- Rotazione pareti aggiunte da UpdateBTL se macchina girata
2022-05-04 19:38:00 +02:00
Emmanuele Sassi e9eaff2685 - Corrette altre eccezioni
- Corretto Import da BTL
- Correzioni ad UpdateBTL
2022-05-02 19:44:11 +02:00
Emmanuele Sassi 66567d8ec6 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-05-02 13:05:05 +02:00
Emmanuele Sassi 1715b5c5b1 - Altre eccezioni corrette 2022-05-02 13:03:32 +02:00
Emmanuele Sassi 2ad4c5af21 - Aggiunto calcolo presa pinza su ripartenza
- Correzione eccezioni
2022-05-02 13:01:58 +02:00
DarioS 27a1618265 EgtBEAMWALL 2.4e1 :
- migliorie per cancellazione pezzo e assemblato.
2022-05-01 17:54:18 +02:00
Emmanuele Sassi a3c9d256b4 - Correzione errore selezione pezzo in grezzo che mostrava pezzo singolo in vista
- Aggiunto inverti con multi selezione
2022-04-30 17:41:39 +02:00
Emmanuele Sassi 5c6febf055 - Migliorata gestione selezione multipla
- Correzioni sovrascrittura progetto
- Corretto salvataggio path di importazione per importazione successiva
- Correzione a selezione in ottimizzatore dei BTLPart contenuti nei grezzi
2022-04-29 17:26:34 +02:00
Emmanuele Sassi feecab95ab - Gestita uscita da ToolDb con Alt+F4
- Gestito errore su solido attivo durante modifica parametri
- Gestione selezione multipla BTLParts
- Gestito bottone ctrl per impedire che deselezioni tutti gli elementi
- Aggiunti bottoni per rotazione di piu' pezzi contemporaneamente
- Correzioni ad UpdateBTL
2022-04-26 10:11:30 +02:00
Emmanuele Sassi d5a338a902 - Gestita chiusura Db utensili con alt + F4
- Gestione Num Axium
- Conversione automatica del file messaggi macchina nel nostro formato
2022-04-22 10:40:24 +02:00
Emmanuele Sassi 8763400f06 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2022-04-11 12:35:11 +02:00
Emmanuele Sassi 34ddc826f8 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into develop 2022-04-07 14:46:58 +02:00
Emmanuele Sassi 1b3c46fbae - Correzione cancellazione progetto nuovo non salvato 2022-04-07 14:46:55 +02:00
DarioS b05fbac9fe EgtBEAMWALL :
- modifica visualizzazione parametri macchina.
2022-04-07 13:21:41 +02:00
Emmanuele Sassi 42353d4b04 - Correzioni a gestione Ts3Data 2022-04-07 09:22:31 +02:00
Emmanuele Sassi 52ce04727a - introdotta lettura parametri macchina da Ts3Data
- evitata scrittura ts3Data quando non trovato file ini dei parametri
- salva backup file Ts3Data prima di sovrascriverlo
2022-04-06 15:46:32 +02:00
Emmanuele Sassi 87b4ebca64 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2022-04-04 19:18:59 +02:00
Samuele Locatelli c7a50d88b7 completata review x gestione cancellazioni nuova struttura datalayer (solo typo fix) 2022-04-04 19:16:33 +02:00
Samuele Locatelli fef7112f46 Merge remote-tracking branch 'origin/develop' into DataLayer 2022-04-04 19:10:18 +02:00
Emmanuele Sassi 98025f02a4 - Correzione errore Db cancellazione progetto Prod
- Correzione comunicazione con supervisor
2022-04-04 19:10:00 +02:00
Emmanuele Sassi f4b4d5ee90 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into develop 2022-04-04 18:21:36 +02:00
Emmanuele Sassi 6337113437 Merge remote-tracking branch 'gitlab.seriate/Test_CICD' into develop 2022-04-04 18:21:22 +02:00
Emmanuele Sassi b7b2606c84 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2022-04-04 18:00:19 +02:00
Emmanuele Sassi c79a584ab7 - Corretta gestione pezzi scartati in optimizer
- Migliorata gestione tabella feature in supervisor
- Gestito elemento selezionato dopo alcuni comandi che lo resettavano
- Correzioni varie stati pezzi dopo ripartenza barra (redo)
- Gestione del nome supervisor
- Miglioramento finestre block e wait
- Correzione posizionamento pezzi in nesting da btl
2022-04-04 17:59:41 +02:00
DarioS f7435ab895 EgtBEAMWALL 2.4d1 :
- ricompilazione con cambio versione.
2022-04-04 07:39:17 +02:00
Samuele Locatelli ccd9a70c0c Merge branch 'DataLayer' into Test_CICD 2022-04-01 19:25:13 +02:00
Samuele Locatelli 04c8f8eba2 Cleanup finale aree #if false 2022-04-01 19:24:39 +02:00
Samuele Locatelli e8870ca050 Fix renaming vari 2022-04-01 19:18:41 +02:00
Samuele Locatelli 6900eedd63 Fix BTLPartController 2022-04-01 19:18:34 +02:00
Samuele Locatelli 5848bc2b0c Update gestione context x classi log 2022-04-01 19:10:16 +02:00
Samuele Locatelli 795f202b0c Fix part controller x local ctx 2022-04-01 17:30:46 +02:00
Samuele Locatelli e41cb24fc9 Typo rename 2022-04-01 17:28:02 +02:00
Samuele Locatelli ed72c7a4e1 Update controller Prod con using locale 2022-04-01 17:27:47 +02:00
Samuele Locatelli 8c3ff80547 Update projController x impiego useing ctx 2022-04-01 17:19:17 +02:00
Samuele Locatelli 28de1c6791 Update x Fix Controller StatusMap 2022-04-01 17:03:35 +02:00
Samuele Locatelli 4e814d73c6 Fix gestione localDbContext x MachGroup controller 2022-04-01 16:56:50 +02:00
Samuele Locatelli 402015af8a Merge branch 'DataLayer' into Test_CICD 2022-04-01 10:57:21 +02:00
Samuele Locatelli e4d1514047 Eliminata cancellazione, al suo posto esclusione in robocopy 2022-04-01 10:56:38 +02:00
Samuele Locatelli 33da807eb5 spostamento in coda della fase attesa + cambio dir destinazione x singolo programma 2022-04-01 10:56:04 +02:00
Samuele Locatelli 43a755febd Merge branch 'Test_CICD' into DataLayer 2022-04-01 10:51:17 +02:00
gitlab 24ed23f161 Update .gitlab-ci.yml file 2022-04-01 07:52:38 +00:00
Emmanuele Sassi ba6a718119 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2022-04-01 09:35:35 +02:00
Samuele Locatelli 9a7db0207d fix tab indentation 2022-04-01 09:34:55 +02:00
Samuele Locatelli e35f51e0c8 Fix gestione multi session esplicita da DataLayer 2022-04-01 09:33:48 +02:00
Samuele Locatelli 4502f1162c Merge remote-tracking branch 'origin/develop' into DataLayer 2022-04-01 09:17:45 +02:00
Emmanuele Sassi 370b270d95 - Aggiunto filtro macchina su finestra apertura progetto
- Correzione uscita da pagina Configurazione che bloccava il programma
- Creazione path DataDir per funzionamento in rete
2022-04-01 09:14:53 +02:00
marco.salvi 70f26de43f fix rm e arch 2022-03-31 17:23:36 +02:00
marco.salvi ef626eaaf9 fix rm 2022-03-31 17:20:56 +02:00
marco.salvi 2ebbfd5662 fix vari 2022-03-31 17:10:59 +02:00
marco.salvi 5244caf8e2 fix logica compilazione 2022-03-31 17:02:13 +02:00
marco.salvi 89ab7bf961 fix pulizia xml pdb 2022-03-31 16:30:13 +02:00
marco.salvi 331b9341be fix pulizia e copia codice 2022-03-31 16:15:37 +02:00
marco.salvi fe5d09a8bd fix copia cartelle e logica compilazione 2022-03-31 15:48:34 +02:00
marco.salvi 312722d3c3 fix syntax e pulizia cartelle 2022-03-31 15:24:39 +02:00
marco.salvi 5f37a796e6 fix errore punatmento 2022-03-31 15:16:36 +02:00
marco.salvi 0a9fe6f8b6 fix errore puntamento 2022-03-31 15:14:28 +02:00
marco.salvi 8f12378299 Aggiunto view optimizer 2022-03-31 15:12:55 +02:00
marco.salvi affd519bc8 prova modifica step copia 2022-03-31 14:50:24 +02:00
marco.salvi 9434211413 fix nuget step 2022-03-31 14:38:07 +02:00
marco.salvi 01959dde1f Fix nuget syntax 2022-03-31 14:33:38 +02:00
marco.salvi fc6c07c613 fix nuget restore 2022-03-31 14:29:30 +02:00
marco.salvi c6e59dd6bb Refresh nuget packages 2022-03-31 14:26:41 +02:00
marco.salvi fc1f07a01b Fix net use 2022-03-31 14:19:29 +02:00
marco.salvi 11d6425de3 Merge remote-tracking branch 'origin/Test_CICD' into Test_CICD 2022-03-31 14:14:49 +02:00
marco.salvi da79e8b833 Fix Packages Locali 2022-03-31 14:13:48 +02:00
Marco Salvi 4a1bdf2397 Update .gitlab-ci.yml file 2022-03-31 11:56:59 +00:00
Marco Salvi 40bcfde47c Update .gitlab-ci.yml file 2022-03-31 11:10:29 +00:00
Marco Salvi 08db55b69f Update .gitlab-ci.yml file 2022-03-31 11:02:22 +00:00
Marco Salvi 914b7317e8 Update .gitlab-ci.yml file 2022-03-31 10:57:30 +00:00
Marco Salvi be2c5e1774 Update .gitlab-ci.yml file 2022-03-31 10:51:46 +00:00
Marco Salvi dcdc612569 Update .gitlab-ci.yml file 2022-03-31 10:51:32 +00:00
Marco Salvi 6798c0faa5 Update .gitlab-ci.yml file 2022-03-31 10:51:14 +00:00
Marco Salvi 3758957946 Update .gitlab-ci.yml file 2022-03-31 10:50:33 +00:00
Samuele Locatelli cb755b8869 aggiunta dll mysql 2022-03-30 14:47:51 +02:00
Samuele Locatelli ffedabc0f3 aggiunta dll ISOCNC 2022-03-30 14:42:29 +02:00
Samuele Locatelli 557f53bc66 Fix dipendenza dll locali 2022-03-30 14:26:13 +02:00
Samuele Locatelli 24770cc9f4 Aggiunta lib x compilazione 2022-03-30 14:21:36 +02:00
Samuele Locatelli d07d441e5d Merge remote-tracking branch 'origin/develop' into DataLayer 2022-03-30 13:42:39 +02:00
Emmanuele Sassi 2d1de6ccf3 - Aggiornamento costanti 2022-03-30 13:42:19 +02:00
Samuele Locatelli 457da42970 Merge remote-tracking branch 'origin/develop' into DataLayer 2022-03-30 13:12:19 +02:00
Emmanuele Sassi 527a3bc3b9 update init DbController del supervisor 2022-03-30 13:12:09 +02:00
Samuele Locatelli e6047e51c6 Merge remote-tracking branch 'origin/develop' into DataLayer 2022-03-30 13:10:27 +02:00
Emmanuele Sassi 77f225f866 - Modifica init DbConfig 2022-03-30 13:09:37 +02:00
Emmanuele Sassi 0e662a8799 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2022-03-22 11:55:21 +01:00
Samuele Locatelli ca2828958d Fix dominio parametrico x creazione utente in rete 2022-03-22 11:54:22 +01:00
Emmanuele Sassi 97d6b26df5 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2022-03-22 11:48:56 +01:00
Samuele Locatelli e01104dba3 Fix init DB senza overload 2022-03-22 11:47:41 +01:00
Samuele Locatelli 443f72d86a Aggiunto init x chiavi di rete 2022-03-22 11:44:34 +01:00
Samuele Locatelli 794b45e4f3 Merge remote-tracking branch 'origin/develop' into DataLayer 2022-03-22 11:33:10 +01:00
RenzoL 456a4e6fb0 - Correzione a inserimento valori Direzione Fibre in Parametri Pezzo 2022-03-18 17:41:28 +01:00
Emmanuele Sassi 52b111aff3 Merge commit 'cc04872cc1a5df9f94710b8c8d5fcf75eac4bb2f' into develop 2022-03-16 14:42:10 +01:00
Emmanuele Sassi e3a436ff4d - Permessa selezione feature in grafica 2022-03-16 14:39:59 +01:00
RenzoL cc04872cc1 - VerifyAll non eseguito se non ci sono MachGroup
- Correzione all'Update di OriginType
2022-03-16 12:54:24 +01:00
Emmanuele Sassi 4075563e9f - Migliorata visibilita' lista tipi di nesting 2022-03-16 12:15:05 +01:00
RenzoL c68efe69be - Correzione Resize colonne FeatureInPartInRawPartList in Supervisor
- Correzione visibilità colonna DO PartInRawPartList in Supervisor
- Altre piccole correzioni in Supervisor
2022-03-16 11:25:15 +01:00
RenzoL bb0a838d91 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-03-16 11:14:19 +01:00
Emmanuele Sassi 217a3b6fcc - Nascosti bottoni cambia materiale e muovi pezzi in grezzo
- Aggiunto minimo e massimo da walldata a spessore grezzo in warehouse
- Nascosto bottone modifica freecontour
2022-03-16 09:53:56 +01:00
RenzoL a7de0d3b1e Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-03-15 17:16:51 +01:00
Emmanuele Sassi 77be897037 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-03-15 17:05:11 +01:00
DarioS 2ef75b21d0 EgtBEAMWALL :
- correzioni per posizioni di nesting problematiche con separatore decimale virgola settato nel SO
- modifiche per nesting da BTL.
2022-03-15 15:17:38 +01:00
Emmanuele Sassi b5066816e1 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2022-03-15 15:05:20 +01:00
RenzoL 34e5b6ec55 - Correzione MaxThickness e Parametri S in Warehouse per Pareti 2022-03-15 14:50:01 +01:00
RenzoL 14e3fa908a - Correzione Muovi pezzi in Ottimizzatore
- Bottone Muovi pezzi reso visibile solo se progetto aperto di tipo Pareti
2022-03-15 12:29:11 +01:00
RenzoL 81427b38b3 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-03-15 10:11:30 +01:00
DarioS d95bd48d9e EgtBEAMWALL :
- correzioni per decimali nelle sezioni in nesting travi e pareti.
2022-03-15 10:04:52 +01:00
Emmanuele Sassi 342472c625 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2022-03-15 09:19:36 +01:00
Emmanuele Sassi 694feab56e - Eliminata TopBar da finestra di caricamento
- Corretto colore testo selzionato in RawPart e PartinRawPart
- Gestita visibilita' nesting da Btl solo quando presente nel file
- Gestito offset variabile su spessore parete
2022-03-15 09:19:04 +01:00
RenzoL d7262bfbb6 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-03-15 09:09:31 +01:00
DarioS 1f510bfae8 EgtBEAMWALL :
- nascosto bottone per nesting da BTL.
2022-03-15 07:51:22 +01:00
RenzoL a054c472cf - Correzione a Offset e MinThickness in Warehouse per Pareti 2022-03-14 16:14:32 +01:00
Emmanuele Sassi 24827b336a Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2022-03-14 10:33:16 +01:00
RenzoL d9681dbcb5 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-03-11 15:24:37 +01:00
Emmanuele Sassi dd9ff98329 - migliorata gestione traduzioni messaggi Lua ed estensione a tutti i tipi di messaggio
- Correzione aggiornamento quote Duplo quando selezionato BtlPart in ottimizzatore
- Correzione su update messaggi di errore da verifica (CALC)
- Aggiunta indicazione dei duplo e MachGroup che contengono il BTLPart selezionato
- Ridotto lista feature in CambiaParametro a solo quelle presenti nel progetto
- disattivato caricamento iniziale su datagrid MachGroup e Part per evitare eccezione di modifica lista durante caricamento
- Estesa lettura dei progetti in finestra da 50 a 5000
- Nascosti bottoni Produci se modalita' senza supervisore
2022-03-11 15:12:03 +01:00
RenzoL 3fe0400219 - Piccole correzioni a visualizzazione statistiche 2022-03-10 16:46:40 +01:00
RenzoL 5cf6343518 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-03-09 17:13:32 +01:00
Emmanuele Sassi 69a2905d9b - Aggiunto caricamento su creazione Pdf statistiche
- Fix del copia grezzo per le pareti
- Fix del bottone CopyToClipboard
- Aggiunta immagine grezzo nel pdf delle statistiche
2022-03-09 16:41:46 +01:00
Emmanuele Sassi b1254c3247 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-03-08 11:14:45 +01:00
DarioS c2a3fdfbd4 EgtBeamWall 2.4c1 :
- versione 2403
- dopo esecuzione NestProcess.lua si resettano tutte le tabelle lua.
2022-03-08 11:12:02 +01:00
RenzoL fd92dbbe23 - Piccole correzioni a ColumnVisibility e ToolTip 2022-03-08 10:22:27 +01:00
Emmanuele Sassi 0218880d93 - Gestita traduzione messaggi lua
- Aggiunto passaggio da ottimizzatore a supervisore e viceversa
- Introdotto nesting da BTL
- Gestione ricalcolo pezzi con collisione
2022-03-07 21:02:24 +01:00
RenzoL 057d31ab49 - Ritorno al Resize standard delle colonne
- Corretta la colonna "fantasma" che appariva con l'allargamento della EgtDataGrid (ora la larghezza dell'ultima colonna visibile diventa di tipo Star)
2022-03-07 16:03:35 +01:00
RenzoL 1ec1e4539f - Aggiunti bottone e finestrella per cambio materiale (simile a cambio parametro) 2022-03-04 15:23:43 +01:00
RenzoL 1c2f87d79f - Piccole correzioni a SParam aggiunti e salvati in Warehouse 2022-03-04 12:13:06 +01:00
RenzoL 5d0a7705d5 - Definizione ordine parametri da considerare per Sort di SectionXMaterial degli SParam in finestra Warehouse 2022-03-03 17:35:15 +01:00
RenzoL e357e54152 - Piccola correzione al commit precedente 2022-03-03 12:11:25 +01:00
RenzoL e598c7af90 - Correzione al Sort delle colonne di EgtDataGrid 2022-03-03 11:47:31 +01:00
RenzoL ab930e2e90 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-03-03 09:41:06 +01:00
Emmanuele Sassi 3752846faa - introdotta apertura ottimizzatore con progetto specificato da riga di comando 2022-02-24 20:37:30 +01:00
RenzoL 7deafdde51 - Copia del file originale scelto nel dialog di UpdateBTL nella cartella Proj del progetto corrente 2022-02-24 15:11:07 +01:00
RenzoL 145ba2afda Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-02-24 11:49:27 +01:00
Emmanuele Sassi 31822c78a4 - aggiunto flag in ini per attivare update btl 2022-02-23 17:00:19 +01:00
Emmanuele Sassi a36313b9b2 - Correzione impedita modifica rot e flip in supervisore 2022-02-23 16:40:49 +01:00
RenzoL 9e7be2740e - Piccole correzioni a ultime modifiche Warehouse 2022-02-23 10:32:30 +01:00
RenzoL 5f6572d0ef - Aggiunta lista di Offset e Spessori minimi e massimi alla Warehouse nel caso Medium e Pareti 2022-02-22 17:07:17 +01:00
RenzoL ce794f55dc Merge remote-tracking branch 'origin/develop' into Renzo 2022-02-22 08:55:14 +01:00
Emmanuele Sassi bd13256399 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-02-21 17:16:05 +01:00
RenzoL 76bdc0bb19 - Aggiunta finestra di selezione per UpdateBTL per aggiornare il progetto corrrente con i pezzi del progetto importato o accodare quest'ultimi
- Aggiunta finestra per checkare i pezzi che si desidera aggiungere nel caso "Aggiorna" di UpdateBTL
2022-02-21 16:41:40 +01:00
Emmanuele Sassi 83bfe07c50 - spostata gestione portare altro programma in primo piano in core
- corretti valori assi macchina su Tpa
- correzione lettura risultati calc in supervisore
- migliorat partenza tick di comunicazione con la macchina
- correttie liste colori in Tpa
- gestita visibilita' pagine input, output su Tpa
- Aggiunto GoToProd in supervisore
- Aggiunto GoToSupervisor in ottimizzatore
- correzione su gestione tick dei thread di comunicazione
- Aggiunto nesting travi su dimensioni diverse e abilitazione dimensioni
- Correzione caricamento prod da supervisore
2022-02-21 16:39:57 +01:00
RenzoL cd940ccf7e Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-02-18 11:17:05 +01:00
DarioS ae7474445d EgtBEAMWALL 2.4b2 :
- corretta gestione ricalcolo pezzi con errori.
2022-02-17 19:23:18 +01:00
Emmanuele Sassi ebec1bb583 - Aggiunto StartCut a lunghezza in creazione grezzo travi
- Aggiunti filtri su BTLPart DoAll
- Correzione su selezione pareti
- Aggiunta visibilita' bottone supervisore
- Correzione su ShowAll parts
- Correzione disattivazione assemblato durante import BTL
- Correzione selezione pezzi in finestre pareti
- Correzione tipo di progetto in warehouse
2022-02-16 18:59:15 +01:00
RenzoL 3ddc441674 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-02-16 15:12:39 +01:00
Emmanuele Sassi acd66d7738 - Correzione visibilita' barra ottimizzazione su caricamento ottimizzazione 2022-02-16 10:36:12 +01:00
Emmanuele Sassi 7be48bd00a - Corretta rotazione/inversione su copia trave 2022-02-15 19:50:41 +01:00
Emmanuele Sassi 136de45c47 - Aggiunta finestra loading a importa, esporta, gotoProj
- Aggiunta traduzione messaggi di loading
2022-02-15 13:01:40 +01:00
Emmanuele Sassi 93c4e02633 - Migliorati header DataGrid
- Aggiunto check DoAll su BTlPart
- Correzione IsEnabled di alcuni bottoni durante verifica
- Correzione eliminazione duplo su creazione barre con pezzi piu' grandi della barra
- Corretta doppio refresh grafico su selezione Machgroup
- Spostato PartManager sotto GridSplitter
- Miglioramenti grafici vari
2022-02-14 17:07:01 +01:00
Emmanuele Sassi f47bf047b8 - Correzione su commit precedente 2022-02-12 13:03:22 +01:00
Emmanuele Sassi b0c6bb52f8 - Aggiunta finestra LoadingWnd per caricamenti
- Nascosto parametri Q in ottimizzatore per travi
2022-02-11 19:23:05 +01:00
RenzoL 7642884442 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-02-09 09:48:30 +01:00
Emmanuele Sassi f8dc8d075b - Aggiunte colonne Grouppo e Sottogruppo
- Correzione scrittura parametri Q in vista
- Correzione quote sezione durante assemblato
- Gestione filtri di ricerca
- Gestione nesting su filtri
2022-02-08 20:31:07 +01:00
Emmanuele Sassi 927f171cd6 - Correzione colonne supervisore per travi
- impostazione stato manuale TPA dopo avvio connessione
- Aggiunta lettura StartCut in supevisore per travi
- Impostazione tempo inizio se nullo e si deve impostare fine
- gestione visibilita' bottone PartDone in supervisore
- Bloccato edit parametri Q in ottimizzatore quando mandati a supervisore
- Nascosti parametri Q in ottimizzatore quando progetto travi
2022-02-07 19:40:29 +01:00
Emmanuele Sassi 5ca6f13899 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2022-02-07 09:23:56 +01:00
Emmanuele Sassi b68f6bfeee - nascosto i parametri Q in ottimizzazione travi
- gestita selezione MachGroup in supervisore dopo comandi
- Aggiunta verifica di non entrare nel ciclo comunicazione programmi se gia' all'interno
- annullato CALC dopo aver inserito pezzo in grezzo
- annullato CALC dopo avermodificato dimensioni grezzo
- disabilitata registrazione modifica su s/blocco duplo
- aggiornato DB su eliminazione Part in RawPart
-
2022-02-07 09:21:18 +01:00
RenzoL cefff881f5 - Stato e direzione del Sort delle colonne della EgtDataGrid viene ora salvato alla modifica e caricato all'avvio del programma
- Aggiunto "Reset Sort" al ContextMenu degli header della EgtDataGrid per resettare il Sort
2022-02-04 17:02:18 +01:00
RenzoL 923f1ab7ff Aggiunto bottone e finestra per muovere i pezzi nel grezzo nell'Ottimizzatore 2022-02-04 14:54:01 +01:00
RenzoL f1b2e66b97 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-02-04 08:52:38 +01:00
Emmanuele Sassi b5daa71abf Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-02-04 08:33:11 +01:00
Emmanuele Sassi ee558cecd6 - Migliorie Calc pezzi
- Correzione flip e rot dei duplo
- Cambiata gestione ricalcolo in supervisore
- Aggiunti controlli su comunicazione tra programmi
- Gestione apertura progetto con s/blocco duplo
- Gestione errore ricalcolo in supervisore
- Aggiunti controlli su cicli di comunicazione tra programmi
2022-02-03 21:49:05 +01:00
DarioS c87210873f EgtBEAMWALL :
- modifiche pe rimpostare vista e origini default macchina quando fallisce l'esecuzione del relativo file lua.
2022-02-03 21:21:31 +01:00
RenzoL 0535036d36 - Piccola correzione ad un EgtSetInfo che prendeva nType di tipo sbagliato 2022-02-02 11:04:29 +01:00
RenzoL 77333dfc9e Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-02-02 10:19:49 +01:00
RenzoL a6b9fcd2ba - Correzione UpdateBTL per avere i part aggiunti distanziati sempre di un offset fisso pari a 500
- Correzione UpdateBTL per avere lista part e disegno aggiornati senza riaprire il progetto ogni volta
- Reso visibile il bottone UpdateBTL
2022-02-02 10:09:06 +01:00
Emmanuele Sassi 568e98aec8 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-02-01 15:52:39 +01:00
DarioS 4548e468a1 EgtBEAMWALL 2.4b1 :
- corretta gestione flip e rotazione dei duplo e loro aggiornamento.
2022-02-01 15:25:47 +01:00
Emmanuele Sassi a73af5928f - Inizio correzione sblocco duplo
- Trasformazione di flip da boolean a integer
- Aggiornamento modifica Q su pezzi
2022-02-01 12:14:16 +01:00
RenzoL 5385547af6 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-02-01 10:02:41 +01:00
Emmanuele Sassi 46f2db3415 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2022-01-31 16:37:20 +01:00
Samuele Locatelli 2aa61e5141 Update gestione DB con using x nON riutilizzare singleton DB 2022-01-31 16:36:18 +01:00
Samuele Locatelli 007c9c0edc Merge remote-tracking branch 'origin/develop' into DataLayer 2022-01-31 16:21:30 +01:00
Emmanuele Sassi ba807e89bc Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-01-31 14:47:45 +01:00
DarioS 53ca42389e EgtBEAMWALL :
- in Viewer corretto ritorno da Cam5 edit pezzo.
2022-01-31 13:26:04 +01:00
Emmanuele Sassi 35cc8959da - Agiunto se pezzo in supervisore impossibile cambiarne le dimensioni
- Gestito sblocco duplo su apertura progetto in prod
- Gestita conservazione parametri duplo su sblocco
2022-01-31 12:49:45 +01:00
RenzoL 467284d008 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2022-01-31 08:51:50 +01:00
Emmanuele Sassi 51a2cbf17c EgtBEAMWALL 2.4a5 :
- ricompilazione per cambio versione
- Aggiunta nuova gestione parametri Q per pareti
2022-01-31 08:47:53 +01:00
Emmanuele Sassi 8e8d1c2a91 - Migliorata gestione assemblato non presente
- Correzione viste per travi
- Introdotto s/blocco dei duplo
- Introdotta traduzione dei messaggi macchina
- Migliorata gestione attivazione bottoni
- Bloccate colonne in edit durante Calc
- Aggiornamento quantita' in prod dopo cambio dimensioni
- Impedito Flip e Rot durante Calc
- Limitata considerazione pezzi in nesting a quelli ancora da aggiungere
- Gestione errori import BTL con messaggio errori
2022-01-29 10:24:24 +01:00
RenzoL 7a2c45fc4b - Aggiunto comando UpdateBTL al ProjManager 2022-01-28 17:01:07 +01:00
RenzoL 19b1b8d984 - Aggiunto salvataggio path ultimi file importati e apertura dialog di importazione con directory iniziale settata da quelli 2022-01-27 11:59:29 +01:00
RenzoL 1767aa7f97 - Aggiunta funzionalità LockTable al ContextMenu sugli header delle colonne di EgtDataGrid 2022-01-26 15:42:49 +01:00
RenzoL 652ce25a83 - Correzione su aggiornamento della visibilità delle colonne di una EgtDataGrid per tutta la tabella (ora è messa dopo l'aggiornamento visibilità di colonna singola a Visible e prima dello stesso a Collapsed) 2022-01-25 16:15:45 +01:00
RenzoL 6c2d3bb7b5 - Resize tra le sole colonne adiacenti di EgtDataGrid funzionante (dal merge col branch "ResizeColonneAdiacenti")
- Settato HorizontalScrollBarVisibility="Auto" per tutte le EgtDataGrid
2022-01-25 12:15:09 +01:00
RenzoL 4257a92486 Merge branch 'ResizeColonneAdiacenti' into Renzo 2022-01-25 09:55:04 +01:00
RenzoL ac621d9dc0 - Rimossa da Configurazione la tab "Colonne tabelle" assieme a DataGrid e funzioni associate poiché ora è gestito dal ContextMenu su header colonne 2022-01-25 09:26:49 +01:00
RenzoL 6f56ae6686 - Aggiunto ContextMenu agli header della EgtDataGrid per settare Reorder, Resize, Sort e Visibilità delle colonne 2022-01-24 17:31:33 +01:00
RenzoL e19032f3cb Correzione alla visibilità delle colonne delle EgtDataGrid che non veniva più settata correttamente 2022-01-24 16:50:16 +01:00
Emmanuele Sassi 92b770f448 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2022-01-24 16:30:19 +01:00
Emmanuele Sassi 27d8eb37e8 - Introdotti tooltip su bottoni disattivi
- corretto errore dimensioni con assemblato in ottimizzatore
- Migliorata dis/attivazione bottoni Calc
- Correzioni mutex per uso mono istanza
- Correzione FlipRotsu singola sezione
- Aggiunta gestione sovrascrittura BTL
- Annullo CurrProd durante importazione progetti per evitare import stati di produzione errati
2022-01-24 16:28:47 +01:00
Emmanuele Sassi dfb3774943 - Spostati nel file messaggi alcuni presenti nel supervisore
- Migliorata gestione pagina MDI
- Introdotti tooltip su bottoni disattivi
2022-01-24 16:23:17 +01:00
Emmanuele Sassi a9b003d9ec - correzione UpdateInfo 2022-01-24 10:30:56 +01:00
Emmanuele Sassi 8c9f2ce613 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2022-01-24 10:05:58 +01:00
Samuele Locatelli b833d6c4ec Update gestione nome BTL da indicizzare x parent/child duplicates 2022-01-24 10:03:38 +01:00
RenzoL 111c59ea46 Template.FindName(...) per trovare i Gripper destro e sinistra dei Thumb + Funzioni DragStarted, PreviewMouseMove e DragCompleted 2022-01-21 14:50:48 +01:00
Emmanuele Sassi 21a91b5202 - Eliminato log di debug 2022-01-21 09:55:19 +01:00
Emmanuele Sassi c1fba27b1f - Correzioni su uso mutex
- Correzione flag di stampa etichette
- Introdotto gestore eccezioni generali per loggarle ed evitare crash
2022-01-21 09:54:21 +01:00
RenzoL 7225bad678 - VM della Tabella delle lavorazioni delle travi eredita dal VM generale ora presente in EgtWPFLib5 2022-01-20 14:44:15 +01:00
RenzoL 6b2aa1a8d1 - Modificata Sub Cell_SizedChanged per permettere il Resize delle sole colonne adicenti (ovvero quelle che hanno il divider in comune che viene draggato)
- Aggiunta Sub ColumnHeader_PreviewMouseLeftButtonDown per identificare quale colonna stiamo ridimensionando
2022-01-20 10:02:21 +01:00
Emmanuele Sassi f95ce8d671 - migliorato IsEnabled bottoni supervisore
- corretto errore su ripartenza parete
- impedisco chiusura supervisore se macchina lavora
- aggiunta notifica pezzi fatti in ottimizzatore
2022-01-19 08:28:50 +01:00
Emmanuele Sassi 54ed7dc11c - Corretto errore importazione non sovrascriveva ProdId su MachGroup 2022-01-18 19:03:09 +01:00
Emmanuele Sassi 69beb83764 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-01-18 17:44:34 +01:00
DarioS faa8aada54 EgtBEAMWALL :
- correzione errore legato a flip (rotazione di 1 deg anzichè 1 * 180 deg).
2022-01-18 17:39:34 +01:00
Emmanuele Sassi 4dcd4a1fa0 - modifica visualizzazione bottoni nesting solo con opportuno flag su licenza
- nascosti comandi Update BTL e Add To BTL
- creato ma lasciato commentato comando per ruotare trave di 90 su X
2022-01-18 17:12:16 +01:00
RenzoL e4178317a9 - Modifiche alla proprietà IsReadOnly delle colonne di EgtDataGrid non vengono più scritte nell'INI durante l'esecuzione del programma 2022-01-18 11:39:00 +01:00
RenzoL a9b25e1a30 - aggiunto pulsante di Invio Feedback al MainMenu
- adattata la funzione ExportProject di ProjManager per funzionare nell'Invio Feedback
2022-01-18 11:29:41 +01:00
Emmanuele Sassi 32d099f5cc Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2022-01-18 08:39:30 +01:00
Emmanuele Sassi fe21d5e65e - Aggiunti tooltip 2022-01-18 08:38:41 +01:00
Emmanuele Sassi 241b392036 - Implementati in interfaccia comandi MDI 2022-01-18 08:37:55 +01:00
DarioS fb90d5a98c EgtBEAMWALL 2.4a4 :
- ricompilazione per cambio versione.
2022-01-18 08:17:16 +01:00
Emmanuele Sassi 9db10d8cde - aggiornamento icone blocca/sblocca rotazione e flip 2022-01-17 09:27:44 +01:00
Emmanuele Sassi aeb60213b6 - Corretto calcolo volume nel caso non ci siano outline 2022-01-17 08:25:46 +01:00
Emmanuele Sassi 69111c057a - Aggiornata versione
- Gestione enable dei bottoni in supervisore
- gestita attivazione da ini stampa etichetta
2022-01-15 13:36:20 +01:00
Emmanuele Sassi 44e97c3452 - aggiornamento icone
- introdotto calcolo volume dato contorno pareti
- aggiunta in supervisore gestione tabella MDI
- aggiunto salvataggio progetto dopo aggiornamento duplo
- girate tutte le viste per macchine inverse, anche in supervisore
- nacosti pezzi quando in ottimizzatore o supervisore senza Machgroup
- scritte BTLPartList in verde se raggiunta quantita' INPROD
- aggiunta gestione bottoni abilitati/disabilitati a seconda degli elementi selezionati
- introdotta modifica dimensioni grezzi
- corretto errore che non impostava corretamente progetto quando aperto da ottimizzatore
- smontato assemblato prima di eseguire alcuni comandi per poi ripristinarlo
2022-01-13 20:45:37 +01:00
Emmanuele Sassi 8112616b96 - aggiunto reset stato di mandato a supervisore per i part
- implementato aggiornamento stato MachGroup e part quando MachGroup tolto da supervisor
- implementato stile di selezione righe in tabella in supervisore
- nascosto bottone part Done in supervisore se macchina pareti
- correzioni a stati di produzione part e machgroup
- impedito usare bottoni reset e done se macchina non in reset o presenti machgroup in coda di produzione
- gestita verifica compatibilita' tipo di macchina usata dal progetto in supervisore
- salvataggio progetto dopo verifica anche su db per non avere problemi con supervisore
- migliorata gestione errore invio Machgroup a supervisore perche' non lavorabile
2022-01-07 19:47:03 +01:00
Emmanuele Sassi 0f6179bcd1 - Gestito reset stato di calc quando modifica Q da pagina config
- salvataggio progetto dopo verifica
- aggiunti controlli in caso di risultati calc con Id sbagliati
- correzione messaggio di fine nesting solo su materiali utilizzati
- corretto errore import/export se progetto assemblato
- reset degli stati di calc sia in proj che prod in importazione progetto
2022-01-06 19:47:52 +01:00
Emmanuele Sassi f52f48c57e - reset calc solo di pezzo e feature su disabilitazione 2022-01-04 22:44:13 +01:00
Emmanuele Sassi 1d596e8d41 - correzione errore in considerazione stati pezzi con feature non calcolate
- aggiornamento versione
2022-01-04 22:20:51 +01:00
Emmanuele Sassi 0651a225ff - aggiunte icone unlock flip e rot
- aggiunti taskid su auxid
- migliorate condizioni di verifica
- nascosto bottone edit in ottimizzatore
2022-01-04 21:37:23 +01:00
Emmanuele Sassi 8fbed00523 - Correzione ricalcolo dopo modifica pezzi senza feature
- Introduzione comando Edit
- Cancellazione file .ori in apertura simulazione se pezzo non calcolato (altrimenti non li ricalcola)
- aggiornamento versione programma
- correzione errori causati dalla modalita' assemblato
- introduzione parziale reset stati calc in import project
2022-01-04 12:51:06 +01:00
Emmanuele Sassi 0bdb218488 - rotazione nuovo pezzo secondo vista della macchina
- tooltip per parametri Q
2022-01-03 19:52:31 +01:00
Emmanuele Sassi dae912e76c - aggiunta considerazione angolo d'inserimento in nuovo grezzo e aggiungi pezzo
- introdotta selezione singola se movimentazione pezzi con mouse disattivata
2022-01-03 12:41:25 +01:00
Emmanuele Sassi e2d226a0f9 - Aggiunti messaggi 2022-01-03 11:01:41 +01:00
Emmanuele Sassi b33baf8288 - miglioramento creazione manuale grezzo 2022-01-03 10:27:23 +01:00
Emmanuele Sassi 5c3b677c20 - Eliminata finestra sezioni materiali in import file
- Introdotto aggiornamento lista sezioni magazzino da proj a prod
- magazzino mostra solo sezioni e materiali del progetto corrente
2021-12-29 20:20:54 +01:00
Emmanuele Sassi 30b4b60d53 - Correzioni a RotFlip 2021-12-29 12:16:39 +01:00
Emmanuele Sassi 73978d1ca9 - Correzione blocco rotazione in import per vista
- Aggiunto tooltip su descrizione parametri P
- Abilitati lucchetti e sblocco rotazione e flip manuali
2021-12-29 10:18:21 +01:00
Emmanuele Sassi 52eec22b63 - modifiche su verifica e simula per mantenere modifiche manuali
- aggiornato stile elemento selezionato sulle datagrid
- corretto posizionamento pezzo in grezzo con aree lavorate
2021-12-28 17:46:10 +01:00
Emmanuele Sassi 863605838b Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2021-12-28 09:50:51 +01:00
DarioS 9257a2fd3a EgtBEAMWALL 2.3l3 :
- ricompilazione totale per cambio versione.
2021-12-23 16:16:26 +01:00
Emmanuele Sassi bb68659510 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-12-23 15:46:50 +01:00
Emmanuele Sassi 04f3e94e50 - aggiunte opzioni nesting
- nuovi colori elemento selezionato in datagrid
- warehouse con possibilita' di attivare/disattivare materiali
2021-12-23 15:44:31 +01:00
RenzoL 5dbb4601a5 - Resa resizable la finestra Warehouse
- Corretto sorting colonna SectionXMaterial in Warehouse
2021-12-23 14:58:20 +01:00
RenzoL 25c4864c63 - Aumentata altezza finestra Warehouse 2021-12-22 10:45:03 +01:00
RenzoL ab1bac7a79 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-12-21 17:12:55 +01:00
Emmanuele Sassi a286caf8f5 - Correzioni esportazione e importazione progetto
- Correzione notifica tempi di lavorazione
2021-12-16 20:04:58 +01:00
Emmanuele Sassi ce4aa010ab - Introduzione aggiornamento multiplo feature su tasto destro o check sul part 2021-12-16 09:27:15 +01:00
Emmanuele Sassi 502a38449f - Aggiornamento versioni 2021-12-14 10:08:39 +01:00
Emmanuele Sassi 752de23e13 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-12-13 14:02:21 +01:00
Emmanuele Sassi 9794378382 - Tolto domanda se aggiungere proj a prod gia' esistente 2021-12-13 14:02:09 +01:00
RenzoL 8f6cac5d75 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-12-13 12:38:04 +01:00
RenzoL 4c6e74cac1 - Correzione scrittura Parametri P/Q 2021-12-13 11:06:34 +01:00
Emmanuele Sassi 505ec32b74 - Aggiunta rilettura parametri Q dopo rotazione
- Aggiunta gestione rotazioni e flip automatico con blocco e sblocco
- Introdotta possibilita' di attivare categoria di feature in pezzo con contextmenu
-  Spostato Reset Calc in CALCPanel
2021-12-13 09:18:40 +01:00
Emmanuele Sassi 949f0b9c7f - Correzione rotazione pareti
- Correzione selezione macchina per progetto
2021-12-07 10:10:04 +01:00
Emmanuele Sassi 7e4b77f321 - Modifiche s rotazione in nesting, da migliorare! 2021-12-04 09:57:22 +01:00
Emmanuele Sassi 843ea293a9 - Agginta inizializzazione variabile punte lunghe in nesting 2021-12-03 19:44:38 +01:00
Emmanuele Sassi b52786ef2b - Modifiche grafiche 2021-12-03 13:13:18 +01:00
Emmanuele Sassi 1298aeaf85 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-12-02 13:21:02 +01:00
RenzoL 46d9be852b Correzione ai Parametri Q non caricati appena si importa un BTL 2021-12-02 12:42:26 +01:00
RenzoL b319b84e20 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-12-02 11:59:26 +01:00
Emmanuele Sassi dcad21374b Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2021-12-02 11:44:02 +01:00
Emmanuele Sassi 28ca22ee35 - Correzione aggiornamento messaggio errore dopo CALC
- Aggiunta opzione abilitadisabilita area pnte lunghe in nesting
2021-12-02 11:43:54 +01:00
DarioS c4af3eedd4 EgtBEAMWALL 2.3l1 :
- altre correzioni e modifiche per impostazione tipo giacitura pezzi a BeamMgr
- modifiche per copia e cancellazione FreeContour, Outline e Aperture.
2021-12-02 11:30:55 +01:00
RenzoL 5e9d068078 Aggiunta copia multipla dei grezzi 2021-12-02 09:41:32 +01:00
RenzoL 791ed3480c Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-12-02 08:43:45 +01:00
Emmanuele Sassi a26e25b253 - Correzione bottone reset barra da supervisor nel caso siano tutte gia' prodotte 2021-12-02 08:36:59 +01:00
Emmanuele Sassi 1db314e077 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2021-12-02 08:35:53 +01:00
RenzoL fb81c84ab2 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-12-01 16:04:31 +01:00
DarioS defe2a36d0 EgtBeamWall :
- correzioni per impostazione tipo giacitura pezzi a BeamMgr.
2021-12-01 16:02:07 +01:00
RenzoL 71b13d514a Nuova finestrella Inserimento Password (con caratteri oscurati) per modifica parametri Macchina 2021-12-01 15:49:11 +01:00
Emmanuele Sassi 6c4bb9d0a7 - Introduzione reset del grezzo in supervisore
- aggiunta rotazione dei pezzi copia per renderli uguali ad originale
- Correzione errore verifica tutti non funzionante con barre gia' mandate a supervisore
2021-12-01 15:21:53 +01:00
Emmanuele Sassi 82d18f368e Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2021-12-01 10:07:32 +01:00
DarioS 4152a7aa1b EgtBeamWall 2.3k3 :
- modifiche per copia pezzi con FreeContour, Outline e Aperture.
2021-12-01 10:00:46 +01:00
Emmanuele Sassi 5dd829e205 - miglioramento RotFlip per pareti
- introduzione angolo riferimento per nesting automatico da WallData.lua
2021-11-30 16:44:55 +01:00
Emmanuele Sassi 7218459c24 - correzioni e migliorie a rot e flip
- separazione rot e flip tra view e optim
- aggiunta gestione angolo di riferimento posizionamento pezzi per pareti
2021-11-29 19:35:28 +01:00
Emmanuele Sassi 8592f8d65f Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-11-29 19:31:45 +01:00
RenzoL e5a3f0c68a Nuova gestione/lettura/scrittura Parametri Q, separati in quelli di tipo Trave e quelli di tipo Parete (aggiornato file BTLFeatures.ini) 2021-11-29 15:23:11 +01:00
RenzoL e168545ec8 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-11-29 08:41:05 +01:00
Emmanuele Sassi 84a6cf3c2f - Aggiunta lettura dati da file WallData.lua
- Aggiunta colonna macchina in dialogo di apertura file
- Impedito di cancellare parametri P e Q con tasto Canc
- Migliorato caricamento macchina
- Aggiunta rotazione vista per macchine pareti ruotate
2021-11-26 19:36:28 +01:00
RenzoL a5c142f25c Aggiunti GridSplitter al Supervisor (con file Dimensions.ini aggiornato) 2021-11-26 15:22:10 +01:00
Emmanuele Sassi 99bd24fe38 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-11-26 10:42:24 +01:00
Emmanuele Sassi 69e010e147 - Modifiche provvisorie per far funzionare Q su L250
- Modifiche lettura variabili NUM per input ed output
- introdotte differenze grafiche tra NUM e TPA
- Introdotto controllo chiave su utilizzo Db non locale
- Correzione su reset dei CALC quando ci sono modifiche
- Blocco comandi su MachGroup in produzione
- Introdotto bottone supervisore in View/Optim per aprirlo o richiamarlo in primo piano
2021-11-26 10:41:27 +01:00
RenzoL ccf903acfc - Rimozione macchine copiate (con suffisso ".new") dalla lista in Cambio Macchina
- Pulsante Cambio Macchina nascosto se presente una sola macchina
2021-11-25 17:18:53 +01:00
RenzoL 76b96a41e3 Sezioni da aggiungere del progetto importato aggiunte alla Warehouse anche se si clicca su "Annulla" della finestra AddSectionXMaterial 2021-11-24 16:46:20 +01:00
Emmanuele Sassi 44518a00a5 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-11-23 19:07:09 +01:00
RenzoL 95cf5e2195 - Aggiunta gestione "Copia grezzo" per pareti
- Piccola correzione "Copia grezzo" per travi
2021-11-23 17:41:46 +01:00
Emmanuele Sassi 5a7e359ab8 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into develop 2021-11-19 14:49:07 +01:00
Emmanuele Sassi ea05a73a4b - Divisi i log tra ViewerOptimizer e Supervisor
- Correzioni per scrittura variabili su controllo TPA
2021-11-19 14:45:41 +01:00
Emmanuele Sassi d071bcb321 - Agginta gestione canali per NUM
- Introdotta gestione ingressi/uscite, da testare
- Divisi errori NUM in 4 categorie con colori
2021-11-18 17:10:39 +01:00
Emmanuele Sassi 4c27716ba2 - Correzione gestione BWType su Supervisor 2021-11-18 10:03:43 +01:00
Emmanuele Sassi 6ccb91b658 - correzion nel recupero del pezzo originale dei duplo: la isduplo funziona solo nel MachGroup
- Aggiunta lettura Indice di lavorazione
- Aggiunto test per ripartenza pareti con domanda
- Agginta gestione parziale colonne in Supervisor
2021-11-18 08:45:22 +01:00
Emmanuele Sassi 4f0ba7382e Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-11-17 16:52:05 +01:00
RenzoL bcf45654a2 Correzione copia parametri ProcessingQuality, Recess, StoreyType in "Copia pezzo" 2021-11-17 15:20:00 +01:00
Emmanuele Sassi 7ab408c2ea Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-11-17 11:02:02 +01:00
RenzoL 299a09d34d - Correzione "Copia pezzo", che non copiava tutti i parametri
- Correzione lettura parametri Recess, ProcessingQuality, StoreyType alla creazione del pezzo
2021-11-16 15:27:08 +01:00
Samuele Locatelli bad8f85e26 Merge remote-tracking branch 'origin/develop' into develop 2021-11-16 08:04:18 +01:00
Samuele Locatelli 07262542e3 Test modifica connString con charset 2021-11-16 08:04:10 +01:00
Emmanuele Sassi 4c3773c22f - Aggiunta funzione Duplo per lettura orig e recupero grezzo 2021-11-15 18:34:13 +01:00
RenzoL ee06c05a77 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-11-15 17:11:44 +01:00
Emmanuele Sassi 6d3be63778 - Separata lista messaggi operatore
- Correzione supervisore quando ho un solo RawPart in lista
- Correzione supervisore su ripartenza pareti
- Corretto errore di disallineamento tra progetto e Db
2021-11-15 11:44:26 +01:00
RenzoL 243b9b6a1a - Correzione lettura/scrittura Parametri Macchina (il contenuto di MachData.ini viene copiato su Ts3Data.lua)
- Se Macchina di tipo Both i Prametri Macchina vengono cercati in entrambe le cartelle (Beam/Wall) e i relativi file copiati laddove mancano
2021-11-12 17:36:08 +01:00
RenzoL f9b94ef999 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-11-11 09:16:53 +01:00
Emmanuele Sassi 889e45bf31 - Corretta ripartenza per parete
- Correzioni e miglioramento visalizzazione errori
2021-11-10 17:32:55 +01:00
RenzoL b6fbf4e425 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-11-10 11:45:36 +01:00
Emmanuele Sassi ea0aa78530 - Correzione visualizzazione MachGroup a fine nesting
- Aggiunta lettura messaggi operatore NUM
- inizializzazione tipo controllo per macchina corrente
- correzione recupero BTLPart in ricezione messaggi da supervisor
-
2021-11-10 10:03:05 +01:00
RenzoL e539b83041 Aggiunte pagine Ingressi e Uscite al Supervisor 2021-11-09 12:57:02 +01:00
RenzoL c7bd1dc1f9 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-11-09 08:51:01 +01:00
Emmanuele Sassi 474a1c1217 - Migliorati messaggi di errore 2021-11-09 08:41:59 +01:00
RenzoL 66dbb529e1 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-11-08 17:17:17 +01:00
Emmanuele Sassi e32dc440c1 - Correzioni e migliorie comunicazione con NUM 2021-11-08 16:29:41 +01:00
Emmanuele Sassi 766e758ed1 - Corretta lettura variabili PLC 2021-11-08 12:11:32 +01:00
RenzoL 3041753cb9 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-11-08 10:21:23 +01:00
Emmanuele Sassi 4d20011478 - Aggiunta gestione errori NUM
- Correzioni e miglioramenti a comunicazione con NUM
- Correzioni e miglioramenti invio programmi a NUM
- Aggiunta gestione separata errori NUM e TPA
- Aggiunta gestione separata OPState e OPMode
2021-11-06 12:48:39 +01:00
Emmanuele Sassi 78470c8ad0 - Integrazione dei comandi Num di COMMTest 2021-11-04 18:01:43 +01:00
RenzoL 5666c271a3 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-11-04 16:08:53 +01:00
Emmanuele Sassi ace6bbc35c - Correzioni comunicazione tra supervisore e ottimizzatore
- Correzioni apertura/chiusura finestre Waiting e Blocked
2021-11-04 10:15:56 +01:00
RenzoL 61a634edab Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-11-03 15:46:19 +01:00
Emmanuele Sassi 5b9be206a7 - Correzione in lista materiali per statistiche
- Aggiornamento versione programma
2021-11-03 14:58:58 +01:00
RenzoL 73bf46d466 Merge branch 'develop' into Renzo 2021-11-03 11:56:21 +01:00
Emmanuele Sassi f4d1728c6a Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-11-03 08:57:20 +01:00
Emmanuele Sassi 4bac0bb1a3 - Miglioramenti comunicazione finestre ripartenza pezzo 2021-11-03 08:57:11 +01:00
RenzoL 380f4f337c Disabilitazione segnalazione parametro Q modificato quando preso dal default 2021-11-02 17:22:29 +01:00
RenzoL 42f0a18d71 Aggiunto reset modifica Parametri Q quando si salva in Configurazione 2021-11-02 11:28:04 +01:00
Emmanuele Sassi b10493ab11 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-11-02 10:16:48 +01:00
Emmanuele Sassi 753a07de3b - Correzioni e miglioramenti ripartenza
- Nuove icone migliorate
- Correzioni e miglioramenti stampa PDF
- Aggiunte nuove statistiche
2021-11-02 10:16:14 +01:00
RenzoL 70cb04a2b2 Aggiunti vari GridSplitter nel ViewerOptimizer con lettura/scrittura delle dimensioni delle Grid coinvolte su file ini 2021-10-29 17:30:23 +02:00
RenzoL 2ec91830e4 Correzione aggiornamento colonne DataGrid nell'Ottimizzatore in base al tipo di Progetto in apertura 2021-10-28 15:16:10 +02:00
Emmanuele Sassi c211557cdd Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-10-28 10:02:11 +02:00
Emmanuele Sassi f1bff666c2 - Stampa pdf statistiche
- Introduzione lista materiali usati
- Aggiornato calcolo tempi con pezzi gia' lavorati
- Aggiornamento icone
- Migliorie e correzioni varie
2021-10-28 10:01:58 +02:00
RenzoL b4a58d9f4f Correzione verifica macchina all'avvio del programma 2021-10-27 14:55:29 +02:00
RenzoL 17dfbf2701 Spostata verifica macchina per Proj e Prod in apertura fuori da OnOpenProject (prima dell'effettiva apertura del progetto) 2021-10-27 12:58:13 +02:00
Emmanuele Sassi 3ec694db3a - Migliorie e correzioni durante le prove su macchina 2021-10-22 18:16:21 +02:00
Emmanuele Sassi 15c965c5b2 - Introdotta modalita' esecuzione MachGroup uno alla volta 2021-10-22 11:53:34 +02:00
Emmanuele Sassi 6482a4c1b8 - Correzioni e migliorie avanzamento pezzi
- Inizio gestione tipi di avanzamento pezzi
2021-10-22 08:35:06 +02:00
Emmanuele Sassi 9de7cb546a Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-10-21 14:55:36 +02:00
Emmanuele Sassi 0a352fe1dd - Implementata stampa etichetta con ZabraPrinterUtilitiesR32.exe
- Implementati indici di passaggio da ottimizzatore a supervisore con 5000
- Correzioni e modifiche comnicazione macchina durante prove
2021-10-21 14:53:43 +02:00
RenzoL f7fdc4aad8 - Aggiunta gestione file MRU nel Supervisor
- Aggiunta apertura ultimo progetto aperto all'avvio nel Supervisor
2021-10-20 16:03:12 +02:00
RenzoL 3ed7bb01f8 Correzione a file MRU (se nell'INI è presente un file di cui non si trova il ProjId/ProdId viene eliminato e non mostrato) 2021-10-20 09:59:47 +02:00
RenzoL 0fa73dbc06 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-10-19 15:45:00 +02:00
RenzoL 7f6cbee96e - Aggiunti DataGrid e comandi per la customizzazione delle Variables della Macchina in ConfigurationPage del Supervisor
- Correzioni varie al Supervisor
2021-10-19 15:44:12 +02:00
RenzoL be1b98d3d9 - Aggiunta DataGrid in AddSectionXMaterialWnd
- Corretta logica Alias in AddSectionXMaterialWnd
2021-10-19 09:03:07 +02:00
Emmanuele Sassi 13d87a180d Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-10-19 08:59:55 +02:00
RenzoL d827fd0c57 Correzioni a conferma e salvataggio di AddSectionXMaterialWnd 2021-10-18 11:02:18 +02:00
Emmanuele Sassi eea875458d - Correzioni finestra nesting 2021-10-15 09:33:17 +02:00
Emmanuele Sassi ef5009e274 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-10-15 08:55:20 +02:00
Emmanuele Sassi f26e5126b7 - Miglioramenti finestra nesting
- Introduzione finestra report del nesting
2021-10-15 08:46:58 +02:00
Emmanuele Sassi 42fc5935f3 - Miglioramenti nesting
- Miglioramenti vinestra avanzamento nesting
2021-10-14 12:23:23 +02:00
RenzoL 0dde9fe328 - Se una sola Macchina disponibile setto il progetto nuovo/importato a quella senza aprire dialog di scelta (tranne se quella Macchina è di tipo BOTH)
- Se progetto in apertura ha Macchina non presente tra quelle disponibili non lo apro
- Non apro AddSectionXMaterialWnd se non ci sono SectionXMaterial da aggiungere
- Aggiunto inserimento parametro Quantità a AddSectionXMaterialWnd
2021-10-13 12:01:35 +02:00
Emmanuele Sassi 06dbef5ed1 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-10-12 17:33:45 +02:00
RenzoL e2973d5e31 - Aggiunto Id Feature (nPRID) tra parentesi quadre al campo Descrizione mostrato per le Feature
- Reso fluido lo scroll delle DataGrid "Colonne tabelle" in Configurazione
- AddFeatureWnd ora ha sempre un PRC selezionato (se si passa tra le 2 tab L/T conserva quello precedentemente selezionato)
- Nomi tabelle e colonne in Configurazione ora visualizzati senza prefissi "DG_" e "col"
- Adattata la scrittura delle Macro alla nuova EgtBeamAddProcess (aggiornato anche MacroTemplate.ini)
2021-10-12 10:25:46 +02:00
RenzoL 9d36b42c19 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-10-11 15:17:46 +02:00
Emmanuele Sassi 3ba60a9fa6 modifiche nesting per sfruttare modifiche medium warehouse 2021-10-11 13:23:56 +02:00
Emmanuele Sassi 4dc7629b35 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-10-11 09:01:35 +02:00
RenzoL 7bb4401cc7 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-10-08 14:55:35 +02:00
Emmanuele Sassi aae8557dca Miglioramento gestione nesting 2021-10-08 12:47:27 +02:00
RenzoL e980b4203d - Reset entità geometriche e refresh BTLStructure quando si esegue Reset Macchina (dal CALCPanel)
- Modifiche e correzioni al Reset Macchina
2021-10-07 16:23:41 +02:00
RenzoL 2aceb33c79 Migliorie al codice delle gestione Warehouse 2021-10-07 11:50:01 +02:00
RenzoL 2f0d375b70 Aggiunta customizzazione colonne EgtDataGrid in WarehouseWnd 2021-10-06 17:29:19 +02:00
RenzoL 044c62fc5e Modifiche alla gestione della Warehouse (aggiunta/rimozione/modifica parametri + nuovo layout file ini) e relativa finestra 2021-10-06 17:10:36 +02:00
Emmanuele Sassi a957ae1183 - gestione nesting pareti su grezzi di diverse dimensioni(warehouse medium)
- Correzioni e migliorie
2021-10-05 11:58:55 +02:00
Emmanuele Sassi e8b262b34a Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2021-09-27 10:04:11 +02:00
Emmanuele Sassi d1f3a44aec - Correzione salvataggio stato pezzi su Db
- Correzione aggiornamento titolo
2021-09-27 10:03:04 +02:00
Emmanuele Sassi c7a7261070 Correzione merge precedente 2021-09-25 13:04:26 +02:00
Emmanuele Sassi 07d1545ef6 Merge commit 'b6ace3b35fde9c775727d81aa44bf1deca721c6f' into develop 2021-09-24 13:01:46 +02:00
RenzoL b6ace3b35f Correzione all'aggiornamento Macchina del (o dei, se più) Prod quando la si cambia nel Proj associato e viceversa 2021-09-24 12:04:46 +02:00
Emmanuele Sassi 82e0abbbaf - Correzione cancellazione BTLPart
- Correzione passagio da Proj a Prod che non ricaricava progetto se modifiche non salvate
- Introdotto flag per nesting manuale
2021-09-24 09:08:46 +02:00
RenzoL 57d087db85 - Correzioni apertura progetto e set Macchina quando si fa GoToProd/GoToProj
- ProjectTypeWnd ora si apre con Macchina (ed eventualmente Tipo) già selezionata di default
- GoToProd ora filtra le ottimizzazioni già esistenti a cui aggiungere il progetto in base a Macchina e Tipo
2021-09-23 15:40:49 +02:00
Emmanuele Sassi 6e22857086 - Bloccati edit Part e Feature in Prod se barre in produzione
- Correzioni e migliorie varie
2021-09-22 14:49:08 +02:00
Emmanuele Sassi cefe870899 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-09-21 17:06:58 +02:00
Emmanuele Sassi 4881f35fa3 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-09-21 17:05:02 +02:00
RenzoL 9f06f6e75d Corrrezione a colonne ReadOnly che durante la verifica/simulazione venivano scritte con DisplayIndex=-1 nell'ini 2021-09-21 16:12:22 +02:00
RenzoL 1ae01e0939 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-09-20 17:17:58 +02:00
Emmanuele Sassi 35f5266745 - Aggiunta rimozione MachGroupM
- Modifiche nsting con magazzino medium
2021-09-20 17:06:21 +02:00
RenzoL ae496e7aab - Aggiunto pulsante "Reset Macchina" al CALCPanel per scegliere la Macchina associata al progetto aperto
- La Macchina scelta nel "Reset Macchina" si rfilette sulla Macchina corrente nella pagina di Configurazione
- Modificata ProjectTypeWnd in modo che creando un nuovo progetto o importando un BTL chieda la Macchina da associare (e il Tipo Progetto se Macchina scelta è sia Travi che Pareti)
2021-09-20 17:02:52 +02:00
Emmanuele Sassi f6638eea9e - Correzioni e miglioramenti warehouse
- Implementato uso warehouse per definire grezzi
- Gestite colonne readonly durante la varifica/simulazione
- Correzioni e miglioramenti
2021-09-20 11:05:12 +02:00
Emmanuele Sassi 1444babea7 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-09-16 18:24:48 +02:00
RenzoL e975d227f6 Modifiche a Init di DbControllers 2021-09-15 11:59:54 +02:00
RenzoL efc3b5da34 Rimozione numero chiave 2021-09-15 11:29:31 +02:00
Emmanuele Sassi 2f78a26dfa - Cambio colore warning anche in Supervisor 2021-09-14 17:49:02 +02:00
Emmanuele Sassi 59253eb4de - Correzzione warning
- Cambiata gestione tipo progetto e macchina associata
2021-09-14 17:46:56 +02:00
Emmanuele Sassi ae795ae501 - Correzioni
- Gestione click feature
-Gestione movimento mouse pareti
2021-09-14 14:39:51 +02:00
Emmanuele Sassi e0693c6463 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2021-09-14 13:01:36 +02:00
Samuele Locatelli f804a7ea58 Merge branch 'DataLayer' into develop 2021-09-14 13:00:48 +02:00
Samuele Locatelli b9dd34abd4 Fix conf DB di default (NO KEY) 2021-09-14 13:00:41 +02:00
Samuele Locatelli 7d2e32108e Merge branch 'develop' into DataLayer 2021-09-14 12:59:53 +02:00
Samuele Locatelli c3a306a8fd Aggiunto machine in modello dati proj/prod + migrazioni 2021-09-14 12:59:39 +02:00
Emmanuele Sassi ad9a25556c Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2021-09-13 15:32:30 +02:00
Samuele Locatelli ad796bb971 Merge branch 'DataLayer' into develop 2021-09-13 15:29:25 +02:00
Samuele Locatelli 18f701d3fa Aggiunta metodo conteggio BtlPart x stato in proj 2021-09-13 15:26:50 +02:00
Emmanuele Sassi 445d2c0778 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2021-09-10 10:02:24 +02:00
Emmanuele Sassi 0063ae8ab2 Ristrutturazione classi 2021-09-10 10:01:53 +02:00
DarioS cbed398eae EgtBEAMWALL 2.3i1 :
- modifiche e correzioni varie.
2021-09-09 16:20:04 +02:00
Emmanuele Sassi d6031231e5 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-09-08 09:58:49 +02:00
Emmanuele Sassi 93c4c50fa2 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2021-09-08 09:55:39 +02:00
Emmanuele Sassi a1ebb8adb9 Modifiche e correzioni 2021-09-08 09:55:15 +02:00
RenzoL 52cde60512 - Tenuta un'unica definizione di EgtDataGrid e DataGridColumnsIniFile nel Core a cui Supervisor e ViewerOptimizer fanno riferimento
- Sistemato il Modulo IniDataGridColumnFunctions in modo che ce ne sia uno in ConfigurationPage VM del Supervisor e uno nel ConfigurationPageVM di ViewerOptimizer per simmetria
2021-09-08 09:49:14 +02:00
DarioS c9e67777ef EgtBEAMWALL :
- corretto problema con nuove barre.
2021-09-08 08:55:22 +02:00
RenzoL 2af621914c Correzione Sort dei valori numerici passati come stringhe nelle tabelle 2021-09-07 14:42:17 +02:00
RenzoL 3d383392f6 Datagrid ParameterList convertita e splittata in 2 EgtDataGrid (PParameterList e QParameterList) 2021-09-06 16:59:29 +02:00
RenzoL 0fa9e62487 Merge remote-tracking branch 'origin/develop' into Renzo 2021-09-06 10:22:38 +02:00
DarioS fa283cf17e EgtBEAMWALL :
- corretto CORE per lancio più EgtCAM5 in parallelo che dava crash (ora CORE v.2.9i1).
2021-09-03 19:30:17 +02:00
RenzoL 5a719ab11b Merge commit 'd25350bb25291143eb529fb5a1a8fbb846ffa805' into Renzo 2021-09-01 14:50:47 +02:00
DarioS bfe5de52c6 EgtBEAMWALL :
- correzioni varie.
2021-09-01 10:14:49 +02:00
DarioS 63e2141024 EgtBEAMWALL :
- portato tutto a .NET Framework 4.7.2.
2021-09-01 09:24:13 +02:00
RenzoL 6e1f08d24a - Parametri "Colonne tabelle" ricaricati quando si esce dalla pagina di Configurazione (Supervisor)
- Aggiunta richiesta di salvataggio se "Colonne tabelle" ha delle modifiche quando esco dalla pagina di Configurazione o dall'applicazione (Supervisor)
2021-08-31 14:53:35 +02:00
Emmanuele Sassi d25350bb25 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-08-31 09:27:43 +02:00
Emmanuele Sassi d6b3ebf0ae Correzioni e migliorie comunicazione tra ottimizzatore e supervisore 2021-08-31 09:22:21 +02:00
RenzoL f295ca1ac5 - Ulteriori DataGrid del ViewerOptimizer convertite in EgtDataGrid
- DataGrid del SuperVisor convertite in EgtDataGrid
- Aggiunte tab "General" e "Colonne tabelle" alla pagina di Configurazione del Supervisor
2021-08-31 09:19:26 +02:00
Emmanuele Sassi eba6d775f5 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-08-24 15:36:21 +02:00
RenzoL e1835d4d94 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-08-23 09:06:21 +02:00
Emmanuele Sassi d22b840264 Merge remote-tracking branch 'gitlab.seriate/develop' into develop 2021-08-23 08:59:54 +02:00
Emmanuele Sassi c8cf01e724 Modifiche al supervisor per comunicazione 2021-08-23 08:59:45 +02:00
RenzoL 3c1f9c32eb Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-08-23 08:51:21 +02:00
Emmanuele Sassi a8778abc97 Correzioni 2021-08-20 20:22:20 +02:00
DarioS ff7dc48efb EgtBEAMWALL 2.3h1 :
- modifiche varie per macchine che lavorano sia travi sia pareti (PF1250).
2021-08-20 20:20:08 +02:00
RenzoL c39ed46b98 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-08-02 17:07:26 +02:00
Emmanuele Sassi d611f66d43 Modifiche comunicazione tra Opt e Sup
Correzioni e migliorie
2021-08-02 15:32:39 +02:00
RenzoL 3c1231937a Aggiustamenti per far funzionare OpenProjectFileDialog del Supervisor con lettura/scrittura corretta dei Resize/Reorder delle colonne 2021-07-30 17:24:52 +02:00
Emmanuele Sassi bf7300310b Correzione merge precedente 2021-07-30 09:38:10 +02:00
Emmanuele Sassi 903c1eba65 Correzione merge precedente 2021-07-30 09:36:28 +02:00
Emmanuele Sassi 24cfabec05 Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-07-29 16:20:18 +02:00
Emmanuele Sassi b4e8d68c62 Modifiche per comunicazione tra ViewerOptimizer e Supervisor
Correzioni e migliorie
2021-07-29 16:17:37 +02:00
RenzoL f6e411264b Aggiunta datagrid nella tab "Colonne tabelle" della ConfigurationPage per customizzare le proprietà delle colonne delle EgtDataGrid usate nel programma (con lettura/scrittura su file ini) 2021-07-29 10:51:36 +02:00
RenzoL 708654e98a Correzione a ReadProductionState 2021-07-28 16:30:10 +02:00
RenzoL 2b10b7c9d1 Correzione cambio macchina selezionata quando non ci sono Proj o Prod aperti 2021-07-28 16:12:26 +02:00
RenzoL d15844f55b - Nuova gestione del reset dei progetti quando tipo macchina selezionata è diverso da tipo progetto, ora differenziando Proj e Prod aperti
- Aggiunto update del tipo progetto per i Prod
- Correzioni varie
2021-07-22 15:07:53 +02:00
Emmanuele Sassi 4e7017041d Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2021-07-20 15:23:05 +02:00
Samuele Locatelli a9290d84ce update con metodo di REMOVE machgroup da supervisor 2021-07-20 15:21:18 +02:00
Emmanuele Sassi 6c75191729 Modifiche per unificare VM di Supervisor ed optimizer
Correzione salvataggio numero pezzi aggiunti
Thread di comunicazione Supervisore
Bozza Thread di comunicazione su ottimizzatore
Migliorie e correzioni
2021-07-19 20:01:31 +02:00
Emmanuele Sassi 8cd82722fe Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2021-07-16 15:50:43 +02:00
Samuele Locatelli 4a3be724f3 inversione ordinamento indice modifiche StatusMap 2021-07-16 15:50:03 +02:00
Emmanuele Sassi c238d68095 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2021-07-16 10:43:59 +02:00
Emmanuele Sassi 13c86bdcdb Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2021-07-16 10:43:01 +02:00
Samuele Locatelli 37b727c52a Fix gestione tipo evento su set supervisor 2021-07-16 10:42:47 +02:00
Samuele Locatelli d56246e95b Correzione doppia scrittura AddMG in StatusMap 2021-07-16 10:31:01 +02:00
Emmanuele Sassi 46d6c2b360 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2021-07-16 10:05:23 +02:00
Samuele Locatelli 5ac81297ad Fix update in caso di session vuota 2021-07-16 09:52:15 +02:00
Samuele Locatelli 49fbb772e2 Update modalità lettura DB x evitare caching EF 2021-07-16 09:35:12 +02:00
Emmanuele Sassi 7abb957ab2 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2021-07-16 09:07:29 +02:00
Samuele Locatelli 9a0fdff213 Fix gestione MG nuovi da ViewOptim (errore DataLayer) 2021-07-16 09:01:48 +02:00
Emmanuele Sassi 346da073a3 Merge remote-tracking branch 'gitlab.seriate/DataLayer' into develop 2021-07-15 20:27:42 +02:00
Samuele Locatelli e1d77a37b6 aggiunto anche controllo eliminazione MachGroup eliminati da DB 2021-07-15 20:24:47 +02:00
Samuele Locatelli eb9fddccaf Aggiunta scrittura eventi in StatusMap x new/update/rem del MachGroup 2021-07-15 20:14:33 +02:00
Samuele Locatelli 0a7b93561e Modifiche x gestione dati StatusMap in append (non update) 2021-07-15 19:55:44 +02:00
Emmanuele Sassi 4b294c992a Nuovo tipo di evento in StatusMap 2021-07-15 19:38:58 +02:00
Emmanuele Sassi 211cbd1f9b Merge remote-tracking branch 'gitlab.seriate/Renzo' into develop 2021-07-15 12:36:24 +02:00
RenzoL c5507a7543 redo modifica showBuilding 2021-07-15 12:35:40 +02:00
Samuele Locatelli a84d4a0223 Fix views 2021-07-15 12:02:31 +02:00
Samuele Locatelli e41af36b20 Fix migrazione 2021-07-15 12:02:19 +02:00
Samuele Locatelli 15562bd9ca refresh view 2021-07-15 11:38:01 +02:00
Samuele Locatelli 58c7fa5408 Fix inserimento modifiche x gestione nuovi campi tipo BW 2021-07-15 11:20:18 +02:00
Emmanuele Sassi 651de09d7d Modifiche per gestione comunicazione tra Supervisor e Ottimizzatore 2021-07-15 10:23:27 +02:00
Emmanuele Sassi 23844a542f Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-07-14 17:51:36 +02:00
Emmanuele Sassi 895af630e3 Spostati VM dell'ottimizzatore in Core
Correzioni e migliorie
2021-07-14 17:46:11 +02:00
DarioS e826a0ed1d EgtBEAMWALL :
- coorezioni in selezione di view
- correzioni per selezione pezzi copia in assemblato
- correzioni per gestione più progetti in ottimizzazione.
2021-07-13 20:20:19 +02:00
DarioS d79f3aa848 EgtBEAMWALL 2.3g2 :
- piccole modifiche estetiche.
2021-07-13 16:31:31 +02:00
Emmanuele Sassi 2361e1f6f8 Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-07-12 17:50:21 +02:00
RenzoL f1640f75f8 - Creato l'oggetto EgtDataGridColumn per gestire diverse proprietà (Width, IsReadOnly, DisplayIndex, ecc.) per ogni colonna singolarmente di una EgtDataGrid
- Aggiunta gestione colonne (e relative proprietà) delle EgtDataGrid tramite lettura/scrittura su file ini
2021-07-12 17:29:51 +02:00
Emmanuele Sassi a58f7d9fda Aggiunto bottone reset MachGroup
Aggiunti tooltip beam show panel
2021-07-12 15:30:59 +02:00
Emmanuele Sassi a20f40085c Correzione gestione progetti multipli senza ricaricarli tra proj e prod
Migliorie statistiche
2021-07-12 11:59:22 +02:00
Emmanuele Sassi 89975169a2 Correzione MRU file su nuovo 2021-07-08 11:05:26 +02:00
Emmanuele Sassi 8a2d9fc4ea Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-07-08 11:04:07 +02:00
Emmanuele Sassi ed68b0da5c Correzioni e migliorie statistiche
Aggiunto bottone per copiare dati in statistiche
2021-07-07 18:57:00 +02:00
RenzoL 2a5ecc4a09 - Correzione sul Nuovo Progetto che, salvato, non veniva aggiunto alla lista degli MRU
- Correzione ad UpdateColumns in OpenProject
2021-07-07 14:59:57 +02:00
Emmanuele Sassi 095d155f1a Correzione creazione progetto New con nuovi attributi 2021-07-07 12:39:17 +02:00
Emmanuele Sassi fdc7adb0da Correzione tipo di progetto su New 2021-07-07 12:13:49 +02:00
Emmanuele Sassi b67bf887e9 Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-07-07 10:46:04 +02:00
Emmanuele Sassi ddad3ea228 Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-07-07 10:45:49 +02:00
DarioS 60032d5336 EgtBEAMWALL :
- semplificati confronti tra SectionXMaterial.
2021-07-06 20:36:12 +02:00
Emmanuele Sassi 2d9dcfa12a Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-07-06 19:55:24 +02:00
Emmanuele Sassi 97727d097e Correzione messaggi 2021-07-06 19:54:24 +02:00
DarioS bece291a6e EgtBEAMWALL 2.3g1 :
- cambio versione
- aggiustamenti estetici.
2021-07-05 10:18:30 +02:00
RenzoL 80dd455ef3 - Correzione riferimenti tipo progetto laddove veniva usato ancora tipo macchina
- Aggiunti commenti su aggiunta/rimozione file a lista MRU in base a tipo progetto
2021-07-02 12:02:55 +02:00
RenzoL 82bfdb7473 - Aggiunto messaggio d'errore quando il tipo di progetto che si vuole aprire non è compatibile col tipo di macchina corrente
- Aggiunta chiusura progetti correnti (Proj e Prod) quando si cambia macchina
2021-07-01 14:45:56 +02:00
RenzoL 7a0d4f33f1 Piccola correzione al filtro di ricerca nel dialog apertura progetto per Ottimizzatore 2021-06-29 16:25:46 +02:00
RenzoL 37df943c08 Correzione dialog apertura progetti con filtri di ricerca per Ottimizzatore 2021-06-29 16:15:35 +02:00
RenzoL da972cdd0a - Aggiunti filtri di ricerca (testuale e con calendario) al dialog di apertura progetto
- Aggiunto refresh al cambio di Parameter Type nei filtri di ricerca dei Part
2021-06-29 12:19:05 +02:00
RenzoL 454024d4bd Merge remote-tracking branch 'origin/feature/total_rebuild' into Renzo 2021-06-29 12:06:03 +02:00
Emmanuele Sassi 1828b88382 Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-06-29 11:43:26 +02:00
Emmanuele Sassi 891bbd4a08 Aggiunto materiale su Machgroup
Corretta sezione
Rimossa selezione grezzo
Gestione blocco interfaccia su verifica e simula
Aggiunta correzione con cancellazione cartelle progetti
Tolto ricaricmento progetto nel passaggio da proj a prod
Iniziat studio esportazione statistiche
Migliorati messaggi su nesting
Cambiata gestione tipo progetto
2021-06-29 11:38:19 +02:00
RenzoL 1fb7699382 Aggiunta apertura ultimo progetto aperto all'avvio 2021-06-25 12:31:59 +02:00
RenzoL c9f47e23f2 Aggiunta gestione file MRU (per Visualizzatore e Ottimizzatore) 2021-06-25 12:04:27 +02:00
Emmanuele Sassi c0b007994a Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-06-23 10:11:05 +02:00
DarioS 18d1368c8c EgtBEAMWALL :
- correzione per problemi legati ad abilitazione/disabilitazione registrazione progetto modificato.
2021-06-23 10:06:13 +02:00
Emmanuele Sassi 49610fba06 Correzioni e migliorie 2021-06-22 18:32:08 +02:00
Emmanuele Sassi da5456b13a Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-06-22 09:19:10 +02:00
Emmanuele Sassi 1cddcb28dc Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-06-22 09:16:13 +02:00
Emmanuele Sassi b9517e1cc5 Gestione esportazione ed importazione progetti 2021-06-22 09:16:02 +02:00
Samuele Locatelli f3ed0cf817 Update Controllers con reset post C-U-D methods 2021-06-21 17:50:11 +02:00
RenzoL 26f96d42c6 Aggiunto drag-and-drop dei file BTL per l'Import 2021-06-18 16:14:42 +02:00
RenzoL 8624dd6fc6 Aggiunta gestione tipo progetto (Beam o Wall) in base a tipo macchina durante l'Import 2021-06-18 12:29:03 +02:00
RenzoL 90dc9ddd4e Merge branch 'feature/total_rebuild' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-06-17 11:47:41 +02:00
RenzoL d8c2a94c75 Aggiunta proprietà nType a CurrentMachine e correzione riferimenti per usarla al posto di quella di MyMachine dove possibile 2021-06-17 11:40:11 +02:00
Emmanuele Sassi f24dcd0bc5 Correzione controller
Aggiunta gestione del passaggio da prod a proj con scelta di questultimo
2021-06-17 11:35:24 +02:00
Emmanuele Sassi 3b368ac504 Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-06-17 08:43:24 +02:00
Emmanuele Sassi f5ac9ddac2 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-06-17 08:43:14 +02:00
Emmanuele Sassi 3f4547179c Aggiunta gestione del merge di piu' proj in un prod
Migliorie e correzioni
2021-06-17 08:42:59 +02:00
Samuele Locatelli a5866a8eb6 update PROJ: getByProdAsc restituisce oggetto corretto 2021-06-17 08:34:25 +02:00
RenzoL ae736a9fff Correzione ricerca parametro Q nel check Custom 2021-06-16 11:29:57 +02:00
Emmanuele Sassi 05da1f2d9e Correzione aggiornamento startcut su modifica offset prima trave 2021-06-16 10:23:37 +02:00
Emmanuele Sassi a8c2154444 Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-06-16 09:31:19 +02:00
Emmanuele Sassi bac7b490be Correzioni e migliorie
Aggiunto reset stato calc in prod su modifiche
2021-06-16 09:31:07 +02:00
DarioS 907e8c355c EgtBEAMWALL :
- correzioni nella Produzione per cambio macchina tra una barra e la successiva.
2021-06-15 09:57:03 +02:00
DarioS ab2925ba74 EgtBEAMWALL :
- corretto problema in FileDialog quando si dà comando di apertura senza aver selezionato un file.
2021-06-14 12:01:07 +02:00
DarioS 747e25315d EgtBEAMWALL :
- in DataLayer corretta dipendenza da EgtWPFLib5.
2021-06-14 11:42:10 +02:00
Emmanuele Sassi 922b1a4787 Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-06-14 09:47:08 +02:00
Emmanuele Sassi 1a926d8f49 Cambiata gestione titolo
Aggiunto listname in prod
2021-06-14 09:46:59 +02:00
DarioS b4140ce9ab EgtBeamWall :
- cancellato direttorio dll inutile e dannoso.
2021-06-11 08:24:52 +02:00
DarioS b6f255695c EgtBEAMWALL :
- modifiche per gestione risultati in produzione.
2021-06-11 07:58:13 +02:00
Emmanuele Sassi 29250f344c Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-06-10 20:48:22 +02:00
Emmanuele Sassi b3b7ea865a Aggiunte statistiche
Modifiche verifica per pareti
Correzioni varie
2021-06-10 20:48:07 +02:00
RenzoL 9903c41009 Nuova visualizzazione Parametri Q in Configurazione (Datagrid con Grouping) 2021-06-10 17:22:04 +02:00
Emmanuele Sassi d4fc382a51 Modifiche supevisor
funzione annulla in passaggio tra progetti
2021-06-09 18:38:37 +02:00
Emmanuele Sassi 846597b01f Modifica che permette di cambiare il listname e vederlo all'apertura 2021-06-07 19:33:13 +02:00
Emmanuele Sassi 83e9f051a5 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-06-07 19:21:50 +02:00
Samuele Locatelli 685d899df0 update nome proj come singolo metodo 2021-06-07 19:21:34 +02:00
Emmanuele Sassi 8fcdbca3cf Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-06-07 19:21:32 +02:00
DarioS 8618fd332e EgtBEAMWALL 2.3f2 :
- correzioni per import BTL con parametri Q.
2021-06-07 19:14:41 +02:00
Emmanuele Sassi 941d896ffa Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-06-05 11:48:25 +02:00
Samuele Locatelli 88dd388fe3 Update procedura scrittura DB context 2021-06-05 11:46:33 +02:00
Samuele Locatelli 7aef151a44 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-06-05 09:16:45 +02:00
Samuele Locatelli d7edf38d57 Update controller LogMachine (da testare) 2021-06-05 09:14:37 +02:00
Emmanuele Sassi 85f9703353 MOdifiche a supervisor per avvio programmi come linea di produzione 2021-06-05 09:14:19 +02:00
Emmanuele Sassi 9aa27dd21d Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-06-03 14:25:15 +02:00
Samuele Locatelli f01f6b9ef6 Fix ricerca MachGroup da ProdId + MachGroupId 2021-06-03 14:23:38 +02:00
Emmanuele Sassi b8f8ae8af1 Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-06-03 14:23:25 +02:00
DarioS c3c45157d3 EgtBEAMWALL :
- verifica obbliga check solo se stato non OK o INFO.
2021-06-02 18:20:37 +02:00
Emmanuele Sassi 29accd4f35 Correzione push precedente 2021-06-02 12:32:52 +02:00
Emmanuele Sassi c6c5936f41 Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-06-01 19:44:23 +02:00
Emmanuele Sassi 25dd993b7c Modifiche visualizzazione verifica travi in visualizzatore 2021-06-01 19:44:15 +02:00
DarioS 6f9e4e43bf Merge branch 'feature/total_rebuild' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/total_rebuild 2021-06-01 19:38:43 +02:00
DarioS cfefeaa4c5 EgtBEAMWALL 2.3f1 :
- modifiche per gestione parametri Q tramite gestore Travi di libreria
- correzioni per segnalazione pezzo con scarico a caduta.
2021-06-01 19:37:54 +02:00
Emmanuele Sassi e76f650ced Modifica per rendere cambio parametro visibile solo in visualizzatore 2021-06-01 18:30:44 +02:00
Emmanuele Sassi 9580911f63 Correzione posizionamento colonna offset 2021-05-31 16:19:12 +02:00
Emmanuele Sassi d3b4afb8ff Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-05-31 15:29:00 +02:00
Emmanuele Sassi 26779d2120 Agginti altri tooltip gestiti con messaggi 2021-05-31 15:27:20 +02:00
Emmanuele Sassi 4ae90231e1 - Aggiunta messaggi gestiti in file 2021-05-31 12:35:26 +02:00
RenzoL bb55e2acb4 Aggiunta gestione percorso del file ini dei Parametri Macchina in base a tipo Macchina (Beam o Wall) 2021-05-31 10:38:36 +02:00
Emmanuele Sassi 66b2fbca9a Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-05-31 06:18:47 +02:00
DarioS b977e106ef EgtBEAMWALL 2.3e2 :
- modifiche varie per feature composite
- gestione ricalcolo solo se necessario
- disattivata copia di L250, L251 e L252 (temporaneo).
2021-05-30 23:03:56 +02:00
Emmanuele Sassi 5f4cd60bd3 Correzione ricerca pezzo 2021-05-30 16:41:17 +02:00
Emmanuele Sassi 6117506135 Aggiunto reset verific su modifiche part e feature in proj 2021-05-29 20:16:20 +02:00
Emmanuele Sassi 84fa23e76c Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-05-29 19:08:03 +02:00
Emmanuele Sassi 5c38d688b1 Correzioni e migliorie verifica in prod 2021-05-29 19:07:38 +02:00
DarioS ee7bfba114 EgtBEAMWALL :
- modifiche per feature con geometrie aggiunte (non ausiliarie).
2021-05-29 18:14:06 +02:00
Emmanuele Sassi a8fb99c9cf Correzione misura 2021-05-28 20:41:07 +02:00
Emmanuele Sassi f58fa27908 Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-05-28 16:30:15 +02:00
Emmanuele Sassi 898f9a7703 Implementazione nuova lettura degli errori da verifica 2021-05-28 16:29:58 +02:00
RenzoL 8d95fccef2 - Aggiunta richiesta di salvataggio in uscita da Configurazione per i default modificati dei prametri Q
- Correzione apertura progetto (ora i valori di default vengono scritti solo se diversi da quelli già nel DB)
2021-05-28 15:49:04 +02:00
RenzoL f62792c650 Correzione Set valore e custom dei parametri Q (che per alcune Feature non funzionava per via del GRP sbagliato) e scrittura dei default nel progetto 2021-05-27 18:08:32 +02:00
RenzoL fc8730683f Merge branch 'feature/total_rebuild' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-05-27 15:47:27 +02:00
RenzoL 2075661927 Redesign della Tab Macchina di ConfigurationPage 2021-05-27 15:46:50 +02:00
Emmanuele Sassi bbb0545ff4 Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-05-27 12:43:29 +02:00
Emmanuele Sassi e11c3991ac - Ricalcolo setup alla chiusura Dbutensili
- correzioni varie
2021-05-27 12:43:13 +02:00
RenzoL f8d7b95149 Merge branch 'feature/total_rebuild' of https://gitlab.steamware.net/egaltech/egtbeamwall into Renzo 2021-05-27 12:20:19 +02:00
RenzoL 276a2d21a3 Aggiustamenti grafici a GroupBox e Parametri del Tab Macchina in ConfigurationPage 2021-05-27 12:16:53 +02:00
Emmanuele Sassi 31a06ab64a Correzioni e migliorie 2021-05-26 14:46:11 +02:00
Emmanuele Sassi 0b5ae544a5 Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-05-26 14:45:47 +02:00
Emmanuele Sassi c09a74e92c Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-05-26 14:45:35 +02:00
Emmanuele Sassi 3b9749ef67 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-26 14:45:15 +02:00
RenzoL a938f2cc6e Ridisegnata ConfigurationPage con TabControl 2021-05-26 12:35:16 +02:00
DarioS 699bc24318 EgtBEAMWALL :
- prime modifiche per problemi con nesting.
2021-05-26 11:55:31 +02:00
Samuele Locatelli f4b12de2f0 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-05-26 11:41:44 +02:00
Samuele Locatelli 2f8ef75ce7 Aggiunto funzione reset x ogni controller 2021-05-26 11:41:15 +02:00
Emmanuele Sassi fc1a9828dc Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-26 11:24:29 +02:00
Samuele Locatelli f7c7e3a7f5 Aggiunta metodo ResetController 2021-05-26 11:22:42 +02:00
Emmanuele Sassi 3eb25c3533 Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-05-25 18:17:56 +02:00
DarioS 208ee3a883 EgtBEAMWALL :
- correzioni varie.
2021-05-25 08:28:01 +02:00
Emmanuele Sassi 4c1289ed2d - sviluppo L250
- aggiunta tabelle lavorazioni
2021-05-24 19:13:22 +02:00
Emmanuele Sassi 91798cdd00 Correzione larghezza colonne per titoli 2021-05-22 13:40:12 +02:00
Emmanuele Sassi dceabbfa37 - continuazione implementazione L250 2021-05-22 12:46:18 +02:00
Emmanuele Sassi a477a93186 Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-05-22 09:41:19 +02:00
Emmanuele Sassi dd536c8cbb - correzioni varie
- inizio implementazione L250
2021-05-22 09:41:07 +02:00
RenzoL b1ce12e110 - correzione alla selezione GRP in ConfigurationPage che dava errore
- sistemati i messaggi
2021-05-21 12:31:35 +02:00
RenzoL c28555080a Merge remote-tracking branch 'origin/feature/total_rebuild' into Renzo 2021-05-21 11:01:59 +02:00
DarioS 95f867dfe3 EgtBEAMWALL :
- piccola modifica nelle lettura dei tempi di nesting.
2021-05-21 10:28:51 +02:00
Emmanuele Sassi e5c8544c59 Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-05-21 09:44:43 +02:00
Emmanuele Sassi 70082e03a5 Correzioni varie 2021-05-21 09:44:31 +02:00
RenzoL 3f7f352919 Merge remote-tracking branch 'origin/feature/total_rebuild' into Renzo 2021-05-21 09:41:48 +02:00
RenzoL 60260ea451 - aggiunta parametri a ConfigurationPage 2021-05-21 09:38:40 +02:00
Emmanuele Sassi 2fc81d3258 Correzione cancellazione progetti 2021-05-21 08:32:29 +02:00
Emmanuele Sassi 9d2b78fd4d Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-20 19:08:27 +02:00
Samuele Locatelli 376f54ab37 Aggiunto eliminazione PART come child del MachGroup 2021-05-20 18:52:15 +02:00
Emmanuele Sassi 07a26632dd Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-20 18:42:09 +02:00
Samuele Locatelli 23ac186eb1 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-05-20 18:40:26 +02:00
Samuele Locatelli ceb9bf2d18 update metodo cancellazione PROD 2021-05-20 18:40:15 +02:00
Emmanuele Sassi bb772e4a1f Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-20 18:05:19 +02:00
Emmanuele Sassi bab90cf7dc - selezione dei pezzi btl in prod
- implementazione copia rawpart travi
- selezione dei pezzi btl in prod
- implementazione accesso Db con codice chiave
2021-05-20 18:05:02 +02:00
Samuele Locatelli 4471fd4564 aggiunta metodo x verifica assegnazione MachGroup a supervisor 2021-05-20 10:15:45 +02:00
Samuele Locatelli 4d9211ae20 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-05-20 10:05:52 +02:00
Emmanuele Sassi e14101134c - gestione qty grezzi in nesting travi e pareti
- cancellazione progetti (proj, prod, assegnazioni al supervisor)
2021-05-19 16:36:19 +02:00
Samuele Locatelli f73e59a434 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-05-19 15:33:35 +02:00
Emmanuele Sassi 4ed15194b4 Fix datalayer x creazione utente 2021-05-19 15:24:02 +02:00
Emmanuele Sassi c652d5930f Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-19 14:55:50 +02:00
Samuele Locatelli 23cbb48527 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-05-19 13:28:42 +02:00
Samuele Locatelli ddc36ba729 DbInit: gestione creazione utenti e DB 2021-05-19 13:27:50 +02:00
Emmanuele Sassi 443bd8e9d8 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-19 11:44:02 +02:00
Samuele Locatelli cbcbc3e854 Merge branch 'feature/DbParametrization' into develop 2021-05-19 11:23:40 +02:00
Samuele Locatelli 1368f15957 refresh progetto 2021-05-19 11:23:24 +02:00
Samuele Locatelli c26a186dcb elimino vecchio config statico 2021-05-19 11:23:19 +02:00
Samuele Locatelli a341659996 Update dll 2021-05-19 11:21:18 +02:00
Samuele Locatelli 0857ec3c1b Altri controllers migrati 2021-05-19 11:21:06 +02:00
Samuele Locatelli 37d6941eeb Primo set controllers migrati 2021-05-19 11:20:26 +02:00
Samuele Locatelli bbdbaf823c init calsse conf parametrica DB 2021-05-19 11:14:39 +02:00
Samuele Locatelli 2d34c70a1b Eliminazione old project 2021-05-19 10:39:09 +02:00
Emmanuele Sassi 18745e3158 Completamento sviluppo gestione colonne EgtDataGrid
Impostazione tempo nesting
Impostazione Qty grezzi
2021-05-19 09:36:16 +02:00
Emmanuele Sassi 184fc1ad77 Modifica path di compilazione 2021-05-17 10:37:07 +02:00
Samuele Locatelli 9caf440696 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into feature/total_rebuild 2021-05-17 10:09:05 +02:00
Samuele Locatelli b167342437 Merge branch 'develop' into feature/total_rebuild 2021-05-17 10:08:30 +02:00
Samuele Locatelli 376cdfaff9 fix rilettura da DB entry modificate 2021-05-17 10:08:20 +02:00
DarioS ff839b5d8a EgtBEAMWALL :
- modifica per controllo progetto modificato in produzione.
2021-05-17 10:08:13 +02:00
Samuele Locatelli 9b86c92639 Merge branch 'feature/total_rebuild' into develop 2021-05-17 10:04:06 +02:00
DarioS 8cb610cdf9 EgtBEAMWALL :
- modifiche varie per LHW di BTL e in globale.
2021-05-17 08:42:29 +02:00
Emmanuele Sassi 24594a4d24 Correzioni 2021-05-15 19:06:57 +02:00
Emmanuele Sassi ebcba6dec3 Correzione 2021-05-15 18:17:17 +02:00
Emmanuele Sassi d99d34af7f Aggiunta AboutBox
Spostamento macchina e Db Ut e Lav in pagina Config
Correzioni varie
2021-05-15 17:15:06 +02:00
Emmanuele Sassi 084220230c Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-05-15 17:14:16 +02:00
DarioS 4177c1a0ae EgtBEAMWALL :
- aggiunta gestione protezione con codice 5327.
2021-05-15 17:13:06 +02:00
Emmanuele Sassi dbf0d6211b Correzioni e test log macchina 2021-05-14 19:52:10 +02:00
Emmanuele Sassi c77e8bd6a5 Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-05-14 18:33:49 +02:00
RenzoL 5a39cd80d3 Merge remote-tracking branch 'origin/feature/total_rebuild' into Renzo 2021-05-14 18:32:47 +02:00
RenzoL 2295305bf1 Aggiunta checkbox Custom sui Parametri Q delle Feature e possibilità di settare i valori di Default degli stessi in Configurazione 2021-05-14 18:29:13 +02:00
Emmanuele Sassi fcff7cfbb7 Miglioramenti travi e sesting 2021-05-13 19:50:17 +02:00
Emmanuele Sassi 025c57d78f Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-13 17:06:32 +02:00
Samuele Locatelli 49d75d575a Cambio modalità lock/unlock con forzatura stato changed 2021-05-13 17:05:35 +02:00
Emmanuele Sassi 4e9e17d937 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-13 11:27:26 +02:00
Emmanuele Sassi bc47a8d419 Correzioni pareti 2021-05-13 11:26:42 +02:00
Samuele Locatelli a2ba210f74 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-05-13 11:24:20 +02:00
Samuele Locatelli e5695049fe Fix comportamento lock creando prod 2021-05-13 11:24:08 +02:00
Emmanuele Sassi 6b340a6ec8 Fix eliminazione pareti
Correzioni varie
2021-05-11 17:52:00 +02:00
DarioS 57e7d8e099 EgtBEAMWALL 2.3e1 :
- correzioni per W e H di travi con rotazioni e inversioni.
2021-05-10 20:12:43 +02:00
Emmanuele Sassi ee422c8e17 Modifiche per funzionamento travi
Correzioni e migliorie varie
2021-05-10 18:35:08 +02:00
Emmanuele Sassi 0457bed4ba Merge remote-tracking branch 'gitlab.seriate/Renzo' into feature/total_rebuild 2021-05-10 09:43:22 +02:00
Emmanuele Sassi 49c30cbb5b Correzioni aggiornamento duplo 2021-05-10 09:42:20 +02:00
RenzoL bbf97f7066 Merge del Warehouse VM 2021-05-07 09:57:12 +02:00
RenzoL 814b94bf97 Merge del Warehouse XAML 2021-05-07 09:23:26 +02:00
RenzoL 86bd547f8d Inizio Merge modifiche da progetto 1 marzo SVN 2021-05-07 09:09:45 +02:00
Emmanuele Sassi 7dca4d63b4 Merge remote-tracking branch 'gitlab.seriate/feature/total_rebuild' into feature/total_rebuild 2021-05-07 08:52:57 +02:00
Emmanuele Sassi 528bbf6fb6 Da refresh di tutti i MachGroup ad add dei nuovi 2021-05-07 08:51:42 +02:00
Samuele Locatelli 5b29302b93 Merge branch 'develop' into feature/total_rebuild 2021-05-06 18:58:42 +02:00
Emmanuele Sassi 2f325ff7fd Correzione nesting lineare travi
Correzioni contatori pezzi
Correzioni varie
2021-05-06 18:56:27 +02:00
Emmanuele Sassi 5ec47d3a9c Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-05 14:29:50 +02:00
Samuele Locatelli eb52018b83 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-05-05 13:23:12 +02:00
Samuele Locatelli 807759a331 update viste e migration DB 2021-05-05 13:22:22 +02:00
Samuele Locatelli 9dccb99d38 completata review index 2021-05-05 13:22:12 +02:00
Samuele Locatelli 9de97768b3 Update anche dell'order/ProdIndex 2021-05-05 13:17:48 +02:00
Emmanuele Sassi daf8045b10 Correzione eliminazione pezzo da barra
Correzioni gestione duplo
2021-05-04 20:48:57 +02:00
Emmanuele Sassi f8c2c28ada Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-04 08:57:01 +02:00
Samuele Locatelli 985c28332f Revisione metodo cancellazione in cascata x update Proj 2021-05-04 08:55:50 +02:00
Emmanuele Sassi 5494838ed4 Modifiche roatazione, inverti pezzi 2021-05-03 19:58:59 +02:00
Emmanuele Sassi c5308cb6f5 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-03 18:54:05 +02:00
Samuele Locatelli 19c42bfa8e Modifica update BtlPart da Proj 2021-05-03 18:52:19 +02:00
Emmanuele Sassi 32f6f72a1a Introduzione contatore pezzi 2021-05-03 17:33:35 +02:00
Emmanuele Sassi 3a113c97bb Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-05-03 08:28:45 +02:00
Emmanuele Sassi 515ce5ef33 Migliorie varie 2021-05-03 08:11:45 +02:00
Samuele Locatelli 7fc702df50 Aggiunte migrations + udpate views x DB 2021-04-30 18:39:08 +02:00
Samuele Locatelli 272c6f46db Update metodi x StatusMap 2021-04-30 18:38:38 +02:00
Emmanuele Sassi e64a89f3f1 Correzioni invio programmi 2021-04-29 09:49:30 +02:00
Emmanuele Sassi 1ebffd8e93 Correzioni invio programmi
implementazione stampa etichette
2021-04-29 09:49:00 +02:00
Emmanuele Sassi 8d8ae29cc8 Correzioni lista produzione barre 2021-04-28 14:10:19 +02:00
Samuele Locatelli 6b7d3ce6b5 Modifica metodo update prod + MachGroup 2021-04-27 12:57:09 +02:00
Samuele Locatelli 53ed0b4775 Aggiunta metodi delete espliciti MachGroup / Part 2021-04-27 12:56:57 +02:00
Samuele Locatelli 5e69f0dd5c Aggiunta equality x model Part/MachGroup 2021-04-27 12:56:36 +02:00
Emmanuele Sassi 86feb7e9a3 Modifiche passaggio proj/prod 2021-04-27 10:14:51 +02:00
Emmanuele Sassi 74dfb67dae Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-26 11:40:57 +02:00
Emmanuele Sassi bd9e3def79 Modifiche per funzionamento ciclo in macchina 2021-04-26 11:40:48 +02:00
Samuele Locatelli 2f03f59eea refresh views 2021-04-23 18:26:57 +02:00
Samuele Locatelli 421e2e2214 aggiunto data migration 2021-04-23 18:26:52 +02:00
Samuele Locatelli 00d43473f5 update controllers DB x MacLog 2021-04-23 18:24:36 +02:00
Samuele Locatelli afe64db075 Update classe VB CoreMacLog 2021-04-23 18:24:28 +02:00
Samuele Locatelli d039e39205 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-04-23 15:58:45 +02:00
Emmanuele Sassi 96538f600f Modifiche MachLog 2021-04-23 14:46:23 +02:00
Samuele Locatelli ca37a2f3c2 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-04-23 14:16:56 +02:00
Emmanuele Sassi 415ae0a39c Migliorie e correzioni
Creazione cartela MachLog
2021-04-23 13:59:18 +02:00
Emmanuele Sassi b576276c7a Modifiche comunicazione completate 2021-04-22 12:28:31 +02:00
Emmanuele Sassi af17747b38 Modifiche comunicazione 2021-04-21 20:02:07 +02:00
Emmanuele Sassi 152d57de16 Modifiche thread di comunicazione con CN 2021-04-20 20:13:25 +02:00
Emmanuele Sassi 78505e0f2b Modifiche thread di comunicazione CN 2021-04-20 20:12:56 +02:00
Emmanuele Sassi 540afe7c6a Riorganizzazione scrittura variabili 2021-04-19 13:04:20 +02:00
Emmanuele Sassi 180068f667 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-19 09:06:56 +02:00
Emmanuele Sassi be50c87b7f Modifiche al supervisor durante prove 2021-04-19 09:06:46 +02:00
Samuele Locatelli 11e6cc449c Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-04-16 19:30:36 +02:00
Samuele Locatelli cd23546c4b spostato dbConf custom (ma NON usato) 2021-04-16 19:22:39 +02:00
Samuele Locatelli f4fb37c9d2 init classe DB nel sim all'avvio 2021-04-16 19:22:20 +02:00
Emmanuele Sassi a128b42bb4 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-16 17:43:56 +02:00
Samuele Locatelli 81d4f42849 update default order x MachGroup 2021-04-16 17:42:44 +02:00
Emmanuele Sassi f9328f9684 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-16 17:08:20 +02:00
Samuele Locatelli b99c7b8ba6 fix update x MachGroup e Part del MG 2021-04-16 17:06:00 +02:00
Emmanuele Sassi f82cc3be10 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-16 16:47:17 +02:00
Samuele Locatelli fb7b160512 add start/end update for parts 2021-04-16 16:18:57 +02:00
Emmanuele Sassi bfa01f1d8d Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-16 15:04:08 +02:00
Samuele Locatelli 44014b9144 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-04-16 15:03:46 +02:00
Emmanuele Sassi a25e80dd49 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-16 15:02:20 +02:00
Samuele Locatelli e64cbb521b modifica x MachGroup solo Start/End 2021-04-16 15:00:42 +02:00
Emmanuele Sassi 5b7f50686c Modifiche ciclo macchina real time 2021-04-16 15:00:31 +02:00
Samuele Locatelli 7ac80309e8 CodeMaid reshape 2021-04-16 10:33:44 +02:00
Emmanuele Sassi fa63d82dc5 Liste funzionanti in Supervisor 2021-04-16 00:04:28 +02:00
Emmanuele Sassi 4b06fbfaf3 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-15 22:31:09 +02:00
Samuele E. Locatelli a252ff0568 Aggiunto metodo update start/end 2021-04-15 22:08:45 +02:00
Emmanuele Sassi cde144de29 Modifiche supervisore 2021-04-15 20:06:18 +02:00
Emmanuele Sassi b7b50ed222 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-15 20:05:55 +02:00
Samuele Locatelli 7f9e637626 update modello e metodi x MachGroup 2021-04-15 20:05:20 +02:00
Samuele Locatelli 30aba16ed3 update ma SIM non ok... 2021-04-15 19:08:54 +02:00
Samuele Locatelli f355f80743 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-04-15 18:46:53 +02:00
Emmanuele Sassi 60dddcbba4 Modifiche per test DataLayer 2021-04-15 18:41:45 +02:00
Emmanuele Sassi 7b89a46487 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-15 17:33:52 +02:00
Samuele Locatelli 21f2695cfe update prod x cancellazione items 2021-04-15 17:32:43 +02:00
Emmanuele Sassi dd920d2bff Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-15 17:02:42 +02:00
Samuele Locatelli f865d73ec3 prova cancellazione implicita a cascata 2021-04-15 16:59:21 +02:00
Emmanuele Sassi da501c6e68 Salvataggio intermedio dati 2021-04-15 16:38:50 +02:00
Emmanuele Sassi a1bfaeee75 Modifiche Supervisor 2021-04-15 16:29:08 +02:00
Emmanuele Sassi b50732100b Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-15 16:28:07 +02:00
Samuele Locatelli 4e35f56bcb modifica metodo update MachGroup x convert Part 2021-04-15 16:24:05 +02:00
Emmanuele Sassi f194128738 Correzione per Sam!!! 2021-04-15 15:29:57 +02:00
Emmanuele Sassi c153189ffa Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-15 15:24:45 +02:00
Samuele Locatelli 7b2425773d Update view definition 2021-04-15 15:23:45 +02:00
Emmanuele Sassi 4dc269ebf7 Correzioni 2021-04-15 15:22:09 +02:00
Emmanuele Sassi 7599503601 Correzioni rimozione elementi in liste 2021-04-15 15:21:48 +02:00
Emmanuele Sassi 9ceed14f85 check prod not null 2021-04-15 11:06:34 +02:00
Emmanuele Sassi ffd4ae2e46 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-15 11:04:29 +02:00
Samuele Locatelli 8f0b47bd64 fix modelli e metodi x Proj 2021-04-15 10:03:58 +02:00
Samuele Locatelli 6295d882a0 refresh view model store 2021-04-15 08:56:37 +02:00
Samuele Locatelli 3bd0d4759f Modifica initDb: un unico step x problema foreign key null 2021-04-15 08:26:48 +02:00
Samuele Locatelli c1b7e80d6f Aggiunta migrazione x nullable ext key (non ok) 2021-04-15 08:25:06 +02:00
Samuele Locatelli 9e5bbfcb39 aggiunta conversione a core x MachGroup 2021-04-15 08:24:31 +02:00
Samuele Locatelli 7c06122527 permesso null x BTLPart in PART (in MachGroup) 2021-04-15 08:24:13 +02:00
Samuele Locatelli 90dc459d99 fix errore proj/prod key 2021-04-15 08:24:00 +02:00
Emmanuele Sassi 48957218be Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-14 13:03:53 +02:00
Samuele Locatelli cc1eb18ca2 aggiunto salvataggio proj/prod 2021-04-14 12:18:53 +02:00
Emmanuele Sassi 79da5a3ac0 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-13 19:14:05 +02:00
Emmanuele Sassi 42424414b3 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-13 19:11:01 +02:00
Samuele Locatelli 78106ea7ca aggiunto check null x prod 2021-04-13 19:10:50 +02:00
Samuele Locatelli e2cc1b3ae8 update x lock di TUTTI i proj a cascata 2021-04-13 19:06:12 +02:00
Emmanuele Sassi 75c791666a Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-13 18:18:31 +02:00
Samuele Locatelli 29c371fcae update con locked 2021-04-13 18:18:18 +02:00
Samuele Locatelli 0698dd4c0c Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-04-13 18:17:44 +02:00
Emmanuele Sassi 636abf6402 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-13 18:16:06 +02:00
Emmanuele Sassi 2ece2b096a Agiornato costruttore ProjectM 2021-04-13 18:13:16 +02:00
Samuele Locatelli 6e6861b803 Update metodi con conversione 2021-04-13 18:12:53 +02:00
Emmanuele Sassi a8bcb1cef3 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-13 18:06:04 +02:00
Samuele Locatelli ca749abe53 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-04-13 17:58:17 +02:00
Samuele Locatelli 2d366b5ac2 update conversione modelli Proj su DB 2021-04-13 17:58:08 +02:00
Emmanuele Sassi 95a70cb6d4 Modifica per Db 2021-04-13 17:21:07 +02:00
Emmanuele Sassi 1697185723 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-13 17:08:52 +02:00
Samuele Locatelli c04a38177a Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-04-13 17:05:43 +02:00
Samuele Locatelli ee872d762c Aggiunta metodi update Proj 2021-04-13 17:05:39 +02:00
Emmanuele Sassi 0560862d5f Correzione gestione solido della trave 2021-04-13 16:09:22 +02:00
Emmanuele Sassi 7b72f03b9b Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-12 18:23:19 +02:00
Samuele E. Locatelli bb2e666695 Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-04-12 17:24:55 +02:00
Samuele E. Locatelli 26b802c5ed Aggiornato file readme 2021-04-12 17:18:57 +02:00
Emmanuele Sassi 969eb267af Modifiche per gestione MachGroup nel programma 2021-04-12 16:35:59 +02:00
Emmanuele Sassi b6bced549f Modifiche core per gestione MachGroup 2021-04-12 16:35:18 +02:00
Emmanuele Sassi 463d4962e0 Dll aggiornate 2021-04-12 16:32:54 +02:00
Emmanuele Sassi ec4eb8adb5 Correzione gestione proj
Spostamento VM Machgroup
2021-04-06 09:59:46 +02:00
Emmanuele Sassi a5f05181c4 Spostamento eventi 2021-04-06 09:16:07 +02:00
Emmanuele Sassi 3dbd1b43ea Correioni scrittura dati Proj su Db 2021-04-05 16:08:16 +02:00
Emmanuele Sassi b8c8ec9e79 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-03 19:31:16 +02:00
Samuele Locatelli 07231a4bcf Aggiunto update globale x prod e proj 2021-04-03 19:27:27 +02:00
Samuele Locatelli d93f1fae04 Aggiunta conversione Part & MAchGroup da CORE 2021-04-03 18:55:27 +02:00
Samuele Locatelli b1994e504a Merge remote-tracking branch 'gitlab.steamware/feature/total_rebuild' into develop 2021-04-03 18:52:58 +02:00
Emmanuele Sassi 7e34c83653 Modifiche 2021-04-03 18:51:58 +02:00
Samuele Locatelli e1e388ff9d Aggiunto udpate x PartList 2021-04-03 18:46:09 +02:00
Samuele Locatelli 8a5a1997b3 Aggiunta DtStart & DtEnd su MachGroup e PartList 2021-04-03 18:44:10 +02:00
Samuele Locatelli a522044c12 upgrade BtlPart model x rimozione parametri inutilizzati 2021-04-03 17:32:21 +02:00
Emmanuele Sassi 6483a2812d RefreshDLL 2021-04-03 17:13:47 +02:00
Emmanuele Sassi 19d1344263 Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-03 17:03:25 +02:00
Samuele Locatelli b34580450f update helper views x startup rapido 2021-04-03 16:59:55 +02:00
Samuele Locatelli 5609e073bb Merge branch 'feature/AddLogModels' into develop 2021-04-03 16:32:32 +02:00
Samuele Locatelli 475a8299bd Update migrations e modelli dati x LOG 2021-04-03 16:31:59 +02:00
Emmanuele Sassi ac7d85ce9d Merge remote-tracking branch 'gitlab.seriate/develop' into feature/total_rebuild 2021-04-03 15:59:27 +02:00
Emmanuele Sassi 7e07024942 Correioni progetti 2021-04-03 15:59:03 +02:00
Samuele Locatelli 3dd82f8c16 Aggiunta modelli ed enum x LOGS 2021-04-03 15:49:32 +02:00
670 changed files with 69297 additions and 16899 deletions
+1
View File
@@ -327,3 +327,4 @@ _UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
.ionide/symbolCache.db
+121
View File
@@ -0,0 +1,121 @@
variables:
NUGET_PATH: 'C:\Tools\nuget.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
EXE_RELEASE_FOLDER: 'c:\Projetcs\Compiled\GPW\Release'
DEPLOY_FOLDER: 'c:\Projects\Deploy\GPW\Builds'
APP_NAME: 'EgtBEAMWALL'
APP_NAMEG: 'EgtBEAMWALL'
NEW_REL: ''
VERS_RD: 'Release'
ARCH: 'x86'
ARCH64: 'x64'
OUTPUT_DIR: ''
NET_SHARE: '\\10.74.82.201\Artifacts\EgtProg\EgtBEAMWALL'
NET_USER: 'steamw\steamware'
# helper x mount cartella Artifacts su truenas
.ReplicaCompiled: &ReplicaCompiled
- |
rm -Recurse Z:\$CI_COMMIT_BRANCH\$env:ARCH\*.*
rm -Recurse Z:\$CI_COMMIT_BRANCH\$env:ARCH\*.*
ROBOCOPY /E $env:APP_NAME\bin\$env:ARCH\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH /XF *.xml /XF *.pdb
ROBOCOPY /E $env:APP_NAME2\bin\$env:ARCH\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH /XF *.xml /XF *.pdb
SLEEP 2
net use Z: /delete
.ReplicaCompileds2: &ReplicaCompileds2
- |
ROBOCOPY /E $env:APP_NAME\bin\$env:ARCH64\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH64 /XF *.xml /XF *.pdb
ROBOCOPY /E $env:APP_NAME2\bin\$env:ARCH64\$env:VERS_RD Z:\$CI_COMMIT_BRANCH\$env:ARCH64 /XF *.xml /XF *.pdb
SLEEP 2
net use Z: /delete
.MakeFolderM: &MakeFolderM
- |
net use Z: /delete
new-item c:\EgtProg\EgtBEAMWALL -itemtype directory
net use Z: $env:NET_SHARE
.nuget-fix: &nuget-fix
- |
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
if ($hasSource -eq 0) {
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
} else {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
}
echo $hasSource
# helper creazione hash files
.hashBuild: &hashBuild
- |
$Target = "Releases\" + $CI_COMMIT_BRANCH + "\" + $env:APP_NAME + ".zip"
$MD5 = Get-FileHash $Target -Algorithm MD5
$SHA1 = Get-FileHash $Target -Algorithm SHA1
New-Item $Target".md5"
New-Item $Target".sha1"
$MD5.Hash | Set-Content -Path $Target".md5"
$SHA1.Hash | Set-Content -Path $Target".sha1"
echo "Created HASH files for $Target"
.cleanup-dir: &cleanup-dir
- |
rm $env:APP_NAME\bin\$env:ARCH\$env:VERS_RD\*.xml
rm $env:APP_NAME\bin\$env:ARCH\$env:VERS_RD\*.pdb
rm $env:APP_NAME\bin\$env:ARCH64\$env:VERS_RD\*.xml
rm $env:APP_NAME\bin\$env:ARCH64\$env:VERS_RD\*.pdb
stages:
- build
- deploy
X86:build:
stage: build
tags:
- win
only:
- main
- master
- develop
variables:
APP_NAME: EgtBEAMWALL.Supervisor
APP_NAME2: EgtBEAMWALL.ViewerOptimizer
VERS_RD: 'Release'
ARCH: 'x86'
ARCH64: 'x64'
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore EgtBEAMWALL.sln -verbosity quiet'
- *MakeFolderM
script:
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH" /p:OutputPath=bin/$env:ARCH/$env:VERS_RD/ /verbosity:minimal /m'
- '& "$env:MSBUILD_PATH" "$env:APP_NAME2\$env:APP_NAME2.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH" /p:OutputPath=bin/$env:ARCH/$env:VERS_RD/ /verbosity:minimal /m'
- *ReplicaCompiled
X64:build:
stage: build
tags:
- win
only:
- main
- master
- develop
variables:
APP_NAME: EgtBEAMWALL.Supervisor
APP_NAME2: EgtBEAMWALL.ViewerOptimizer
VERS_RD: 'Release'
ARCH: 'x86'
ARCH64: 'x64'
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore EgtBEAMWALL.sln -verbosity quiet'
- *MakeFolderM
script:
- '& "$env:MSBUILD_PATH" "$env:APP_NAME\$env:APP_NAME.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH64" /p:OutputPath=bin/$env:ARCH64/$env:VERS_RD/ /verbosity:minimal /m'
- '& "$env:MSBUILD_PATH" "$env:APP_NAME2\$env:APP_NAME2.vbproj" -target:Build /p:Configuration=$env:VERS_RD /p:Platform="$env:ARCH64" /p:OutputPath=bin/$env:ARCH64/$env:VERS_RD/ /verbosity:minimal /m'
- *ReplicaCompileds2
@@ -8,8 +8,8 @@ Imports EgtWPFLib5
Public Class BTLFeatureM
' Feature a cui appartiene il parametro
Protected m_ParentPart As BTLPartM
Public ReadOnly Property ParentPart As BTLPartM
Protected m_ParentPart As Object
Public ReadOnly Property ParentPart As Object
Get
Return m_ParentPart
End Get
@@ -171,20 +171,10 @@ Public Class BTLFeatureM
End Set
End Property
Protected m_nCALC_FALL As Integer
Public Property nCALC_FALL As Integer
Get
Return m_nCALC_FALL
End Get
Set(value As Integer)
m_nCALC_FALL = value
End Set
End Property
Protected m_sCALC_MSG As String
Public Property sCALC_MSG As String
Get
Return m_sCALC_MSG
Return MessageFromLuaMsg(m_sCALC_MSG)
End Get
Set(value As String)
m_sCALC_MSG = value
@@ -250,90 +240,81 @@ Public Class BTLFeatureM
Return New BTLFeatureM
End Function
Public Shared Function CreateBTLFeature(ParentPart As BTLPartM, nFeatureId As Integer) As BTLFeatureM
Public Shared Function CreateBTLFeature(ParentPart As Object, nFeatureId As Integer, Optional bIsBTL As Boolean = True) As BTLFeatureM
Dim NewBTLFeature As New BTLFeatureM
NewBTLFeature.m_ParentPart = ParentPart
NewBTLFeature.m_nFeatureId = nFeatureId
' leggo gruppo, numero feature e lato
EgtGetInfo(nFeatureId, BTL_FTR_GRP, NewBTLFeature.nSelGRP)
EgtGetInfo(nFeatureId, BTL_FTR_PRC, NewBTLFeature.nPRC)
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.nSelSIDE)
EgtGetInfo(nFeatureId, BTL_FTR_GRP, NewBTLFeature.m_nSelGRP)
EgtGetInfo(nFeatureId, BTL_FTR_PRC, NewBTLFeature.m_nPRC)
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, NewBTLFeature.m_nSelSIDE)
Dim nDO As Integer = 1
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
NewBTLFeature.bDO = (nDO <> 0)
NewBTLFeature.m_bDO = (nDO <> 0)
Else
NewBTLFeature.bDO = True
NewBTLFeature.m_bDO = True
End If
' leggo des,prid e frame
EgtGetInfo(nFeatureId, BTL_FTR_DES, NewBTLFeature.sDES)
EgtGetInfo(nFeatureId, BTL_FTR_PRID, NewBTLFeature.nPRID)
EgtGetInfo(nFeatureId, BTL_FTR_FRAME, NewBTLFeature.frFRAME)
' leggo calc error
Dim nErr As Integer = 0
Dim nRot As Integer = 0
Dim nFall As Integer = 0
Dim sMsg As String = ""
Dim bCalc As Boolean = False
bCalc = EgtGetInfo(NewBTLFeature.nFeatureId, ITG_PROJ_ERR, nErr)
EgtGetInfo(nFeatureId, ITG_PROJ_ROT, nRot)
EgtGetInfo(nFeatureId, ITG_PROJ_FALL, nFall)
EgtGetInfo(nFeatureId, ITG_PROJ_MSG, sMsg)
If Not bCalc Then
NewBTLFeature.nState = CalcStates.NOTCALCULATED
NewBTLFeature.nCALC_ERR = 0
NewBTLFeature.nCALC_ROT = 0
NewBTLFeature.nCALC_FALL = 0
NewBTLFeature.sCALC_MSG = ""
Else
NewBTLFeature.nCALC_ERR = nErr
NewBTLFeature.nCALC_ROT = nRot
NewBTLFeature.nCALC_FALL = nFall
NewBTLFeature.sCALC_MSG = sMsg
If nErr = 0 Then
NewBTLFeature.nState = 0
ElseIf nErr > 1 Then
NewBTLFeature.nState = 1
ElseIf nErr < 1 Then
NewBTLFeature.nState = -1
End If
End If
EgtGetInfo(nFeatureId, BTL_FTR_DES, NewBTLFeature.m_sDES)
EgtGetInfo(nFeatureId, BTL_FTR_PRID, NewBTLFeature.m_nPRID)
EgtGetInfo(nFeatureId, BTL_FTR_FRAME, NewBTLFeature.m_frFRAME)
' leggo parametri della feature
GetBeamPrivateProfileGRPList(CalcBeamPrivateProfileGRP(NewBTLFeature.nSelGRP), NewBTLFeature.nPRC, NewBTLFeature.GRPList)
GetBeamPrivateProfileName(NewBTLFeature.nSelGRP, NewBTLFeature.nPRC, NewBTLFeature)
GetBeamPrivateProfileGRPList(CalcBeamPrivateProfileGRP(NewBTLFeature.m_nSelGRP), NewBTLFeature.m_nPRC, NewBTLFeature.m_GRPList)
GetBeamPrivateProfileName(NewBTLFeature.m_nSelGRP, NewBTLFeature.m_nPRC, NewBTLFeature)
' crea parametri per questa feature da file ini
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
' leggo parametri delle feature
NewBTLFeature.ReadFeatureParams()
' leggo calc error
Dim nErr As Integer = 0
Dim nRot As Integer = 0
Dim sMsg As String = ""
Dim bCalc As Boolean = False
If bIsBTL Then
bCalc = EgtGetInfo(NewBTLFeature.nFeatureId, ITG_PROJ_ERR, nErr)
EgtGetInfo(nFeatureId, ITG_PROJ_ROT, nRot)
EgtGetInfo(nFeatureId, ITG_PROJ_MSG, sMsg)
Else
bCalc = EgtGetInfo(NewBTLFeature.nFeatureId, ITG_PROD_ERR, nErr)
EgtGetInfo(nFeatureId, ITG_PROD_ROT, nRot)
EgtGetInfo(nFeatureId, ITG_PROD_MSG, sMsg)
End If
If Not bCalc Then
NewBTLFeature.m_nState = CalcStates.NOTCALCULATED
NewBTLFeature.m_nCALC_ERR = 0
NewBTLFeature.m_nCALC_ROT = 0
NewBTLFeature.m_sCALC_MSG = ""
Else
NewBTLFeature.m_nCALC_ERR = nErr
NewBTLFeature.m_nCALC_ROT = nRot
NewBTLFeature.m_sCALC_MSG = sMsg
Select Case nErr
Case 0
NewBTLFeature.nState = CalcStates.OK
Case 22
NewBTLFeature.nState = CalcStates.COLLISION
Case 17, 19
NewBTLFeature.nState = CalcStates.WARNING
Case < 0
NewBTLFeature.nState = CalcStates.INFO
Case > 0
NewBTLFeature.nState = CalcStates.ERROR_
End Select
End If
Return NewBTLFeature
End Function
Public Shared Function CreateBTLFeature(nPRC As Integer, nGRP As Integer, nSIDE As Integer) As BTLFeatureM
Dim NewBTLFeature As New BTLFeatureM
NewBTLFeature.nPRC = nPRC
NewBTLFeature.nSelGRP = nGRP
NewBTLFeature.nSelSIDE = nSIDE
NewBTLFeature.bDO = True
NewBTLFeature.m_nPRC = nPRC
NewBTLFeature.m_nSelGRP = nGRP
NewBTLFeature.m_nSelSIDE = nSIDE
NewBTLFeature.m_bDO = True
' crea parametri per questa feature da file ini
NewBTLFeature.CreateFeatureParams(NewBTLFeature)
Return NewBTLFeature
End Function
'Sub New(ParentPart As BTLPartM, nFeatureId As Integer)
' m_ParentPart = ParentPart
' m_nFeatureId = nFeatureId
' m_PParamList = New ObservableCollection(Of BTLParam)
' m_QParamList = New ObservableCollection(Of BTLParam)
'End Sub
'Sub New(nPRC As Integer, nGRP As Integer, nSIDE As Integer)
' m_PParamList = New ObservableCollection(Of BTLParam)
' m_QParamList = New ObservableCollection(Of BTLParam)
' m_nPRC = nPRC
' m_nSelGRP = nGRP
' m_nSelSIDE = nSIDE
' m_bDO = True
'End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
@@ -389,27 +370,93 @@ Public Class BTLFeatureM
Return ReadFeatureParams(m_PBTLParamMList) And ReadFeatureParams(m_QBTLParamMList)
End Function
Private Function ReadFeatureParams(ParamList As List(Of BTLParamM)) As Boolean
Dim bToRecalc As Boolean = False
' leggo valore parametro da struttura geometrica
For Each Param As BTLParamM In ParamList
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
Dim dParamValue As Double = 0
If Not EgtGetInfo(m_nFeatureId, Param.sName, dParamValue) Then
Dim sReadName As String = Param.sName
If IsFreeContour() Then
Select Case Param.sName
Case "P05"
sReadName = "DEPTH"
Case "P07"
sReadName = "PCKT"
Case "P13"
sReadName = "CNT_TYPE"
Case "P14"
sReadName = "CNT_DATA"
Case "P15"
sReadName = "CNT_PAR"
End Select
End If
If Not EgtGetInfo(m_nFeatureId, sReadName, dParamValue) Then
dParamValue = 0
End If
Param.dValue = dParamValue
' se è un parametro P setto il valore letto nel DB
If Param.bIsP Then
Param.SetValue(dParamValue)
Else
' recupero info Custom
Dim nCustom As Integer = 0
EgtGetInfo(nFeatureId, Param.sName & "A", nCustom)
'se pezzo parent di tipo Part
If TypeOf m_ParentPart Is PartM Then
Param.SetValue(dParamValue)
' se è un parametro Q verifico nel progetto se sia un valore custom
ElseIf nCustom = 1 Then
Param.SetValue(dParamValue)
Param.bCustom = True
' altrimenti lo setto al valore di default
Else
Param.SetValue(Param.dDefault)
Dim dReadValue As Double = 0
EgtGetInfo(m_nFeatureId, Param.sName, dReadValue)
If dReadValue <> Param.dDefault Then
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr
EgtSetInfo(m_nFeatureId, Param.sName, Param.dDefault)
'se pezzo parent di tipo BTL
If TypeOf m_ParentPart Is BTLPartM AndAlso m_bDO Then
Dim BTLPartM As BTLPartM = DirectCast(m_ParentPart, BTLPartM)
EgtRemoveInfo(BTLPartM.m_nPartId, ITG_PROJ_ERR)
EgtRemoveInfo(BTLPartM.m_nPartId, ITG_PROJ_MSG)
EgtRemoveInfo(BTLPartM.m_nPartId, ITG_PROJ_FALL)
EgtRemoveInfo(BTLPartM.m_nPartId, ITG_PROJ_ROT)
'EgtDuploSetModified(DirectCast(m_ParentPart, BTLPartM).m_nPartId)
End If
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
bToRecalc = True
End If
Param.bCustom = False
End If
End If
ElseIf Param.nType = BTLParamType.STRING_ Then
Dim sParamValue As String = String.Empty
EgtGetInfo(m_nFeatureId, Param.sName, sParamValue)
Param.sValue = sParamValue
Param.SetValue(sParamValue)
ElseIf Param.nType = BTLParamType.COMBO Then
Dim nParamValue As Integer
EgtGetInfo(m_nFeatureId, Param.sName, nParamValue)
Param.nSelValue = nParamValue
End If
Next
Return False
' Se necessario ricalcolo, lo eseguo
If Not IsFreeContour() And bToRecalc Then
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr
UpdateParams()
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
End If
Return True
End Function
' funzione che rilegge i parametri Q
Public Function ReadQValues()
Return ReadFeatureParams(m_QBTLParamMList)
End Function
' funzione che setta i valori di default a tutti i parametri
Public Function SetDefaultValues() As Boolean
Return SetDefaultValues(m_PBTLParamMList) And SetDefaultValues(m_QBTLParamMList)
@@ -418,9 +465,9 @@ Public Class BTLFeatureM
' leggo valore parametro da struttura geometrica
For Each Param As BTLParamM In ParamList
If Param.nType = BTLParamType.DOUBLE_ Or Param.nType = BTLParamType.LENGTH Then
Param.dValue = Param.dDefault
Param.SetValue(Param.dDefault)
ElseIf Param.nType = BTLParamType.STRING_ Then
Param.sValue = ""
Param.SetValue(Param.sDefault)
ElseIf Param.nType = BTLParamType.COMBO Then
Param.nSelValue = Param.dDefault
End If
@@ -429,55 +476,84 @@ Public Class BTLFeatureM
End Function
' funzione che calcola array dei valori dei parametri
Public Function CalcParamArray(ByRef vPar() As Double, ByRef sPar As String) As Boolean
Public Function CalcParamArray(ByRef vPar() As Double, ByRef sPar As String, ByRef vParQ() As String) As Boolean
' verifico che lista parametri non sia vuota
If IsNothing(m_PBTLParamMList) OrElse m_PBTLParamMList.Count = 0 Then Return False
' caclcolo lunghezza array
Dim nLastParId As Integer = m_PBTLParamMList(m_PBTLParamMList.Count - 1).nId - 1
Dim vTempPar(nLastParId) As Double
Dim sTempPar As String = String.Empty
' carico tutti i parametri su array
For ParIndex = 0 To m_PBTLParamMList.Count - 1
Dim BTLPar As BTLParamM = DirectCast(m_PBTLParamMList(ParIndex), BTLParamM)
Select Case BTLPar.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
vTempPar(BTLPar.nId - 1) = BTLPar.dValue
Case BTLParamType.STRING_
sTempPar = BTLPar.sValue
'Case BTLParamType.COMBO
' Dim cBTLPar As BTLParamCombo = DirectCast(ParentFeature.PParamList(ParIndex), BTLParamCombo)
' vPar(ParIndex) = cBTLPar.
End Select
Next
vPar = vTempPar
If String.IsNullOrEmpty(sTempPar) Then
sPar = " "
Else
sPar = sTempPar
If Not IsNothing(m_PBTLParamMList) AndAlso m_PBTLParamMList.Count > 0 Then
' calcolo lunghezza array Parametri
Dim nLastParId As Integer = m_PBTLParamMList(m_PBTLParamMList.Count - 1).nId - 1
Dim vTempPar(nLastParId) As Double
Dim sTempPar As String = String.Empty
' carico tutti i parametri su array
For ParIndex = 0 To m_PBTLParamMList.Count - 1
Dim BTLPar As BTLParamM = DirectCast(m_PBTLParamMList(ParIndex), BTLParamM)
Select Case BTLPar.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
vTempPar(BTLPar.nId - 1) = BTLPar.dValue
Case BTLParamType.STRING_
sTempPar = BTLPar.sValue
'Case BTLParamType.COMBO
' Dim cBTLPar As BTLParamCombo = DirectCast(ParentFeature.PParamList(ParIndex), BTLParamCombo)
' vPar(ParIndex) = cBTLPar.
End Select
Next
vPar = vTempPar
sPar = If(String.IsNullOrEmpty(sTempPar), " ", sTempPar)
End If
' Determino parametri Q
Dim vTempParQ(m_QBTLParamMList.Count) As String
For ParQIndex = 0 To m_QBTLParamMList.Count - 1
Dim ParQ As BTLParamM = m_QBTLParamMList(ParQIndex)
vTempParQ(ParQIndex) = ParQ.sName & ":" & If(ParQ.nType <> BTLParamType.STRING_, DoubleToString(ParQ.dValue, 3), ParQ.sValue)
Next
Dim sDO As String = ""
If Not bDO Then sDO = 0
vTempParQ(m_QBTLParamMList.Count) = "DO:" & sDO
vParQ = vTempParQ
Return True
End Function
' funzione che aggiorna parametri della feature
Public Function UpdateParams(nNewGRP As Integer, nNewPRC As Integer, nNewSIDE As Integer, sNewDesc As String, nNewProcId As Integer,
frNewRef As Frame3d, vNewPar() As Double, sNewPar As String) As Boolean
' aggiorno la feature con nuovo valore
Dim vPar() As Double = Nothing
frNewRef As Frame3d, vNewParP() As Double, sNewPar As String, vNewParQ As String(), Optional bUpdate As Boolean = True) As Boolean
' Recupero parametri originali della feature
Dim vPar() As Double = {}
Dim sPar As String = String.Empty
CalcParamArray(vPar, sPar)
Dim vParQ() As String = {}
CalcParamArray(vPar, sPar, vParQ)
' recupero eventuali percorsi originali della feature
Dim nCrvId As Integer = GDB_ID.NULL
Dim nCrv2Id As Integer = GDB_ID.NULL
GetFreeContourPaths(nCrvId, nCrv2Id)
' modifica della feature con i nuovi parametri
Dim nFeatureId As Integer = EgtBeamModifyProcess(Me.nFeatureId, nNewGRP, nNewPRC, nNewSIDE, sNewDesc, nNewProcId,
frNewRef, vNewPar, sNewPar)
If nFeatureId <> GDB_ID.NULL Then
frNewRef, vNewParP, sNewPar, vNewParQ, nCrvId, nCrv2Id, bUpdate)
Dim bOk As Boolean = nFeatureId <> GDB_ID.NULL
If bOk Then
' riporto parametri Q custom
For Each QPar In QBTLParamMList
If QPar.bCustom Then EgtSetInfo(nFeatureId, QPar.sName & "A", 1)
Next
SetFeatureId(nFeatureId)
' imposto modificato per copie
EgtDuploSetModified(ParentPart.nPartId)
Return True
bOk = True
Else
MessageBox.Show("Impossible create feature with this values", "Error")
nFeatureId = EgtBeamModifyProcess(Me.nFeatureId, Me.nSelGRP, Me.nPRC, Me.nSelSIDE, "", Me.nPRID, New Frame3d(), vPar, sPar)
' Impossibile creare una feature con questi valori - ERRORE
MessageBox.Show(EgtMsg(61852), EgtMsg(30007))
nFeatureId = EgtBeamModifyProcess(Me.nFeatureId, Me.nSelGRP, Me.nPRC, Me.nSelSIDE, "", Me.nPRID,
New Frame3d(), vPar, sPar, vParQ, nCrvId, nCrv2Id)
SetFeatureId(nFeatureId)
Return False
bOk = False
End If
Return bOk
End Function
Public Function UpdateParams(Optional bUpdate As Boolean = True) As Boolean
' aggiorno la feature con nuovo valore
Dim vPar() As Double = {}
Dim sPar As String = String.Empty
Dim vParQ() As String = {}
CalcParamArray(vPar, sPar, vParQ)
Return UpdateParams(Me.nSelGRP, Me.nPRC, Me.nSelSIDE, Me.sDES, Me.nPRID, Me.frFRAME, vPar, sPar, vParQ, bUpdate)
End Function
' funzione che restituisce se la feature è un contorno libero
@@ -485,6 +561,30 @@ Public Class BTLFeatureM
Return m_nPRC = 250 OrElse m_nPRC = 251 OrElse m_nPRC = 252
End Function
' funzione che restituisce i percorsi associati ai contorni liberi
Public Function GetFreeContourPaths(ByRef nCrvId As Integer, ByRef nCrv2Id As Integer) As Boolean
' imposto eventuali percorsi
nCrvId = GDB_ID.NULL
nCrv2Id = GDB_ID.NULL
If IsFreeContour() Then
Dim sAuxId As String = ""
If EgtGetInfo(nFeatureId, "AUXID", sAuxId) Then
Dim sAuxIdSplit() As String = sAuxId.Split(","c)
Dim nAuxId As Integer
If Integer.TryParse(sAuxIdSplit(0), nAuxId) Then
nCrvId = nFeatureId + nAuxId
Dim nAux2Id As Integer
If sAuxIdSplit.Count > 1 Then
If Integer.TryParse(sAuxIdSplit(1), nAux2Id) Then
nCrv2Id = nFeatureId + nAux2Id
End If
End If
End If
End If
End If
Return True
End Function
#End Region ' METHODS
End Class
@@ -7,7 +7,6 @@ Imports EgtWPFLib5
Public Class BTLParamM
' parametro che dice se il parametro e' P o Q
Protected m_bIsP As Boolean = True
Public ReadOnly Property bIsP As Boolean
@@ -16,6 +15,17 @@ Public Class BTLParamM
End Get
End Property
' parametro che dice se il parametro e' stato modificato
Protected m_bIsModified As Boolean
Public Property bIsModified As Boolean
Get
Return m_bIsModified
End Get
Set(value As Boolean)
m_bIsModified = value
End Set
End Property
' parametri da struttura
Protected m_sName As String
Public Property sName As String
@@ -82,6 +92,10 @@ Public Class BTLParamM
m_dValue = value
End Set
End Property
Public Sub SetValue(value As Double)
m_dValue = value
End Sub
Protected m_sValue As String
Public Overridable Property sValue As String
Get
@@ -91,6 +105,9 @@ Public Class BTLParamM
m_sValue = value
End Set
End Property
Public Sub SetValue(value As String)
m_sValue = value
End Sub
Protected m_nSelValue As Integer
Public Property nSelValue As Integer
@@ -103,10 +120,23 @@ Public Class BTLParamM
End Property
Protected m_dDefault As Double
Public ReadOnly Property dDefault As Double
Public Property dDefault As Double
Get
Return m_dDefault
End Get
Set(value As Double)
m_dDefault = value
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
@@ -116,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
@@ -125,6 +158,26 @@ Public Class BTLParamM
End Get
End Property
Protected m_bCustom As Boolean
Public Property bCustom As Boolean
Get
Return m_bCustom
End Get
Set(value As Boolean)
m_bCustom = value
End Set
End Property
Protected m_sBWType As String
Public Property sBWType As String
Get
Return m_sBWType
End Get
Set(value As String)
m_sBWType = value
End Set
End Property
#Region "MESSAGES"
Public ReadOnly Property Name_Msg As String
@@ -191,10 +244,33 @@ Public Class BTLParamM
Return NewBTLParam
End Function
' new per double e length (con tipo Beam o Wall)
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String,
dMin As Double, dMax As Double, dDefault As Double, sDescription As String, sBWType As String) As BTLParamM
Dim NewBTLParam As New BTLParamM
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
NewBTLParam.dMin = dMin
NewBTLParam.dMax = dMax
NewBTLParam.m_dDefault = dDefault
NewBTLParam.m_sBWType = sBWType
Return NewBTLParam
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, 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
@@ -209,6 +285,18 @@ Public Class BTLParamM
Return NewBTLParam
End Function
' new per combobox (con tipo Beam o Wall)
Public Shared Function CreateBTLParam(ParentFeature As BTLFeatureM, IsP As Boolean, nType As BTLParamType, sParamName As String, nMin As Integer, nMax As Integer, nDefault As Integer, sDescription As String, ValueList As List(Of String), sBWType As String)
Dim NewBTLParam As New BTLParamM
NewBTLParam.StdInit(ParentFeature, IsP, nType, sParamName, sDescription)
NewBTLParam.dMin = nMin
NewBTLParam.dMax = nMax
NewBTLParam.m_dDefault = nDefault
NewBTLParam.m_ValueList = ValueList
NewBTLParam.m_sBWType = sBWType
Return NewBTLParam
End Function
' new per parametro vuoto
Public Shared Function CreateBTLParam(IsP As Boolean, nType As BTLParamType, sParamName As String)
Dim NewBTLParam As New BTLParamM
@@ -56,33 +56,33 @@ Public Class BTLPartM
End Set
End Property
Public m_dL As Double
Public Property dL As Double
Public m_dBtlL As Double
Public Property dBtlL As Double
Get
Return m_dL
Return m_dBtlL
End Get
Set(value As Double)
m_dL = value
m_dBtlL = value
End Set
End Property
Public m_dW As Double
Public Property dW As Double
Public m_dBtlW As Double
Public Property dBtlW As Double
Get
Return m_dW
Return m_dBtlW
End Get
Set(value As Double)
m_dW = value
m_dBtlW = value
End Set
End Property
Public m_dH As Double
Public Property dH As Double
Public m_dBtlH As Double
Public Property dBtlH As Double
Get
Return m_dH
Return m_dBtlH
End Get
Set(value As Double)
m_dH = value
m_dBtlH = value
End Set
End Property
@@ -548,6 +548,18 @@ Public Class BTLPartM
#End Region ' Parametri pezzo
' volume del pezzo
Private m_dVolume As Double
Public Property dVolume As Double
Get
Return m_dVolume
End Get
Set(value As Double)
m_dVolume = value
End Set
End Property
' numero di pezzi da fare da BTL
Public m_nCNT As Integer
Public Property nCNT As Integer
Get
@@ -558,6 +570,39 @@ Public Class BTLPartM
End Set
End Property
' numero di pezzi aggiunti (da fare in piu' rispetto a CNT)
Public m_nADDED As Integer
Public Property nADDED As Integer
Get
Return m_nADDED
End Get
Set(value As Integer)
If EgtSetInfo(nPartId, BTL_PRT_ADDED, value) Then
m_nADDED = value
End If
End Set
End Property
' numero di pezzi inseriti nelle barre (in PROD), quindi numero di duplo del pezzo
Public ReadOnly Property nINPROD As Integer
Get
Dim INPROD As Integer = 0
EgtDuploCount(m_nPartId, INPROD)
Return INPROD
End Get
End Property
' numero di pezzi gia' prodotti
Public m_nDONE As Integer
Public Property nDONE As Integer
Get
Return m_nDONE
End Get
Set(value As Integer)
m_nDONE = value
End Set
End Property
Private m_nINVERTED As Integer
Public Property nINVERTED As Integer
Get
@@ -568,6 +613,16 @@ Public Class BTLPartM
End Set
End Property
Private m_bLockInversion As Boolean = False
Public Property bLockInversion As Boolean
Get
Return m_bLockInversion
End Get
Set(value As Boolean)
m_bLockInversion = value
End Set
End Property
Private m_nROTATED As Integer
Public Property nROTATED As Integer
Get
@@ -578,6 +633,16 @@ Public Class BTLPartM
End Set
End Property
Private m_bLockRotation As Boolean = False
Public Property bLockRotation As Boolean
Get
Return m_bLockRotation
End Get
Set(value As Boolean)
m_bLockRotation = value
End Set
End Property
Private m_nCALC_ERR As Integer
Public Property nCALC_ERR As Integer
Get
@@ -601,7 +666,7 @@ Public Class BTLPartM
Private m_sCALC_MSG As String
Public Property sCALC_MSG As String
Get
Return m_sCALC_MSG
Return MessageFromLuaMsg(m_sCALC_MSG)
End Get
Set(value As String)
m_sCALC_MSG = value
@@ -638,6 +703,26 @@ Public Class BTLPartM
End Set
End Property
Private m_nFeaturesGlobalState As CalcStates
Public Property nFeaturesGlobalState As CalcStates
Get
Return m_nFeaturesGlobalState
End Get
Set(value As CalcStates)
m_nFeaturesGlobalState = value
End Set
End Property
Private m_nCALC_GlobalERR As Integer
Public Property nCALC_GlobalERR As Integer
Get
Return m_nCALC_GlobalERR
End Get
Set(value As Integer)
m_nCALC_GlobalERR = value
End Set
End Property
Public m_nState As CalcStates = -1
Public Property nState As CalcStates
Get
@@ -675,7 +760,7 @@ Public Class BTLPartM
Dim sValArray() As String
Dim sValue As String = String.Empty
Dim nValue As Integer = 0
EgtGetInfo(nPartId, BTL_PRT_PDN, NewBTLPart.nPDN)
EgtGetInfo(nPartId, BTL_PRT_PDN, NewBTLPart.m_nPDN)
Dim nDO As Integer = 1
If EgtGetInfo(nPartId, BTL_PRT_DO, nDO) Then
NewBTLPart.m_bDO = (nDO <> 0)
@@ -683,10 +768,11 @@ Public Class BTLPartM
NewBTLPart.m_bDO = True
End If
EgtGetInfo(nPartId, BTL_PRT_NAM, NewBTLPart.m_sNAM)
EgtGetInfo(nPartId, BTL_PRT_L, NewBTLPart.m_dL)
EgtGetInfo(nPartId, BTL_PRT_W, NewBTLPart.m_dW)
EgtGetInfo(nPartId, BTL_PRT_H, NewBTLPart.m_dH)
EgtGetInfo(nPartId, BTL_PRT_L, NewBTLPart.m_dBtlL)
EgtGetInfo(nPartId, BTL_PRT_W, NewBTLPart.m_dBtlW)
EgtGetInfo(nPartId, BTL_PRT_H, NewBTLPart.m_dBtlH)
EgtGetInfo(nPartId, BTL_PRT_CNT, NewBTLPart.m_nCNT)
EgtGetInfo(nPartId, BTL_PRT_ADDED, NewBTLPart.m_nADDED)
EgtGetInfo(nPartId, BTL_PRT_ASSEMBLYNUM, NewBTLPart.m_sASSEMBLYNUM)
EgtGetInfo(nPartId, BTL_PRT_ORDERNUM, NewBTLPart.m_nORDERNUM)
EgtGetInfo(nPartId, BTL_PRT_DESIGNATION, NewBTLPart.m_sDESIGN)
@@ -711,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
@@ -727,12 +813,12 @@ Public Class BTLPartM
ind = ind + 1
End While
EgtGetInfo(nPartId, BTL_PRT_CAMBER, sValue)
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 5 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)
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 10 Then
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")
@@ -742,12 +828,12 @@ Public Class BTLPartM
End If
EgtGetInfo(nPartId, BTL_PRT_PARTOFFSET, sValue)
sValArray = sValue.Split(New String() {": ", " P"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 5 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)
sValArray = sValue.Split(New String() {":", "P"}, StringSplitOptions.RemoveEmptyEntries)
If sValArray.Count() >= 10 Then
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")
@@ -757,14 +843,36 @@ Public Class BTLPartM
NewBTLPart.ocREFSIDEFIXCLAMP)
End If
Dim EnumIndex As Integer = 0
EgtGetInfo(nPartId, BTL_PRT_PROCESSINGQUALITY, sValue)
NewBTLPart.m_SelPROCESSINGQUALITY = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, NewBTLPart.ocPROCESSINGQUALITY),
NewBTLPart.ocPROCESSINGQUALITY)
For ind = 1 To NewBTLPart.ocPROCESSINGQUALITY.Count
Dim sEnumName = [Enum].GetName(GetType(ProcessingQuality), ind)
If sEnumName.Equals(sValue) Then
EnumIndex = ind
Exit For
End If
Next
NewBTLPart.m_SelPROCESSINGQUALITY = EnumIndex - 1
EgtGetInfo(nPartId, BTL_PRT_RECESS, sValue)
NewBTLPart.m_SelRECESS = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, NewBTLPart.ocRECESS), NewBTLPart.ocRECESS)
EnumIndex = 0
For ind = 1 To NewBTLPart.ocRECESS.Count
Dim sEnumName = [Enum].GetName(GetType(Recess), ind)
If sEnumName.Equals(sValue) Then
EnumIndex = ind
Exit For
End If
Next
NewBTLPart.m_SelRECESS = EnumIndex - 1
EgtGetInfo(nPartId, BTL_PRT_STOREYTYPE, sValue)
NewBTLPart.m_SelSTOREYTYPE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, NewBTLPart.ocSTOREYTYPE),
NewBTLPart.ocSTOREYTYPE)
EnumIndex = 0
For ind = 1 To NewBTLPart.ocSTOREYTYPE.Count
Dim sEnumName = [Enum].GetName(GetType(StoreyType), ind)
If sEnumName.Equals(sValue) Then
EnumIndex = ind
Exit For
End If
Next
NewBTLPart.m_SelSTOREYTYPE = EnumIndex - 1
EgtGetInfo(nPartId, BTL_PRT_ELEMENTNUM, NewBTLPart.m_sELEMENTNUM)
EgtGetInfo(nPartId, BTL_PRT_LAYER, NewBTLPart.m_nLAYER)
EgtGetInfo(nPartId, BTL_PRT_MODULENUM, NewBTLPart.m_sMODULENUM)
@@ -775,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
@@ -813,8 +921,14 @@ Public Class BTLPartM
If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, NewBTLPart.m_nINVERTED) Then
NewBTLPart.m_nINVERTED = 0
End If
If EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewBTLPart.m_sMATERIAL) Then
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewBTLPart.m_sMATERIAL)
If Not EgtGetInfo(nPartId, LOCK_ROT, NewBTLPart.m_bLockRotation) Then
NewBTLPart.m_bLockRotation = False
End If
If Not EgtGetInfo(nPartId, LOCK_FLIP, NewBTLPart.m_bLockInversion) Then
NewBTLPart.m_bLockInversion = False
End If
EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewBTLPart.m_dVolume)
' Leggo outline e features
NewBTLPart.m_BTLFeatureMList = LoadFeatures(nPartId, NewBTLPart)
' leggo calc error
@@ -828,24 +942,30 @@ Public Class BTLPartM
EgtGetInfo(nPartId, ITG_PROJ_FALL, nFall)
EgtGetInfo(nPartId, ITG_PROJ_MSG, sMsg)
If Not bCalc Then
NewBTLPart.nState = CalcStates.NOTCALCULATED
NewBTLPart.nCALC_ERR = -1
NewBTLPart.nCALC_ROT = 0
NewBTLPart.nCALC_FALL = 0
NewBTLPart.sCALC_MSG = ""
NewBTLPart.m_nState = CalcStates.NOTCALCULATED
NewBTLPart.m_nCALC_ERR = 0
NewBTLPart.m_nCALC_ROT = 0
NewBTLPart.m_nCALC_FALL = 0
NewBTLPart.m_sCALC_MSG = ""
Else
NewBTLPart.nCALC_ERR = nErr
NewBTLPart.nCALC_ROT = nRot
NewBTLPart.nCALC_FALL = nFall
NewBTLPart.sCALC_MSG = sMsg
If nErr = 0 Then
NewBTLPart.nState = CalcStates.OK
ElseIf nErr > 1 Then
NewBTLPart.nState = CalcStates.ERROR_
ElseIf nErr < 1 Then
NewBTLPart.nState = CalcStates.NOTCALCULATED
End If
NewBTLPart.m_nCALC_ERR = nErr
NewBTLPart.m_nCALC_ROT = nRot
NewBTLPart.m_nCALC_FALL = nFall
NewBTLPart.m_sCALC_MSG = sMsg
Select Case nErr
Case 0
NewBTLPart.nState = CalcStates.OK
Case 22
NewBTLPart.nState = CalcStates.COLLISION
Case 17, 19
NewBTLPart.nState = CalcStates.WARNING
Case < 0
NewBTLPart.nState = CalcStates.INFO
Case > 0
NewBTLPart.nState = CalcStates.ERROR_
End Select
End If
EgtGetInfo(nPartId, ITG_PROJ_TIME, NewBTLPart.m_nCALC_TIME)
Return NewBTLPart
End Function
@@ -869,9 +989,12 @@ Public Class BTLPartM
While nFeatureId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nFeatureId, BTL_FTR_MAINID) Then
' creo la feature
TempList.Add(BTLFeatureM.CreateBTLFeature(NewBTLPart, nFeatureId))
Dim NewFeature As BTLFeatureM = BTLFeatureM.CreateBTLFeature(NewBTLPart, nFeatureId)
TempList.Add(NewFeature)
' aggiorno Id feature perchè potrebbe essere stata ricalcolata
nFeatureId = NewFeature.nFeatureId
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
@@ -921,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
@@ -940,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")
@@ -955,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")
@@ -982,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
@@ -1087,6 +1210,75 @@ Public Class BTLPartM
Return New List(Of BTLFeatureM)(m_BTLFeatureMList)
End Function
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
EgtGetBBoxGlob(nLs, GDB_BB.STANDARD, b3Solid)
If b3Solid.IsEmpty() Then
EgtOutLog("ERROR: Box non definito per la trave " & sNAM)
Return False
End If
' eseguo rotazione di 90 gradi attorno asse X
Dim dRot = If(IsPositive, 1, -1) * Math.Abs(dAng)
Dim vtAxes As Vector3d
' se travi ruoto attorno all'asse X
If SelectedMachineType = MachineType.BEAM Then
vtAxes = Vector3d.X_AX
' se pareti ruoto attorno all'asse Z
ElseIf SelectedMachineType = MachineType.WALL Then
vtAxes = -Vector3d.Z_AX
End If
' se invertito
Dim bInverted As Boolean = m_nINVERTED <> 0
If bInverted Then
' annullo inversione
Inversion(SelectedMachineType)
End If
' eseguo rotazione
Dim bOk As Boolean = EgtRotate(nPartId, b3Solid.Center, vtAxes, dRot, GDB_RT.GLOB)
If bOk Then
Dim dNewRotation As Double = (m_nROTATED + dRot) Mod 360
m_nROTATED = If(dNewRotation >= 0, dNewRotation, 360 + dNewRotation)
EgtSetInfo(nPartId, BTL_PRT_ROTATED, m_nROTATED)
' imposto modificato per copie
EgtDuploSetModified(nPartId)
End If
' se era invertito
If bInverted Then
' ripristino inversione
Inversion(SelectedMachineType)
End If
If bRedraw Then EgtDraw()
Return bOk
End Function
Public Sub Inversion(SelectedMachineType As MachineType)
' recupero il box del pezzo
Dim nLs As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
Dim b3Solid As New BBox3d
EgtGetBBoxGlob(nLs, GDB_BB.STANDARD, b3Solid)
If b3Solid.IsEmpty() Then
EgtOutLog("ERROR: Box non definito per la trave " & sNAM)
Return
End If
Dim vtAxes As Vector3d
' se travi ruoto attorno all'asse Z
If SelectedMachineType = MachineType.BEAM Then
vtAxes = Vector3d.Z_AX
' se pareti ruoto attorno all'asse X
ElseIf SelectedMachineType = MachineType.WALL Then
vtAxes = Vector3d.X_AX
End If
' eseguo rotazione di 180 gradi
If EgtRotate(nPartId, b3Solid.Center, vtAxes, 180, GDB_RT.GLOB) Then
m_nINVERTED = If(m_nINVERTED = 0, 180, 0)
EgtSetInfo(nPartId, BTL_PRT_INVERTED, m_nINVERTED)
' imposto modificato per copie
EgtDuploSetModified(nPartId)
End If
End Sub
Public Function NewProcId() As Integer
Dim nMaxProcId As Integer = 0
If Not IsNothing(BTLFeatureMList) AndAlso BTLFeatureMList.Count > 0 Then
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLStructureM
@@ -10,6 +11,13 @@ Public Class BTLStructureM
End Get
End Property
Private m_nAsseBaseId As Integer = GDB_ID.NULL
Public ReadOnly Property nAsseBaseId As Integer
Get
Return m_nAsseBaseId
End Get
End Property
' pezzi da BTL
Public m_BTLPartMList As List(Of BTLPartM)
Public Property BTLPartMList As List(Of BTLPartM)
@@ -66,6 +74,16 @@ Public Class BTLStructureM
End Set
End Property
Public m_nPROJTYPE As Integer
Public Property nPROJTYPE As Integer
Get
Return m_nPROJTYPE
End Get
Set(value As Integer)
m_nPROJTYPE = value
End Set
End Property
Public m_sLISTNAME As String
Public Property sLISTNAME As String
Get
@@ -356,14 +374,44 @@ Public Class BTLStructureM
Return New BTLStructureM
End Function
Public Shared Function CreateBTLStructure() As BTLStructureM
Public Shared Function CreateBTLStructure(ProjId As Integer) As BTLStructureM
Dim NewBTLStructure As New BTLStructureM
Dim sValue As String = String.Empty
NewBTLStructure.m_nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
' se devo filtrare un progetto
If ProjId > 0 Then
' cerco tra i layer BTLInfo
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
While nBTLInfoLayerId <> GDB_ID.NULL
' verifico se il layer appartiene al ProjId
Dim nBTLInfoLayerProjId As Integer
EgtGetInfo(nBTLInfoLayerId, BTL_PRT_PROJ, nBTLInfoLayerProjId)
If nBTLInfoLayerProjId = ProjId Then
NewBTLStructure.m_nBTLInfoId = nBTLInfoLayerId
Exit While
End If
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
End While
' cerco tra gli AsseBase
Dim nAsseBaseLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
While nAsseBaseLayerId <> GDB_ID.NULL
' verifico se il layer appartiene al ProjId
Dim nAsseBaseLayerProjId As Integer
EgtGetInfo(nAsseBaseLayerId, BTL_PRT_PROJ, nAsseBaseLayerProjId)
If nAsseBaseLayerProjId = ProjId Then
NewBTLStructure.m_nAsseBaseId = nAsseBaseLayerId
Exit While
End If
nAsseBaseLayerId = EgtGetNextName(nAsseBaseLayerId, ASSEBASE)
End While
Else
NewBTLStructure.m_nAsseBaseId = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
NewBTLStructure.m_nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
End If
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJNUM, NewBTLStructure.m_sPROJNUM)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJNAME, NewBTLStructure.m_sPROJNAME)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJPART, NewBTLStructure.m_sPROJPART)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJGUID, NewBTLStructure.m_sPROJGUID)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_PROJTYPE, NewBTLStructure.m_nPROJTYPE)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_LISTNAME, NewBTLStructure.m_sLISTNAME)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_CUSTOMER, NewBTLStructure.m_sCUSTOMER)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_ARCHITECT, NewBTLStructure.m_sARCHITECT)
@@ -384,8 +432,10 @@ Public Class BTLStructureM
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_PRT_RECESS, sValue)
NewBTLStructure.m_SelRECESS = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, NewBTLStructure.ocRECESS), NewBTLStructure.ocRECESS)
EgtGetInfo(NewBTLStructure.m_nBTLInfoId, BTL_GEN_USERATTRIBUTE, NewBTLStructure.m_sUSERATTRIBUTE)
' setto il tipo di progetto (Beam o Wall) nel file ini del BTL
If NewBTLStructure.m_nPROJTYPE <> BWType.NULL Then BTLIniFile.m_nBTLBWType = NewBTLStructure.m_nPROJTYPE
' recupero i part
NewBTLStructure.m_BTLPartMList = LoadParts()
NewBTLStructure.m_BTLPartMList = LoadParts(ProjId)
'Dim nPartId As Integer = EgtGetFirstPart()
'While nPartId <> GDB_ID.NULL
' NewBTLStructure.m_BTLPartMList.Add(BTLPartM.CreateBTLPart(nPartId))
@@ -394,11 +444,22 @@ Public Class BTLStructureM
Return NewBTLStructure
End Function
Private Shared Function LoadParts() As List(Of BTLPartM)
Private Shared Function LoadParts(ProjId As Integer) As List(Of BTLPartM)
Dim TempList As New List(Of BTLPartM)
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
TempList.Add(BTLPartM.CreateBTLPart(nPartId))
' se devo filtrare un progetto
If ProjId > 0 Then
' verifico se il pezzo appartiene al ProjId
Dim nPartProjId As Integer
EgtGetInfo(nPartId, BTL_PRT_PROJ, nPartProjId)
If nPartProjId = ProjId Then
TempList.Add(BTLPartM.CreateBTLPart(nPartId))
End If
Else
' altrimenti carico tutti
TempList.Add(BTLPartM.CreateBTLPart(nPartId))
End If
nPartId = EgtGetNextPart(nPartId)
End While
Return TempList
@@ -418,6 +479,13 @@ Public Class BTLStructureM
End If
End Sub
Public Sub RemoveBTLPart(BTLPartM As BTLPartM)
If IsNothing(BTLPartM) Then Return
If Not m_BTLPartMList.Contains(BTLPartM) Then Return
m_BTLPartMList.Remove(BTLPartM)
'RaiseEvent BTLPartAdded(Me, New BTLPartAddedEventArgs(BTLPartM))
End Sub
Public Function GetBTLParts() As List(Of BTLPartM)
Return New List(Of BTLPartM)(m_BTLPartMList)
End Function
@@ -430,6 +498,10 @@ Public Class BTLStructureM
Return nMaxPDN + 1
End Function
Public Sub UpdateBTLInfoLayer()
m_nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
End Sub
#End Region ' METHODS
End Class
@@ -0,0 +1,269 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.Windows
Imports System.Windows.Media
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLFeatureVM
Inherits VMBase
Protected WithEvents m_BTLFeatureM As BTLFeatureM
Public ReadOnly Property BTLFeatureM As BTLFeatureM
Get
Return m_BTLFeatureM
End Get
End Property
Protected m_BTLPartM As BTLPartM
Public ReadOnly Property nFeatureId As Integer
Get
Return m_BTLFeatureM.nFeatureId
End Get
End Property
Public Overridable Property nSelGRP As Integer
Get
Return m_BTLFeatureM.nSelGRP
End Get
Set(value As Integer)
m_BTLFeatureM.nSelGRP = value
End Set
End Property
Public ReadOnly Property sDescGRP As String
Get
Dim sDescConstruction As String = String.Empty
If CalcBeamPrivateProfileGRP(m_BTLFeatureM.nSelGRP) = 0 Then
sDescConstruction = "L"
Else
sDescConstruction = "T"
End If
sDescConstruction &= m_BTLFeatureM.nPRC.ToString("000")
Return sDescConstruction
End Get
End Property
Public Property nPRC As Integer
Get
Return m_BTLFeatureM.nPRC
End Get
Set(value As Integer)
m_BTLFeatureM.nPRC = value
End Set
End Property
' Lato
Public Overridable Property nSelSIDE As Integer
Get
Return m_BTLFeatureM.nSelSIDE
End Get
Set(value As Integer)
m_BTLFeatureM.nSelSIDE = value
End Set
End Property
Public ReadOnly Property sName As String
Get
Return m_BTLFeatureM.sName
End Get
End Property
Public Overridable Property bDO As Boolean
Get
Return m_BTLFeatureM.bDO
End Get
Set(value As Boolean)
m_BTLFeatureM.bDO = value
End Set
End Property
Public Property nPRID As Integer
Get
Return m_BTLFeatureM.nPRID
End Get
Set(value As Integer)
m_BTLFeatureM.nPRID = value
End Set
End Property
Public Property sDES As String
Get
Return m_BTLFeatureM.sDES
End Get
Set(value As String)
m_BTLFeatureM.sDES = value
End Set
End Property
Public Property frFRAME As Frame3d
Get
Return m_BTLFeatureM.frFRAME
End Get
Set(value As Frame3d)
m_BTLFeatureM.frFRAME = value
End Set
End Property
' proprieta' che mostra la descrizione in interfaccia
Public ReadOnly Property sDesc As String
Get
Return sDescGRP & " [" & nPRID & "] " & sName
End Get
End Property
Public ReadOnly Property nState As CalcStates
Get
Return m_BTLFeatureM.nState
End Get
End Property
Public ReadOnly Property nCALC_ERR As Integer
Get
Return m_BTLFeatureM.nCALC_ERR
End Get
End Property
Public ReadOnly Property nCALC_ROT As Integer
Get
Return m_BTLFeatureM.nCALC_ROT
End Get
End Property
Public ReadOnly Property sCALC_MSG As String
Get
Return m_BTLFeatureM.sCALC_MSG
End Get
End Property
Public ReadOnly Property Calc_Background As SolidColorBrush
Get
If Not m_BTLFeatureM.bDO Then Return Brushes.Aqua
Select Case m_BTLFeatureM.nState
Case CalcStates.ERROR_, CalcStates.COLLISION
Return Brushes.Red
Case CalcStates.WARNING
Return Brushes.Orange
Case CalcStates.INFO, CalcStates.OK
Return Brushes.Green
Case CalcStates.NOTCALCULATED
Return Brushes.LightGray
Case Else
Return Brushes.Red
End Select
End Get
End Property
Public ReadOnly Property CALC_ROT_Visibility As Visibility
Get
Return If(m_BTLFeatureM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Public ReadOnly Property CALC_ERR_Letter As String
Get
Select Case m_BTLFeatureM.nState
Case CalcStates.COLLISION
Return "c"
Case CalcStates.ERROR_
Return "e"
Case CalcStates.WARNING
Return "w"
Case CalcStates.INFO
Return "i"
Case Else
Return ""
End Select
End Get
End Property
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
Get
Select Case m_BTLFeatureM.nState
Case CalcStates.ERROR_, CalcStates.COLLISION
Return Brushes.Red
Case CalcStates.WARNING
Return Brushes.Orange
Case CalcStates.INFO
Return Brushes.Green
Case Else
Return Brushes.Red
End Select
End Get
End Property
' variabile che indica se rifare il pezzo
Private m_bRedo As Boolean = True
Public Property bRedo As Boolean
Get
Return m_bRedo
End Get
Set(value As Boolean)
m_bRedo = value
End Set
End Property
#Region "CONSTRUCTOR"
'Sub New(BTLFeatureM As BTLFeatureM, BTLPartM As BTLPartM)
' m_BTLFeatureM = BTLFeatureM
' AddHandler m_BTLFeatureM.PBTLParamAdded, AddressOf OnPBTLParamAdded
' AddHandler m_BTLFeatureM.QBTLParamAdded, AddressOf OnQBTLParamAdded
' m_BTLPartM = BTLPartM
' CreatePBTLParamVMList()
' CreateQBTLParamVMList()
' NotifyPropertyChanged(NameOf(Calc_Background))
' NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
' NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
' NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
'End Sub
Sub New()
End Sub
Sub New(BTLFeatureM As BTLFeatureM)
m_BTLFeatureM = BTLFeatureM
m_BTLPartM = Nothing
NotifyPropertyChanged(NameOf(Calc_Background))
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
' funzione che seleziona la feature nella geometria
Public Sub SelGeomFeature()
EgtDeselectAll()
SelGeomFeature(nFeatureId)
End Sub
Private Sub SelGeomFeature(nMyFeatureId As Integer)
EgtSelectObj(nMyFeatureId)
Dim sVal As String = ""
If EgtGetInfo(nMyFeatureId, BTL_FTR_ADJID, sVal) Then
Dim vAdjId() As String = sVal.Split(","c)
For Each sAdjId In vAdjId
Dim nAdjId As Integer
If Integer.TryParse(sAdjId, nAdjId) Then
SelGeomFeature(nMyFeatureId + nAdjId)
End If
Next
End If
If EgtGetInfo(nMyFeatureId, BTL_FTR_AUXID, sVal) Then
Dim vAuxId() As String = sVal.Split(","c)
For Each sAuxId In vAuxId
Dim nAuxId As Integer
If Integer.TryParse(sAuxId, nAuxId) Then
EgtSelectObj(nMyFeatureId + nAuxId)
End If
Next
End If
End Sub
#End Region ' METHODS
End Class
-39
View File
@@ -1,39 +0,0 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class Beam
Inherits Part
Protected m_dOffset As Double
Public ReadOnly Property dOffset As Double
Get
Return m_dOffset
End Get
End Property
' Id del grezzo
Protected m_nRawPartId As Integer = GDB_ID.NULL
#Region "CONSTRUCTOR"
Sub New(nParentMachGroup As Core.MyMachGroup, nPartId As Integer, nRawPartId As Integer)
MyBase.New(nParentMachGroup, nPartId)
m_nRawPartId = nRawPartId
End Sub
#End Region ' CONSTRUCTOR
Friend Sub UpdateOffset()
' calcolo offset
Dim nBeamIndex As Integer = ParentMachGroup.PartList.IndexOf(Me)
If nBeamIndex > 0 Then
m_dOffset = dPOSX - (ParentMachGroup.PartList(nBeamIndex - 1).dPOSX + ParentMachGroup.PartList(nBeamIndex - 1).dL)
Else
Dim BeamMachGroup As BeamMachGroup = DirectCast(ParentMachGroup, BeamMachGroup)
m_dOffset = BeamMachGroup.dStartCut
End If
End Sub
End Class
-60
View File
@@ -1,60 +0,0 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class BeamMachGroup
Inherits MyMachGroup
Protected m_dStartCut As Double
Public ReadOnly Property dStartCut As Double
Get
Return m_dStartCut
End Get
End Property
Sub New(nId As Integer, sName As String, sMachine As String)
MyBase.New(nId, sName, sMachine)
SetMachineType(MachineType.BEAM)
EgtGetInfo(nId, MGR_RPT_BARLEN, dL)
EgtGetInfo(nId, MGR_RPT_BARHEIGHT, dH)
EgtGetInfo(nId, MGR_RPT_BARWIDTH, dW)
m_dTotMat = dL
For Each Part In PartList
m_dMatForPart += Part.dL
Next
End Sub
Public Overrides Sub RefreshPartList()
' leggo StartCut da posizione primo pezzo
Dim sInfo As String = ""
Dim sSplitInfo() As String
Dim bFound As Boolean = False
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c)
StringToDouble(sSplitInfo(1), m_dStartCut)
Else
m_dStartCut = 0
End If
' aggiorno lista pezzi
PartList.Clear()
Dim nRawPartId As Integer = EgtGetFirstRawPart()
While nRawPartId <> GDB_ID.NULL
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
If nPartId <> GDB_ID.NULL Then
Dim NewBeam As Beam = New Beam(Me, nPartId, nRawPartId)
PartList.Add(NewBeam)
NewBeam.UpdateOffset()
End If
nRawPartId = EgtGetNextRawPart(nRawPartId)
End While
End Sub
Public Overrides Sub RefreshGroupData()
EgtGetInfo(Id, MGR_RPT_BARLEN, dL)
EgtGetInfo(Id, MGR_RPT_BARHEIGHT, dH)
EgtGetInfo(Id, MGR_RPT_BARWIDTH, dW)
End Sub
End Class
@@ -0,0 +1,24 @@
Public Class CalcEditEndEventArgs
Inherits EventArgs
Public Enum Results As Integer
NULL = 0
MODIFIED = 1
ERROR_ = 2
End Enum
Public m_End As Results
Public Property End_ As Results
Get
Return m_End
End Get
Private Set(value As Results)
m_End = value
End Set
End Property
Sub New(Result As Results)
m_End = Result
End Sub
End Class
@@ -0,0 +1,36 @@
Public Class CalcEndEventArgs
Inherits EventArgs
Public Enum Results As Integer
NULL = 0
OK = 1
ERROR_ = 2
EDIT = 3
End Enum
Public m_End As Results
Public Property End_ As Results
Get
Return m_End
End Get
Private Set(value As Results)
m_End = value
End Set
End Property
Public m_CmdType As CmdTypes
Public Property CmdType As CmdTypes
Get
Return m_CmdType
End Get
Private Set(value As CmdTypes)
m_CmdType = value
End Set
End Property
Sub New(CmdType As CmdTypes, Result As Results)
m_CmdType = CmdType
m_End = Result
End Sub
End Class
@@ -0,0 +1,596 @@
Imports System.IO
Imports System.Threading
Imports System.Globalization
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtBEAMWALL.Core
Public Module CalcIntegration
Private _thread As System.Threading.Thread
Public Event Calc_Ended As EventHandler(Of CalcEndEventArgs)
Public Event Calc_ProcessResult As EventHandler(Of CalcResultEventArgs)
Public Event Calc_ProcessEnd As EventHandler(Of CalcProcessEndEventArgs)
Private m_bIsSupervisor As Boolean = False
Public Enum CmdTypes As Integer
GENERATE = 0
MODIFY = 1
SIMULATE = 2
CHECK = 3
CHECKGEN = 4
POINT_CLOUD = 5
RAWPART = 6
EDIT = 7
End Enum
Private Structure MyProc
Public bEnable As Boolean
Public Proc As Process
Public nBar As Integer
End Structure
Private m_MaxCamInstances As Integer = 1
Public Sub SetMaxCamInstances(value As Integer)
m_MaxCamInstances = value
End Sub
Delegate Sub CallbackDlg(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
Public Sub Run(vBar As Bar(), sProjDirPath As String, callback As CallbackDlg, Optional bIsSupervisor As Boolean = False)
_thread = New Thread(Sub()
m_bIsSupervisor = bIsSupervisor
DoJob(vBar, sProjDirPath, callback)
End Sub)
_thread.Start()
End Sub
Private Sub DoJob(vBar As Bar(), sProjDirPath As String, callback As CallbackDlg)
Dim bCancel As Boolean = False
callback(0, "Init", bCancel)
If vBar.Count > 0 AndAlso vBar(0).nCmdType = CmdTypes.SIMULATE Then
Dim Bar As Bar = vBar(0)
' verifico se il pezzo e' non calcolato
If Bar.nProgramPage = ProjectType.PROJ Then
If Bar.nGlobState = CalcStates.NOTCALCULATED Then
Bar.sBarPath = CreateNewProjectFromPart(Bar.nBarId, sProjDirPath)
Else
Dim nPDN As Integer = 0
EgtGetInfo(Bar.nBarId, BTL_PRT_PDN, nPDN)
Bar.sBarPath = sProjDirPath & "\" & nPDN.ToString() & ".bwe"
End If
ElseIf Bar.nProgramPage = ProjectType.PROD Then
If Bar.nGlobState = CalcStates.NOTCALCULATED Then
Bar.sBarPath = CreateNewProjectFromMachGroup(Bar.nBarId, sProjDirPath, Bar.nGlobState)
Else
Dim sMachGroupName As String = ""
EgtGetMachGroupName(Bar.nBarId, sMachGroupName)
Bar.sBarPath = sProjDirPath & "\" & sMachGroupName & ".bwe"
End If
End If
ElseIf vBar(0).nCmdType <> CmdTypes.EDIT Then
' creo progetti a seconda del tipo
For Each Bar In vBar
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.nGlobState)
End If
Next
End If
Dim bIsSimulation As Boolean = False
Dim bIsSimulationVerifyed As Boolean = False
Dim bIsEdit As Boolean = False
Dim LastFileWriteTime As Date
' se sono in simulazione
If vBar.Count > 0 AndAlso vBar(0).nCmdType = CmdTypes.SIMULATE Then
bIsSimulation = True
callback(0, "Simulation opened", bCancel)
ElseIf vBar.Count > 0 AndAlso vBar(0).nCmdType = CmdTypes.EDIT Then
bIsEdit = True
Dim sCurrFilePath As String = ""
EgtGetCurrFilePath(sCurrFilePath)
vBar(0).sBarPath = sCurrFilePath
LastFileWriteTime = File.GetLastWriteTime(sCurrFilePath)
callback(0, "Editor opened", bCancel)
Else
callback(0.1, "", bCancel)
End If
Dim ExePath As String = String.Empty
GetMainPrivateProfileString(S_BEAM, K_CALCPATH, "", ExePath)
' Numero di barre
Dim numBars As Integer = vBar.Count
If numBars = 0 Then Return
' Numero di core logici da utilizzare (minimo tra presenti sul PC e imposti da INI)
Dim nMaxThread As Integer = Math.Min(Environment.ProcessorCount, m_MaxCamInstances)
Array.Resize(Of Bar)(vBar, numBars + nMaxThread - 1)
' Frazione di avanzamento del lavoro (in piu)
Dim dProgress As Double = 0
'indice incremento progress durante calcolo barra
Dim nPgsCurrBar As Integer = 0
Dim nPgsClock As Integer = 0
' Lancio in parallelo più processi (senza superare il numero di core logici presenti)
Dim vProc As MyProc() = New MyProc(nMaxThread - 1) {}
For j As Integer = 0 To nMaxThread - 1
vProc(j).nBar = -1
vProc(j).bEnable = True
Next
' Processo i Btl in parallelo
Dim nCurrBar As Integer = 0
Dim nDoneBar As Integer = 0
Dim nShiftBar As Integer = 0
Dim nActProc As Integer = 0
Dim bAllKO As Boolean
While nCurrBar < numBars + nShiftBar OrElse nActProc > 0
For j As Integer = 0 To nMaxThread - 1
If Not vProc(j).bEnable Then Continue For
Dim bDone As Boolean = False
If vProc(j).nBar = -1 Then
If nCurrBar < numBars + nShiftBar Then
If vBar(nCurrBar).bBarOk Then
vProc(j).Proc = New Process()
vProc(j).Proc.StartInfo.FileName = ExePath
If bIsEdit Then
vProc(j).Proc.StartInfo.Arguments = """" & vBar(nCurrBar).sBarPath & """"
Else
vProc(j).Proc.StartInfo.Arguments = """" & vBar(nCurrBar).sBarPath & """ " &
"""" & vBar(nCurrBar).nProjType & """ " &
"""" & vBar(nCurrBar).nMachineName & """ " & vBar(nCurrBar).nCmdType
End If
vProc(j).Proc.StartInfo.UseShellExecute = False
If vProc(j).Proc.Start() Then
vProc(j).nBar = nCurrBar
nCurrBar += 1
nActProc += 1
End If
Else
If vBar(nCurrBar).nCmdType = CmdTypes.CHECK OrElse vBar(nCurrBar).nCmdType = CmdTypes.CHECKGEN Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
ElseIf vBar(nCurrBar).nCmdType = CmdTypes.GENERATE Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(nCurrBar))) 'ProcessResults(vBar(nCurrBar))
End If
bDone = True
nCurrBar += 1
End If
End If
Else
If vProc(j).Proc.HasExited Then
' se terminato con successo
If vProc(j).Proc.ExitCode = 0 Then
' salvo il risultato
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
ElseIf vBar(vProc(j).nBar).nCmdType = CmdTypes.GENERATE Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
End If
bDone = True
vProc(j).nBar = -1
nActProc -= 1
' se superato il numero di processi eseguibili in parallelo
ElseIf vProc(j).Proc.ExitCode = 1 Then
' aggiungo il pezzo in coda
If numBars + nShiftBar < numBars + nMaxThread Then
vBar(numBars + nShiftBar) = vBar(vProc(j).nBar)
nShiftBar += 1
End If
' disabilito il processo
vProc(j).bEnable = False
vProc(j).nBar = -1
nActProc -= 1
' altrimenti (errore generico di esecuzione)
Else
' salvo il risultato
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
ElseIf vBar(vProc(j).nBar).nCmdType = CmdTypes.GENERATE Then
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(vProc(j).nBar))) ' ProcessResults(vBar(vProc(j).nBar))
'RaiseEvent Calc_ProcessEnd(Nothing, New CalcProcessEndEventArgs(vBar(vProc(j).nBar))) 'ProcessResults(vBar(nCurrBar))
End If
bDone = True
vProc(j).nBar = -1
nActProc -= 1
End If
Else
vProc(j).Proc.Refresh()
End If
End If
If bDone Then
' se sono in simulazione
If bIsSimulation Then
Dim sOriPath As String = Path.ChangeExtension(vBar(0).sBarPath, ".ori.bwe")
' se file modificato a mano
If File.GetLastWriteTime(sOriPath) < File.GetLastWriteTime(vBar(0).sBarPath) Then
' aggiorno progetto
If File.Exists(vBar(0).sBarPath) Then File.Copy(vBar(0).sBarPath, sOriPath, True)
' messaggio di lancio verifica
callback(50, "Verifying modifications...", bCancel)
' lancio verifica
System.Threading.Thread.Sleep(500)
Dim Proc As New Process()
Proc.StartInfo.FileName = ExePath
Proc.StartInfo.Arguments = """" & vBar(0).sBarPath & """ " &
"""" & vBar(0).nProjType & """ " &
"""" & vBar(0).nMachineName & """ " & CmdTypes.CHECKGEN
Proc.StartInfo.UseShellExecute = False
If Proc.Start() Then
Dim ProgressValue As Integer = 50
While Not Proc.HasExited
Proc.Refresh()
If ProgressValue < 90 Then ProgressValue += 0.001
callback(ProgressValue, "Verifying modifications...", bCancel)
Thread.Sleep(1)
End While
' se terminato con successo
If Proc.ExitCode = 0 Then
' salvo il risultato
RaiseEvent Calc_ProcessResult(Nothing, New CalcResultEventArgs(vBar(0)))
Thread.Sleep(500)
End If
End If
End If
' messaggio di completamento simulazione
callback(0, "Simulation closing", bCancel)
ElseIf bIsEdit Then
' ricarico il progetto
Dim Result As CalcEndEventArgs.Results
If bAllKO Then
Result = CalcEndEventArgs.Results.ERROR_
ElseIf bIsEdit Then
Result = CalcEndEventArgs.Results.EDIT
Else
Result = CalcEndEventArgs.Results.OK
End If
RaiseEvent Calc_Ended(Nothing, New CalcEndEventArgs(CmdTypes.EDIT, Result))
Return
Else
' Dialog con Progress Bar
nDoneBar += 1
dProgress = 1 / numBars * nDoneBar
Dim sProg As String = (dProgress * 100).ToString("F1", CultureInfo.InvariantCulture)
callback(dProgress, " Progress: " & sProg & "% Count: " & nDoneBar & " / " & numBars, bCancel)
End If
If bCancel Then
' fine
callback(1, "", bCancel)
' riabilito interfaccia
RaiseEvent Calc_Ended(Nothing, New CalcEndEventArgs(CmdTypes.CHECKGEN, CalcEndEventArgs.Results.OK))
Return
End If
nPgsCurrBar = 0
nPgsClock = 0
Else
' se non sono in simulazione
If Not bIsSimulation AndAlso Not bIsEdit Then
' aggiorno conteggio
If nPgsClock >= 100 AndAlso nPgsCurrBar < 149 Then
nPgsCurrBar += 1
dProgress = 1 / numBars * nDoneBar + 1 / numBars / 150 * nPgsCurrBar
Dim sProg As String = (dProgress * 100).ToString("F1", CultureInfo.InvariantCulture)
callback(dProgress, " Progress: " & sProg & "% Count: " & nDoneBar & " / " & numBars, bCancel)
nPgsClock = 0
End If
End If
End If
nPgsClock += 1
Thread.Sleep(1)
Next
' Verifico che i processi non siano andati tutti in errore
bAllKO = True
For j As Integer = 0 To nMaxThread - 1
If vProc(j).bEnable Then bAllKO = False
Next
If bAllKO Then
Exit While
End If
Thread.Sleep(10)
End While
Thread.Sleep(300)
' se sono in simulazione
If bIsSimulation Then
callback(1, "Simulation closed", bCancel)
Else
callback(1, "Done", bCancel)
End If
' riabilito interfaccia
RaiseEvent Calc_Ended(Nothing, New CalcEndEventArgs(If(bIsSimulation And Not bIsSimulationVerifyed, CmdTypes.SIMULATE, CmdTypes.CHECKGEN), If(bAllKO, CalcEndEventArgs.Results.ERROR_, CalcEndEventArgs.Results.OK)))
End Sub
Private Function CreateNewProjectFromPart(nPartId As Integer, sProjDirPath As String) As String
' Aggiorno identificativi per segnalazione errori
UpdateCutIdAndTaskId(nPartId)
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr
' Recupero visibilita' pezzo e lo imposto a visibile
Dim nOldPartMode As Integer
EgtGetMode(nPartId, nOldPartMode)
EgtSetMode(nPartId, GDB_MD.STD)
' Salvo pezzo nel suo progetto
Dim bOk As Boolean = False
Dim nPDN As Integer = 0
EgtGetInfo(nPartId, BTL_PRT_PDN, nPDN)
Dim sPartFilePath As String = sProjDirPath & "\" & nPDN.ToString() & ".bwe"
bOk = EgtSaveObjToFile(nPartId, sPartFilePath, NGE.CMPTEXT)
' Ripristino visibilita' pezzo
EgtSetMode(nPartId, nOldPartMode)
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
Return If(bOk, sPartFilePath, String.Empty)
End Function
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)
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
If EgtVerifyRawPartPhase(nRawId, 1) Then
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawId)
While nPartId <> GDB_ID.NULL
UpdateCutIdAndTaskId(nPartId)
nPartId = EgtGetNextPartInRawPart(nPartId)
End While
End If
nRawId = EgtGetNextRawPart(nRawId)
End While
If nMachGroupId <> nOldMachGroup Then
If nOldMachGroup <> GDB_ID.NULL Then
EgtSetCurrMachGroup(nOldMachGroup)
Else
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
Dim sMachGroupName As String = ""
EgtGetMachGroupName(nMachGroupId, sMachGroupName)
Dim sMachGroupFilePath As String = sProjDirPath & "\" & sMachGroupName & ".bwe"
If EgtSaveObjToFile(nMachGroupId, sMachGroupFilePath, NGE.CMPTEXT) Then
Return sMachGroupFilePath
End If
Return String.Empty
End Function
Private Function UpdateCutIdAndTaskId(nPartId As Integer) As Boolean
' Assegno Id a CutId per calcoli
EgtSetInfo(nPartId, "CUTID", nPartId, True)
' Assegno TASKID agli outline per calcoli
Dim nOutLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutLayerId)
While nOutlineId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) Then
' verifico se ha un principale
Dim nMainOffsId As Integer = 0
Dim nTaskId As Integer = nOutlineId
If EgtGetInfo(nOutlineId, BTL_FTR_MAINID, nMainOffsId) Then
nTaskId = nOutlineId + nMainOffsId
'' assegno TASKID alla feature per calcoli
'EgtSetInfo(nOutlineId, "TASKID", nOutlineId + nMainOffsId, True)
'Else
' ' assegno TASKID alla feature per calcoli
' EgtSetInfo(nOutlineId, "TASKID", nOutlineId, True)
End If
' assegno TASKID alla feature per calcoli
EgtSetInfo(nOutlineId, "TASKID", nTaskId)
' recupero eventuali AuxId
Dim sAuxIds As String = ""
If EgtGetInfo(nOutlineId, BTL_FTR_AUXID, sAuxIds) Then
Dim AuxIdArray() As String = sAuxIds.Split(","c)
If AuxIdArray.Count > 0 Then
For Each AuxId In AuxIdArray
AuxId = AuxId.Trim()
AuxId = AuxId.Trim("+"c)
Dim nAuxId As Integer
If Integer.TryParse(AuxId, nAuxId) Then
EgtSetInfo(nOutlineId + nAuxId, "TASKID", nTaskId)
End If
Next
End If
End If
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
' Assegno TASKID alle feature per calcoli
Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
While nFeatureId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) Then
' verifico se ha un principale
Dim nMainOffsId As Integer
Dim nTaskId As Integer = nFeatureId
If EgtGetInfo(nFeatureId, BTL_FTR_MAINID, nMainOffsId) Then
nTaskId = nFeatureId + nMainOffsId
' ' assegno TASKID alla feature per calcoli
' EgtSetInfo(nFeatureId, "TASKID", nFeatureId + nMainOffsId, True)
'Else
' ' assegno TASKID alla feature per calcoli
' EgtSetInfo(nFeatureId, "TASKID", nFeatureId, True)
End If
' assegno TASKID alla feature per calcoli
EgtSetInfo(nFeatureId, "TASKID", nTaskId)
' recupero eventuali AuxId
Dim sAuxIds As String = ""
If EgtGetInfo(nFeatureId, BTL_FTR_AUXID, sAuxIds) Then
Dim AuxIdArray() As String = sAuxIds.Split(","c)
For Each AuxId In AuxIdArray
AuxId = AuxId.Trim()
AuxId = AuxId.Trim("+"c)
Dim nAuxId As Integer
If Integer.TryParse(AuxId, nAuxId) Then
EgtSetInfo(nFeatureId + nAuxId, "TASKID", nTaskId)
End If
Next
End If
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
Return True
End Function
End Module
Public Class Bar
'Public piInfo As PatternInfo
Public nBarState As Integer
Public nBarId As Integer
Public sBarPath As String
Public bBarOk As Boolean
Public nCmdType As Integer
Public nProgramPage As ProjectType
Public nProjType As BWType
Public nMachineName As String
Public nGlobState As Integer
End Class
Public Class ProcessResult
Public Enum ProcessResultTypes As Integer
BAR = 1
PART = 2
TASKID = 3
FALL = 4
TIME = 5
End Enum
Private m_Type As ProcessResultTypes
Public ReadOnly Property Type As ProcessResultTypes
Get
Return m_Type
End Get
End Property
Private m_nCUTID As Integer
Public ReadOnly Property nCUTID As Integer
Get
Return m_nCUTID
End Get
End Property
Private m_nTASKID As Integer
Public ReadOnly Property nTASKID As Integer
Get
Return m_nTASKID
End Get
End Property
Private m_nERR As Integer
Public ReadOnly Property nERR As Integer
Get
Return m_nERR
End Get
End Property
Private m_sMSG As String
Public ReadOnly Property sMSG As String
Get
Return m_sMSG
End Get
End Property
Private m_dROT As Double
Public ReadOnly Property dROT As Double
Get
Return m_dROT
End Get
End Property
Public Sub SetROT(value As Double)
m_dROT = value
End Sub
Private m_nFALL As Integer
Public ReadOnly Property nFALL As Integer
Get
Return m_nFALL
End Get
End Property
Private m_nTIME As Integer
Public ReadOnly Property nTIME As Integer
Get
Return m_nTIME
End Get
End Property
Public Shared Function CreateTaskResult(CUTID As Integer, TASKID As Integer, ERR As Integer, MSG As String, ROT As Double) As ProcessResult
If CUTID <> 0 Then
If TASKID = 0 Then
Return New ProcessResult(ProcessResultTypes.PART, CUTID, TASKID, ERR, MSG, ROT, 0, 0)
End If
Return New ProcessResult(ProcessResultTypes.TASKID, CUTID, TASKID, ERR, MSG, ROT, 0, 0)
End If
Return New ProcessResult(ProcessResultTypes.BAR, CUTID, TASKID, ERR, MSG, ROT, 0, 0)
End Function
Public Shared Function CreateFallResult(CUTID As Integer, ERR As Integer, MSG As String, FALL As Integer) As ProcessResult
Return New ProcessResult(ProcessResultTypes.FALL, CUTID, 0, ERR, MSG, 0, FALL, 0)
End Function
Public Shared Function CreateTimeResult(CUTID As Integer, TIME As Integer) As ProcessResult
Return New ProcessResult(ProcessResultTypes.TIME, CUTID, 0, 0, "", 0, 0, TIME)
End Function
Protected Sub New(Type As ProcessResultTypes, CUTID As Integer, TASKID As Integer, ERR As Integer, MSG As String, ROT As Double, FALL As Integer, TIME As Integer)
m_Type = Type
m_nCUTID = CUTID
m_nTASKID = TASKID
m_nERR = ERR
m_sMSG = MSG
m_dROT = ROT
m_nFALL = FALL
m_nTIME = TIME
End Sub
End Class
@@ -0,0 +1,18 @@
Public Class CalcProcessEndEventArgs
Inherits EventArgs
Public m_Result As Bar
Public Property Result As Bar
Get
Return m_Result
End Get
Private Set(value As Bar)
m_Result = value
End Set
End Property
Sub New(Result As Bar)
m_Result = Result
End Sub
End Class
@@ -0,0 +1,24 @@
Public Class CalcResultEventArgs
Inherits EventArgs
Public Enum Results As Integer
NULL = 0
OK = 1
ERROR_ = 2
End Enum
Public m_Result As Bar
Public Property Result As Bar
Get
Return m_Result
End Get
Private Set(value As Bar)
m_Result = value
End Set
End Property
Sub New(Result As Bar)
m_Result = Result
End Sub
End Class
+176 -123
View File
@@ -24,13 +24,15 @@
NULL = 0
BEAM = 1
WALL = 2
BOTH = 3
End Enum
Enum CalcStates As Integer
NOTCALCULATED = -1
OK = 0
WARNING = 1
ERROR_ = 2
INFO = 1
WARNING = 2
ERROR_ = 3
End Enum
Public Enum Range As Integer
@@ -111,147 +113,198 @@
PROD = 2
End Enum
Friend Const PROJ As String = "PROJ"
Friend Const FILENAMESEPARATOR As Char = "^"c
Friend Const BTLINFO As String = "BtlInfo"
' Tipo di progetto (Beam o Wall)
Public Enum BWType As Integer
NULL = 0
BEAM = 1
WALL = 2
End Enum
Public Const PROJ As String = "PROJ"
Public Const FILENAMESEPARATOR As Char = "^"c
Public Const BTLINFO As String = "BtlInfo"
' layer per assemblato
Public Const ASSEBASE As String = "AsseBase"
' info parametri assemblato
Public Const BTL_ASSEBASE_N As String = "N"
' info parametri BTL
Friend Const BTL_PRT_PDN As String = "PDN"
Friend Const BTL_PRT_DO As String = "DO"
Friend Const BTL_PRT_NAM As String = "NAM"
Friend Const BTL_PRT_L As String = "L"
Friend Const BTL_PRT_W As String = "W"
Friend Const BTL_PRT_H As String = "H"
Friend Const BTL_PRT_CNT As String = "CNT"
Friend Const BTL_PRT_ROTATED As String = "ROTATED"
Friend Const BTL_PRT_INVERTED As String = "INVERTED"
Friend Const BTL_PRT_MATERIAL As String = "MATERIAL"
Public Const BTL_PRT_PROJ As String = "PROJ"
Public Const BTL_PRT_PDN As String = "PDN"
Public Const BTL_PRT_DO As String = "DO"
Public Const BTL_PRT_NAM As String = "NAM"
Public Const BTL_PRT_L As String = "L"
Public Const BTL_PRT_W As String = "W"
Public Const BTL_PRT_H As String = "H"
Public Const BTL_PRT_CNT As String = "CNT"
Public Const BTL_PRT_ADDED As String = "ADDED"
Public Const BTL_PRT_DONE As String = "DONE"
Public Const BTL_PRT_ROTATED As String = "ROTATED"
Public Const BTL_PRT_INVERTED As String = "INVERTED"
Public Const BTL_PRT_MATERIAL As String = "MATERIAL"
Public Const BTL_PRT_VOLUME As String = "VOLUME"
' parametri pezzo
Friend Const BTL_PRT_SINGLEMEMBERNUM = "SINGLEMEMBERNUMBER"
Friend Const BTL_PRT_ASSEMBLYNUM = "ASSEMBLYNUMBER"
Friend Const BTL_PRT_ORDERNUM = "ORDERNUMBER"
Friend Const BTL_PRT_DESIGNATION = "DESIGNATION"
Friend Const BTL_PRT_ANNOTATION = "ANNOTATION"
Friend Const BTL_PRT_STOREY = "STOREY"
Friend Const BTL_PRT_GROUP = "GROUP"
Friend Const BTL_PRT_PACKAGE = "PACKAGE"
Friend Const BTL_PRT_TIMBERGRADE = "TIMBERGRADE"
Friend Const BTL_PRT_QUALITYGRADE = "QUALITYGRADE"
Friend Const BTL_PRT_COLOUR = "COLOUR"
Friend Const BTL_PRT_PLANINGLENGTH = "PLANINGLENGTH"
Friend Const BTL_PRT_STARTOFFSET = "STARTOFFSET"
Friend Const BTL_PRT_ENDOFFSET = "ENDOFFSET"
Friend Const BTL_PRT_UID = "UID"
Friend Const BTL_PRT_TRANSFORMATION = "TRANSFORMATION"
Friend Const BTL_PRT_CAMBER = "CAMBER"
Friend Const BTL_PRT_PARTOFFSET = "PARTOFFSET"
Friend Const BTL_PRT_PROCESSINGQUALITY = "PROCESSINGQUALITY"
Friend Const BTL_PRT_RECESS = "RECESS"
Friend Const BTL_PRT_STOREYTYPE = "STOREYTYPE"
Friend Const BTL_PRT_ELEMENTNUM = "ELEMENTNUMBER"
Friend Const BTL_PRT_LAYER = "LAYER"
Friend Const BTL_PRT_MODULENUM = "MODULENUMBER"
Public Const BTL_PRT_SINGLEMEMBERNUM = "SINGLEMEMBERNUMBER"
Public Const BTL_PRT_ASSEMBLYNUM = "ASSEMBLYNUMBER"
Public Const BTL_PRT_ORDERNUM = "ORDERNUMBER"
Public Const BTL_PRT_DESIGNATION = "DESIGNATION"
Public Const BTL_PRT_ANNOTATION = "ANNOTATION"
Public Const BTL_PRT_STOREY = "STOREY"
Public Const BTL_PRT_GROUP = "GROUP"
Public Const BTL_PRT_PACKAGE = "PACKAGE"
Public Const BTL_PRT_TIMBERGRADE = "TIMBERGRADE"
Public Const BTL_PRT_QUALITYGRADE = "QUALITYGRADE"
Public Const BTL_PRT_COLOUR = "COLOUR"
Public Const BTL_PRT_PLANINGLENGTH = "PLANINGLENGTH"
Public Const BTL_PRT_STARTOFFSET = "STARTOFFSET"
Public Const BTL_PRT_ENDOFFSET = "ENDOFFSET"
Public Const BTL_PRT_UID = "UID"
Public Const BTL_PRT_TRANSFORMATION = "TRANSFORMATION"
Public Const BTL_PRT_CAMBER = "CAMBER"
Public Const BTL_PRT_PARTOFFSET = "PARTOFFSET"
Public Const BTL_PRT_PROCESSINGQUALITY = "PROCESSINGQUALITY"
Public Const BTL_PRT_RECESS = "RECESS"
Public Const BTL_PRT_STOREYTYPE = "STOREYTYPE"
Public Const BTL_PRT_ELEMENTNUM = "ELEMENTNUMBER"
Public Const BTL_PRT_LAYER = "LAYER"
Public Const BTL_PRT_MODULENUM = "MODULENUMBER"
'Friend Const BTL_PRT_USERATTRIBUTE = "USERATTRIBUTE"
Friend Const BTL_PRT_COMMENT = "COMMENT"
Friend Const BTL_PRT_GRAINDIR = "GRAINDIRECTION"
Friend Const BTL_PRT_REFSIDE = "REFERENCESIDE"
Friend Const BTL_PRT_ALIGNMENT = "ALIGNMENT"
Friend Const BTL_PRT_MATERIALTYPE = "MATERIALTYPE"
Public Const BTL_PRT_COMMENT = "COMMENT"
Public Const BTL_PRT_GRAINDIR = "GRAINDIRECTION"
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
Friend Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
Friend Const BTL_GEN_PROJNAME = "PROJECTNAME"
Friend Const BTL_GEN_PROJPART = "PROJECTPART"
Friend Const BTL_GEN_PROJGUID = "PROJECTGUID"
Friend Const BTL_GEN_LISTNAME = "LISTNAME"
Friend Const BTL_GEN_CUSTOMER = "CUSTOMER"
Friend Const BTL_GEN_ARCHITECT = "ARCHITECT"
Friend Const BTL_GEN_EDITOR = "EDITOR"
Friend Const BTL_GEN_DELIVDATE = "DELIVERYDATE"
Friend Const BTL_GEN_EXPDATE = "EXPORTDATE"
Friend Const BTL_GEN_EXPTIME = "EXPORTTIME"
Friend Const BTL_GEN_EXPRELEASE = "EXPORTRELEASE"
Friend Const BTL_GEN_LANGUAGE = "LANGUAGE"
Friend Const BTL_GEN_RANGE = "RANGE"
Friend Const BTL_GEN_COMPUTERNAME = "COMPUTERNAME"
Friend Const BTL_GEN_USER = "USER"
Friend Const BTL_GEN_SRCFILE = "SOURCEFILE"
Friend Const BTL_GEN_EXPFILE = "EXPORTFILE"
Friend Const BTL_GEN_USERATTRIBUTE = "USERATTRIBUTE"
Public Const BTL_GEN_BTLPATH = "BTL"
Public Const BTL_GEN_PROJNUM = "PROJECTNUMBER"
Public Const BTL_GEN_PROJNAME = "PROJECTNAME"
Public Const BTL_GEN_PROJPART = "PROJECTPART"
Public Const BTL_GEN_PROJGUID = "PROJECTGUID"
Public Const BTL_GEN_PROJTYPE = "PROJECTTYPE"
Public Const BTL_GEN_LISTNAME = "LISTNAME"
Public Const BTL_GEN_CUSTOMER = "CUSTOMER"
Public Const BTL_GEN_ARCHITECT = "ARCHITECT"
Public Const BTL_GEN_EDITOR = "EDITOR"
Public Const BTL_GEN_DELIVDATE = "DELIVERYDATE"
Public Const BTL_GEN_EXPDATE = "EXPORTDATE"
Public Const BTL_GEN_EXPTIME = "EXPORTTIME"
Public Const BTL_GEN_EXPRELEASE = "EXPORTRELEASE"
Public Const BTL_GEN_LANGUAGE = "LANGUAGE"
Public Const BTL_GEN_RANGE = "RANGE"
Public Const BTL_GEN_COMPUTERNAME = "COMPUTERNAME"
Public Const BTL_GEN_USER = "USER"
Public Const BTL_GEN_SRCFILE = "SOURCEFILE"
Public Const BTL_GEN_EXPFILE = "EXPORTFILE"
Public Const BTL_GEN_USERATTRIBUTE = "USERATTRIBUTE"
Friend Const PROCESSINGS As String = "Processings"
Friend Const OUTLINE As String = "Outline"
Friend Const BTL_FTR_GRP As String = "GRP"
Friend Const BTL_FTR_PRC As String = "PRC"
Friend Const BTL_FTR_DO As String = "DO"
Friend Const BTL_FTR_SIDE As String = "SIDE"
Friend Const BTL_FTR_NAME As String = "NAME"
Friend Const BTL_FTR_DES As String = "DES"
Friend Const BTL_FTR_PRID As String = "PRID"
Friend Const BTL_FTR_FRAME As String = "FRAME"
Public Const PROCESSINGS As String = "Processings"
Public Const OUTLINE As String = "Outline"
Public Const BTL_FTR_GRP As String = "GRP"
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_NAME As String = "NAME"
Public Const BTL_FTR_DES As String = "DES"
Public Const BTL_FTR_PRID As String = "PRID"
Public Const BTL_FTR_FRAME As String = "FRAME"
Public Const BTL_FTR_MAINID As String = "MAINID"
Public Const BTL_FTR_ADJID As String = "ADJID"
Public Const BTL_FTR_AUXID As String = "AUXID"
' parametri machgroup grezzi
Friend Const MGR_RPT_ID As String = "ID"
Friend Const MGR_RPT_L As String = "L"
Friend Const MGR_RPT_W As String = "W"
Friend Const MGR_RPT_H As String = "H"
Friend Const MGR_RPT_WASTE As String = "WASTE"
Friend Const MGR_RPT_USAGE As String = "USAGE"
Friend Const MGR_RPT_STARTCUT As String = "STARTCUT"
Friend Const MGR_RPT_MATERIAL As String = "MATERIAL"
Public Const MGR_RPT_ID As String = "ID"
Public Const MGR_RPT_L As String = "L"
Public Const MGR_RPT_W As String = "W"
Public Const MGR_RPT_H As String = "H"
Public Const MGR_RPT_WASTE As String = "WASTE"
Public Const MGR_RPT_USAGE As String = "USAGE"
Public Const MGR_RPT_STARTCUT As String = "STARTCUT"
Public Const MGR_RPT_MATERIAL As String = "MATERIAL"
Friend Const MGR_PRT_PDN As String = "PDN"
Friend Const MGR_PRT_L As String = "L"
Friend Const MGR_PRT_W As String = "W"
Friend Const MGR_PRT_H As String = "H"
Friend Const MGR_PRT_DES As String = "DES"
Friend Const MGR_PRT_STARTCUT As String = "STARTCUT"
Friend Const MGR_PRT_MATERIAL As String = "MATERIAL"
Public Const MGR_PRT_PDN As String = "PDN"
Public Const MGR_PRT_L As String = "L"
Public Const MGR_PRT_W As String = "W"
Public Const MGR_PRT_H As String = "H"
Public Const MGR_PRT_DES As String = "DES"
Public Const MGR_PRT_STARTCUT As String = "STARTCUT"
Public Const MGR_PRT_MATERIAL As String = "MATERIAL"
Public Const MGR_PRT_DO As String = "DO"
Public Const MGR_PRT_ROT As String = "ROT"
Public Const MGR_PRT_FLIP As String = "FLIP"
Public Const MGR_PRT_POSX As String = "POSX"
Public Const MGR_PRT_POSY As String = "POSY"
Friend Const MGR_FTR_GRP As String = "GRP"
Friend Const MGR_FTR_PRC As String = "PRC"
Friend Const MGR_FTR_DO As String = "DO"
Friend Const MGR_FTR_SIDE As String = "SIDE"
Friend Const MGR_FTR_NAME As String = "NAME"
Friend Const MGR_FTR_DES As String = "DES"
Friend Const MGR_FTR_PRID As String = "PRID"
Friend Const MGR_FTR_FRAME As String = "FRAME"
Public Const MGR_FTR_GRP As String = "GRP"
Public Const MGR_FTR_PRC As String = "PRC"
Public Const MGR_FTR_DO As String = "DO"
Public Const MGR_FTR_SIDE As String = "SIDE"
Public Const MGR_FTR_NAME As String = "NAME"
Public Const MGR_FTR_DES As String = "DES"
Public Const MGR_FTR_PRID As String = "PRID"
Public Const MGR_FTR_FRAME As String = "FRAME"
' parametri creazione barre
Friend Const MGR_RPT_BARLEN As String = "BARLEN"
Friend Const MGR_RPT_BARHEIGHT As String = "BARHEIGHT"
Friend Const MGR_RPT_BARWIDTH As String = "BARWIDTH"
Friend Const MGR_RPT_PANELLEN As String = "PANELLEN"
Friend Const MGR_RPT_PANELWIDTH As String = "PANELWIDTH"
Friend Const MGR_RPT_PANELHEIGHT As String = "PANELHEIGHT"
Friend Const MGR_RPT_PART As String = "PART"
Public Const MGR_RPT_BARLEN As String = "BARLEN"
Public Const MGR_RPT_BARHEIGHT As String = "BARHEIGHT"
Public Const MGR_RPT_BARWIDTH As String = "BARWIDTH"
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
Public Const MGR_RPT_PRODID As String = "PRODID"
Public Const MGR_RPT_PATTID As String = "PATTID"
' parametri errori integration
Friend Const ITG_CUTID As String = "CUTID"
Friend Const ITG_TASKID As String = "TASKID"
Friend Const ITG_PROJ_ERR As String = "PROJ_ERR"
Friend Const ITG_PROJ_MSG As String = "PROJ_MSG"
Friend Const ITG_PROJ_ROT As String = "PROJ_ROT"
Friend Const ITG_PROJ_FALL As String = "PROJ_FALL"
Friend Const ITG_PROJ_TIME As String = "PROJ_TIME"
Public Const ITG_CUTID As String = "CUTID"
Public Const ITG_TASKID As String = "TASKID"
Public Const ITG_PROJ_ERR As String = "PROJ_ERR"
Public Const ITG_PROJ_MSG As String = "PROJ_MSG"
Public Const ITG_PROJ_ROT As String = "PROJ_ROT"
Public Const ITG_PROJ_FALL As String = "PROJ_FALL"
Public Const ITG_PROJ_TIME As String = "PROJ_TIME"
' parametri errori integration
Friend Const ITG_PROD_ERR As String = "PROD_ERR"
Friend Const ITG_PROD_MSG As String = "PROD_MSG"
Friend Const ITG_PROD_ROT As String = "PROD_ROT"
Friend Const ITG_PROD_TIME As String = "PROD_TIME"
Public Const ITG_PROD_ERR As String = "PROD_ERR"
Public Const ITG_PROD_MSG As String = "PROD_MSG"
Public Const ITG_PROD_ROT As String = "PROD_ROT"
Public Const ITG_PROD_FALL As String = "PROD_FALL"
Public Const ITG_PROD_TIME As String = "PROD_TIME"
' parametri blocco rot e flip
Public Const LOCK_ROT As String = "MANUALROT"
Public Const LOCK_FLIP As String = "MANUALFLIP"
' parametri errori integration
Friend Const DUPLO_TODELETE As String = "DUPLO_TODELETE"
Public Const DUPLO_TODELETE As String = "DUPLO_TODELETE"
' parametri warehouse
Friend Const WRH_BEAM As String = "BEAM"
Friend Const WRH_WALL As String = "WALL"
Friend Const WRH_CURRENT As String = "Current"
Friend Const WRH_STARTOFFSET As String = "StartOffset"
Friend Const WRH_OFFSET As String = "Offset"
Friend Const WRH_L As String = "L"
Friend Const WRH_KERF As String = "Kerf"
Friend Const WRH_S As String = "S"
Public Const WRH_BEAM As String = "BEAM"
Public Const WRH_WALL As String = "WALL"
Public Const WRH_CURRENT As String = "Current"
Public Const WRH_STARTOFFSET As String = "StartOffset"
Public Const WRH_OFFSET As String = "Offset"
Public Const WRH_RANGE As String = "Range"
Public Const WRH_QUANTITY As String = "Quantity"
Public Const WRH_L As String = "L"
Public Const WRH_KERF As String = "Kerf"
Public Const WRH_S As String = "S"
' parametri import/export
Public Const EXP_PROJ As String = "EXPORTPROJ"
Public Const EXP_PROD As String = "EXPORTPROD"
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"
End Module
@@ -0,0 +1,20 @@
Public Module ConstColumns
Public Const COL_DO As String = "colDO"
Public Const COL_VALUE As String = "colVALUE"
Public Const COL_CUSTOM As String = "colCUSTOM"
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"
Public Const COL_POSY As String = "colPOSY"
Public Const COL_OFFSET As String = "colOFFSET"
Public Const COL_REDO As String = "colREDO"
Public Const COL_TYPE As String = "colTYPE"
Public Const COL_DESCRIPTION As String = "colDESCRIPTION"
Public Const COL_SUPERVISORID As String = "colSUPERVISORID"
End Module
@@ -0,0 +1,35 @@
Public Module ConstDataGridColumnsIni
Public Const DATAGRIDCOLUMNS_FILE_NAME As String = "DataGridColumns.ini"
Public Const S_FEATURELIST As String = "DG_FeatureList"
Public Const S_OPENPROJFILEDLG_PROJ As String = "DG_OpenProjectFileDialog_PROJ"
Public Const S_OPENPROJFILEDLG_PROD As String = "DG_OpenProjectFileDialog_PROD"
Public Const S_RAWPARTLIST_BEAM As String = "DG_RawPartList_BEAM"
Public Const S_RAWPARTLIST_WALL As String = "DG_RawPartList_WALL"
Public Const S_PARTINRAWPARTLIST_BEAM As String = "DG_PartInRawPartList_BEAM"
Public Const S_PARTINRAWPARTLIST_WALL As String = "DG_PartInRawPartList_WALL"
Public Const S_PARAMETERLIST_P As String = "DG_ParameterList_P"
Public Const S_PARAMETERLIST_Q As String = "DG_ParameterList_Q"
Public Const S_DUPLOPARAMETERLIST_Q As String = "DG_DuploParameterList_Q"
Public Const S_RAWPARTLIST_SUPERVISOR As String = "DG_RawPartList_SUPERVISOR"
Public Const S_PARTINRAWPARTLIST_SUPERVISOR As String = "DG_PartInRawPartList_SUPERVISOR"
Public Const S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR As String = "DG_FeatureInPartInRawPartList_SUPERVISOR"
Public Const S_PARTLIST As String = "DG_PartList"
Public Const S_FEATUREINPARTINRAWPARTLIST As String = "DG_FeatureInPartInRawPartList"
Public Const S_STATISTICS As String = "DG_Statistics"
Public Const S_OPTIMIZERSTATISTICS As String = "DG_OptimizerStatistics"
Public Const S_RAWPARTSTATISTICS As String = "DG_RawPartStatistics"
Public Const S_BEAMMACHININGS As String = "DG_BeamMachinings"
Public Const S_SPARAMLIST_BEAM As String = "DG_SParamList_BEAM"
Public Const S_SPARAMLIST_WALL As String = "DG_SParamList_WALL"
Public Const S_SECTXMATLIST_BEAM As String = "DG_SectXMatList_BEAM"
Public Const S_SECTXMATLIST_WALL As String = "DG_SectXMatList_WALL"
Public Const S_VARIABLESLIST As String = "DG_VariablesList"
Public Const S_MDICOMMANDS As String = "DG_MDICommands"
Public Const S_MACHINELOG As String = "DG_MachineLog"
Public Const S_UPDATEBTLPARTLIST As String = "DG_UpdateBTLPartList"
Public Const K_LOCKTABLE As String = "LockTable"
End Module
+13
View File
@@ -0,0 +1,13 @@
Public Class ConstDims
Public Const DIMENSIONS_FILE_NAME As String = "Dimensions.ini"
Public Const PROJECT_VIEW As String = "Project_View"
Public Const PROJECT_OPTIMIZER As String = "Project_Optimizer"
Public Const LEFTPANEL_VIEW As String = "LeftPanel_View"
Public Const LEFTPANEL_OPTIMIZER As String = "LeftPanel_Optimizer"
Public Const TOPPANEL_OPTIMIZER As String = "TopPanel_Optimizer"
Public Const LEFTPANEL_SUPERVISOR As String = "LeftPanel_Supervisor"
Public Const PROJECT_SUPERVISOR As String = "Project_Supervisor"
End Class
@@ -11,7 +11,7 @@
'
'----------------------------------------------------------------------------
Module ConstGen
Public Module ConstGen
' File con direttorio radice dei dati
Public Const DAT_FILE_NAME As String = "DataRoot.Ini"
@@ -30,38 +30,29 @@ Module ConstGen
MACHINING = 1
SUPERVISOR = 2
CONFIG = 3
INPUTS = 4
OUTPUTS = 5
End Enum
' Abilitazioni licenza
Friend Enum KEY_OPT As UInteger
CUT_BASE = 1 ' Prodotto OmagCUT
MAN_MANIP = 2
AUTO_MANIP = 4
MAN_PHOTO = 8
AUTO_PHOTO = 16
AUTO_NESTING = 32
ENABLE_MILL = 64
PROCUCTION_LINE = 128
OFFICE_BASE = 256 ' Prodotto OmagOFFICE
VM_MULTI = 512
UNDER_CUT = 1024
CSV_SIMPLE = 2048
PHOTO_BASE = 4096 ' Prodotto OmagPHOTO
TRF_IMPORT = 8192
MOVE_PARTS = 16384
IMPORT_SLABDXF = 32768
CURVED_FRAME = 65536
ENABLE_WJ = 131072
Public Enum KEY_OPT As UInteger
BEAM = 1
WALL = 2
NESTING_AUTO = 4
SUPERVISOR = 8
NETWORK = 16
ANY_DB = 32
End Enum
' File di log generale
Public Const GENLOG_FILE_NAME As String = "EgtBEAMWALLLog#.txt"
Public Const VWOPTGENLOG_FILE_NAME As String = "EgtBEAMWALL.ViewerOptimizerLog#.txt"
Public Const SUPGENLOG_FILE_NAME As String = "EgtBEAMWALL.SupervisorLog#.txt"
' Sottodirettorio di configurazione
Public Const CONF_DIR As String = "Config"
' Sottodirettorio delle risorse
Public Const RES_DIR As String = "Resources"
' Sottodirettorio temporaneo
' Sottodirettorio temporaneo
Public Const TEMP_DIR As String = "Temp"
' Sottodirettorio per Cam automatico
Public Const PROJS_DIR As String = "Projs"
@@ -83,5 +74,9 @@ Module ConstGen
Public Const TOOLMAKERS_DFL_DIR As String = "ToolMakers"
' Nome file Lua con le funzioni di attrezzaggio
Public Const SETUP_LUA As String = "SetUp.lua"
' Nome eseguibile per stampa
Public Const ZEBRAPRINTER_EXE As String = "ZebraPrinterUtilitiesD32.exe"
' Sottodirettorio di default per macro
Public Const MACRO_DFL_DIR As String = "Macro"
End Module
+154
View File
@@ -0,0 +1,154 @@
'----------------------------------------------------------------------------
' EgalTech 2015-2015
'----------------------------------------------------------------------------
' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
' Contenuto : Modulo costanti sezione e chiavi per file Ini.
'
'
'
' Modifiche : 12.02.15 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Public Module ConstIni
Public Const INI_FILE_NAME As String = "EgtBEAMWALL.ini"
'Public Const S_GENERAL As String = "General"
'Public Const K_DEBUG As String = "Debug"
'Public Const K_LICENCE As String = "Licence"
'Public Const K_USERLEVEL As String = "UserLevel"
'Public Const K_MAXINST As String = "MaxInstances"
Public Const K_MAXCAMINST As String = "MaxCamInstances"
Public Const K_VIEWOPTIM_INSTANCES As String = "ViewOptimInstances"
Public Const K_SUPERVISOR_INSTANCES As String = "SupervisorInstances"
'Public Const K_COMMANDLOG As String = "CommandLog"
'Public Const K_MESSAGESDIR As String = "MessagesDir"
'Public Const K_MESSAGES As String = "Messages"
'Public Const K_WINPLACE As String = "WinPlace"
Public Const K_VIEWOPTIMWINPLACE As String = "ViewOptimWinPlace"
Public Const K_SUPERVISORWINPLACE As String = "SupervisorWinPlace"
'Public Const K_LASTPROJ As String = "LastProj"
'Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj"
Public Const K_LASTIMPDIR As String = "LastImpDir"
Public Const K_LASTNGEXPDIR As String = "LastNgexpDir"
Public Const K_LASTUPDATEDIR As String = "LastUpdateDir"
Public Const K_PROJSINDEX As String = "ProjsIndex"
Public Const K_PRODSINDEX As String = "ProdsIndex"
'Public Const K_SUPPORT As String = "Support"
Public Const K_DBADDRESS As String = "DbAddress"
Public Const K_DBMASTERKEY As String = "DbMasterKey"
Public Const K_SHAREDFOLDER As String = "SharedFolder"
Public Const K_UPDATEBTL As String = "UpdateBtl"
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"
'Public Const S_LUA As String = "Lua"
'Public Const K_LIBSDIR As String = "LibsDir"
'Public Const K_BASELIB As String = "BaseLib"
'Public Const S_GEOMDB As String = "GeomDB"
'Public Const K_DEFAULTFONT As String = "DefaultFont"
'Public Const K_NFEFONTDIR As String = "NfeFontDir"
'Public Const K_DEFAULTCOLOR As String = "DefaultColor"
'Public Const K_SAVETYPE As String = "SaveType"
'Public Const S_OPENGL As String = "OpenGL"
'Public Const K_DOUBLEBUFFER As String = "DoubleBuffer"
'Public Const K_COLORBITS As String = "ColorBits"
'Public Const K_DEPTHBITS As String = "DepthBits"
'Public Const K_DRIVER As String = "Driver"
'Public Const S_SCENE As String = "Scene"
'Public Const K_BACKTOP As String = "BackTop"
'Public Const K_BACKBOTTOM As String = "BackBottom"
'Public Const K_SHOWGFRAME As String = "ShowGFrame"
'Public Const K_MARK As String = "Mark"
'Public Const K_SELSURF As String = "SelSurf"
'Public Const K_SHOWMODE As String = "ShowMode"
Public Const K_SHOWBUILDING As String = "ShowBuilding"
'Public Const K_CURVEDIR As String = "CurveDir"
'Public Const K_SHOWTRIAADV As String = "ShowTriaAdv"
'Public Const K_SHOWZMAP As String = "ShowZmap"
'Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels"
'Public Const K_ZOOMWIN As String = "ZoomWin"
'Public Const K_DISTLINE As String = "DistLine"
'Public Const K_MMUNITS As String = "MmUnits"
'Public Const S_GRID As String = "Grid"
'Public Const K_SHOWGRID As String = "ShowGrid"
'Public Const K_SHOWFRAME As String = "ShowFrame"
'Public Const K_SNAPSTEP As String = "SnapStep"
'Public Const K_SNAPSTEPINCH As String = "SnapStepInch"
'Public Const K_MINLINESSTEP As String = "MinLineSStep"
'Public Const K_MAJLINESSTEP As String = "MajLineSStep"
'Public Const K_EXTSSTEP As String = "ExtSStep"
'Public Const K_MINLNCOLOR As String = "MinLnColor"
'Public Const K_MAJLNCOLOR As String = "MajLnColor"
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"
'Public Const K_TOOLMAKERSDIR As String = "ToolMakersDir"
'Public Const K_CURRMACH As String = "CurrMach"
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"
'Public Const K_SLIDERVAL As String = "SliderVal"
Public Const S_BEAM As String = "Beam"
Public Const K_CALCPATH As String = "CalcPath"
Public Const K_BEAMBASEDIR As String = "BaseDir"
Public Const K_BEAMBWEEXEC As String = "BweExec"
Public Const S_WALL As String = "Wall"
Public Const K_WALLBASEDIR As String = "BaseDir"
Public Const K_WALLBWEEXEC As String = "BweExec"
'Public Const S_NEST As String = "Nest"
Public Const K_NESTEXEC As String = "NestExec"
Public Const K_FLIPROT As String = "FlipRot"
Public Const K_SECTIONTIME As String = "SectionTime"
Public Const K_PARTTIME As String = "PartTime"
Public Const K_RAWPARTDEF As String = "RawPartDefinition"
Public Const K_MANUALNEST As String = "ManualNest"
Public Const K_LDINTERSOTHER As String = "LDIntersOther"
Public Const K_MINSCORE As String = "MinScore"
Public Const S_BEAMWALL As String = "BeamWall"
Public Const K_BEAMWALLENABLE As String = "BtlEnable"
Public Const K_BEAMWALLBASEDIR As String = "BaseDir"
Public Const K_BEAMWALLBUTTON As String = "Button"
Public Const S_MRUPROJFILES As String = "MruProjFiles"
Public Const S_MRUPRODFILES As String = "MruProdFiles"
Public Const S_MRUSUPERVISORPRODFILES As String = "MruSupervisorProdFiles"
Public Const S_PRINTER As String = "Printer"
Public Const K_LINK As String = "Link"
Public Const K_ENABLE As String = "Enable"
Public Const K_ZEBRAUTILITIES As String = "ZebraUtilities"
Public Const K_TEMPLATE As String = "Template"
Public Const S_BEAM_LIST As String = "Beam_List"
Public Const S_WALL_LIST As String = "Wall_List"
Public Const S_WAREHOUSE As String = "Warehouse"
Public Const K_TYPE As String = "Type"
Public Const K_DEFAULTQUANTITY As String = "DefaultQuantity"
End Module
@@ -0,0 +1,60 @@
Public Module ConstMachComm
Public Enum ResultTypes As Integer
NULL = 0
EXECUTED = 1
RESULT = 2
End Enum
Public Enum CommandTypes As Integer
ERROR_ = 1
CONNECT = 2
DISCONNECT = 3
START = 4
SOFTSTART = 5
STOP_ = 6
RESET = 7
STEP_ = 8
SETPOINT = 9
SENDPROG = 10
REMOVEPROG = 11
REMOVEALLPROG = 12
READ_TPA = 13
WRITE = 14
DELETEALARMS = 15
SETOPMODE = 16
READ_NUMFLEXIUM = 17
STOPREAD_NUMFLEXIUM = 18
MDI = 19
SETCHANNEL = 20
End Enum
Public Enum LogCommandTypes As Integer
NULL = 0
ERROR_ = 1
CONNECT = 2
DISCONNECT = 3
START = 4
SOFTSTART = 5
STOP_ = 6
RESET = 7
STEP_ = 8
SETPOINT = 9
SENDPROG = 10
REMOVEPROG = 11
REMOVEALLPROG = 12
READ = 13
WRITE = 14
DELETEALARMS = 15
SETOP = 16
ALARM = 17
NEWOP = 18
End Enum
Public Enum CommandStates As Integer
NULL = 0
ERROR_ = 1
OK = 2
End Enum
End Module
@@ -0,0 +1,28 @@
Public Module ConstMachIni
Public Const MACH_INI_FILE_NAME As String = "MachData.ini"
Public Const GETBEAMDATA_FILE_NAME As String = "GetBeamData.lua"
Public Const GETWALLDATA_FILE_NAME As String = "GetWallData.lua"
Public Const GETTS3DATA_FILE_NAME As String = "GetTs3Data.lua"
Public Const K_NCTYPE As String = "NCType"
Public Const K_CONNECTIONSTRING As String = "ConnectionString"
Public Const S_CHANNELS As String = "Channels"
' Variables della macchina corrente
Public Const S_MAINVARIABLES As String = "MainVariables"
Public Const S_VARIABLES As String = "Variables"
Public Const S_INPUTVARIABLES As String = "InputVariables"
Public Const S_OUTPUTVARIABLES As String = "OutputVariables"
Public Const S_MDI As String = "MDI"
Public Const K_BEAM As String = "Beam"
Public Const K_WALL As String = "Wall"
Public Const K_SCRIPT As String = "Scripts"
Public Const K_SETUP As String = "Setup"
Public Const K_FLOW As String = "Flow"
Public Const TS3DATA_FILE As String = "Ts3Data.lua"
End Module
@@ -1,4 +1,4 @@
Module ConstMsg
Public Module ConstMsg
Public Const MSG_SETUPERRORS As Integer = 5000 + 1470
@@ -0,0 +1,18 @@
Public Class PartAddedEventArgs
Inherits EventArgs
Public m_NewPart As PartM
Public Property NewPart As PartM
Get
Return m_NewPart
End Get
Private Set(value As PartM)
m_NewPart = value
End Set
End Property
Sub New(NewBTLFeature As PartM)
Me.NewPart = NewBTLFeature
End Sub
End Class
+95 -24
View File
@@ -10,8 +10,9 @@
<AssemblyName>EgtBEAMWALL.Core</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -21,6 +22,7 @@
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>EgtBEAMWALL.Core.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -30,6 +32,7 @@
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>EgtBEAMWALL.Core.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
@@ -45,15 +48,18 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="EgtUILib">
<HintPath>..\dll\EgtUILib.dll</HintPath>
<HintPath>..\ExtLibs\EgtUILib.dll</HintPath>
</Reference>
<Reference Include="EgtWPFLib5">
<HintPath>..\dll\EgtWPFLib5.dll</HintPath>
<HintPath>..\ExtLibs\EgtWPFLib5.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@@ -71,21 +77,54 @@
<Import Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="Beam.vb" />
<Compile Include="BeamMachGroup.vb" />
<Compile Include="Model\BTLParamAddedEventArgs.vb" />
<Compile Include="Model\BTLFeatureM.vb" />
<Compile Include="Model\BTLParamM.vb" />
<Compile Include="Model\BTLFeatureAddedEventArgs.vb" />
<Compile Include="Model\BTLPartAddedEventArgs.vb" />
<Compile Include="Model\BTLPartM.vb" />
<Compile Include="Model\BTLStructureM.vb" />
<Compile Include="BTLViewModel\BTLFeatureVM.vb" />
<Compile Include="CALCPanel\CalcEditEndEventArgs.vb" />
<Compile Include="Constants\ConstColumns.vb" />
<Compile Include="Constants\ConstDataGridColumnsIni.vb" />
<Compile Include="Constants\ConstDims.vb" />
<Compile Include="Constants\ConstGen.vb" />
<Compile Include="Constants\ConstIni.vb" />
<Compile Include="Constants\ConstMachComm.vb" />
<Compile Include="Constants\ConstMachIni.vb" />
<Compile Include="Constants\ConstMsg.vb" />
<Compile Include="EgtDataGrid\EgtDataGrid.xaml.vb">
<DependentUpon>EgtDataGrid.xaml</DependentUpon>
</Compile>
<Compile Include="EgtDataGrid\DataGridColumnsIniFile.vb" />
<Compile Include="CALCPanel\CalcProcessEndEventArgs.vb" />
<Compile Include="CALCPanel\CalcResultEventArgs.vb" />
<Compile Include="CALCPanel\CalcEndEventArgs.vb" />
<Compile Include="CALCPanel\CalcIntegration.vb" />
<Compile Include="DataAccess\PartAddedEventArgs.vb" />
<Compile Include="DataAccess\BTLParamAddedEventArgs.vb" />
<Compile Include="Lib\MachGroupAddedEventArgs.vb" />
<Compile Include="Lib\MachGroupVM.vb" />
<Compile Include="Lib\NewMachGroupPanelVM.vb" />
<Compile Include="BTLModel\BTLFeatureM.vb" />
<Compile Include="BTLModel\BTLParamM.vb" />
<Compile Include="DataAccess\BTLFeatureAddedEventArgs.vb" />
<Compile Include="DataAccess\BTLPartAddedEventArgs.vb" />
<Compile Include="BTLModel\BTLPartM.vb" />
<Compile Include="BTLModel\BTLStructureM.vb" />
<Compile Include="Constants\ConstBeam.vb" />
<Compile Include="Enum.vb" />
<Compile Include="LoadingWnd\LoadingWndHelper.vb" />
<Compile Include="LoadingWnd\LoadingWndV.xaml.vb">
<DependentUpon>LoadingWndV.xaml</DependentUpon>
</Compile>
<Compile Include="LoadingWnd\LoadingWndVM.vb" />
<Compile Include="Utility\DimensionsIniFile.vb" />
<Compile Include="Utility\Enum.vb" />
<Compile Include="MachGroupPanel\MyMachGroupPanelVM.vb" />
<Compile Include="MachGroupPanel\MyMachGroupVM.vb" />
<Compile Include="MachGroupPanel\PartVM.vb" />
<Compile Include="Utility\GridDimension.vb" />
<Compile Include="Utility\LuaMsgManager.vb" />
<Compile Include="Utility\MachLog.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
@@ -97,17 +136,31 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="MyMachGroup.vb" />
<Compile Include="Part.vb" />
<Compile Include="ProdFileM.vb" />
<Compile Include="ProjectFileM.vb" />
<Compile Include="ProjFileM.vb" />
<Compile Include="SectionXMaterial.vb" />
<Compile Include="MachGroupModel\MyMachGroupM.vb" />
<Compile Include="Lib\MachGroupM.vb" />
<Compile Include="Lib\MachGroupPanelM.vb" />
<Compile Include="MachGroupModel\MyMachGroupPanelM.vb" />
<Compile Include="Utility\ManageWindow.vb" />
<Compile Include="Utility\MyMachine.vb" />
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml.vb">
<DependentUpon>OpenProjectFileDialogV.xaml</DependentUpon>
</Compile>
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogVM.vb" />
<Compile Include="MachGroupModel\PartM.vb" />
<Compile Include="ProjectFileVM\ProdFileM.vb" />
<Compile Include="ProjectFileVM\ProjectFileM.vb" />
<Compile Include="ProjectManager\ProdFileVM.vb" />
<Compile Include="ProjectManager\ProjectFileVM.vb" />
<Compile Include="ProjectManager\ProjFileVM.vb" />
<Compile Include="ProjectFileVM\ProjFileM.vb" />
<Compile Include="Utility\SectionXMaterial.vb" />
<Compile Include="Utility\BTLIniFile.vb" />
<Compile Include="Utility\Command.vb" />
<Compile Include="Utility\VMBase.vb" />
<Compile Include="Wall.vb" />
<Compile Include="WallMachGroup.vb" />
<Compile Include="Utility\CoreMap.vb" />
<Compile Include="Utility\DisableModifiedMgr.vb" />
<Compile Include="ViewPanel\ViewPanelV.xaml.vb">
<DependentUpon>ViewPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="ViewPanel\ViewPanelVM.vb" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
@@ -128,8 +181,26 @@
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Page Include="EgtDataGrid\EgtDataGrid.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="LoadingWnd\LoadingWndV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="OpenProjectFileDialog\OpenProjectFileDialogV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ViewPanel\ViewPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\ViewerOptimizer\EgtBEAMWALL.Core.dll</PostBuildEvent>
<PostBuildEvent>copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.Core.dll</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -0,0 +1,82 @@
Imports System.Collections.ObjectModel
Imports System.Windows.Controls
Imports System.Windows.Forms
Imports EgtUILib
Imports EgtWPFLib5
Public Module DataGridColumnsIniFile
Public m_sDataGridColumnsIniFile As String
' funzione per ottenere dal file INI le colonne da caricare nelle EgtDataGrid del programma
Public Function GetPrivateProfileColumns(ParentDGName As String, ByRef ocColumns As ObservableCollection(Of EgtDataGridColumn)) As Boolean
Dim colIndex As Integer = 0
Dim str = String.Empty
While EgtUILib.GetPrivateProfileString(ParentDGName, colIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0
Dim sColumnParams() As String = str.Split(","c)
' verifico numero minimo di parametri
If sColumnParams.Count >= 9 Then
' cancello spazi
For index = 0 To sColumnParams.Count - 1
sColumnParams(index) = sColumnParams(index).Trim()
Next
' creo colonna
Dim sName = sColumnParams(0)
Dim bReorder As Boolean = sColumnParams(1).Equals("1")
Dim bResize As Boolean = sColumnParams(2).Equals("1")
Dim bSort As Boolean = sColumnParams(3).Equals("1")
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
Dim Width As Double
Dim WidthType As DataGridLengthUnitType
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")
Dim nSortDirection As SortOrder = If(sColumnParams.Count >= 10, CInt(sColumnParams(9)), 0)
ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible, nSortDirection))
End If
colIndex += 1
End While
Return ocColumns.Count > 0
End Function
Public Function WriteColumnPrivateProfileParam(ParentDataGridName As String, DisplayIndex As String, sColumnParams As String) As Boolean
Return WritePrivateProfileString(ParentDataGridName, DisplayIndex, sColumnParams, m_sDataGridColumnsIniFile)
End Function
' funzione per ottenere dal file INI le colonne da caricare nelle EgtDataGrid del programma
Public Function GetPrivateProfileColumn(ParentDGName As String, ByRef Column As EgtDataGridColumn) As Boolean
Dim colIndex As Integer = 0
Dim str = String.Empty
While EgtUILib.GetPrivateProfileString(ParentDGName, colIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0
Dim sColumnParams() As String = str.Split(","c)
' verifico numero minimo di parametri
If sColumnParams.Count >= 9 Then
If Column.Name = sColumnParams(0) Then
' cancello spazi
For index = 0 To sColumnParams.Count - 1
sColumnParams(index) = sColumnParams(index).Trim()
Next
' creo colonna
Dim sName = sColumnParams(0)
Dim bReorder As Boolean = sColumnParams(1).Equals("1")
Dim bResize As Boolean = sColumnParams(2).Equals("1")
Dim bSort As Boolean = sColumnParams(3).Equals("1")
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
Dim Width As Double
Dim WidthType As DataGridLengthUnitType
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")
Dim nSortDirection As SortOrder = If(sColumnParams.Count >= 10, CInt(sColumnParams(9)), 0)
Column = New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible, nSortDirection)
Exit While
End If
End If
colIndex += 1
End While
Return Not IsNothing(Column)
End Function
End Module
@@ -0,0 +1,18 @@
<DataGrid x:Class="EgtDataGrid"
x:Name="CurrDataGrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment"
Value="Stretch" />
<EventSetter Event="SizeChanged"
Handler="Cell_SizedChanged" />
<EventSetter Event="MouseRightButtonDown"
Handler="Cell_MouseRightButtonDown" />
</Style>
</DataGrid.ColumnHeaderStyle>
</DataGrid>
@@ -0,0 +1,598 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Controls.Primitives
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtUILib
Imports EgtWPFLib5
Public Class EgtDataGrid
' vecchio indice da salvare per il Reorder delle colonne
Public OldIndex As Integer = 0
' indice header su cui è aperto il ContextMenu per gestione check/uncheck LockTable
Private HeaderDispIndex As Integer = 0
' somma delle larghezze delle colonne di EgtDataGrid
Private columnsWidth As Double = 0
' larghezza minima dell'ultima colonna per attivare/disattivare ScrollBar orizzontale
Private Const LASTCOLUMN_MINWIDTH As Double = 40
Sub New()
InitializeComponent()
End Sub
Public Shadows Property BindingColumns As ObservableCollection(Of EgtDataGridColumn)
Get
Return CType(MyBase.GetValue(BindingColumnsProperty), ObservableCollection(Of EgtDataGridColumn))
End Get
Set(value As ObservableCollection(Of EgtDataGridColumn))
MyBase.SetValue(BindingColumnsProperty, value)
End Set
End Property
Public Shared ReadOnly BindingColumnsProperty As DependencyProperty = DependencyProperty.Register("BindingColumns", GetType(ObservableCollection(Of EgtDataGridColumn)), GetType(EgtDataGrid), New FrameworkPropertyMetadata(New ObservableCollection(Of EgtDataGridColumn), New PropertyChangedCallback(AddressOf OnDataGridColumnsPropertyChanged)) With {.BindsTwoWayByDefault = True})
Private Shared Sub OnDataGridColumnsPropertyChanged(ByVal source As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
Dim context = TryCast(source, EgtDataGrid)
Dim oldItems = TryCast(e.OldValue, ObservableCollection(Of EgtDataGridColumn))
If oldItems IsNot Nothing Then
For index = 0 To oldItems.Count - 1
Dim Column As DataGridColumn = context.FindResource(oldItems(index))
context.Columns.Remove(Column)
Next
RemoveHandler oldItems.CollectionChanged, AddressOf context.collectionChanged
End If
Dim newItems = TryCast(e.NewValue, ObservableCollection(Of EgtDataGridColumn))
If newItems IsNot Nothing Then
For index = 0 To newItems.Count - 1
Try
Dim col As DataGridColumn = context.FindResource(newItems(index).Name)
newItems(index).InitColumn(col)
context.Columns.Add(col)
Catch ex As Exception
MessageBox.Show(String.Format(EgtMsg(61883), newItems(index).Name, newItems(index).ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
End Try
Next
AddHandler newItems.CollectionChanged, AddressOf context.collectionChanged
End If
End Sub
Private Sub collectionChanged(ByVal sender As Object, ByVal e As NotifyCollectionChangedEventArgs)
Select Case e.Action
Case NotifyCollectionChangedAction.Add
If e.NewItems IsNot Nothing Then
For Each one As EgtDataGridColumn In e.NewItems
Try
Dim col As DataGridColumn = CurrDataGrid.FindResource(one.Name)
one.InitColumn(col)
CurrDataGrid.Columns.Insert(e.NewStartingIndex, col)
If col.DisplayIndex <> e.NewStartingIndex Then
CurrDataGrid.Columns(e.NewStartingIndex).DisplayIndex = e.NewStartingIndex
End If
Catch ex As Exception
MessageBox.Show(String.Format(EgtMsg(61883), one.Name, one.ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
End Try
Next
End If
Case NotifyCollectionChangedAction.Remove
If e.OldItems IsNot Nothing Then
For Each one As EgtDataGridColumn In e.OldItems
Dim col As DataGridColumn = CurrDataGrid.FindResource(one.Name)
CurrDataGrid.Columns.Remove(col)
Next
End If
Case NotifyCollectionChangedAction.Move
'Dim col As DataGridColumn = CurrDataGrid.FindResource(BindingColumns(e.OldStartingIndex))
'col.DisplayIndex = e.NewStartingIndex
CurrDataGrid.Columns.Move(e.OldStartingIndex, e.NewStartingIndex)
CurrDataGrid.Columns(e.NewStartingIndex).DisplayIndex = e.NewStartingIndex
'Dim x = CurrDataGrid.Columns(e.OldStartingIndex).DisplayIndex
Case NotifyCollectionChangedAction.Reset
CurrDataGrid.Columns.Clear()
If e.NewItems IsNot Nothing Then
For Each one As DataGridColumn In e.NewItems
Dim col As DataGridColumn = CurrDataGrid.FindResource(one)
CurrDataGrid.Columns.Add(col)
Next
End If
Case NotifyCollectionChangedAction.Replace
Dim col As DataGridColumn = CurrDataGrid.FindResource(e.NewItems(0))
CurrDataGrid.Columns(e.NewStartingIndex) = col
End Select
End Sub
Private Sub Cell_SizedChanged(sender As Object, e As SizeChangedEventArgs)
' ad ogni ridimensionamento della cella del ColumnHeader salvo le nuove dimensioni nell'ini
If Not IsNothing(e.OriginalSource.Column) AndAlso Not IsNothing(BindingColumns(e.OriginalSource.Column.DisplayIndex)) Then
' se la colonna corrente è Star ed è preceduta da una colonna Pixel non scrivo le modifiche
If Not (e.OriginalSource.Column.Width.IsStar) Then
BindingColumns(e.OriginalSource.Column.DisplayIndex).SaveDataGridColumn()
End If
End If
End Sub
Private Sub DataGrid_SizedChanged(sender As Object, e As SizeChangedEventArgs) Handles CurrDataGrid.SizeChanged
' confronto la larghezza effettiva della EgtDataGrid con la somma delle larghezze delle colonne
UpdateColumnsWidth()
If BindingColumns.Count > 0 Then
If CurrDataGrid.ActualWidth - LASTCOLUMN_MINWIDTH > columnsWidth Then
' nascondo la ScrollBar orizzontale e setto lo UnitType dell'ultima colonna visibile a Star
ScrollViewer.SetHorizontalScrollBarVisibility(CurrDataGrid, ScrollBarVisibility.Hidden)
BindingColumns.Last(Function(x) x.Visible = True).Width = New DataGridLength(1, DataGridLengthUnitType.Star)
Else
' mostro la ScrollBar orizzontale e se UnitType delle colonne è Star lo setto a Pixel
ScrollViewer.SetHorizontalScrollBarVisibility(CurrDataGrid, ScrollBarVisibility.Visible)
For Each bc In BindingColumns
If bc.Width.IsStar Then
bc.Width = New DataGridLength(bc.ActualWidth, DataGridLengthUnitType.Pixel)
End If
Next
End If
' scrivo nell'INI la Width dell'ultima colonna visibile
BindingColumns.Last(Function(x) x.Visible = True).SaveDataGridColumn()
End If
End Sub
Public Sub UpdateColumnsWidth()
' ricalcolo la somma delle larghezze delle colonne visibili
columnsWidth = 0
For Each col In BindingColumns
If col.ColumnVisibility = Visibility.Visible Then
columnsWidth += col.ActualWidth
End If
Next
' alla somma calcolata tolgo la larghezza dell'ultima colonna visibile e aggiungo LASTCOLUMN_MINWIDTH
' (in questo modo si attiva/disattiva la ScrollBar orizzontale non appena l'ultima colonna viene ristretta/estesa a LASTCOLUMN_MINWIDTH px)
If BindingColumns.Count > 0 AndAlso
BindingColumns.Any(Function(x) x.Visible = True) Then
columnsWidth = columnsWidth - BindingColumns.Last(Function(x) x.Visible = True).ActualWidth + LASTCOLUMN_MINWIDTH
End If
End Sub
Private Sub Cell_MouseRightButtonDown(sender As Object, e As RoutedEventArgs)
Dim nDispIndex As Integer = sender.DisplayIndex
' creo il ContextMenu con gli item checkabili
Dim cm As ContextMenu = New ContextMenu()
Dim miReorder As MenuItem = New MenuItem()
Dim miResize As MenuItem = New MenuItem()
Dim miSort As MenuItem = New MenuItem()
Dim sep1 As Separator = New Separator()
Dim miVis As MenuItem = New MenuItem()
Dim sep2 As Separator = New Separator()
Dim miLock As MenuItem = New MenuItem()
Dim miResetSort As MenuItem = New MenuItem()
miReorder.Header = NameOf(EgtDataGridColumn.CanUserReorder)
miResize.Header = NameOf(EgtDataGridColumn.CanUserResize)
miSort.Header = NameOf(EgtDataGridColumn.CanUserSort)
miVis.Header = "Columns Visibility"
miLock.Header = "Lock Table"
miResetSort.Header = "Reset Sort"
miReorder.IsCheckable = True
miResize.IsCheckable = True
miSort.IsCheckable = True
miLock.IsCheckable = True
miResetSort.IsCheckable = False
miReorder.StaysOpenOnClick = True
miResize.StaysOpenOnClick = True
miSort.StaysOpenOnClick = True
miLock.StaysOpenOnClick = True
miResetSort.StaysOpenOnClick = True
' setto il binding
Dim miReorderBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserReorder))
Dim miResizeBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserResize))
Dim miSortBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserSort))
miReorderBinding.Mode = BindingMode.TwoWay
miResizeBinding.Mode = BindingMode.TwoWay
miSortBinding.Mode = BindingMode.TwoWay
miReorder.DataContext = BindingColumns(nDispIndex)
miResize.DataContext = BindingColumns(nDispIndex)
miSort.DataContext = BindingColumns(nDispIndex)
miReorder.SetBinding(MenuItem.IsCheckedProperty, miReorderBinding)
miResize.SetBinding(MenuItem.IsCheckedProperty, miResizeBinding)
miSort.SetBinding(MenuItem.IsCheckedProperty, miSortBinding)
' setto check e enable associati a LockTable
miLock.IsChecked = (GetPrivateProfileInt(BindingColumns(nDispIndex).ParentDataGridName, K_LOCKTABLE, 0, m_sDataGridColumnsIniFile) > 0)
miReorder.IsChecked = If(miLock.IsChecked, False, BindingColumns(nDispIndex).CanUserReorder)
miResize.IsChecked = If(miLock.IsChecked, False, BindingColumns(nDispIndex).CanUserResize)
miReorder.IsEnabled = Not miLock.IsChecked
miResize.IsEnabled = Not miLock.IsChecked
HeaderDispIndex = nDispIndex
AddHandler miLock.Checked, AddressOf miLock_Checked
AddHandler miLock.Unchecked, AddressOf miLock_Unchecked
AddHandler miResetSort.Click, AddressOf miResetSort_Click
' aggiungo i MenuItem al ContextMenu
cm.Items.Add(miReorder)
cm.Items.Add(miResize)
cm.Items.Add(miSort)
cm.Items.Add(sep1)
cm.Items.Add(miVis)
cm.Items.Add(sep2)
cm.Items.Add(miLock)
cm.Items.Add(miResetSort)
' creo e aggiungo gli item figli di Columns Visibility
For Each Column In BindingColumns
Dim mi As MenuItem = New MenuItem()
mi.Header = Column.Name
mi.IsCheckable = True
Dim miBinding As Binding = New Binding(NameOf(EgtDataGridColumn.Visible))
miBinding.Mode = BindingMode.TwoWay
mi.DataContext = Column
mi.SetBinding(MenuItem.IsCheckedProperty, miBinding)
mi.StaysOpenOnClick = True
mi.IsEnabled = Column.CanUserEditVisible
miVis.Items.Add(mi)
Next
' disabilito Columns Visibility se tutti i suoi figli sono disabilitati
Dim bIsEnabled As Boolean = False
For Each visMenuItem In miVis.Items
bIsEnabled = visMenuItem.IsEnabled
Next
cm.Items(4).IsEnabled = bIsEnabled
cm.PlacementTarget = TryCast(sender, Button)
cm.IsOpen = True
End Sub
Private Sub CurrDataGrid_ColumnReordering(sender As Object, e As DataGridColumnEventArgs) Handles CurrDataGrid.ColumnReordering
' conservo il vecchio indice in modo da effettuare lo scambio in BindingColumns una volta riordinate graficamente
OldIndex = e.Column.DisplayIndex
End Sub
Private Sub CurrDataGrid_ColumnReordered(sender As Object, e As DataGridColumnEventArgs) Handles CurrDataGrid.ColumnReordered
' scambio le colonne in BindingColumns
BindingColumns.Move(OldIndex, e.Column.DisplayIndex)
' scrivo tutte le colonne interessate dallo spostamento
' (se OldIndex > e.Column.DisplayIndex, il ciclo non viene eseguito quindi lo faccio nell'altro senso)
For index = OldIndex To e.Column.DisplayIndex
BindingColumns(index).SaveDataGridColumn()
Next
For index = e.Column.DisplayIndex To OldIndex
BindingColumns(index).SaveDataGridColumn()
Next
End Sub
Private Sub miLock_Checked(sender As Object, e As RoutedEventArgs)
Dim miLock = DirectCast(sender, MenuItem)
' disabilito Reorder e Resize di tutte le colonne salvandone prima il valore
For Each Column In BindingColumns
Column.OldCanUserReorder = Column.CanUserReorder
Column.OldCanUserResize = Column.CanUserResize
Column.CanUserReorder = False
Column.CanUserResize = False
Next
' aggiorno il ContextMenu correntemente aperto
Dim miReorder As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(0)
Dim miResize As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(1)
miReorder.IsChecked = False
miResize.IsChecked = False
miReorder.IsEnabled = False
miResize.IsEnabled = False
' scrivo il valore di LockTable nell'INI
WritePrivateProfileString(BindingColumns(HeaderDispIndex).ParentDataGridName, K_LOCKTABLE, 1, m_sDataGridColumnsIniFile)
End Sub
Private Sub miLock_Unchecked(sender As Object, e As RoutedEventArgs)
Dim miLock = DirectCast(sender, MenuItem)
' abilito Reorder e Resize di tutte le colonne ripristinando il valore precedente, se presente
For Each Column In BindingColumns
If Not IsNothing(Column.OldCanUserReorder) Then Column.CanUserReorder = Column.OldCanUserReorder
If Not IsNothing(Column.OldCanUserResize) Then Column.CanUserResize = Column.OldCanUserResize
Next
' aggiorno il ContextMenu correntemente aperto
Dim miReorder As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(0)
Dim miResize As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(1)
miReorder.IsChecked = If(IsNothing(BindingColumns(HeaderDispIndex).OldCanUserReorder), BindingColumns(HeaderDispIndex).CanUserReorder, BindingColumns(HeaderDispIndex).OldCanUserReorder)
miResize.IsChecked = If(IsNothing(BindingColumns(HeaderDispIndex).OldCanUserResize), BindingColumns(HeaderDispIndex).CanUserResize, BindingColumns(HeaderDispIndex).OldCanUserResize)
miReorder.IsEnabled = True
miResize.IsEnabled = True
' scrivo il valore di LockTable nell'INI
WritePrivateProfileString(BindingColumns(HeaderDispIndex).ParentDataGridName, K_LOCKTABLE, 0, m_sDataGridColumnsIniFile)
End Sub
Private Sub miResetSort_Click(sender As Object, e As RoutedEventArgs)
' resetto le SortDirection di tutte le colonne della datagrid
ResetSortDirections()
End Sub
Private Sub CurrDataGrid_Loaded(sender As Object, e As RoutedEventArgs) Handles CurrDataGrid.Loaded
' setto la SortDirection, se attiva, sulla colonna su cui è attiva
Dim colIndex As Integer = 0
For Each col In BindingColumns
If col.SortDirection > 0 Then
CurrDataGrid.Items.SortDescriptions.Add(New SortDescription(CurrDataGrid.Columns(colIndex).SortMemberPath, col.SortDirection - 1))
Exit For
End If
colIndex += 1
Next
' calcolo la somma delle larghezze delle colonne visibili
For Each col In BindingColumns
If col.ColumnVisibility = Visibility.Visible Then
columnsWidth += col.ActualWidth
End If
Next
End Sub
Private Sub CurrDataGrid_Sorting(sender As Object, e As DataGridSortingEventArgs) Handles CurrDataGrid.Sorting
' salvo la SortDirection corrente della colonna prima di resettarla per tutte le colonne
Dim CurrSortDirection As ListSortDirection? = e.Column.SortDirection
ResetSortDirections(True)
' ora applico la SortDirection corretta
Select Case CurrSortDirection
Case ListSortDirection.Ascending
BindingColumns(e.Column.DisplayIndex).SortDirection = 2 ' la setto a Descending
Case ListSortDirection.Descending
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la setto a Ascending
Case Else
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la setto a Ascending
End Select
End Sub
Private Sub ResetSortDirections(Optional bUserClick As Boolean = False)
If bUserClick Then
' nel caso di click dell'utente sulla colonna da sortare occorre solamente settare a 0 la SortDirection di tutte le colonne
For Each column In BindingColumns
column.SortDirection = 0
Next
Else
' altrimenti (caso ResetSort da ContextMenu) è necessatio un Clear più ampio e anche grafico
CurrDataGrid.Items.SortDescriptions.Clear()
For Each column In BindingColumns
column.SortDirection = 0
' resetto graficamente anche l'header della colonna
CurrDataGrid.Columns(column.DisplayIndex).SortDirection = Nothing
Next
End If
End Sub
End Class
Public Class EgtDataGridColumn
Private m_dgColumn As DataGridColumn
Private Property m_ParentDataGridName As String
Public Property ParentDataGridName As String
Get
Return m_ParentDataGridName
End Get
Set(value As String)
m_ParentDataGridName = value
End Set
End Property
Private Property m_Name As String
Public Property Name As String
Get
Return m_Name
End Get
Set(value As String)
m_Name = value
End Set
End Property
Private Property m_Width As DataGridLength
Public Property Width As DataGridLength
Get
Return m_dgColumn.Width
End Get
Set(value As DataGridLength)
If Not IsNothing(m_dgColumn) Then
m_dgColumn.Width = value
Else
m_Width = value
End If
End Set
End Property
Public ReadOnly Property ActualWidth As Double
Get
Return m_dgColumn.ActualWidth
End Get
End Property
Private Property m_DisplayIndex As Integer
Public Property DisplayIndex As Integer
Get
Return m_dgColumn.DisplayIndex
End Get
Set(value As Integer)
If Not IsNothing(m_dgColumn) Then
m_dgColumn.DisplayIndex = value
Else
m_DisplayIndex = value
End If
End Set
End Property
Private Property m_OrigIsReadOnly As Boolean = True
Private Property m_IsReadOnly As Boolean = True
Public Property IsReadOnly As Boolean
Get
Return m_dgColumn.IsReadOnly
End Get
Set(value As Boolean)
If Not IsNothing(m_dgColumn) Then
m_dgColumn.IsReadOnly = value
Else
m_IsReadOnly = value
End If
End Set
End Property
Friend OldCanUserReorder As Boolean?
Private m_CanUserReorder As Boolean
Public Property CanUserReorder As Boolean
Get
Return m_dgColumn.CanUserReorder
End Get
Set(value As Boolean)
If Not IsNothing(m_dgColumn) Then
m_dgColumn.CanUserReorder = value
Else
m_CanUserReorder = value
End If
SaveDataGridColumn()
End Set
End Property
Friend OldCanUserResize As Boolean?
Private m_CanUserResize As Boolean
Public Property CanUserResize As Boolean
Get
Return m_dgColumn.CanUserResize
End Get
Set(value As Boolean)
If Not IsNothing(m_dgColumn) Then
m_dgColumn.CanUserResize = value
Else
m_CanUserResize = value
End If
SaveDataGridColumn()
End Set
End Property
Private m_CanUserSort As Boolean
Public Property CanUserSort As Boolean
Get
Return m_dgColumn.CanUserSort
End Get
Set(value As Boolean)
If Not IsNothing(m_dgColumn) Then
m_dgColumn.CanUserSort = value
Else
m_CanUserSort = value
End If
SaveDataGridColumn()
End Set
End Property
Private m_Visible As Boolean
Public Property Visible As Boolean
Get
Return m_Visible
End Get
Set(value As Boolean)
m_Visible = value
ColumnVisibility = If(m_Visible, Visibility.Visible, Visibility.Collapsed)
SaveDataGridColumn()
End Set
End Property
Private m_ColumnVisibility As Visibility
Public Property ColumnVisibility As Visibility
Get
Return If(m_Visible, Visibility.Visible, Visibility.Collapsed)
End Get
Set(value As Visibility)
m_ColumnVisibility = value
If Not IsNothing(m_dgColumn) Then
m_dgColumn.Visibility = value
' ricavo la EgtDataGrid a cui appartiene la DataGridColumn
Dim propertyInfo As Reflection.PropertyInfo = m_dgColumn.GetType().GetProperty("DataGridOwner",
Reflection.BindingFlags.Instance Or
Reflection.BindingFlags.NonPublic)
Dim dg As EgtDataGrid = propertyInfo.GetValue(m_dgColumn, Nothing)
' ogni colonna visibile con UnitType a Star tranne l'ultima verrà settata a Pixel
For Each bc In dg.BindingColumns
If bc.Width.IsStar And Not bc.Name = dg.BindingColumns.Last(Function(x) x.Visible = True).Name Then
bc.Width = New DataGridLength(bc.ActualWidth, DataGridLengthUnitType.Pixel)
End If
Next
End If
End Set
End Property
Private m_CanUserEditVisible As Boolean
Public Property CanUserEditVisible As Boolean
Get
Return m_CanUserEditVisible
End Get
Set(value As Boolean)
m_CanUserEditVisible = value
SaveDataGridColumn()
End Set
End Property
Private m_SortDirection As Forms.SortOrder = Forms.SortOrder.None
Public Property SortDirection As Forms.SortOrder
Get
Return m_SortDirection 'If(IsNothing(m_dgColumn.SortDirection), 0, m_dgColumn.SortDirection + 1)
End Get
Set(value As Forms.SortOrder)
'If Not IsNothing(m_dgColumn) Then
' If value = 0 Then
' m_dgColumn.SortDirection = Nothing
' Else
' m_dgColumn.SortDirection = value - 1
' End If
'Else
m_SortDirection = value
'End If
SaveDataGridColumn()
End Set
End Property
Sub New(sName As String)
m_Name = sName
End Sub
Sub New(sParentDG As String, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean, nSortDirection As Integer)
m_ParentDataGridName = sParentDG
m_Name = sName
m_CanUserReorder = bCanUserReorder
m_CanUserResize = bCanUserResize
m_CanUserSort = bCanUserSort
m_OrigIsReadOnly = bIsReadOnly
m_IsReadOnly = bIsReadOnly
m_Width = Width
m_Visible = bVisible
m_CanUserEditVisible = bCanUserEditVisible
m_SortDirection = nSortDirection
End Sub
Friend Sub InitColumn(dgColumn As DataGridColumn)
m_dgColumn = dgColumn
m_dgColumn.CanUserReorder = m_CanUserReorder
m_dgColumn.CanUserResize = m_CanUserResize
m_dgColumn.CanUserSort = m_CanUserSort
m_dgColumn.IsReadOnly = m_IsReadOnly
'm_dgColumn.DisplayIndex = m_DisplayIndex
m_dgColumn.Width = m_Width
m_dgColumn.Visibility = m_ColumnVisibility
If CInt(m_SortDirection) > 0 Then
m_dgColumn.SortDirection = m_SortDirection - 1 'If(CInt(m_SortDirection) = 0, Nothing, m_SortDirection - 1)
Else
m_dgColumn.SortDirection = Nothing
End If
End Sub
' funzione per calcolare e scrivere la stringa dei parametri della colonna nell'INI
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(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
End Class
-16
View File
@@ -1,16 +0,0 @@
Public Enum CalcStates As Integer
NOTCALCULATED = -1
OK = 0
WARNING = 1
ERROR_ = 2
End Enum
Public Enum ItemState As Integer
ND = -1
Assigned = 0
Confirmed = 1
WIP = 2
Produced = 3
Scrapped = 4
End Enum
@@ -0,0 +1,18 @@
Public Class MachGroupAddedEventArgs
Inherits EventArgs
Public m_NewMachGroupM As MachGroupM
Public Property NewMachGroupM As MachGroupM
Get
Return m_NewMachGroupM
End Get
Private Set(value As MachGroupM)
m_NewMachGroupM = value
End Set
End Property
Sub New(NewMachGroupM As MachGroupM)
Me.NewMachGroupM = NewMachGroupM
End Sub
End Class
+69
View File
@@ -0,0 +1,69 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows
Imports EgtUILib
Imports EgtWPFLib5
Public Class MachGroupM
Protected m_Id As Integer
Public ReadOnly Property Id As Integer
Get
Return m_Id
End Get
End Property
Protected m_Name As String
Public ReadOnly Property Name As String
Get
Return m_Name
End Get
End Property
Protected m_Machine As String
Public ReadOnly Property Machine As String
Get
Return m_Machine
End Get
End Property
Protected m_IsEnabled As Boolean
Public Property IsEnabled As Boolean
Get
Return m_IsEnabled
End Get
Set(value As Boolean)
m_IsEnabled = value
End Set
End Property
#Region "CONSTRUCTORS"
Protected Sub New()
End Sub
Public Shared Function CreateNewMachGroup() As MachGroupM
Return New MachGroupM
End Function
Public Shared Function CreateMachGroup(nId As Integer, sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New MachGroupM
NewMachGroupM.m_Id = nId
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
Return NewMachGroupM
End Function
Public Shared Function CreateMachGroup(sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New MachGroupM
' Creo il nuovo gruppo di lavorazione con i dati ottenuti a seconda del caso in cui mi trovo
NewMachGroupM.m_Id = EgtAddMachGroup(sName, sMachine)
If NewMachGroupM.m_Id = GDB_ID.NULL Then Return Nothing
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
Return NewMachGroupM
End Function
#End Region ' CONSTRUCTORS
End Class
+251
View File
@@ -0,0 +1,251 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows
Imports EgtUILib
Imports EgtWPFLib5
Public Class MachGroupPanelM
#Region "FIELDS & PROPERTIES"
' Lista delle macchine disponibili
Protected m_MachineList As List(Of Machine)
' Macchina di default
Protected m_DefaultMachine As String = String.Empty
Public ReadOnly Property DefaultMachine As String
Get
Return m_DefaultMachine
End Get
End Property
' Variabile che definisce se il nome è automatico
Protected m_IsGroupNameAutomatic As Boolean = True
' Variabile che definisce se ci sono più gruppi di lavorazione
Protected m_IsMultiMachGroup As Boolean
Public ReadOnly Property IsMultiMachGroup As Boolean
Get
Return m_IsMultiMachGroup
End Get
End Property
' Nome base dei gruppi
Protected m_BaseName As String
Protected m_MachGroupMList As New List(Of MachGroupM)
Public Property MachGroupMList As List(Of MachGroupM)
Get
Return m_MachGroupMList
End Get
Set(value As List(Of MachGroupM))
m_MachGroupMList = value
End Set
End Property
Protected m_MachGroupPanel_Visibility As Visibility
Public Property MachGroupPanel_Visibility As Visibility
Get
Return m_MachGroupPanel_Visibility
End Get
Set(value As Visibility)
m_MachGroupPanel_Visibility = value
End Set
End Property
' Variabile che permette di abilitare/disabilitare i bottoni aggiungi e togli MachGroup
Protected m_IsEnabledAddRemove As Boolean
Public Property IsEnabledAddRemove As Boolean
Get
Return m_IsEnabledAddRemove
End Get
Set(value As Boolean)
m_IsEnabledAddRemove = value
End Set
End Property
' Variabile che definisce lo stato (attivi/disattivi) di tutti i gruppi tranne quello selezionato
Protected m_IsEnabledMachGroups As Boolean
Public Property IsEnabledMachGroups As Boolean
Get
Return m_IsEnabledMachGroups
End Get
Set(value As Boolean)
m_IsEnabledMachGroups = value
End Set
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Protected Sub New()
End Sub
Public Shared Function CreateNewMachGroupPanel() As MachGroupPanelM
Return New MachGroupPanelM
End Function
Public Shared Function CreateMachGroupPanel(IsMultiMachGroup As Boolean,
MachineList As List(Of Machine), DefaultMachine As String,
Optional sBaseName As String = "MachGroup_1") As MachGroupPanelM
Dim NewMachGroupPanelM As New MachGroupPanelM
NewMachGroupPanelM.m_IsMultiMachGroup = IsMultiMachGroup
' Assegno nome base
NewMachGroupPanelM.m_BaseName = sBaseName
' Recupero lista macchine
NewMachGroupPanelM.m_MachineList = MachineList
' Assegno macchina di default
NewMachGroupPanelM.m_DefaultMachine = DefaultMachine
' recupero i MachGroup
NewMachGroupPanelM.m_MachGroupMList = LoadMachGroups()
Return NewMachGroupPanelM
End Function
Public Shared Function LoadMachGroups() As List(Of MachGroupM)
Dim TempList As New List(Of MachGroupM)
Dim nId = EgtGetFirstMachGroup()
While nId <> GDB_ID.NULL
EgtSetCurrMachGroup(nId)
Dim sName As String = String.Empty
Dim sMachine As String = String.Empty
EgtGetMachGroupName(nId, sName)
EgtGetMachGroupMachineName(nId, sMachine)
TempList.Add(MachGroupM.CreateMachGroup(nId, sName, sMachine))
nId = EgtGetNextMachGroup(nId)
End While
Return TempList
End Function
#End Region ' CONSTRUCTOR
#Region "METHODS"
Public Event MachGroupAdded As EventHandler(Of MachGroupAddedEventArgs)
Public Event MachGroupRemoved As EventHandler(Of MachGroupAddedEventArgs)
Public Overridable Sub AddMachGroup(MachGroupM As MachGroupM)
If IsNothing(MachGroupM) Then Return
If Not m_MachGroupMList.Contains(MachGroupM) Then
m_MachGroupMList.Add(MachGroupM)
RaiseEvent MachGroupAdded(Me, New MachGroupAddedEventArgs(MachGroupM))
End If
End Sub
Public Overridable Sub RemoveMachGroup(MachGroupM As MachGroupM)
If IsNothing(MachGroupM) Then Return
If m_MachGroupMList.Contains(MachGroupM) AndAlso m_MachGroupMList.Remove(MachGroupM) Then
RaiseEvent MachGroupRemoved(Me, New MachGroupAddedEventArgs(MachGroupM))
End If
End Sub
Public Function GetMachGroups() As List(Of MachGroupM)
Return New List(Of MachGroupM)(m_MachGroupMList)
End Function
'Public Function InitMachGroupPanel(IsMultiMachGroup As Boolean,
' MachineList As List(Of Machine), DefaultMachine As String,
' Optional sBaseName As String = "MachGroup_1") As Boolean
' m_IsMultiMachGroup = IsMultiMachGroup
' ' se è a gruppo singolo, nascondo il panel
' If Not m_IsMultiMachGroup Then SetMachGroupPanelVisibility(False)
' ' Assegno nome base
' m_BaseName = sBaseName
' ' Recupero lista macchine
' m_MachineList = MachineList
' ' Assegno macchina di default
' m_DefaultMachine = DefaultMachine
' Return MachineList.Count > 0
'End Function
'Public Overridable Sub LoadMachGroupList()
' ' Carico i gruppi di lavorazione nella lista
' Dim nId = EgtGetFirstMachGroup()
' While nId <> GDB_ID.NULL
' Dim sName As String = String.Empty
' Dim sMachine As String = String.Empty
' EgtGetMachGroupName(nId, sName)
' EgtGetMachGroupMachineName(nId, sMachine)
' MachGroupMList.Add(New MachGroup(nId, sName, sMachine))
' nId = EgtGetNextMachGroup(nId)
' End While
'End Sub
Public Overridable Function NewMachGroup() As MachGroupM
' Sistemazioni preliminari
OnPreNewMachGroup()
' Se non ci sono macchine disponibili esco con errore
If m_MachineList.Count <= 0 Then Return Nothing
' Creo il VM per chiedere nome e macchina a seconda del caso in cui mi trovo
Dim NewMachGroupWndVM As NewMachGroupWndVM = Nothing
Dim sNewMGrpName As String = m_BaseName
Dim sNewMachName As String = m_MachineList(0).Name
If m_IsMultiMachGroup Then
EgtGetMachGroupNewName(sNewMGrpName)
If m_MachineList.Count = 1 Then
If Not m_IsGroupNameAutomatic Then
NewMachGroupWndVM = New NewMachGroupWndVM(sNewMGrpName)
End If
Else
If m_IsGroupNameAutomatic Then
NewMachGroupWndVM = New NewMachGroupWndVM(m_DefaultMachine, m_MachineList)
Else
NewMachGroupWndVM = New NewMachGroupWndVM(sNewMGrpName, m_DefaultMachine, m_MachineList)
End If
End If
ElseIf EgtGetMachGroupCount() = 0 Then
If m_MachineList.Count > 1 Then
NewMachGroupWndVM = New NewMachGroupWndVM(m_DefaultMachine, m_MachineList)
End If
End If
' Se necessario, lancio finestra di acquisizione dati
If Not IsNothing(NewMachGroupWndVM) Then
' Se non esistono gruppi nella lista, rendo la finestra non chiudibile senza scelta
If m_MachGroupMList.Count = 0 Then NewMachGroupWndVM.IsClosable = False
' Lancio finestra
Dim NewMachGroupWndV As New NewMachGroupWndV(Application.Current.MainWindow, NewMachGroupWndVM)
If NewMachGroupWndV.ShowDialog() = False Then Return Nothing
' Recupero dati
If Not IsNothing(NewMachGroupWndVM.Name) Then sNewMGrpName = NewMachGroupWndVM.Name
If Not IsNothing(NewMachGroupWndVM.SelectedMachine) Then sNewMachName = NewMachGroupWndVM.SelectedMachine.Name
End If
' Creo il nuovo gruppo di lavorazione con i dati ottenuti a seconda del caso in cui mi trovo
Dim MachGroupM As MachGroupM = MachGroupM.CreateMachGroup(sNewMGrpName, sNewMachName)
If IsNothing(MachGroupM) Then Return Nothing
AddMachGroup(MachGroupM)
' Sistemazioni finali
m_DefaultMachine = sNewMachName
OnPostNewMachGroup()
Return MachGroupM
End Function
Public Function NewMachGroupWithDefaults() As MachGroupM
' Sistemazioni preliminari
OnPreNewMachGroup()
' Se non ci sono macchine disponibili esco con errore
If m_MachineList.Count <= 0 Then Return Nothing
' Assegno valori di default
Dim sNewMGrpName As String = m_BaseName
Dim sNewMachName As String = If(Machine.ExistsMachine(m_DefaultMachine, m_MachineList), m_DefaultMachine, m_MachineList(0).Name)
' Creo il nuovo gruppo di lavorazione con i dati ottenuti a seconda del caso in cui mi trovo
Dim MachGroupM As MachGroupM = MachGroupM.CreateMachGroup(sNewMGrpName, sNewMachName)
If IsNothing(MachGroupM) Then Return Nothing
AddMachGroup(MachGroupM)
' Sistemazioni finali
m_DefaultMachine = sNewMachName
OnPostNewMachGroup()
Return MachGroupM
End Function
Public Overridable Function OnPreNewMachGroup() As Boolean
Return True
End Function
Public Overridable Function OnPostNewMachGroup() As Boolean
Return True
End Function
Public Overridable Function OnPreRemoveCurrMachGroup() As Boolean
Return True
End Function
#End Region ' METHODS
End Class
+60
View File
@@ -0,0 +1,60 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows
Imports EgtUILib
Imports EgtWPFLib5
Public Class MachGroupVM
Inherits VMBase
Protected m_MachGroupM As MachGroupM
Public ReadOnly Property MachGroupM As MachGroupM
Get
Return m_MachGroupM
End Get
End Property
Public ReadOnly Property Id As Integer
Get
Return m_MachGroupM.Id
End Get
End Property
Public ReadOnly Property Name As String
Get
Return m_MachGroupM.Name
End Get
End Property
Public ReadOnly Property Machine As String
Get
Return m_MachGroupM.Machine
End Get
End Property
Public Property IsEnabled As Boolean
Get
Return m_MachGroupM.IsEnabled
End Get
Set(value As Boolean)
m_MachGroupM.IsEnabled = value
NotifyPropertyChanged(NameOf(IsEnabled))
End Set
End Property
#Region "ToolTip"
Public Overridable ReadOnly Property MachGroupToolTip As String
Get
Return "Name: " & m_MachGroupM.Name & Environment.NewLine &
"Machine: " & m_MachGroupM.Machine
End Get
End Property
#End Region ' ToolTip
Sub New(MachGroupM As MachGroupM)
m_MachGroupM = MachGroupM
End Sub
End Class
+289
View File
@@ -0,0 +1,289 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO
Imports System.Windows
Imports System.Windows.Input
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class NewMachGroupPanelVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Protected m_MachGroupPanelM As MachGroupPanelM
Public ReadOnly Property DefaultMachine As String
Get
Return m_MachGroupPanelM.DefaultMachine
End Get
End Property
Protected m_MachGroupVMList As ObservableCollection(Of MachGroupVM)
Public Property MachGroupVMList As ObservableCollection(Of MachGroupVM)
Get
Return m_MachGroupVMList
End Get
Set(value As ObservableCollection(Of MachGroupVM))
m_MachGroupVMList = value
End Set
End Property
Protected m_SelectedMachGroup As MachGroupVM
Public Property SelectedMachGroup As MachGroupVM
Get
Return m_SelectedMachGroup
End Get
Set(value As MachGroupVM)
m_SelectedMachGroup = value
If Not IsNothing(value) Then
OnPreSetCurrMachGroup()
EgtSetCurrMachGroup(value.Id)
OnPostSetCurrMachGroup()
End If
NotifyPropertyChanged(NameOf(SelectedMachGroup))
End Set
End Property
Public ReadOnly Property MachGroupPanel_Visibility As Visibility
Get
Return m_MachGroupPanelM.MachGroupPanel_Visibility
End Get
End Property
Public Sub SetMachGroupPanelVisibility(IsVisible As Boolean)
If IsVisible Then
m_MachGroupPanelM.MachGroupPanel_Visibility = Visibility.Visible
Else
m_MachGroupPanelM.MachGroupPanel_Visibility = Visibility.Collapsed
End If
NotifyPropertyChanged(NameOf(MachGroupPanel_Visibility))
End Sub
' Variabile che permette di abilitare/disabilitare i bottoni aggiungi e togli MachGroup
Public Property IsEnabledAddRemove As Boolean
Get
Return m_MachGroupPanelM.IsEnabledAddRemove
End Get
Set(value As Boolean)
m_MachGroupPanelM.IsEnabledAddRemove = value
NotifyPropertyChanged(NameOf(IsEnabledAddRemove))
End Set
End Property
' Variabile che definisce lo stato (attivi/disattivi) di tutti i gruppi tranne quello selezionato
Public ReadOnly Property IsEnabledMachGroups As Boolean
Get
Return m_MachGroupPanelM.IsEnabledMachGroups
End Get
End Property
' Definizione comandi
Private m_cmdSetCurrMachGroup As ICommand
Private m_cmdAddMachGroup As ICommand
Private m_cmdRemoveMachGroup As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(MachGroupPanelM As MachGroupPanelM)
m_MachGroupPanelM = MachGroupPanelM
AddHandler m_MachGroupPanelM.MachGroupAdded, AddressOf OnMachGroupAdded
If Not MachGroupPanelM.IsMultiMachGroup Then SetMachGroupPanelVisibility(False)
CreateMachGroupVMList()
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Protected Overridable Sub CreateMachGroupVMList()
Dim all As List(Of MachGroupVM) = (From MachGroupM In m_MachGroupPanelM.GetMachGroups()
Select New MachGroupVM(MachGroupM)).ToList()
For Each MachGroupvM As MachGroupVM In all
AddHandler MachGroupvM.PropertyChanged, AddressOf OnMachGroupVMPropertyChanged
Next
m_MachGroupVMList = New ObservableCollection(Of MachGroupVM)(all)
AddHandler m_MachGroupVMList.CollectionChanged, AddressOf OnMachGroupVMListChanged
End Sub
Public Overridable Function InitMachGroupList(Optional bUseDefaults As Boolean = False) As Boolean
' Svuoto precedente lista di MachGroup
m_MachGroupPanelM.MachGroupMList.Clear()
' verifico se esistono già gruppi di lavorazione o se devo creare il primo
Dim bOk As Boolean
Dim nId = EgtGetFirstMachGroup()
If nId <> GDB_ID.NULL Then
bOk = EgtSetCurrMachGroup(nId)
Else
If bUseDefaults Then
bOk = Not IsNothing(m_MachGroupPanelM.NewMachGroupWithDefaults())
Else
bOk = Not IsNothing(m_MachGroupPanelM.NewMachGroup())
End If
End If
If Not bOk Then Return False
' Sistemazioni finali
m_MachGroupPanelM.MachGroupMList = MachGroupPanelM.LoadMachGroups()
SelectedMachGroup = MachGroupVMList(0)
Return True
End Function
' Funzione che permette di abilitare o disabilitare tutti i gruppi tranne quello selezionato più i bottni Add/Remove
Public Function SetMachGroupState(bState As Boolean) As Boolean
If bState Then
For Each Group In MachGroupVMList
Group.IsEnabled = True
Next
m_MachGroupPanelM.IsEnabledAddRemove = True
NotifyPropertyChanged(NameOf(IsEnabledAddRemove))
m_MachGroupPanelM.IsEnabledMachGroups = True
Return True
Else
For Each Group In MachGroupVMList
If Group Is SelectedMachGroup Then
Group.IsEnabled = True
Else
Group.IsEnabled = False
End If
Next
m_MachGroupPanelM.IsEnabledAddRemove = False
NotifyPropertyChanged(NameOf(IsEnabledAddRemove))
m_MachGroupPanelM.IsEnabledMachGroups = False
Return True
End If
Return False
End Function
Public Overridable Function OnPreSetCurrMachGroup() As Boolean
Return True
End Function
Public Overridable Function OnPostSetCurrMachGroup() As Boolean
Return True
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "AddMachGroupCommand"
''' <summary>
''' Returns a command that set the selected MachGroup as the Current one.
''' </summary>
Public ReadOnly Property AddMachGroupCommand As ICommand
Get
If m_cmdAddMachGroup Is Nothing Then
m_cmdAddMachGroup = New Command(AddressOf AddMachGroup)
End If
Return m_cmdAddMachGroup
End Get
End Property
Public Overridable Sub AddMachGroup()
Dim MachGroupM As MachGroupM = m_MachGroupPanelM.NewMachGroup()
If IsNothing(MachGroupM) Then Return
' lo seleziono
SelectedMachGroup = MachGroupVMList.FirstOrDefault(Function(x) x.MachGroupM Is MachGroupM)
EgtZoom(ZM.ALL)
End Sub
#End Region ' AddMachGroupCommand
#Region "RemoveMachGroupCommand"
''' <summary>
''' Returns a command that set the selected MachGroup as the Current one.
''' </summary>
Public ReadOnly Property RemoveMachGroupCommand As ICommand
Get
If m_cmdRemoveMachGroup Is Nothing Then
m_cmdRemoveMachGroup = New Command(AddressOf RemoveMachGroup)
End If
Return m_cmdRemoveMachGroup
End Get
End Property
Public Overridable Sub RemoveMachGroup()
' Calcolo indice del gruppo da cancellare
Dim nSelectedMachGroupIndex As Integer = MachGroupVMList.IndexOf(SelectedMachGroup)
If MachGroupVMList.Count = 1 Then
'chiedo conferma prima di resettare il gruppo di lavorazione
Select Case MessageBox.Show("Eliminare?", "", MessageBoxButton.YesNo, MessageBoxImage.Question)
Case MessageBoxResult.Yes
' cancello il gruppo corrente e ne creo uno nuovo con lo stesso nome
m_MachGroupPanelM.OnPreRemoveCurrMachGroup()
EgtRemoveMachGroup(MachGroupVMList(0).Id)
MachGroupVMList.Clear()
AddMachGroup()
EgtZoom(ZM.ALL)
Case MessageBoxResult.No
Return
End Select
Else
'chiedo conferma prima di cancellare il gruppo di lavorazione
Select Case MessageBox.Show("Eliminare?", "", MessageBoxButton.YesNo, MessageBoxImage.Question)
Case MessageBoxResult.Yes
' cancello quello selezionato (ovvero il corrente)
m_MachGroupPanelM.OnPreRemoveCurrMachGroup()
EgtRemoveMachGroup(MachGroupVMList(nSelectedMachGroupIndex).Id)
' rendo corrente il gruppo di lavorazione successivo a quello da cancellare
If nSelectedMachGroupIndex = 0 And MachGroupVMList.Count > 1 Then
EgtSetCurrMachGroup(MachGroupVMList(nSelectedMachGroupIndex + 1).Id)
SelectedMachGroup = MachGroupVMList(nSelectedMachGroupIndex + 1)
' rendo corrente il gruppo di lavorazione precedente a quello da cancellare
ElseIf nSelectedMachGroupIndex > 0 Then
EgtSetCurrMachGroup(MachGroupVMList(nSelectedMachGroupIndex - 1).Id)
SelectedMachGroup = MachGroupVMList(nSelectedMachGroupIndex - 1)
End If
EgtZoom(ZM.ALL)
' aggiorno la lista dei gruppi
MachGroupVMList.RemoveAt(nSelectedMachGroupIndex)
Case MessageBoxResult.No
Return
End Select
End If
End Sub
#End Region ' RemoveMachGroupCommand
#End Region ' COMMANDS
#Region "EVENTS"
Protected Overridable Sub OnMachGroupAdded(sender As Object, e As MachGroupAddedEventArgs)
Dim MachGroupVM As MachGroupVM = New MachGroupVM(e.NewMachGroupM)
m_MachGroupVMList.Add(MachGroupVM)
NotifyPropertyChanged(NameOf(MachGroupVMList))
End Sub
Protected Sub OnMachGroupVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each MachGroupVM As MachGroupVM In e.NewItems
AddHandler MachGroupVM.PropertyChanged, AddressOf OnMachGroupVMPropertyChanged
Next
End If
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each MachGroupVM As MachGroupVM In e.OldItems
RemoveHandler MachGroupVM.PropertyChanged, AddressOf OnMachGroupVMPropertyChanged
m_MachGroupPanelM.MachGroupMList.Remove(MachGroupVM.MachGroupM)
Next
End If
End Sub
Protected Overridable Sub OnMachGroupVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
Select Case e.PropertyName
'Case nameof(sender.sMATERIAL)
End Select
End Sub
#End Region ' EVENTS
End Class
@@ -0,0 +1,99 @@
Imports System.Threading
Imports System.Windows.Threading
Public Module LoadingWndHelper
Public Enum ActiveIds As Integer
OPENPROJ = 1
SAVEPROJ = 2
IMPORTBTL = 3
GOTOPROD = 4
OPENPROD = 5
SAVEPROD = 6
GOTOPROJ = 7
EXPORTPROJECT = 8
IMPORTPROJECT = 9
CHANGEPARAM = 10
CREATINGPDF = 11
CHANGEMATERIAL = 12
End Enum
Dim m_MainWindow As Windows.Window
Public Sub SetMainWindow(MainWindow As Windows.Window)
m_MainWindow = MainWindow
End Sub
Private m_bMainWindow_IsActive As Boolean = True
Public Sub SetMainWindowIsActive(IsActive As Boolean)
m_bMainWindow_IsActive = IsActive
End Sub
Delegate Sub CallbackLoadingDlg(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
Private m_thread As Thread
Private m_LoadingWndVM As Core.LoadingWndVM
Private m_CurrStep As Integer
Private m_StepText As String
Private m_nProgress As Integer
Private m_nNextProgress As Integer
Private m_bClose As Boolean
Private m_bActiveId As Integer = -1
Public Function OpenLoadingWnd(Id As Integer, nSteps As Integer, TotText As String, FirstStepText As String, nNextProgress As Integer) As Boolean
If m_bActiveId > 0 Then Return False
m_bActiveId = Id
m_LoadingWndVM = Nothing
m_CurrStep = 1
m_StepText = FirstStepText
m_nProgress = 1
m_nNextProgress = nNextProgress
m_bClose = False
Dim Top As Double = m_MainWindow.Top + (m_MainWindow.Height / 2) - 100
Dim Left As Double = m_MainWindow.Left + (m_MainWindow.Width / 2) - 150
Dim WindowStartupLocation As Windows.WindowStartupLocation = Windows.WindowStartupLocation.Manual
If m_MainWindow.WindowState = Windows.WindowState.Maximized Then
WindowStartupLocation = Windows.WindowStartupLocation.CenterOwner
End If
m_thread = New Thread(Sub()
m_LoadingWndVM = New Core.LoadingWndVM(nSteps, TotText, AddressOf LoadingCallback)
m_LoadingWndVM.UpdateProgress(m_CurrStep, m_StepText, m_nProgress, m_nNextProgress)
Dim LoadingWnd As New LoadingWndV(Nothing, m_LoadingWndVM)
' posiziono la finestra
If WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen Then
LoadingWnd.WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen
Else
LoadingWnd.Top = Top
LoadingWnd.Left = Left
End If
LoadingWnd.Show()
Dispatcher.Run()
End Sub)
m_thread.SetApartmentState(ApartmentState.STA)
m_thread.Start()
Return True
End Function
Private Sub LoadingCallback(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
CurrStep = m_CurrStep
StepText = m_StepText
nProgress = m_nProgress
nNextProgress = m_nNextProgress
m_bMainWindow_IsActive = MainWindow_IsActive
bClose = m_bClose
End Sub
Public Sub UpdateLoadingWnd(Id As Integer, CurrStep As Integer, StepText As String, nProgress As Integer, nNextProgress As Integer)
If Id <> m_bActiveId Then Return
m_CurrStep = CurrStep
m_StepText = StepText
m_nProgress = nProgress
m_nNextProgress = nNextProgress
End Sub
Public Sub CloseLoadingWnd(Id As Integer)
If Id <> m_bActiveId Then Return
m_bClose = True
m_bActiveId = -1
End Sub
End Module
@@ -0,0 +1,56 @@
<EgtWPFLib5:EgtCustomWindow x:Class="LoadingWndV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
Height="200" Width="300"
TitleBarHeight="0"
ResizeMode="NoResize" WindowStyle="None"
IsClosable="False" IsMinimizable="False"
WindowStartupLocation="Manual" ShowInTaskbar="False">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="1"
Text="{Binding TotText_Msg}"
TextAlignment="Center"/>
<TextBlock Grid.Row="2"
Text="{Binding StepText_Msg}"
TextAlignment="Center"
Visibility="{Binding StepText_Visibility}"/>
<Grid Grid.Row="3"
Visibility="{Binding StepProgress_Visibility}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid Height="20"/>
<ProgressBar Grid.Row="1"
Minimum="0"
Maximum="100"
Value="{Binding StepProgress_Value}"
Height="20"
Margin="40,0,40,0"/>
</Grid>
<ProgressBar Grid.Row="5"
Minimum="0"
Maximum="100"
Value="{Binding TotProgress_Value}"
Height="20"
Margin="40,0,40,0"/>
<TextBlock Grid.Row="7"
Text="{Binding TotProgress_Msg}"
TextAlignment="Center"/>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,36 @@
Imports System.Windows
Imports System.Windows.Input
Public Class LoadingWndV
Private WithEvents m_LoadingWndVM As LoadingWndVM
Sub New(Owner As Window, LoadingWndVM As LoadingWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = LoadingWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_LoadingWndVM = LoadingWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_LoadingWndVM.m_CloseWindow
Me.Close()
End Sub
Private Sub ActivateWindow() Handles m_LoadingWndVM.m_ActivateWindow
Me.Activate()
End Sub
Private Sub Me_ContentRendered() Handles Me.ContentRendered
m_LoadingWndVM.StartFunction()
End Sub
Private Sub ToolsDbView_Closing(sender As Object, e As ComponentModel.CancelEventArgs) Handles Me.Closing
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
e.Cancel = True
Return
End If
End Sub
End Class
+233
View File
@@ -0,0 +1,233 @@
Imports System.Timers
Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Threading
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class LoadingWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Enum LoadingTypes As Integer
NULL = 0
OPEN = 1
IMPORT = 2
End Enum
Delegate Sub CallbackLoadingDlg(ByRef CurrStep As Integer, ByRef StepText As String, ByRef nProgress As Integer, ByRef nNextProgress As Integer, ByRef MainWindow_IsActive As Boolean, ByRef bClose As Boolean)
Friend Event m_CloseWindow(bDialogResult As Boolean)
Friend Event m_ActivateWindow()
Private m_CallbackLoading As CallbackLoadingDlg
Private m_Waiting_Timer As New DispatcherTimer
' numero di passaggi di caricamento
Private m_nSteps As Integer
' titolo testo di caricamento
Private m_TotText As String
' numero passaggio corrente
Private m_CurrStep As Integer
' testo del passaggio corrente
Private m_StepText As String
' indice d'inizio di questo passaggio
Private m_nStartProgress As Integer
' indice d'inizio del prossimo passaggio
Private m_nNextProgress As Integer
' variabile che indica richiesta chiusura della finestra
Private m_bClosing As Boolean = False
Private m_bMainWindow_IsActive As Boolean = True
Private m_StepProgress_Value As Double = 0
Public Property StepProgress_Value As Double
Get
Return m_StepProgress_Value
End Get
Set(value As Double)
m_StepProgress_Value = value
End Set
End Property
Private m_TotProgress_Value As Double = 0
Public Property TotProgress_Value As Double
Get
Return Math.Floor(m_TotProgress_Value)
End Get
Set(value As Double)
m_TotProgress_Value = value
End Set
End Property
Private m_StepText_Visibility As Visibility
Public ReadOnly Property StepText_Visibility As Visibility
Get
Return m_StepText_Visibility
End Get
End Property
Private m_StepProgress_Visibility As Visibility
Public ReadOnly Property StepProgress_Visibility As Visibility
Get
Return m_StepProgress_Visibility
End Get
End Property
#Region "Messages"
Public ReadOnly Property TotText_Msg As String
Get
Return If(m_nSteps > 0, m_TotText & " (" & m_CurrStep & "/" & m_nSteps & ")", m_TotText)
End Get
End Property
Public ReadOnly Property StepText_Msg As String
Get
Return m_StepText
End Get
End Property
Public ReadOnly Property TotProgress_Msg As String
Get
Return m_TotProgress_Value.ToString("0.#") & "%"
End Get
End Property
#End Region ' Messages
' Definizione comandi
Private m_cmdCancel As ICommand
#End Region ' FIELDS & PROPERTIES
Sub New(Steps As Integer, TotText As String, callback As CallbackLoadingDlg)
m_nSteps = Steps
m_TotText = TotText
m_CallbackLoading = callback
m_bClosing = False
If Steps = 1 Then
m_StepText_Visibility = Visibility.Collapsed
m_StepProgress_Visibility = Visibility.Collapsed
Else
m_StepText_Visibility = Visibility.Visible
m_StepProgress_Visibility = Visibility.Visible
End If
' imposto contatore
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(200)
AddHandler m_Waiting_Timer.Tick, AddressOf WaitingTimer_Tick
End Sub
Public Sub UpdateProgress(CurrStep As Integer, StepText As String, nStartProgress As Integer, nNextProgress As Integer)
m_CurrStep = CurrStep
m_StepText = StepText
m_StepProgress_Value = nStartProgress
m_nNextProgress = nNextProgress
NotifyPropertyChanged(NameOf(StepText_Msg))
NotifyPropertyChanged(NameOf(TotText_Msg))
End Sub
Public Overridable Sub StartFunction()
m_Waiting_Timer.Start()
End Sub
Protected Overridable Sub WaitingTimer_Tick()
' leggo eventuali nuovi valori
Dim CurrStep As Integer = 0
Dim StepText As String = ""
Dim nStartProgress As Integer = 0
Dim nNextProgress As Integer = 0
Dim bMainWindow_IsActive As Boolean = True
Dim bClose As Boolean = False
m_CallbackLoading(CurrStep, StepText, nStartProgress, nNextProgress, bMainWindow_IsActive, bClose)
If bMainWindow_IsActive <> m_bMainWindow_IsActive Then
RaiseEvent m_ActivateWindow()
End If
If m_bClosing Then
Close()
Dispatcher.CurrentDispatcher.InvokeShutdown()
Return
ElseIf bClose Then
m_bClosing = True
' mostro completamento caricamento
m_CurrStep = m_nSteps
m_StepProgress_Value = 100
m_TotProgress_Value = 100
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(1000)
Else
If m_CurrStep <> CurrStep Then
If m_StepProgress_Value < 100 Then
m_StepProgress_Value = 100
ElseIf m_StepProgress_Value = 100 Then
m_StepProgress_Value = 0
m_CurrStep = CurrStep
m_StepText = StepText
m_nStartProgress = nStartProgress
m_nNextProgress = nNextProgress
End If
Else
' incremento Step corrente
If m_StepProgress_Value < 80 Then
m_StepProgress_Value += 1
ElseIf m_StepProgress_Value < 90 Then
m_StepProgress_Value += 0.4
ElseIf m_StepProgress_Value < 98 Then
m_StepProgress_Value += 0.1
Else
m_StepProgress_Value += 0.01
End If
End If
' calcolo totale
Dim dStepStart As Double = If(m_CurrStep > 1, m_nStartProgress, 0)
Dim dStepEnd As Double = m_nNextProgress
m_TotProgress_Value = dStepStart + ((dStepEnd - dStepStart) / 100 * m_StepProgress_Value)
End If
' aggiorno grafica
NotifyPropertyChanged(NameOf(StepText_Msg))
NotifyPropertyChanged(NameOf(TotText_Msg))
NotifyPropertyChanged(NameOf(StepProgress_Value))
NotifyPropertyChanged(NameOf(TotProgress_Value))
NotifyPropertyChanged(NameOf(TotProgress_Msg))
End Sub
Public Sub Close()
' fermo timer
m_Waiting_Timer.Stop()
' chiudo finestra
RaiseEvent m_CloseWindow(True)
End Sub
#Region "COMMANDS"
#Region "Cancel"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property Cancel_Command As ICommand
Get
If m_cmdCancel Is Nothing Then
m_cmdCancel = New Command(AddressOf Cancel)
End If
Return m_cmdCancel
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Cancel()
'' chiedo conferma
'If MessageBox.Show("Are you sure you want to stop the nesting?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then Return
'' fermo il nesting
'Map.refOptimizePanelVM.m_StopNesting = True
'' fermo timer e chiudo finestra
'CloseNesting()
End Sub
#End Region ' Cancel
#End Region ' COMMANDS
End Class
+205
View File
@@ -0,0 +1,205 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class BeamM
Inherits PartM
Protected m_dOffset As Double
Public Property dOffset As Double
Get
Return m_dOffset
End Get
Set(value As Double)
m_dOffset = value
End Set
End Property
' Id del grezzo
Protected m_nRawPartId As Integer = GDB_ID.NULL
'#Region "CONSTRUCTOR"
' Sub New(nParentMachGroup As MyMachGroupM, nPartId As Integer, nRawPartId As Integer)
' MyBase.New(nParentMachGroup, nPartId)
' m_nRawPartId = nRawPartId
' End Sub
'#End Region ' CONSTRUCTOR
#Region "CONSTRUCTORS"
Protected Sub New(nParentMachGroup As MyMachGroupM, nPartId As Integer)
MyBase.New(nParentMachGroup, nPartId)
End Sub
'Public Shared Function CreateNewBeam() As BeamM
' Return New BeamM
'End Function
Public Shared Function CreateBeam(nParentMachGroup As MyMachGroupM, nPartId As Integer, nRawPartId As Integer) As BeamM
Dim NewBeamM As New BeamM(nParentMachGroup, nPartId)
NewBeamM.m_nRawPartId = nRawPartId
' leggo info pezzo
EgtGetInfo(nPartId, BTL_PRT_PROJ, NewBeamM.m_nProjId)
EgtGetInfo(nPartId, BTL_PRT_PDN, NewBeamM.m_nPDN)
EgtGetInfo(nPartId, BTL_PRT_NAM, NewBeamM.m_sNAM)
EgtGetInfo(nPartId, BTL_PRT_L, NewBeamM.m_dBtlL)
EgtGetInfo(nPartId, BTL_PRT_W, NewBeamM.m_dBtlW)
EgtGetInfo(nPartId, BTL_PRT_H, NewBeamM.m_dBtlH)
EgtGetInfo(nPartId, BTL_PRT_CNT, NewBeamM.m_nCNT)
EgtGetInfo(nPartId, BTL_PRT_GROUP, NewBeamM.m_sGROUP)
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewBeamM.m_sMATERIAL)
Dim nTemp As Integer = 0
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
nTemp = 0
End If
NewBeamM.SetRotated(nTemp)
If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, nTemp) Then
nTemp = 0
End If
NewBeamM.SetInverted(nTemp)
' leggo PosX
Dim sInfo As String = ""
Dim Index = 1
Dim sSplitInfo() As String = Nothing
Dim bFound As Boolean = False
While EgtGetInfo(NewBeamM.m_ParentMachGroup.Id, MGR_RPT_PART & Index, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c)
If sSplitInfo(0) = nPartId Then
bFound = True
Exit While
End If
End If
Index += 1
End While
If bFound Then
StringToDouble(sSplitInfo(1), NewBeamM.m_dPOSX)
End If
' leggo feature
NewBeamM.m_FeatureMList = LoadBTLFeatures(nPartId)
' leggo calc error
Dim nErr As Integer = 0
Dim nRot As Integer = 0
Dim nFall As Integer = 0
Dim sMsg As String = ""
Dim bCalc As Boolean = False
bCalc = EgtGetInfo(nPartId, ITG_PROD_ERR, nErr)
EgtGetInfo(nPartId, ITG_PROD_ROT, nRot)
EgtGetInfo(nPartId, ITG_PROD_FALL, nFall)
EgtGetInfo(nPartId, ITG_PROD_MSG, sMsg)
If Not bCalc Then
NewBeamM.m_nCALC_State = CalcStates.NOTCALCULATED
NewBeamM.m_nCALC_ERR = -1
NewBeamM.m_nCALC_ROT = 0
NewBeamM.m_nCALC_FALL = 0
NewBeamM.m_sCALC_MSG = ""
Else
NewBeamM.m_nCALC_ERR = nErr
NewBeamM.m_nCALC_ROT = nRot
NewBeamM.m_nCALC_FALL = nFall
NewBeamM.m_sCALC_MSG = sMsg
If nErr = 0 Then
NewBeamM.m_nCALC_State = CalcStates.OK
ElseIf nErr > 1 Then
NewBeamM.m_nCALC_State = CalcStates.ERROR_
ElseIf nErr < 1 Then
NewBeamM.m_nCALC_State = CalcStates.NOTCALCULATED
End If
End If
EgtGetInfo(nPartId, ITG_PROD_TIME, NewBeamM.m_nCALC_TIME)
ReadMachGroupData(NewBeamM)
Return NewBeamM
End Function
#End Region ' CONSTRUCTORS
#Region "X DataLayer"
Public Shared Function CreateBeamDL(nParentMachGroup As MyMachGroupM, nPartId As Integer, nRawPartId As Integer) As BeamM
Dim NewBeamM As New BeamM(nParentMachGroup, nPartId)
NewBeamM.m_nRawPartId = nRawPartId
'' leggo info pezzo
'EgtGetInfo(nPartId, BTL_PRT_PROJ, NewBeamM.nProjId)
'EgtGetInfo(nPartId, BTL_PRT_PDN, NewBeamM.nPDN)
'EgtGetInfo(nPartId, BTL_PRT_NAM, NewBeamM.sNAM)
'EgtGetInfo(nPartId, BTL_PRT_L, NewBeamM.dL)
'EgtGetInfo(nPartId, BTL_PRT_W, NewBeamM.dW)
'EgtGetInfo(nPartId, BTL_PRT_H, NewBeamM.dH)
'EgtGetInfo(nPartId, BTL_PRT_CNT, NewBeamM.nCNT)
'Dim nTemp As Integer = 0
'If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
' nTemp = 0
'End If
'NewBeamM.SetRotated(nTemp)
'If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, nTemp) Then
' nTemp = 0
'End If
'NewBeamM.SetInverted(nTemp)
'' leggo PosX
'Dim sInfo As String = ""
'Dim Index = 1
'Dim sSplitInfo() As String
'Dim bFound As Boolean = False
'While EgtGetInfo(NewBeamM.m_ParentMachGroup.Id, MGR_RPT_PART & Index, sInfo)
' If Not String.IsNullOrWhiteSpace(sInfo) Then
' sSplitInfo = sInfo.Split(","c)
' If sSplitInfo(0) = nPartId Then
' bFound = True
' Exit While
' End If
' End If
' Index += 1
'End While
'If bFound Then
' StringToDouble(sSplitInfo(1), NewBeamM.dPOSX)
'End If
'' leggo feature
'NewBeamM.m_FeatureMList = LoadBTLFeatures(nPartId)
Return NewBeamM
End Function
#End Region
Private Shared Function LoadBTLFeatures(nPartId As Integer) As List(Of BTLFeatureM)
Dim TempList As New List(Of BTLFeatureM)
' Aggiungo outline
Dim nOutLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutLayerId)
While nOutlineId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nOutlineId, BTL_FTR_MAINID) Then
' creo la feature
TempList.Add(BTLFeatureM.CreateBTLFeature(Nothing, nOutlineId))
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
' Aggiungo feature
Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
While nFeatureId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nFeatureId, BTL_FTR_MAINID) Then
' creo la feature
TempList.Add(BTLFeatureM.CreateBTLFeature(Nothing, nFeatureId))
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
Return TempList
End Function
Public Sub UpdateOffset()
' calcolo offset
Dim nBeamIndex As Integer = ParentMachGroup.PartMList.IndexOf(Me)
If nBeamIndex > 0 Then
m_dOffset = dPOSX - (ParentMachGroup.PartMList(nBeamIndex - 1).dPOSX + ParentMachGroup.PartMList(nBeamIndex - 1).dL)
Else
m_dOffset = dPOSX
End If
End Sub
End Class
@@ -0,0 +1,133 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class BeamMachGroupM
Inherits MyMachGroupM
Protected m_dStartCut As Double
Public Property dStartCut As Double
Get
Return m_dStartCut
End Get
Set(value As Double)
m_dStartCut = value
End Set
End Property
#Region "CONSTRUCTORS"
Protected Sub New()
End Sub
Public Shared Function CreateNewBeamMachGroup() As MachGroupM
Return New MachGroupM
End Function
Public Shared Function CreateBeamMachGroup(nId As Integer, sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New BeamMachGroupM
NewMachGroupM.m_Id = nId
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
' NewMachGroupM.SetMachineType(MachineType.BEAM)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
For Each Part As BeamM In NewMachGroupM.m_PartMList
Part.UpdateOffset()
NewMachGroupM.m_dMatForPart += Part.dL
Next
ReadMachGroupData(NewMachGroupM)
Return NewMachGroupM
End Function
Public Shared Function CreateBeamMachGroup(sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New BeamMachGroupM
' Creo il nuovo gruppo di lavorazione con i dati ottenuti a seconda del caso in cui mi trovo
NewMachGroupM.m_Id = EgtAddMachGroup(sName, sMachine)
If NewMachGroupM.m_Id = GDB_ID.NULL Then Return Nothing
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
'NewMachGroupM.SetMachineType(MachineType.BEAM)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL
For Each Part In NewMachGroupM.m_PartMList
NewMachGroupM.m_dMatForPart += Part.dL
Next
ReadMachGroupData(NewMachGroupM)
Return NewMachGroupM
End Function
#End Region ' CONSTRUCTORS
#Region "X DataLayer"
Public Shared Function CreateBeamMachGroupDL(nId As Integer, sName As String, sMachine As String, PartMList As List(Of PartM)) As MachGroupM
Dim NewMachGroupM As New BeamMachGroupM
NewMachGroupM.m_Id = nId
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
'NewMachGroupM.SetMachineType(MachineType.BEAM)
'EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
'EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
'EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
'NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL
NewMachGroupM.m_PartMList = PartMList
Return NewMachGroupM
End Function
#End Region
Private Shared Function LoadParts(NewBeamMachGroupM As BeamMachGroupM) As List(Of PartM)
Dim TempList As New List(Of PartM)
Dim nRawPartId As Integer = EgtGetFirstRawPart()
While nRawPartId <> GDB_ID.NULL
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
If nPartId <> GDB_ID.NULL Then
Dim NewBeam As BeamM = BeamM.CreateBeam(NewBeamMachGroupM, nPartId, nRawPartId)
TempList.Add(NewBeam)
End If
nRawPartId = EgtGetNextRawPart(nRawPartId)
End While
Return TempList
End Function
Public Overrides Sub RefreshPartList()
' leggo StartCut da posizione primo pezzo
Dim sInfo As String = ""
Dim sSplitInfo() As String
Dim bFound As Boolean = False
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c)
StringToDouble(sSplitInfo(1), m_dStartCut)
Else
m_dStartCut = 0
End If
' aggiorno lista pezzi
RemoveAllParts()
Dim nRawPartId As Integer = EgtGetFirstRawPart()
While nRawPartId <> GDB_ID.NULL
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
If nPartId <> GDB_ID.NULL Then
Dim NewBeam As BeamM = BeamM.CreateBeam(Me, nPartId, nRawPartId)
AddPart(NewBeam)
NewBeam.UpdateOffset()
End If
nRawPartId = EgtGetNextRawPart(nRawPartId)
End While
End Sub
Public Overrides Sub RefreshGroupData()
EgtGetInfo(Id, MGR_RPT_BARLEN, dL)
EgtGetInfo(Id, MGR_RPT_BARHEIGHT, dH)
EgtGetInfo(Id, MGR_RPT_BARWIDTH, dW)
EgtGetInfo(Id, MGR_RPT_MATERIAL, sMATERIAL)
End Sub
End Class
@@ -0,0 +1,547 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtUILib
Imports EgtWPFLib5
Public Class MyMachGroupM
Inherits MachGroupM
#Region "FIELDS & PROPERTIES"
#Region "General"
Public Event PartAdded As EventHandler(Of PartAddedEventArgs)
Public Event PartRemoved As EventHandler(Of PartAddedEventArgs)
Protected m_nType As BWType
Public ReadOnly Property nType As BWType
Get
Return m_nType
End Get
End Property
Protected m_dL As Double
Public Property dL As Double
Get
Return m_dL
End Get
Set(value As Double)
m_dL = value
End Set
End Property
Protected m_dW As Double
Public Property dW As Double
Get
Return m_dW
End Get
Set(value As Double)
m_dW = value
End Set
End Property
Protected m_dH As Double
Public Property dH As Double
Get
Return m_dH
End Get
Set(value As Double)
m_dH = value
End Set
End Property
Protected m_dtStartTime As DateTime
Public Property dtStartTime As DateTime
Get
Return m_dtStartTime
End Get
Set(value As DateTime)
m_dtStartTime = value
End Set
End Property
Protected m_dtEndTime As DateTime
Public Property dtEndTime As DateTime
Get
Return m_dtEndTime
End Get
Set(value As DateTime)
m_dtEndTime = value
End Set
End Property
Protected m_dMatForPart As Double = 0
Public ReadOnly Property dMatForPart As Double
Get
Return m_dMatForPart
End Get
End Property
Protected m_nProdIndex As Integer = 0
Public Property nProdIndex As Integer
Get
Return m_nProdIndex
End Get
Set
m_nProdIndex = Value
End Set
End Property
Public Sub SetMatForPart(dMatForPart As Double)
m_dMatForPart = dMatForPart
End Sub
Protected m_dTotMat As Double = 0
Public ReadOnly Property dTotMat As Double
Get
Return m_dTotMat
End Get
End Property
Public Sub SetTotMat(TotMat As Double)
m_dTotMat = TotMat
End Sub
Protected m_sMATERIAL As String
Public Property sMATERIAL As String
Get
Return m_sMATERIAL
End Get
Set(value As String)
m_sMATERIAL = value
End Set
End Property
' lista dei pezzi che sono nel grezzo
Protected m_PartMList As New List(Of PartM)
Public Property PartMList As List(Of PartM)
Get
Return m_PartMList
End Get
Set(value As List(Of PartM))
m_PartMList = value
End Set
End Property
#End Region ' General
#Region "Beam"
Protected m_dStartCut As Double
Public Property dStartCut As Double
Get
Return m_dStartCut
End Get
Set(value As Double)
m_dStartCut = value
End Set
End Property
#End Region ' Beam
#Region "Wall"
Protected m_nRawPartId As Integer = GDB_ID.NULL
Public ReadOnly Property nRawPartId As Integer
Get
Return m_nRawPartId
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"
Private m_nCALC_ERR As Integer
Public Property nCALC_ERR As Integer
Get
Return m_nCALC_ERR
End Get
Set(value As Integer)
m_nCALC_ERR = value
End Set
End Property
Private m_nCALC_FALL As Integer
Public Property nCALC_FALL As Integer
Get
Return m_nCALC_FALL
End Get
Set(value As Integer)
m_nCALC_FALL = value
End Set
End Property
Private m_sCALC_MSG As String
Public Property sCALC_MSG As String
Get
Return MessageFromLuaMsg(m_sCALC_MSG)
End Get
Set(value As String)
m_sCALC_MSG = value
End Set
End Property
Public m_nCALC_ROT As Integer
Public Property nCALC_ROT As Integer
Get
Return m_nCALC_ROT
End Get
Set(value As Integer)
m_nCALC_ROT = value
End Set
End Property
Public m_nCALC_TIME As Integer
Public Property nCALC_TIME As Integer
Get
Return m_nCALC_TIME
End Get
Set(value As Integer)
m_nCALC_TIME = value
End Set
End Property
Public m_nCALC_GlobalState As CalcStates = CalcStates.NOTCALCULATED
Public Property nCALC_GlobalState As CalcStates
Get
Return m_nCALC_GlobalState
End Get
Set(value As CalcStates)
m_nCALC_GlobalState = value
End Set
End Property
Private m_bCALC_PartsGlobalState As CalcStates
Public Property bCALC_PartsGlobalState As CalcStates
Get
Return m_bCALC_PartsGlobalState
End Get
Set(value As CalcStates)
m_bCALC_PartsGlobalState = value
End Set
End Property
Private m_nCALC_GlobalERR As Integer
Public Property nCALC_GlobalERR As Integer
Get
Return m_nCALC_GlobalERR
End Get
Set(value As Integer)
m_nCALC_GlobalERR = value
End Set
End Property
Public m_nCALC_State As CalcStates = CalcStates.NOTCALCULATED
Public Property nCALC_State As CalcStates
Get
Return m_nCALC_State
End Get
Set(value As CalcStates)
m_nCALC_State = value
End Set
End Property
#End Region ' Calc
#Region "Supervisor"
Protected m_sSupervisorId As String
Public Property sSupervisorId As String
Get
Return m_sSupervisorId
End Get
Set(value As String)
m_sSupervisorId = value
End Set
End Property
Protected m_nPriorityIndex As Integer
Public Property nPriorityIndex As Integer
Get
Return m_nPriorityIndex
End Get
Set(value As Integer)
m_nPriorityIndex = value
End Set
End Property
Protected m_nProductionState As ItemState = ItemState.ND
Public ReadOnly Property nProductionState As ItemState
Get
Return m_nProductionState
End Get
End Property
Public Sub SetProductionState(nState As ItemState)
m_nProductionState = nState
End Sub
#End Region ' Supervisor
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Protected Sub New()
End Sub
Public Overloads Shared Function CreateNewMachGroup() As MyMachGroupM
Return New MyMachGroupM
End Function
Public Overloads Shared Function CreateMyMachGroup(Type As BWType, nId As Integer, sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New MyMachGroupM
NewMachGroupM.m_Id = nId
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
NewMachGroupM.m_nType = Type
If NewMachGroupM.m_nType = MachineType.BEAM Then
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
For Each Part In NewMachGroupM.m_PartMList
Part.UpdateOffset()
NewMachGroupM.m_dTotMat += Part.dL + Part.dOffset
NewMachGroupM.m_dMatForPart += Part.dL
Next
Else
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
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
NewMachGroupM.m_dMatForPart += Part.dVolume
Next
End If
ReadMachGroupData(NewMachGroupM)
Return NewMachGroupM
End Function
Public Overloads Shared Function CreateMyMachGroup(Type As BWType, sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New MyMachGroupM
NewMachGroupM.m_Id = EgtAddMachGroup(sName, sMachine)
If NewMachGroupM.m_Id = GDB_ID.NULL Then Return Nothing
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
NewMachGroupM.m_nType = Type
If NewMachGroupM.m_nType = MachineType.BEAM Then
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARLEN, NewMachGroupM.m_dL)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARHEIGHT, NewMachGroupM.m_dH)
EgtGetInfo(NewMachGroupM.m_Id, MGR_RPT_BARWIDTH, NewMachGroupM.m_dW)
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
For Each Part In NewMachGroupM.m_PartMList
Part.UpdateOffset()
NewMachGroupM.m_dMatForPart += Part.dL + Part.dOffset
Next
Else
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
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
NewMachGroupM.m_dMatForPart += Part.dVolume
Next
End If
ReadMachGroupData(NewMachGroupM)
Return NewMachGroupM
End Function
#End Region ' CONSTRUCTOR
#Region "METHODS"
#Region "Machgroup"
Public Shared Sub ReadMachGroupData(NewMachgroup As MyMachGroupM)
' leggo materiale
EgtGetInfo(NewMachgroup.Id, MGR_RPT_MATERIAL, NewMachgroup.sMATERIAL)
' leggo calc error
Dim nErr As Integer = 0
Dim nRot As Integer = 0
Dim nFall As Integer = 0
Dim sMsg As String = ""
Dim bCalc As Boolean = False
bCalc = EgtGetInfo(NewMachgroup.Id, ITG_PROD_ERR, nErr)
EgtGetInfo(NewMachgroup.Id, ITG_PROD_ROT, nRot)
EgtGetInfo(NewMachgroup.Id, ITG_PROD_FALL, nFall)
EgtGetInfo(NewMachgroup.Id, ITG_PROD_MSG, sMsg)
If Not bCalc Then
NewMachgroup.m_nCALC_State = CalcStates.NOTCALCULATED
NewMachgroup.m_nCALC_ERR = 0
NewMachgroup.m_nCALC_ROT = 0
NewMachgroup.m_nCALC_FALL = 0
NewMachgroup.m_sCALC_MSG = ""
Else
NewMachgroup.m_nCALC_ERR = nErr
NewMachgroup.m_nCALC_ROT = nRot
NewMachgroup.m_nCALC_FALL = nFall
NewMachgroup.m_sCALC_MSG = sMsg
Select Case nErr
Case 0
NewMachgroup.nCALC_State = CalcStates.OK
Case 22
NewMachgroup.nCALC_State = CalcStates.COLLISION
Case 17, 19
NewMachgroup.nCALC_State = CalcStates.WARNING
Case < 0
NewMachgroup.nCALC_State = CalcStates.INFO
Case > 0
NewMachgroup.nCALC_State = CalcStates.ERROR_
End Select
End If
EgtGetInfo(NewMachgroup.Id, ITG_PROD_TIME, NewMachgroup.m_nCALC_TIME)
End Sub
Public Overridable Sub RefreshPartList()
If m_nType = MachineType.BEAM Then
' leggo StartCut da posizione primo pezzo
Dim sInfo As String = ""
Dim sSplitInfo() As String
Dim bFound As Boolean = False
EgtGetInfo(Id, MGR_RPT_PART & 1, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c)
StringToDoubleAdv(sSplitInfo(1), m_dStartCut)
Else
m_dStartCut = 0
End If
' aggiorno lista pezzi
RemoveAllParts()
Dim nRawPartId As Integer = EgtGetFirstRawPart()
While nRawPartId <> GDB_ID.NULL
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
If nPartId <> GDB_ID.NULL Then
Dim NewBeam As PartM = PartM.CreatePart(BWType.BEAM, Me, nPartId, nRawPartId)
AddPart(NewBeam)
NewBeam.UpdateOffset()
End If
nRawPartId = EgtGetNextRawPart(nRawPartId)
End While
Else
' aggiorno lista pezzi
RemoveAllParts()
Dim nRawPartId As Integer = EgtGetFirstRawPart()
If nRawPartId <> GDB_ID.NULL Then
Me.m_nRawPartId = nRawPartId
End If
Dim nWallId As Integer = EgtGetFirstPartInRawPart(m_nRawPartId)
While nWallId <> GDB_ID.NULL
If nWallId <> GDB_ID.NULL Then
Dim NewWall As PartM = PartM.CreatePart(BWType.WALL, Me, nWallId, m_nRawPartId)
AddPart(NewWall)
End If
nWallId = EgtGetNextPartInRawPart(nWallId)
End While
End If
End Sub
Public Overridable Sub RefreshGroupData()
If m_nType = MachineType.BEAM Then
EgtGetInfo(Id, MGR_RPT_BARLEN, dL)
EgtGetInfo(Id, MGR_RPT_BARHEIGHT, dH)
EgtGetInfo(Id, MGR_RPT_BARWIDTH, dW)
EgtGetInfo(Id, MGR_RPT_MATERIAL, sMATERIAL)
Else
EgtGetInfo(Id, MGR_RPT_PANELLEN, dL)
EgtGetInfo(Id, MGR_RPT_PANELWIDTH, dW)
EgtGetInfo(Id, MGR_RPT_PANELHEIGHT, dH)
EgtGetInfo(Id, MGR_RPT_MATERIAL, sMATERIAL)
End If
End Sub
Public Overridable Sub DeleteMachGroup()
' elimino tutte le copie
Dim nRawPartId As Integer = EgtGetFirstRawPart()
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
While nRawPartId <> GDB_ID.NULL
EgtRemovePartFromRawPart(nBeamId)
EgtErase(nBeamId)
nRawPartId = EgtGetNextRawPart(nRawPartId)
nBeamId = EgtGetFirstPartInRawPart(nRawPartId)
End While
' elimino MachGroup
EgtRemoveMachGroup(Me.Id)
End Sub
#End Region ' Machgroup
#Region "Parts"
Private Shared Function LoadParts(NewMachGroupM As MyMachGroupM) As List(Of PartM)
Dim TempList As New List(Of PartM)
If NewMachGroupM.m_nType = MachineType.BEAM Then
Dim nRawPartId As Integer = EgtGetFirstRawPart()
While nRawPartId <> GDB_ID.NULL
Dim nPartId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
If nPartId <> GDB_ID.NULL Then
Dim NewBeam As PartM = PartM.CreatePart(BWType.BEAM, NewMachGroupM, nPartId, nRawPartId)
TempList.Add(NewBeam)
End If
nRawPartId = EgtGetNextRawPart(nRawPartId)
End While
Else
Dim nWallId As Integer = EgtGetFirstPartInRawPart(NewMachGroupM.m_nRawPartId)
While nWallId <> GDB_ID.NULL
If nWallId <> GDB_ID.NULL Then
Dim NewWall As PartM = PartM.CreatePart(BWType.WALL, NewMachGroupM, nWallId, NewMachGroupM.m_nRawPartId)
TempList.Add(NewWall)
End If
nWallId = EgtGetNextPartInRawPart(nWallId)
End While
End If
Return TempList
End Function
Public Sub AddPart(PartM As PartM)
If IsNothing(PartM) Then Return
If Not m_PartMList.Contains(PartM) Then
m_PartMList.Add(PartM)
RaiseEvent PartAdded(Me, New PartAddedEventArgs(PartM))
End If
End Sub
Public Sub RemovePart(PartM As PartM)
If IsNothing(PartM) Then Return
If m_PartMList.Contains(PartM) AndAlso m_PartMList.Remove(PartM) Then
RaiseEvent PartRemoved(Me, New PartAddedEventArgs(PartM))
End If
End Sub
Public Sub RemoveAllParts()
If IsNothing(m_PartMList) Then Return
For PartIndex = m_PartMList.Count - 1 To 0 Step -1
Dim PartM As PartM = m_PartMList(PartIndex)
If m_PartMList.Remove(PartM) Then
RaiseEvent PartRemoved(Me, New PartAddedEventArgs(PartM))
End If
Next
End Sub
Public Function GetParts() As List(Of PartM)
Return New List(Of PartM)(m_PartMList)
End Function
#End Region ' Parts
#End Region ' METHODS
End Class
@@ -0,0 +1,449 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class MyMachGroupPanelM
Inherits MachGroupPanelM
#Region "FIELDS & PROPERTIES"
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Public Shared Function CreateMyMachGroupPanel(MachineList As List(Of Machine)) As MachGroupPanelM
Dim NewMyMachGroupPanelM As New MyMachGroupPanelM
NewMyMachGroupPanelM.m_IsMultiMachGroup = False
' Assegno nome base
NewMyMachGroupPanelM.m_BaseName = ""
' Recupero lista macchine
NewMyMachGroupPanelM.m_MachineList = MachineList
' Assegno macchina di default
NewMyMachGroupPanelM.m_DefaultMachine = ""
' aggiorno copie
UpdateDuplo()
' recupero i MachGroup
NewMyMachGroupPanelM.m_MachGroupMList = LoadMyMachGroups(MachineList)
Return NewMyMachGroupPanelM
End Function
#End Region ' CONSTRUCTOR
#Region "METHODS"
Public Shared Function LoadMyMachGroups(MachineList As List(Of Machine)) As List(Of MachGroupM)
Dim TempList As New List(Of MachGroupM)
' Carico i gruppi di lavorazione nella lista
Dim nId = EgtGetFirstMachGroup()
While nId <> GDB_ID.NULL
EgtSetCurrMachGroup(nId)
Dim sName As String = String.Empty
Dim sMachine As String = String.Empty
EgtGetMachGroupName(nId, sName)
EgtGetMachGroupMachineName(nId, sMachine)
' cerco la macchina tra quelle presenti
Dim UsedMachine As MyMachine = Nothing
Dim bOk As Boolean = Machine.SearchMachine(sMachine, MachineList, UsedMachine)
If Not bOk OrElse UsedMachine.nType = MachineType.NULL Then
EgtOutLog("Machine incompatible with beam & wall machining!!")
Else
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
Dim nPROJTYPE As Integer = BWType.NULL
EgtGetInfo(nBTLInfoLayerId, BTL_GEN_PROJTYPE, nPROJTYPE)
If nPROJTYPE = BWType.BEAM Or nPROJTYPE = BWType.WALL Then
TempList.Add(MyMachGroupM.CreateMyMachGroup(nPROJTYPE, nId, sName, sMachine))
Else
EgtOutLog("Machine of beam & wall type, but project type not found!!")
End If
End If
nId = EgtGetNextMachGroup(nId)
End While
EgtResetCurrMachGroup()
Return TempList
End Function
' funzione che restituisce il gruppo di lavorazione dato l'Id geometrico
Public Shared Function LoadMyMachGroupFromId(nId As Integer, MachineList As List(Of Machine)) As MachGroupM
If nId <= 0 Then Return Nothing
If Not EgtSetCurrMachGroup(nId) Then Return Nothing
Dim sName As String = String.Empty
Dim sMachine As String = String.Empty
EgtGetMachGroupName(nId, sName)
EgtGetMachGroupMachineName(nId, sMachine)
' cerco la macchina tra quelle presenti
Dim UsedMachine As MyMachine = Nothing
Dim bOk As Boolean = Machine.SearchMachine(sMachine, MachineList, UsedMachine)
If Not bOk OrElse UsedMachine.nType = MachineType.NULL Then
EgtOutLog("Machine incompatible with beam & wall machining!!")
Else
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
Dim nPROJTYPE As Integer = BWType.NULL
EgtGetInfo(nBTLInfoLayerId, BTL_GEN_PROJTYPE, nPROJTYPE)
If nPROJTYPE = BWType.BEAM Or nPROJTYPE = BWType.WALL Then
Return MyMachGroupM.CreateMyMachGroup(nPROJTYPE, nId, sName, sMachine)
Else
EgtOutLog("Machine of beam & wall type, but project type not found!!")
End If
End If
Return Nothing
End Function
' funzione che restituisce solo i gruppi di lavorazione creati nel nesting
Public Shared Function UpdateFromNestingMyMachGroups(MachineList As List(Of Machine)) As List(Of MachGroupM)
Dim TempList As New List(Of MachGroupM)
' Carico i gruppi di lavorazione nella lista
Dim nId = EgtGetFirstMachGroup()
While nId <> GDB_ID.NULL
Dim UpdateUI As Integer = 0
If EgtGetInfo(nId, "UPDATEUI", UpdateUI) AndAlso UpdateUI = 1 Then
TempList.Add(LoadMyMachGroupFromId(nId, MachineList))
' rimuovo info
EgtRemoveInfo(nId, "UPDATEUI")
End If
nId = EgtGetNextMachGroup(nId)
End While
EgtResetCurrMachGroup()
Return TempList
End Function
Public Function NewMyMachGroup(sMachName As String, nMachineType As MachineType) As MachGroupM
' Sistemazioni preliminari
OnPreNewMachGroup()
' Se non ci sono macchine disponibili esco con errore
If m_MachineList.Count <= 0 Then Return Nothing
' Creo il nuovo gruppo di lavorazione con i dati ottenuti a seconda del caso in cui mi trovo
Dim MachGroupM As MachGroupM
If nMachineType = MachineType.NULL Then
EgtOutLog("Machine incompatible with beam & wall machining!!")
Return Nothing
Else
MachGroupM = MyMachGroupM.CreateMyMachGroup(nMachineType, NewMachGroupID(), sMachName)
End If
If IsNothing(MachGroupM) Then Return Nothing
AddMachGroup(MachGroupM)
' Sistemazioni finali
m_DefaultMachine = sMachName
OnPostNewMachGroup()
Return MachGroupM
End Function
Public Overrides Function OnPreNewMachGroup() As Boolean
'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
Return True
End Function
' NB: Anche se ho già aggiunto il nuovo gruppo di lavorazione, non l'ho ancora reso corrente (viene fatto dopo), quindi
' non posso usare CurrentMachine perchè è ancora impostata quella precedente!!!
Public Overrides Function OnPostNewMachGroup() As Boolean
' Salvo macchina del gruppo come nuovo default
Dim sCurrMachName As String = String.Empty
EgtGetCurrMachineName(sCurrMachName)
WriteMainPrivateProfileString(S_MACH, K_CURRMACH, sCurrMachName)
'' leggo nome attrezzaggio di default
'Dim sDefaultSetUpName As String = String.Empty
'Dim sMachineIniPath As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sCurrMachName & "\" & sCurrMachName & ".ini"
'EgtUILib.GetPrivateProfileString(S_SETUP, K_DEFAULT, "", sDefaultSetUpName, sMachineIniPath)
'' se è attiva l'opzione, rendo corrente l'attrezzaggio di default
'If Not String.IsNullOrEmpty(sDefaultSetUpName) Then
' If Not EgtImportSetup(sDefaultSetUpName) Then
' EgtOutLog("Error loading default setup " & sDefaultSetUpName)
' MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 9) & " " & sDefaultSetUpName, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Exclamation)
' End If
'End If
Return True
End Function
Public Overrides Function OnPreRemoveCurrMachGroup() As Boolean
'EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
Return True
End Function
Public Function NewMachGroupID() As Integer
Dim nTemp As Integer = 0
If Not IsNothing(MachGroupMList) AndAlso MachGroupMList.Count > 0 Then Return MachGroupMList.Select(Of Integer)(Function(x) If(Integer.TryParse(x.Name, nTemp), nTemp, 0)).Max() + 1
Return 1
End Function
' funzione che fa l'update di tutte le copie dei pezzi modificati
Public Shared Sub UpdateDuplo()
' verifico tipo di progetto
Dim nBtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
Dim nBWType As Integer = 0
EgtGetInfo(nBtlInfoId, BTL_GEN_PROJTYPE, nBWType)
' ciclo sui pezzi
Dim bTotIsModified As Boolean = False
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
Dim bIsModified As Boolean = False
If EgtDuploGetModified(nPartId, bIsModified) AndAlso bIsModified Then
' verifico se c'é PRID sugli outline
Dim nPRId As Integer = 1
Dim nOutlineLayer As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
If nOutlineLayer <> GDB_ID.NULL Then
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
While nOutlineId <> GDB_ID.NULL
' verifico che sia feature
If EgtExistsInfo(nOutlineId, MGR_FTR_PRC) Then
If EgtExistsInfo(nOutlineId, MGR_FTR_PRID) Then
nOutlineId = EgtGetNext(nOutlineId)
Continue While
Else
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
nPRId += 1
End If
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
End If
bTotIsModified = True
Dim DuploList As New List(Of Integer)
EgtDuploList(nPartId, DuploList)
Dim DuploArray() As Integer
Dim RotArray(DuploList.Count) As Integer
Dim FlipArray(DuploList.Count) As Integer
Dim QArray(DuploList.Count) As Dictionary(Of String, Dictionary(Of String, String))
DuploArray = DuploList.ToArray()
' recupero ROT (gradi) e FLIP (0/1) per non perderli
For Duploindex = 0 To DuploArray.Length - 1
RotArray(Duploindex) = 0
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
FlipArray(Duploindex) = 0
EgtGetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
If FlipArray(Duploindex) <> 0 Then FlipArray(Duploindex) = 180
If nBWType = BWType.WALL Then
' salvo parametri Q
QArray(Duploindex) = New Dictionary(Of String, Dictionary(Of String, String))
' ciclo sugli outline
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
If nOutlineLayer <> GDB_ID.NULL Then
Dim nGlobPRId As Integer = 1
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
While nOutlineId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
If Not EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId) Then
EgtSetInfo(nOutlineId, MGR_FTR_PRID, nGlobPRId)
nPRId = nGlobPRId
nGlobPRId += 1
End If
Dim sKey As String = nPRId & "." & nPRC
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
For QIndex = 1 To 10
Dim QKey As String = "Q" & QIndex.ToString("D2")
Dim QValue As Integer = 0
If EgtGetInfo(nOutlineId, QKey, QValue) Then
QArray(Duploindex)(sKey).Add(QKey, QValue)
End If
Next
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
End If
' ciclo sulle feature
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
If nFeatureLayer <> GDB_ID.NULL Then
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
While nFeatureId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
Dim sKey As String = nPRId & "." & nPRC
QArray(Duploindex).Add(sKey, New Dictionary(Of String, String))
For QIndex = 1 To 10
Dim QKey As String = "Q" & QIndex.ToString("D2")
Dim QValue As Integer = 0
If EgtGetInfo(nFeatureId, QKey, QValue) Then
QArray(Duploindex)(sKey).Add(QKey, QValue)
End If
Next
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
End If
End If
Next
' aggiornamento dei Duplo
EgtDuploUpdate(nPartId)
' ripristino i valori di ROT e FLIP
For Duploindex = 0 To DuploArray.Length - 1
' ripristino info rot e flip
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_ROT, RotArray(Duploindex))
EgtSetInfo(DuploArray(Duploindex), MGR_PRT_FLIP, FlipArray(Duploindex))
If nBWType = BWType.WALL Then
' ciclo sugli outline
nOutlineLayer = EgtGetFirstNameInGroup(DuploArray(Duploindex), OUTLINE)
If nOutlineLayer <> GDB_ID.NULL Then
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayer)
While nOutlineId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nOutlineId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
EgtGetInfo(nOutlineId, MGR_FTR_PRID, nPRId)
Dim sKey As String = nPRId & "." & nPRC
' ripristino parametri Q
If QArray(Duploindex).ContainsKey(sKey) Then
For Each QPar In QArray(Duploindex)(sKey)
EgtSetInfo(nOutlineId, QPar.Key, QPar.Value)
Next
End If
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
End If
' ciclo sulle feature
Dim nFeatureLayer As Integer = EgtGetFirstNameInGroup(DuploArray(Duploindex), PROCESSINGS)
If nFeatureLayer <> GDB_ID.NULL Then
Dim nFeatureId As Integer = EgtGetFirstInGroup(nFeatureLayer)
While nFeatureId <> GDB_ID.NULL
' verifico che sia feature
Dim nPRC As Integer
If EgtGetInfo(nFeatureId, MGR_FTR_PRC, nPRC) Then
nPRId = 0
EgtGetInfo(nFeatureId, MGR_FTR_PRID, nPRId)
Dim sKey As String = nPRId & "." & nPRC
' ripristino parametri Q
If QArray(Duploindex).ContainsKey(sKey) Then
For Each QPar In QArray(Duploindex)(sKey)
EgtSetInfo(nFeatureId, QPar.Key, QPar.Value)
Next
End If
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
End If
End If
Next
End If
nPartId = EgtGetNextPart(nPartId)
End While
If bTotIsModified Then
Dim CurrFilePath As String = ""
EgtGetCurrFilePath(CurrFilePath)
EgtSaveFile(CurrFilePath, NGE.CMPTEXT)
End If
End Sub
Class DuploFeature
' Id geometrico della feature
Friend nFeatureId As Integer
Friend nPRC As Integer
Friend nPRID As Integer
End Class
' funzione che cancella tutti i pezzi segnati da eliminare
Public Shared Function DeleteDuplo() As List(Of Integer)
Dim ToRedrawMachGroupList As New List(Of Integer)
' reset necessario per poter accedere direttamente al grezzo dalle info pezzo e al MachGroup tramite la gerarchia Db geometrico
EgtResetCurrMachGroup()
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
Dim bIsToDelete As Boolean = False
If DuploGetToDelete(nPartId, bIsToDelete) AndAlso bIsToDelete Then
' verifico se ci sono copie
Dim nDuploCount As Integer = 0
EgtDuploCount(nPartId, nDuploCount)
Dim DuploList As New List(Of Integer)
If nDuploCount > 0 AndAlso EgtDuploList(nPartId, DuploList) Then
' cancello tutti i pezzi copia nelle barre
For Each nDuploId In DuploList
' recupero grezzo cui appartiene
Dim nRawPartId As Integer = DuploGetRawPart(nDuploId)
' recupero gruppo di lavorazione
Dim nMachGroupId As Integer = EgtGetParent(EgtGetParent(EgtGetParent(nRawPartId)))
' elimino eventuali successive info pezzi di troppo
Dim nIndex As Integer = 0
Dim sTemp As String = ""
While EgtGetInfo(nMachGroupId, MGR_RPT_PART & nIndex, sTemp)
Dim PartData() As String = sTemp.Split(","c)
If PartData(0) <> nDuploId Then
EgtSetInfo(nMachGroupId, MGR_RPT_PART & nIndex, sTemp)
nIndex += 1
End If
End While
ToRedrawMachGroupList.Add(nMachGroupId)
'' elimino vecchio grezzo ed eseguo script creazione nuovo
'Dim nRawId As Integer = EgtGetFirstRawPart()
'While nRawId <> GDB_ID.NULL
' EgtRemovePartFromRawPart(EgtGetFirstPartInRawPart(nRawId))
' EgtRemoveRawPart(nRawId)
' nRawId = EgtGetFirstRawPart()
'End While
'If Not ExecBeam(Map.refMainWindowVM.MainWindowM.sTempDir, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then Return False
' lo setto come corrente
EgtSetCurrMachGroup(nMachGroupId)
' elimino pezzo copia
EgtRemovePartFromRawPart(nDuploId)
EgtErase(nDuploId)
Next
End If
DuploResetToDelete(nPartId)
End If
nPartId = EgtGetNextPart(nPartId)
End While
EgtResetCurrMachGroup()
Return ToRedrawMachGroupList
End Function
Friend Shared Function DuploGetToDelete(nSouId As Integer, ByRef bToDelete As Boolean) As Boolean
If IsNothing(nSouId) Then Return False
Return EgtGetInfo(nSouId, DUPLO_TODELETE, bToDelete)
End Function
Public Shared Function DuploSetToDelete(nSouId As Integer) As Boolean
If IsNothing(nSouId) Then Return False
Return EgtSetInfo(nSouId, DUPLO_TODELETE, True)
End Function
Private Shared Function DuploResetToDelete(nSouId As Integer) As Boolean
If IsNothing(nSouId) Then Return False
Return EgtSetInfo(nSouId, DUPLO_TODELETE, "")
End Function
' funzione che restituisce il pezzo di origine di un Duplo
' sostituisce EgtDuploGetOriginal che funziona solo all'interno del MachGroup del Duplo
Public Shared Function DuploGetOriginal(nDuploId As Integer) As Integer
Dim nOrigId As Integer = GDB_ID.NULL
If EgtGetInfo(nDuploId, GDB_SI_DUPSOU, nOrigId) AndAlso nOrigId > 0 Then
Return nOrigId
Else
Return GDB_ID.NULL
End If
End Function
Public Shared Function DuploGetRawPart(nDuploId As Integer) As Integer
Dim nSwapItem As Integer = GDB_ID.NULL
Dim sSwapItem As String = String.Empty
EgtGetInfo(nDuploId, "!LST", sSwapItem)
Dim LSTValues() As String = sSwapItem.Split(","c)
If Not IsNothing(LSTValues(LSTValues.Count - 1)) AndAlso Integer.TryParse(LSTValues(LSTValues.Count - 1), nSwapItem) AndAlso nSwapItem > 0 Then
Return EgtGetParent(nSwapItem)
End If
Return GDB_ID.NULL
'Dim nRawId As Integer = GDB_ID.NULL
'If EgtGetInfo(nDuploId, GDB_SI_LIST, nRawId) AndAlso nRawId > 0 Then
' Return nRawId
'Else
' Return GDB_ID.NULL
'End If
End Function
#End Region ' METHODS
End Class
+646
View File
@@ -0,0 +1,646 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtUILib
Imports EgtWPFLib5
Public Class PartM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
#Region "General"
Public Event BTLFeatureAdded As EventHandler(Of BTLFeatureAddedEventArgs)
Protected m_nType As BWType
Public ReadOnly Property nType As BWType
Get
Return m_nType
End Get
End Property
Protected m_ParentMachGroup As MyMachGroupM
Public ReadOnly Property ParentMachGroup As MyMachGroupM
Get
Return m_ParentMachGroup
End Get
End Property
' Id geometrico del pezzo
Protected m_nPartId As Integer
Public ReadOnly Property nPartId As Integer
Get
Return m_nPartId
End Get
End Property
Friend Sub SetPartId(nPartId As Integer)
m_nPartId = nPartId
End Sub
' Proj del pezzo
Protected m_nProjId As Integer = 0
Public Property nProjId As Integer
Get
Return m_nProjId
End Get
Set(value As Integer)
m_nProjId = value
End Set
End Property
' Info del pezzo
Protected m_nPDN As Integer
Public ReadOnly Property nPDN As Integer
Get
Return m_nPDN
End Get
End Property
Protected m_sNAM As String
Public ReadOnly Property sNAM As String
Get
Return m_sNAM
End Get
End Property
Protected m_dBtlL As Double
Public ReadOnly Property dBtlL As String
Get
Return m_dBtlL
End Get
End Property
Public Property dL As Double
Get
Dim frBeam As New Frame3d
EgtGetGroupGlobFrame(nPartId, frBeam)
If IsX(frBeam.VersX(), EPS_SMALL) Then
Return m_dBtlL
ElseIf IsX(frBeam.VersY(), EPS_SMALL) Then
Return m_dBtlH
Else
Return m_dBtlW
End If
End Get
Set(value As Double)
m_dBtlL = value
End Set
End Property
Protected m_dBtlW As Double
Public ReadOnly Property dBtlW As String
Get
Return m_dBtlW
End Get
End Property
Public Property dW As Double
Get
Dim frBeam As New Frame3d
EgtGetGroupGlobFrame(nPartId, frBeam)
If IsY(frBeam.VersX()) Then
Return m_dBtlL
ElseIf IsY(frBeam.VersY()) Then
Return m_dBtlH
Else
Return m_dBtlW
End If
End Get
Set(value As Double)
m_dBtlW = value
End Set
End Property
Protected m_dBtlH As Double
Public ReadOnly Property dBtlH As String
Get
Return m_dBtlH
End Get
End Property
Public Property dH As Double
Get
Dim frBeam As New Frame3d
EgtGetGroupGlobFrame(nPartId, frBeam)
If IsZ(frBeam.VersX()) Then
Return m_dBtlL
ElseIf IsZ(frBeam.VersY()) Then
Return m_dBtlH
Else
Return m_dBtlW
End If
Return m_dBtlH
End Get
Set(value As Double)
m_dBtlH = value
End Set
End Property
Protected m_dPOSX As Double
Public Property dPOSX As Double
Get
If nType = BWType.WALL Then
' verifico che sia attivo MachGroup di questo pezzo
If EgtGetCurrMachGroup() = ParentMachGroup.Id Then
' recupero box pezzo
Dim b3Part As New BBox3d
EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
' recupero layer del box
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
' recupero box del layer box
Dim b3Box As New BBox3d
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
' recupero origine grezzo
Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
Dim b3Raw As New BBox3d
EgtGetRawPartBBox(nrawPartId, b3Raw)
' calcolo distanza tra origine pezzo e tavolo
Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
m_dPOSX = vtPartRef.x
Return vtPartRef.x
' altrimenti restituisco valore salvato (per quando viene clickato un BTLPart)
Else
Return m_dPOSX
End If
Else ' nType = BWType.BEAM
Return m_dPOSX
End If
End Get
Set(value As Double)
m_dPOSX = value
End Set
End Property
Protected m_nCNT As Integer
Public Property nCNT As Integer
Get
Return m_nCNT
End Get
Set(value As Integer)
m_nCNT = value
End Set
End Property
Protected m_nINVERTED As Integer
Public ReadOnly Property nINVERTED As Integer
Get
Return m_nINVERTED
End Get
End Property
Public Sub SetInverted(nInverted As Integer)
m_nINVERTED = nInverted
End Sub
Protected m_nROTATED As Integer
Public ReadOnly Property nROTATED As Integer
Get
Return m_nROTATED
End Get
End Property
Public Sub SetRotated(nRotated As Integer)
m_nROTATED = nRotated
End Sub
Protected m_sMATERIAL As String
Public Property sMATERIAL As String
Get
Return m_sMATERIAL
End Get
Set(value As String)
m_sMATERIAL = value
End Set
End Property
Public m_sSTOREY As String
Public Property sSTOREY As String
Get
Return m_sSTOREY
End Get
Set(value As String)
m_sSTOREY = value
End Set
End Property
Public m_sGROUP As String
Public Property sGROUP As String
Get
Return m_sGROUP
End Get
Set(value As String)
m_sGROUP = value
End Set
End Property
Protected m_nBTLPartId As Integer
Public ReadOnly Property nBTLPartId As Integer
Get
Return m_nBTLPartId
End Get
End Property
' lista delle feature del pezzo
Protected m_FeatureMList As List(Of BTLFeatureM)
Public Property FeatureMList As List(Of BTLFeatureM)
Get
Return m_FeatureMList
End Get
Set(value As List(Of BTLFeatureM))
m_FeatureMList = value
End Set
End Property
#End Region ' General
#Region "Beam"
' Id del grezzo
Protected m_nRawPartId As Integer = GDB_ID.NULL
Public ReadOnly Property nRawPartId As Integer
Get
Return m_nRawPartId
End Get
End Property
Protected m_dOffset As Double
Public Property dOffset As Double
Get
Return m_dOffset
End Get
Set(value As Double)
m_dOffset = value
End Set
End Property
#End Region ' Beam
#Region "Wall"
Protected m_dPOSY As Double
Public Property dPOSY As Double
Get
' verifico che sia attivo MachGroup di questo pezzo
If EgtGetCurrMachGroup() = ParentMachGroup.Id Then
' recupero box pezzo
Dim b3Part As New BBox3d
EgtGetBBoxGlob(nPartId, GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, b3Part)
' recupero layer del box
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nPartId, "Box")
' recupero box del layer box
Dim b3Box As New BBox3d
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
' recupero origine grezzo
Dim nrawPartId As Integer = EgtGetRawPartFromPart(nPartId)
Dim b3Raw As New BBox3d
EgtGetRawPartBBox(nrawPartId, b3Raw)
' calcolo distanza tra origine pezzo e tavolo
Dim vtPartRef As New Vector3d(b3Box.Min() - b3Raw.Min())
m_dPOSY = vtPartRef.y
Return vtPartRef.y
' altrimenti restituisco valore salvato (per quando viene clickato un BTLPart)
Else
Return m_dPOSY
End If
'Return m_dPOSY
End Get
Set(value As Double)
m_dPOSY = value
End Set
End Property
Protected m_dROT As Double
Public Property dROT As Double
Get
Return m_dROT
End Get
Set(value As Double)
m_dROT = value
End Set
End Property
Protected m_nFLIP As Integer
Public Property nFLIP As Integer
Get
Return m_nFLIP
End Get
Set(value As Integer)
m_nFLIP = value
End Set
End Property
Protected m_dVolume As Double
Public Property dVolume As Double
Get
Return m_dVolume
End Get
Set(value As Double)
m_dVolume = value
End Set
End Property
#End Region ' Wall
#Region "Calc"
Protected m_nCALC_GlobalState As CalcStates = CalcStates.NOTCALCULATED
Public Property nCALC_GlobalState As CalcStates
Get
Return m_nCALC_GlobalState
End Get
Set(value As CalcStates)
m_nCALC_GlobalState = value
End Set
End Property
Private m_nCALC_GlobalERR As Integer
Public Property nCALC_GlobalERR As Integer
Get
Return m_nCALC_GlobalERR
End Get
Set(value As Integer)
m_nCALC_GlobalERR = value
End Set
End Property
Protected m_nCALC_State As CalcStates = CalcStates.NOTCALCULATED
Public Property nCALC_State As CalcStates
Get
Return m_nCALC_State
End Get
Set(value As CalcStates)
m_nCALC_State = value
End Set
End Property
Protected m_nCALC_ERR As Integer
Public Property nCALC_ERR As Integer
Get
Return m_nCALC_ERR
End Get
Set(value As Integer)
m_nCALC_ERR = value
End Set
End Property
Protected m_sCALC_MSG As String = String.Empty
Public Property sCALC_MSG As String
Get
Return MessageFromLuaMsg(m_sCALC_MSG)
End Get
Set(value As String)
m_sCALC_MSG = value
End Set
End Property
Protected m_nCALC_ROT As Integer
Public Property nCALC_ROT As Integer
Get
Return m_nCALC_ROT
End Get
Set(value As Integer)
m_nCALC_ROT = value
End Set
End Property
Protected m_nCALC_FALL As Integer
Public Property nCALC_FALL As Integer
Get
Return m_nCALC_FALL
End Get
Set(value As Integer)
m_nCALC_FALL = value
End Set
End Property
Protected m_nCALC_TIME As Integer
Public Property nCALC_TIME As Integer
Get
Return m_nCALC_TIME
End Get
Set(value As Integer)
m_nCALC_TIME = value
End Set
End Property
#End Region ' Calc
#Region "Supervisor"
Protected m_nProductionState As ItemState = ItemState.ND
Public ReadOnly Property nProductionState As ItemState
Get
Return m_nProductionState
End Get
End Property
Public Sub SetProductionState(nState As CalcStates)
m_nProductionState = nState
End Sub
Protected m_dtStartTime As DateTime
Public Property dtStartTime As DateTime
Get
Return m_dtStartTime
End Get
Set(value As DateTime)
m_dtStartTime = value
End Set
End Property
Protected m_dtEndTime As DateTime
Public Property dtEndTime As DateTime
Get
Return m_dtEndTime
End Get
Set(value As DateTime)
m_dtEndTime = value
End Set
End Property
#End Region ' Supervisor
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(nParentMachGroup As MyMachGroupM, nPartId As Integer)
m_ParentMachGroup = nParentMachGroup
SetPartId(nPartId)
' imposto BtlPart da cui deriva questo Duplo
m_nBTLPartId = MyMachGroupPanelM.DuploGetOriginal(nPartId)
End Sub
Public Shared Function CreatePart(Type As BWType, nParentMachGroup As MyMachGroupM, nPartId As Integer, nRawPartId As Integer) As PartM
Dim NewPartM As New PartM(nParentMachGroup, nPartId)
NewPartM.m_nType = Type
NewPartM.m_nRawPartId = nRawPartId
' leggo info pezzo
EgtGetInfo(nPartId, BTL_PRT_PROJ, NewPartM.m_nProjId)
EgtGetInfo(nPartId, BTL_PRT_PDN, NewPartM.m_nPDN)
EgtGetInfo(nPartId, BTL_PRT_NAM, NewPartM.m_sNAM)
EgtGetInfo(nPartId, BTL_PRT_L, NewPartM.m_dBtlL)
EgtGetInfo(nPartId, BTL_PRT_W, NewPartM.m_dBtlW)
EgtGetInfo(nPartId, BTL_PRT_H, NewPartM.m_dBtlH)
EgtGetInfo(nPartId, BTL_PRT_CNT, NewPartM.m_nCNT)
EgtGetInfo(nPartId, BTL_PRT_GROUP, NewPartM.m_sGROUP)
EgtGetInfo(nPartId, BTL_PRT_STOREY, NewPartM.m_sSTOREY)
EgtGetInfo(nPartId, BTL_PRT_MATERIAL, NewPartM.m_sMATERIAL)
Dim nTemp As Integer = 0
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
nTemp = 0
End If
NewPartM.SetRotated(nTemp)
If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, nTemp) Then
nTemp = 0
End If
NewPartM.SetInverted(nTemp)
If NewPartM.m_nType = BWType.BEAM Then
' leggo PosX
Dim sInfo As String = ""
Dim Index = 1
Dim sSplitInfo() As String = Nothing
Dim bFound As Boolean = False
While EgtGetInfo(NewPartM.m_ParentMachGroup.Id, MGR_RPT_PART & Index, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c)
If sSplitInfo(0) = nPartId Then
bFound = True
Exit While
End If
End If
Index += 1
End While
If bFound Then
StringToDoubleAdv(sSplitInfo(1), NewPartM.m_dPOSX)
End If
Else
' leggo PosX, PosY, Rot e Flip
EgtGetInfo(nPartId, MGR_PRT_POSX, NewPartM.m_dPOSX)
EgtGetInfo(nPartId, MGR_PRT_POSY, NewPartM.m_dPOSY)
EgtGetInfo(nPartId, MGR_PRT_ROT, NewPartM.m_dROT)
EgtGetInfo(nPartId, MGR_PRT_FLIP, NewPartM.m_nFLIP)
End If
' leggo volume
If Not EgtGetInfo(nPartId, BTL_PRT_VOLUME, NewPartM.dVolume) Then
Dim nOrigId As Integer = EgtDuploGetOriginal(nPartId)
EgtGetInfo(nOrigId, BTL_PRT_VOLUME, NewPartM.dVolume)
End If
' leggo feature
NewPartM.m_FeatureMList = LoadBTLFeatures(NewPartM, nPartId)
ReadMachGroupData(NewPartM)
Return NewPartM
End Function
#End Region ' CONSTRUCTOR
#Region "METHODS"
#Region "Part"
Public Shared Sub ReadMachGroupData(NewPartM As PartM)
' leggo calc error
Dim nErr As Integer = 0
Dim nRot As Integer = 0
Dim nFall As Integer = 0
Dim sMsg As String = ""
Dim bCalc As Boolean = False
bCalc = EgtGetInfo(NewPartM.nPartId, ITG_PROD_ERR, nErr)
EgtGetInfo(NewPartM.nPartId, ITG_PROD_ROT, nRot)
EgtGetInfo(NewPartM.nPartId, ITG_PROD_FALL, nFall)
EgtGetInfo(NewPartM.nPartId, ITG_PROD_MSG, sMsg)
If Not bCalc Then
NewPartM.m_nCALC_State = CalcStates.NOTCALCULATED
NewPartM.m_nCALC_ERR = -1
NewPartM.m_nCALC_ROT = 0
NewPartM.m_nCALC_FALL = 0
NewPartM.m_sCALC_MSG = ""
Else
NewPartM.m_nCALC_ERR = nErr
NewPartM.m_nCALC_ROT = nRot
NewPartM.m_nCALC_FALL = nFall
NewPartM.m_sCALC_MSG = sMsg
Select Case nErr
Case 0
NewPartM.nCALC_State = CalcStates.OK
Case 22
NewPartM.nCALC_State = CalcStates.COLLISION
Case 17, 19
NewPartM.nCALC_State = CalcStates.WARNING
Case < 0
NewPartM.nCALC_State = CalcStates.INFO
Case > 0
NewPartM.nCALC_State = CalcStates.ERROR_
End Select
End If
EgtGetInfo(NewPartM.nPartId, ITG_PROD_TIME, NewPartM.m_nCALC_TIME)
End Sub
Public Sub ReadVolume()
' leggo volume
If Not EgtGetInfo(nPartId, BTL_PRT_VOLUME, dVolume) Then
Dim nOrigId As Integer = EgtDuploGetOriginal(nPartId)
EgtGetInfo(nOrigId, BTL_PRT_VOLUME, dVolume)
End If
End Sub
#End Region ' Part
#Region "Beam"
Public Sub UpdateOffset()
' calcolo offset
Dim nBeamIndex As Integer = ParentMachGroup.PartMList.IndexOf(Me)
If nBeamIndex > 0 Then
m_dOffset = dPOSX - (ParentMachGroup.PartMList(nBeamIndex - 1).dPOSX + ParentMachGroup.PartMList(nBeamIndex - 1).dL)
Else
m_dOffset = dPOSX
End If
End Sub
#End Region ' Beam
#Region "Features"
Public Shared Function LoadBTLFeatures(NewPartM As PartM, nPartId As Integer) As List(Of BTLFeatureM)
Dim TempList As New List(Of BTLFeatureM)
' Aggiungo outline
Dim nOutLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutLayerId)
While nOutlineId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nOutlineId, BTL_FTR_MAINID) Then
' creo la feature
TempList.Add(BTLFeatureM.CreateBTLFeature(NewPartM, nOutlineId, False))
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
' Aggiungo feature
Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
While nFeatureId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nFeatureId, BTL_FTR_MAINID) Then
' creo la feature
TempList.Add(BTLFeatureM.CreateBTLFeature(NewPartM, nFeatureId, False))
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
Return TempList
End Function
Public Sub AddBTLFeature(BTLFeatureM As BTLFeatureM)
If IsNothing(BTLFeatureM) Then Return
If Not m_FeatureMList.Contains(BTLFeatureM) Then
m_FeatureMList.Add(BTLFeatureM)
RaiseEvent BTLFeatureAdded(Me, New BTLFeatureAddedEventArgs(BTLFeatureM))
End If
End Sub
Public Function GetBTLFeatures() As List(Of BTLFeatureM)
Return New List(Of BTLFeatureM)(m_FeatureMList)
End Function
#End Region ' Features
#End Region ' METHODS
End Class
+110
View File
@@ -0,0 +1,110 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class WallM
Inherits PartM
Protected m_dPOSY As Double
Public Property dPOSY As Double
Get
Return m_dPOSY
End Get
Set(value As Double)
m_dPOSY = value
End Set
End Property
Protected m_dROT As Double
Public Property dROT As Double
Get
Return m_dROT
End Get
Set(value As Double)
m_dROT = value
End Set
End Property
Protected m_bFLIP As Boolean
Public Property bFLIP As Boolean
Get
Return m_bFLIP
End Get
Set(value As Boolean)
m_bFLIP = value
End Set
End Property
#Region "CONSTRUCTOR"
Protected Sub New(nParentMachGroup As MyMachGroupM, nPartId As Integer)
MyBase.New(nParentMachGroup, nPartId)
End Sub
Public Shared Function CreateWall(nParentMachGroup As MyMachGroupM, nPartId As Integer, nRawPartId As Integer) As WallM
Dim NewWallM As New WallM(nParentMachGroup, nPartId)
' leggo info pezzo
EgtGetInfo(nPartId, BTL_PRT_PROJ, NewWallM.m_nProjId)
EgtGetInfo(nPartId, BTL_PRT_PDN, NewWallM.m_nPDN)
EgtGetInfo(nPartId, BTL_PRT_NAM, NewWallM.m_sNAM)
EgtGetInfo(nPartId, BTL_PRT_L, NewWallM.m_dBtlL)
EgtGetInfo(nPartId, BTL_PRT_W, NewWallM.m_dBtlW)
EgtGetInfo(nPartId, BTL_PRT_H, NewWallM.m_dBtlH)
EgtGetInfo(nPartId, BTL_PRT_CNT, NewWallM.m_nCNT)
Dim nTemp As Integer = 0
If Not EgtGetInfo(nPartId, BTL_PRT_ROTATED, nTemp) Then
nTemp = 0
End If
NewWallM.SetRotated(nTemp)
If Not EgtGetInfo(nPartId, BTL_PRT_INVERTED, nTemp) Then
nTemp = 0
End If
NewWallM.SetInverted(nTemp)
' leggo PosX, PosY, Rot e Flip
EgtGetInfo(nPartId, MGR_PRT_POSX, NewWallM.m_dPOSX)
EgtGetInfo(nPartId, MGR_PRT_POSY, NewWallM.m_dPOSY)
EgtGetInfo(nPartId, MGR_PRT_ROT, NewWallM.m_dROT)
EgtGetInfo(nPartId, MGR_PRT_FLIP, NewWallM.m_bFLIP)
' leggo feature
NewWallM.m_FeatureMList = LoadBTLFeatures(nPartId)
ReadMachGroupData(NewWallM)
Return NewWallM
End Function
#End Region ' CONSTRUCTOR
#Region "METHODS"
Private Shared Function LoadBTLFeatures(nPartId As Integer) As List(Of BTLFeatureM)
Dim TempList As New List(Of BTLFeatureM)
' Aggiungo outline
Dim nOutLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutLayerId)
While nOutlineId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nOutlineId, BTL_FTR_MAINID) Then
' creo la feature
TempList.Add(BTLFeatureM.CreateBTLFeature(Nothing, nOutlineId))
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
' Aggiungo feature
Dim nProcessingId As Integer = EgtGetFirstNameInGroup(nPartId, PROCESSINGS)
Dim nFeatureId As Integer = EgtGetFirstInGroup(nProcessingId)
While nFeatureId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nFeatureId, BTL_FTR_GRP, nGRP) AndAlso Not EgtExistsInfo(nFeatureId, BTL_FTR_MAINID) Then
' creo la feature
TempList.Add(BTLFeatureM.CreateBTLFeature(Nothing, nFeatureId))
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
Return TempList
End Function
#End Region ' METHODS
End Class
@@ -0,0 +1,103 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class WallMachGroupM
Inherits MyMachGroupM
Protected m_nRawPartId As Integer = GDB_ID.NULL
Public ReadOnly Property nRawPartId As Integer
Get
Return m_nRawPartId
End Get
End Property
#Region "CONSTRUCTORS"
Protected Sub New()
End Sub
Public Shared Function CreateNewWallMachGroup() As MachGroupM
Return New MachGroupM
End Function
Public Shared Function CreateWallMachGroup(nId As Integer, sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New WallMachGroupM
NewMachGroupM.m_Id = nId
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
NewMachGroupM.m_nType = MachineType.WALL
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
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)
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW
NewMachGroupM.m_PartMList = LoadParts(NewMachGroupM)
For Each Part In NewMachGroupM.m_PartMList
NewMachGroupM.m_dMatForPart += (Part.dL * Part.dW)
Next
ReadMachGroupData(NewMachGroupM)
Return NewMachGroupM
End Function
Public Shared Function CreateWallMachGroup(sName As String, sMachine As String) As MachGroupM
Dim NewMachGroupM As New WallMachGroupM
' Creo il nuovo gruppo di lavorazione con i dati ottenuti a seconda del caso in cui mi trovo
NewMachGroupM.m_Id = EgtAddMachGroup(sName, sMachine)
If NewMachGroupM.m_Id = GDB_ID.NULL Then Return Nothing
NewMachGroupM.m_Name = sName
NewMachGroupM.m_Machine = sMachine
NewMachGroupM.m_nType = MachineType.WALL
NewMachGroupM.m_nRawPartId = EgtGetFirstRawPart()
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)
NewMachGroupM.m_dTotMat = NewMachGroupM.m_dL * NewMachGroupM.m_dW
For Each Part In NewMachGroupM.m_PartMList
NewMachGroupM.m_dMatForPart += (Part.dL * Part.dW)
Next
ReadMachGroupData(NewMachGroupM)
Return NewMachGroupM
End Function
#End Region ' CONSTRUCTORS
Private Shared Function LoadParts(NewWallMachGroupM As WallMachGroupM) As List(Of PartM)
Dim TempList As New List(Of PartM)
Dim nWallId As Integer = EgtGetFirstPartInRawPart(NewWallMachGroupM.m_nRawPartId)
While nWallId <> GDB_ID.NULL
If nWallId <> GDB_ID.NULL Then
Dim NewWall As WallM = WallM.CreateWall(NewWallMachGroupM, nWallId, NewWallMachGroupM.m_nRawPartId)
TempList.Add(NewWall)
End If
nWallId = EgtGetNextPartInRawPart(nWallId)
End While
Return TempList
End Function
Public Overrides Sub RefreshPartList()
' aggiorno lista pezzi
RemoveAllParts()
Dim nRawPartId As Integer = EgtGetFirstRawPart()
If nRawPartId <> GDB_ID.NULL Then
Me.m_nRawPartId = nRawPartId
End If
Dim nWallId As Integer = EgtGetFirstPartInRawPart(m_nRawPartId)
While nWallId <> GDB_ID.NULL
If nWallId <> GDB_ID.NULL Then
Dim NewWall As WallM = WallM.CreateWall(Me, nWallId, m_nRawPartId)
AddPart(NewWall)
End If
nWallId = EgtGetNextPartInRawPart(nWallId)
End While
End Sub
Public Overrides Sub RefreshGroupData()
EgtGetInfo(Id, MGR_RPT_PANELLEN, dL)
EgtGetInfo(Id, MGR_RPT_PANELWIDTH, dW)
EgtGetInfo(Id, MGR_RPT_PANELHEIGHT, dH)
EgtGetInfo(Id, MGR_RPT_MATERIAL, sMATERIAL)
End Sub
End Class
@@ -0,0 +1,113 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public MustInherit Class BeamMachGroupVM
Inherits MyMachGroupVM
Public ReadOnly Property m_BeamMachGroupM As BeamMachGroupM
Get
Return m_MachGroupM
End Get
End Property
Public Overridable Property sStartCut As String
Get
Return LenToString(m_BeamMachGroupM.dStartCut, 3)
End Get
Set(value As String)
StringToLen(value, m_BeamMachGroupM.dStartCut)
End Set
End Property
Public Property dStartCut As Double
Get
Return m_BeamMachGroupM.dStartCut
End Get
Set(value As Double)
m_BeamMachGroupM.dStartCut = value
NotifyPropertyChanged(NameOf(sStartCut))
End Set
End Property
Public Property SelBeam As BeamVM
Get
Return m_SelPart
End Get
Set(value As BeamVM)
m_SelPart = value
End Set
End Property
#Region "CONSTRUCTORS"
Sub New(BeamMachGroupM As BeamMachGroupM)
MyBase.New(BeamMachGroupM)
AddHandler m_BeamMachGroupM.PartAdded, AddressOf OnBeamAdded
AddHandler m_BeamMachGroupM.PartRemoved, AddressOf OnBeamRemoved
CreateBeamVMList()
' Aggiorno stato da stati feature
CalcGlobalUpdate()
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Protected MustOverride Sub CreateBeamVMList()
Public Overrides Sub RefreshPartList()
End Sub
Public Overrides Sub RefreshGroupData()
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#End Region ' COMMANDS
#Region "EVENTS"
Protected MustOverride Sub OnBeamAdded(sender As Object, e As PartAddedEventArgs)
Private Sub OnBeamRemoved(sender As Object, e As PartAddedEventArgs)
Dim BeamVM As BeamVM = PartVMList.FirstOrDefault(Function(x) x.PartM Is e.m_NewPart)
If Not IsNothing(BeamVM) Then PartVMList.Remove(BeamVM)
End Sub
Protected Sub OnBeamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If e.Action = NotifyCollectionChangedAction.Add Then
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each BeamVM As BeamVM In e.NewItems
AddHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
Next
End If
End If
If e.Action = NotifyCollectionChangedAction.Remove Then
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each BeamVM As BeamVM In e.OldItems
RemoveHandler BeamVM.PropertyChanged, AddressOf OnBeamVMPropertyChanged
Next
End If
End If
If e.Action = NotifyCollectionChangedAction.Move Then
Dim ItemVM As PartVM = e.OldItems(0)
m_BeamMachGroupM.PartMList.RemoveAt(e.OldStartingIndex)
m_BeamMachGroupM.PartMList.Insert(e.NewStartingIndex, ItemVM.PartM)
End If
End Sub
Protected Overridable Sub OnBeamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
'Select Case e.PropertyName
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
'End Select
End Sub
#End Region
End Class
+43
View File
@@ -0,0 +1,43 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public MustInherit Class BeamVM
Inherits PartVM
Public ReadOnly Property m_BeamM As BeamM
Get
Return m_PartM
End Get
End Property
Public Overridable Property sOffset As String
Get
Return LenToString(m_BeamM.dOffset, 3)
End Get
Set(value As String)
StringToLen(value, m_BeamM.dOffset)
End Set
End Property
Public ReadOnly Property dOffset As Double
Get
Return m_BeamM.dOffset
End Get
End Property
#Region "CONSTRUCTOR"
Sub New(BeamM As BeamM, ParentMachGroupVM As BeamMachGroupVM)
MyBase.New(BeamM, ParentMachGroupVM)
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
#End Region ' METHODS
End Class
@@ -0,0 +1,210 @@
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public MustInherit Class MyMachGroupPanelVM
Inherits NewMachGroupPanelVM
#Region "FIELDS & PROPERTIES"
Public ReadOnly Property m_MyMachGroupPanelM As MyMachGroupPanelM
Get
Return m_MachGroupPanelM
End Get
End Property
Public ReadOnly Property sTotMachGroups As String
Get
Return m_MachGroupVMList.Count()
End Get
End Property
Public ReadOnly Property sTotVolume As String
Get
Dim dMMTotVolume As Double = m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) x.dUnitVolume, Func(Of MachGroupVM, Double)))
Return If(EgtUiUnitsAreMM(), DoubleToString(dMMTotVolume / 1000000000, 3), DoubleToString(dMMTotVolume * (12 / ONEINCH), 3))
End Get
End Property
Public ReadOnly Property sTotEstimatedTime As String
Get
Return TimeSpan.FromSeconds(m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) x.nCALC_TIME, Func(Of MachGroupVM, Double)))).ToString()
End Get
End Property
Public ReadOnly Property dTotTime As String
Get
Return m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) If(x.nProduction_State >= ItemState.Produced AndAlso Not IsNothing(x.dtEndTime) AndAlso x.dtEndTime <> DateTime.MinValue, (x.dtEndTime - x.dtStartTime).TotalSeconds(), x.nCALC_TIME), Func(Of MachGroupVM, Double)))
End Get
End Property
Public ReadOnly Property sTotTime As String
Get
Return TimeSpan.FromSeconds(dTotTime).ToString()
End Get
End Property
Public ReadOnly Property dDoneTime As String
Get
Return m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) If(x.nProduction_State >= ItemState.Produced AndAlso Not IsNothing(x.dtEndTime) AndAlso x.dtEndTime <> DateTime.MinValue, (x.dtEndTime - x.dtStartTime).TotalSeconds(), 0), Func(Of MachGroupVM, Double)))
End Get
End Property
Public ReadOnly Property sDoneTime As String
Get
Return TimeSpan.FromSeconds(dDoneTime).ToString()
End Get
End Property
Public ReadOnly Property dRemainingTime As String
Get
Return m_MachGroupVMList.Sum(CType(Function(x As MyMachGroupVM) If(x.nProduction_State < ItemState.Produced, x.nCALC_TIME, 0), Func(Of MachGroupVM, Double)))
End Get
End Property
Public ReadOnly Property sRemainingTime As String
Get
Return TimeSpan.FromSeconds(dRemainingTime).ToString()
End Get
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(MachGroupPanelM As MachGroupPanelM)
MyBase.New(MachGroupPanelM)
' Creo riferimento a questa classe in Map
CoreMap.SetRefMachGroupPanelVM(Me)
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Protected MustOverride Overrides Sub CreateMachGroupVMList()
Public Overrides Function InitMachGroupList(Optional bUseDefaults As Boolean = False) As Boolean
' Svuoto precedente lista di MachGroup
MachGroupVMList.Clear()
' aggiorno copie
MyMachGroupPanelM.UpdateDuplo()
' verifico se esistono già gruppi di lavorazione o se devo creare il primo
Dim bOk As Boolean = False
Dim nId = EgtGetFirstMachGroup()
If nId <> GDB_ID.NULL Then
bOk = EgtSetCurrMachGroup(nId)
End If
If Not bOk Then Return True
' carico lista dei gruppi di lavorazione
m_MachGroupPanelM.MachGroupMList = MyMachGroupPanelM.LoadMyMachGroups(CoreMap.refMachinePanelVM.MachineList.ToList())
' elimino copie da cancellare
MyMachGroupPanelM.DeleteDuplo()
If bOk Then SelectedMachGroup = MachGroupVMList(0)
EgtZoom(ZM.ALL)
Return True
End Function
Private Sub RedrawModifiedMachGroup(RedrawList As List(Of Integer))
For Each nMachGroupId In RedrawList
EgtSetCurrMachGroup(nMachGroupId)
' elimino vecchio grezzo ed eseguo script creazione nuovo
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
EgtRemovePartFromRawPart(EgtGetFirstPartInRawPart(nRawId))
EgtRemoveRawPart(nRawId)
nRawId = EgtGetFirstRawPart()
End While
'If Not ExecBeam(Map.refMainWindowVM.MainWindowM.sTempDir, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then Return False
Next
End Sub
'Public Overrides Sub AddMachGroup()
' Dim MyMachGroupM As MyMachGroupM = m_MyMachGroupPanelM.NewMyMachGroup(CurrentMachine.sMachineName, Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' ' e lo seleziono
' SelectedMachGroup = MachGroupVMList.FirstOrDefault(Function(x) x.MachGroupM Is MyMachGroupM)
'End Sub
Public Overrides Function OnPreSetCurrMachGroup() As Boolean
EgtSetCurrentContext(CoreMap.refSceneHostVM.MainScene.GetCtx())
Return True
End Function
Public Overrides Function OnPostSetCurrMachGroup() As Boolean
' resetto eventuale selezione pezzo
Dim SelMachGroup As MyMachGroupVM = DirectCast(SelectedMachGroup, MyMachGroupVM)
SelMachGroup.SelPart = Nothing
' Imposto vista solo tavola
EgtSetMachineLook(MCH_LOOK.TAB)
Core.ViewPanelVM.BWSetView(If(ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False)
EgtZoom(ZM.ALL)
Return True
End Function
' funzione che seleziona primo gruppo
'Friend Sub SelFirstMachGroup()
' If Not IsNothing(Me) AndAlso Not IsNothing(MachGroupVMList) AndAlso MachGroupVMList.Count > 0 Then
' SelectedMachGroup = MachGroupVMList(0)
' Else
' SelectedMachGroup = Nothing
' EgtResetCurrMachGroup()
' ' nascondo tutti i pezzi
' Map.refProjectVM.BTLStructureVM.HideAll()
' End If
'End Sub
' funzione che seleziona ultimo gruppo
Public Sub SelLastMachGroup()
If Not IsNothing(Me) AndAlso Not IsNothing(MachGroupVMList) AndAlso MachGroupVMList.Count > 0 Then
SelectedMachGroup = MachGroupVMList(MachGroupVMList.Count - 1)
End If
End Sub
Public Function GetLastMachGroup() As MachGroupVM
If Not IsNothing(Me) AndAlso Not IsNothing(MachGroupVMList) AndAlso MachGroupVMList.Count > 0 Then
Return MachGroupVMList(MachGroupVMList.Count - 1)
End If
Return Nothing
End Function
' funzione che aggiorna totale tempi a fine calcolo
Public Sub CalcGlobalTime()
NotifyPropertyChanged(NameOf(sTotTime))
NotifyPropertyChanged(NameOf(sRemainingTime))
End Sub
' funzione che aggiorna numero gruppi di lavorazione e volume totale
Public Sub CalcGlobalUpdate()
NotifyPropertyChanged(NameOf(sTotMachGroups))
NotifyPropertyChanged(NameOf(sTotVolume))
NotifyPropertyChanged(NameOf(sTotTime))
NotifyPropertyChanged(NameOf(sRemainingTime))
End Sub
Public Shared Sub DuploRemoveProjCalc(nPartDuploId As Integer)
EgtSetInfo(nPartDuploId, ITG_PROJ_ERR, "")
EgtSetInfo(nPartDuploId, ITG_PROJ_MSG, "")
EgtSetInfo(nPartDuploId, ITG_PROJ_ROT, "")
EgtSetInfo(nPartDuploId, ITG_PROJ_FALL, "")
EgtSetInfo(nPartDuploId, ITG_PROJ_TIME, "")
End Sub
#End Region ' METHODS
#Region "EVENTS"
Protected Overrides Sub OnMachGroupVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
Select Case e.PropertyName
Case NameOf(sender.nProduction_State)
NotifyPropertyChanged(NameOf(sTotTime))
NotifyPropertyChanged(NameOf(sRemainingTime))
End Select
End Sub
#End Region ' EVENTS
End Class
@@ -0,0 +1,723 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO
Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public MustInherit Class MyMachGroupVM
Inherits MachGroupVM
#Region "FIELDS & PROPERTIES"
#Region "General"
Public ReadOnly Property MyMachGroupM As MyMachGroupM
Get
Return m_MachGroupM
End Get
End Property
Public ReadOnly Property nType As BWType
Get
Return MyMachGroupM.nType
End Get
End Property
Public ReadOnly Property nName As Integer
Get
Dim nIntName As Integer = 0
Integer.TryParse(MyMachGroupM.Name, nIntName)
Return nIntName
End Get
End Property
Public Property dL As Double
Get
Return MyMachGroupM.dL
End Get
Set(value As Double)
MyMachGroupM.dL = value
End Set
End Property
Public Property dW As Double
Get
Return MyMachGroupM.dW
End Get
Set(value As Double)
MyMachGroupM.dW = value
End Set
End Property
Public Property dH As Double
Get
Return MyMachGroupM.dH
End Get
Set(value As Double)
MyMachGroupM.dH = value
End Set
End Property
Public Property dtStartTime As DateTime
Get
Return MyMachGroupM.dtStartTime
End Get
Set(value As DateTime)
MyMachGroupM.dtStartTime = value
NotifyPropertyChanged(NameOf(Production_Background))
End Set
End Property
Public Property dtEndTime As DateTime
Get
Return MyMachGroupM.dtEndTime
End Get
Set(value As DateTime)
MyMachGroupM.dtEndTime = value
NotifyPropertyChanged(NameOf(Production_Background))
End Set
End Property
Public ReadOnly Property dUsage As Double
Get
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, If(nType = BWType.WALL, MyMachGroupM.dMatForPart / MyMachGroupM.dTotMat * 100, MyMachGroupM.dMatForPart / MyMachGroupM.dL * 100), 0)
End Get
End Property
Public ReadOnly Property dWaste As Double
Get
Return If(MyMachGroupM.dMatForPart > 0 AndAlso MyMachGroupM.dTotMat > 0, If(nType = BWType.WALL, (MyMachGroupM.dTotMat - MyMachGroupM.dMatForPart) / 1000000000, MyMachGroupM.dL - MyMachGroupM.dTotMat), 0)
End Get
End Property
Public ReadOnly Property sUsage As String
Get
Return DoubleToString(dUsage, 3)
End Get
End Property
Public ReadOnly Property sWaste As String
Get
Return LenToString(dWaste, 3)
End Get
End Property
Public Property sMATERIAL As String
Get
Return MyMachGroupM.sMATERIAL
End Get
Set(value As String)
MyMachGroupM.sMATERIAL = value
End Set
End Property
Public ReadOnly Property sUnitTime As String
Get
Return TimeSpan.FromSeconds(nCALC_TIME).ToString()
End Get
End Property
Public ReadOnly Property dUnitVolume As Double
Get
Return dL * dW * dH
End Get
End Property
Public ReadOnly Property Section As SectionXMaterial
Get
Return New SectionXMaterial(dW, dH, dL, MyMachGroupM.sMATERIAL)
End Get
End Property
' lista dei pezzi che sono nel grezzo
Protected m_PartVMList As New ObservableCollection(Of PartVM)
Public Property PartVMList As ObservableCollection(Of PartVM)
Get
Return m_PartVMList
End Get
Set(value As ObservableCollection(Of PartVM))
m_PartVMList = value
End Set
End Property
Protected m_SelPart As PartVM
Public Overridable Property SelPart As PartVM
Get
Return m_SelPart
End Get
Set(value As PartVM)
m_SelPart = value
' seleziono pezzo
EgtDeselectAll()
If Not IsNothing(value) Then EgtSelectObj(SelPart.nPartId)
EgtDraw()
NotifyPropertyChanged(NameOf(SelPart))
End Set
End Property
#End Region ' General
#Region "Beam"
Public Overridable Property sStartCut As String
Get
Return LenToString(MyMachGroupM.dStartCut, 3)
End Get
Set(value As String)
StringToLenAdv(value, MyMachGroupM.dStartCut, True)
End Set
End Property
Public Property dStartCut As Double
Get
Return MyMachGroupM.dStartCut
End Get
Set(value As Double)
MyMachGroupM.dStartCut = value
NotifyPropertyChanged(NameOf(sStartCut))
End Set
End Property
#End Region ' Beam
#Region "Wall"
#End Region ' Wall
#Region "Calc"
Public ReadOnly Property nCALC_ERR As Integer
Get
Return MyMachGroupM.nCALC_ERR
End Get
End Property
Public ReadOnly Property nCALC_FALL As Integer
Get
Return MyMachGroupM.nCALC_FALL
End Get
End Property
Public ReadOnly Property sCALC_MSG As String
Get
Return MyMachGroupM.sCALC_MSG
End Get
End Property
Public Property nCALC_ROT As Integer
Get
Return MyMachGroupM.nCALC_ROT
End Get
Set(value As Integer)
MyMachGroupM.nCALC_ROT = value
End Set
End Property
Public Property nCALC_TIME As Integer
Get
Return MyMachGroupM.nCALC_TIME
End Get
Set(value As Integer)
MyMachGroupM.nCALC_TIME = value
End Set
End Property
Public Property nGlobalState As CalcStates
Get
Return MyMachGroupM.nCALC_GlobalState
End Get
Set(value As CalcStates)
MyMachGroupM.nCALC_GlobalState = value
End Set
End Property
Public ReadOnly Property nPartsGlobalState As CalcStates
Get
Return MyMachGroupM.bCALC_PartsGlobalState
End Get
End Property
Public Property nCALC_State As CalcStates
Get
Return MyMachGroupM.nCALC_State
End Get
Set(value As CalcStates)
MyMachGroupM.nCALC_State = value
End Set
End Property
Public ReadOnly Property Calc_Background As SolidColorBrush
Get
Select Case MyMachGroupM.nCALC_GlobalState
Case CalcStates.ERROR_, CalcStates.COLLISION
Return Brushes.Red
Case CalcStates.WARNING
Return Brushes.Orange
Case CalcStates.INFO, CalcStates.OK
Return Brushes.Green
Case CalcStates.NOTCALCULATED
Return Brushes.LightGray
Case Else
Return Brushes.Red
End Select
End Get
End Property
Public ReadOnly Property CALC_ROT_Visibility As Visibility
Get
Return If(MyMachGroupM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Public ReadOnly Property CALC_FALL_Visibility As Visibility
Get
Return If(MyMachGroupM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Public ReadOnly Property CALC_ERR_Letter As String
Get
Select Case MyMachGroupM.nCALC_GlobalState
Case CalcStates.COLLISION
Return "c"
Case CalcStates.ERROR_
Return "e"
Case CalcStates.WARNING
Return "w"
Case CalcStates.INFO
Return "i"
Case Else
Return ""
End Select
End Get
End Property
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
Get
Select Case MyMachGroupM.m_nCALC_GlobalState
Case CalcStates.ERROR_, CalcStates.COLLISION
Return Brushes.Red
Case CalcStates.WARNING
Return Brushes.Orange
Case CalcStates.INFO
Return Brushes.Green
Case Else
Return Brushes.Red
End Select
End Get
End Property
#End Region ' Calc
#Region "Supervisor"
Public Property nProduction_State As ItemState
Get
Return MyMachGroupM.nProductionState
End Get
Set(value As ItemState)
MyMachGroupM.SetProductionState(value)
End Set
End Property
Public ReadOnly Property Production_Background As SolidColorBrush
Get
Select Case nProduction_State
Case ItemState.ND
Return Brushes.White
Case ItemState.Assigned, ItemState.Confirmed
If m_bToBeProduced Then ' barra in attesa
If m_bCNReCalculated Then
Return Brushes.Orange
Else ' barra in check calc
Return Brushes.Purple
End If
Else ' barra in coda
Return Brushes.White
End If
Case ItemState.WIP
Return Brushes.Green
Case ItemState.Produced
Return Brushes.Yellow
Case Else ' ItemState.Scrapped
Return Brushes.Aqua
End Select
End Get
End Property
' indica se il pezzo deve essere tagliato
Protected m_bToBeProduced As Boolean = False
Public ReadOnly Property bToBeProduced As Boolean
Get
Return m_bToBeProduced
End Get
End Property
' indica se il pezzo e' gia' stato ricalcolato e quindi pronto a partire
Protected m_bCNReCalculated As Boolean = False
Public ReadOnly Property bReadyForMachining As Boolean
Get
Return m_bToBeProduced AndAlso m_bCNReCalculated
End Get
End Property
Protected m_bSendingToMachine As Boolean = False
Public ReadOnly Property bSendingToMachine As Boolean
Get
Return m_bSendingToMachine
End Get
End Property
Public Sub SetSendingToMachine(value As Boolean)
m_bSendingToMachine = value
End Sub
' indica se il pezzo e' stato mandato alla macchina
Protected m_bSentToMachine As Boolean = False
Public ReadOnly Property bSentToMachine As Boolean
Get
Return m_bSentToMachine
End Get
End Property
Public Sub SetSentToMachine(value As Boolean)
m_bSentToMachine = value
m_bSendingToMachine = False
End Sub
' indica se la macchina e' stata interrotta durante la lavorazione
Protected m_bResetWhileCutting As Boolean = False
Public ReadOnly Property bResetWhileCutting As Boolean
Get
Return m_bResetWhileCutting
End Get
End Property
Public Sub SetResetWhileCutting(value As Boolean)
m_bResetWhileCutting = value
End Sub
Public ReadOnly Property Background As SolidColorBrush
Get
Select Case nProduction_State
Case ItemState.ND
Return Brushes.White
Case ItemState.Assigned
Return Brushes.LightGray
Case ItemState.Confirmed
Return Brushes.LightGray
Case ItemState.WIP
Return Brushes.Green
Case ItemState.Produced
Return Brushes.Yellow
Case Else ' ItemState.Scrapped
Return Brushes.Aqua
End Select
End Get
End Property
Public Overridable ReadOnly Property Produce_IsEnabled As Boolean
Get
Select Case nProduction_State
Case ItemState.Assigned, ItemState.Confirmed
Return Not m_bToBeProduced
Case Else
Return False
End Select
End Get
End Property
Private m_SupervisorId As String = ""
Public ReadOnly Property SupervisorId As String
Get
Return m_SupervisorId
End Get
End Property
Public Sub SetSupervisorId(SupervisorId As String)
m_SupervisorId = SupervisorId
End Sub
Private m_cc As StateChangeEventArgs
Public ReadOnly Property IsReadOnly As Boolean
Get
Return String.IsNullOrEmpty(m_SupervisorId)
End Get
End Property
#End Region ' Supervisor
' definizione comandi
Private m_cmdDeleteMachGroup As ICommand
Private m_cmdProduceMachGroup As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTORS"
Sub New(MyMachGroupM As MyMachGroupM)
MyBase.New(MyMachGroupM)
'aggiorno lista pezzi
RefreshPartList()
AddHandler MyMachGroupM.PartAdded, AddressOf OnPartAdded
AddHandler MyMachGroupM.PartRemoved, AddressOf OnPartRemoved
CreatePartVMList()
' Aggiorno stato da stati feature
CalcGlobalUpdate()
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
#Region "Machgroup"
Public MustOverride Sub RefreshGroupData()
Public Overridable Function Copy() As MyMachGroupVM
Return Nothing
End Function
Public Sub UpdateUsage()
If nType = BWType.BEAM Then
MyMachGroupM.SetMatForPart(0)
Dim dPartLength As Double
Dim dPartOffsetLength As Double
For Each Part In PartVMList
dPartOffsetLength += Part.dL + Part.dOffset
dPartLength += Part.dL
Next
MyMachGroupM.SetTotMat(dPartOffsetLength)
MyMachGroupM.SetMatForPart(dPartLength)
Else
MyMachGroupM.SetTotMat(dL * dH * dW)
MyMachGroupM.SetMatForPart(0)
Dim dPartVolume As Double
For Each Part In PartVMList
dPartVolume += Part.dVolume
Next
MyMachGroupM.SetMatForPart(dPartVolume)
End If
NotifyPropertyChanged(NameOf(sUsage))
NotifyPropertyChanged(NameOf(sWaste))
End Sub
Public Overridable Function CnFilePath() As String
Return Nothing
End Function
#End Region ' Machgroup
#Region "Calc"
' funzione che aggiorna lo stato e gli errori dopo calcolo
Public Sub CalcMachGroupUpdate(ERR As Integer, ROT As Integer, MSG As String)
EgtSetInfo(Id, ITG_PROD_ERR, ERR, True)
EgtSetInfo(Id, ITG_PROD_MSG, MSG, True)
EgtSetInfo(Id, ITG_PROD_ROT, ROT, True)
MyMachGroupM.nCALC_ERR = ERR
MyMachGroupM.nCALC_ROT = ROT
MyMachGroupM.sCALC_MSG = MSG
Select Case ERR
Case 0
nCALC_State = CalcStates.OK
Case 22
nCALC_State = CalcStates.COLLISION
Case 17, 19
nCALC_State = CalcStates.WARNING
Case < 0
nCALC_State = CalcStates.INFO
Case > 0
nCALC_State = CalcStates.ERROR_
End Select
NotifyPropertyChanged(NameOf(Calc_Background))
End Sub
Public Sub ResetCalcMachGroup()
EgtRemoveInfo(Id, ITG_PROD_ERR)
EgtRemoveInfo(Id, ITG_PROD_MSG)
EgtRemoveInfo(Id, ITG_PROD_ROT)
MyMachGroupM.nCALC_GlobalState = CalcStates.NOTCALCULATED
MyMachGroupM.nCALC_State = CalcStates.NOTCALCULATED
MyMachGroupM.nCALC_GlobalERR = 0
MyMachGroupM.nCALC_ERR = 0
MyMachGroupM.nCALC_ROT = 0
MyMachGroupM.nCALC_FALL = 0
MyMachGroupM.sCALC_MSG = ""
NotifyPropertyChanged(NameOf(Calc_Background))
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
End Sub
' funzione che aggiorna lo stato e gli errori dopo calcolo
Public Overridable Sub CalcGlobalUpdate()
MyMachGroupM.nCALC_GlobalERR = nCALC_ERR
MyMachGroupM.nCALC_GlobalState = nCALC_State
' stato globale dei pezzi
MyMachGroupM.bCALC_PartsGlobalState = CalcStates.NOTCALCULATED
For Each Part In MyMachGroupM.PartMList
If Part.nCALC_GlobalState = CalcStates.NOTCALCULATED And nCALC_State < CalcStates.ERROR_ Then
MyMachGroupM.nCALC_GlobalState = Part.nCALC_GlobalState
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
Exit For
ElseIf Part.nCALC_GlobalState > MyMachGroupM.nCALC_GlobalState Then
MyMachGroupM.nCALC_GlobalState = Part.nCALC_GlobalState
MyMachGroupM.nCALC_GlobalERR = Part.nCALC_GlobalERR
End If
If Part.nCALC_GlobalState > MyMachGroupM.bCALC_PartsGlobalState Then
MyMachGroupM.bCALC_PartsGlobalState = Part.nCALC_GlobalState
End If
If Part.nCALC_ROT <> 0 Then
MyMachGroupM.m_nCALC_ROT = Part.nCALC_ROT
End If
If Part.nCALC_FALL <> 0 Then
MyMachGroupM.nCALC_FALL = Part.nCALC_FALL
End If
Next
NotifyPropertyChanged(NameOf(Calc_Background))
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
End Sub
Public Sub CalcTimeUpdate(TIME As Integer)
EgtSetInfo(Id, ITG_PROD_TIME, TIME, True)
nCALC_TIME = TIME
NotifyPropertyChanged(NameOf(sUnitTime))
End Sub
Public Overridable Sub CALCEnd()
End Sub
#End Region ' Calc
#Region "Supervisor"
Public Sub SentToSupervisor()
MyMachGroupM.SetProductionState(ItemState.Assigned)
NotifyPropertyChanged(NameOf(Background))
End Sub
Public Sub ResetProduce()
m_bCNReCalculated = False
m_bToBeProduced = False
m_bSendingToMachine = False
m_bSentToMachine = False
NotifyPropertyChanged(NameOf(Production_Background))
End Sub
#End Region ' Supervisor
#Region "Parts"
Protected MustOverride Sub CreatePartVMList()
Public MustOverride Sub RefreshPartList()
#End Region ' Parts
#End Region ' METHODS
#Region "COMMANDS"
#Region "DeleteMachGroup"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property DeleteMachGroup_Command As ICommand
Get
If m_cmdDeleteMachGroup Is Nothing Then
m_cmdDeleteMachGroup = New Command(AddressOf DeleteMachGroupCmd)
End If
Return m_cmdDeleteMachGroup
End Get
End Property
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)
While nRawPartId <> GDB_ID.NULL
EgtRemovePartFromRawPart(nBeamId)
EgtErase(nBeamId)
nRawPartId = EgtGetNextRawPart(nRawPartId)
nBeamId = EgtGetFirstPartInRawPart(nRawPartId)
End While
' elimino MachGroup
EgtRemoveMachGroup(Me.Id)
End Sub
#End Region ' DeleteMachGroup
#Region "ProduceMachGroup"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property ProduceMachGroup_Command As ICommand
Get
If m_cmdProduceMachGroup Is Nothing Then
m_cmdProduceMachGroup = New Command(AddressOf ProduceMachGroup)
End If
Return m_cmdProduceMachGroup
End Get
End Property
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Overridable Sub ProduceMachGroup()
End Sub
#End Region ' ProduceMachGroup
#End Region ' COMMANDS
#Region "EVENTS"
Protected MustOverride Sub OnPartAdded(sender As Object, e As PartAddedEventArgs)
Private Sub OnPartRemoved(sender As Object, e As PartAddedEventArgs)
Dim PartVM As PartVM = PartVMList.FirstOrDefault(Function(x) x.PartM Is e.m_NewPart)
If Not IsNothing(PartVM) Then PartVMList.Remove(PartVM)
End Sub
Protected Sub OnPartVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If e.Action = NotifyCollectionChangedAction.Add Then
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each PartVM As PartVM In e.NewItems
AddHandler PartVM.PropertyChanged, AddressOf OnPartVMPropertyChanged
Next
End If
End If
If e.Action = NotifyCollectionChangedAction.Remove Then
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each PartVM As PartVM In e.OldItems
RemoveHandler PartVM.PropertyChanged, AddressOf OnPartVMPropertyChanged
MyMachGroupM.PartMList.Remove(PartVM.PartM)
Next
End If
End If
If e.Action = NotifyCollectionChangedAction.Move Then
Dim ItemVM As PartVM = e.OldItems(0)
MyMachGroupM.PartMList.RemoveAt(e.OldStartingIndex)
MyMachGroupM.PartMList.Insert(e.NewStartingIndex, ItemVM.PartM)
End If
End Sub
Protected Overridable Sub OnPartVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
Select Case e.PropertyName
Case NameOf(sender.sPOSX), NameOf(sender.sPOSY), NameOf(sender.bFLIP), NameOf(sender.sROT)
' setto pezzo da ricalcolare
ResetCalcMachGroup()
End Select
End Sub
#End Region ' EVENTS
End Class
+643
View File
@@ -0,0 +1,643 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO
Imports System.Windows
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public MustInherit Class PartVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
#Region "General"
Protected m_PartM As PartM
Public ReadOnly Property PartM As PartM
Get
Return m_PartM
End Get
End Property
Protected m_ParentMachGroupVM As MyMachGroupVM
Public ReadOnly Property ParentMachGroupVM As MyMachGroupVM
Get
Return m_ParentMachGroupVM
End Get
End Property
' Id geometrico del pezzo
Public ReadOnly Property nPartId As Integer
Get
Return m_PartM.nPartId
End Get
End Property
' Proj del pezzo
Public Property nProjId As Integer
Get
Return m_PartM.nProjId
End Get
Set(value As Integer)
m_PartM.nProjId = value
End Set
End Property
' Info del pezzo
Public ReadOnly Property nPDN As Integer
Get
Return m_PartM.nPDN
End Get
End Property
Public ReadOnly Property sNAM As String
Get
Return m_PartM.sNAM
End Get
End Property
Public ReadOnly Property sL As String
Get
Return LenToString(m_PartM.dL, 3)
End Get
End Property
Public Property dL As Double
Get
Return m_PartM.dL
End Get
Set(value As Double)
m_PartM.dL = value
End Set
End Property
Public ReadOnly Property sW As String
Get
Return LenToString(m_PartM.dW, 3)
End Get
End Property
Public Property dW As Double
Get
Return m_PartM.dW
End Get
Set(value As Double)
m_PartM.dW = value
End Set
End Property
Public ReadOnly Property sH As String
Get
Return LenToString(m_PartM.dH, 3)
End Get
End Property
Public Property dH As Double
Get
Return m_PartM.dH
End Get
Set(value As Double)
m_PartM.dH = value
End Set
End Property
Public Overridable Property sPOSX As String
Get
Return LenToString(m_PartM.dPOSX, 3)
End Get
Set(value As String)
StringToLenAdv(value, m_PartM.dPOSX, True)
End Set
End Property
Public Property dPOSX As Double
Get
Return m_PartM.dPOSX
End Get
Set(value As Double)
m_PartM.dPOSX = value
NotifyPropertyChanged(NameOf(sPOSX))
End Set
End Property
Public Property nCNT As Integer
Get
Return m_PartM.nCNT
End Get
Set(value As Integer)
m_PartM.nCNT = value
End Set
End Property
Public ReadOnly Property sINVERTED As String
Get
Return m_PartM.nINVERTED & "°"
End Get
End Property
Public ReadOnly Property nINVERTED As Integer
Get
Return m_PartM.nINVERTED
End Get
End Property
Public ReadOnly Property sROTATED As String
Get
Return m_PartM.nROTATED & "°"
End Get
End Property
Public ReadOnly Property nROTATED As Integer
Get
Return m_PartM.nROTATED
End Get
End Property
Public Property sMATERIAL As String
Get
Return m_PartM.sMATERIAL
End Get
Set(value As String)
m_PartM.sMATERIAL = value
End Set
End Property
Public ReadOnly Property sSTOREY As String
Get
Return m_PartM.sSTOREY
End Get
End Property
Public ReadOnly Property sGROUP As String
Get
Return m_PartM.sGROUP
End Get
End Property
Public ReadOnly Property dVolume As Double
Get
Return m_PartM.dVolume
End Get
End Property
' lista delle feature del pezzo
Protected m_FeatureVMList As ObservableCollection(Of BTLFeatureVM)
Public Property FeatureVMList As ObservableCollection(Of BTLFeatureVM)
Get
Return m_FeatureVMList
End Get
Set(value As ObservableCollection(Of BTLFeatureVM))
m_FeatureVMList = value
End Set
End Property
Protected m_SelFeatureVM As BTLFeatureVM
Public Property SelFeatureVM As BTLFeatureVM
Get
Return m_SelFeatureVM
End Get
Set(value As BTLFeatureVM)
m_SelFeatureVM = value
If Not IsNothing(m_SelFeatureVM) Then
DirectCast(m_SelFeatureVM, BTLFeatureVM).SelGeomFeature()
Else
EgtDeselectAll()
End If
EgtDraw()
NotifyPropertyChanged(NameOf(SelFeatureVM))
End Set
End Property
#End Region ' General
#Region "Beam"
Public Overridable Property sOffset As String
Get
Return LenToString(m_PartM.dOffset, 3)
End Get
Set(value As String)
StringToLenAdv(value, m_PartM.dOffset, True)
End Set
End Property
Public ReadOnly Property dOffset As Double
Get
Return m_PartM.dOffset
End Get
End Property
#End Region ' Beam
#Region "Wall"
Public Overridable Property sPOSY As String
Get
Return LenToString(m_PartM.dPOSY, 3)
End Get
Set(value As String)
StringToLenAdv(value, m_PartM.dPOSY, True)
End Set
End Property
Public ReadOnly Property dPOSY As Double
Get
Return m_PartM.dPOSY
End Get
End Property
Public Property sROT As String
Get
Return LenToString(m_PartM.dROT, 3) & "°"
End Get
Set(value As String)
StringToLenAdv(value, m_PartM.dROT, True)
End Set
End Property
Public ReadOnly Property dROT As Double
Get
Return m_PartM.dROT
End Get
End Property
Public Overridable Property nFLIP As Integer
Get
Return m_PartM.nFLIP
End Get
Set(value As Integer)
m_PartM.nFLIP = value
End Set
End Property
#End Region ' Wall
#Region "Calc"
Public ReadOnly Property nGlobalState As CalcStates
Get
Return m_PartM.nCALC_GlobalState
End Get
End Property
Public Property nCALC_GlobalERR As Integer
Get
Return m_PartM.nCALC_GlobalERR
End Get
Set(value As Integer)
m_PartM.nCALC_GlobalERR = value
End Set
End Property
Public Property nCALC_State As CalcStates
Get
Return m_PartM.nCALC_State
End Get
Set(value As CalcStates)
m_PartM.nCALC_State = value
End Set
End Property
Public ReadOnly Property Calc_Background As SolidColorBrush
Get
Select Case m_PartM.nCALC_GlobalState
Case CalcStates.ERROR_, CalcStates.COLLISION
Return Brushes.Red
Case CalcStates.WARNING
Return Brushes.Orange
Case CalcStates.INFO, CalcStates.OK
Return Brushes.Green
Case CalcStates.NOTCALCULATED
Return Brushes.LightGray
Case Else
Return Brushes.Red
End Select
End Get
End Property
Public ReadOnly Property CALC_ROT_Visibility As Visibility
Get
Return If(m_PartM.nCALC_ROT <> 0, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Public ReadOnly Property CALC_FALL_Visibility As Visibility
Get
Return If(m_PartM.nCALC_FALL <> 0, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Public ReadOnly Property CALC_ERR_Letter As String
Get
Select Case m_PartM.nCALC_GlobalState
Case CalcStates.COLLISION
Return "c"
Case CalcStates.ERROR_
Return "e"
Case CalcStates.WARNING
Return "w"
Case CalcStates.INFO
Return "i"
Case Else
Return ""
End Select
End Get
End Property
Public ReadOnly Property CALC_ERR_Foreground As SolidColorBrush
Get
Select Case m_PartM.nCALC_GlobalState
Case CalcStates.ERROR_, CalcStates.COLLISION
Return Brushes.Red
Case CalcStates.WARNING
Return Brushes.Orange
Case CalcStates.INFO
Return Brushes.Green
Case Else
Return Brushes.Red
End Select
End Get
End Property
Public ReadOnly Property nCALC_ERR As Integer
Get
Return m_PartM.nCALC_ERR
End Get
End Property
Public ReadOnly Property sCALC_MSG As String
Get
Return m_PartM.sCALC_MSG
End Get
End Property
Public Property nCALC_ROT As Integer
Get
Return m_PartM.nCALC_ROT
End Get
Set(value As Integer)
m_PartM.nCALC_ROT = value
End Set
End Property
Public Property nCALC_FALL As Integer
Get
Return m_PartM.nCALC_FALL
End Get
Set(value As Integer)
m_PartM.nCALC_FALL = value
End Set
End Property
Public Property nCALC_TIME As Integer
Get
Return m_PartM.nCALC_TIME
End Get
Set(value As Integer)
m_PartM.nCALC_TIME = value
End Set
End Property
#End Region ' Calc
#Region "Supervisor"
Public Property nProduction_State As ItemState
Get
Return m_PartM.nProductionState
End Get
Set(value As ItemState)
m_PartM.SetProductionState(value)
End Set
End Property
Public ReadOnly Property Production_Background As SolidColorBrush
Get
Select Case nProduction_State
Case ItemState.ND
Return Brushes.White
Case ItemState.Assigned, ItemState.Confirmed
Return Brushes.White
Case ItemState.WIP
Return Brushes.Green
Case ItemState.Produced
Return Brushes.Yellow
Case Else ' ItemState.Scrapped
Return Brushes.Aqua
End Select
End Get
End Property
Public Property dtStartTime As DateTime
Get
Return m_PartM.dtStartTime
End Get
Set(value As DateTime)
m_PartM.dtStartTime = value
NotifyPropertyChanged(NameOf(Production_Background))
End Set
End Property
Public Property dtEndTime As DateTime
Get
Return m_PartM.dtEndTime
End Get
Set(value As DateTime)
m_PartM.dtEndTime = value
NotifyPropertyChanged(NameOf(Production_Background))
End Set
End Property
' variabile che indica se rifare il pezzo
Private m_bRedo As Boolean = True
Public Property bRedo As Boolean
Get
Return m_bRedo
End Get
Set(value As Boolean)
For Each Feature In FeatureVMList
Feature.bRedo = value
Next
m_bRedo = value
End Set
End Property
Public ReadOnly Property Background As SolidColorBrush
Get
Select Case nProduction_State
Case ItemState.ND
Return Brushes.White
Case ItemState.Assigned
Return Brushes.LightGray
Case ItemState.Confirmed
Return Brushes.LightGray
Case ItemState.WIP
Return Brushes.Green
Case ItemState.Produced
Return Brushes.Yellow
Case Else ' ItemState.Scrapped
Return Brushes.Aqua
End Select
End Get
End Property
#End Region ' Supervisor
' definizione comandi
Private m_cmdDeletePart As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(PartM As PartM)
m_PartM = PartM
AddHandler m_PartM.BTLFeatureAdded, AddressOf OnBTLFeatureAdded
CreateBTLFeatureVMList()
End Sub
Sub New(PartM As PartM, ParentMachGroupVM As MyMachGroupVM)
m_PartM = PartM
m_ParentMachGroupVM = ParentMachGroupVM
AddHandler m_PartM.BTLFeatureAdded, AddressOf OnBTLFeatureAdded
CreateBTLFeatureVMList()
' Aggiorno stato da stati feature
CalcGlobalUpdate()
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
#Region "Feature"
Protected MustOverride Sub CreateBTLFeatureVMList()
#End Region ' Feature
#Region "Calc"
' funzione che aggiorna lo stato e gli errori dopo calcolo
Public Sub CalcPartUpdate(ERR As Integer, ROT As Integer, MSG As String)
EgtSetInfo(nPartId, ITG_PROD_ERR, ERR, True)
EgtSetInfo(nPartId, ITG_PROD_MSG, MSG, True)
EgtSetInfo(nPartId, ITG_PROD_ROT, ROT, True)
m_PartM.nCALC_ERR = ERR
m_PartM.nCALC_ROT = ROT
m_PartM.sCALC_MSG = MSG
Select Case ERR
Case 0
nCALC_State = CalcStates.OK
Case 22
nCALC_State = CalcStates.COLLISION
Case 17, 19
nCALC_State = CalcStates.WARNING
Case < 0
nCALC_State = CalcStates.INFO
Case > 0
nCALC_State = CalcStates.ERROR_
End Select
NotifyPropertyChanged(NameOf(Calc_Background))
End Sub
Public Sub ResetCalcPart()
EgtRemoveInfo(nPartId, ITG_PROD_ERR)
EgtRemoveInfo(nPartId, ITG_PROD_MSG)
EgtRemoveInfo(nPartId, ITG_PROD_ROT)
EgtRemoveInfo(nPartId, ITG_PROD_FALL)
m_PartM.nCALC_GlobalState = CalcStates.NOTCALCULATED
m_PartM.nCALC_State = CalcStates.NOTCALCULATED
m_PartM.nCALC_GlobalERR = 0
m_PartM.nCALC_ERR = 0
m_PartM.nCALC_ROT = 0
m_PartM.nCALC_FALL = 0
m_PartM.sCALC_MSG = ""
NotifyPropertyChanged(NameOf(Calc_Background))
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
ParentMachGroupVM.ResetCalcMachGroup()
End Sub
Public Sub CalcFallUpdate(FALL As Integer)
EgtSetInfo(nPartId, ITG_PROD_FALL, FALL, True)
m_PartM.nCALC_FALL = 0
NotifyPropertyChanged(NameOf(nCALC_FALL))
End Sub
' funzione che aggiorna lo stato e gli errori dopo calcolo
Public Sub CalcGlobalUpdate()
m_PartM.nCALC_GlobalState = nCALC_State
For Each Feature In FeatureVMList
If Not Feature.bDO Then Continue For
If Feature.nState > m_PartM.nCALC_GlobalState Then
m_PartM.nCALC_GlobalState = Feature.nState
m_PartM.nCALC_GlobalERR = Feature.nCALC_ERR
End If
If Feature.nCALC_ROT <> 0 Then
m_PartM.nCALC_ROT = Feature.nCALC_ROT
End If
Next
NotifyPropertyChanged(NameOf(Calc_Background))
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
End Sub
#End Region ' Calc
#End Region ' METHODS
#Region "COMMANDS"
#Region "DeletePart"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property DeletePart_Command() As ICommand
Get
If m_cmdDeletePart Is Nothing Then
m_cmdDeletePart = New Command(AddressOf DeletePart)
End If
Return m_cmdDeletePart
End Get
End Property
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Overridable Sub DeletePart()
End Sub
#End Region ' DeletePart
#End Region ' COMMANDS
#Region "EVENTS"
Public Sub OnBTLFeatureAdded(sender As Object, e As BTLFeatureAddedEventArgs)
Dim BTLFeatureVM As BTLFeatureVM = New BTLFeatureVM(e.NewBTLFeature)
FeatureVMList.Add(BTLFeatureVM)
End Sub
Protected Sub OnBTLFeatureVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each BTLFeatureVM As BTLFeatureVM In e.NewItems
AddHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
Next
End If
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each BTLFeatureVM As BTLFeatureVM In e.OldItems
RemoveHandler BTLFeatureVM.PropertyChanged, AddressOf OnBTLFeatureVMPropertyChanged
'm_PartM.FeatureMList.Remove(BTLFeatureVM.BTLFeatureM)
Next
End If
End Sub
Protected Overridable Sub OnBTLFeatureVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
'Select Case e.PropertyName
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
'End Select
End Sub
#End Region ' EVENTS
End Class
@@ -0,0 +1,78 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public MustInherit Class WallMachGroupVM
Inherits MyMachGroupVM
Public ReadOnly Property m_WallMachGroupM As WallMachGroupM
Get
Return m_MachGroupM
End Get
End Property
#Region "CONSTRUCTORS"
Sub New(WallMachGroupM As WallMachGroupM)
MyBase.New(WallMachGroupM)
AddHandler m_WallMachGroupM.PartAdded, AddressOf OnWallAdded
AddHandler m_WallMachGroupM.PartRemoved, AddressOf OnWallRemoved
CreateWallVMList()
' Aggiorno stato da stati feature
CalcGlobalUpdate()
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Protected MustOverride Sub CreateWallVMList()
#End Region ' METHODS
Public Overrides Sub RefreshPartList()
End Sub
Public Overrides Sub RefreshGroupData()
End Sub
#Region "COMMANDS"
#End Region ' COMMANDS
#Region "EVENTS"
Protected MustOverride Sub OnWallAdded(sender As Object, e As PartAddedEventArgs)
Private Sub OnWallRemoved(sender As Object, e As PartAddedEventArgs)
Dim WallVM As WallVM = PartVMList.FirstOrDefault(Function(x) x.PartM Is e.m_NewPart)
If Not IsNothing(WallVM) Then PartVMList.Remove(WallVM)
End Sub
Protected Sub OnWallVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each WallVM As WallVM In e.NewItems
AddHandler WallVM.PropertyChanged, AddressOf OnWallVMPropertyChanged
Next
End If
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each WallVM As WallVM In e.OldItems
RemoveHandler WallVM.PropertyChanged, AddressOf OnWallVMPropertyChanged
Next
End If
End Sub
Protected Sub OnWallVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
'Select Case e.PropertyName
' Case NameOf(sender.nSelGRP), NameOf(sender.nSelSIDE)
'End Select
End Sub
#End Region
End Class
+81
View File
@@ -0,0 +1,81 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows.Input
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public MustInherit Class WallVM
Inherits PartVM
Public ReadOnly Property m_WallM As WallM
Get
Return m_PartM
End Get
End Property
Public Overrides Property sPOSX As String
Get
Return LenToString(m_WallM.dPOSX, 3)
End Get
Set(value As String)
StringToLen(value, m_WallM.dPOSX)
End Set
End Property
Public Overridable Property sPOSY As String
Get
Return LenToString(m_WallM.dPOSY, 3)
End Get
Set(value As String)
StringToLen(value, m_WallM.dPOSY)
End Set
End Property
Public ReadOnly Property dPOSY As Double
Get
Return m_WallM.dPOSY
End Get
End Property
Public Property sROT As String
Get
Return LenToString(m_WallM.dROT, 3) & "°"
End Get
Set(value As String)
StringToLen(value, m_WallM.dROT)
End Set
End Property
Public ReadOnly Property dROT As Double
Get
Return m_WallM.dROT
End Get
End Property
Public Overridable Property bFLIP As Boolean
Get
Return m_WallM.bFLIP
End Get
Set(value As Boolean)
m_WallM.bFLIP = value
End Set
End Property
#Region "CONSTRUCTOR"
Sub New(WallM As WallM, ParentMachGroupVM As WallMachGroupVM)
MyBase.New(WallM, ParentMachGroupVM)
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
#End Region ' METHODS
#Region "COMMANDS"
#End Region ' COMMANDS
End Class
+9 -5
View File
@@ -8,11 +8,15 @@ Imports System.Runtime.InteropServices
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("EgtBEAMWALL.Core")>
#If DEBUG Then
<Assembly: AssemblyTitle("EgtBEAMWALL.Core Debug AnyCPU")>
#Else
<Assembly: AssemblyTitle("EgtBEAMWALL.Core Release AnyCPU")>
#End If
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("EgtBEAMWALL.Core")>
<Assembly: AssemblyCopyright("Copyright © 2020")>
<Assembly: AssemblyCopyright("Copyright © 2020-2023 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
@@ -31,5 +35,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>
<Assembly: AssemblyVersion("2.5.5.2")>
<Assembly: AssemblyFileVersion("2.5.5.2")>
+12 -11
View File
@@ -11,6 +11,7 @@
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
@@ -21,20 +22,20 @@ Namespace My.Resources
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
@@ -44,17 +45,17 @@ Namespace My.Resources
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set(ByVal value As Global.System.Globalization.CultureInfo)
Set
resourceCulture = value
End Set
End Property
+25 -25
View File
@@ -13,42 +13,42 @@ Option Explicit On
Namespace My
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0"), _
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
Private Shared addedHandler As Boolean
Private Shared addedHandler As Boolean
Private Shared addedHandlerLockObject As New Object
Private Shared addedHandlerLockObject As New Object
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
If My.Application.SaveMySettingsOnExit Then
My.Settings.Save()
End If
End Sub
#End If
#End Region
Public Shared ReadOnly Property [Default]() As MySettings
Get
#If _MyType = "WindowsForms" Then
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
If Not addedHandler Then
SyncLock addedHandlerLockObject
If Not addedHandler Then
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
addedHandler = True
End If
End SyncLock
End If
#End If
Return defaultInstance
End Get
-168
View File
@@ -1,168 +0,0 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtUILib
Imports EgtWPFLib5
Public MustInherit Class MyMachGroup
Inherits MachGroup
Protected m_nMachineType As MachineType
Public ReadOnly Property nMachineType As MachineType
Get
Return m_nMachineType
End Get
End Property
Public Sub SetMachineType(nMachineType As MachineType)
m_nMachineType = nMachineType
End Sub
Protected m_dL As Double
Public Property dL As Double
Get
Return m_dL
End Get
Set(value As Double)
m_dL = value
End Set
End Property
Protected m_dW As Double
Public Property dW As Double
Get
Return m_dW
End Get
Set(value As Double)
m_dW = value
End Set
End Property
Protected m_dH As Double
Public Property dH As Double
Get
Return m_dH
End Get
Set(value As Double)
m_dH = value
End Set
End Property
Protected m_dMatForPart As Double = 0
Protected m_dTotMat As Double = 0
Public ReadOnly Property dUsage As Double
Get
Return If(m_dMatForPart > 0 AndAlso m_dTotMat > 0, m_dMatForPart / m_dTotMat * 100, 0)
End Get
End Property
Public ReadOnly Property dWaste As Double
Get
Return If(m_dMatForPart > 0 AndAlso m_dTotMat > 0, (m_dTotMat - m_dMatForPart) / m_dTotMat * 100, 0)
End Get
End Property
Public ReadOnly Property sUsage As String
Get
Return dUsage & "%"
End Get
End Property
Public ReadOnly Property sWaste As String
Get
Return dWaste & "%"
End Get
End Property
Protected m_sMATERIAL As String
Public Property sMATERIAL As String
Get
Return m_sMATERIAL
End Get
Set(value As String)
m_sMATERIAL = value
End Set
End Property
' lista dei pezzi che sono nel grezzo
Private m_PartList As New ObservableCollection(Of Part)
Public Property PartList As ObservableCollection(Of Part)
Get
Return m_PartList
End Get
Set(value As ObservableCollection(Of Part))
m_PartList = value
End Set
End Property
Protected m_SelPart As Part
Public Overridable Property SelPart As Part
Get
Return m_SelPart
End Get
Set(value As Part)
m_SelPart = value
' seleziono pezzo
EgtDeselectAll()
If Not IsNothing(value) Then EgtSelectObj(SelPart.nPartId)
EgtDraw()
NotifyPropertyChanged(NameOf(SelPart))
End Set
End Property
Protected m_nState As CalcStates = -1
Public ReadOnly Property nState As CalcStates
Get
Return m_nState
End Get
End Property
Public ReadOnly Property Calc_Background As SolidColorBrush
Get
If m_nState = 0 Then
Return Brushes.Green
ElseIf m_nState < 0 Then
Return Brushes.LightGray
ElseIf m_nState > 0 Then
Return Brushes.Red
Else
Return Brushes.Red
End If
End Get
End Property
Sub New(nId As Integer, sName As String, sMachine As String)
MyBase.New(nId, sName, sMachine)
'aggiorno lista pezzi
RefreshPartList()
End Sub
Public MustOverride Sub RefreshPartList()
Public MustOverride Sub RefreshGroupData()
Public Overridable Sub DeleteMachGroup()
' elimino tutte le copie
Dim nRawPartId As Integer = EgtGetFirstRawPart()
Dim nBeamId As Integer = EgtGetFirstPartInRawPart(nRawPartId)
While nRawPartId <> GDB_ID.NULL
EgtRemovePartFromRawPart(nBeamId)
EgtErase(nBeamId)
nRawPartId = EgtGetNextRawPart(nRawPartId)
nBeamId = EgtGetFirstPartInRawPart(nRawPartId)
End While
' elimino MachGroup
EgtRemoveMachGroup(Me.Id)
End Sub
Public Sub CalcMachGroupUpdate()
m_nState = CalcStates.OK
For Each Part In PartList
If Part.nGlobalState > 0 AndAlso m_nState = CalcStates.OK Then
m_nState = CalcStates.ERROR_
End If
Next
NotifyPropertyChanged(NameOf(Calc_Background))
End Sub
End Class
@@ -0,0 +1,208 @@
<EgtWPFLib5:EgtCustomWindow x:Class="OpenProjectFileDialogV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
Title="{Binding Title}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
Height="500" Width="500" Topmost="True"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<EgtWPFLib5:EgtCustomWindow.Resources>
<EgtWPFLib5:FileNameConverter x:Key="FileNameConverter"/>
</EgtWPFLib5:EgtCustomWindow.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel>
<Grid Grid.Row="0" Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding FilterType_Msg}"
Grid.Row="0" Grid.Column="0"
Style="{StaticResource OptionTextBlock}"/>
<ComboBox ItemsSource="{Binding SearchColumnList}"
SelectedItem="{Binding SelSearchColumn}"
Width="Auto"
Margin="5"
Grid.Row="0" Grid.Column="1"
Style="{StaticResource FeatureComboBox}"/>
<TextBlock Text="{Binding Search_Msg}"
Margin="0,5,0,0"
Grid.Row="1" Grid.Column="0"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SearchText}"
Margin="5"
Grid.Row="1" Grid.Column="1"
Visibility="{Binding SearchText_Visibility}"/>
<Calendar SelectedDatesChanged="Calendar_SelectedDatesChanged"
SelectionMode="MultipleRange"
Grid.Row="1" Grid.Column="1"
Visibility="{Binding SearchDate_Visibility}"/>
</Grid>
</StackPanel>
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
ItemsSource="{Binding ProjectList}"
SelectedItem="{Binding SelProject}"
CanUserAddRows="False"
AutoGenerateColumns="False"
CanUserResizeRows="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="5"
BindingColumns="{Binding ProjectColumns}">
<DataGrid.Resources>
<!-- ProjId -->
<DataGridTextColumn x:Key="colPROJID" Binding="{Binding sProjId}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- ProdId -->
<DataGridTextColumn x:Key="colPRODID" Binding="{Binding sProdId}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- BTL FileName -->
<DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- ListName -->
<DataGridTextColumn x:Key="colLISTNAME" Binding="{Binding sListName}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.ListName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- Exported date -->
<DataGridTextColumn x:Key="colEXPDATE" Binding="{Binding dtExportDate}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.ExportDate_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- Creation date -->
<DataGridTextColumn x:Key="colCRTDATE" Binding="{Binding dtCreateDate}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.CreateDate_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!-- Machine -->
<DataGridTextColumn x:Key="colMACHINE" Binding="{Binding sMachine}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Machine_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!-- Name (per Prod) -->
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Name_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OpenProjectFileDialogV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!-- Delete -->
<!--
<DataGridTemplateColumn x:Key="colDELETE"
Width="Auto"
IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="X"
Command="{Binding Delete_Command}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
</DataGrid.Resources>
<!--<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding OpenFileName}"
Padding="4,1,4,1">
<TextBlock.InputBindings>
<MouseBinding MouseAction="LeftDoubleClick"
Command="{Binding DataContext.ProjectDoubleClick_Command, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"
CommandParameter="{Binding nProjId}" />
</TextBlock.InputBindings>
</TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>-->
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="IsEnabled" Value="{Binding bIsEnabled}"/>
<EventSetter Event="MouseDoubleClick" Handler="ProjectList_MouseDoubleClick"/>
</Style>
</DataGrid.RowStyle>
</EgtBEAMWALL:EgtDataGrid>
<!--<ListBox Grid.Row="0"
ItemsSource="{Binding ProjectList}"
SelectedItem="{Binding SelProject}"
Margin="5">
-->
<!--<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ProjFileName}"/>
</DataTemplate>
</ListBox.ItemTemplate>-->
<!--
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
<Setter Property="Padding" Value="0"></Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding OpenFileName}"
Padding="4,1,4,1">
<TextBlock.InputBindings>
<MouseBinding MouseAction="LeftDoubleClick"
Command="{Binding DataContext.ProjectDoubleClick_Command, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"
CommandParameter="{Binding nProjId}" />
</TextBlock.InputBindings>
</TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>-->
<UniformGrid Columns="3" Grid.Row="2" Margin="0,0,0,5">
<Button IsDefault="True" Name="OpenBtn"
Content="{Binding Open_Msg}" Style="{DynamicResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding Delete_Msg}"
Command="{Binding Delete_Command}"
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
<Button IsCancel="True"
Content="{Binding Cancel_Msg}"
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -1,5 +1,9 @@
Imports System.ComponentModel
Imports System.IO
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Input
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtUILib
Public Class OpenProjectFileDialogV
@@ -26,40 +30,28 @@ Public Class OpenProjectFileDialogV
' mostro la finestra di dialogo
Return Me.ShowDialog()
End Function
Public Function EgtShowDialog(ProjectType As ProjectType, ProjectList As List(Of ProjFileVM)) As Boolean?
Public Function EgtShowDialog(ProjectType As ProjectType, ProjectList As List(Of ProjectFileVM)) As Boolean?
m_OpenProjFileDialogVM.Init(ProjectType, ProjectList)
' mostro la finestra di dialogo
Return Me.ShowDialog()
End Function
Public Function EgtShowDialog(ProjectType As ProjectType, GoToProd As Boolean) As Boolean?
m_OpenProjFileDialogVM.Init(ProjectType, Nothing, GoToProd)
' mostro la finestra di dialogo
Return Me.ShowDialog()
End Function
#End Region ' METHODS
#Region "EVENTS"
'Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
' m_MainWindowVM.ContentRendered()
'End Sub
Private Sub ProjectList_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs)
m_OpenProjFileDialogVM.ProjDoubleClick()
End Sub
#End Region ' EVENTS
'Private Sub m_FileNameTxBl_MouseDown(sender As Object, e As Windows.Input.MouseButtonEventArgs) Handles FileNameList.MouseDoubleClick
' Dim src As DependencyObject = VisualTreeHelper.GetParent(DirectCast(e.OriginalSource, DependencyObject))
' ' verifico che venga clickato un item, non lo spazio vuoto o la scrollbar
' If Not TypeOf src Is ListBoxItem Then
' src = Utility.FindAncestor(Of ListBoxItem)(src)
' End If
' If IsNothing(src) OrElse src.[GetType]() <> GetType(ListBoxItem) Then
' e.Handled = True
' Else
' If Not IsNothing(m_SelectedFile) Then
' m_FileName = SelectedFile
' DialogResult = True
' End If
' End If
'End Sub
Private Sub OpenBtn_Click(sender As Object, e As RoutedEventArgs) Handles OpenBtn.Click
DialogResult = m_OpenProjFileDialogVM.VerifySelected()
End Sub
@@ -68,4 +60,10 @@ Public Class OpenProjectFileDialogV
Me.DialogResult = bDialogResult
End Sub
Private Sub Calendar_SelectedDatesChanged(sender As Object, e As SelectionChangedEventArgs)
Dim cal As System.Windows.Controls.Calendar = sender
m_OpenProjFileDialogVM.m_SearchDate = cal.SelectedDates
m_OpenProjFileDialogVM.m_ProjectList_View.Refresh()
End Sub
End Class
@@ -0,0 +1,377 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Input
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtUILib
Imports EgtWPFLib5
Public MustInherit Class OpenProjectFileDialogVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
Protected m_ProjectColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property ProjectColumns As ObservableCollection(Of EgtDataGridColumn)
Get
Return m_ProjectColumns
End Get
Set(value As ObservableCollection(Of EgtDataGridColumn))
m_ProjectColumns = value
End Set
End Property
Protected m_ProjectType As ProjectType
Protected m_sFilter As String
Public Property Filter As String
Get
Return m_sFilter
End Get
Set(value As String)
m_sFilter = value
End Set
End Property
Protected m_sFileNameFilter As Predicate(Of String)
Public Property FileNameFilter As Predicate(Of String)
Get
Return m_sFileNameFilter
End Get
Set(value As Predicate(Of String))
m_sFileNameFilter = value
End Set
End Property
Protected m_sExtensions As New List(Of String)
Public ReadOnly Property Extensions As List(Of String)
Get
Return m_sExtensions
End Get
End Property
Public m_ProjectList_View As CollectionView = Nothing
Protected m_ProjectList As New ObservableCollection(Of ProjectFileVM)
Public ReadOnly Property ProjectList As ObservableCollection(Of ProjectFileVM)
Get
Return m_ProjectList
End Get
End Property
Protected m_SelProject As ProjectFileVM
Public Property SelProject As ProjectFileVM
Get
Return m_SelProject
End Get
Set(value As ProjectFileVM)
m_SelProject = value
End Set
End Property
Protected m_FileName As String
Public Property FileName As String
Get
Return m_FileName
End Get
Set(value As String)
m_FileName = value
End Set
End Property
' lista campi per ricerca testuale e con datepicker
Protected m_SearchColumnList As New ObservableCollection(Of IdNameStruct)
Public ReadOnly Property SearchColumnList As ObservableCollection(Of IdNameStruct)
Get
Return m_SearchColumnList
End Get
End Property
Protected m_SelSearchColumn As IdNameStruct = Nothing
Public Property SelSearchColumn As IdNameStruct
Get
Return m_SelSearchColumn
End Get
Set(value As IdNameStruct)
' resetto il contenuto della barra di ricerca testuale
m_SearchText = ""
NotifyPropertyChanged(NameOf(SearchText))
' resetto le selezioni sul calendario
If Not IsNothing(SearchDate) Then SearchDate.Clear()
' setto il Tipo Filtro a NULL e refresho la lista dei progetti (in modo da averli visibili tutti)
m_SelSearchColumn = m_SearchColumnList(0)
m_ProjectList_View.Refresh()
' ora setto il valore scelto come Tipo Filtro
m_SelSearchColumn = value
Select Case m_SelSearchColumn.Id
Case OpenProjFileColumn.ID, OpenProjFileColumn.BTLFILENAME, OpenProjFileColumn.LISTNAME, OpenProjFileColumn.MACHINE
SearchText_Visibility = Visibility.Visible
SearchDate_Visibility = Visibility.Collapsed
Case OpenProjFileColumn.EXPORTDATE, OpenProjFileColumn.CREATEDATE
SearchText_Visibility = Visibility.Collapsed
SearchDate_Visibility = Visibility.Visible
Case Else
SearchText_Visibility = Visibility.Collapsed
SearchDate_Visibility = Visibility.Collapsed
End Select
End Set
End Property
Protected m_SearchText As String = ""
Public Property SearchText As String
Get
Return m_SearchText
End Get
Set(value As String)
m_SearchText = value
m_ProjectList_View.Refresh()
End Set
End Property
Friend m_SearchDate As SelectedDatesCollection = Nothing
Public ReadOnly Property SearchDate As SelectedDatesCollection
Get
Return m_SearchDate
End Get
End Property
Protected m_SearchText_Visibility As Visibility = Visibility.Collapsed
Public Property SearchText_Visibility As Visibility
Get
Return m_SearchText_Visibility
End Get
Set(value As Visibility)
m_SearchText_Visibility = value
NotifyPropertyChanged(NameOf(SearchText_Visibility))
End Set
End Property
Protected m_SearchDate_Visibility As Visibility = Visibility.Collapsed
Public Property SearchDate_Visibility As Visibility
Get
Return m_SearchDate_Visibility
End Get
Set(value As Visibility)
m_SearchDate_Visibility = value
NotifyPropertyChanged(NameOf(SearchDate_Visibility))
End Set
End Property
Public Enum OpenProjFileColumn As Integer
NULL = 0
ID = 1
BTLFILENAME = 2
LISTNAME = 3
EXPORTDATE = 4
CREATEDATE = 5
MACHINE = 6
End Enum
#Region "Messages"
Public ReadOnly Property FilterType_Msg As String
Get
Return EgtMsg(61836)
End Get
End Property
Public ReadOnly Property Search_Msg As String
Get
Return EgtMsg(61837)
End Get
End Property
Public ReadOnly Property Id_Msg As String
Get
Return EgtMsg(61815)
End Get
End Property
Public ReadOnly Property BTLFileName_Msg As String
Get
Return EgtMsg(61819)
End Get
End Property
Public ReadOnly Property ListName_Msg As String
Get
Return EgtMsg(61820)
End Get
End Property
Public ReadOnly Property ExportDate_Msg As String
Get
Return EgtMsg(61821)
End Get
End Property
Public ReadOnly Property CreateDate_Msg As String
Get
Return EgtMsg(61822)
End Get
End Property
Public ReadOnly Property Machine_Msg As String
Get
Return EgtMsg(61886)
End Get
End Property
Public ReadOnly Property Name_Msg As String
Get
Return EgtMsg(61808)
End Get
End Property
Public ReadOnly Property Open_Msg As String
Get
Return EgtMsg(30006)
End Get
End Property
Public ReadOnly Property Delete_Msg As String
Get
Return EgtMsg(61823)
End Get
End Property
Public ReadOnly Property Cancel_Msg As String
Get
Return EgtMsg(30002)
End Get
End Property
#End Region
' Definizione comandi
Private m_cmdProjectDoubleClick As ICommand
Private m_cmdDelete As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "METHODS"
Public MustOverride Function Init(ProjectType As ProjectType, Optional CurrProjectList As List(Of ProjectFileVM) = Nothing, Optional GoToProd As Boolean = False) As Boolean?
Protected Sub LoadColumns(ProjectType As ProjectType)
If ProjectType = ProjectType.PROJ Then
' carico le colonne della datagrid
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROJ, ProjectColumns)
' carico campi su cui eseguire il filtro di ricerca
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
New IdNameStruct(OpenProjFileColumn.LISTNAME, ListName_Msg),
New IdNameStruct(OpenProjFileColumn.EXPORTDATE, ExportDate_Msg),
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
ElseIf ProjectType = ProjectType.PROD Then
' carico le colonne della datagrid
GetPrivateProfileColumns(S_OPENPROJFILEDLG_PROD, ProjectColumns)
' carico campi su cui eseguire il filtro di ricerca
m_SearchColumnList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(OpenProjFileColumn.NULL, ""),
New IdNameStruct(OpenProjFileColumn.ID, Id_Msg),
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg),
New IdNameStruct(OpenProjFileColumn.MACHINE, Machine_Msg)})
End If
' setto la visibilità delle colonne delle EgtDataGrid
For Each col In ProjectColumns
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
Next
End Sub
Friend Function VerifySelected() As Boolean
If IsNothing(SelProject) Then Return False
Dim AllFilesInDir As IEnumerable(Of String) = Nothing
If m_ProjectType = Core.ConstBeam.ProjectType.PROJ Then
If String.IsNullOrWhiteSpace(SelProject.sProjDirPath) OrElse Not Directory.Exists(SelProject.sProjDirPath) Then Return False
' verifico se esiste ProdId
AllFilesInDir = Directory.EnumerateFiles(SelProject.sProjDirPath)
ElseIf m_ProjectType = Core.ConstBeam.ProjectType.PROD Then
If String.IsNullOrWhiteSpace(SelProject.sProdDirPath) OrElse Not Directory.Exists(SelProject.sProdDirPath) Then Return False
AllFilesInDir = Directory.EnumerateFiles(SelProject.sProdDirPath)
Else
Return False
End If
For Each File In AllFilesInDir
If Path.GetExtension(File).ToLower() = ".nge" Then
Return True
End If
Next
Return False
End Function
Protected Function ProjectFilter(Proj As Object) As Boolean
Dim bProjectOk As Boolean = True
If m_ProjectType = ProjectType.PROJ Then
Dim CurrProj As ProjFileVM = DirectCast(Proj, ProjFileVM)
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
(m_SelSearchColumn.Id = OpenProjFileColumn.EXPORTDATE AndAlso Not SearchDate.Contains(CurrProj.dtExportDate.Date)) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProjId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.LISTNAME AndAlso CurrProj.sListName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
ElseIf m_ProjectType = ProjectType.PROD Then
Dim CurrProj As ProdFileVM = DirectCast(Proj, ProdFileVM)
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso (
(m_SelSearchColumn.Id = OpenProjFileColumn.CREATEDATE AndAlso Not SearchDate.Contains(CurrProj.dtCreateDate.Date))) Then bProjectOk = False
If m_SelSearchColumn.Id <> OpenProjFileColumn.NULL AndAlso m_SearchText <> String.Empty AndAlso (
(m_SelSearchColumn.Id = OpenProjFileColumn.ID AndAlso CurrProj.sProdId.ToString.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.BTLFILENAME AndAlso CurrProj.sBTLFileName.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0) OrElse
(m_SelSearchColumn.Id = OpenProjFileColumn.MACHINE AndAlso CurrProj.sMachine.IndexOf(SearchText, StringComparison.InvariantCultureIgnoreCase) < 0)) Then bProjectOk = False
End If
Return bProjectOk
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "ProjectDoubleClick"
''' <summary>
''' Returns a command that do New.
''' </summary>
Public ReadOnly Property ProjectDoubleClick_Command As ICommand
Get
If m_cmdProjectDoubleClick Is Nothing Then
m_cmdProjectDoubleClick = New Command(AddressOf ProjDoubleClick)
End If
Return m_cmdProjectDoubleClick
End Get
End Property
''' <summary>
''' Execute the New. This method is invoked by the NewCommand.
''' </summary>
Friend Sub ProjDoubleClick()
If VerifySelected() Then
RaiseEvent m_CloseWindow(True)
End If
End Sub
#End Region ' ProjectDoubleClick
#Region "Delete"
''' <summary>
''' Returns a command that do New.
''' </summary>
Public ReadOnly Property Delete_Command As ICommand
Get
If m_cmdDelete Is Nothing Then
m_cmdDelete = New Command(AddressOf Delete)
End If
Return m_cmdDelete
End Get
End Property
''' <summary>
''' Execute the New. This method is invoked by the NewCommand.
''' </summary>
Public Overridable Sub Delete()
End Sub
#End Region ' Delete
#End Region ' Commands
End Class
-364
View File
@@ -1,364 +0,0 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows.Input
Imports System.Windows.Media
Imports EgtUILib
Imports EgtWPFLib5
Public MustInherit Class Part
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Protected m_ParentMachGroup As MyMachGroup
Public ReadOnly Property ParentMachGroup As MyMachGroup
Get
Return m_ParentMachGroup
End Get
End Property
' Id geometrico del pezzo
Protected m_nPartId As Integer
Public ReadOnly Property nPartId As Integer
Get
Return m_nPartId
End Get
End Property
Friend Sub SetPartId(nPartId As Integer)
m_nPartId = nPartId
End Sub
' Proj del pezzo
Protected m_nProjId As Integer = 0
Public Property nProjId As Integer
Get
Return m_nProjId
End Get
Set(value As Integer)
m_nProjId = value
End Set
End Property
' Info del pezzo
Protected m_nPDN As Integer
Public ReadOnly Property nPDN As Integer
Get
Return m_nPDN
End Get
End Property
Protected m_sNAM As String
Public ReadOnly Property sNAM As String
Get
Return m_sNAM
End Get
End Property
Protected m_dL As Double
Public Property dL As Double
Get
Return m_dL
End Get
Set(value As Double)
m_dL = value
End Set
End Property
Protected m_dW As Double
Public Property dW As Double
Get
Return m_dW
End Get
Set(value As Double)
m_dW = value
End Set
End Property
Protected m_dH As Double
Public Property dH As Double
Get
Return m_dH
End Get
Set(value As Double)
m_dH = value
End Set
End Property
Protected m_dPOSX As Double
Public Property sPOSX As String
Get
Return LenToString(m_dPOSX, 3)
End Get
Set(value As String)
StringToLen(value, m_dPOSX)
End Set
End Property
Public Property dPOSX As Double
Get
Return m_dPOSX
End Get
Set(value As Double)
m_dPOSX = value
NotifyPropertyChanged(NameOf(sPOSX))
End Set
End Property
Protected m_nCNT As Integer
Public Property nCNT As Integer
Get
Return m_nCNT
End Get
Set(value As Integer)
m_nCNT = value
End Set
End Property
Protected m_nINVERTED As Integer
Public ReadOnly Property sINVERTED As String
Get
Return m_nINVERTED & "°"
End Get
End Property
Public Sub SetInverted(nInverted As Integer)
m_nINVERTED = nInverted
End Sub
Protected m_nROTATED As Integer
Public ReadOnly Property sROTATED As String
Get
Return m_nROTATED & "°"
End Get
End Property
Public Sub SetRotated(nRotated As Integer)
m_nROTATED = nRotated
End Sub
Protected m_sMATERIAL As String
Public Property sMATERIAL As String
Get
Return m_sMATERIAL
End Get
Set(value As String)
m_sMATERIAL = value
End Set
End Property
Protected m_nGlobalState As CalcStates = -1
Public ReadOnly Property nGlobalState As CalcStates
Get
Return m_nGlobalState
End Get
End Property
Protected m_nState As CalcStates = -1
Public Property nState As CalcStates
Get
Return m_nState
End Get
Set(value As CalcStates)
m_nState = value
End Set
End Property
Public ReadOnly Property Calc_Background As SolidColorBrush
Get
If m_nGlobalState = 0 Then
Return Brushes.Green
ElseIf m_nGlobalState < 0 Then
Return Brushes.LightGray
ElseIf m_nGlobalState > 0 Then
Return Brushes.Red
Else
Return Brushes.Red
End If
End Get
End Property
Protected m_nCALC_ERR As Integer
Public ReadOnly Property nCALC_ERR As Integer
Get
Return m_nCALC_ERR
End Get
End Property
Protected m_sCALC_MSG As String = String.Empty
Public ReadOnly Property nCALC_MSG As String
Get
Return m_sCALC_MSG
End Get
End Property
Protected m_nCALC_ROT As Integer
Public Property nCALC_ROT As Integer
Get
Return m_nCALC_ROT
End Get
Set(value As Integer)
m_nCALC_ROT = value
End Set
End Property
Protected m_nCALC_FALL As Integer
Public Property nCALC_FALL As Integer
Get
Return m_nCALC_FALL
End Get
Set(value As Integer)
m_nCALC_FALL = value
End Set
End Property
Protected m_nCALC_TIME As Integer
Public Property nCALC_TIME As Integer
Get
Return m_nCALC_TIME
End Get
Set(value As Integer)
m_nCALC_TIME = value
End Set
End Property
' lista delle feature del pezzo
Protected m_FeatureList As ObservableCollection(Of BTLFeatureM)
Public Property FeatureList As ObservableCollection(Of BTLFeatureM)
Get
Return m_FeatureList
End Get
Set(value As ObservableCollection(Of BTLFeatureM))
m_FeatureList = value
End Set
End Property
Protected m_SelFeature As BTLFeatureM
Public Property SelFeature As BTLFeatureM
Get
Return m_SelFeature
End Get
Set(value As BTLFeatureM)
m_SelFeature = value
EgtDeselectAll()
If Not IsNothing(value) Then EgtSelectObj(m_SelFeature.nFeatureId)
EgtDraw()
NotifyPropertyChanged(NameOf(SelFeature))
End Set
End Property
' definizione comandi
Private m_cmdDeletePart As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(nParentMachGroup As MyMachGroup, nPartId As Integer)
m_ParentMachGroup = nParentMachGroup
SetPartId(nPartId)
m_FeatureList = New ObservableCollection(Of BTLFeatureM)
End Sub
#End Region ' CONSTRUCTOR
' funzione che aggiorna lo stato e gli errori dopo calcolo
Public Sub CalcPartUpdate(bCalc As Boolean, ERR As Integer, ROT As Integer, FALL As Integer, MSG As String)
If Not bCalc Then
nState = CalcStates.NOTCALCULATED
m_nCALC_ERR = 0
m_nCALC_ROT = 0
m_nCALC_FALL = 0
m_sCALC_MSG = ""
Else
m_nCALC_ERR = ERR
m_nCALC_ROT = ROT
m_nCALC_FALL = 0
m_sCALC_MSG = MSG
If ERR = 0 Then
nState = CalcStates.OK
ElseIf ERR > 1 Then
nState = CalcStates.ERROR_
ElseIf ERR < 1 Then
nState = CalcStates.NOTCALCULATED
End If
End If
NotifyPropertyChanged(NameOf(Calc_Background))
End Sub
' funzione che aggiorna lo stato e gli errori dopo calcolo
Public Sub CalcFeatureUpdate()
m_nGlobalState = nState
For Each Feature In FeatureList
If Not Feature.bDO Then
ElseIf Feature.nState < 0 Then
m_nGlobalState = CalcStates.NOTCALCULATED
Exit For
ElseIf Feature.nState > 0 AndAlso m_nGlobalState = CalcStates.OK Then
m_nGlobalState = CalcStates.ERROR_
End If
Next
NotifyPropertyChanged(NameOf(Calc_Background))
End Sub
#Region "COMMANDS"
#Region "DeletePart"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property DeletePart_Command() As ICommand
Get
If m_cmdDeletePart Is Nothing Then
m_cmdDeletePart = New Command(AddressOf DeletePart)
End If
Return m_cmdDeletePart
End Get
End Property
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Overridable Sub DeletePart()
EgtRemovePartFromRawPart(Me.m_nPartId)
' elimino pezzo copia
EgtErase(Me.m_nPartId)
' elimino info pezzo su mach group
Dim sInfo As String = ""
Dim Index As Integer = 1
Dim sSplitInfo() As String
Dim bFound As Boolean = False
While EgtGetInfo(m_ParentMachGroup.Id, MGR_RPT_PART & Index, sInfo)
If Not String.IsNullOrWhiteSpace(sInfo) Then
sSplitInfo = sInfo.Split(","c)
If bFound Then
EgtSetInfo(m_ParentMachGroup.Id, MGR_RPT_PART & Index - 1, sInfo)
End If
If sSplitInfo(0) = nPartId Then
bFound = True
End If
End If
Index += 1
End While
If bFound Then
EgtSetInfo(m_ParentMachGroup.Id, MGR_RPT_PART & Index - 1, "")
End If
' rimuovo dalla lista pezzi
Index = ParentMachGroup.PartList.IndexOf(Me)
If Index = 0 Then
If ParentMachGroup.PartList.Count > 0 Then
ParentMachGroup.SelPart = ParentMachGroup.PartList(0)
Else
ParentMachGroup.SelPart = Nothing
End If
ElseIf Index = ParentMachGroup.PartList.Count - 1 Then
If ParentMachGroup.PartList.Count > 1 Then
ParentMachGroup.SelPart = ParentMachGroup.PartList(ParentMachGroup.PartList.Count - 2)
Else
ParentMachGroup.SelPart = Nothing
End If
Else
ParentMachGroup.SelPart = ParentMachGroup.PartList(Index - 1)
End If
ParentMachGroup.PartList.Remove(Me)
End Sub
#End Region ' DeletePart
#End Region ' COMMANDS
End Class
@@ -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
@@ -27,13 +30,17 @@ Public Class ProdFileM
Return New ProdFileM
End Function
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer),
dtCreateProjDate As DateTime, sName As String) As ProdFileM
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType,
sMachine As String, sLockedBy As String, dtLock As DateTime) As ProdFileM
Dim NewProjectFileM As New ProdFileM
NewProjectFileM.m_nProdId = nProdId
NewProjectFileM.m_nProjIdList = nProjIdList
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
NewProjectFileM.m_sName = sName
NewProjectFileM.m_nType = nType
NewProjectFileM.m_sMachine = sMachine
NewProjectFileM.m_sLockedBy = sLockedBy
NewProjectFileM.m_dtLock = dtLock
Return NewProjectFileM
End Function
@@ -19,10 +19,13 @@ Public Class ProjFileM
End Property
Protected m_sBTLFileName As String = String.Empty
Public ReadOnly Property sBTLFileName As String
Public Property sBTLFileName As String
Get
Return m_sBTLFileName
End Get
Set(value As String)
m_sBTLFileName = value
End Set
End Property
#Region "CONSTRUCTORS"
@@ -34,16 +37,20 @@ Public Class ProjFileM
Return New ProjFileM
End Function
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime,
dtExportDate As DateTime, sListName As String, sBTLFileName As String) As ProjFileM
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String,
sBTLFileName As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String) As ProjFileM
Dim NewProjectFileM As New ProjFileM
NewProjectFileM.m_nProjId = nProjId
NewProjectFileM.m_nProdId = nProdId
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
NewProjectFileM.m_dtExportDate = dtExportDate
NewProjectFileM.m_sListName = sListName
NewProjectFileM.m_sBTLFileName = sBTLFileName
Return NewProjectFileM
NewProjectFileM.m_nProjId = nProjId
NewProjectFileM.m_nProdId = nProdId
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
NewProjectFileM.m_dtExportDate = dtExportDate
NewProjectFileM.m_sListName = sListName
NewProjectFileM.m_sBTLFileName = sBTLFileName
NewProjectFileM.m_bIsNew = IsNew
NewProjectFileM.m_bIsLocked = IsLocked
NewProjectFileM.m_nType = nType
NewProjectFileM.m_sMachine = sMachine
Return NewProjectFileM
End Function
#End Region ' CONSTRUCTORS
@@ -44,18 +44,57 @@ Public Class ProjectFileM
End Set
End Property
#Region "CONSTRUCTORS"
Protected m_bIsLocked As Boolean
Public Property bIsLocked As Boolean
Get
Return m_bIsLocked
End Get
Set(value As Boolean)
m_bIsLocked = value
End Set
End Property
'Sub New(nProjectType As ProjectType, nProjId As Integer, nProdId As Integer, sBTLFileName As String)
' m_nProjectType = nProjectType
' If m_nProjectType = ProjectType.PROJ Then
' m_nProjId = nProjId
' m_nProdId = nProdId
' m_BTLFileName = sBTLFileName
' ElseIf m_nProjectType = ProjectType.PROD Then
' m_nProdId = nProdId
' End If
'End Sub
Protected m_nType As BWType
Public Property nType As BWType
Get
Return m_nType
End Get
Set(value As BWType)
m_nType = value
End Set
End Property
Protected m_sMachine As String
Public Property sMachine As String
Get
Return m_sMachine
End Get
Set(value As String)
m_sMachine = value
End Set
End Property
Protected m_sLockedBy As String
Public Property sLockedBy As String
Get
Return m_sLockedBy
End Get
Set(value As String)
m_sLockedBy = value
End Set
End Property
Protected m_dtLock As DateTime
Public Property dtLock As DateTime
Get
Return m_dtLock
End Get
Set(value As DateTime)
m_dtLock = value
End Set
End Property
#Region "CONSTRUCTORS"
#End Region ' CONSTRUCTORS
@@ -0,0 +1,106 @@
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Public Class ProdFileVM
Inherits ProjectFileVM
Public ReadOnly Property ProdFileM As ProdFileM
Get
Return m_ProjectFileM
End Get
End Property
Public ReadOnly Property nProjIdList As List(Of Integer)
Get
Return ProdFileM.nProjIdList
End Get
End Property
Public Overrides ReadOnly Property nProdId As Integer
Get
Return ProdFileM.nProdId
End Get
End Property
Public Overrides ReadOnly Property sProdDirPath As String
Get
Dim sPath As String = String.Empty
If IsNothing(ProdFileM.nProdId) OrElse ProdFileM.nProdId = 0 Then Return String.Empty
Return m_sProdsDir & "\" & nProdId.ToString("0000")
End Get
End Property
Public Overrides ReadOnly Property sProdPath As String
Get
Dim sPath As String = String.Empty
If IsNothing(ProdFileM.nProdId) OrElse ProdFileM.nProdId = 0 Then Return String.Empty
Return m_sProdsDir & "\" & nProdId.ToString("0000") & "\" & nProdId.ToString("0000") & ".nge"
End Get
End Property
Public Overrides Property bIsNew As Boolean
Get
Return ProdFileM.bIsNew
End Get
Set(value As Boolean)
ProdFileM.bIsNew = value
End Set
End Property
Public ReadOnly Property sName As String
Get
Return ProdFileM.sName
End Get
End Property
Private m_sBTLFileName As String
Public ReadOnly Property sBTLFileName As String
Get
Return m_sBTLFileName
End Get
End Property
Protected Sub SetBTLFileName(value As String)
m_sBTLFileName = value
End Sub
#Region "CONSTRUCTORS"
Sub New(ProdFileM As ProdFileM)
m_ProjectFileM = ProdFileM
End Sub
#End Region ' CONSTRUCTORS
Friend Function GetProjPath(nProjId As Integer)
Dim sPath As String = String.Empty
If nProjId = 0 Then Return String.Empty
Return m_sProjsDir & "\" & nProjId.ToString("0000") & "\" & nProjId.ToString("0000") & ".nge"
End Function
' funzione che restituisce le parti di nome file
Friend Shared Function VerifyProjectFile(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
If nProjectType = ProjectType.PROJ Then
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
If DataFromFileName.Count = 3 Then
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
Integer.TryParse(DataFromFileName(0), nProjId)
Else Return False
End If
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
Integer.TryParse(DataFromFileName(1), nProdId)
Else
nProdId = 0
End If
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
sBTLFileName = DataFromFileName(2)
End If
Return True
Else Return False
End If
ElseIf nProjectType = ProjectType.PROD Then
Return Integer.TryParse(ProjectFileName, nProdId)
Else Return False
End If
End Function
End Class
@@ -0,0 +1,125 @@
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Public Class ProjFileVM
Inherits ProjectFileVM
Public ReadOnly Property ProjFileM As ProjFileM
Get
Return m_ProjectFileM
End Get
End Property
Public Overrides ReadOnly Property nProjId As Integer
Get
Return ProjFileM.nProjId
End Get
End Property
Public Overrides ReadOnly Property nProdId As Integer
Get
Return ProjFileM.nProdId
End Get
End Property
Public Overrides ReadOnly Property sProjDirPath As String
Get
If IsNothing(ProjFileM.nProjId) OrElse ProjFileM.nProjId = 0 Then Return String.Empty
Return m_sProjsDir & "\" & nProjId.ToString("0000")
End Get
End Property
Public Overrides ReadOnly Property sProjPath As String
Get
Dim sPath As String = String.Empty
If IsNothing(ProjFileM.nProjId) OrElse ProjFileM.nProjId = 0 Then Return String.Empty
sPath = m_sProjsDir & "\" & nProjId.ToString("0000") & "\" & nProjId.ToString("0000") & ".nge"
Return sPath
End Get
End Property
Public Overrides ReadOnly Property sProdDirPath As String
Get
Dim sPath As String = String.Empty
If IsNothing(ProjFileM.nProdId) OrElse ProjFileM.nProdId = 0 Then Return String.Empty
Return m_sProdsDir & "\" & nProdId.ToString("0000")
End Get
End Property
Public Overrides ReadOnly Property sProdPath As String
Get
Dim sPath As String = String.Empty
If IsNothing(ProjFileM.nProdId) OrElse ProjFileM.nProdId = 0 Then Return String.Empty
Return m_sProdsDir & "\" & nProdId.ToString("0000") & "\" & nProdId.ToString("0000") & ".nge"
End Get
End Property
Public Overrides Property bIsNew As Boolean
Get
Return ProjFileM.bIsNew
End Get
Set(value As Boolean)
ProjFileM.bIsNew = value
End Set
End Property
Public ReadOnly Property sBTLFileName As String
Get
Return ProjFileM.sBTLFileName
End Get
End Property
Public ReadOnly Property sListName As String
Get
Return ProjFileM.sListName
End Get
End Property
Public ReadOnly Property dtExportDate As DateTime
Get
Return ProjFileM.dtExportDate
End Get
End Property
#Region "CONSTRUCTORS"
Sub New(ProjectFileM As ProjFileM)
m_ProjectFileM = ProjectFileM
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Public Sub SetBTLFileName(BTLFileName As String)
ProjFileM.sBTLFileName = BTLFileName
End Sub
' funzione che restituisce le parti di nome file
Friend Shared Function VerifyProjectFile(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
If nProjectType = ProjectType.PROJ Then
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
If DataFromFileName.Count = 3 Then
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
Integer.TryParse(DataFromFileName(0), nProjId)
Else Return False
End If
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
Integer.TryParse(DataFromFileName(1), nProdId)
Else
nProdId = 0
End If
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
sBTLFileName = DataFromFileName(2)
End If
Return True
Else Return False
End If
ElseIf nProjectType = ProjectType.PROD Then
Return Integer.TryParse(ProjectFileName, nProdId)
Else Return False
End If
End Function
#End Region ' METHODS
End Class
@@ -0,0 +1,172 @@
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class ProjectFileVM
Inherits VMBase
Protected Shared m_sProjsDir As String
Protected Shared m_sProdsDir As String
Protected m_ProjectFileM As ProjectFileM
Public Overridable ReadOnly Property nProjId As Integer
Get
Return m_ProjectFileM.nProjId
End Get
End Property
Public Overridable ReadOnly Property sProjId As String
Get
Return m_ProjectFileM.nProjId.ToString("0000")
End Get
End Property
Public Overridable ReadOnly Property nProdId As Integer
Get
Return m_ProjectFileM.nProdId
End Get
End Property
Public Overridable ReadOnly Property sProdId As String
Get
Return m_ProjectFileM.nProdId.ToString("0000")
End Get
End Property
Public Overridable ReadOnly Property sProjDirPath As String
Get
If IsNothing(m_ProjectFileM.nProjId) OrElse m_ProjectFileM.nProjId = 0 Then Return String.Empty
Return m_sProjsDir & "\" & nProjId.ToString("0000")
End Get
End Property
Public Overridable ReadOnly Property sProjPath As String
Get
Dim sPath As String = String.Empty
If IsNothing(m_ProjectFileM.nProjId) OrElse m_ProjectFileM.nProjId = 0 Then Return String.Empty
sPath = m_sProjsDir & "\" & nProjId.ToString("0000") & "\" & nProjId.ToString("0000") & ".nge"
Return sPath
End Get
End Property
Public Overridable ReadOnly Property sProdDirPath As String
Get
Dim sPath As String = String.Empty
If IsNothing(m_ProjectFileM.nProdId) OrElse m_ProjectFileM.nProdId = 0 Then Return String.Empty
Return m_sProdsDir & "\" & nProdId.ToString("0000")
End Get
End Property
Public Overridable ReadOnly Property sProdPath As String
Get
Dim sPath As String = String.Empty
If IsNothing(m_ProjectFileM.nProdId) OrElse m_ProjectFileM.nProdId = 0 Then Return String.Empty
Return m_sProdsDir & "\" & nProdId.ToString("0000") & "\" & nProdId.ToString("0000") & ".nge"
End Get
End Property
Public Overridable Property bIsNew As Boolean
Get
Return m_ProjectFileM.bIsNew
End Get
Set(value As Boolean)
m_ProjectFileM.bIsNew = value
End Set
End Property
Public Overridable Property bIsLocked As Boolean
Get
Return m_ProjectFileM.bIsLocked
End Get
Set(value As Boolean)
m_ProjectFileM.bIsLocked = value
End Set
End Property
Public ReadOnly Property dtCreateDate As DateTime
Get
Return m_ProjectFileM.dtCreateDate
End Get
End Property
' variabile che indica se ricaricare il progetto
Protected m_bReloadProject As Boolean = True
Public ReadOnly Property bReloadProject As Boolean
Get
Return m_bReloadProject
End Get
End Property
Protected m_nModificationIndex As Integer = Integer.MaxValue - 1000
Public ReadOnly Property nModificationIndex As Integer
Get
Return m_nModificationIndex
End Get
End Property
Public Sub SetModificationIndex(value As String)
m_nModificationIndex = value
End Sub
Public ReadOnly Property nType As BWType
Get
Return m_ProjectFileM.nType
End Get
End Property
Public ReadOnly Property sMachine As String
Get
Return m_ProjectFileM.sMachine
End Get
End Property
#Region "Messages"
Public ReadOnly Property Id_Msg As String
Get
Return EgtMsg(61815)
End Get
End Property
Public ReadOnly Property BTLFileName_Msg As String
Get
Return EgtMsg(61819)
End Get
End Property
Public ReadOnly Property ListName_Msg As String
Get
Return EgtMsg(61820)
End Get
End Property
Public ReadOnly Property ExportDate_Msg As String
Get
Return EgtMsg(61821)
End Get
End Property
Public ReadOnly Property CreateDate_Msg As String
Get
Return EgtMsg(61822)
End Get
End Property
Public ReadOnly Property Name_Msg As String
Get
Return EgtMsg(61808)
End Get
End Property
#End Region ' Messages
#Region "CONSTRUCTORS"
#End Region ' CONSTRUCTORS
Public Sub SetReloadProject(bValue As Boolean)
m_bReloadProject = bValue
End Sub
Public Shared Sub Init(sProjsDir As String, sProdsDir As String)
m_sProjsDir = sProjsDir
m_sProdsDir = sProdsDir
End Sub
Public Sub SetMachine(sMachine)
m_ProjectFileM.sMachine = sMachine
End Sub
End Class
+66 -5
View File
@@ -18,6 +18,7 @@ Imports EgtWPFLib5
Public Module BTLIniFile
Public m_sBTLIniFile As String
Public m_nBTLBWType As BWType
Public Function GetBeamPrivateProfileProcessList(IpGRPType As GRPType, ByRef IpProcessList As ObservableCollection(Of Integer)) As Boolean
Dim PRCList As New ObservableCollection(Of Integer)
@@ -124,9 +125,16 @@ Public Module BTLIniFile
Return ""
End Function
' funzione che ottiene il parametro P/Q usando m_nBTLBWType del modulo
Public Function GetBeamPrivateProfileParam(IpGRP As Integer, IpPRC As Integer, IsP As Boolean, IpFeatureParamIndex As String, IpParentFeature As BTLFeatureM, ByRef IpBTLParam As BTLParamM) As Boolean
Dim sBTLParam As String = String.Empty
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, If(IsP, "P", "Q") & IpFeatureParamIndex, String.Empty, sBTLParam, m_sBTLIniFile) > 0 Then
Dim sBWQParam As String = String.Empty
If m_nBTLBWType = BWType.BEAM Then
sBWQParam = "B"
ElseIf m_nBTLBWType = BWType.WALL Then
sBWQParam = "W"
End If
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, If(IsP, "P", "Q" & sBWQParam) & IpFeatureParamIndex, String.Empty, sBTLParam, m_sBTLIniFile) > 0 Then
Dim sBTLParamParams() As String = sBTLParam.Split(","c)
' verifico numero minimo di parametri
If sBTLParamParams.Count >= 6 Then
@@ -139,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_
@@ -151,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
@@ -170,4 +178,57 @@ Public Module BTLIniFile
Return False
End Function
' funzione che ottiene il parametro P/Q usando BTLBWType passato come argomento
Public Function GetBeamPrivateProfileParam(IpGRP As Integer, IpPRC As Integer, IsP As Boolean, IpFeatureParamIndex As String, IpParentFeature As BTLFeatureM, ByRef IpBTLParam As BTLParamM, BTLBWType As BWType) As Boolean
Dim sBTLParam As String = String.Empty
Dim sBWQParam As String = String.Empty
If BTLBWType = BWType.BEAM Then
sBWQParam = "B"
ElseIf BTLBWType = BWType.WALL Then
sBWQParam = "W"
End If
If EgtUILib.GetPrivateProfileString(CalcBeamPrivateProfileGRP(IpGRP) & "." & IpPRC, If(IsP, "P", "Q" & sBWQParam) & IpFeatureParamIndex, String.Empty, sBTLParam, m_sBTLIniFile) > 0 Then
Dim sBTLParamParams() As String = sBTLParam.Split(","c)
' verifico numero minimo di parametri
If sBTLParamParams.Count >= 6 Then
' cancello spazi
For Index = 0 To sBTLParamParams.Count - 1
sBTLParamParams(Index) = sBTLParamParams(Index).Trim()
Next
' creo parametro
If sBTLParamParams(0) = "d" OrElse sBTLParamParams(0) = "l" Then
Dim dMin As Double
Dim dMax As Double
Dim dDefault As Double
StringToDoubleAdv(sBTLParamParams(2), dMin)
StringToDoubleAdv(sBTLParamParams(3), dMax)
StringToDoubleAdv(sBTLParamParams(4), dDefault)
Dim ParamType As BTLParamType
If sBTLParamParams(0) = "d" Then
ParamType = BTLParamType.DOUBLE_
Else
ParamType = BTLParamType.LENGTH
End If
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(4), sBTLParamParams(5), sBWQParam)
Return Not IsNothing(IpBTLParam)
ElseIf sBTLParamParams(0) = "c" Then
Dim nMin As Integer
Dim nMax As Integer
Dim nDefault As Integer
Integer.TryParse(sBTLParamParams(2), nMin)
Integer.TryParse(sBTLParamParams(3), nMax)
Integer.TryParse(sBTLParamParams(4), nDefault)
' recupero lista valori
Dim ValueList As New List(Of String)
IpBTLParam = BTLParamM.CreateBTLParam(IpParentFeature, IsP, BTLParamType.COMBO, sBTLParamParams(1), nMin, nMax, nDefault, sBTLParamParams(5), ValueList, sBWQParam)
Return Not IsNothing(IpBTLParam)
End If
End If
End If
Return False
End Function
End Module
-70
View File
@@ -1,70 +0,0 @@
Imports System.Windows.Input
''' <summary>
''' A command whose sole purpose is to
''' relay its functionality to other
''' objects by invoking delegates. The
''' default return value for the CanExecute
''' method is 'true'.
''' </summary>
Public Class Command
Implements ICommand
#Region "Fields"
Private ReadOnly _execute As Action(Of Object)
Private ReadOnly _canExecute As Predicate(Of Object)
#End Region ' Fields
#Region "Constructors"
''' <summary>
''' Creates a new command that can always execute.
''' </summary>
''' <param name="execute">The execution logic.</param>
Public Sub New(ByVal execute As Action(Of Object))
Me.New(execute, Nothing)
End Sub
''' <summary>
''' Creates a new command.
''' </summary>
''' <param name="execute">The execution logic.</param>
''' <param name="canExecute">The execution status logic.</param>
Public Sub New(ByVal execute As Action(Of Object), ByVal canExecute As Predicate(Of Object))
If execute Is Nothing Then
Throw New ArgumentNullException("execute")
End If
_execute = execute
_canExecute = canExecute
End Sub
#End Region ' Constructors
#Region "ICommand Members"
<DebuggerStepThrough> _
Public Function CanExecute(ByVal parameter As Object) As Boolean Implements ICommand.CanExecute
Return If(_canExecute Is Nothing, True, _canExecute(parameter))
End Function
Public Custom Event CanExecuteChanged As EventHandler Implements ICommand.CanExecuteChanged
AddHandler(ByVal value As EventHandler)
AddHandler CommandManager.RequerySuggested, value
End AddHandler
RemoveHandler(ByVal value As EventHandler)
RemoveHandler CommandManager.RequerySuggested, value
End RemoveHandler
RaiseEvent(ByVal sender As System.Object, ByVal e As System.EventArgs)
End RaiseEvent
End Event
Public Sub Execute(ByVal parameter As Object) Implements ICommand.Execute
_execute(parameter)
End Sub
#End Region ' ICommand Members
End Class
+330
View File
@@ -0,0 +1,330 @@
Imports EgtWPFLib5
Public Module CoreMap
'Private m_refMainWindowVM As MainWindowVM
'Private m_refMyStatusBarVM As MyStatusBarVM
'Private m_refProjManagerVM As ProjManagerVM
'Private m_refProdManagerVM As ProdManagerVM
'Private m_refProjectVM As ProjectVM
'Private m_refMainMenuVM As MainMenuVM
Private m_refMachinePanelVM As MachinePanelVM
Private m_refMyMachGroupPanelVM As MyMachGroupPanelVM
'Private m_refLeftPanelVM As LeftPanelVM
'Private m_refBottomPanelVM As BottomPanelVM
'Private m_refShowBeamPanelVM As ShowBeamPanelVM
'Private m_refConfigurationPageVM As ConfigurationPageVM
'Private m_refRawPartListVM As RawPartListVM
'Private m_refPartInRawPartListVM As PartInRawPartListVM
'Private m_refWarehouseWndVM As WarehouseWndVM
'Private m_refFeatureListVM As FeatureListVM
'Private m_refFreeContourManagerVM As FreeContourManagerVM
'Private m_refFreeContourInputVM As FreeContourInputVM
'Private m_refPartManagerVM As PartManagerVM
'Private m_refInstrumentPanelVM As InstrumentPanelVM
'Private m_refTopPanelVM As TopPanelVM
'Private m_refOptimizePanelVM As OptimizePanelVM
'Private m_refOpenProjectFileDialogVM As OpenProjectFileDialogVM
#Region "Get"
'Public ReadOnly Property refMainWindowVM As MainWindowVM
' Get
' Return m_refMainWindowVM
' End Get
'End Property
'Public ReadOnly Property refMyStatusBarVM As MyStatusBarVM
' Get
' Return LibMap.refStatusBarVM
' End Get
'End Property
'Public ReadOnly Property refProjManagerVM As ProjManagerVM
' Get
' Return m_refProjManagerVM
' End Get
'End Property
'Public ReadOnly Property refProdManagerVM As ProdManagerVM
' Get
' Return m_refProdManagerVM
' End Get
'End Property
'Public ReadOnly Property refProjectVM As ProjectVM
' Get
' Return m_refProjectVM
' End Get
'End Property
Public ReadOnly Property refSceneHostVM As SceneHostVM
Get
Return LibMap.refSceneHostVM
End Get
End Property
'Public ReadOnly Property refShowPanelVM As ShowPanelVM
' Get
' Return LibMap.refShowPanelVM
' End Get
'End Property
'Public ReadOnly Property refMainMenuVM As MainMenuVM
' Get
' Return m_refMainMenuVM
' End Get
'End Property
Public ReadOnly Property refMachinePanelVM As MachinePanelVM
Get
Return m_refMachinePanelVM
End Get
End Property
'Public ReadOnly Property refLeftPanelVM As LeftPanelVM
' Get
' Return m_refLeftPanelVM
' End Get
'End Property
Public ReadOnly Property refMachGroupPanelVM As MyMachGroupPanelVM
Get
Return m_refMyMachGroupPanelVM
End Get
End Property
'Public ReadOnly Property refBottomPanelVM As BottomPanelVM
' Get
' Return m_refBottomPanelVM
' End Get
'End Property
'Public ReadOnly Property refShowBeamPanelVM As ShowBeamPanelVM
' Get
' Return m_refShowBeamPanelVM
' End Get
'End Property
'Public ReadOnly Property refConfigurationPageVM As ConfigurationPageVM
' Get
' Return m_refConfigurationPageVM
' End Get
'End Property
'Public ReadOnly Property refRawPartListVM As RawPartListVM
' Get
' Return m_refRawPartListVM
' End Get
'End Property
'Public ReadOnly Property refPartInRawPartListVM As PartInRawPartListVM
' Get
' Return m_refPartInRawPartListVM
' End Get
'End Property
'Public ReadOnly Property refWarehouseWndVM As WarehouseWndVM
' Get
' Return m_refWarehouseWndVM
' End Get
'End Property
'Public ReadOnly Property refFeatureListVM As FeatureListVM
' Get
' Return m_refFeatureListVM
' End Get
'End Property
'Public ReadOnly Property refFreeContourManagerVM As FreeContourManagerVM
' Get
' Return m_refFreeContourManagerVM
' End Get
'End Property
'Public ReadOnly Property refFreeContourInputVM As FreeContourInputVM
' Get
' Return m_refFreeContourInputVM
' End Get
'End Property
'Public ReadOnly Property refPartManagerVM As PartManagerVM
' Get
' Return m_refPartManagerVM
' End Get
'End Property
'Public ReadOnly Property refInstrumentPanelVM As MyInstrumentPanelVM
' Get
' Return m_refInstrumentPanelVM
' End Get
'End Property
'Public ReadOnly Property refTopPanelVM As TopPanelVM
' Get
' Return m_refTopPanelVM
' End Get
'End Property
'Public ReadOnly Property refOptimizePanelVM As OptimizePanelVM
' Get
' Return m_refOptimizePanelVM
' End Get
'End Property
'Public ReadOnly Property refOpenProjectFileDialogVM As OpenProjectFileDialogVM
' Get
' Return m_refOpenProjectFileDialogVM
' End Get
'End Property
#End Region ' Get
#Region "Set"
'Friend Function SetRefMyStatusBarVM(MyStatusBarVM As MyStatusBarVM) As Boolean
' LibMap.SetRefStatusBarVM(MyStatusBarVM)
' Return Not IsNothing(LibMap.refStatusBarVM)
'End Function
'Friend Function SetRefProjManagerVM(ProjManagerVM As ProjManagerVM) As Boolean
' m_refProjManagerVM = ProjManagerVM
' Return Not IsNothing(m_refProjManagerVM)
'End Function
'Friend Function SetRefProdManagerVM(ProdManagerVM As ProdManagerVM) As Boolean
' m_refProdManagerVM = ProdManagerVM
' Return Not IsNothing(m_refProdManagerVM)
'End Function
'Friend Function SetRefProjectVM(ProjectVM As ProjectVM) As Boolean
' m_refProjectVM = ProjectVM
' Return Not IsNothing(m_refProjectVM)
'End Function
'Friend Function SetRefMainMenuVM(MainMenuVM As MainMenuVM) As Boolean
' m_refMainMenuVM = MainMenuVM
' Return Not IsNothing(m_refMainMenuVM)
'End Function
Public Function SetRefSceneHostVM(SceneHostVM As SceneHostVM) As Boolean
LibMap.SetRefSceneHostVM(SceneHostVM)
Return Not IsNothing(LibMap.refSceneHostVM)
End Function
'Friend Function SetRefShowPanelVM(ShowPanelVM As ShowPanelVM) As Boolean
' LibMap.SetRefShowPanelVM(ShowPanelVM)
' Return Not IsNothing(LibMap.refShowPanelVM)
'End Function
Public Function SetRefMachinePanelVM(MachinePanelVM As MachinePanelVM) As Boolean
m_refMachinePanelVM = MachinePanelVM
Return Not IsNothing(m_refMachinePanelVM)
End Function
'Friend Function SetRefLeftPanelVM(LeftPanelVM As LeftPanelVM) As Boolean
' m_refLeftPanelVM = LeftPanelVM
' Return Not IsNothing(m_refLeftPanelVM)
'End Function
Public Function SetRefMachGroupPanelVM(MachGroupPanelVM As MyMachGroupPanelVM) As Boolean
m_refMyMachGroupPanelVM = MachGroupPanelVM
Return Not IsNothing(m_refMyMachGroupPanelVM)
End Function
'Friend Function SetRefBottomPanelVM(BottomPanelVM As BottomPanelVM) As Boolean
' m_refBottomPanelVM = BottomPanelVM
' Return Not IsNothing(m_refBottomPanelVM)
'End Function
'Friend Function SetRefShowBeamPanelVM(ShowBeamPanelVM As ShowBeamPanelVM) As Boolean
' m_refShowBeamPanelVM = ShowBeamPanelVM
' Return Not IsNothing(m_refShowBeamPanelVM)
'End Function
'Friend Function SetRefConfigurationPageVM(ConfigurationPageVM As ConfigurationPageVM) As Boolean
' m_refConfigurationPageVM = ConfigurationPageVM
' Return Not IsNothing(m_refConfigurationPageVM)
'End Function
'Friend Function SetRefRawPartListVM(RawPartListVM As RawPartListVM) As Boolean
' m_refRawPartListVM = RawPartListVM
' Return Not IsNothing(m_refRawPartListVM)
'End Function
'Friend Function SetRefPartInRawPartListVM(PartInRawPartListVM As PartInRawPartListVM) As Boolean
' m_refPartInRawPartListVM = PartInRawPartListVM
' Return Not IsNothing(m_refPartInRawPartListVM)
'End Function
'Friend Function SetRefWarehouseWndVM(WarehouseWndVM As WarehouseWndVM) As Boolean
' m_refWarehouseWndVM = WarehouseWndVM
' Return Not IsNothing(m_refWarehouseWndVM)
'End Function
'Friend Function SetRefFeatureListVM(FeatureListVM As FeatureListVM) As Boolean
' m_refFeatureListVM = FeatureListVM
' Return Not IsNothing(m_refFeatureListVM)
'End Function
'Friend Function SetRefFreeContourManagerVM(FreeContourManagerVM As FreeContourManagerVM) As Boolean
' m_refFreeContourManagerVM = FreeContourManagerVM
' Return Not IsNothing(m_refFreeContourManagerVM)
'End Function
'Friend Function SetRefFreeContourInputVM(FreeContourInputVM As FreeContourInputVM) As Boolean
' m_refFreeContourInputVM = FreeContourInputVM
' Return Not IsNothing(m_refFreeContourInputVM)
'End Function
'Friend Function SetRefPartManagerVM(PartManagerVM As PartManagerVM) As Boolean
' m_refPartManagerVM = PartManagerVM
' Return Not IsNothing(m_refPartManagerVM)
'End Function
'Friend Function SetRefInstrumentPanelVM(InstrumentPanelVM As InstrumentPanelVM) As Boolean
' m_refInstrumentPanelVM = InstrumentPanelVM
' Return Not IsNothing(m_refInstrumentPanelVM)
'End Function
'Friend Function SetRefTopPanelVM(TopPanelVM As TopPanelVM) As Boolean
' m_refTopPanelVM = TopPanelVM
' Return Not IsNothing(m_refTopPanelVM)
'End Function
'Friend Function SetRefOptimizePanelVM(OptimizePanelVM As OptimizePanelVM) As Boolean
' m_refOptimizePanelVM = OptimizePanelVM
' Return Not IsNothing(m_refOptimizePanelVM)
'End Function
'Friend Function SetRefOpenProjectFileDialogVM(OpenProjectFileDialogVM As OpenProjectFileDialogVM) As Boolean
' m_refOpenProjectFileDialogVM = OpenProjectFileDialogVM
' Return Not IsNothing(m_refOpenProjectFileDialogVM)
'End Function
#End Region ' Set
#Region "Init"
'Friend Function BeginInit(MainWindowVM As MainWindowVM) As Boolean
' m_refMainWindowVM = MainWindowVM
' Return Not IsNothing(m_refMainWindowVM)
'End Function
Friend Function EndInit() As Boolean
'Return Not IsNothing(m_refMainWindowVM) AndAlso Not IsNothing(m_refMainMenuVM) AndAlso
' Not IsNothing(LibMap.refStatusBarVM) AndAlso Not IsNothing(m_refProjManagerVM) AndAlso
' Not IsNothing(m_refProdManagerVM) AndAlso Not IsNothing(m_refConfigurationPageVM) AndAlso
' Not IsNothing(LibMap.refSceneHostVM) AndAlso Not IsNothing(LibMap.refShowPanelVM) AndAlso
' Not IsNothing(m_refMachinePanelVM) AndAlso Not IsNothing(LibMap.refMachGroupPanelVM) AndAlso
' Not IsNothing(m_refRawPartListVM) AndAlso Not IsNothing(m_refWarehouseWndVM) AndAlso
' Not IsNothing(m_refFeatureListVM) AndAlso Not IsNothing(m_refPartInRawPartListVM) AndAlso
' Not IsNothing(m_refFreeContourManagerVM) AndAlso Not IsNothing(m_refFreeContourInputVM) AndAlso
' Not IsNothing(m_refInstrumentPanelVM) AndAlso Not IsNothing(m_refTopPanelVM) AndAlso
' Not IsNothing(m_refPartManagerVM) AndAlso Not IsNothing(m_refOptimizePanelVM) AndAlso
' Not IsNothing(m_refShowBeamPanelVM) AndAlso Not IsNothing(m_refOpenProjectFileDialogVM) AndAlso
' LibMap.EndInit()
Return Not IsNothing(m_refMachinePanelVM) AndAlso Not IsNothing(LibMap.refMachGroupPanelVM)
End Function
#End Region ' Init
End Module
@@ -0,0 +1,62 @@
Imports System.Windows
Imports System.Windows.Controls
Imports EgtWPFLib5
Imports EgtUILib
Imports System.Collections.ObjectModel
Public Module DimensionsIniFile
Public m_sDimensionsIniFile As String
Public Sub ReadGridDimensions(GridName As String, ByRef GridDimsList As ObservableCollection(Of GridDimension))
GridDimsList = New ObservableCollection(Of GridDimension)
Dim Index As Integer = 0
Dim sValue = String.Empty
While GetPrivateProfileString(GridName, Index, String.Empty, sValue, m_sDimensionsIniFile) > 0
Dim sValueParams() As String = sValue.Split(","c)
' verifico numero minimo di parametri
If sValueParams.Count >= 4 Then
' cancello spazi
For I = 0 To sValueParams.Count - 1
sValueParams(I) = sValueParams(I).Trim()
Next
' creo valore
Dim nDimIndex As Integer
Dim nDimType As DimensionType
Dim GridLenValue As Double
Dim GridLenType As GridUnitType
Integer.TryParse(sValueParams(0), nDimIndex)
Integer.TryParse(sValueParams(1), nDimType)
StringToDoubleAdv(sValueParams(2), GridLenValue)
Integer.TryParse(sValueParams(3), GridLenType)
GridDimsList.Add(New GridDimension(GridName, nDimIndex, nDimType, New GridLength(GridLenValue, GridLenType)))
End If
Index += 1
End While
For Each GridDimsItem In GridDimsList
GridDimsItem.GridDimensions = GridDimsList
Next
End Sub
' funzione per calcolare e scrivere la stringa dei valori delle righe/colonne della Grid nell'INI
Public Function SaveGridDimensions(GridName As String, GridDims As ObservableCollection(Of GridDimension)) As Boolean
Dim bOk As Boolean
Dim Index = 0
Dim sValue = String.Empty
For Each GridDimsItem In GridDims
sValue = GridDimsItem.Index & "," & GridDimsItem.DimType & "," & DoubleToString(GridDimsItem.GridLen.Value, 6) & "," & GridDimsItem.GridLen.GridUnitType
bOk = WritePrivateProfileDimension(GridName, Index, sValue)
Index += 1
Next
Return bOk
End Function
Public Function WritePrivateProfileDimension(GridName As String, Index As String, sValue As String) As Boolean
Return WritePrivateProfileString(GridName, Index, sValue, m_sDimensionsIniFile)
End Function
Private Function GetGridLengthFromIndexAndType(GridDimsList As List(Of GridDimension), Index As Integer, DimType As DimensionType) As GridDimension
Return GridDimsList.FirstOrDefault(Function(x) x.Index = Index And x.DimType = DimType)
End Function
End Module
@@ -0,0 +1,16 @@
Imports EgtUILib
Public Class DisableModifiedMgr
Private m_bOldEnMod As Boolean
Sub New()
m_bOldEnMod = EgtGetEnableModified()
If m_bOldEnMod Then EgtDisableModified()
End Sub
Public Sub ReEnable()
If m_bOldEnMod Then EgtEnableModified()
End Sub
End Class
+71
View File
@@ -0,0 +1,71 @@
Public Enum CalcStates As Integer
NOTCALCULATED = -1
OK = 0
INFO = 1
WARNING = 2
ERROR_ = 3
COLLISION = 4
End Enum
Public Enum EventType
ND = -1
Started = 0
Ended = 1
End Enum
Public Enum ItemState As Integer
ND = -1
Assigned = 0
Confirmed = 1
WIP = 2
Produced = 3
Scrapped = 4
End Enum
Public Enum LogSupportLevel
ND = -1
I = 0
E = 1
End Enum
Public Enum LogSupportTarget
ND = -1
Supervisor = 0
LoadProject = 1
End Enum
Public Enum StatusMapItemType
ND = -1
Prod = 0
MachGroup = 1
Part = 2
Comm = 3
End Enum
Public Enum StatusMapOpType
ND = -1
Startup = 0
PartStart = 1
PartEnd = 2
MachGroupAdd = 3
MachGroupMod = 4
MachGroupRem = 5
MachGroupNeedRedo = 6
MachGroupAssignedToSupervisor = 7
MachGroupRemovedFromSupervisor = 8
SupervisorStopRequest = 9
ViewOptimStoped = 10
SupervisorReleaseStop = 11
ResetPartStart = 12
ResetPartEnd = 13
SetPartScrapped = 14
ChangeProdInSupervisorRequest = 15
ChangeProdInProdRequest = 16
OpenPageInViewOptimRequest = 17
MachGroupValidationUpdate = 18
End Enum
Public Enum DimensionType
COLUMN = 0
ROW = 1
End Enum
+73
View File
@@ -0,0 +1,73 @@
Imports System.Collections.ObjectModel
Imports System.Windows
Imports System.Windows.Controls
Imports EgtWPFLib5
Public Class GridDimension
Inherits VMBase
Private Shared m_SoftwareModActive As Boolean = False
Private Property m_GridName As String
Public Property GridName As String
Get
Return m_GridName
End Get
Set(value As String)
m_GridName = value
End Set
End Property
Private Property m_Index As Integer
Public Property Index As Integer
Get
Return m_Index
End Get
Set(value As Integer)
m_Index = value
End Set
End Property
Private Property m_DimType As DimensionType
Public Property DimType As DimensionType
Get
Return m_DimType
End Get
Set(value As DimensionType)
m_DimType = value
End Set
End Property
Private Property m_GridLen As GridLength
Public Property GridLen As GridLength
Get
Return m_GridLen
End Get
Set(value As GridLength)
m_GridLen = value
If Not m_SoftwareModActive Then DimensionsIniFile.SaveGridDimensions(GridName, GridDimensions)
End Set
End Property
Private Property m_GridDimensions As ObservableCollection(Of GridDimension)
Public Property GridDimensions As ObservableCollection(Of GridDimension)
Get
Return m_GridDimensions
End Get
Set(value As ObservableCollection(Of GridDimension))
m_GridDimensions = value
End Set
End Property
Sub New(GridName As String, Index As Integer, DimType As DimensionType, GridLen As GridLength)
m_GridName = GridName
m_Index = Index
m_DimType = DimType
m_GridLen = GridLen
End Sub
Public Shared Sub SetSoftwareMod(bActive As Boolean)
m_SoftwareModActive = bActive
End Sub
End Class
+31
View File
@@ -0,0 +1,31 @@
Imports EgtUILib
Public Module LuaMsgManager
Public Function MessageFromLuaMsg(LuaMsg As String) As String
' verifico se inizia con $$
If Not String.IsNullOrWhiteSpace(LuaMsg) AndAlso LuaMsg.Length >= 2 AndAlso LuaMsg.Substring(0, 2) = "$$" Then
Dim sMsgArgs() As String = LuaMsg.Substring(2).Split(",")
Dim nMsg As Integer = -1
If sMsgArgs.Count > 1 AndAlso Integer.TryParse(sMsgArgs(0), nMsg) AndAlso nMsg > 0 Then
If sMsgArgs.Count > 1 Then
Dim sArgs() As String = sMsgArgs.Skip(1).ToArray()
Dim sMsg As String = String.Format(EgtMsg(65000 + nMsg), sArgs)
If Not String.IsNullOrWhiteSpace(sMsg) Then
Return sMsg
Else
Return EgtMsg(65000 + nMsg)
End If
Else
Return EgtMsg(65000 + nMsg)
End If
Else
Return LuaMsg
End If
Else
Return LuaMsg
End If
Return ""
End Function
End Module
+275
View File
@@ -0,0 +1,275 @@
Public Class MachLog
#Region "Private Fields"
Public Enum MachLogTypes
PART_STATUS = 1
MACHGROUP_STATUS = 2
MACHINE_MODE = 3
MACHINE_STATUS = 4
MACHINE_COMMAND = 5
READ_VAR = 6
WRITE_VAR = 7
ALARM = 8
OPERATOR_MSG = 9
PROGRAM_SEND = 10
End Enum
Private m_AlarmCode As String
Private m_AlarmDateTime As DateTime
Private m_AlarmMessage As String
Private m_AlarmOperation As Integer
Private m_AlarmType As Integer
Private m_CommandExecutedCorrectly As Boolean
Private m_CommandState As CommandStates
Private m_CommandType As LogCommandTypes
Private m_Description As String
Private m_newOpState As Integer
Private m_ResultType As ResultTypes
Private m_VarAddress As String
Private m_VarValue As String
' variabili del log macchina
Public ReadOnly Property EventType As MachLogTypes
Get
Return m_ResultType
End Get
End Property
Public ReadOnly Property EventDateTime As DateTime
Get
Return m_AlarmDateTime
End Get
End Property
Public ReadOnly Property EventValue As String
Get
Return m_VarValue
End Get
End Property
Public ReadOnly Property sEventType As String
Get
Select Case m_ResultType
Case MachLogTypes.PART_STATUS
Return String.Format("({0}) Stato pezzo", 1)
Case MachLogTypes.MACHGROUP_STATUS
Return String.Format("({0}) Stato barra", 2)
Case MachLogTypes.MACHINE_MODE = 3
Return String.Format("({0}) Modalità macchina", 3)
Case MachLogTypes.MACHINE_STATUS = 4
Return String.Format("({0}) Stato macchina", 4)
Case MachLogTypes.MACHINE_COMMAND = 5
Return String.Format("({0}) Comando macchina", 5)
Case MachLogTypes.READ_VAR = 6
Return String.Format("({0}) Lettura variabile", 6)
Case MachLogTypes.WRITE_VAR = 7
Return String.Format("({0}) Scrittura variabile", 7)
Case MachLogTypes.ALARM = 8
Return String.Format("({0}) Allarme", 8)
Case MachLogTypes.OPERATOR_MSG = 9
Return String.Format("({0}) Messaggio opertore", 9)
Case MachLogTypes.PROGRAM_SEND = 10
Return String.Format("({0}) Invio programma", 10)
Case Else
Return "Altro"
End Select
End Get
End Property
Public ReadOnly Property sEventDateTime As String
Get
Return m_AlarmDateTime
End Get
End Property
Public ReadOnly Property sEventValue As String
Get
Return m_VarValue
End Get
End Property
Public ReadOnly Property sPROD As String
Get
Return m_VarValue
End Get
End Property
#End Region
#Region "Protected Constructors"
Protected Sub New()
m_AlarmCode = ""
m_AlarmDateTime = DateTime.MinValue
m_AlarmMessage = ""
m_AlarmOperation = 0
m_AlarmType = 0
m_CommandExecutedCorrectly = False
m_CommandState = CommandStates.NULL
m_CommandType = LogCommandTypes.NULL
m_Description = ""
m_newOpState = 0
m_ResultType = ResultTypes.NULL
m_VarAddress = ""
m_VarValue = ""
End Sub
#End Region
#Region "Public Properties"
Public ReadOnly Property AlarmCode As String
Get
Return m_AlarmCode
End Get
End Property
Public ReadOnly Property AlarmDateTime As Date
Get
Return m_AlarmDateTime
End Get
End Property
Public ReadOnly Property AlarmMessage As String
Get
Return m_AlarmMessage
End Get
End Property
Public ReadOnly Property AlarmOperation As Integer
Get
Return m_AlarmOperation
End Get
End Property
Public ReadOnly Property AlarmType As Integer
Get
Return m_AlarmType
End Get
End Property
Public ReadOnly Property CommandExecutedCorrectly As Boolean
Get
Return m_CommandExecutedCorrectly
End Get
End Property
Public ReadOnly Property CommandState As CommandStates
Get
Return m_CommandState
End Get
End Property
Public ReadOnly Property CommandType As LogCommandTypes
Get
Return m_CommandType
End Get
End Property
Public ReadOnly Property Description As String
Get
Return m_Description
End Get
End Property
Public ReadOnly Property newOpState As Integer
Get
Return m_newOpState
End Get
End Property
Public ReadOnly Property ResultType As ResultTypes
Get
Return m_ResultType
End Get
End Property
Public ReadOnly Property VarAddress As String
Get
Return m_VarAddress
End Get
End Property
Public ReadOnly Property VarValue As String
Get
Return m_VarValue
End Get
End Property
#End Region
#Region "Internal Methods"
Public Shared Function CreateAlarmLog(AlarmOperation As Integer, AlarmType As Integer, AlarmMessage As String, AlarmCode As String, AlarmDateTime As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = LogCommandTypes.ALARM
NewMachLog.m_AlarmOperation = AlarmOperation
NewMachLog.m_AlarmType = AlarmType
NewMachLog.m_AlarmMessage = AlarmMessage
NewMachLog.m_AlarmCode = AlarmCode
DateTime.TryParse(AlarmDateTime, NewMachLog.m_AlarmDateTime)
Return NewMachLog
End Function
Public Shared Function CreateOPStateLog(newOpState As Integer)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = LogCommandTypes.NEWOP
NewMachLog.m_newOpState = newOpState
NewMachLog.m_AlarmDateTime = DateTime.Now()
Return NewMachLog
End Function
Public Shared Function CreateReadLog(CommandExecutedCorrectly As Boolean, VarAddress As String, VarValue As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = CommandTypes.READ_TPA
NewMachLog.m_CommandExecutedCorrectly = CommandExecutedCorrectly
NewMachLog.m_VarAddress = VarAddress
NewMachLog.m_VarValue = VarValue
NewMachLog.m_AlarmDateTime = DateTime.Now()
Return NewMachLog
End Function
Public Shared Function CreateResultLog(CommandType As LogCommandTypes, CommandState As CommandStates, ResultType As ResultTypes, Description As String)
Dim NewMachLog As New MachLog
NewMachLog.m_CommandType = CommandType
NewMachLog.m_CommandState = CommandState
NewMachLog.m_ResultType = ResultType
NewMachLog.m_Description = Description
NewMachLog.m_AlarmDateTime = DateTime.Now()
Return NewMachLog
End Function
Public Shared Function CreateMachLog(EventType As MachLogTypes, EventDateTime As DateTime, Value As String, SupervisorID As String)
Dim NewMachEvent As New MachLog
NewMachEvent.m_ResultType = EventType
NewMachEvent.m_AlarmDateTime = EventDateTime
NewMachEvent.m_VarValue = Value
NewMachEvent.m_VarAddress = SupervisorID
Return NewMachEvent
End Function
#End Region
#Region "Public Methods"
Public Shared Function CreateMachLog(AlarmCode As String, AlarmDateTime As Date, AlarmMessage As String, AlarmOperation As Integer, AlarmType As Integer, CommandExecutedCorrectly As Boolean, CommandState As CommandStates, CommandType As LogCommandTypes, Description As String, newOpState As Integer, ResultType As ResultTypes, VarAddress As String, VarValue As String) As MachLog
Dim NewMachLog As New MachLog
NewMachLog.m_AlarmCode = AlarmCode
NewMachLog.m_AlarmDateTime = AlarmDateTime
NewMachLog.m_AlarmMessage = AlarmMessage
NewMachLog.m_AlarmOperation = AlarmOperation
NewMachLog.m_AlarmType = AlarmType
NewMachLog.m_CommandExecutedCorrectly = CommandExecutedCorrectly
NewMachLog.m_CommandState = CommandState
NewMachLog.m_CommandType = CommandType
NewMachLog.m_Description = Description
NewMachLog.m_newOpState = newOpState
NewMachLog.m_ResultType = ResultType
NewMachLog.m_VarAddress = VarAddress
NewMachLog.m_VarValue = VarValue
Return NewMachLog
End Function
#End Region
End Class
+81
View File
@@ -0,0 +1,81 @@
Imports EgtUILib
Public Module ManageView
' Tipo di progetto aperto
Private m_Type As BWType
' Per macchine pareti:
' Posizione vista
Private m_nViewDir As VT
Public Function BWSetView(nView As VT, Optional bRedraw As Boolean = True)
' condizioni che cambiano la vista del progetto
Select Case m_Type
Case BWType.BEAM
EgtSetView(VT.ISO_SW, bRedraw)
Case BWType.WALL
Select Case nView
Case VT.TOP
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(0, -90, bRedraw) ' equivalente a vista TOP
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(0, 90, bRedraw) ' equivalente a vista TOP ruotata di 180 su Z
End Select
Case VT.FRONT
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(90, -90, bRedraw) ' equivalente a vista FRONT
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(90, 90, bRedraw) ' equivalente a vista FRONT ruotata di 180 su Z
End Select
Case VT.BACK
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(-90, -90, bRedraw) ' equivalente a vista BACK
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(-90, 90, bRedraw) ' equivalente a vista BACK ruotata di 180 su Z
End Select
Case VT.RIGHT
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista RIGHT
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista RIGHT ruotata di 180 su Z
End Select
Case VT.LEFT
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista RIGHT
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista RIGHT ruotata di 180 su Z
End Select
Case VT.ISO_SW
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
End Select
Case Else ' VT.ISO_SW
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
End Select
End Select
End Select
End Function
Public Sub UpdateMachParam(ViewDir As Integer)
m_nViewDir = ViewDir
End Sub
Public Sub UpdateBWType(Type As BWType)
m_Type = Type
End Sub
End Module
+57
View File
@@ -0,0 +1,57 @@
Imports System.Runtime.InteropServices
Public Module ManageWindow
<DllImport("user32.dll")>
Public Function FindWindow(ByVal className As String, ByVal windowTitle As String) As IntPtr
End Function
<DllImport("user32.dll")>
Private Function ShowWindow(ByVal hWnd As IntPtr, ByVal flags As ShowWindowEnum) As Boolean
End Function
<DllImport("user32.dll")>
Private Function SetForegroundWindow(ByVal hwnd As IntPtr) As Integer
End Function
<DllImport("user32.dll")>
Private Function GetWindowPlacement(ByVal hWnd As IntPtr, ByRef lpwndpl As Windowplacement) As Boolean
End Function
Private Enum ShowWindowEnum
Hide = 0
ShowNormal = 1
ShowMinimized = 2
ShowMaximized = 3
Maximize = 3
ShowNormalNoActivate = 4
Show = 5
Minimize = 6
ShowMinNoActivate = 7
ShowNoActivate = 8
Restore = 9
ShowDefault = 10
ForceMinimized = 11
End Enum
Private Structure Windowplacement
Public length As Integer
Public flags As Integer
Public showCmd As Integer
Public ptMinPosition As System.Drawing.Point
Public ptMaxPosition As System.Drawing.Point
Public rcNormalPosition As System.Drawing.Rectangle
End Structure
Public Sub BringWindowToFront(wdwIntPtr As IntPtr)
'Dim wdwIntPtr As IntPtr = FindWindow(Nothing, "0016 - EgtBEAMWALL")
Dim placement As Windowplacement = New Windowplacement()
GetWindowPlacement(wdwIntPtr, placement)
' se minimizzata
If placement.showCmd = 2 Then
' riporto in vista non minimizzata
ShowWindow(wdwIntPtr, ShowWindowEnum.Restore)
End If
' porto avanti la finestra rendendola quella attiva
SetForegroundWindow(wdwIntPtr)
End Sub
End Module
+48
View File
@@ -0,0 +1,48 @@
Imports System.IO
Imports EgtWPFLib5
Public Class MyMachine
Inherits Machine
Private m_nType As MachineType
Public ReadOnly Property nType As MachineType
Get
Return m_nType
End Get
End Property
Sub New(sDirPath As String, sIniPath As String)
MyBase.New(sDirPath, sIniPath)
' verifico esistenza cartella Beam e Wall per assegnare tipo
If Directory.Exists(sDirPath & "/Beam") AndAlso Directory.Exists(sDirPath & "/Wall") Then
m_nType = MachineType.BOTH
ElseIf Directory.Exists(sDirPath & "/Beam") Then
m_nType = MachineType.BEAM
ElseIf Directory.Exists(sDirPath & "/Wall") Then
m_nType = MachineType.WALL
Else
m_nType = MachineType.NULL
End If
End Sub
Public Shared Shadows Function MachineListInit(sMachinesRootDir As String, MachineList As IList(Of Machine)) As Boolean
' Se direttorio base macchine non definito o non esiste, ritorno
If String.IsNullOrWhiteSpace(sMachinesRootDir) OrElse
Not Directory.Exists(sMachinesRootDir) Then
MachineList = Nothing
Return False
End If
' Cerco le macchine
Dim Machines As String() = Directory.GetDirectories(sMachinesRootDir)
For i As Integer = 0 To Machines.Count - 1
Dim PathIni As String = Machines(i) & "\" & Path.GetFileName(Machines(i)) & ".ini"
Dim PathBeam As String = Machines(i) & "\" & "Beam"
Dim PathWall As String = Machines(i) & "\" & "Wall"
If File.Exists(PathIni) AndAlso (Directory.Exists(PathBeam) OrElse Directory.Exists(PathWall)) Then
MachineList.Add(New MyMachine(Machines(i), PathIni))
End If
Next
Return True
End Function
End Class
@@ -5,8 +5,13 @@ Imports EgtWPFLib5
Public Class SectionXMaterial
Inherits VMBase
Private Shared m_nType As MachineType
Public Shared Sub SetType(nType As MachineType)
Private Shared m_nType As BWType
Public Shared ReadOnly Property nType As BWType
Get
Return m_nType
End Get
End Property
Public Shared Sub SetType(nType As BWType)
m_nType = nType
End Sub
@@ -77,25 +82,28 @@ Public Class SectionXMaterial
End Property
Shared Operator =(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
Return (S1.m_dH = S2.m_dH AndAlso S1.m_dW = S2.m_dW AndAlso S1.m_dL = S2.m_dL AndAlso S1.m_Material.Any(Function(x) S2.m_Material.Any(Function(y) y = x)))
Return (Math.Abs( S1.m_dH - S2.m_dH) < 100 * EPS_SMALL AndAlso
Math.Abs( S1.m_dW - S2.m_dW) < 100 * EPS_SMALL AndAlso
Math.Abs( S1.m_dL - S2.m_dL) < 100 * EPS_SMALL AndAlso
S1.m_Material.Any(Function(x) S2.m_Material.Any(Function(y) y = x)))
End Operator
Shared Operator <>(ByVal S1 As SectionXMaterial, ByVal S2 As SectionXMaterial) As Boolean
Return (S1.m_dH <> S2.m_dH OrElse S1.m_dW <> S2.m_dW OrElse S1.m_dL <> S2.m_dL) OrElse Not S1.m_Material.Any(Function(x) S2.m_Material.Any(Function(y) y = x))
Return Not S1 = S2
End Operator
Public Overrides Function Equals(ByVal obj As Object) As Boolean
If TypeOf obj Is SectionXMaterial Then
Return (m_dH = obj.dH AndAlso m_dW = obj.dW AndAlso m_dL = obj.dL AndAlso m_Material.Any(Function(x) DirectCast(obj.sMaterial, List(Of String)).Any(Function(y) y = x)))
Return Me = DirectCast(obj, SectionXMaterial) '(m_dH = obj.dH AndAlso m_dW = obj.dW AndAlso m_dL = obj.dL AndAlso m_Material.Any(Function(x) DirectCast(obj.sMaterial, List(Of String)).Any(Function(y) y = x)))
End If
Return False
End Function
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String)
If m_nType = MachineType.BEAM Then
If m_nType = BWType.BEAM Then
m_dW = dW
m_dH = dH
ElseIf m_nType = MachineType.WALL Then
ElseIf m_nType = BWType.WALL Then
m_dH = dH
Else
m_dW = dW
@@ -133,6 +141,16 @@ Public Class SectionXMaterial
End Set
End Property
Private m_nQuantity As Integer
Public Property nQuantity As Integer
Get
Return m_nQuantity
End Get
Set(value As Integer)
m_nQuantity = value
End Set
End Property
Private m_Alias_IsEnabled As Boolean
Public Property Alias_IsEnabled As Boolean
Get
@@ -144,65 +162,12 @@ Public Class SectionXMaterial
End Property
Private m_Alias_IsChecked As Boolean
Public Property Alias_IsChecked As Boolean
Public Overridable Property Alias_IsChecked As Boolean
Get
Return m_Alias_IsChecked
End Get
Set(value As Boolean)
m_Alias_IsChecked = value
If value Then
NewBeam_Visibility = Visibility.Collapsed
NewWall_Visibility = Visibility.Collapsed
Alias_Visibility = Visibility.Visible
Else
If m_nType = MachineType.BEAM Then
NewBeam_Visibility = Visibility.Visible
NewWall_Visibility = Visibility.Collapsed
Else
NewBeam_Visibility = Visibility.Collapsed
NewWall_Visibility = Visibility.Visible
End If
Alias_Visibility = Visibility.Collapsed
End If
End Set
End Property
Private m_NewBeam_Visibility As Visibility
Public Property NewBeam_Visibility As Visibility
Get
Return m_NewBeam_Visibility
End Get
Set(value As Visibility)
If value <> m_NewBeam_Visibility Then
m_NewBeam_Visibility = value
NotifyPropertyChanged("NewBeam_Visibility")
End If
End Set
End Property
Private m_NewWall_Visibility As Visibility
Public Property NewWall_Visibility As Visibility
Get
Return m_NewWall_Visibility
End Get
Set(value As Visibility)
If value <> m_NewWall_Visibility Then
m_NewWall_Visibility = value
NotifyPropertyChanged("NewWall_Visibility")
End If
End Set
End Property
Private m_Alias_Visibility As Visibility
Public Property Alias_Visibility As Visibility
Get
Return m_Alias_Visibility
End Get
Set(value As Visibility)
If value <> m_Alias_Visibility Then
m_Alias_Visibility = value
NotifyPropertyChanged("Alias_Visibility")
End If
End Set
End Property
@@ -224,6 +189,31 @@ Public Class SectionXMaterial
End Get
End Property
Public ReadOnly Property Quantity_Msg As String
Get
Return EgtMsg(61774)
End Get
End Property
Sub New(dW As Double, dH As Double, dL As Double, sMaterial As String, nQuantity As Integer)
If m_nType = BWType.BEAM Then
m_dW = dW
m_dH = dH
ElseIf m_nType = BWType.WALL Then
m_dH = dH
Else
m_dW = dW
m_dH = dH
m_dL = dL
End If
m_Material = New List(Of String)
Dim sMaterialArray() As String = Split(sMaterial, ";")
For Each sMatItem In sMaterialArray
m_Material.Add(sMatItem)
Next
m_nQuantity = nQuantity
End Sub
#End Region ' Import BTL <-> Warehouse
End Class
-12
View File
@@ -1,12 +0,0 @@
Imports System.ComponentModel
Public Class VMBase
Implements INotifyPropertyChanged
Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged
Public Sub NotifyPropertyChanged(propName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
End Sub
End Class
@@ -0,0 +1,44 @@
<EgtFloating:EgtFloatingPanel x:Class="ViewPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
<Button ToolTip="{Binding ZoomAllToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding ZoomAllCommand}">
<Image Source="/Resources/ViewPanel/ZoomAll.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromTopToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding TopViewCommand}">
<Image Source="/Resources/ViewPanel/LookFromTOP.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromFrontToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding FrontViewCommand}">
<Image Source="/Resources/ViewPanel/LookFromFRONT.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromRightToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding RightViewCommand}">
<Image Source="/Resources/ViewPanel/LookFromRIGHT.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromBackToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding BackViewCommand}">
<Image Source="/Resources/ViewPanel/LookFromBACK.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromLeftToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding LeftViewCommand}">
<Image Source="/Resources/ViewPanel/LookFromLEFT.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding LookFromIso_SWToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding IsoViewSWCommand}">
<Image Source="/Resources/ViewPanel/LookFromISO_SW.png" Stretch="Uniform"/>
</Button>
</EgtFloating:EgtFloatingPanel>
@@ -0,0 +1,3 @@
Public Class ViewPanelV
End Class
+265
View File
@@ -0,0 +1,265 @@
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtUILib
Public Class ViewPanelVM
Inherits EgtWPFLib5.ViewPanelVM
' Tipo di progetto aperto
Private Shared m_Type As BWType
Public Shared ReadOnly Property Type As BWType
Get
Return m_Type
End Get
End Property
' Posizione vista
Private Shared m_nViewDir As VT = VT.ISO_SW
Public Shared Sub BWSetView(nView As VT, Optional bRedraw As Boolean = True)
' condizioni che cambiano la vista del progetto
'Select Case m_Type
' Case BWType.BEAM
' Select Case nView
' Case VT.TOP
' EgtSetView(VT.TOP, bRedraw)
' Case VT.FRONT
' EgtSetView(VT.FRONT, bRedraw)
' Case VT.BACK
' EgtSetView(VT.BACK, bRedraw)
' Case VT.RIGHT
' EgtSetView(VT.RIGHT, bRedraw)
' Case VT.LEFT
' EgtSetView(VT.LEFT, bRedraw)
' Case VT.ISO_SW
' EgtSetView(VT.ISO_SW, bRedraw)
' Case Else ' VT.ISO_SW
' EgtSetView(VT.ISO_SW, bRedraw)
' End Select
' Case BWType.WALL
Select Case nView
Case VT.TOP
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(0, -90, bRedraw) ' equivalente a vista TOP
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(0, 90, bRedraw) ' equivalente a vista TOP ruotata di 180 su Z
End Select
Case VT.FRONT
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(90, -90, bRedraw) ' equivalente a vista FRONT
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(90, 90, bRedraw) ' equivalente a vista FRONT ruotata di 180 su Z
End Select
Case VT.BACK
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(-90, -90, bRedraw) ' equivalente a vista BACK
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(-90, 90, bRedraw) ' equivalente a vista BACK ruotata di 180 su Z
End Select
Case VT.RIGHT
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista RIGHT
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista RIGHT ruotata di 180 su Z
End Select
Case VT.LEFT
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista LEFT
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista LEFT ruotata di 180 su Z
End Select
Case VT.ISO_SW
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
End Select
Case Else ' VT.ISO_SW
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
End Select
End Select
'End Select
End Sub
Public Shared Sub UpdateMachParam(ViewDir As VT)
m_nViewDir = ViewDir
End Sub
Public Shared Sub UpdateBWType(Type As BWType)
m_Type = Type
End Sub
#Region "COMMANDS"
#Region "TopViewCommand"
''' <summary>
''' Execute the TopView. This method is invoked by the TopViewCommand.
''' </summary>
Public Overrides Sub TopView(ByVal param As Object)
ViewPanelVM.BWSetView(VT.TOP, True)
End Sub
#End Region ' TopViewCommand
#Region "FrontViewCommand"
''' <summary>
''' Execute the FrontView. This method is invoked by the FrontViewCommand.
''' </summary>
Public Overrides Sub FrontView(ByVal param As Object)
ViewPanelVM.BWSetView(VT.FRONT, True)
End Sub
#End Region ' FrontViewCommand
#Region "LeftViewCommand"
''' <summary>
''' Execute the LeftView. This method is invoked by the LeftViewCommand.
''' </summary>
Public Overrides Sub LeftView(ByVal param As Object)
ViewPanelVM.BWSetView(VT.LEFT, True)
End Sub
#End Region ' LeftViewCommand
#Region "BackViewCommand"
''' <summary>
''' Execute the BackView. This method is invoked by the BackViewCommand.
''' </summary>
Public Overrides Sub BackView(ByVal param As Object)
ViewPanelVM.BWSetView(VT.BACK, True)
End Sub
#End Region ' BackViewCommand
#Region "RightViewCommand"
''' <summary>
''' Execute the RightView. This method is invoked by the RightViewCommand.
''' </summary>
Public Overrides Sub RightView(ByVal param As Object)
ViewPanelVM.BWSetView(VT.RIGHT, True)
End Sub
#End Region ' RightViewCommand
'#Region "IsoViewSECommand"
' ''' <summary>
' ''' Returns a command that do IsoViewSE.
' ''' </summary>
' Public ReadOnly Property IsoViewSECommand As ICommand
' Get
' If m_cmdIsoViewSE Is Nothing Then
' m_cmdIsoViewSE = New Command(AddressOf IsoViewSE)
' End If
' Return m_cmdIsoViewSE
' End Get
' End Property
' ''' <summary>
' ''' Execute the IsoViewSE. This method is invoked by the IsoViewSECommand.
' ''' </summary>
' Public Sub IsoViewSE(ByVal param As Object)
' LibMap.refSceneHostVM.MainScene.IsoViewSE()
' End Sub
'#End Region ' IsoViewSECommand
#Region "IsoViewSWCommand"
''' <summary>
''' Execute the IsoViewSW. This method is invoked by the IsoViewSWCommand.
''' </summary>
Public Overrides Sub IsoViewSW(ByVal param As Object)
ViewPanelVM.BWSetView(VT.ISO_SW, True)
End Sub
#End Region ' IsoViewSWCommand
'#Region "IsoViewNECommand"
' ''' <summary>
' ''' Returns a command that do IsoViewNE.
' ''' </summary>
' Public ReadOnly Property IsoViewNECommand As ICommand
' Get
' If m_cmdIsoViewNE Is Nothing Then
' m_cmdIsoViewNE = New Command(AddressOf IsoViewNE)
' End If
' Return m_cmdIsoViewNE
' End Get
' End Property
' ''' <summary>
' ''' Execute the IsoViewNE. This method is invoked by the IsoViewNECommand.
' ''' </summary>
' Public Sub IsoViewNE(ByVal param As Object)
' LibMap.refSceneHostVM.MainScene.IsoViewNE()
' End Sub
'#End Region ' IsoViewNECommand
'#Region "IsoViewNWCommand"
' ''' <summary>
' ''' Returns a command that do IsoViewNW.
' ''' </summary>
' Public ReadOnly Property IsoViewNWCommand As ICommand
' Get
' If m_cmdIsoViewNW Is Nothing Then
' m_cmdIsoViewNW = New Command(AddressOf IsoViewNW)
' End If
' Return m_cmdIsoViewNW
' End Get
' End Property
' ''' <summary>
' ''' Execute the IsoViewNW. This method is invoked by the IsoViewNWCommand.
' ''' </summary>
' Public Sub IsoViewNW(ByVal param As Object)
' LibMap.refSceneHostVM.MainScene.IsoViewNW()
' End Sub
'#End Region ' IsoViewNWCommand
'#Region "ViewToCPlaneCommand"
' ''' <summary>
' ''' Returns a command that do GetDist.
' ''' </summary>
' Public ReadOnly Property ViewToCPlaneCommand As ICommand
' Get
' If m_cmdViewToCPlane Is Nothing Then
' m_cmdViewToCPlane = New Command(AddressOf ViewToCPlane)
' End If
' Return m_cmdViewToCPlane
' End Get
' End Property
' ''' <summary>
' ''' Execute the GetDist. This method is invoked by the GetDistCommand.
' ''' </summary>
' Public Sub ViewToCPlane(ByVal param As Object)
' LibMap.refSceneHostVM.MainScene.CPlaneView()
' End Sub
'#End Region ' ViewToCPlaneCommand
#End Region ' COMMANDS
End Class
-47
View File
@@ -1,47 +0,0 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class Wall
Inherits Part
Protected m_dPOSY As Double
Public Property dPOSY As Double
Get
Return m_dPOSY
End Get
Set(value As Double)
m_dPOSY = value
End Set
End Property
Protected m_dROT As Double
Public Property dROT As Double
Get
Return m_dROT
End Get
Set(value As Double)
m_dROT = value
End Set
End Property
Protected m_dFLIP As Double
Public Property dFLIP As Double
Get
Return m_dFLIP
End Get
Set(value As Double)
m_dFLIP = value
End Set
End Property
#Region "CONSTRUCTOR"
Sub New(nParentMachGroup As MyMachGroup, nPartId As Integer)
MyBase.New(nParentMachGroup, nPartId)
End Sub
#End Region ' CONSTRUCTOR
End Class
-45
View File
@@ -1,45 +0,0 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class WallMachGroup
Inherits MyMachGroup
Protected m_nRawPartId As Integer = GDB_ID.NULL
Public ReadOnly Property nRawPartId As Integer
Get
Return m_nRawPartId
End Get
End Property
Sub New(nId As Integer, sName As String, sMachine As String)
MyBase.New(nId, sName, sMachine)
SetMachineType(MachineType.WALL)
m_nRawPartId = EgtGetFirstRawPart()
EgtGetInfo(nId, MGR_RPT_PANELLEN, dL)
EgtGetInfo(nId, MGR_RPT_PANELWIDTH, dW)
EgtGetInfo(nId, MGR_RPT_PANELHEIGHT, dH)
m_dTotMat = dL * dW
For Each Part In PartList
m_dMatForPart += (Part.dL * Part.dW)
Next
End Sub
Public Overrides Sub RefreshPartList()
m_nRawPartId = EgtGetFirstRawPart()
PartList.Clear()
Dim nPartId As Integer = EgtGetFirstPartInRawPart(m_nRawPartId)
While nPartId <> GDB_ID.NULL
PartList.Add(New Wall(Me, nPartId))
nPartId = EgtGetNextPartInRawPart(nPartId)
End While
End Sub
Public Overrides Sub RefreshGroupData()
EgtGetInfo(Id, MGR_RPT_PANELLEN, dL)
EgtGetInfo(Id, MGR_RPT_PANELWIDTH, dW)
EgtGetInfo(Id, MGR_RPT_PANELHEIGHT, dH)
End Sub
End Class
+99
View File
@@ -0,0 +1,99 @@
using EgtBEAMWALL.DataLayer.DatabaseModels;
using EgtBEAMWALL.DataLayer.Migrations;
using MySql.Data.EntityFramework;
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq;
using System.ServiceProcess;
namespace EgtBEAMWALL.DataLayer
{
[DbConfigurationType(typeof(MySqlEFConfiguration))]
public class AdminContext : DbContext
{
#region Public Constructors
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
public AdminContext() : base(DbConfig.ADMIN_CONNECTION_STRING)
{
}
public AdminContext(string connectionString) : base(connectionString)
{
}
#endregion Public Constructors
#region Public Properties
/// <summary>
/// User management
/// </summary>
public DbSet<UserPriv> UserList { get; set; }
#endregion Public Properties
#region Public Methods
public bool SetUpDbConnectionAndDbConfig()
{
try
{
String serviceName = getDbServiceName();
if (serviceName.Equals(""))
{
return false;
}
ServiceController service = new ServiceController(serviceName);
try
{
TimeSpan timeout = TimeSpan.FromSeconds(DbConfig.DATABASE_PROCESS_TIMEOUT);
service.WaitForStatus(ServiceControllerStatus.Running, timeout);
}
catch (Exception)
{
return false;
}
//Database.SetInitializer<DatabaseContext>(null);
Database.SetInitializer(new MigrateDatabaseToLatestVersion<DatabaseContext, Configuration>());
var migrator = new DbMigrator(new Configuration());
if (migrator.GetPendingMigrations().Any())
{
// Run migrations and seed.
migrator.Update();
}
}
catch (Exception exc)
{
Console.WriteLine(exc.ToString());
return false;
}
return true;
}
#endregion Public Methods
#region Private Methods
private static string getDbServiceName()
{
ServiceController[] services = ServiceController.GetServices();
var service = services.FirstOrDefault(s => s.ServiceName == "MariaDB");
if (service != null)
return service.DisplayName;
service = services.FirstOrDefault(s => s.ServiceName == "MySQL");
if (service != null)
return service.DisplayName;
return "";
}
#endregion Private Methods
}
}
+41 -31
View File
@@ -1,35 +1,45 @@
<?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.Entity.EF6, Version=6.10.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
<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-6.10.9.0" newVersion="6.10.9.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
</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-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>
</configuration>
-20
View File
@@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EgtBEAMWALL.DataLayer
{
public static class Constants
{
// Database config
public const string DATABASE_SERV = "127.0.0.1";
public const string DATABASE_NAME = "EgtBwDb";
public const string DATABASE_USER = "EgtUser";
public const string DATABASE_PWD = "viacremasca";
public static int DATABASE_PROCESS_TIMEOUT = 5;
public static string CONNECTION_STRING = $"server={DATABASE_SERV};port=3306;database={DATABASE_NAME};uid={DATABASE_USER};pwd={DATABASE_PWD};sslmode=None";
}
}
@@ -1,25 +1,17 @@
using System;
using EgtBEAMWALL.DataLayer.DatabaseModels;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EgtBEAMWALL.DataLayer.DatabaseModels;
namespace EgtBEAMWALL.DataLayer.Controllers
{
public class BTLPartController : IDisposable
{
#region Private Fields
private DatabaseContext dbCtx;
#endregion Private Fields
#region Public Constructors
public BTLPartController()
{
// Initialize database context
dbCtx = new DatabaseContext(Constants.CONNECTION_STRING);
}
#endregion Public Constructors
@@ -32,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)
@@ -43,9 +35,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
PDN = corePart.nPDN,
DO = corePart.bDO,
NAM = corePart.sNAM,
W = corePart.dW,
L = corePart.dL,
H = corePart.dH,
W = corePart.dBtlW,
L = corePart.dBtlL,
H = corePart.dBtlH,
Material = corePart.sMATERIAL,
CNT = corePart.nCNT,
//TBP = corePart.nTBP,
@@ -76,9 +68,9 @@ namespace EgtBEAMWALL.DataLayer.Controllers
PDN = corePart.nPDN,
DO = corePart.bDO,
NAM = corePart.sNAM,
W = corePart.dW,
L = corePart.dL,
H = corePart.dH,
W = corePart.dBtlW,
L = corePart.dBtlL,
H = corePart.dBtlH,
Material = corePart.sMATERIAL,
CNT = corePart.nCNT,
//TBP = corePart.nTBP,
@@ -105,14 +97,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
try
{
// Add to database
dbCtx.BTLPartList.AddRange(partData);
// Commit changes
dbCtx.SaveChanges();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// Add to database
localDbCtx.BTLPartList.AddRange(partData);
// Commit changes
localDbCtx.SaveChanges();
}
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on Create: {exc}");
string errMessage = $"EXCEPTION on BTLPart.Create: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
return partData;
}
@@ -146,14 +143,19 @@ namespace EgtBEAMWALL.DataLayer.Controllers
try
{
// Add to database
dbCtx.BTLPartList.AddRange(partData);
// Commit changes
dbCtx.SaveChanges();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// Add to database
localDbCtx.BTLPartList.AddRange(partData);
// Commit changes
localDbCtx.SaveChanges();
}
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on CreateBaseObj: {exc}");
string errMessage = $"EXCEPTION on BTLPart.CreateBaseObj: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
return partData;
@@ -167,21 +169,26 @@ namespace EgtBEAMWALL.DataLayer.Controllers
public bool Delete(int PartDbId)
{
bool done = false;
var item2del = dbCtx
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var item2del = localDbCtx
.BTLPartList
.Where(x => x.BTLPartDbId == PartDbId)
.SingleOrDefault();
try
{
// Add to database
dbCtx.BTLPartList.Remove(item2del);
// Commit changes
dbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on Delete: {exc}");
try
{
// Add to database
localDbCtx.BTLPartList.Remove(item2del);
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on BTLPart.Delete: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
@@ -194,28 +201,31 @@ namespace EgtBEAMWALL.DataLayer.Controllers
public bool DeleteByProject(int ProjDbId)
{
bool done = false;
var items2del = dbCtx
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var items2del = localDbCtx
.BTLPartList
.Where(x => x.ProjDbId == ProjDbId);
try
{
// Add to database
dbCtx.BTLPartList.RemoveRange(items2del);
// Commit changes
dbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on DeleteByProject: {exc}");
try
{
// Add to database
localDbCtx.BTLPartList.RemoveRange(items2del);
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on BTLPart.DeleteByProject: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
public void Dispose()
{
// Clear database context
dbCtx.Dispose();
}
/// <summary>
@@ -225,10 +235,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public BTLPartModel FindByDbId(int PartDbId)
{
return dbCtx
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
return localDbCtx
.BTLPartList
.Where(x => x.BTLPartDbId == PartDbId)
.SingleOrDefault();
}
}
/// <summary>
@@ -238,10 +251,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public BTLPartModel FindByPartId(int PartId)
{
return dbCtx
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
return localDbCtx
.BTLPartList
.Where(x => x.PartId == PartId)
.SingleOrDefault();
}
}
/// <summary>
@@ -252,10 +268,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public BTLPartModel FindByPartIdProjDbId(int PartId, int ProjDbId)
{
return dbCtx
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
return localDbCtx
.BTLPartList
.Where(x => x.PartId == PartId && x.ProjDbId == ProjDbId)
.FirstOrDefault();
}
}
/// <summary>
@@ -265,12 +284,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public List<BTLPartModel> GetByProjectAsc(int ProjDbId)
{
// retrieve
return dbCtx
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// retrieve
return localDbCtx
.BTLPartList
.Where(x => x.ProjDbId == ProjDbId)
.OrderBy(x => x.BTLPartDbId)
.ToList();
}
}
/// <summary>
@@ -280,12 +302,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public List<BTLPartModel> GetByProjectDesc(int ProjDbId)
{
// retrieve
return dbCtx
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// retrieve
return localDbCtx
.BTLPartList
.Where(x => x.ProjDbId == ProjDbId)
.OrderByDescending(x => x.BTLPartDbId)
.ToList();
}
}
/// <summary>
@@ -296,17 +321,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public List<BTLPartModel> GetPaginatedAsc(int PartDbIdStart, int numRecord)
{
List<BTLPartModel> answ = new List<BTLPartModel>();
int numEnd = PartDbIdStart - numRecord;
// check numEnd
if (numEnd < 0)
numEnd = 0;
// retrieve
return dbCtx
.BTLPartList
.Where(x => x.BTLPartDbId <= PartDbIdStart)
.OrderBy(x => x.BTLPartDbId)
.Take(numRecord)
.ToList();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// retrieve
answ = localDbCtx
.BTLPartList
.Where(x => x.BTLPartDbId <= PartDbIdStart)
.OrderBy(x => x.BTLPartDbId)
.Take(numRecord)
.ToList();
}
return answ;
}
/// <summary>
@@ -317,17 +347,22 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public List<BTLPartModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
{
List<BTLPartModel> answ = new List<BTLPartModel>();
int numEnd = PartDbIdStart - numRecord;
// check numEnd
if (numEnd < 0)
numEnd = 0;
// retrieve
return dbCtx
.BTLPartList
.Where(x => x.BTLPartDbId <= PartDbIdStart)
.OrderByDescending(x => x.BTLPartDbId)
.Take(numRecord)
.ToList();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// retrieve
answ = localDbCtx
.BTLPartList
.Where(x => x.BTLPartDbId <= PartDbIdStart)
.OrderByDescending(x => x.BTLPartDbId)
.Take(numRecord)
.ToList();
}
return answ;
}
/// <summary>
@@ -338,30 +373,44 @@ namespace EgtBEAMWALL.DataLayer.Controllers
public bool Update(BTLPartModel updItem)
{
bool done = false;
var item2update = dbCtx
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var item2update = localDbCtx
.BTLPartList
.Where(x => x.BTLPartDbId == updItem.BTLPartDbId)
.SingleOrDefault();
try
{
// update, vers 1...
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
try
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
//// update, vers 2
//dbCtx.BTLPartList.Remove(item2del);
//dbCtx.BTLPartList.Add(updItem);
//// update, vers 2
//localDbCtx.BTLPartList.Remove(item2del);
//localDbCtx.BTLPartList.Add(updItem);
// Commit changes
dbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on Update: {exc}");
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on BTLPart.Update: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
#endregion Public Methods
#region Private Fields
/// <summary>
/// Istanza logger
/// </summary>
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
}
}
+176 -16
View File
@@ -1,19 +1,12 @@
using System;
using System.Collections.Generic;
using NLog;
using System;
using System.Linq;
using System.Text;
using EgtBEAMWALL.DataLayer.DatabaseModels;
using System.Threading;
namespace EgtBEAMWALL.DataLayer.Controllers
{
public class DbController : IDisposable
{
#region Private Fields
private DatabaseContext dbCtx;
#endregion Private Fields
#region Public Fields
/// <summary>
@@ -27,41 +20,208 @@ namespace EgtBEAMWALL.DataLayer.Controllers
public DbController()
{
// Initialize database context
dbCtx = new DatabaseContext(Constants.CONNECTION_STRING);
// Initialize database context for ADMIN
adbCtx = new AdminContext(DbConfig.ADMIN_CONNECTION_STRING);
// DB standard utente
dbCtx = new AdminContext(DbConfig.CONNECTION_STRING);
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Verifica necessità creazione utente (locale o in rete)
/// </summary>
/// <param name="username"></param>
/// <param name="pwd"></param>
/// <param name="isNetwork"></param>
/// <returns></returns>
public bool checkCreateUser(string username, string pwd, bool isNetwork)
{
bool answ = false;
string domain = isNetwork ? "%" : "localhost";
answ = doCheckCreate(username, pwd, answ, domain, false);
if (answ)
{
doGrantPriv(username, domain, "ALL ON *.*");
}
return answ;
}
/// <summary>
/// Migrazione esplicita del DB da parte dell'admin controller
/// </summary>
/// <returns></returns>
public bool checkMigrateDb()
{
return adbCtx.SetUpDbConnectionAndDbConfig();
}
public void Dispose()
{
// Clear database context
dbCtx.Dispose();
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>
/// <returns></returns>
public bool ResetDb()
{
bool answ = false;
try
{
dbCtx
adbCtx
.Database
.SqlQuery<int>("CALL stp_ResetDb()");
answ = true;
dbCtx.SaveChanges();
adbCtx.SaveChanges();
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on ResetDb: {exc}");
string errMessage = $"EXCEPTION on DbController.ResetDb: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
return answ;
}
#endregion Public Methods
#region Private Fields
private AdminContext adbCtx;
private AdminContext dbCtx;
/// <summary>
/// Istanza logger
/// </summary>
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
}
}
@@ -0,0 +1,264 @@
using EgtBEAMWALL.DataLayer.DatabaseModels;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
namespace EgtBEAMWALL.DataLayer.Controllers
{
public class LogMachineController : IDisposable
{
#region Public Constructors
public LogMachineController()
{
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Conversion of base class to DB model class
/// </summary>
/// <param name="coreMacLog"></param>
/// <returns></returns>
public LogMachineModel ConvertFromCore(Core.MachLog coreMacLog)
{
LogMachineModel answ = new LogMachineModel();
if (coreMacLog != null)
{
answ = new LogMachineModel()
{
AlarmCode = coreMacLog.AlarmCode,
AlarmDatetime = coreMacLog.AlarmDateTime,
AlarmMessage = coreMacLog.AlarmMessage,
AlarmOperation = coreMacLog.AlarmOperation,
AlarmType = coreMacLog.AlarmType,
CommandExecutedCorrectly = coreMacLog.CommandExecutedCorrectly,
CommandState = coreMacLog.CommandState,
CommandType = coreMacLog.CommandType,
Description = coreMacLog.Description,
NewOpState = coreMacLog.newOpState,
ResultType = coreMacLog.ResultType,
VarAddress = coreMacLog.VarAddress,
VarValue = coreMacLog.VarValue
};
}
return answ;
}
/// <summary>
/// Conversion from DB to Core class
/// </summary>
/// <param name="dbLog"></param>
/// <returns></returns>
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;
}
/// <summary>
/// Create machine LOG record
/// </summary>
/// <param name="newLogMac"></param>
/// <returns></returns>
public bool Create(LogMachineModel newLogMac)
{
bool fatto = false;
try
{
try
{
using (var locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// Add to database
locallocalDbCtx.LogMachineList.Add(newLogMac);
// Commit changes
locallocalDbCtx.SaveChanges();
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on LogMachine.Create: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch
{ }
return fatto;
}
/// <summary>
/// Create machine LOG record (da modello dati CORE)
/// </summary>
/// <param name="newLogMac"></param>
/// <returns></returns>
public bool Create(Core.MachLog newMachLog)
{
var dbLogModel = ConvertFromCore(newMachLog);
return Create(dbLogModel);
}
/// <summary>
/// Delete by key
/// </summary>
/// <param name="LogDbId"></param>
/// <returns></returns>
public bool DeleteByKey(int LogDbId)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var items2del = localDbCtx
.LogMachineList
.Where(x => x.LogDbId == LogDbId);
try
{
// Add to database
localDbCtx.LogMachineList.RemoveRange(items2del);
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on LogMachine.DeleteByKey: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
public void Dispose()
{
}
/// <summary>
/// Get record by LogDbId
/// </summary>
/// <param name="LogDbId"></param>
/// <returns></returns>
public LogMachineModel FindByDbId(int LogDbId)
{
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
return localDbCtx
.LogMachineList
.Where(x => x.LogDbId == LogDbId)
.SingleOrDefault();
}
}
/// <summary>
/// Get paginated data from DB (ASC ordered)
/// </summary>
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public List<LogMachineModel> GetAsc(DateTime dtStart, DateTime dtEnd)
{
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// retrieve
return localDbCtx
.LogMachineList
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
.OrderBy(x => x.AlarmDatetime)
.ToList();
}
}
/// <summary>
/// Get paginated data from DB (ASC ordered) in "core format"
/// </summary>
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public List<Core.MachLog> GetCoreAsc(DateTime dtStart, DateTime dtEnd)
{
var rawData = GetAsc(dtStart, dtEnd);
var coreData = rawData.Select(x => ConvertToCore(x)).ToList();
return coreData;
}
/// <summary>
/// Get paginated data from DB (DESC ordered) in "core format"
/// </summary>
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public List<Core.MachLog> GetCoreDesc(DateTime dtStart, DateTime dtEnd)
{
var rawData = GetDesc(dtStart, dtEnd);
var coreData = rawData.Select(x => ConvertToCore(x)).ToList();
return coreData;
}
/// <summary>
/// Get paginated data from DB (DESC ordered)
/// </summary>
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public List<LogMachineModel> GetDesc(DateTime dtStart, DateTime dtEnd)
{
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// retrieve
return localDbCtx
.LogMachineList
.Where(x => x.AlarmDatetime >= dtStart && x.AlarmDatetime <= dtEnd)
.OrderByDescending(x => x.AlarmDatetime)
.ToList();
}
}
/// <summary>
/// Update single LogMachineModel
/// </summary>
/// <param name="updItem"></param>
/// <returns></returns>
public bool Update(LogMachineModel updItem)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var item2update = localDbCtx
.LogMachineList
.Where(x => x.LogDbId == updItem.LogDbId)
.SingleOrDefault();
try
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on LogMachine.Update: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
#endregion Public Methods
#region Private Fields
/// <summary>
/// Istanza logger
/// </summary>
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
}
}
@@ -0,0 +1,194 @@
using EgtBEAMWALL.DataLayer.DatabaseModels;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
namespace EgtBEAMWALL.DataLayer.Controllers
{
public class LogSupportController : IDisposable
{
#region Public Constructors
public LogSupportController()
{
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Create support LOG record
/// </summary>
/// <param name="dtCreated"></param>
/// <param name="fileName"></param>
/// <param name="dtExported"></param>
/// <param name="sn"></param>
/// <param name="description"></param>
/// <param name="eventType"></param>
/// <param name="message"></param>
/// <param name="value"></param>
/// <returns></returns>
public bool Create(DateTime dtCreated, Core.LogSupportLevel level, Core.LogSupportTarget target, string message)
{
bool fatto = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
try
{
try
{
LogSupportModel newItem = new LogSupportModel() { DtEvent = dtCreated, Level = level, Target = target, Message = message };
// Add to database
localDbCtx.LogSupportList.Add(newItem);
// Commit changes
localDbCtx.SaveChanges();
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on LogSupport.Create: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch
{ }
}
return fatto;
}
/// <summary>
/// Delete by key
/// </summary>
/// <param name="LogDbId"></param>
/// <returns></returns>
public bool DeleteByKey(int LogDbId)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var items2del = localDbCtx
.LogSupportList
.Where(x => x.LogDbId == LogDbId);
try
{
// Add to database
localDbCtx.LogSupportList.RemoveRange(items2del);
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on LogSupport.DeleteByKey: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
public void Dispose()
{
}
/// <summary>
/// Get record by LogDbId
/// </summary>
/// <param name="LogDbId"></param>
/// <returns></returns>
public LogSupportModel FindByDbId(int LogDbId)
{
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
return localDbCtx
.LogSupportList
.Where(x => x.LogDbId == LogDbId)
.SingleOrDefault();
}
}
/// <summary>
/// Get paginated data from DB (ASC ordered)
/// </summary>
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public List<LogSupportModel> GetPaginatedAsc(DateTime dtStart, DateTime dtEnd)
{
// retrieve
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
return localDbCtx
.LogSupportList
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
.OrderBy(x => x.DtEvent)
.ToList();
}
}
/// <summary>
/// Get paginated data from DB (DESC ordered)
/// </summary>
/// <param name="dtStart"></param>
/// <param name="dtEnd"></param>
/// <returns></returns>
public List<LogSupportModel> GetPaginatedDesc(DateTime dtStart, DateTime dtEnd)
{
// retrieve
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
return localDbCtx
.LogSupportList
.Where(x => x.DtEvent >= dtStart && x.DtEvent <= dtEnd)
.OrderByDescending(x => x.DtEvent)
.ToList();
}
}
/// <summary>
/// Update single LogMachineModel
/// </summary>
/// <param name="updItem"></param>
/// <returns></returns>
public bool Update(LogSupportModel updItem)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var item2update = localDbCtx
.LogSupportList
.Where(x => x.LogDbId == updItem.LogDbId)
.SingleOrDefault();
try
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on LogSupport.Update: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
#endregion Public Methods
#region Private Fields
/// <summary>
/// Istanza logger
/// </summary>
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
}
}
@@ -1,80 +1,21 @@
using System;
using EgtBEAMWALL.DataLayer.DatabaseModels;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EgtBEAMWALL.DataLayer.DatabaseModels;
namespace EgtBEAMWALL.DataLayer.Controllers
{
public class MachGroupController : IDisposable
{
#region Private Fields
private DatabaseContext dbCtx;
#endregion Private Fields
#region Public Fields
public static MachGroupController man = new MachGroupController();
#endregion Public Fields
#region Public Constructors
public MachGroupController()
{
// Initialize database context
dbCtx = new DatabaseContext(Constants.CONNECTION_STRING);
}
#endregion Public Constructors
#if false
/// <summary>
/// Get paginated data from DB (ASC ordered)
/// </summary>
/// <param name="MachGroupDbIdStart"></param>
/// <param name="numRecord"></param>
/// <returns></returns>
public List<MachGroupModel> GetPaginatedAsc(int MachGroupDbIdStart, int numRecord)
{
int numEnd = MachGroupDbIdStart - numRecord;
// check numEnd
if (numEnd < 0)
numEnd = 0;
// retrieve
return dbCtx
.MachGroupList
.Where(x => x.MachGroupDbId <= MachGroupDbIdStart)
.OrderBy(x => x.MachGroupDbId)
.Take(numRecord)
.ToList();
}
/// <summary>
/// Get paginated data from DB (DESC ordered)
/// </summary>
/// <param name="PartDbIdStart"></param>
/// <param name="numRecord"></param>
/// <returns></returns>
public List<MachGroupModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
{
int numEnd = PartDbIdStart - numRecord;
// check numEnd
if (numEnd < 0)
numEnd = 0;
// retrieve
return dbCtx
.MachGroupList
.Where(x => x.MachGroupDbId <= PartDbIdStart)
.OrderByDescending(x => x.MachGroupDbId)
.Take(numRecord)
.ToList();
}
#endif
#region Public Methods
/// <summary>
@@ -83,14 +24,14 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <param name="coreMachGroup"></param>
/// <param name="currProdDbId"></param>
/// <returns></returns>
public static MachGroupModel ConvertFromCore(Core.MyMachGroup coreMachGroup, int currProdDbId)
public MachGroupModel ConvertFromCore(Core.MyMachGroupM coreMachGroup, int currProdDbId)
{
MachGroupModel answ = new MachGroupModel();
if (coreMachGroup != null)
{
answ = new MachGroupModel()
{
Assign = "",
SupervisorId = "",
Name = coreMachGroup.Name,
Locked = true,
MachGroupId = coreMachGroup.Id,
@@ -99,12 +40,110 @@ namespace EgtBEAMWALL.DataLayer.Controllers
H = coreMachGroup.dH,
L = coreMachGroup.dL,
W = coreMachGroup.dW,
Material = coreMachGroup.sMATERIAL
DtStart = coreMachGroup.dtStartTime,
DtEnd = coreMachGroup.dtEndTime,
Material = coreMachGroup.sMATERIAL,
// indice ordinale SOLO SE è >= 0
ProdIndex = coreMachGroup.nProdIndex >= 0 ? coreMachGroup.nProdIndex : 10000
};
}
return answ;
}
/// <summary> Add MachGroup as rebuilt from NeedRedo (on top of order priority) <param
/// name="ProdId">Id del Prod</param> <param name="newMachGroup">Nuovo MachGroup da
/// associare</param> <returns></returns>
public ProdModel AddMachGroupRedo(int ProdId, Core.MyMachGroupM newMachGroup)
{
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
currData = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.SingleOrDefault();
try
{
var locMGCtrl = new MachGroupController();
var convCurrMG = locMGCtrl.ConvertFromCore(newMachGroup, currData.ProdDbId);
convCurrMG.ProdIndex = 1;
// aggiungo MachGroup
localDbCtx.MachGroupList.Add(convCurrMG);
// Commit changes
localDbCtx.SaveChanges();
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)
// .SingleOrDefault();
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;
// salvo
localDbCtx.SaveChanges();
}
}
else
{
PartList2Add.Add(convCurrPartM);
}
}
// aggiungo PartList
localDbCtx.PartList.AddRange(PartList2Add);
// Commit changes
localDbCtx.SaveChanges();
// aggiorno valore isNew a false x PROD
currData.IsNew = false;
// Commit changes
localDbCtx.SaveChanges();
// aggiorno info sullo status
myStatusMapCtrl.UpdateAction("", ProdId, newMachGroup.Id, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupAdd, "");
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on MachGroup.UpdateMachGroup: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return currData;
}
/// <summary>
/// Create record on DB
/// </summary>
@@ -115,25 +154,76 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
MachGroupModel newMachGroup = new MachGroupModel() { MachGroupId = newMachGroupId, Name = Name, State = Core.ItemState.ND };
try
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// Add to database
dbCtx.MachGroupList.Add(newMachGroup);
// Commit changes
dbCtx.SaveChanges();
try
{
// Add to database
localDbCtx.MachGroupList.Add(newMachGroup);
// Commit changes
localDbCtx.SaveChanges();
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on MachGroup.Create: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on Create: {exc}");
}
return newMachGroup;
}
/// <summary>
/// Delete MachGroup + Parts
/// </summary>
/// <param name="ProdId"></param>
/// <param name="MachGroupId"></param>
/// <returns></returns>
public bool Delete(int ProdId, int MachGroupId)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
// inizio eliminando le part
var parts2del = localDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId)
.ToList();
var MG2Del = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.SingleOrDefault();
try
{
// Remove to database
localDbCtx.PartList.RemoveRange(parts2del);
localDbCtx.MachGroupList.Remove(MG2Del);
// Commit changes
localDbCtx.SaveChanges();
// registro modifica StatusMap
myStatusMapCtrl.UpdateAction(MG2Del.SupervisorId, ProdId, MG2Del.MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on MachGroup.Delete: ProdId: {ProdId} | MachGroupId: {MachGroupId}{Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
// se fatto aggiorno info sullo status
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRem, "");
}
return done;
}
public void Dispose()
{
// Clear database context
dbCtx.Dispose();
}
/// <summary>
@@ -143,10 +233,13 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public MachGroupModel FindByMachGroupDbId(int MachGroupDbId)
{
return dbCtx
.MachGroupList
.Where(x => x.MachGroupDbId == MachGroupDbId)
.SingleOrDefault();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
return localDbCtx
.MachGroupList
.Where(x => x.MachGroupDbId == MachGroupDbId)
.SingleOrDefault();
}
}
/// <summary>
@@ -154,27 +247,15 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// </summary>
/// <param name="MachGroupId"></param>
/// <returns></returns>
public MachGroupModel FindByMachGroupId(int MachGroupId)
public MachGroupModel FindByMachGroupId(int ProdId, int MachGroupId)
{
return dbCtx
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
return localDbCtx
.MachGroupList
.Where(x => x.MachGroupId == MachGroupId)
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.SingleOrDefault();
}
/// <summary>
/// Get filtered data by Assign (ASC ordered)
/// </summary>
/// <param name="Assign"></param>
/// <returns></returns>
public List<MachGroupModel> GetByAssign(string Assign)
{
return dbCtx
.MachGroupList
.Where(x => x.Assign == Assign)
.OrderBy(x => x.Order)
.ThenBy(x => x.MachGroupId)
.ToList();
}
}
/// <summary>
@@ -184,29 +265,36 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <returns></returns>
public List<MachGroupModel> GetByProdAsc(int ProdId)
{
// recupero
// verificare fattibilità in 1 solo passo
int ProdDbId = 0;
try
List<MachGroupModel> answ = new List<MachGroupModel>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var currProd = dbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.FirstOrDefault();
if (currProd != null)
try
{
ProdDbId = currProd.ProdDbId;
var currProd = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.FirstOrDefault();
if (currProd != null)
{
ProdDbId = currProd.ProdDbId;
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on MachGroup.GetByProdAsc: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
answ = localDbCtx
.MachGroupList
.Where(x => x.ProdDbId == ProdDbId)
.OrderBy(x => x.ProdIndex)
.ThenBy(x => x.MachGroupId)
.ToList();
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on GetByProdAsc: {exc}");
}
return dbCtx
.MachGroupList
.Where(x => x.ProdDbId == ProdDbId)
.OrderBy(x => x.Order)
.ThenBy(x => x.MachGroupId)
.ToList();
return answ;
}
/// <summary>
@@ -218,27 +306,182 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
// recupero
int ProdDbId = 0;
try
List<MachGroupModel> answ = new List<MachGroupModel>();
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var currProd = dbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.FirstOrDefault();
if (currProd != null)
// verificare fattibilità in 1 solo passo
try
{
ProdDbId = currProd.ProdDbId;
var currProd = localDbCtx
.ProdList
.Where(x => x.ProdId == ProdId)
.FirstOrDefault();
if (currProd != null)
{
ProdDbId = currProd.ProdDbId;
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on MachGroup.GetByProdDesc: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
answ = localDbCtx
.MachGroupList
.Where(x => x.ProdDbId == ProdDbId)
.OrderByDescending(x => x.ProdIndex)
.ThenByDescending(x => x.MachGroupId)
.ToList();
}
return answ;
}
/// <summary>
/// Get filtered data by Assign (ASC ordered)
/// </summary>
/// <param name="ProdId"></param>
/// <param name="SupervisorId"></param>
/// <returns></returns>
public List<MachGroupModel> GetByProdSupervisor(int ProdId, string SupervisorId)
{
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
return localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.SupervisorId == SupervisorId)
.OrderBy(x => x.ProdIndex)
.ThenBy(x => x.MachGroupId)
.ToList();
}
}
/// <summary>
/// Set ProdIndex for MachGroup
/// </summary>
/// <param name="ProdId"></param>
/// <returns></returns>
public int GetMinIndex(int ProdId)
{
int answ = 5000;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
try
{
// aggiorno
var result = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.ProdIndex >= 5000 && x.ProdIndex < 10000)
.OrderByDescending(x => x.ProdIndex)
.FirstOrDefault();
if (result != null)
{
answ = result.ProdIndex;
}
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on MachGroup.UpdateOrder: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
return answ;
}
/// <summary>
/// Imposta a RIMOSSA dal supervisore
/// </summary>
/// <param name="MachGroupId"></param>
/// <param name="newState"></param>
/// <returns></returns>
public bool RemoveFromSupervisor(int ProdId, int MachGroupId)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
Console.WriteLine($"EXCEPTION on GetByProdDesc: {exc}");
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
var currRecord = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
if (currRecord != null)
{
currRecord.State = Core.ItemState.ND;
currRecord.SupervisorId = "";
currRecord.ProdIndex = 0;
// Commit changes
localDbCtx.SaveChanges();
// aggiorno info sullo status
myStatusMapCtrl.UpdateAction("", ProdId, MachGroupId, Core.StatusMapItemType.MachGroup, Core.StatusMapOpType.MachGroupRemovedFromSupervisor, "");
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)
{
string errMessage = $"EXCEPTION on MachGroup.RemoveFromSupervisor: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return dbCtx
.MachGroupList
.Where(x => x.ProdDbId == ProdDbId)
.OrderByDescending(x => x.Order)
.ThenByDescending(x => x.MachGroupId)
.ToList();
return done;
}
/// <summary>
/// Set MachGroup as NeedRedo (ripresa = da rigenerare)
/// </summary>
/// <param name="MachGroupId"></param>
/// <param name="newState"></param>
/// <param name="Value">Value to save for regenerate</param>
/// <returns></returns>
public bool SetNeedRedo(int ProdId, int MachGroupId, Core.ItemState newState, string Value)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
var item2upd = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.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.SetNeedRedo: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
/// <summary>
@@ -249,59 +492,224 @@ namespace EgtBEAMWALL.DataLayer.Controllers
public bool Update(MachGroupModel updItem)
{
bool done = false;
var item2update = dbCtx
.MachGroupList
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
.SingleOrDefault();
try
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// update, vers 1...
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
var myStatusMapCtrl = new StatusMapController();
try
{
var item2update = localDbCtx
.MachGroupList
.Where(x => x.MachGroupDbId == updItem.MachGroupDbId)
.SingleOrDefault();
if (item2update != null)
{
// update, vers 1...
localDbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
//// update, vers 2
//dbCtx.BTLPartList.Remove(item2del);
//dbCtx.BTLPartList.Add(updItem);
// Commit changes
dbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on Update: {exc}");
// 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)
{
string errMessage = $"EXCEPTION on MachGroup.Update: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
/// <summary>
/// Set Status for MachGroup
/// Set END for MachGroup
/// </summary>
/// <param name="newAssign"></param>
/// <param name="newState"></param>
/// <param name="ProdId"></param>
/// <param name="MachGroupId"></param>
/// <param name="DtEnd"></param>
/// <returns></returns>
public bool UpdateAssign(int MachGroupId, string newAssign)
public bool UpdateEnd(int ProdId, int MachGroupId, DateTime DtEnd)
{
bool done = false;
try
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// aggiorno
var currRecord = dbCtx
.MachGroupList
.Where(x => x.MachGroupId == MachGroupId)
.FirstOrDefault();
currRecord.Assign = newAssign;
currRecord.State = Core.ItemState.Assigned;
// Commit changes
dbCtx.SaveChanges();
done = true;
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
var currRecord = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
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)
{
string errMessage = $"EXCEPTION on MachGroup.UpdateEnd: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
catch (Exception exc)
return done;
}
/// <summary>
/// Set ProdIndex for MachGroup
/// </summary>
/// <param name="ProdId"></param>
/// <param name="MachGroupId"></param>
/// <param name="newProdIndex"></param>
/// <returns></returns>
public bool UpdateOrder(int ProdId, int MachGroupId, int newProdIndex)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
Console.WriteLine($"EXCEPTION on UpdateAssign: {exc}");
try
{
// aggiorno
var item2upd = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.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)
{
string errMessage = $"EXCEPTION on MachGroup.UpdateOrder: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
/// <summary>
/// Set START for MachGroup
/// </summary>
/// <param name="ProdId"></param>
/// <param name="MachGroupId"></param>
/// <param name="PartId"></param>
/// <param name="DtStart"></param>
/// <returns></returns>
public bool UpdateStart(int ProdId, int MachGroupId, DateTime DtStart)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
var currRecord = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
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)
{
string errMessage = $"EXCEPTION on MachGroup.UpdateStart: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
/// <summary>
/// Set START/END for MachGroup
/// </summary>
/// <param name="ProdId"></param>
/// <param name="MachGroupId"></param>
/// <param name="DtStart"></param>
/// <param name="DtEnd"></param>
/// <returns></returns>
public bool UpdateStartEnd(int ProdId, int MachGroupId, DateTime DtStart, DateTime DtEnd)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
var currRecord = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.FirstOrDefault();
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)
{
string errMessage = $"EXCEPTION on MachGroup.UpdateStartEnd: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
@@ -311,29 +719,98 @@ namespace EgtBEAMWALL.DataLayer.Controllers
/// <param name="MachGroupId"></param>
/// <param name="newState"></param>
/// <returns></returns>
public bool UpdateStatus(int MachGroupId, Core.ItemState newState)
public bool UpdateStatus(int ProdId, int MachGroupId, Core.ItemState newState)
{
bool done = false;
try
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
// aggiorno
dbCtx
.MachGroupList
.Where(x => x.MachGroupId == MachGroupId)
.FirstOrDefault()
.State = newState;
// Commit changes
dbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
var item2upd = localDbCtx
.MachGroupList
.Where(x => x.Prod.ProdId == ProdId && x.MachGroupId == MachGroupId)
.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)
{
string errMessage = $"EXCEPTION on MachGroup.UpdateStatus: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
/// <summary> Set Supervisor & state for MachGroup </summary> <param name="ProdId"></param>
/// <param name="MachGroupId"></param> <param name="SupervisorId"></param> <returns></returns>
public bool UpdateSupervisor(int ProdId, int MachGroupId, string SupervisorId)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
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;
// Commit changes
localDbCtx.SaveChanges();
done = true;
// 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)
{
string errMessage = $"EXCEPTION on MachGroup.UpdateSupervisor: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
#endregion Public Methods
#region Private Fields
/// <summary>
/// Istanza logger
/// </summary>
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
}
}
@@ -1,35 +1,407 @@
using System;
using System.Collections.Generic;
using EgtBEAMWALL.DataLayer.DatabaseModels;
using NLog;
using System;
using System.Linq;
using System.Text;
using EgtBEAMWALL.DataLayer.DatabaseModels;
namespace EgtBEAMWALL.DataLayer.Controllers
{
public class PartController : IDisposable
{
#region Private Fields
private DatabaseContext dbCtx;
#endregion Private Fields
#region Public Fields
public static PartController man = new PartController();
#endregion Public Fields
#region Public Constructors
public PartController()
{
// Initialize database context
dbCtx = new DatabaseContext(Constants.CONNECTION_STRING);
}
{ }
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Conversion of base class to DB model class
/// </summary>
/// <param name="corePart"></param>
/// <param name="currMachGroupDbId"></param>
/// <returns></returns>
public PartModel ConvertFromCore(Core.PartM corePart, int currMachGroupDbId)
{
PartModel answ = new PartModel();
if (corePart != null)
{
int BTLPartId = FindBtlPartByBPI(corePart.nProjId, corePart.nBTLPartId);
answ = new PartModel()
{
PartId = corePart.nPartId,
PDN = corePart.nPDN,
BTLPartDbId = BTLPartId,
MachGroupDbId = currMachGroupDbId,
State = corePart.nProductionState,
NAM = corePart.sNAM,
W = corePart.dW,
L = corePart.dL,
H = corePart.dH,
Material = corePart.sMATERIAL,
DtStart = corePart.dtStartTime,
DtEnd = corePart.dtEndTime,
//DO = corePart.bDO,
//CNT = corePart.nCNT,
//TBP = corePart.nTBP,
//DON = corePart.nDON,
ROT = corePart.nCALC_ROT,
//GRP = corePart.sGRP,
//UNT = corePart.nUNT,
CALC_State = (int)corePart.nCALC_State
};
}
return answ;
}
/// <summary>
/// Delete single Part
/// </summary>
/// <param name="ProdId"></param>
/// <param name="MachGroupId"></param>
/// <param name="PartId"></param>
/// <returns></returns>
public bool Delete(int ProdId, int MachGroupId, int PartId)
{
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();
if (item2del != null)
{
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);
}
}
else
{
string errMessage = $"ERROR on Part.Delete (01): req item was not found | ProdId {ProdId} | MachGroupId {MachGroupId} | PartId {PartId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
/// <summary>
/// Delete single Part
/// </summary>
/// <param name="PartDbId"></param>
/// <returns></returns>
public bool Delete(int PartDbId)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var item2del = localDbCtx
.PartList
.Where(x => x.PartDbId == PartDbId)
.SingleOrDefault();
if (item2del != null)
{
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);
}
}
else
{
string errMessage = $"ERROR on Part.Delete (02): req item was not found | PartDbId {PartDbId}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
/// <summary>
/// Delete Part by project
/// </summary>
/// <param name="MachGroupDbId"></param>
/// <returns></returns>
public bool DeleteByMachGroup(int MachGroupDbId)
{
bool done = false;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var items2del = localDbCtx
.PartList
.Where(x => x.MachGroupDbId == MachGroupDbId);
try
{
// Add to database
localDbCtx.PartList.RemoveRange(items2del);
// Commit changes
localDbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
string errMessage = $"EXCEPTION on Part.DeleteByMachGroup: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
public void Dispose()
{
}
/// <summary>
/// Get record by DBId
/// </summary>
/// <param name="PartDbId"></param>
/// <returns></returns>
public PartModel FindByDbId(int PartDbId)
{
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
return localDbCtx
.PartList
.Where(x => x.PartDbId == PartDbId)
.SingleOrDefault();
}
}
/// <summary>
/// Get record by ExtId
/// </summary>
/// <param name="PartId"></param>
/// <returns></returns>
public PartModel FindByPartId(int ProdId, int PartId)
{
PartModel answ = null;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
answ = locallocalDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.PartId == PartId)
.FirstOrDefault();
}
return answ;
}
/// <summary>
/// Update single Part
/// </summary>
/// <param name="updItem"></param>
/// <returns></returns>
public bool Update(PartModel updItem)
{
bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.PartDbId == updItem.PartDbId)
.SingleOrDefault();
if (item2upd != null)
{
try
{
// update, vers 1...
locallocalDbCtx.Entry(item2upd).CurrentValues.SetValues(updItem);
//// update, vers 2
//localDbCtx.PartList.Remove(item2del);
//localDbCtx.PartList.Add(updItem);
// 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);
}
}
else
{
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);
}
}
return done;
}
/// <summary>
/// Set EndDate for Part
/// </summary>
/// <param name="PartId"></param>
/// <param name="DtEnd"></param>
/// <returns></returns>
public bool UpdateEnd(int ProdId, int MachGroupId, int PartId, DateTime DtEnd)
{
bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.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)
{
string errMessage = $"EXCEPTION on Part.UpdateEnd: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
/// <summary>
/// Set StartDate for Part
/// </summary>
/// <param name="PartId"></param>
/// <param name="DtStart"></param>
/// <returns></returns>
public bool UpdateStart(int ProdId, int MachGroupId, int PartId, DateTime DtStart)
{
bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.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)
{
string errMessage = $"EXCEPTION on Part.UpdateStart: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
/// <summary>
/// Set Status for Part
/// </summary>
/// <param name="PartId"></param>
/// <param name="newState"></param>
/// <returns></returns>
public bool UpdateStatus(int ProdId, int MachGroupId, int PartId, Core.ItemState newState)
{
bool done = false;
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var myStatusMapCtrl = new StatusMapController();
try
{
// aggiorno
var item2upd = locallocalDbCtx
.PartList
.Where(x => x.MachGroup.Prod.ProdId == ProdId && x.MachGroup.MachGroupId == MachGroupId && x.PartId == PartId)
.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)
{
string errMessage = $"EXCEPTION on Part.UpdateStatus: {Environment.NewLine}{exc}";
Console.WriteLine(errMessage);
Log.Error(errMessage);
}
}
return done;
}
#endregion Public Methods
#region Protected Methods
/// <summary>
@@ -42,381 +414,55 @@ namespace EgtBEAMWALL.DataLayer.Controllers
{
int BtlPartDbId = 0;
var currProj = dbCtx
.ProjList
.Where(x => x.ProjId == ProjId)
.FirstOrDefault();
if (currProj != null)
using (DatabaseContext locallocalDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var btlPart = dbCtx
.BTLPartList
.Where(x => x.ProjDbId == currProj.ProjDbId && x.PDN == PDN)
.SingleOrDefault();
var btlPart = locallocalDbCtx
.BTLPartList
.Where(x => x.Project.ProjId == ProjId && x.PDN == PDN)
.SingleOrDefault();
if (btlPart != null)
{
BtlPartDbId = btlPart.BTLPartDbId;
}
}
return BtlPartDbId;
}
/// <summary>
/// Get BtlPartDBId by ProjId + BtlPartId
/// </summary>
/// <param name="ProjId"></param>
/// <param name="BtlPartId"></param>
/// <returns></returns>
protected int FindBtlPartByBPI(int ProjId, int BtlPartId)
{
int BtlPartDbId = 0;
using (DatabaseContext localDbCtx = new DatabaseContext(DbConfig.CONNECTION_STRING))
{
var btlPart = localDbCtx
.BTLPartList
.Where(x => x.Project.ProjId == ProjId && x.PartId == BtlPartId)
.SingleOrDefault();
if (btlPart != null)
{
BtlPartDbId = btlPart.BTLPartDbId;
}
}
return BtlPartDbId;
}
#endregion Protected Methods
#region Public Methods
#region Private Fields
/// <summary>
/// Conversion of base class to DB model class
/// Istanza logger
/// </summary>
/// <param name="corePart"></param>
/// <param name="currMachGroupDbId"></param>
/// <returns></returns>
public static PartModel ConvertFromCore(Core.Part corePart, int currMachGroupDbId)
{
PartModel answ = new PartModel();
if (corePart != null)
{
answ = new PartModel()
{
PartId = corePart.nPartId,
PDN = corePart.nPDN,
BTLPartDbId = man.FindBtlPart(corePart.nProjId, corePart.nPDN),
MachGroupDbId = currMachGroupDbId,
State = Core.ItemState.Assigned,
NAM = corePart.sNAM,
W = corePart.dW,
L = corePart.dL,
H = corePart.dH,
Material = corePart.sMATERIAL,
private NLog.Logger Log = LogManager.GetCurrentClassLogger();
//DO = corePart.bDO,
//CNT = corePart.nCNT,
//TBP = corePart.nTBP,
//DON = corePart.nDON,
ROT = corePart.nCALC_ROT,
//GRP = corePart.sGRP,
//UNT = corePart.nUNT,
CALC_State = (int)corePart.nState
};
}
return answ;
}
#if false
/// <summary>
/// Conversion of base class to DB model class
/// </summary>
/// <param name="corePart"></param>
/// <returns></returns>
public PartModel Convert(Core.Part corePart)
{
PartModel answ = new PartModel();
if (corePart != null)
{
answ = new PartModel()
{
PartId = corePart.nPartId,
PDN = corePart.nPDN,
DO = corePart.bDO,
NAM = corePart.sNAM,
W = corePart.dW,
L = corePart.dL,
H = corePart.dH,
MAT = corePart.sMATERIAL,
CNT = corePart.nCNT,
TBP = corePart.nTBP,
DON = corePart.nDON,
ROT = corePart.nROT,
GRP = corePart.sGRP,
UNT = corePart.nUNT,
CALC_State = (int)corePart.nState
};
}
return answ;
}
/// <summary>
/// Create multiple Part record associated to MachGroup
/// </summary>
/// <param name="MachGroupID"></param>
/// <param name="partData"></param>
/// <returns></returns>
public List<PartModel> Create(int MachGroupID, List<PartModel> partData)
{
// se è adv mode --> uso TUTTI i dati
if (DbManager.AdvDataModel)
{
try
{
// Add to database
dbCtx.PartList.AddRange(partData);
// Commit changes
dbCtx.SaveChanges();
}
catch
{ }
return partData;
}
// se non adv --> faccio solo copia degli id...
else
{
List<int> partIdList = new List<int>();
foreach (var item in partData)
{
partIdList.Add(item.PartId);
}
return CreateBaseObj(MachGroupID, partIdList);
}
}
/// <summary>
/// Create multiple (empty) Part record associated to Project
/// </summary>
/// <param name="ProjDbId"></param>
/// <param name="rawListData"></param>
/// <returns></returns>
public List<PartModel> CreateBaseObj(int ProjDbId, List<int> rawListData)
{
List<PartModel> partData = new List<PartModel>();
foreach (var item in rawListData)
{
PartModel newItem = new PartModel() { ProjDbId = ProjDbId, PartId = item };
partData.Add(newItem);
}
try
{
// Add to database
dbCtx.PartList.AddRange(partData);
// Commit changes
dbCtx.SaveChanges();
}
catch
{ }
return partData;
}
/// <summary>
/// Get filtered data by ProjectId (ASC ordered)
/// </summary>
/// <param name="ProjDbId"></param>
/// <returns></returns>
public List<PartModel> GetByProjectAsc(int ProjDbId)
{
// retrieve
return dbCtx
.PartList
.Where(x => x.ProjDbId == ProjDbId)
.OrderBy(x => x.PartDbId)
.ToList();
}
/// <summary>
/// Get filtered data by ProjectId (DESC ordered)
/// </summary>
/// <param name="ProjDbId"></param>
/// <returns></returns>
public List<PartModel> GetByProjectDesc(int ProjDbId)
{
// retrieve
return dbCtx
.PartList
.Where(x => x.ProjDbId == ProjDbId)
.OrderByDescending(x => x.PartDbId)
.ToList();
}
/// <summary>
/// Get paginated data from DB (ASC ordered)
/// </summary>
/// <param name="PartDbIdStart"></param>
/// <param name="numRecord"></param>
/// <returns></returns>
public List<PartModel> GetPaginatedAsc(int PartDbIdStart, int numRecord)
{
int numEnd = PartDbIdStart - numRecord;
// check numEnd
if (numEnd < 0)
numEnd = 0;
// retrieve
return dbCtx
.PartList
.Where(x => x.PartDbId <= PartDbIdStart)
.OrderBy(x => x.PartDbId)
.Take(numRecord)
.ToList();
}
/// <summary>
/// Get paginated data from DB (DESC ordered)
/// </summary>
/// <param name="PartDbIdStart"></param>
/// <param name="numRecord"></param>
/// <returns></returns>
public List<PartModel> GetPaginatedDesc(int PartDbIdStart, int numRecord)
{
int numEnd = PartDbIdStart - numRecord;
// check numEnd
if (numEnd < 0)
numEnd = 0;
// retrieve
return dbCtx
.PartList
.Where(x => x.PartDbId <= PartDbIdStart)
.OrderByDescending(x => x.PartDbId)
.Take(numRecord)
.ToList();
}
/// <summary>
/// Update single Part
/// </summary>
/// <param name="updItem"></param>
/// <returns></returns>
public bool Update(PartModel updItem)
{
bool done = false;
var item2update = dbCtx
.PartList
.Where(x => x.PartDbId == updItem.PartDbId)
.SingleOrDefault();
try
{
// update, vers 1...
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
//// update, vers 2
//dbCtx.PartList.Remove(item2del);
//dbCtx.PartList.Add(updItem);
// Commit changes
dbCtx.SaveChanges();
done = true;
}
catch
{ }
return done;
}
#endif
/// <summary>
/// Delete single Part
/// </summary>
/// <param name="PartDbId"></param>
/// <returns></returns>
public bool Delete(int PartDbId)
{
bool done = false;
var item2del = dbCtx
.PartList
.Where(x => x.PartDbId == PartDbId)
.SingleOrDefault();
try
{
// Add to database
dbCtx.PartList.Remove(item2del);
// Commit changes
dbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on Delete: {exc}");
}
return done;
}
/// <summary>
/// Delete Part by project
/// </summary>
/// <param name="MachGroupDbId"></param>
/// <returns></returns>
public bool DeleteByMachGroup(int MachGroupDbId)
{
bool done = false;
var items2del = dbCtx
.PartList
.Where(x => x.MachGroupDbId == MachGroupDbId);
try
{
// Add to database
dbCtx.PartList.RemoveRange(items2del);
// Commit changes
dbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on DeleteByMachGroup: {exc}");
}
return done;
}
public void Dispose()
{
// Clear database context
dbCtx.Dispose();
}
/// <summary>
/// Get record by DBId
/// </summary>
/// <param name="PartDbId"></param>
/// <returns></returns>
public PartModel FindByDbId(int PartDbId)
{
return dbCtx
.PartList
.Where(x => x.PartDbId == PartDbId)
.SingleOrDefault();
}
/// <summary>
/// Get record by ExtId
/// </summary>
/// <param name="PartId"></param>
/// <returns></returns>
public PartModel FindByPartId(int PartId)
{
return dbCtx
.PartList
.Where(x => x.PartId == PartId)
.SingleOrDefault();
}
/// <summary>
/// Set Status for Part
/// </summary>
/// <param name="PartId"></param>
/// <param name="newState"></param>
/// <returns></returns>
public bool UpdateStatus(int PartId, Core.ItemState newState)
{
bool done = false;
try
{
// aggiorno
dbCtx
.PartList
.Where(x => x.PartId == PartId)
.FirstOrDefault()
.State = newState;
// Commit changes
dbCtx.SaveChanges();
done = true;
}
catch (Exception exc)
{
Console.WriteLine($"EXCEPTION on UpdateStatus: {exc}");
}
return done;
}
#endregion Public Methods
#endregion Private Fields
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff

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