Compare commits

...

161 Commits

Author SHA1 Message Date
Demetrio Cassarino 51dcc4243b Optimizer 2.7.10.7
-creato nuove tabelle statistiche con nuovo metodo
2025-11-03 12:43:35 +01:00
Demetrio Cassarino 8d0c8b6428 Optimizer 2.7.10.6
-rimosso classi inutilizzate
2025-10-31 15:58:01 +01:00
Demetrio Cassarino 6fb87c8c33 Optimizer 2.7.10.5
-aggiornato versione EgwWPFBaseLib
2025-10-31 15:12:53 +01:00
Demetrio Cassarino 09639dbd81 Optimizer 2.7.10.4
-Elminato qparam
-aggiornato tabelle con EgwWPFBaseLib
2025-10-28 15:56:30 +01:00
Demetrio Cassarino b8ec7661ac Optimizer 2.7.10.3
- piccola modifica RawPartManagerWndV
2025-10-27 16:21:44 +01:00
Demetrio Cassarino b30406f1fc -piccole migliorie 2025-10-27 14:56:11 +01:00
Demetrio Cassarino 647614e67e Optimizer 2.7.10.2
-Eliminato classi e pagine nascoste
-Rinominato pagine e classi
2025-10-27 09:15:16 +01:00
Emmanuele Sassi 3899026713 - modifica 2025-10-24 15:36:26 +02:00
Emmanuele Sassi 76c8766528 - aggiunta EgwWPFBaseLib
- integrata EgwDatagrid su lista pezzi btl
- aggiornato Newtonsoft.Json a 13.0.4
2025-10-24 15:36:11 +02:00
Demetrio Cassarino 0657c9b101 -sistemato caricamento assemblato
-aggiunto immagine topologia
-sistemata vista tabella tblpartlist
2025-10-23 11:42:48 +02:00
Demetrio Cassarino f1a7d0dfba -gestione visibilità pulsante resetall
-sistemato bug su livello utenza
2025-10-21 14:42:26 +02:00
Demetrio Cassarino 9d626bd8d8 -aggiunto visualizzazione lista più assemblati 2025-10-20 12:29:09 +02:00
Demetrio Cassarino 29246fb70c -aggiunto pulsanti vista a scena assemblato 2025-10-16 16:43:13 +02:00
Demetrio Cassarino a64e93c866 -aggiornata visualizzazione assemblato 2025-10-16 15:26:46 +02:00
Demetrio Cassarino 8dd1e8e4b7 -sistemato parametri generali
-sistemato singolo assemblato
2025-10-15 15:19:44 +02:00
Demetrio Cassarino c67b31c17b -migliorata gestione parametri generali 2025-10-13 15:07:27 +02:00
Demetrio Cassarino ca9d376928 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-10-10 15:50:16 +02:00
Demetrio Cassarino f4e2167c9b -terminato parametri generali
-corretto alcuni bug
2025-10-10 15:50:09 +02:00
Emmanuele Sassi c6ed8b63ba Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewGraphicsProgram 2025-10-10 15:47:46 +02:00
Emmanuele Sassi 925601090f - correzione impostazione tipo progetto per sezioni al momento giusto 2025-10-10 15:47:25 +02:00
Demetrio Cassarino be8ded7c9a Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-10-09 09:18:00 +02:00
Demetrio Cassarino 579c57083f -aggiunta parametri generali da terminare 2025-10-09 09:17:09 +02:00
Emmanuele Sassi 4514a1a967 - eliminato x:name da EgtDataGrid
- aggiunto style in Dictionary per DataGridColumnHeader
- modificato in tutti gli usi di EgtDataGrid
2025-10-06 16:26:41 +02:00
Emmanuele Sassi 9c2e02943a - correzione path per simulazione 2025-10-02 15:16:52 +02:00
Emmanuele Sassi c4819f5b27 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewGraphicsProgram 2025-10-02 13:09:47 +02:00
Emmanuele Sassi c216e04276 - corrette dipendenze progetti per ordine di compilazione
- rimosso progetto ViewerOptimizer
2025-10-02 13:09:42 +02:00
Demetrio Cassarino 773efbcb25 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-10-02 11:27:10 +02:00
Demetrio Cassarino e9d061a083 -aggiunto check default config file strategie 2025-10-02 11:27:05 +02:00
Emmanuele Sassi 76bf4e6485 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewGraphicsProgram 2025-10-02 10:30:23 +02:00
Emmanuele Sassi 375406c196 - eliminati riferimenti a Name in codice EgtDataGrid
- aggiunto nuget EgwMultiEngine.Core
- iniziato modifiche popup in OnlyProdBTLPartListV
2025-10-02 10:30:18 +02:00
Demetrio Cassarino 6e0ae88f72 -sistemato forza strategie
-aggiornato visualizzazione parametri strategie
2025-10-01 10:00:53 +02:00
Demetrio Cassarino afae12547e -aggiunto livello utenza per strategie 2025-09-29 15:07:00 +02:00
Demetrio Cassarino 727138c6dd -gestione pulsante per visualizzare la lista di utensili selezionabili 2025-09-25 16:52:10 +02:00
Demetrio Cassarino 54f890e2c1 -diviso pagina configurazione in config e config programma 2025-09-25 11:54:33 +02:00
Demetrio Cassarino 47e3a32714 -aggiunto controllo su tipo strategje non presente 2025-09-24 16:44:03 +02:00
Demetrio Cassarino 0ca180f6f2 -gestito in strategie tipo non presente 2025-09-24 12:51:30 +02:00
Demetrio Cassarino d33a34830e -aggiunto stile per itemcontrol 2025-09-24 09:45:18 +02:00
Demetrio Cassarino fdca416dca -migliorata grafica lista utensili 2025-09-24 09:10:53 +02:00
Demetrio Cassarino 00ce92d369 -corretto visualizzazione pdf
-piccola correzione su salvataggio json
-rimozione variabili e funzioni inutilizzate
2025-09-23 15:43:56 +02:00
Demetrio Cassarino ee82b9b0fb -pulizia codice 2025-09-23 11:05:00 +02:00
Demetrio Cassarino 42beb7125e -rimosso variabile OnlyProd da core e supervisor 2025-09-23 10:12:23 +02:00
Demetrio Cassarino 207778d595 -gestito visualizzazione lista utensili 2025-09-23 09:59:17 +02:00
Demetrio Cassarino 888aa76c36 -rimossa variabile bOnlyProd 2025-09-22 14:28:45 +02:00
Demetrio Cassarino 189a632d94 -sistemato messaggi, pulizia codice 2025-09-19 16:36:50 +02:00
Demetrio Cassarino e7dbb80da2 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-09-19 11:15:26 +02:00
Demetrio Cassarino f08a7bdef7 -sistemato messaggi 2025-09-19 11:15:21 +02:00
Emmanuele Sassi 71c65a28bb Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewGraphicsProgram 2025-09-18 13:09:39 +02:00
Emmanuele Sassi c986f46861 - gestita pagina configurazione macchina
- migliorato caricamento strategie
2025-09-18 12:59:57 +02:00
Demetrio Cassarino 6ff8987a14 -creato nuovo tipo "tool" in strategie
-ripristinato pulsante statistiche
-migliorata gestione machine in config per selezione strategie o parametri macchina
2025-09-17 08:07:41 +02:00
Demetrio Cassarino 47d8ec273e -ripristinato MyExecProcessManager 2025-09-09 08:22:21 +02:00
Demetrio Cassarino 40c233e34f Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-09-09 08:04:59 +02:00
Demetrio Cassarino e10ab83e4b -aggiunto tipo string in strategie
-ripristinato intestazione in tabella updatebtl
-gestito updatebtl da rivedere
2025-09-09 08:04:54 +02:00
Emmanuele Sassi 9afe215b53 - eliminato import inutile 2025-09-08 10:49:10 +02:00
Emmanuele Sassi b6a68f06a3 - spostamento parametri macchina in MyMachine
- divisione tra macchina del progetto e di configurazione
2025-09-08 10:48:51 +02:00
Emmanuele Sassi 6fd4184732 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewGraphicsProgram 2025-09-04 11:05:45 +02:00
Emmanuele Sassi 5527a7e316 - aggiunto ExecProcessManager
- aggiornata finestra BtlDataWnd per gestione multiprogetto
- fix aggiunta progetto
2025-09-04 11:05:20 +02:00
Demetrio Cassarino ecb05a29c9 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-09-02 09:23:30 +02:00
Demetrio Cassarino 6829a7c203 -pulito codice 2025-09-02 09:22:28 +02:00
Emmanuele Sassi e6601930c4 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewGraphicsProgram 2025-09-01 10:14:37 +02:00
Emmanuele Sassi 4040a1ab98 ' correzione lettura programma all'avvio 2025-09-01 10:14:31 +02:00
Demetrio Cassarino 9db39a5d45 -gestito cambio pagina da progettazione a configurazione 2025-09-01 09:17:48 +02:00
Demetrio Cassarino af1be57395 -pulizia codice
- aggiornato saveproject da rivedere
2025-08-29 16:33:29 +02:00
Emmanuele Sassi 8ae20fe129 - aggiornamento funzione NewProject 2025-08-28 18:57:42 +02:00
Emmanuele Sassi ba8422bcb1 - aggiunta caricamento MachGroupPanel su importBtl 2025-08-28 09:46:28 +02:00
Demetrio Cassarino ef5a5d337c -pulizia codice 2025-08-27 14:52:54 +02:00
Demetrio Cassarino 4fd271bf4c -gestito apertura progetto
-rimosso initonlyprod
2025-08-27 13:07:23 +02:00
Emmanuele Sassi cfa1910f25 - iniziata correzione macchina selezionata
- corretto path Proj per generazione
2025-08-26 19:24:35 +02:00
Emmanuele Sassi dfbcfa435a - modificata gestione Open, Save e ImportBTL
- modificata finestra ProjectTypeWnd
- spostato strategit sotto tab Macchina
- aggiunta in strategie gestione Beam o Wall
2025-08-26 11:51:11 +02:00
Demetrio Cassarino bcc9ecb9db -gestito visualizzazione pezzo quando rimosso
-gestito livello utente per parametri strategie
2025-07-31 08:06:46 +02:00
Demetrio Cassarino feb943cfb1 -aggiunto immagine al posto del tooltip in ppparameter
-gestito vista assemblato
-aggiornato cotrolli su vista assemblato
-aggiornato selezione multipla pezzi
2025-07-29 10:26:22 +02:00
Demetrio Cassarino e878069ffd -ripristinato variant per nuovo programma 2025-07-10 08:52:42 +02:00
Demetrio Cassarino 4a0e8365bb -gestito visibilità tabella feature quando visualizzo assemblato 2025-07-09 16:53:14 +02:00
Demetrio Cassarino b563997e43 -cambiato gestione pulsanti modifica feature e pezzo 2025-07-09 16:46:58 +02:00
Demetrio Cassarino 0049122199 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-07-09 13:08:00 +02:00
Demetrio Cassarino da0ee72bcc -aggiunto splasscreen 2025-07-09 13:07:54 +02:00
Emmanuele Sassi b19d11be18 - impostata ultima griglia per selezione
- migliorata selezione
2025-07-09 13:04:11 +02:00
Emmanuele Sassi f22fa79fee - aggiunta deselezione feature
- aggiunta precedente feature selezionata
- eliminato tipo di selezione
2025-07-09 09:20:17 +02:00
Emmanuele Sassi 64881c5869 - riportate alcune modifiche da ramo correzioni&migliorie
- evitato drag su selezione pezzo
2025-07-04 14:55:31 +02:00
Demetrio Cassarino bb61a85132 -pulizia codice 2025-07-02 16:46:49 +02:00
Demetrio Cassarino 6591de143a -aggiunto scena assemblato
-migliorato gestione popup
2025-06-06 09:33:32 +02:00
Demetrio Cassarino aee76d1150 -aggiunto chiusura popup quando si seleziona un bottone
-spostato onlyprodproject in cartella Project
2025-05-28 16:52:55 +02:00
Demetrio Cassarino 5eb75a9c38 -pulizia codice 2025-05-27 16:47:57 +02:00
Demetrio Cassarino c7b7aec302 -pulizia codice
-aggiunto selezione albero con un solo click
-sistemato assemblato quando si seleziona pezzo in produzione
2025-05-27 16:01:39 +02:00
Demetrio Cassarino 1e49806662 -aggiornato info dati json
-aagiunto assemblato
2025-05-23 17:10:37 +02:00
Demetrio Cassarino ccc824489b -aggiornato visualizzazione BTLFeatureVMList in xaml 2025-05-23 11:53:18 +02:00
Demetrio Cassarino 62db5e4a42 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-05-23 10:09:52 +02:00
Demetrio Cassarino fffbf3676f -aggiunto stile per listabtl 2025-05-23 10:09:47 +02:00
Emmanuele Sassi ac46e13c54 - modificata selezione feature in lista pezzi BTL 2025-05-23 10:07:12 +02:00
Emmanuele Sassi 3c84e91735 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewGraphicsProgram 2025-05-22 17:43:44 +02:00
Emmanuele Sassi fab3b0fe14 - correzione su verifica duplo solo quando esistonmo
- aggiunta sezioni a warehouse su importazione file
2025-05-22 17:43:39 +02:00
Demetrio Cassarino 6ce4fa7641 -aggiornato margini validità pezzo 2025-05-22 17:16:23 +02:00
Emmanuele Sassi 51707cc973 - riportata correzione backup 2025-05-22 16:52:08 +02:00
Demetrio Cassarino a9e463141e -corretto inversione pezzo in btl 2025-05-22 16:03:35 +02:00
Demetrio Cassarino 1e2023234e -aggiunto messaggi di errore per feature 2025-05-22 15:14:33 +02:00
Demetrio Cassarino b305d8be17 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-05-22 12:13:39 +02:00
Demetrio Cassarino ac9d0dc076 -gestito flag checksum 2025-05-22 12:13:35 +02:00
Emmanuele Sassi a2a3642ecf aggiunto nome strategia e immagine, gestito errore su forcestrategy 2025-05-22 12:11:35 +02:00
Demetrio Cassarino 1051bf0f58 -aggiornato forcedstrategy 2025-05-22 09:46:20 +02:00
Demetrio Cassarino 3e03d44840 -sistemato commit 2025-05-22 08:36:08 +02:00
Demetrio Cassarino 4730c0ef42 -rimosso finestre inutulizzate 2025-05-22 08:35:19 +02:00
Demetrio Cassarino 9eac34222f -aggiornato immagini 2025-05-21 17:35:31 +02:00
Demetrio Cassarino f2c5b60acc -aggiunto reset per pezzo btl e machgroup e resetall
-risistemanto percorso beamnew
2025-05-21 09:39:10 +02:00
Emmanuele Sassi 5c5dae5e3a Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewGraphicsProgram 2025-05-20 16:14:45 +02:00
Emmanuele Sassi c400973972 - correzione import BTL
- rimossa scena assemblato
- fix bottoni verifica
- accelerato scorrimento lista BTLPart
2025-05-20 16:14:28 +02:00
Demetrio Cassarino 9522cd6d4e -aggiuntoi force strategy in btl 2025-05-20 11:06:27 +02:00
Demetrio Cassarino f0ce11dad7 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-05-19 16:13:03 +02:00
Demetrio Cassarino 493c63ece2 -aggiornato salvataggio e nuovo file json aisetup 2025-05-19 16:12:59 +02:00
Emmanuele Sassi 33d18efcc2 - migliorie strategy
- aggiunta strategy per btl
- aggiunte ForcedStrategy su feature
2025-05-19 16:09:36 +02:00
Demetrio Cassarino 07c67e0987 -gestito spostamento da strategie available ad attive 2025-05-16 17:02:17 +02:00
Emmanuele Sassi 07753855cd - miglioramenti lettura e scrittura Json strategie 2025-05-16 14:59:45 +02:00
Demetrio Cassarino d1e95372e1 -sistemato salvataggio file json 2025-05-16 10:14:57 +02:00
Emmanuele Sassi 9865028f99 - miglioramento strategie 2025-05-15 18:53:57 +02:00
Demetrio Cassarino ecb2055690 -rimosso liste inutilizzate 2025-05-15 14:32:46 +02:00
Demetrio Cassarino 187fdde32b -rispristinato spostamento strategia da available ad active 2025-05-15 13:04:14 +02:00
Demetrio Cassarino 5e66d99528 -rimosso liste deactivate e active strategy 2025-05-15 10:52:15 +02:00
Emmanuele Sassi 79f0b3ee9f - correzione libreria necessaria 2025-05-14 19:05:39 +02:00
Emmanuele Sassi feafc44022 - miglioramenti e correzioni StrategyManager 2025-05-14 19:02:43 +02:00
Demetrio Cassarino d376fdca3e Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-05-14 11:48:40 +02:00
Demetrio Cassarino cc43198e05 -sistemato scena assemblato 2025-05-14 11:48:37 +02:00
Emmanuele Sassi 82892c2460 - sistemata selezione ed edit su tabella grezzi 2025-05-14 11:41:54 +02:00
Demetrio Cassarino 92656e997e -aggiunto finestra showbuilding
-aggiunto controllo su liste differenti
2025-05-13 12:27:16 +02:00
Demetrio Cassarino 32d576111a -piccole migliorie 2025-05-12 14:33:48 +02:00
Demetrio Cassarino 17ebba3e11 -ottmizzato codice su savestrategy 2025-05-09 16:52:07 +02:00
Demetrio Cassarino eed9456c8d -ottimizzazione codice strategie 2025-05-09 15:05:32 +02:00
Demetrio Cassarino 3f56e563c1 -sistemato pagina cofigstrategy, piccoli affinamenti
-introdotto forza strategia in produzione
2025-05-08 17:05:14 +02:00
Demetrio Cassarino 9c9b00d661 -sistemato simula per programma
-aggiunto salvataggio, salvataggio con nome
2025-05-07 17:14:57 +02:00
Demetrio Cassarino 4d2e18ebf1 -aggiunto pulsanti apri, salva, e salvacome 2025-05-06 17:23:33 +02:00
Demetrio Cassarino 8692baafff -rimosso sfondo rosso 2025-05-06 17:15:13 +02:00
Demetrio Cassarino b9a89fa212 -sistemato grafica su tabelle
-aggiunto combobox per scelte
2025-05-06 17:14:31 +02:00
Demetrio Cassarino 9d572699a2 -suddiviso in più xaml la finestra strategymanagerv
-inizio gestione checkboc, combobox
2025-05-05 17:34:56 +02:00
Demetrio Cassarino 1794d475ea -suddiviso xaml strategymanager 2025-05-05 14:14:48 +02:00
Demetrio Cassarino 8a73b3cab8 -gestito active e deactive strategy
-introdotto crea customconfig json
2025-04-30 15:01:37 +02:00
Demetrio Cassarino 86010b41c1 -creato strategymanagerVm
-sistemato codice
2025-04-29 17:04:55 +02:00
Demetrio Cassarino 6d8d3a1c1f -inizio strategie in pagina configurazione 2025-04-28 17:18:34 +02:00
Demetrio Cassarino b48b63bd4d -aggiunto pulsanti conferma-annulla modifiche si feature
-gestito blocco leftpanel quando si è in modifica feature
2025-04-24 16:44:24 +02:00
Demetrio Cassarino 05feb0ab8b -aggiornato selectedmachgroup 2025-04-24 10:55:06 +02:00
Demetrio Cassarino deca9cd4c0 -ripristinato funzioni da modulo config
-pulizia di proj e prod manager
-da sistemare selectedmachgroup
2025-04-23 16:31:14 +02:00
Demetrio Cassarino 8b36b65b37 -rimosso distinzione tra view, machining page 2025-04-22 16:46:32 +02:00
Demetrio Cassarino 06899fadfd -ripristinato optmizervisibility 2025-04-22 08:55:15 +02:00
Demetrio Cassarino 80e9ea4c15 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egalware-cadcam/interfacce/egtbeamwall into feature/NewGraphicsProgram 2025-04-22 08:07:28 +02:00
Demetrio Cassarino ad47a070ef -pulizia codice 2025-04-22 08:03:44 +02:00
Emmanuele Sassi d99ea84058 - gestita selezione su BTLPartList con apertura e chiusura RowDetails 2025-04-18 17:57:56 +02:00
Demetrio Cassarino 069df21cfa -sistemata visibilità tabella feature per produzione 2025-04-18 09:41:30 +02:00
Demetrio Cassarino 7def1b8d5d -aggiunto pulsante modifica pezzo che apre una nuovo tab
-gestito visualizzazione interfaccia
2025-04-17 17:33:05 +02:00
Emmanuele Sassi 82aea136c2 - correzione riferimento a grafica non utilizzata 2025-04-16 19:48:11 +02:00
Demetrio Cassarino 55260fe380 -inizio pulizia codice
-sistemato apri in supervisor
2025-04-16 17:04:01 +02:00
Demetrio Cassarino 4bdbba6599 -sistemato pulsante per modifica feature 2025-04-15 16:59:02 +02:00
Demetrio Cassarino 0d38b47f24 -aggiunto pulsante per la modifica della feature 2025-04-15 15:51:28 +02:00
Demetrio Cassarino 2332eccef9 -pulizia codice 2025-04-15 11:20:07 +02:00
Emmanuele Sassi a3481659f2 Merge branch 'feature/NewGraphicsProgram' of https://gitlab.steamware.net/egaltech/egtbeamwall into feature/NewGraphicsProgram 2025-04-14 17:05:56 +02:00
Emmanuele Sassi 4b90d2e915 - correzione EgtDataGrid
- introduzione datagrid per pezzi dentro grezzi
2025-04-14 17:03:45 +02:00
Demetrio Cassarino bb0a3b385a cambiato dimensioni bottone reset 2025-04-14 10:24:59 +02:00
Demetrio Cassarino 0c82debdf4 -cambiato stile bottone reset 2025-04-14 10:24:11 +02:00
Demetrio Cassarino 995650aac2 -aggiunto lista FeatureInPartInRawPartList 2025-04-14 09:42:01 +02:00
Demetrio Cassarino f7a85a0680 -gestito PartVMList per pareti 2025-04-14 09:20:36 +02:00
Demetrio Cassarino 910e54cae8 -aggiunto comandi su leftpanel
-sistemato grafica
2025-04-11 16:28:54 +02:00
Demetrio Cassarino ea2cb64886 -aggiunto pulsanti a tabelle
-rivisto grafica
2025-04-10 17:08:53 +02:00
Demetrio Cassarino c785adbcdf -aggiornato grafica
-aggiunto a OnlyProdRawPartListV pulsanti da sistemare
2025-04-09 16:59:02 +02:00
Demetrio Cassarino 9546248819 -aggiunto DG_OnlyProdPartList in Datagridckolumns.ini
- gestione lista feature da rivedere
-aggiunto in OnlyProdRawPartListV lista PartVMList
-aggiunto pulsanti start, save con gestione popup
2025-04-08 17:23:19 +02:00
Emmanuele Sassi 13b2dd29d1 - aggiunta proprieta proj su pezzi
- aggiunto progetto Optimizer
2025-04-05 12:59:22 +02:00
Demetrio Cassarino 55879d431e -riattivato pulsanti per aprire btl 2025-04-03 12:02:11 +02:00
525 changed files with 59485 additions and 876 deletions
-1
View File
@@ -1,5 +1,4 @@
Imports System.Collections.ObjectModel
Imports System.Globalization
Imports System.Windows
Imports EgtUILib
Imports EgtWPFLib5
+12
View File
@@ -18,6 +18,17 @@ Public Class BTLPartM
End Property
' Info del pezzo
Public m_nPROJ As Integer
Public Property nPROJ As Integer
Get
Return m_nPROJ
End Get
Set(value As Integer)
m_nPROJ = value
End Set
End Property
Public m_nPDN As Integer
Public Property nPDN As Integer
Get
@@ -752,6 +763,7 @@ Public Class BTLPartM
Dim sValArray() As String
Dim sValue As String = String.Empty
Dim nValue As Integer = 0
EgtGetInfo(nPartId, BTL_PRT_PROJ, NewBTLPart.m_nPROJ)
EgtGetInfo(nPartId, BTL_PRT_PDN, NewBTLPart.m_nPDN)
Dim nDO As Integer = 1
If EgtGetInfo(nPartId, BTL_PRT_DO, nDO) Then
+28 -1
View File
@@ -229,7 +229,6 @@ Public Class BTLFeatureVM
' funzione che seleziona la feature nella geometria
Public Sub SelGeomFeature()
EgtDeselectAll()
SelGeomFeature(nFeatureId)
End Sub
@@ -256,6 +255,34 @@ Public Class BTLFeatureVM
End If
End Sub
' funzione che seleziona la feature nella geometria
Public Sub DeselGeomFeature()
DeselGeomFeature(nFeatureId)
End Sub
Private Sub DeselGeomFeature(nMyFeatureId As Integer)
EgtDeselectObj(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
DeselGeomFeature(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
EgtDeselectObj(nMyFeatureId + nAuxId)
End If
Next
End If
End Sub
Public Overridable Sub RefreshFeature()
End Sub
@@ -39,12 +39,7 @@
BindingColumns="{Binding BeamMachiningsColumns}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Teal}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
ColumnHeaderStyle="{StaticResource Main_DataGridColumnHeader}"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
+13 -6
View File
@@ -23,6 +23,10 @@ Public Module CalcIntegration
POINT_CLOUD = 5
RAWPART = 6
EDIT = 7
CHECKNOSIM = 8
TOPOLOGY = 9
OPENTOOLDB = 11 ' Non utilizzato
OPENMACHINIGDB = 12 ' Non utilizzato
End Enum
Private Structure MyProc
@@ -160,7 +164,7 @@ Public Module CalcIntegration
nActProc += 1
End If
Else
If vBar(nCurrBar).nCmdType = CmdTypes.CHECK OrElse vBar(nCurrBar).nCmdType = CmdTypes.CHECKGEN Then
If vBar(nCurrBar).nCmdType = CmdTypes.CHECK OrElse vBar(nCurrBar).nCmdType = CmdTypes.CHECKGEN OrElse vBar(nCurrBar).nCmdType = CmdTypes.CHECKNOSIM 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))
@@ -175,7 +179,7 @@ Public Module CalcIntegration
' 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
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKNOSIM 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))
@@ -197,7 +201,7 @@ Public Module CalcIntegration
' 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
If vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECK OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKGEN OrElse vBar(vProc(j).nBar).nCmdType = CmdTypes.CHECKNOSIM 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))
@@ -321,7 +325,7 @@ Public Module CalcIntegration
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
Public Function CreateNewProjectFromPart(nPartId As Integer, sProjDirPath As String) As String
' Aggiorno identificativi per segnalazione errori
UpdateCutIdAndTaskId(nPartId)
@@ -350,7 +354,7 @@ Public Module CalcIntegration
Return If(bOk, sPartFilePath, String.Empty)
End Function
Private Function CreateNewProjectFromMachGroup(nMachGroupId As Integer, sProjDirPath As String, nGlobState As Integer) As String
Public 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
@@ -389,9 +393,12 @@ Public Module CalcIntegration
Dim sMachGroupName As String = ""
EgtGetMachGroupName(nMachGroupId, sMachGroupName)
Dim sMachGroupFilePath As String = sProjDirPath & "\" & sMachGroupName & ".bwe"
If EgtSaveObjToFile(nMachGroupId, sMachGroupFilePath, NGE.CMPTEXT) Then
If EgtSaveMachGroupToFile(nMachGroupId, {EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO), EgtGetFirstNameInGroup(GDB_ID.ROOT, PROJECTINFO)}, sMachGroupFilePath, NGE.CMPTEXT) Then
Return sMachGroupFilePath
End If
'If EgtSaveObjToFile(nMachGroupId, sMachGroupFilePath, NGE.CMPTEXT) Then
' Return sMachGroupFilePath
'End If
Return String.Empty
End Function
@@ -119,6 +119,12 @@
</StackPanel>
</Grid>
</GroupBox>
<UniformGrid Columns="2"
Margin="0,5,0,0">
<TextBlock Text="Importa BTL con verifica" VerticalAlignment="Center" Foreground="{StaticResource BeamWall_Corduroy}"/>
<CheckBox IsChecked="{Binding bVerifyImportBTL_IsChecked}"
Margin="0,5,0,0"/>
</UniformGrid>
</StackPanel>
</Grid>
+1
View File
@@ -120,6 +120,7 @@
Public Const PROJ As String = "PROJ"
Public Const FILENAMESEPARATOR As Char = "^"c
Public Const BTLINFO As String = "BtlInfo"
Public Const PROJECTINFO As String = "ProjectInfo"
' layer per assemblato
Public Const ASSEBASE As String = "AsseBase"
@@ -1,6 +1,7 @@
Public Module ConstDataGridColumnsIni
Public Const DATAGRIDCOLUMNS_FILE_NAME As String = "DataGridColumns.ini"
Public Const OPTIMIZERDATAGRIDCOLUMNS_FILE_NAME As String = "OPTIMIZERDataGridColumns.ini"
Public Const S_FEATURELIST As String = "DG_FeatureList"
Public Const S_OPENPROJFILEDLG_PROJ As String = "DG_OpenProjectFileDialog_PROJ"
+19 -2
View File
@@ -28,6 +28,7 @@ Public Module ConstGen
' Pagine del programma
Public Enum Pages As Integer
EMPTY = -1
VIEW = 0
MACHINING = 1
SUPERVISOR = 2
@@ -35,6 +36,7 @@ Public Module ConstGen
INPUTS = 4
OUTPUTS = 5
ONLYPRODPAGE = 6
CONFIGPROGRAM = 7
End Enum
' Abilitazioni licenza
@@ -55,7 +57,7 @@ Public Module ConstGen
End Enum
' File di log generale
Public Const VWOPTGENLOG_FILE_NAME As String = "EgtBEAMWALL.ViewerOptimizerLog#.txt"
Public Const VWOPTGENLOG_FILE_NAME As String = "EgtBEAMWALL.OptimizerLog#.txt"
Public Const SUPGENLOG_FILE_NAME As String = "EgtBEAMWALL.SupervisorLog#.txt"
' Sottodirettorio di configurazione
@@ -76,8 +78,12 @@ Public Module ConstGen
Public Const WAREHOUSE_DIR As String = "Warehouse"
' Sottodirettorio per lavorazioni travi
Public Const BEAM_DIR As String = "Beam"
' Sottodirettorio per lavorazioni travi nuovo
Public Const BEAMNEW_DIR As String = "BeamNew"
' Sottodirettorio per lavorazioni pareti
Public Const WALL_DIR As String = "Wall"
' Sottodirettorio per lavorazioni pareti nuovo
Public Const WALLNEW_DIR As String = "WallNew"
' Sottodirettorio di default per il salvataggio con nome
Public Const SAVE_DFL_NAMEDIR As String = "MyProjects"
' Sottodirettorio di default per le macchine
@@ -90,5 +96,16 @@ Public Module ConstGen
Public Const ZEBRAPRINTER_EXE As String = "ZebraPrinterUtilitiesD32.exe"
' Sottodirettorio di default per macro
Public Const MACRO_DFL_DIR As String = "Macro"
' Sottodirettorio per setup strategie
Public Const AISETUP_DIR As String = "AISetup"
' Sottodirettorio per automatismo strategie
Public Const STRATEGIES_DIR As String = "Strategies"
' Sottodirettorio per automatismo strategie standard
Public Const STANDARD_DIR As String = "Standard"
' File contenente lista strategie per feature/topologia
Public Const AVAILABLESTRATEGYLIST_FILE As String = "AvailableStrategyList"
' File contente tutte le feature
Public Const CUSTOMERCONFIG_FILE As String = "CustomerConfig"
' File contenente i parametri generali
Public Const GENERALPARAMETERS_FILE As String = "GeneralParameters"
End Module
+15
View File
@@ -35,6 +35,8 @@ Public Module ConstIni
Public Const K_FASTPRODUCE As String = "FastProduce"
Public Const K_ADDPROJ As String = "AddProj"
Public Const K_PROJECTMODE As String = "ProjectMode"
Public Const K_CAMEXEPATH As String = "CAMExePath"
Public Const K_PIPELUADIR As String = "PipeLuaDir"
Public Const K_SHOWBUILDING As String = "ShowBuilding"
@@ -50,14 +52,21 @@ Public Module ConstIni
Public Const K_EXPORTBWE As String = "ExpBwe"
Public Const S_BEAM As String = "Beam"
Public Const S_BEAMNEW As String = "BeamNew"
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 S_WALLNEW As String = "WallNew"
Public Const K_WALLBASEDIR As String = "BaseDir"
Public Const K_WALLBWEEXEC As String = "BweExec"
Public Const S_EXECGROUP As String = "ExecGroup"
Public Const K_ENVIRONMENT As String = "Environment"
Public Const K_PIPELUAFILE As String = "PipeLuaFile"
Public Const K_MAXCAMINSTANCES As String = "MaxCAMInstances"
Public Const S_MACHINELOGFILTER As String = "MachineLogFilters"
Public Const K_PARTEVENTTYPE As String = "PartEventType"
Public Const K_ENTITYTYPE As String = "EntityType"
@@ -119,4 +128,10 @@ Public Module ConstIni
' Server Address
Public Const K_SERVERADDRESS As String = "ServerAddressRelease"
Public Const K_BEAMWALL As String = "EgtBeamWall"
Public Const S_STRATEGY As String = "Strategy"
Public Const K_PARAMPASSWORD As String = "ParamPassword"
Public Const K_DEFAULTCONFIG As String = "DefaultConfiguration"
Public Const K_VERIFYIMPORTBTL As String = "VerifyImportBTL"
End Module
+1 -29
View File
@@ -60,7 +60,7 @@
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@@ -137,12 +137,6 @@
<Compile Include="ConfigurationPage\Machine_ConfigurationPageV.xaml.vb">
<DependentUpon>Machine_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\OnlyProdQParameter_ConfigurationPageV.xaml.vb">
<DependentUpon>OnlyProdQParameter_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\QParameter_ConfigurationPageV.xaml.vb">
<DependentUpon>QParameter_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="Constants\ConstColumns.vb" />
<Compile Include="Constants\ConstDataGridColumnsIni.vb" />
<Compile Include="Constants\ConstDims.vb" />
@@ -222,12 +216,6 @@
<Compile Include="OpenProjectFileDialog\OnlyProdOpenProjectFileDialogV.xaml.vb">
<DependentUpon>OnlyProdOpenProjectFileDialogV.xaml</DependentUpon>
</Compile>
<Compile Include="SetUpWindow\OnlyProdSetUpWindowV.xaml.vb">
<DependentUpon>OnlyProdSetUpWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="ToolsDbWindow\OnlyProdToolDbWindowV.xaml.vb">
<DependentUpon>OnlyProdToolDbWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="Utility\Configuration.vb" />
<Compile Include="ProjectFileVM\ProdItem.vb" />
<Compile Include="Utility\DimensionsIniFile.vb" />
@@ -326,14 +314,6 @@
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="ConfigurationPage\OnlyProdQParameter_ConfigurationPageV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ConfigurationPage\QParameter_ConfigurationPageV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="EgtColorPicker\EgtColorPickerV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -406,14 +386,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SetUpWindow\OnlyProdSetUpWindowV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ToolsDbWindow\OnlyProdToolDbWindowV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ViewPanel\ViewPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -1,20 +1,6 @@
<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="{x:Type DataGridColumnHeader}">
<EventSetter Event="SizeChanged" Handler="Cell_SizedChanged" />
<EventSetter Event="MouseRightButtonDown" Handler="Cell_MouseRightButtonDown" />
<!-- Propieta' Header DataGrid -->
<Setter Property="Background" Value="{Binding ColumnHeaderBackground, ElementName=CurrDataGrid}" />
<Setter Property="Foreground" Value="{Binding ColumnHeaderForeground, ElementName=CurrDataGrid}" />
<Setter Property="FontWeight" Value="{Binding ColumnHeaderFontWeight, ElementName=CurrDataGrid}" />
<Setter Property="FontSize" Value="{Binding ColumnHeaderFontSize, ElementName=CurrDataGrid}" />
<Setter Property="HorizontalContentAlignment" Value="{Binding ColumnHeaderHorizontalContentAlignment, ElementName=CurrDataGrid}" />
<Setter Property="Padding" Value="{Binding ColumnHeaderPadding, ElementName=CurrDataGrid}" />
</Style>
</DataGrid.ColumnHeaderStyle>
</DataGrid>
+127 -141
View File
@@ -6,6 +6,7 @@ Imports System.Windows.Controls
Imports System.Windows.Controls.Primitives
Imports System.Windows.Data
Imports System.Windows.Media
Imports System.Windows.Threading
Imports EgtUILib
Imports EgtWPFLib5
@@ -25,6 +26,7 @@ Public Class EgtDataGrid
Sub New()
InitializeComponent()
AddHandler Columns.CollectionChanged, AddressOf Columns_CollectionChanged
End Sub
Public Shadows Property BindingColumns As ObservableCollection(Of EgtDataGridColumn)
@@ -70,6 +72,78 @@ Public Class EgtDataGrid
End If
End Sub
Private Sub Columns_CollectionChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If e.Action = NotifyCollectionChangedAction.Add Then
For Each newColumn As DataGridColumn In e.NewItems
Dispatcher.BeginInvoke(New Action(Sub()
HookHeaderForColumn(newColumn)
End Sub), DispatcherPriority.Loaded)
Next
ElseIf e.Action = NotifyCollectionChangedAction.Remove Then
For Each removedColumn As DataGridColumn In e.OldItems
Dispatcher.BeginInvoke(New Action(Sub()
UnhookHeaderForColumn(removedColumn)
End Sub), DispatcherPriority.Loaded)
Next
End If
End Sub
Private Sub HookHeaderForColumn(ByVal column As DataGridColumn)
Dim headersPresenter = FindVisualChild(Of DataGridColumnHeadersPresenter)(Me)
If headersPresenter Is Nothing Then Return
For Each header In FindVisualChildren(Of DataGridColumnHeader)(headersPresenter)
If header.Column Is column Then
AddHandler header.SizeChanged, AddressOf ColumnHeader_SizeChanged
AddHandler header.MouseRightButtonDown, AddressOf ColumnHeader_MouseRightButtonDown
Exit For
End If
Next
End Sub
Private Sub UnhookHeaderForColumn(ByVal column As DataGridColumn)
Dim headersPresenter = FindVisualChild(Of DataGridColumnHeadersPresenter)(Me)
If headersPresenter Is Nothing Then Return
For Each header In FindVisualChildren(Of DataGridColumnHeader)(headersPresenter)
If header.Column Is column Then
RemoveHandler header.SizeChanged, AddressOf ColumnHeader_SizeChanged
RemoveHandler header.MouseRightButtonDown, AddressOf ColumnHeader_MouseRightButtonDown
Exit For
End If
Next
End Sub
Private Function FindVisualChild(Of T As DependencyObject)(ByVal parent As DependencyObject) As T
Dim tChild As T = Nothing
For i As Integer = 0 To VisualTreeHelper.GetChildrenCount(parent) - 1
Dim child = VisualTreeHelper.GetChild(parent, i)
tChild = TryCast(child, T)
If tChild IsNot Nothing Then Return tChild
Dim result = FindVisualChild(Of T)(child)
If result IsNot Nothing Then Return result
Next
Return Nothing
End Function
Private Iterator Function FindVisualChildren(Of T As DependencyObject)(ByVal parent As DependencyObject) As IEnumerable(Of T)
Dim tChild As T = Nothing
For i As Integer = 0 To VisualTreeHelper.GetChildrenCount(parent) - 1
Dim child = VisualTreeHelper.GetChild(parent, i)
tChild = TryCast(child, T)
If tChild IsNot Nothing Then Yield tChild
For Each descendant In FindVisualChildren(Of T)(child)
Yield descendant
Next
Next
End Function
Private Sub collectionChanged(ByVal sender As Object, ByVal e As NotifyCollectionChangedEventArgs)
Select Case e.Action
Case NotifyCollectionChangedAction.Add
@@ -78,11 +152,11 @@ Public Class EgtDataGrid
For Each one As EgtDataGridColumn In e.NewItems
Try
Dim col As DataGridColumn = CurrDataGrid.FindResource(one.Name)
Dim col As DataGridColumn = Me.FindResource(one.Name)
one.InitColumn(col)
CurrDataGrid.Columns.Insert(e.NewStartingIndex, col)
Me.Columns.Insert(e.NewStartingIndex, col)
If col.DisplayIndex <> e.NewStartingIndex Then
CurrDataGrid.Columns(e.NewStartingIndex).DisplayIndex = e.NewStartingIndex
Me.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)
@@ -95,34 +169,34 @@ Public Class EgtDataGrid
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)
Dim col As DataGridColumn = Me.FindResource(one.Name)
Me.Columns.Remove(col)
Next
End If
Case NotifyCollectionChangedAction.Move
'Dim col As DataGridColumn = CurrDataGrid.FindResource(BindingColumns(e.OldStartingIndex))
'Dim col As DataGridColumn = Me.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
Me.Columns.Move(e.OldStartingIndex, e.NewStartingIndex)
Me.Columns(e.NewStartingIndex).DisplayIndex = e.NewStartingIndex
'Dim x = Me.Columns(e.OldStartingIndex).DisplayIndex
Case NotifyCollectionChangedAction.Reset
CurrDataGrid.Columns.Clear()
Me.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)
Dim col As DataGridColumn = Me.FindResource(one)
Me.Columns.Add(col)
Next
End If
Case NotifyCollectionChangedAction.Replace
Dim col As DataGridColumn = CurrDataGrid.FindResource(e.NewItems(0))
CurrDataGrid.Columns(e.NewStartingIndex) = col
Dim col As DataGridColumn = Me.FindResource(e.NewItems(0))
Me.Columns(e.NewStartingIndex) = col
End Select
End Sub
Private Sub Cell_SizedChanged(sender As Object, e As SizeChangedEventArgs)
Private Sub ColumnHeader_SizeChanged(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
@@ -132,17 +206,17 @@ Public Class EgtDataGrid
End If
End Sub
Private Sub DataGrid_SizedChanged(sender As Object, e As SizeChangedEventArgs) Handles CurrDataGrid.SizeChanged
Private Sub DataGrid_SizedChanged(sender As Object, e As SizeChangedEventArgs) Handles Me.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
If Me.ActualWidth - LASTCOLUMN_MINWIDTH > columnsWidth Then
' nascondo la ScrollBar orizzontale e setto lo UnitType dell'ultima colonna visibile a Star
ScrollViewer.SetHorizontalScrollBarVisibility(CurrDataGrid, ScrollBarVisibility.Hidden)
ScrollViewer.SetHorizontalScrollBarVisibility(Me, 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)
ScrollViewer.SetHorizontalScrollBarVisibility(Me, ScrollBarVisibility.Visible)
For Each bc In BindingColumns
If bc.Width.IsStar Then
bc.Width = New DataGridLength(bc.ActualWidth, DataGridLengthUnitType.Pixel)
@@ -170,7 +244,7 @@ Public Class EgtDataGrid
End If
End Sub
Private Sub Cell_MouseRightButtonDown(sender As Object, e As RoutedEventArgs)
Private Sub ColumnHeader_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()
@@ -254,12 +328,12 @@ Public Class EgtDataGrid
cm.IsOpen = True
End Sub
Private Sub CurrDataGrid_ColumnReordering(sender As Object, e As DataGridColumnEventArgs) Handles CurrDataGrid.ColumnReordering
Private Sub CurrDataGrid_ColumnReordering(sender As Object, e As DataGridColumnEventArgs) Handles Me.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
Private Sub CurrDataGrid_ColumnReordered(sender As Object, e As DataGridColumnEventArgs) Handles Me.ColumnReordered
' scambio le colonne in BindingColumns
BindingColumns.Move(OldIndex, e.Column.DisplayIndex)
' scrivo tutte le colonne interessate dallo spostamento
@@ -315,12 +389,12 @@ Public Class EgtDataGrid
ResetSortDirections()
End Sub
Private Sub CurrDataGrid_Loaded(sender As Object, e As RoutedEventArgs) Handles CurrDataGrid.Loaded
Private Sub CurrDataGrid_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.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))
Me.Items.SortDescriptions.Add(New SortDescription(Me.Columns(colIndex).SortMemberPath, col.SortDirection - 1))
Exit For
End If
colIndex += 1
@@ -333,7 +407,7 @@ Public Class EgtDataGrid
Next
End Sub
Private Sub CurrDataGrid_Sorting(sender As Object, e As DataGridSortingEventArgs) Handles CurrDataGrid.Sorting
Private Sub CurrDataGrid_Sorting(sender As Object, e As DataGridSortingEventArgs) Handles Me.Sorting
' salvo la SortDirection corrente della colonna prima di resettarla per tutte le colonne
Dim CurrSortDirection As ListSortDirection? = e.Column.SortDirection
ResetSortDirections(True)
@@ -356,129 +430,16 @@ Public Class EgtDataGrid
Next
Else
' altrimenti (caso ResetSort da ContextMenu) è necessatio un Clear più ampio e anche grafico
CurrDataGrid.Items.SortDescriptions.Clear()
Me.Items.SortDescriptions.Clear()
For Each column In BindingColumns
column.SortDirection = 0
' resetto graficamente anche l'header della colonna
CurrDataGrid.Columns(column.DisplayIndex).SortDirection = Nothing
Me.Columns(column.DisplayIndex).SortDirection = Nothing
Next
RaiseEvent ResetSort()
End If
End Sub
#Region "COLUMN HEADER PROPERTY DATAGRID"
#Region "BACKGROUND HEADER"
Public Shared ReadOnly ColumnHeaderBackgroundProperty As DependencyProperty = DependencyProperty.Register("ColumnHeaderBackground",
GetType(Brush),
GetType(EgtDataGrid),
New FrameworkPropertyMetadata(SystemColors.ControlBrush))
Public Property ColumnHeaderBackground As Brush
Get
Return DirectCast(GetValue(ColumnHeaderBackgroundProperty), Brush)
End Get
Set(value As Brush)
SetValue(ColumnHeaderBackgroundProperty, value)
End Set
End Property
#End Region ' BackGround Heder
#Region "FOREGROUND HEADER"
Public Shared ReadOnly ColumnHeaderForegroundProperty As DependencyProperty = DependencyProperty.Register("ColumnHeaderForeground",
GetType(Brush),
GetType(EgtDataGrid),
New FrameworkPropertyMetadata(SystemColors.ControlTextBrush))
Public Property ColumnHeaderForeground As Brush
Get
Return DirectCast(GetValue(ColumnHeaderForegroundProperty), Brush)
End Get
Set(value As Brush)
SetValue(ColumnHeaderForegroundProperty, value)
End Set
End Property
#End Region ' Foreground Header
#Region "FONTWEIGHT HEADER"
Public Shared ReadOnly ColumnHeaderFontWeightProperty As DependencyProperty = DependencyProperty.Register("ColumnHeaderFontWeight",
GetType(FontWeight),
GetType(EgtDataGrid),
New FrameworkPropertyMetadata(FontWeights.Normal))
Public Property ColumnHeaderFontWeight As FontWeight
Get
Return DirectCast(GetValue(ColumnHeaderFontWeightProperty), FontWeight)
End Get
Set(value As FontWeight)
SetValue(ColumnHeaderFontWeightProperty, value)
End Set
End Property
#End Region ' FontWeight Header
#Region "FONTSIZE HEADER"
Public Shared ReadOnly ColumnHeaderFontSizeProperty As DependencyProperty = DependencyProperty.Register("ColumnHeaderFontSize",
GetType(Double),
GetType(EgtDataGrid),
New FrameworkPropertyMetadata(Convert.ToDouble(12)))
Public Property ColumnHeaderFontSize As Double
Get
Return DirectCast(GetValue(ColumnHeaderFontSizeProperty), Double)
End Get
Set(value As Double)
SetValue(ColumnHeaderFontSizeProperty, value)
End Set
End Property
#End Region ' FontSize Header
#Region "HORIZONTAKCONTENTALIGNMENT HEADER"
Public Shared ReadOnly ColumnHeaderHorizontalContentAlignmentProperty As DependencyProperty = DependencyProperty.Register("ColumnHeaderHorizontalContentAlignment",
GetType(HorizontalAlignment),
GetType(EgtDataGrid),
New FrameworkPropertyMetadata(HorizontalAlignment.Stretch))
Public Property ColumnHeaderHorizontalContentAlignment As HorizontalAlignment
Get
Return DirectCast(GetValue(ColumnHeaderHorizontalContentAlignmentProperty), HorizontalAlignment)
End Get
Set(value As HorizontalAlignment)
SetValue(ColumnHeaderHorizontalContentAlignmentProperty, value)
End Set
End Property
#End Region ' HorizontalContentAlignment Header
#Region "PADDING HEADER"
Public Shared ReadOnly ColumnHeaderPaddingProperty As DependencyProperty = DependencyProperty.Register("ColumnHeaderPadding",
GetType(Thickness),
GetType(EgtDataGrid),
New FrameworkPropertyMetadata(New Thickness(0)))
Public Property ColumnHeaderPadding As Thickness
Get
Return DirectCast(GetValue(ColumnHeaderPaddingProperty), Thickness)
End Get
Set(value As Thickness)
SetValue(ColumnHeaderPaddingProperty, value)
End Set
End Property
#End Region ' Padding Header
#End Region ' Column Header Property DataGrid
End Class
Public Class EgtDataGridColumn
@@ -522,7 +483,11 @@ Public Class EgtDataGridColumn
Private Property m_Width As DataGridLength
Public Property Width As DataGridLength
Get
If Not IsNothing(m_dgColumn) Then
Return m_dgColumn.Width
Else
Return m_Width
End If
End Get
Set(value As DataGridLength)
If Not IsNothing(m_dgColumn) Then
@@ -539,10 +504,14 @@ Public Class EgtDataGridColumn
End Get
End Property
Private Property m_DisplayIndex As Integer
Private Property m_DisplayIndex As Integer = -1
Public Property DisplayIndex As Integer
Get
If Not IsNothing(m_dgColumn) Then
Return m_dgColumn.DisplayIndex
Else
Return m_DisplayIndex
End If
End Get
Set(value As Integer)
If Not IsNothing(m_dgColumn) Then
@@ -557,7 +526,11 @@ Public Class EgtDataGridColumn
Private Property m_IsReadOnly As Boolean = True
Public Property IsReadOnly As Boolean
Get
If Not IsNothing(m_dgColumn) Then
Return m_dgColumn.IsReadOnly
Else
Return m_IsReadOnly
End If
End Get
Set(value As Boolean)
If Not IsNothing(m_dgColumn) Then
@@ -575,7 +548,11 @@ Public Class EgtDataGridColumn
Private m_CanUserReorder As Boolean
Public Property CanUserReorder As Boolean
Get
If Not IsNothing(m_dgColumn) Then
Return m_dgColumn.CanUserReorder
Else
Return m_CanUserReorder
End If
End Get
Set(value As Boolean)
If Not IsNothing(m_dgColumn) Then
@@ -591,7 +568,11 @@ Public Class EgtDataGridColumn
Private m_CanUserResize As Boolean
Public Property CanUserResize As Boolean
Get
If Not IsNothing(m_dgColumn) Then
Return m_dgColumn.CanUserResize
Else
Return m_CanUserResize
End If
End Get
Set(value As Boolean)
If Not IsNothing(m_dgColumn) Then
@@ -606,7 +587,11 @@ Public Class EgtDataGridColumn
Private m_CanUserSort As Boolean
Public Property CanUserSort As Boolean
Get
If Not IsNothing(m_dgColumn) Then
Return m_dgColumn.CanUserSort
Else
Return m_CanUserSort
End If
End Get
Set(value As Boolean)
If Not IsNothing(m_dgColumn) Then
@@ -721,6 +706,7 @@ Public Class EgtDataGridColumn
' funzione per calcolare e scrivere la stringa dei parametri della colonna nell'INI
Public Function SaveDataGridColumn() As Boolean
If DisplayIndex = -1 Then Return False
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)
@@ -59,12 +59,7 @@ Public Module LoadingWndHelper
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 Object
If bOnlyProd Then
LoadingWnd = New OnlyProdLoadingWndV(Nothing, m_LoadingWndVM)
Else
LoadingWnd = New LoadingWndV(Nothing, m_LoadingWndVM)
End If
Dim LoadingWnd As New OnlyProdLoadingWndV(Nothing, m_LoadingWndVM)
' posiziono la finestra
If WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen Then
LoadingWnd.WindowStartupLocation = Windows.WindowStartupLocation.CenterScreen
@@ -88,7 +88,6 @@ Public Class MyMachGroupPanelM
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)
@@ -342,7 +341,9 @@ Public Class MyMachGroupPanelM
End Sub
Public Shared Sub SetDuploModified(nPartId As Integer)
If Configuration.bOnlyProd Then
Dim nDuploCount As Integer = 0
EgtDuploCount(nPartId, nDuploCount)
If nDuploCount > 0 Then
' segno modificato e aggiorno duplo
EgtDuploSetModified(nPartId)
UpdateDuplo(nPartId)
@@ -353,8 +354,6 @@ Public Class MyMachGroupPanelM
For Each CurrMachGroup As MyMachGroupVM In DuploList
CurrMachGroup.RefreshMachGroup()
Next
Else
EgtDuploSetModified(nPartId)
End If
End Sub
@@ -28,16 +28,16 @@
ToolTip="{Binding ToolDBToolTip}"
Command="{Binding ToolDbCommand}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
<Button Content="{Binding MachiningDbMsg}"
<!--<Button Content="{Binding MachiningDbMsg}"
Command="{Binding MachDbCommand}"
ToolTip="{Binding MachiningDbToolTip}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}" Width="100"/>
Style="{StaticResource GeneralConfigurationToolBar_TextButton}" Width="100"/>-->
<Button Content="{Binding SetUpMsg}"
Command="{Binding SetUpCommand}"
ToolTip="{Binding SetUpToolTip}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"
Visibility="{Binding SetUp_Visibility}"/>
<Button ToolTip="{Binding BeamTable_ToolTip}"
<!--<Button ToolTip="{Binding BeamTable_ToolTip}"
Command="{Binding BeamTable_Command}"
Visibility="{Binding BeamTable_Visibility}"
Style="{StaticResource ToolBarWarehouse_Button}">
@@ -48,7 +48,7 @@
Visibility="{Binding WallTable_Visibility}"
Style="{StaticResource ToolBarWarehouse_Button}">
<Image Source="/Resources/Configuration/MachiningsTable.png" Stretch="Uniform"/>
</Button>
</Button>-->
<Button Content="{Binding ParameterMachineMsg}"
ToolTip="{Binding ParameterMachineMsg}"
Command="{Binding ParameterMachine_Command}"
@@ -90,8 +90,7 @@
</Grid>
</GroupBox>
<EgtBEAMWALL:EgtDataGrid x:Name="MainDataGrid"
Grid.Row="1"
<EgtBEAMWALL:EgtDataGrid Grid.Row="1"
ItemsSource="{Binding ProjectList}"
SelectedItem="{Binding SelProject}"
CanUserAddRows="False"
@@ -104,7 +103,6 @@
Margin="5"
RowDetailsVisibilityMode="Visible"
CellEditEnding="MainDataGrid_CellEditEnding"
ColumnHeaderBackground="{x:Null}"
BindingColumns="{Binding ProdColumns}">
<DataGrid.Resources>
<!-- ProdId -->
@@ -106,12 +106,7 @@
CellEditEnding="MainDataGrid_CellEditEnding"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Teal}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
ColumnHeaderStyle="{StaticResource Main_DataGridColumnHeader}"
Style="{StaticResource DataGrid_OnlyProd}"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}">
<DataGrid.Resources>
@@ -102,12 +102,7 @@
BindingColumns="{Binding ProjectColumns}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Teal}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
ColumnHeaderStyle="{StaticResource Main_DataGridColumnHeader}"
Style="{StaticResource DataGrid_OnlyProd}"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}">
<DataGrid.RowStyle>
@@ -94,7 +94,6 @@
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ColumnHeaderBackground="{x:Null}"
Margin="5"
BindingColumns="{Binding ProjectColumns}">
<DataGrid.Resources>
@@ -1,208 +0,0 @@
<EgtWPFLib5:EgtCustomWindow x:Class="OnlyProdSetUpWindowV"
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"
Title="{Binding TitleMsg}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
CloseCommand="{Binding CloseSetUpCommand, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<EgtWPFLib5:EgtCustomWindow.Resources>
<Style x:Key="HorizontalScrollViewerItemsControlStyle" TargetType="{x:Type ItemsControl}">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ItemsControl}">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" >
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</EgtWPFLib5:EgtCustomWindow.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<UniformGrid Columns="4">
<Button Content="{Binding ApplyMsg}" Command="{Binding ApplyCommand}"
IsEnabled="{Binding IsEnabledApplyBtn}" Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding ArchiveMsg}" Command="{Binding ArchiveCommand}" Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding RetrievesMsg}" Command="{Binding RetrievesCommand}" Height="30"
CommandParameter="{Binding SelectedItem,ElementName=ToolsTreeView}"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding AutomaticMsg}" Command="{Binding AutomaticCommand}" Height="30"
CommandParameter="{Binding SelectedItem,ElementName=ToolsTreeView}"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
</UniformGrid>
<TreeView Grid.Row="1" Name="ToolsTreeView" ItemsSource="{Binding ToolsList}">
<TreeView.Style>
<Style TargetType="{x:Type TreeView}">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.35,0">
<GradientStop Color="{StaticResource BeamWall_Mercury_Color}" Offset="0"/>
<GradientStop Color="{StaticResource BeamWall_Concrete_Color}" Offset="0.45"/>
<GradientStop Color="{StaticResource BeamWall_White_Color}" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
</TreeView.Style>
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
<EventSetter Event="MouseDoubleClick" Handler="Tool_DoubleClick"/>
</Style>
</TreeView.ItemContainerStyle>
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:FamilyToolItem}" ItemsSource="{Binding Items}">
<Grid Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding PictureString}" Height="20" Width="20" Margin="0,0,5,0" />
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="0,-2,5,0" VerticalAlignment="Center" />
<Ellipse Grid.Column="2" Height="10" Width="10" Fill="{Binding FamilyColor}" />
</Grid>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type EgtWPFLib5:ToolItem}">
<Grid Height="20" ToolTip="{Binding ToolTipMsg}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Margin="0,8,6,4" />-->
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="0,-2,5,0" VerticalAlignment="Center" />
<Ellipse Grid.Column="2" Height="10" Width="10" Fill="{Binding ToolColor}" />
</Grid>
</DataTemplate>
</TreeView.Resources>
</TreeView>
</Grid>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding SetUpImage}" MaxWidth="300"/>
<ItemsControl Grid.Column="1" ItemsSource="{Binding PositionGroupList}"
Style="{DynamicResource HorizontalScrollViewerItemsControlStyle}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ItemsControl Grid.Column="1" ItemsSource="{Binding PositionList}" Margin="0,0,20,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="5,5,15,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding TcPos}"/>
<ItemsControl Grid.Column="1" ItemsSource="{Binding ExitToolAssociationList}"
HorizontalAlignment="Left">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<!--<WrapPanel Orientation="Horizontal" MaxWidth="200"/>-->
<UniformGrid Columns="1"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="10,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<ToggleButton Content="{Binding ExitPar}" Name="ExitBtn"
CommandParameter="{Binding SelectedItem,ElementName=ToolsTreeView}"
IsChecked="{Binding IsOccupied}" Height="25" Width="25" Margin="0,0,5,0"
Command="{Binding SetUpToolCommand}"
IsEnabled="{Binding IsEnabledPos}"
Background="{Binding ExitBtnBackgroundCol}"/>
<Border x:Name="ToolBorder" Grid.Column="1" BorderBrush="#4D84C4"
BorderThickness="1" ToolTip="{Binding ToolTipMsg}">
<Border.Style>
<Style TargetType="{x:Type Border}">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ExitBtn, Path=IsChecked}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<TextBlock Text="{Binding Tool.Name}" Margin="3"/>
</Border>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -1,31 +0,0 @@
Imports EgtWPFLib5
Imports System.Windows.Controls
Imports System.Windows.Input
Public Class OnlyProdSetUpWindowV
Private WithEvents m_SetUpWindowVM As SetUpWindowVM
Sub New(Owner As System.Windows.Window, SetUpWindowVM As SetUpWindowVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = SetUpWindowVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_SetUpWindowVM = SetUpWindowVM
End Sub
Private Sub Tool_DoubleClick(sender As Object, e As MouseButtonEventArgs)
Dim TreeViewItem As TreeViewItem = DirectCast(sender, TreeViewItem)
If TypeOf TreeViewItem.DataContext Is ToolItem Then
Dim SelTool As ToolItem = DirectCast(TreeViewItem.DataContext, ToolItem)
m_SetUpWindowVM.ToolDoubleClick(SelTool)
e.Handled = True
End If
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_SetUpWindowVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -1,138 +0,0 @@
<EgtWPFLib5:EgtCustomWindow x:Class="OnlyProdToolDbWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="{Binding Title}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
CloseCommand="{Binding CloseToolsDbCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
CloseCommandParameter="{Binding Path=SelectedItem, ElementName=ToolsTreeView}"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<EgtWPFLib5:EgtCustomWindow.InputBindings>
<KeyBinding Key="Escape" Command="{Binding ReloadToolCommand}"
CommandParameter="{Binding Path=SelectedItem,ElementName=ToolsTreeView}"/>
</EgtWPFLib5:EgtCustomWindow.InputBindings>
<EgtWPFLib5:EgtCustomWindow.Resources>
<EgtWPFLib5:ToolDrawUUIDConverter x:Key="ToolDrawUUIDConverter"/>
<EgtWPFLib5:ErrorVisibilityConverter x:Key="ErrorVisibilityConverter"/>
</EgtWPFLib5:EgtCustomWindow.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.75*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<UniformGrid Grid.Row="0" Columns="3">
<Button Content="{Binding NewMsg}" Command="{Binding NewCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=ToolsTreeView}"
IsEnabled="{Binding IsEnabledNewBtn, Mode=OneWay}" Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding SaveMsg}" Command="{Binding SaveCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=ToolsTreeView}"
IsEnabled="{Binding IsEnabledSaveBtn, Mode=OneWay}" Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding RemoveMsg}" Command="{Binding RemoveCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=ToolsTreeView}"
IsEnabled="{Binding IsEnabledRemoveBtn, Mode=OneWay}" Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
</UniformGrid>
<TreeView Name="ToolsTreeView" Grid.Row="1" ItemsSource="{Binding ToolsList}">
<TreeView.Style>
<Style TargetType="{x:Type TreeView}">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.35,0">
<GradientStop Color="{StaticResource BeamWall_Mercury_Color}" Offset="0"/>
<GradientStop Color="{StaticResource BeamWall_Concrete_Color}" Offset="0.45"/>
<GradientStop Color="{StaticResource BeamWall_White_Color}" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
</TreeView.Style>
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
<Setter Property="IsEnabled" Value="{Binding IsEnabled, Mode=TwoWay}" />
</Style>
</TreeView.ItemContainerStyle>
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type EgtWPFLib5:FamilyToolTreeViewItem}" ItemsSource="{Binding Items}">
<Grid Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding PictureString}" Height="20" Width="20" Margin="0,0,5,0" />
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="0,-2,5,0" VerticalAlignment="Center" />
</Grid>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type EgtWPFLib5:ToolTreeViewItem}">
<Grid Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Margin="0,8,6,4" />-->
<CheckBox Name="ActiveTxBx" Grid.Column="0" Height="15" Width="15" Margin="-15,0,5,0" VerticalContentAlignment="Center"
IsChecked="{Binding Active}"
Visibility="{Binding Path=DataContext.Active_Visibility,
RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
<TextBlock Grid.Column="1" Text="{Binding NamePar}" FontSize="15" Margin="0,-2,5,0" VerticalAlignment="Center" />
</Grid>
</DataTemplate>
</TreeView.Resources>
</TreeView>
<UniformGrid Grid.Row="2" Columns="3">
<Button Content="{Binding ImportMsg}"
Command="{Binding ImportCommand}"
IsEnabled="{Binding IsEnabledImpExpBtn, Mode=OneWay}"
Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding ExportMsg}"
Command="{Binding ExportCommand}"
IsEnabled="{Binding IsEnabledImpExpBtn, Mode=OneWay}"
Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
<Button Content="{Binding ResetMsg}"
Command="{Binding ReloadToolCommand}"
CommandParameter="{Binding Path=SelectedItem,ElementName=ToolsTreeView}"
Height="30"
Style="{StaticResource OnlyRightPanel_HalfRound_Button}"/>
</UniformGrid>
</Grid>
<ContentControl Content="{Binding Path=ParamPageV}" Grid.Column="1"/>
<!--ContentControl che ospita la scena restituita sotto forma di WindowsFormsHost-->
<ContentControl Content="{Binding ToolSceneHost}" Grid.Column="2"/>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -1,33 +0,0 @@
Imports EgtWPFLib5
Imports System.Windows.Input
Imports EgtUILib
Public Class OnlyProdToolDbWindowV
Private WithEvents m_ToolDbWindowVM As ToolDbWindowVM
Sub New(Owner As System.Windows.Window, ToolDbWindowVM As ToolDbWindowVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ToolDbWindowVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ToolDbWindowVM = ToolDbWindowVM
End Sub
Private Sub ToolsDbView_Closed(bDialogResult As Boolean) Handles m_ToolDbWindowVM.m_CloseWindow
' Imposto contesto generale
EgtSetCurrentContext(ToolDbWindowVM.ProjectSceneContext)
' Cancello contesto di visualizzazione utensile
EgtDeleteContext(ToolDbWindowVM.ToolDbSceneContext)
Me.Close()
End Sub
Private Sub ToolsDbView_Closing(sender As Object, e As System.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
-41
View File
@@ -6,19 +6,6 @@ Public Module Configuration
' Test per comunicazione
Public m_commLib As DataSyncro
''' <summary>
''' Flag per impostare la visualizzazione con la singola pagina
''' </summary>
Private m_bOnlyProd As Boolean
Public ReadOnly Property bOnlyProd As Boolean
Get
Return m_bOnlyProd
End Get
End Property
Public Sub SetOnlyProd(value As Boolean)
m_bOnlyProd = value
End Sub
''' <summary>
''' Flag per visualizzare il pulsante Db Attrezzaggi
''' </summary>
@@ -80,34 +67,6 @@ Public Module Configuration
IniFile.m_sIniFile = m_sConfigDir & "\" & Core.ConstIni.INI_FILE_NAME
End Sub
''' <summary>
''' Funzione per recuperare bOnlyProd
''' </summary>
''' <param name="Section">Sezione dove si trova la variabile che devo cercare</param>
''' <param name="Key">Variabile che sto cercando</param>
''' <param name="Path">Cartella dove e' presente il file ini</param>
''' <param name="Default_Value">Valore di defaul opzionabile</param>
''' <returns></returns>
Public Function Read_Value(Section As String, Key As String, Path As String, Optional Default_Value As String = "") As String
Dim Reader_Lines As String() = System.IO.File.ReadAllLines(Path)
Dim Current_Section As String = ""
For Each Reader_Line As String In Reader_Lines
If Reader_Line.StartsWith("[") AndAlso Reader_Line.EndsWith("]") Then
Current_Section = Reader_Line
ElseIf Current_Section.Equals($"[{Section}]") Then
Dim lineParts As String() = Reader_Line.Split({"="c}, 2)
If lineParts.Length >= 1 AndAlso lineParts(0) = Key Then
Return If(lineParts.Length >= 2, lineParts(1), Default_Value)
End If
End If
Next
Return Default_Value
End Function
''' <summary>
''' Metodo che controlla la comunicazione server
''' </summary>
+1 -1
View File
@@ -2,7 +2,7 @@
<packages>
<package id="EgwProxy.LiMan" version="1.0.2408.718" targetFramework="net472" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net472" />
<package id="RestSharp" version="111.2.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Memory" version="4.5.5" targetFramework="net472" />
@@ -71,7 +71,7 @@
<HintPath>..\packages\MySql.Data.EntityFramework.8.0.21\lib\net452\MySql.Data.EntityFramework.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.5.0.1\lib\net46\NLog.dll</HintPath>
+1 -1
View File
@@ -9,7 +9,7 @@
<package id="K4os.Hash.xxHash" version="1.0.8" targetFramework="net472" />
<package id="MySql.Data" version="8.0.21" targetFramework="net472" />
<package id="MySql.Data.EntityFramework" version="8.0.21" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" />
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net472" />
<package id="NLog" version="5.0.1" targetFramework="net472" />
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
<package id="SSH.NET" version="2016.1.0" targetFramework="net472" />
@@ -0,0 +1,52 @@
<Window x:Class="AboutBoxV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="AboutBox" Height="400" Width="360" WindowStyle="None" ResizeMode="NoResize"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
<Border BorderThickness="2" BorderBrush="LightBlue">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1.75*"/>
<RowDefinition Height="0.15*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="2.5*"/>
<RowDefinition Height="0.35*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.35*"/>
</Grid.RowDefinitions>
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Name="LogoBrd" Grid.Column="1" Background="White">
<Image Source="/Resources/AboutBox/EgalwareLogo.png" Stretch="Uniform"/>
</Border>
</Grid>
<TextBlock Name="DescriptionLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18" />
<TextBlock Name="VersionLbl" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="12" />
<TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" FontSize="12" IsReadOnly="True" TextWrapping="Wrap"/>
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="8" IsCancel="True"
Margin="100,0"/>
</Grid>
</Border>
</Window>
@@ -0,0 +1,40 @@
Imports EgtUILib
Imports EgtBEAMWALL.Core
Public Class AboutBoxV
Private Sub AboutBoxWD_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
DescriptionLbl.Text = My.Application.Info.Description.ToString()
VersionLbl.Text = "Version : " & My.Application.Info.Version.Major.ToString() &
"." & My.Application.Info.Version.Minor.ToString() &
(ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
My.Application.Info.Version.Revision.ToString()
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
Dim sInfo As String = String.Empty
Dim sKey As String = String.Empty
EgtGetKeyInfo(sKey)
Dim sKlev As String = Map.refMainWindowVM.MainWindowM.nKeyLevel.ToString()
Dim sOpts As String = Map.refMainWindowVM.MainWindowM.nKeyOptions.ToString()
Dim sLeftDays As String = ""
Dim nLeftDays As Integer
if EgtGetKeyLeftDays( nLeftDays) AndAlso nLeftDays < 500 Then sLeftDays= " (" & nLeftDays.ToString() & ")"
sInfo = If( EgtIsDebug(), "*** Debug Libraries ***" & Environment.NewLine, "")
sInfo &= "User " & Environment.MachineName & "\" & Environment.UserName &
" (" & Map.refMainWindowVM.MainWindowM.nInstance.ToString() & ")" & Environment.NewLine
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
Dim sOpSys As String = String.Empty
EgtGetOsInfo( sOpSys)
sInfo &= sOpSys & Environment.NewLine
Dim sCPU As String = String.Empty
EgtGetCpuInfo( sCPU)
sInfo &= sCPU & Environment.NewLine
Dim sScene As String = String.Empty
EgtGetSceneInfo(sScene)
sInfo &= sScene
InfoLbl.Text = sInfo
ExitBtn.Content = EgtMsg(10104) 'Ok
End Sub
End Class
@@ -0,0 +1,120 @@
<EgtWPFLib5:EgtCustomWindow x:Class="AddFeatureWndV"
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"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
Title="AddProcess"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Background="{StaticResource BeamWall_Kashmir}" Margin="0,2,0,2" CornerRadius="4,0,0,4">
<TextBlock Text="{Binding Process_Msg}"
Style="{StaticResource ListTextBlock}"/>
</Border>
<Border Grid.Row="1"
Style="{StaticResource OnlyProdPage_Border}"
CornerRadius="4,0,0,4"
BorderThickness="2,2,0,2">
<ListBox Grid.Row="1"
ItemsSource="{Binding PRCListView}"
SelectedItem="{Binding nSelPRC}"
Style="{StaticResource NewAddFeature_ListBox}"
ItemContainerStyle="{StaticResource AlternationIndex_ListBoxItem}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ghDesc}"
ToolTip="{Binding ghDesc}"
TextAlignment="Justify"
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}}"
Style="{StaticResource OptionTextBlock}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
<Border Grid.Column="1" Background="{StaticResource BeamWall_Kashmir}" Margin="0,2,0,2">
<TextBlock Grid.Column="1"
Text="{Binding Custom_Msg}"
Style="{StaticResource ListTextBlock}"/>
</Border>
<Border Grid.Row="1"
Grid.Column="1"
Style="{StaticResource OnlyProdPage_Border}"
CornerRadius="0"
BorderThickness="0,2,0,2">
<ListBox ItemsSource="{Binding MacroCustomList}"
SelectedIndex="{Binding nSelMacroCustom}"
Style="{StaticResource MacroCustom_ListBox}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Style="{StaticResource MacroCustom_WrapPanel}"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding sMacroName}"
Style="{StaticResource Macro_TextBlock}"/>
<Image Grid.Row="1"
Source="{Binding sMacroDrawPath}"
Style="{StaticResource Macro_Image}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
<Border Grid.Column="2" Background="{StaticResource BeamWall_Kashmir}" Margin="0,2,0,2" Padding="0,10,0,10" CornerRadius="0,4,4,0">
<TextBlock
Text="{Binding Default_Msg}"
Style="{StaticResource ListTextBlock}"/>
</Border>
<Border Grid.Row="1"
Grid.Column="2"
Style="{StaticResource OnlyProdPage_Border}"
CornerRadius="0,4,4,0"
BorderThickness="0,2,2,2">
<ListBox ItemsSource="{Binding MacroDefaultList}"
SelectedIndex="{Binding nSelMacroDefault}"
Style="{StaticResource MacroDefault_ListBox}"
ItemContainerStyle="{StaticResource AlternationIndex_ListBoxItem}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding sMacroName}"
TextAlignment="Justify"
Style="{StaticResource MacroDefault_TextBlock}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
<UniformGrid Columns="2"
Grid.Row="2"
Grid.ColumnSpan="3"
Margin="5">
<Button Content="{Binding OK_Msg}"
Command="{Binding Ok_Command}"
IsDefault="True"
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
<Button Content="{Binding Cancel_Msg}"
IsCancel="True"
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,17 @@
Public Class AddFeatureWndV
Private WithEvents m_AddFeatureWndVM As AddFeatureWndVM
Sub New(Owner As Window, AddFeatureWndVM As AddFeatureWndVM)
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
Me.DataContext = AddFeatureWndVM
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
m_AddFeatureWndVM = AddFeatureWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddFeatureWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,422 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Public Class AddFeatureWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
Friend m_MacroFilePathList As List(Of String)
Friend m_MacroCustomFilePathList As List(Of String)
Private m_PrevSelPRCIndex_L As Integer = 0
Private m_PrevSelPRCIndex_T As Integer = 0
Private m_SelGRPType As GRPType
Public Property SelGRPType As Integer
Get
Return m_SelGRPType
End Get
Set(value As Integer)
m_SelGRPType = value
' carico lista process
Dim TempPRCList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileProcessList(m_SelGRPType, TempPRCList)
m_PRCList.Clear()
For Each PRC In TempPRCList
' leggo gruppi
Dim GRPList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileGRPList(m_SelGRPType, PRC, GRPList)
m_PRCList.Add(New PRC(If(GRPList.Count > 0, GRPList(0), m_SelGRPType), PRC, GetBeamPrivateProfileName(m_SelGRPType, PRC)))
Next
If m_SelGRPType = GRPType.L Then
nSelPRC = PRCList(m_PrevSelPRCIndex_L)
ElseIf m_SelGRPType = GRPType.T Then
nSelPRC = PRCList(m_PrevSelPRCIndex_T)
End If
NotifyPropertyChanged(NameOf(PRCList))
NotifyPropertyChanged(NameOf(nSelPRC))
End Set
End Property
Private m_PRCList As New ObservableCollection(Of PRC)
Public ReadOnly Property PRCList As ObservableCollection(Of PRC)
Get
Return m_PRCList
End Get
End Property
Private m_PRCListView As New List(Of PRC)
Public ReadOnly Property PRCListView As List(Of PRC)
Get
Return m_PRCListView
End Get
End Property
#Region "New Macro OnlyProdPage"
Private m_MacroDefaultList As New ObservableCollection(Of Object)
Public ReadOnly Property MacroDefaultList As ObservableCollection(Of Object)
Get
Return m_MacroDefaultList
End Get
End Property
Private m_nSelMacroDefault As Integer = -1
Public Property nSelMacroDefault As Integer
Get
Return m_nSelMacroDefault
End Get
Set(value As Integer)
If value <> m_nSelMacroDefault Then
m_nSelMacroDefault = value
End If
End Set
End Property
#End Region ' New Macro OnlyProdPage
Private m_nSelPRC As PRC = Nothing
Public Property nSelPRC As PRC
Get
Return m_nSelPRC
End Get
Set(value As PRC)
If value IsNot m_nSelPRC Then
m_nSelPRC = value
If Not IsNothing(m_nSelPRC) Then
If SelGRPType = GRPType.L Then
m_PrevSelPRCIndex_L = PRCList.IndexOf(m_nSelPRC)
ElseIf SelGRPType = GRPType.T Then
m_PrevSelPRCIndex_T = PRCList.IndexOf(m_nSelPRC)
End If
End If
NotifyPropertyChanged(NameOf(sDrawPath))
' carico eventuali file Macro
MacroCustomList.Clear()
MacroDefaultList.Clear()
m_MacroFilePathList = New List(Of String)
m_MacroCustomFilePathList = New List(Of String)
If Not IsNothing(nSelPRC) Then
Dim nGRPFromFileName As Integer = 0
Dim nPRCFromFileName As Integer = 0
Dim sMacroNameFromFileName As String = String.Empty
Dim nIdMacroName As Integer = 0
' ricavo lista file Macro Default
GetMacroListDefault(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
' ricavo lista file Macro Custom
GetMacroListCustom(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
If MacroCustomList.Count > 0 Then
MacroList_IsEnabled = True
Else
MacroList_IsEnabled = False
End If
End If
End If
NotifyPropertyChanged(NameOf(nSelPRC))
End Set
End Property
Private m_MacroList_IsEnabled As Boolean
Public Property MacroList_IsEnabled As Boolean
Get
Return m_MacroList_IsEnabled
End Get
Set(value As Boolean)
If value <> m_MacroList_IsEnabled Then
m_MacroList_IsEnabled = value
NotifyPropertyChanged(NameOf(MacroList_IsEnabled))
End If
End Set
End Property
Private m_MacroCustomList As New ObservableCollection(Of Object)
Public ReadOnly Property MacroCustomList As ObservableCollection(Of Object)
Get
Return m_MacroCustomList
End Get
End Property
Private m_nSelMacroCustom As Integer = -1
Public Property nSelMacroCustom As Integer
Get
Return m_nSelMacroCustom
End Get
Set(value As Integer)
If value <> m_nSelMacroCustom Then
m_nSelMacroCustom = value
End If
End Set
End Property
Public ReadOnly Property sDrawPath As String
Get
If IsNothing(m_nSelPRC) Then Return ""
Dim sDescConstruction As String = String.Empty
If m_SelGRPType = GRPType.L Then
sDescConstruction = "L"
Else
sDescConstruction = "T"
End If
sDescConstruction &= m_nSelPRC.nPRC.ToString("000")
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescConstruction & ".png"
End Get
End Property
' Definizione comandi
Private m_cmdOk As ICommand
#Region "Messages"
Public ReadOnly Property Process_Msg As String
Get
Return EgtMsg(61805).ToUpper()
End Get
End Property
Public ReadOnly Property Default_Msg As String
Get
Return EgtMsg(61899).ToUpper()
End Get
End Property
Public ReadOnly Property Custom_Msg As String
Get
Return EgtMsg(61801).ToUpper()
End Get
End Property
Public ReadOnly Property OK_Msg As String
Get
Return EgtMsg(91651)
End Get
End Property
Public ReadOnly Property Cancel_Msg As String
Get
Return EgtMsg(91652)
End Get
End Property
#End Region
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
' carico lista process
Dim TempPRCList As New ObservableCollection(Of Integer)
Dim TempPRCLList As New ObservableCollection(Of Integer)
Dim TempPRCLTist As New ObservableCollection(Of Integer)
GetBeamPrivateProfileProcessList(0, TempPRCLList)
GetBeamPrivateProfileProcessList(1, TempPRCLTist)
' riporto le liste process in un unica lista
For Each PRCL In TempPRCLList
TempPRCList.Add(PRCL)
Next
For Each PRCT In TempPRCLTist
TempPRCList.Add(PRCT)
Next
m_PRCList.Clear()
' ciclo sulla lista process eliminado i doppi
For Each PRC In TempPRCList.Distinct()
' leggo gruppi
Dim GRPLList As New ObservableCollection(Of Integer)
Dim GRPTList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileGRPList(0, PRC, GRPLList)
GetBeamPrivateProfileGRPList(1, PRC, GRPTList)
If GRPLList.Count > 0 Then m_PRCList.Add(New PRC(GRPLList(0), PRC, GetBeamPrivateProfileName(0, PRC)))
If GRPTList.Count > 0 Then m_PRCList.Add(New PRC(GRPTList(0), PRC, GetBeamPrivateProfileName(1, PRC)))
Next
m_PRCListView = m_PRCList.OrderBy(Function(x) x.nPRC).ToList()
nSelPRC = m_PRCList(0)
NotifyPropertyChanged(NameOf(PRCListView))
NotifyPropertyChanged(NameOf(PRCList))
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Private Sub GetMacroListDefault(ByRef nGRPFromFileName As Integer, ByRef nPRCFromFileName As Integer, ByRef sMacroNameFromFileName As String, ByRef nIdMacroName As Integer)
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroCustomDir)
For Each File In AllFilesInDir
If Path.GetExtension(File).ToLower() = ".lua" Then
If File.Contains(FILENAMESEPARATOR) Then
Dim FileName As String = Path.GetFileNameWithoutExtension(File)
Dim DataFromFileName As String() = FileName.Split(FILENAMESEPARATOR)
If DataFromFileName.Count = 2 Then
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
Dim NumbersFromFileName As String() = DataFromFileName(0).Split(".")
Integer.TryParse(NumbersFromFileName(0), nGRPFromFileName)
Integer.TryParse(NumbersFromFileName(1), nPRCFromFileName)
End If
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
sMacroNameFromFileName = DataFromFileName(1)
End If
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
MacroCustomList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\Template\" & sMacroNameFromFileName & ".png"))
m_MacroFilePathList.Add(File)
nIdMacroName += 1
End If
End If
End If
End If
Next
End Sub
Private Sub GetMacroListCustom(ByRef nGRPFromFileName As Integer, ByRef nPRCFromFileName As Integer, ByRef sMacroNameFromFileName As String, ByRef nIdMacroName As Integer)
nIdMacroName = 0
Dim AllFilesInDirCustom As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Map.refMainWindowVM.MainWindowM.sMacroDefaultDir)
For Each File In AllFilesInDirCustom
If Path.GetExtension(File).ToLower() = ".lua" Then
If File.Contains(FILENAMESEPARATOR) Then
Dim FileName As String = Path.GetFileNameWithoutExtension(File)
Dim DataFromFileName As String() = FileName.Split(FILENAMESEPARATOR)
If DataFromFileName.Count = 2 Then
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
Dim NumbersFromFileName As String() = DataFromFileName(0).Split(".")
Integer.TryParse(NumbersFromFileName(0), nGRPFromFileName)
Integer.TryParse(NumbersFromFileName(1), nPRCFromFileName)
End If
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
sMacroNameFromFileName = DataFromFileName(1)
End If
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
MacroDefaultList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName))
m_MacroCustomFilePathList.Add(File)
nIdMacroName += 1
End If
End If
End If
End If
Next
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
'verifico che tutti i campi contengano un valore valido
If Not IsNothing(m_nSelPRC) AndAlso m_nSelPRC.nPRC > 0 Then
RaiseEvent m_CloseWindow(True)
Else
MessageBox.Show(EgtMsg(61852), EgtMsg(30007))
End If
End Sub
#End Region ' Ok
#End Region ' COMMANDS
End Class
Public Class PRC
' Processo
Private m_nPRC As Integer
Friend ReadOnly Property nPRC As Integer
Get
Return m_nPRC
End Get
End Property
' Gruppo
Private m_nGRP As Integer
Friend ReadOnly Property nGRP As Integer
Get
Return m_nGRP
End Get
End Property
Private m_nSIDE As Integer = 2
Public ReadOnly Property nSIDE As Integer
Get
Return m_nSIDE
End Get
End Property
Private m_nVARIANT As Integer = 0
Public ReadOnly Property nVARIANT As Integer
Get
Return m_nVARIANT
End Get
End Property
' Nome
Private m_sName As String
Public ReadOnly Property sName As String
Get
Return m_sName
End Get
End Property
Public ReadOnly Property ghDesc As String
Get
Return If(m_nGRP = 1 OrElse m_nGRP = 2, "T", "L") & m_nPRC.ToString("000") & " " & m_sName
End Get
End Property
Sub New(GRP As Integer, PRC As Integer, Name As String)
m_nPRC = PRC
m_sName = Name
m_nGRP = GRP
End Sub
End Class
Public Class NewMacro
' Indice Macro
Private m_nIndexMacro As Integer
Public ReadOnly Property nIndexMacro As Integer
Get
Return m_nIndexMacro
End Get
End Property
' Nome Macro
Private m_sMacroName As String
Public ReadOnly Property sMacroName As String
Get
Return m_sMacroName.ToUpper()
End Get
End Property
' Cartella dove sono contenuti i templete delle macro
Private m_sMacroDrawPath As String
Public ReadOnly Property sMacroDrawPath As String
Get
Return m_sMacroDrawPath
End Get
End Property
Sub New(IndexMacro As Integer, MacroName As String)
m_nIndexMacro = IndexMacro
m_sMacroName = MacroName
End Sub
Sub New(IndexMacro As Integer, MacroName As String, MacroDrawPath As String)
m_nIndexMacro = IndexMacro
m_sMacroName = MacroName
m_sMacroDrawPath = MacroDrawPath
End Sub
End Class
@@ -0,0 +1,94 @@
<EgtWPFLib5:EgtCustomWindow x:Class="AddPartWndV"
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"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
Title="AddPartWndV"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Style="{StaticResource OnlyProdAddPart_Grid}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Name"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sNAM}"
Style="{StaticResource NAM_TextBox}"/>
</Grid>
<Grid Grid.Row="1"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Prod Number"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding nPDN}"
Style="{StaticResource Dimension_TextBox}"/>
<TextBlock Grid.Column="2"
Text="Count"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="3"
Text="{Binding sCNT}"
Style="{StaticResource Dimension_TextBox}"/>
</Grid>
<Grid Grid.Row="2"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="W"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sW}"
Style="{StaticResource Dimension_TextBox}"/>
<TextBlock Grid.Column="2"
Text="H"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="3"
Text="{Binding sH}"
Style="{StaticResource Dimension_TextBox}"/>
<TextBlock Grid.Column="4"
Text="L"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="5"
Text="{Binding sL}"
Style="{StaticResource Dimension_TextBox}"/>
</Grid>
<UniformGrid Grid.Row="3"
Columns="2"
Margin="0,5,0,5">
<Button Content="Ok"
Command="{Binding Ok_Command}"
IsDefault="True"
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
<Button Content="Cancel"
IsCancel="True"
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class AddPartWndV
Private WithEvents m_AddPartWndVM As AddPartWndVM
Sub New(Owner As Window, AddPartWndVM As AddPartWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = AddPartWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_AddPartWndVM = AddPartWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddPartWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,176 @@
Imports EgtWPFLib5
Imports EgtUILib
Public Class AddPartWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
Private m_nPDN As Integer
Public Property nPDN As Integer
Get
Return m_nPDN
End Get
Set(value As Integer)
m_nPDN = value
End Set
End Property
Private m_sNAM As String
Public Property sNAM As String
Get
Return m_sNAM
End Get
Set(value As String)
m_sNAM = value
End Set
End Property
Private m_dL As Double
Public ReadOnly Property dL As Double
Get
Return m_dL
End Get
End Property
Public Property sL As String
Get
Return LenToString(m_dL, 3)
End Get
Set(value As String)
Dim dTempL As Double
If StringToLenAdv(value, dTempL, True) AndAlso dTempL > 0 Then
m_dL = dTempL
Else
NotifyPropertyChanged(NameOf(sL))
End If
End Set
End Property
Private m_dW As Double
Public ReadOnly Property dW As Double
Get
Return m_dW
End Get
End Property
Public Property sW As String
Get
Return LenToString(m_dW, 3)
End Get
Set(value As String)
Dim dTempW As Double
If StringToLenAdv(value, dTempW, True) AndAlso dTempW > 0 Then
EgtDraw()
m_dW = dTempW
Else
NotifyPropertyChanged(NameOf(sW))
End If
End Set
End Property
Private m_dH As Double
Public ReadOnly Property dH As Double
Get
Return m_dH
End Get
End Property
Public Property sH As String
Get
Return LenToString(m_dH, 3)
End Get
Set(value As String)
Dim dTempH As Double
If StringToLenAdv(value, dTempH, True) AndAlso dTempH > 0 Then
EgtDraw()
m_dH = dTempH
Else
NotifyPropertyChanged(NameOf(sH))
End If
End Set
End Property
Private m_sMAT As String
Public Property sMAT As String
Get
Return m_sMAT
End Get
Set(value As String)
m_sMAT = value
End Set
End Property
Private m_nCNT As Integer
Public ReadOnly Property nCNT As Integer
Get
Return m_nCNT
End Get
End Property
Public Property sCNT As String
Get
Return m_nCNT
End Get
Set(value As String)
Dim nTempCNT As Integer
If Integer.TryParse(value, nTempCNT) AndAlso nTempCNT > 0 Then
m_nCNT = nTempCNT
Else
NotifyPropertyChanged(NameOf(sCNT))
End If
End Set
End Property
' Definizione comandi
Private m_cmdOk As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
If Not IsNothing(Map.refProjectVM.BTLStructureVM.BTLPartVMList) Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
m_dW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dW
m_dH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dH
m_dL = Map.refProjectVM.BTLStructureVM.SelBTLPart.dL
ElseIf Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count > 0 Then
m_dW = Map.refProjectVM.BTLStructureVM.BTLPartVMList(0).dW
m_dH = Map.refProjectVM.BTLStructureVM.BTLPartVMList(0).dH
m_dL = Map.refProjectVM.BTLStructureVM.BTLPartVMList(0).dL
End If
m_nPDN = Map.refProjectVM.BTLStructureVM.BTLStructureM.NewPDN()
End If
m_nCNT = 1
End Sub
#End Region ' CONSTRUCTOR
#Region "COMMANDS"
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
'verifico che tutti i campi contengano un valore valido
If Not IsNothing(m_dL) AndAlso m_dL > 0 AndAlso
Not IsNothing(m_dW) AndAlso m_dW >= 0 AndAlso
Not IsNothing(m_dH) AndAlso m_dH >= 0 Then
RaiseEvent m_CloseWindow(True)
Else
MessageBox.Show(EgtMsg(61853), EgtMsg(30007))
End If
End Sub
#End Region ' Ok
#End Region ' COMMANDS
End Class
@@ -0,0 +1,60 @@
<EgtWPFLib5:EgtCustomWindow x:Class="AddRawPartWndV"
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"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
Title="AddRawPartWnd"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ComboBox ItemsSource="{Binding DimensionsList}"
SelectedItem="{Binding SelDimension}"
DisplayMemberPath="sDimension"
Visibility="{Binding DimensionsList_Visibility}"
Margin="0,0,0,5"
Style="{StaticResource OnlyProd_ComboBox}"/>
<ItemsControl Grid.Row="1"
ItemsSource="{Binding VariableList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sMsg}"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sValue}"
Style="{StaticResource Value_TextBox}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<UniformGrid Grid.Row="2"
Columns="2"
Margin="0,0,0,5">
<Button Grid.Column="1"
Content="Ok"
Command="{Binding Ok_Command}"
IsDefault="True"
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"
Margin="0,0,5,0"/>
<Button Grid.Column="3"
Content="Cancel"
IsCancel="True"
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class AddRawPartWndV
Private WithEvents m_AddRawPartWndVM As AddRawPartWndVM
Sub New(Owner As Window, AddRawPartWndVM As AddRawPartWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = AddRawPartWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_AddRawPartWndVM = AddRawPartWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddRawPartWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,256 @@
Imports System.Collections.ObjectModel
Imports EgtWPFLib5
Imports EgtUILib
Imports EgtBEAMWALL.Core
Public Class AddRawPartWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Public Enum EditTypes As Integer
ONLY_TEXT = 1
ONLY_COMBO = 2
TEXT_AND_COMBO = 3
End Enum
Friend Event m_CloseWindow(bDialogResult As Boolean)
' flag che indica se trave o parete
Private m_nProjectType As BWType = BWType.BEAM
Private m_EditType As EditTypes = EditTypes.ONLY_TEXT
' lista delle variabili da mostrare
Private m_VariableList_View As CollectionView = Nothing
Private m_VariableList As ObservableCollection(Of Variable)
Public ReadOnly Property VariableList As ObservableCollection(Of Variable)
Get
Return m_VariableList
End Get
End Property
Private m_DimensionsList As List(Of SParam)
Public Property DimensionsList As List(Of SParam)
Get
Return m_DimensionsList
End Get
Set(value As List(Of SParam))
m_DimensionsList = value
End Set
End Property
Private m_SelDimension As SParam
Public Property SelDimension As SParam
Get
Return m_SelDimension
End Get
Set(value As SParam)
m_SelDimension = value
If m_EditType = EditTypes.ONLY_COMBO OrElse m_EditType = EditTypes.TEXT_AND_COMBO Then
' aggiorno textbox
Select Case m_nProjectType
Case BWType.BEAM
m_VariableList(0).SetValue(value.dL)
Case BWType.WALL
m_VariableList(0).SetValue(value.dW)
m_VariableList(1).SetValue(value.dL)
End Select
End If
End Set
End Property
Private m_DimensionsList_Visibility As Visibility
Public ReadOnly Property DimensionsList_Visibility As Visibility
Get
Return If(m_EditType = EditTypes.ONLY_COMBO OrElse m_EditType = EditTypes.TEXT_AND_COMBO, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
' Definizione comandi
Private m_cmdOk As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(MachineType As Integer, dL As Double, dW As Double, dPosx As Double)
m_nProjectType = MachineType
m_EditType = EditTypes.ONLY_TEXT
Select Case m_nProjectType
Case ConstBeam.MachineType.BEAM
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL), ' lunghezza
New Variable(Variable.VariableType.LENGTH, EgtMsg(61816), dPosx)}) ' ritaglio iniziale
Case ConstBeam.MachineType.WALL
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL), ' lunghezza
New Variable(Variable.VariableType.LENGTH, EgtMsg(61936), dW)}) ' larghezza
End Select
End Sub
Sub New(EditType As EditTypes, ProjectType As BWType, DimensionsList As List(Of SParam), dL As Double, dW As Double, dPosx As Double, dOffset As Double, dKerf As Double)
m_EditType = EditType
m_nProjectType = ProjectType
Select Case ProjectType
Case BWType.BEAM
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL + dPosx), ' lunghezza + ritaglio iniziale
New Variable(Variable.VariableType.LENGTH, EgtMsg(61816), dPosx), ' ritaglio iniziale
New Variable(Variable.VariableType.LENGTH, EgtMsg(61937), dOffset)}) ' offset
Case BWType.WALL
m_VariableList = New ObservableCollection(Of Variable)({New Variable(Variable.VariableType.LENGTH, EgtMsg(61936), dW), ' larghezza
New Variable(Variable.VariableType.LENGTH, EgtMsg(61935), dL), ' lunghezza
New Variable(Variable.VariableType.LENGTH, EgtMsg(61938), dKerf), ' kerf
New Variable(Variable.VariableType.LENGTH, EgtMsg(61937), dOffset)}) ' offset
End Select
m_DimensionsList = DimensionsList
If m_DimensionsList.Count > 0 Then
Dim LastMaterial As SParam = WarehouseHelper.GetLastMaterial(DimensionsList(0).SectXMat)
If IsNothing(LastMaterial) Then
SelDimension = m_DimensionsList(0)
Else
Dim TempDimension As SParam = m_DimensionsList.FirstOrDefault(Function(x) x.SectXMat = LastMaterial.SectXMat AndAlso x.dL = LastMaterial.dL AndAlso x.dW = LastMaterial.dW AndAlso x.nQuantity = LastMaterial.nQuantity)
If Not IsNothing(TempDimension) Then
SelDimension = TempDimension
Else
SelDimension = m_DimensionsList(0)
End If
End If
End If
' riduco lista parametri a solo quelli che utilizzati
m_VariableList_View = CollectionViewSource.GetDefaultView(m_VariableList)
m_VariableList_View.Filter = AddressOf VariableListFilter
NotifyPropertyChanged(NameOf(DimensionsList_Visibility))
End Sub
Private Function VariableListFilter(Variable As Object) As Boolean
Dim CurrVariable As Variable = DirectCast(Variable, Variable)
Dim nVariableIndex As Integer = m_VariableList.IndexOf(Variable)
Select Case m_nProjectType
Case BWType.BEAM
If m_EditType = EditTypes.ONLY_TEXT OrElse m_EditType = EditTypes.TEXT_AND_COMBO Then
Return True
Else
Return nVariableIndex = 1 OrElse nVariableIndex = 2
End If
Case BWType.WALL
If m_EditType = EditTypes.ONLY_TEXT OrElse m_EditType = EditTypes.TEXT_AND_COMBO Then
Return True
Else
Return nVariableIndex = 2 OrElse nVariableIndex = 3
End If
End Select
Return False
End Function
#End Region ' CONSTRUCTOR
#Region "COMMANDS"
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
'verifico che tutti i campi contengano un valore valido
For Each Variable In m_VariableList
If (Variable.nType = Variable.VariableType.STRING_ AndAlso IsNothing(Variable.sValue)) OrElse
((Variable.nType = Variable.VariableType.DOUBLE_ OrElse Variable.nType = Variable.VariableType.LENGTH) AndAlso IsNothing(Variable.dValue)) Then
MessageBox.Show(If(m_nProjectType = MachineType.BEAM, EgtMsg(61854), EgtMsg(61855)), EgtMsg(30007))
Return
End If
Next
' se non ci sono problemi esco restituendo vero
RaiseEvent m_CloseWindow(True)
End Sub
#End Region ' Ok
#End Region ' COMMANDS
End Class
Public Class Variable
Inherits VMBase
Public Enum VariableType As Integer
DOUBLE_ = 1
STRING_ = 2
COMBO = 3
LENGTH = 4
End Enum
Private m_nType As VariableType
Public ReadOnly Property nType As VariableType
Get
Return m_nType
End Get
End Property
Private m_sMsg As String
Public Property sMsg As String
Get
Return m_sMsg
End Get
Set(value As String)
m_sMsg = value
End Set
End Property
Private m_dValue As Double = 0
Friend ReadOnly Property dValue As Double
Get
Return m_dValue
End Get
End Property
Private m_sValue As String = ""
Public Property sValue As String
Get
Select Case m_nType
Case VariableType.STRING_
Return m_sValue
Case VariableType.LENGTH
Return LenToString(m_dValue, 3)
Case Else ' VariableType.DOUBLE_
Return DoubleToString(m_dValue, 3)
End Select
End Get
Set(value As String)
Select Case m_nType
Case VariableType.STRING_
m_sValue = value
Case VariableType.LENGTH
Dim dTempValue As Double
If StringToLenAdv(value, dTempValue, True) Then
m_dValue = dTempValue
Else
NotifyPropertyChanged(NameOf(sValue))
End If
Case Else ' VariableType.DOUBLE_
Dim dTempValue As Double
If StringToDoubleAdv(value, dTempValue, True) Then
m_dValue = dTempValue
Else
NotifyPropertyChanged(NameOf(sValue))
End If
End Select
End Set
End Property
Sub New(Type As VariableType, Msg As String, Value As Double)
m_nType = Type
m_sMsg = Msg
m_dValue = Value
End Sub
Friend Sub SetValue(dValue As Double)
m_dValue = dValue
NotifyPropertyChanged(NameOf(sValue))
End Sub
End Class
@@ -0,0 +1,127 @@
<EgtWPFLib5:EgtCustomWindow x:Class="AddSectionXMaterialWndV"
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:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
Title="AddSectionXMaterial">
<StackPanel Margin="5,5,5,0">
<EgtBEAMWALLCORE:EgtDataGrid Grid.Row="0" Width="500" MaxHeight="600"
ItemsSource="{Binding NewSectionXMaterialList}"
SelectedItem="{Binding SelNewSectionXMaterial}"
CanUserAddRows="False"
AutoGenerateColumns="False"
CanUserResizeRows="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="False"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="5"
BindingColumns="{Binding SectXMatColumns}">
<DataGrid.Resources>
<!-- SectionXMaterial -->
<DataGridTextColumn x:Key="colSECTXMAT" Binding="{Binding sSectionXMaterial}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.SectionXMaterial_Msg,RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:AddSectionXMaterialWndV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!-- Alias -->
<DataGridTemplateColumn x:Key="colALIAS">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Alias_Msg,RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:AddSectionXMaterialWndV}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Path=Alias_IsChecked, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding Alias_IsEnabled}"
HorizontalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!-- W -->
<DataGridTextColumn x:Key="colW" Binding="{Binding sNewW}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.W_Msg,RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:AddSectionXMaterialWndV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="IsEnabled" Value="{Binding Alias_IsNotChecked}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!-- L -->
<DataGridTextColumn x:Key="colL" Binding="{Binding sNewL}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.L_Msg,RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:AddSectionXMaterialWndV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="IsEnabled" Value="{Binding Alias_IsNotChecked}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!-- Material -->
<DataGridTemplateColumn x:Key="colMATERIAL">
<DataGridTemplateColumn.Header>
<TextBlock Text="{Binding Path=DataContext.Material_Msg,RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:AddSectionXMaterialWndV}}}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding MaterialForSameSection_List}"
SelectedItem="{Binding SelMaterialForSameSection, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding Alias_IsChecked, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!-- Quantity -->
<DataGridTextColumn x:Key="colQTY" Binding="{Binding sQuantity}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Quantity_Msg,RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:AddSectionXMaterialWndV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="IsEnabled" Value="{Binding Alias_IsNotChecked}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
</DataGrid.Resources>
</EgtBEAMWALLCORE:EgtDataGrid>
<Grid Grid.Row="2" Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Content="{Binding Ok_Msg}"
Command="{Binding Ok_Command}"
IsDefault="True"
Grid.Column="1"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding Cancel_Msg}"
Command="{Binding Cancel_Command}"
IsCancel="True"
Grid.Column="3"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
</StackPanel>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class AddSectionXMaterialWndV
Private WithEvents m_AddSectionXMaterialWndVM As AddSectionXMaterialWndVM
Sub New(Owner As Window, AddSectionXMaterialWndVM As AddSectionXMaterialWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = AddSectionXMaterialWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_AddSectionXMaterialWndVM = AddSectionXMaterialWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_AddSectionXMaterialWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,381 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Public Class AddSectionXMaterialWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
Protected m_SectXMatColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property SectXMatColumns As ObservableCollection(Of EgtDataGridColumn)
Get
Return m_SectXMatColumns
End Get
Set(value As ObservableCollection(Of EgtDataGridColumn))
m_SectXMatColumns = value
End Set
End Property
' Lista dei nuovi SectionXMaterial in BTLSTructure non presenti in Warehouse
Private m_NewSectionXMaterialList As New ObservableCollection(Of SectionXMaterialToBeAdded)
Public Property NewSectionXMaterialList As ObservableCollection(Of SectionXMaterialToBeAdded)
Get
Return m_NewSectionXMaterialList
End Get
Set(value As ObservableCollection(Of SectionXMaterialToBeAdded))
m_NewSectionXMaterialList = value
End Set
End Property
' Lista dei SectionXMaterial presenti in Warehouse
Private m_WhSectXMatList As New List(Of SectionXMaterial)
Public Property WhSectXMatList As List(Of SectionXMaterial)
Get
Return m_WhSectXMatList
End Get
Set(value As List(Of SectionXMaterial))
m_WhSectXMatList = value
End Set
End Property
' SectionXMaterial correntemente selezionato nella Datagrid
Private m_SelNewSectionXMaterial As SectionXMaterialToBeAdded
Public Property SelNewSectionXMaterial As SectionXMaterialToBeAdded
Get
Return m_SelNewSectionXMaterial
End Get
Set(value As SectionXMaterialToBeAdded)
m_SelNewSectionXMaterial = value
End Set
End Property
' Definizione comandi
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "MESSAGES"
Public ReadOnly Property SectionXMaterial_Msg As String
Get
Return EgtMsg(61771)
End Get
End Property
Public ReadOnly Property Alias_Msg As String
Get
Return EgtMsg(61772)
End Get
End Property
Public ReadOnly Property L_Msg As String
Get
Return EgtMsg(61604)
End Get
End Property
Public ReadOnly Property W_Msg As String
Get
Return EgtMsg(61605)
End Get
End Property
Public ReadOnly Property Material_Msg As String
Get
Return EgtMsg(61607)
End Get
End Property
Public ReadOnly Property Quantity_Msg As String
Get
Return EgtMsg(61774)
End Get
End Property
Public ReadOnly Property Ok_Msg As String
Get
Return EgtMsg(61761)
End Get
End Property
Public ReadOnly Property Cancel_Msg As String
Get
Return EgtMsg(61763)
End Get
End Property
Public ReadOnly Property Error_Msg As String
Get
Return EgtMsg(61764)
End Get
End Property
Public ReadOnly Property IncorrectValues_Msg As String
Get
Return EgtMsg(61768)
End Get
End Property
#End Region ' MESSAGES
#Region "CONSTRUCTOR"
Sub New(SectXMatList As List(Of SectionXMaterialToBeAdded))
' Aggiungo riferimento a Map
Map.SetRefAddSectionXMaterialWndVM(Me)
' carico le colonne della datagrid
LoadColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
NewSectionXMaterialList = New ObservableCollection(Of SectionXMaterialToBeAdded)(SectXMatList)
WhSectXMatList = WarehouseWndVM.GetSectionXMaterialsFromWarehouse()
' Prendo i SectionXMaterial appena messi nella Lista di questa finestra e li confronto con ciascuno di quelli presenti in Warehouse.
' Se le sezioni sono uguali carico i materiali relativi alla medesima sezione.
' Se i materiali di quella medesima sezione non ci sono disabilito la CheckBox Alias.
For Each NewSectXMatItem In NewSectionXMaterialList
NewSectXMatItem.Alias_IsChecked = False
For Each SectionListItem In WhSectXMatList
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
If NewSectXMatItem.dW = SectionListItem.dW AndAlso NewSectXMatItem.dH = SectionListItem.dH Then
' Se le sezioni sono uguali allora indago sui materiali
For Index As Integer = 0 To SectionListItem.sMaterial.Count - 1
If Not NewSectXMatItem.MaterialForSameSection_List.Contains(SectionListItem.sMaterial(Index)) And
Not NewSectXMatItem.sMaterial.Contains(SectionListItem.sMaterial(Index)) Then
NewSectXMatItem.MaterialForSameSection_List.Add(SectionListItem.sMaterial(Index))
End If
If NewSectXMatItem.MaterialForSameSection_List.Count > 0 Then
NewSectXMatItem.Alias_IsEnabled = True
End If
Next
End If
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
If NewSectXMatItem.dH = SectionListItem.dH Then
' Se le sezioni sono uguali allora indago sui materiali
For Index As Integer = 0 To SectionListItem.sMaterial.Count - 1
If Not NewSectXMatItem.MaterialForSameSection_List.Contains(SectionListItem.sMaterial(Index)) And
Not NewSectXMatItem.sMaterial.Contains(SectionListItem.sMaterial(Index)) Then
NewSectXMatItem.MaterialForSameSection_List.Add(SectionListItem.sMaterial(Index))
End If
If NewSectXMatItem.MaterialForSameSection_List.Count > 0 Then
NewSectXMatItem.Alias_IsEnabled = True
End If
Next
End If
End If
Next
Next
End Sub
#End Region ' CONSTRUCTOR
#Region "COMMANDS"
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
' Se i valori non sono corretti segnalo l'errore e impedisco il salvataggio
For Index As Integer = 0 To NewSectionXMaterialList.Count - 1
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM AndAlso
(Not NewSectionXMaterialList(Index).Alias_IsChecked And NewSectionXMaterialList(Index).dNewL < 0) OrElse
(NewSectionXMaterialList(Index).Alias_IsChecked And IsNothing(NewSectionXMaterialList(Index).SelMaterialForSameSection)) OrElse
(Not NewSectionXMaterialList(Index).Alias_IsChecked And (NewSectionXMaterialList(Index).nQuantity < 0 Or NewSectionXMaterialList(Index).nQuantity > 99)) Then
MessageBox.Show(IncorrectValues_Msg, Error_Msg)
Return
End If
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL AndAlso
(Not NewSectionXMaterialList(Index).Alias_IsChecked And (NewSectionXMaterialList(Index).dNewW < 0 Or NewSectionXMaterialList(Index).dNewL < 0)) OrElse
(NewSectionXMaterialList(Index).Alias_IsChecked And IsNothing(NewSectionXMaterialList(Index).SelMaterialForSameSection)) OrElse
(Not NewSectionXMaterialList(Index).Alias_IsChecked And (NewSectionXMaterialList(Index).nQuantity < 0 Or NewSectionXMaterialList(Index).nQuantity > 99)) Then
MessageBox.Show(IncorrectValues_Msg, Error_Msg)
Return
End If
Next
' Se i valori sono corretti salvo
Save()
End Sub
#End Region ' Ok
#Region "Cancel"
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
Public Sub Cancel()
' Resetto i valori prima di salvarli
For Index As Integer = 0 To NewSectionXMaterialList.Count - 1
NewSectionXMaterialList(Index).Alias_IsChecked = False
NewSectionXMaterialList(Index).dNewL = 0
NewSectionXMaterialList(Index).nQuantity = 0
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then NewSectionXMaterialList(Index).dNewW = 0
Next
Save()
End Sub
#End Region ' Cancel
#End Region ' COMMANDS
#Region "METHODS"
#Region "LoadColumns"
Protected Sub LoadColumns(ProjectType As BWType)
If ProjectType = BWType.BEAM Then
' carico le colonne della datagrid
GetPrivateProfileColumns(S_SECTXMATLIST_BEAM, SectXMatColumns)
ElseIf ProjectType = BWType.WALL Then
' carico le colonne della datagrid
GetPrivateProfileColumns(S_SECTXMATLIST_WALL, SectXMatColumns)
End If
' aggiorno la visibilità delle colonne
For Each col In SectXMatColumns
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
Next
End Sub
#End Region ' LoadColumns
#Region "Save"
Public Sub Save()
' Indice per scansionare NewSectionXMaterialList
Dim Index = 0
' Indice da incrementare in modo da scrivere i nuovi parametri L/S a partire dal giusto numero
Dim ParamIndex = 1
' Indice da incrementare in modo da scrivere i nuovi SectionXMaterial a partire dal giusto numero
Dim SxMParamIndex = 1
Dim sWarehousePath As String = Map.refMainWindowVM.MainWindowM.sWarehouseDir & "\" & WH_MEDIUM_INI_FILE_NAME
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.BEAM Then
' Ciclo sui parametri L esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere
Dim sValue As String = String.Empty
While EgtUILib.GetPrivateProfileString(S_BEAM, "L" & ParamIndex, String.Empty, sValue, sWarehousePath)
ParamIndex += 1
End While
' Ciclo sui SectionXMaterial BEAM esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere
While EgtUILib.GetPrivateProfileString(S_BEAM_LIST, SxMParamIndex, String.Empty, sValue, sWarehousePath)
SxMParamIndex += 1
End While
' Se i valori sono tutti >= 0 li scrivo nel file INI
Index = 0
For Each NewSxMItem In NewSectionXMaterialList
Dim sAlias As String = String.Empty
For Each Mat In NewSectionXMaterialList(Index).sMaterial
sAlias &= Mat & ";"
Next
sAlias = sAlias.TrimEnd(";")
' Se Alias è checkato aggiungo l'Alias scelto dalla ComboBox alla stringa e setto NewL e Quantity a 0 e aggiorno il SectionXmaterial in BeamList
If NewSxMItem.Alias_IsChecked Then
sAlias &= ";" & NewSxMItem.SelMaterialForSameSection
NewSectionXMaterialList(Index).dNewL = 0
NewSectionXMaterialList(Index).nQuantity = 0
' Ricavo l'indice del SectionXMaterial da aggiornare
Dim UpdateSxMIndex = 1
For Each WhSectXMat In WhSectXMatList
If WhSectXMat.dW = NewSxMItem.dW AndAlso WhSectXMat.dH = NewSxMItem.dH Then
Exit For
End If
UpdateSxMIndex += 1
Next
' Aggiorno il SectionXMaterial
WritePrivateProfileString(S_BEAM_LIST, UpdateSxMIndex, LenToString(NewSectionXMaterialList(Index).dW, 3) & "," &
LenToString(NewSectionXMaterialList(Index).dH, 3) & "," &
sAlias, sWarehousePath)
Else
' Altrimenti aggiungo il nuovo SectionXMaterial e il parametro
WritePrivateProfileString(S_BEAM_LIST, SxMParamIndex, LenToString(NewSectionXMaterialList(Index).dW, 3) & "," &
LenToString(NewSectionXMaterialList(Index).dH, 3) & "," &
sAlias, sWarehousePath)
WritePrivateProfileString(S_BEAM, K_L & ParamIndex, SxMParamIndex & "," &
LenToString(NewSectionXMaterialList(Index).dNewL, 3) & "," &
NewSectionXMaterialList(Index).nQuantity, sWarehousePath)
ParamIndex += 1
SxMParamIndex += 1
End If
Index += 1
Next
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = MachineType.WALL Then
' Ciclo sui parametri S esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere
Dim sValue As String = String.Empty
While EgtUILib.GetPrivateProfileString(S_WALL, "S" & ParamIndex, String.Empty, sValue, sWarehousePath)
ParamIndex += 1
End While
' Ciclo sui SectionXMaterial WALL esistenti nell'INI in modo da avere l'indice di partenza per gli ulteriori parametri da scrivere
While EgtUILib.GetPrivateProfileString(S_WALL_LIST, SxMParamIndex, String.Empty, sValue, sWarehousePath)
SxMParamIndex += 1
End While
' Se i valori sono tutti > 0 li scrivo nel file INI
Index = 0
For Each NewSxMItem In NewSectionXMaterialList
Dim sAlias As String = String.Empty
For Each Mat In NewSectionXMaterialList(Index).sMaterial
sAlias &= Mat & ";"
Next
sAlias = sAlias.TrimEnd(";")
' Se Alias è checkato aggiungo l'Alias scelto dalla ComboBox alla stringa
If NewSxMItem.Alias_IsChecked Then
sAlias &= ";" & NewSxMItem.SelMaterialForSameSection
NewSectionXMaterialList(Index).dNewW = 0
NewSectionXMaterialList(Index).dNewL = 0
NewSectionXMaterialList(Index).nQuantity = 0
' Ricavo l'indice del SectionXMaterial da aggiornare
Dim UpdateSxMIndex = 1
For Each WhSectXMat In WhSectXMatList
If WhSectXMat.dH = NewSxMItem.dH Then
Exit For
End If
UpdateSxMIndex += 1
Next
' Aggiorno il SectionXMaterial
WritePrivateProfileString(S_WALL_LIST, UpdateSxMIndex, LenToString(NewSectionXMaterialList(Index).dH, 3) & "," &
sAlias, sWarehousePath)
Else
' Altrimenti aggiungo il nuovo SectionXMaterial e il parametro
WritePrivateProfileString(S_WALL_LIST, SxMParamIndex, LenToString(NewSectionXMaterialList(Index).dH, 3) & "," &
sAlias, sWarehousePath)
WritePrivateProfileString(S_WALL, K_S & ParamIndex, SxMParamIndex & "," &
LenToString(NewSectionXMaterialList(Index).dNewW, 3) & "," &
LenToString(NewSectionXMaterialList(Index).dNewL, 3) & "," &
NewSectionXMaterialList(Index).nQuantity, sWarehousePath)
ParamIndex += 1
SxMParamIndex += 1
End If
Index += 1
Next
End If
RaiseEvent m_CloseWindow(True)
End Sub
#End Region ' Save
#End Region ' METHODS
End Class
+47
View File
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.21.9.0" newVersion="3.21.9.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.3.5.0" newVersion="1.3.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.9.0.0" newVersion="1.9.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+9
View File
@@ -0,0 +1,9 @@
<Application x:Class="Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<ResourceDictionary Source="Utility/Dictionary.xaml"/>
</Application.Resources>
</Application>
+21
View File
@@ -0,0 +1,21 @@
Class Application
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
' can be handled in this file.
Protected Overrides Sub OnStartup(e As StartupEventArgs)
MyBase.OnStartup(e)
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
If e.Args.Count = 0 Then
' creo finestra SplashScreen
Dim SplashScreen As New SplashScreenV
Me.MainWindow = SplashScreen
Me.MainWindow.Show()
MapV.SetRefSplashScreenV(SplashScreen)
End If
' Creo la View principale
Me.MainWindow = New MainWindowV
' Mostro la View principale
Me.MainWindow.Show()
End Sub
End Class
@@ -0,0 +1,173 @@
<EgtWPFLib5:EgtCustomWindow x:Class="BTLDataWndV"
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:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="True"
IsMinimizable="False"
IsResizable="False"
Title="BTLDataWndV"
Name="BTLDataWndV"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<TabControl>
<TabItem Header="Strategy">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ComboBox ItemsSource="{Binding StrategySetupList}" HorizontalAlignment="Center" Margin="0,10,0,10"
SelectedItem="{Binding SelStrategySetup, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource Strategy_ComboBox}" />
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<OPTIMIZER:ProjectParametersV Grid.RowSpan="2" Margin="0,10,0,0"
Tag="{Binding GeneralParametersList}"
IsEnabled="{Binding GeneralParametersIsEnable}"/>
<UniformGrid Rows="2" Grid.Column="1" Margin="0,0,5,0">
<CheckBox IsChecked="{Binding bSaveGeneralParameters, UpdateSourceTrigger=PropertyChanged}"
Margin="10,10,0,0" VerticalAlignment="Top" HorizontalAlignment="Center"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_CheckBox}"/>
<Button Command="{Binding Ok_Command}" VerticalAlignment="Bottom" Margin="0,0,0,5"
ToolTip="{Binding SaveAsToolTip}"
Style="{StaticResource SaveStrategy_Button}">
<Image Source="/Resources/NewPage/Ok.png" Stretch="Uniform"/>
</Button>
</UniformGrid>
</Grid>
</Grid>
</TabItem>
<TabItem Header="BTL">
<UniformGrid Margin="5"
Columns="6" Rows="7">
<TextBlock Text="{Binding PROJNUM_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sPROJNUM, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sPROJNAME, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJPART_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sPROJPART, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJGUID_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sPROJGUID, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding LISTNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sLISTNAME, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding CUSTOMER_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sCUSTOMER, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding ARCHITECT_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sARCHITECT, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EDITOR_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sEDITOR, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding DELIVDATE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sDELIVDATE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPDATE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sEXPDATE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPTIME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sEXPTIME, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPRELEASE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sEXPRELEASE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding LANGUAGE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sLANGUAGE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding RANGE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding ocRANGE,
Mode=OneWay}"
SelectedIndex="{Binding SelRANGE,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding PROCESSINGQUALITY_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding ocPROCESSINGQUALITY,
Mode=OneWay}"
SelectedIndex="{Binding SelPROCESSINGQUALITY,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding COMPUTERNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sCOMPUTERNAME, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding USER_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sUSER, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding SRCFILE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sSRCFILE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPFILE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sEXPFILE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding RECESS_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding ocRECESS,
Mode=OneWay}"
SelectedIndex="{Binding SelRECESS,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding USERATTRIBUTE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sUSERATTRIBUTE, UpdateSourceTrigger=Explicit}"
Style="{StaticResource PartParam_TextBox}"/>
</UniformGrid>
</TabItem>
</TabControl>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class BTLDataWndV
Private WithEvents m_BTLDataWndVM As BTLDataWndVM
Sub New(Owner As Window, BTLDataWndVM As BTLDataWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = BTLDataWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_BTLDataWndVM = BTLDataWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BTLDataWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,801 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Optimizer.MainMenuVM
Imports EgtUILib
Imports EgtWPFLib5
Imports Newtonsoft.Json
Public Class BTLDataWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
Private m_StrategySetupList As New ObservableCollection(Of String)
Public ReadOnly Property StrategySetupList As ObservableCollection(Of String)
Get
Return m_StrategySetupList
End Get
End Property
Private m_SelStrategySetup As String
Public Property SelStrategySetup As String
Get
Return m_SelStrategySetup
End Get
Set(value As String)
If m_SelStrategySetup <> value Then
EgtSetInfo(m_nBTLInfoLayerId, "AISETUP", value)
WriteMainPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, value & ".json")
Map.refStrategyManagerVM.SelStrategySetup.sName = value
Map.refStrategyManagerVM.SelStrategySetup.Read()
Map.refProdManagerVM.Save()
End If
m_SelStrategySetup = value
NotifyPropertyChanged(NameOf(SelStrategySetup))
End Set
End Property
Private m_nBTLInfoLayerId As Integer = -1
Public ReadOnly Property nBTLInfoId As Integer
Get
Return m_nBTLInfoLayerId
End Get
End Property
Private m_GeneralParametersList As New ObservableCollection(Of ProjectParameters)
Public Property GeneralParametersList As ObservableCollection(Of ProjectParameters)
Get
Return m_GeneralParametersList
End Get
Set(value As ObservableCollection(Of ProjectParameters))
m_GeneralParametersList = value
NotifyPropertyChanged(NameOf(GeneralParametersList))
End Set
End Property
Private m_bSaveGeneralParameters As Boolean
Public Property bSaveGeneralParameters As Boolean
Get
Return m_bSaveGeneralParameters
End Get
Set(value As Boolean)
m_bSaveGeneralParameters = value
If m_bSaveGeneralParameters Then
SetGeneralParametersIsEnable(True)
Else
SetGeneralParametersIsEnable(False)
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(Map.refStrategyManagerVM.SelStrategyType.Id)
Dim sGeneralParametersFilePath As String = sStrategiesDirPath & "\" & GENERALPARAMETERS_FILE & ".json"
If File.Exists(sGeneralParametersFilePath) Then
Dim sReadedFiles As String = File.ReadAllText(sGeneralParametersFilePath)
Dim JsonGeneralParametersList As List(Of JsonGeneralParameters) = JsonConvert.DeserializeObject(Of List(Of JsonGeneralParameters))(sReadedFiles)
m_GeneralParametersList = New ObservableCollection(Of ProjectParameters)((From JsonGeneralParameter In JsonGeneralParametersList
Select JsonGeneralParameter.Deserialize(Map.refStrategyManagerVM.SelStrategyType.Id)).ToList())
End If
End If
NotifyPropertyChanged(NameOf(bSaveGeneralParameters))
End Set
End Property
Friend Sub SetbSaveGeneralParameters(value As Boolean)
m_bSaveGeneralParameters = value
NotifyPropertyChanged(NameOf(bSaveGeneralParameters))
End Sub
Private m_GeneralParametersIsEnable As Boolean = False
Public ReadOnly Property GeneralParametersIsEnable As Boolean
Get
Return m_GeneralParametersIsEnable
End Get
End Property
Friend Sub SetGeneralParametersIsEnable(value As Boolean)
m_GeneralParametersIsEnable = value
NotifyPropertyChanged(NameOf(GeneralParametersIsEnable))
End Sub
#Region "Parametri generici"
Public m_sPROJNUM As String
Public Property sPROJNUM As String
Get
Return m_sPROJNUM
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJNUM, value) Then
m_sPROJNUM = value
Else
NotifyPropertyChanged(NameOf(sPROJNUM))
End If
End Set
End Property
Public m_sPROJNAME As String
Public Property sPROJNAME As String
Get
Return m_sPROJNAME
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJNAME, value) Then
m_sPROJNAME = value
Else
NotifyPropertyChanged(NameOf(sPROJNAME))
End If
End Set
End Property
Public m_sPROJPART As String
Public Property sPROJPART As String
Get
Return m_sPROJPART
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJPART, value) Then
m_sPROJPART = value
Else
NotifyPropertyChanged(NameOf(sPROJPART))
End If
End Set
End Property
Public m_sPROJGUID As String
Public Property sPROJGUID As String
Get
Return m_sPROJGUID
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJGUID, value) Then
m_sPROJGUID = value
Else
NotifyPropertyChanged(NameOf(sPROJGUID))
End If
End Set
End Property
Public m_nPROJTYPE As Integer
Public ReadOnly Property nPROJTYPE As BWType
Get
Select Case Map.refMainMenuVM.SelPage
Case Pages.ONLYPRODPAGE
Return Map.refProdManagerVM.nProdType
Case Else
Return BWType.NULL
End Select
End Get
End Property
Public m_sLISTNAME As String
Public Property sLISTNAME As String
Get
Return m_sLISTNAME
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_LISTNAME, value) Then
DbControllers.m_ProjController.UpdateListName(ProjectManagerVM.CurrProj.nProjId, value)
m_sLISTNAME = value
Else
NotifyPropertyChanged(NameOf(sLISTNAME))
End If
End Set
End Property
Public m_sCUSTOMER As String
Public Property sCUSTOMER As String
Get
Return m_sCUSTOMER
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_CUSTOMER, value) Then
m_sCUSTOMER = value
Else
NotifyPropertyChanged(NameOf(sCUSTOMER))
End If
End Set
End Property
Public m_sARCHITECT As String
Public Property sARCHITECT As String
Get
Return m_sARCHITECT
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_ARCHITECT, value) Then
m_sARCHITECT = value
Else
NotifyPropertyChanged(NameOf(sARCHITECT))
End If
End Set
End Property
Public m_sEDITOR As String
Public Property sEDITOR As String
Get
Return m_sEDITOR
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_EDITOR, value) Then
m_sEDITOR = value
Else
NotifyPropertyChanged(NameOf(sEDITOR))
End If
End Set
End Property
Public m_sDELIVDATE As String
Public Property sDELIVDATE As String
Get
Return m_sDELIVDATE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_DELIVDATE, value) Then
m_sDELIVDATE = value
Else
NotifyPropertyChanged(NameOf(sDELIVDATE))
End If
End Set
End Property
Public m_sEXPDATE As String
Public Property sEXPDATE As String
Get
Return m_sEXPDATE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPDATE, value) Then
m_sEXPDATE = value
Else
NotifyPropertyChanged(NameOf(sEXPDATE))
End If
End Set
End Property
Public m_sEXPTIME As String
Public Property sEXPTIME As String
Get
Return m_sEXPTIME
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPTIME, value) Then
m_sEXPTIME = value
Else
NotifyPropertyChanged(NameOf(sEXPTIME))
End If
End Set
End Property
Public m_sEXPRELEASE As String
Public Property sEXPRELEASE As String
Get
Return m_sEXPRELEASE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPRELEASE, value) Then
m_sEXPRELEASE = value
Else
NotifyPropertyChanged(NameOf(sEXPRELEASE))
End If
End Set
End Property
Public m_sLANGUAGE As String
Public Property sLANGUAGE As String
Get
Return m_sLANGUAGE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_LANGUAGE, value) Then
m_sLANGUAGE = value
Else
NotifyPropertyChanged(NameOf(sLANGUAGE))
End If
End Set
End Property
Public m_ocRANGE As New List(Of Object)({New IdNameStruct(Range.STANDARD, EgtMsg(61710)),
New IdNameStruct(Range.EXTENDED, EgtMsg(61711))})
Public ReadOnly Property ocRANGE As List(Of Object)
Get
Return m_ocRANGE
End Get
End Property
Public m_SelRANGE As Integer
Public Property SelRANGE As Integer
Get
Return m_SelRANGE
End Get
Set(value As Integer)
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocRANGE)
Dim sValue As String = [Enum].GetName(GetType(Range), nValue)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_RANGE, sValue) Then
m_SelRANGE = value
Else
NotifyPropertyChanged(NameOf(SelRANGE))
End If
End Set
End Property
Public m_ocPROCESSINGQUALITY As New List(Of Object)({New IdNameStruct(ProcessingQuality.AUTOMATIC, EgtMsg(61658)),
New IdNameStruct(ProcessingQuality.VISIBLE, EgtMsg(61659)),
New IdNameStruct(ProcessingQuality.FAST, EgtMsg(61660))})
Public ReadOnly Property ocPROCESSINGQUALITY As List(Of Object)
Get
Return m_ocPROCESSINGQUALITY
End Get
End Property
Public m_SelPROCESSINGQUALITY As Integer
Public Property SelPROCESSINGQUALITY As Integer
Get
Return m_SelPROCESSINGQUALITY
End Get
Set(value As Integer)
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocPROCESSINGQUALITY)
Dim sValue As String = [Enum].GetName(GetType(ProcessingQuality), nValue)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_PRT_PROCESSINGQUALITY, sValue) Then
m_SelPROCESSINGQUALITY = value
Else
NotifyPropertyChanged(NameOf(SelPROCESSINGQUALITY))
End If
End Set
End Property
Public m_sCOMPUTERNAME As String
Public Property sCOMPUTERNAME As String
Get
Return m_sCOMPUTERNAME
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_COMPUTERNAME, value) Then
m_sCOMPUTERNAME = value
Else
NotifyPropertyChanged(NameOf(sCOMPUTERNAME))
End If
End Set
End Property
Public m_sUSER As String
Public Property sUSER As String
Get
Return m_sUSER
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_USER, value) Then
m_sUSER = value
Else
NotifyPropertyChanged(NameOf(sUSER))
End If
End Set
End Property
Public m_sSRCFILE As String
Public Property sSRCFILE As String
Get
Return m_sSRCFILE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_SRCFILE, value) Then
m_sSRCFILE = value
Else
NotifyPropertyChanged(NameOf(sSRCFILE))
End If
End Set
End Property
Public m_sEXPFILE As String
Public Property sEXPFILE As String
Get
Return m_sEXPFILE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPFILE, value) Then
m_sEXPFILE = value
Else
NotifyPropertyChanged(NameOf(sEXPFILE))
End If
End Set
End Property
Public m_ocRECESS As New List(Of Object)({New IdNameStruct(Recess.AUTOMATIC, EgtMsg(61658)),
New IdNameStruct(Recess.MANUAL, EgtMsg(61661))})
Public ReadOnly Property ocRECESS As List(Of Object)
Get
Return m_ocRECESS
End Get
End Property
Public m_SelRECESS As Integer
Public Property SelRECESS As Integer
Get
Return m_SelRECESS
End Get
Set(value As Integer)
Dim nValue As Integer = IdNameStruct.IdFromInd(value, ocRECESS)
Dim sValue As String = [Enum].GetName(GetType(Recess), nValue)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_PRT_RECESS, sValue) Then
m_SelRECESS = value
Else
NotifyPropertyChanged(NameOf(SelRECESS))
End If
End Set
End Property
Public m_sUSERATTRIBUTE As String
Public Property sUSERATTRIBUTE As String
Get
Return m_sUSERATTRIBUTE
End Get
Set(value As String)
If EgtSetInfo(m_nBTLInfoLayerId, BTL_GEN_USERATTRIBUTE, value) Then
m_sUSERATTRIBUTE = value
Else
NotifyPropertyChanged(NameOf(sUSERATTRIBUTE))
End If
End Set
End Property
#End Region ' Parametri generici
#Region "Messages"
Public ReadOnly Property PROJNUM_MSG As String
Get
Return EgtMsg(61692)
End Get
End Property
Public ReadOnly Property PROJNAME_MSG As String
Get
Return EgtMsg(61693)
End Get
End Property
Public ReadOnly Property PROJPART_MSG As String
Get
Return EgtMsg(61694)
End Get
End Property
Public ReadOnly Property PROJGUID_MSG As String
Get
Return EgtMsg(61695)
End Get
End Property
Public ReadOnly Property LISTNAME_MSG As String
Get
Return EgtMsg(61696)
End Get
End Property
Public ReadOnly Property CUSTOMER_MSG As String
Get
Return EgtMsg(61697)
End Get
End Property
Public ReadOnly Property ARCHITECT_MSG As String
Get
Return EgtMsg(61698)
End Get
End Property
Public ReadOnly Property EDITOR_MSG As String
Get
Return EgtMsg(61699)
End Get
End Property
Public ReadOnly Property DELIVDATE_MSG As String
Get
Return EgtMsg(61700)
End Get
End Property
Public ReadOnly Property EXPDATE_MSG As String
Get
Return EgtMsg(61701)
End Get
End Property
Public ReadOnly Property EXPTIME_MSG As String
Get
Return EgtMsg(61702)
End Get
End Property
Public ReadOnly Property EXPRELEASE_MSG As String
Get
Return EgtMsg(61703)
End Get
End Property
Public ReadOnly Property LANGUAGE_MSG As String
Get
Return EgtMsg(61704)
End Get
End Property
Public ReadOnly Property RANGE_MSG As String
Get
Return EgtMsg(61705)
End Get
End Property
Public ReadOnly Property PROCESSINGQUALITY_MSG As String
Get
Return EgtMsg(61642)
End Get
End Property
Public ReadOnly Property COMPUTERNAME_MSG As String
Get
Return EgtMsg(61706)
End Get
End Property
Public ReadOnly Property USER_MSG As String
Get
Return EgtMsg(61707)
End Get
End Property
Public ReadOnly Property SRCFILE_MSG As String
Get
Return EgtMsg(61708)
End Get
End Property
Public ReadOnly Property EXPFILE_MSG As String
Get
Return EgtMsg(61709)
End Get
End Property
Public ReadOnly Property RECESS_MSG As String
Get
Return EgtMsg(61643)
End Get
End Property
Public ReadOnly Property USERATTRIBUTE_MSG As String
Get
Return EgtMsg(61648)
End Get
End Property
#End Region ' Messages
' Definizione comandi
Private m_cmdOk As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(nProjId As Integer)
' leggo cartella dei setup delle strategie
Dim AISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath(ProjectManagerVM.CurrProd.nType, True)
Dim AISetupPaths As String() = Directory.GetFiles(AISetupDirPath)
For Each AiSetup In AISetupPaths
m_StrategySetupList.Add(Path.GetFileNameWithoutExtension(AiSetup))
Next
' cerco tra i layer BTLInfo
Dim nCurrBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
While nCurrBTLInfoLayerId <> GDB_ID.NULL
' verifico se il layer appartiene al ProjId
Dim nBTLInfoLayerProjId As Integer
EgtGetInfo(nCurrBTLInfoLayerId, BTL_PRT_PROJ, nBTLInfoLayerProjId)
If nBTLInfoLayerProjId = nProjId Then
m_nBTLInfoLayerId = nCurrBTLInfoLayerId
Exit While
End If
nCurrBTLInfoLayerId = EgtGetNextName(nCurrBTLInfoLayerId, BTLINFO)
End While
' leggo parametri Btl
ReadBtlParams()
'' leggo strategia
'EgtGetInfo(m_nBTLInfoLayerId, "AISETUP", m_SelStrategySetup)
' Controllo se presente file default config
Dim sDefaultConfigFile As String = String.Empty
Dim sTrimDefaultConfig As String = String.Empty
If GetMainPrivateProfileString(S_STRATEGY, K_DEFAULTCONFIG, "", sDefaultConfigFile) <> 0 Then
sTrimDefaultConfig = System.IO.Path.GetFileNameWithoutExtension(sDefaultConfigFile)
m_SelStrategySetup = sTrimDefaultConfig
EgtSetInfo(m_nBTLInfoLayerId, "AISETUP", m_SelStrategySetup)
End If
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(Map.refStrategyManagerVM.SelStrategyType.Id)
Dim sGeneralParametersFilePath As String = sStrategiesDirPath & "\" & GENERALPARAMETERS_FILE & ".json"
If File.Exists(sGeneralParametersFilePath) Then
Dim sReadedFiles As String = File.ReadAllText(sGeneralParametersFilePath)
Dim JsonGeneralParametersList As List(Of JsonGeneralParameters) = JsonConvert.DeserializeObject(Of List(Of JsonGeneralParameters))(sReadedFiles)
m_GeneralParametersList = New ObservableCollection(Of ProjectParameters)((From JsonGeneralParameter In JsonGeneralParametersList
Select JsonGeneralParameter.Deserialize(Map.refStrategyManagerVM.SelStrategyType.Id)).ToList())
For Each GenericItem As ProjectParameters In m_GeneralParametersList
Select Case GenericItem.sMinUserLevel
Case UserLevel.ADVANCED
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UserAdmin_IsChecked, Visibility.Visible, Visibility.Collapsed))
Case Else
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, Visibility.Visible, Visibility.Collapsed))
Map.refMainMenuVM.SetUnloackImage("pack://application:,,,/Resources/NewPage/padlock.png")
End If
End Select
Next
NotifyPropertyChanged(NameOf(GeneralParametersList))
End If
' Leggo info se presenti
Dim sInfo As String = String.Empty
For Each GeneralParameter In m_GeneralParametersList
Select Case GeneralParameter.GetType()
Case GetType(BooleanGenericParameter)
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
Dim sTmpBoolValue As Boolean = DirectCast(GeneralParameter, BooleanGenericParameter).bValue
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue) Then
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(DoubleGenericParameter)
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue) Then
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(ComboGenericParameter)
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue) Then
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(StringGenericParameter)
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
Dim sTmpStringValue As String = DirectCast(GeneralParameter, StringGenericParameter).sValue
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue) Then
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(ListGenericParameter)
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
If Item.bIsActive Then
sInfo &= Item.sUUID & "," & Item.sName & ";"
Dim sTmpInfo As String = sInfo
If Not EgtGetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, sInfo) Then
sInfo = sTmpInfo
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
Return
End If
End If
Next
End Select
Next
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Private Sub ReadBtlParams()
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJNUM, m_sPROJNUM)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJNAME, m_sPROJNAME)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJPART, m_sPROJPART)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJGUID, m_sPROJGUID)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_PROJTYPE, m_nPROJTYPE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_LISTNAME, m_sLISTNAME)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_CUSTOMER, m_sCUSTOMER)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_ARCHITECT, m_sARCHITECT)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_EDITOR, m_sEDITOR)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_DELIVDATE, m_sDELIVDATE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPDATE, m_sEXPDATE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPTIME, m_sEXPTIME)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPRELEASE, m_sEXPRELEASE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_LANGUAGE, m_sLANGUAGE)
Dim sValue As String = String.Empty
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_RANGE, sValue)
m_SelRANGE = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocRANGE), ocRANGE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_PRT_PROCESSINGQUALITY, sValue)
m_SelPROCESSINGQUALITY = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocPROCESSINGQUALITY), ocPROCESSINGQUALITY)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_COMPUTERNAME, m_sCOMPUTERNAME)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_USER, m_sUSER)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_SRCFILE, m_sSRCFILE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_EXPFILE, m_sEXPFILE)
EgtGetInfo(m_nBTLInfoLayerId, BTL_PRT_RECESS, sValue)
m_SelRECESS = IdNameStruct.IndFromId(IdNameStruct.IdFromName(sValue, ocRECESS), ocRECESS)
EgtGetInfo(m_nBTLInfoLayerId, BTL_GEN_USERATTRIBUTE, m_sUSERATTRIBUTE)
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
'' scrivo AISetup
'Dim sOldStrategySetup As String = ""
'EgtGetInfo(m_nBTLInfoLayerId, "AISETUP", sOldStrategySetup)
'If m_SelStrategySetup <> sOldStrategySetup Then
' EgtSetInfo(m_nBTLInfoLayerId, "AISETUP", m_SelStrategySetup)
'End If
Dim sInfo As String = String.Empty
If m_bSaveGeneralParameters Then
For Each GeneralParameter In GeneralParametersList
Select Case GeneralParameter.GetType()
Case GetType(BooleanGenericParameter)
EgtSetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
Case GetType(DoubleGenericParameter)
EgtSetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
Case GetType(ComboGenericParameter)
EgtSetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue)
Case GetType(StringGenericParameter)
EgtSetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue)
Case GetType(ListGenericParameter)
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
If Item.bIsActive Then
sInfo &= Item.sUUID & "," & Item.sName & ";"
EgtSetInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge, sInfo)
End If
Next
End Select
Next
Else
For Each GeneralParameter In m_GeneralParametersList
Select Case GeneralParameter.GetType()
Case GetType(BooleanGenericParameter)
EgtRemoveInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge)
Case GetType(DoubleGenericParameter)
EgtRemoveInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge)
Case GetType(ComboGenericParameter)
EgtRemoveInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge)
Case GetType(StringGenericParameter)
EgtRemoveInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge)
Case GetType(ListGenericParameter)
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
If Item.bIsActive Then
sInfo &= Item.sUUID & "," & Item.sName & ";"
EgtRemoveInfo(m_nBTLInfoLayerId, GeneralParameter.sNameNge)
End If
Next
End Select
Next
End If
Map.refProdManagerVM.Save()
RaiseEvent m_CloseWindow(True)
End Sub
#End Region ' Ok
#End Region ' COMMANDS
End Class
@@ -0,0 +1,49 @@
<Border x:Class="BTLPartManagerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DataContext="{StaticResource BTLPartManagerVM}"
CornerRadius="5"
BorderThickness="2"
BorderBrush="{StaticResource BeamWall_Teal}"
Background="{StaticResource BeamWall_FountainBlue}">
<StackPanel Orientation="Horizontal"
Style="{StaticResource OnlyProdBTLPartManager_StackPanel}">
<Button Command="{Binding CopyPart_Command}"
Click="ClosePopUp_Click"
ToolTip="{Binding CopyPart_ToolTip}"
IsEnabled="{Binding CopyPart_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/CopyPart.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding RemovePart_Command}"
Click="ClosePopUp_Click"
ToolTip="{Binding RemovePart_ToolTip}"
IsEnabled="{Binding RemovePart_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding Simulate_ToolTip}"
Click="ClosePopUp_Click"
Command="{Binding Simulate_Command}"
IsEnabled="{Binding Simulate_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/Simulate.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding Edit_ToolTip}"
Click="ClosePopUp_Click"
Command="{Binding Edit_Command}"
IsEnabled="{Binding Edit_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/Edit.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding ResetCalc_Command}"
Click="ClosePopUp_Click"
ToolTip="{Binding ResetCalc_ToolTip}"
IsEnabled="{Binding CALCPanel_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/ResetCalc.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Border>
@@ -0,0 +1,14 @@
Public Class BTLPartManagerV
Private Sub ClosePopUp_Click(sender As Object, e As RoutedEventArgs)
Dim Button As Button = DirectCast(sender, Button)
Dim StackPanel As StackPanel = DirectCast(Button.Parent, StackPanel)
Dim OnlyProdBTLPartManagerV As BTLPartManagerV = DirectCast(StackPanel.Parent, BTLPartManagerV)
Dim Popup As Primitives.Popup = DirectCast(OnlyProdBTLPartManagerV.Parent, Primitives.Popup)
If Not IsNothing(Popup) Then
Popup.IsOpen = False
End If
End Sub
End Class
@@ -0,0 +1,456 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Optimizer.MainMenuVM
Imports EgtUILib
Imports EgtWPFLib5
Imports Newtonsoft.Json
Public Class BTLPartManagerVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private m_BTLPartManager_IsEnabled As Boolean = True
Public ReadOnly Property BTLPartManager_IsEnabled As Boolean
Get
Return m_BTLPartManager_IsEnabled
End Get
End Property
Public ReadOnly Property CopyPart_IsEnabled As Boolean
Get
Return m_BTLPartManager_IsEnabled AndAlso Not IsNothing(Map.refShowBeamPanelVM) AndAlso Not Map.refShowBeamPanelVM.bShowAll AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 1
End Get
End Property
Public ReadOnly Property RotatePart_IsEnabled As Boolean
Get
Return m_BTLPartManager_IsEnabled AndAlso Not IsNothing(Map.refProjectVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 1
End Get
End Property
Public ReadOnly Property RemovePart_IsEnabled As Boolean
Get
Return m_BTLPartManager_IsEnabled
End Get
End Property
' Definizione comandi
Private m_cmdCopyPart As ICommand
Private m_cmdRemovePart As ICommand
Private m_cmdSimulate As ICommand
Private m_cmdEdit As ICommand
Private m_cmdResetCalc As ICommand
#Region "Messages"
Public ReadOnly Property NewRawPart_ToolTip As String
Get
Return EgtMsg(61903)
End Get
End Property
Public ReadOnly Property NewRawPartLast_ToolTip As String
Get
Return EgtMsg(61977)
End Get
End Property
Public ReadOnly Property AddToRawPart_ToolTip As String
Get
Return EgtMsg(61904)
End Get
End Property
Public ReadOnly Property CopyPart_ToolTip As String
Get
Return EgtMsg(61905)
End Get
End Property
Public ReadOnly Property RemovePart_ToolTip As String
Get
Return EgtMsg(61907)
End Get
End Property
Public ReadOnly Property AddFeature_ToolTip As String
Get
Return EgtMsg(61910)
End Get
End Property
Public ReadOnly Property RemoveFeature_ToolTip As String
Get
Return EgtMsg(61911)
End Get
End Property
Public ReadOnly Property BackRotation_ToolTip As String
Get
Return EgtMsg(61996)
End Get
End Property
Public ReadOnly Property ForwardRotation_ToolTip As String
Get
Return EgtMsg(61997)
End Get
End Property
Public ReadOnly Property InvertSx_ToolTip As String
Get
Return EgtMsg(61998)
End Get
End Property
Public ReadOnly Property InvertDx_ToolTip As String
Get
Return EgtMsg(61999)
End Get
End Property
Public ReadOnly Property Simulate_ToolTip As String
Get
Return EgtMsg(61902)
End Get
End Property
Public ReadOnly Property Edit_ToolTip As String
Get
Return EgtMsg(61939)
End Get
End Property
Public ReadOnly Property ResetCalc_ToolTip As String
Get
Return EgtMsg(61940)
End Get
End Property
#End Region ' Messages
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
Map.SetRefBTLPartManagerVM(Me)
End Sub
#End Region ' Constructor
#Region "METHODS"
Friend Sub SetBTLPartManagerIsEnabled(bIsEnabled As Boolean)
m_BTLPartManager_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(BTLPartManager_IsEnabled))
NotifyPropertyChanged(NameOf(CopyPart_IsEnabled))
NotifyPropertyChanged(NameOf(RemovePart_IsEnabled))
End Sub
Friend Sub PartShowAllChanged()
NotifyPropertyChanged(NameOf(CopyPart_IsEnabled))
'NotifyPropertyChanged(NameOf(RotatePart_IsEnabled))
NotifyPropertyChanged(NameOf(RemovePart_IsEnabled))
End Sub
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
Private Sub ManageCalc(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
If dProgress = 0 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
ElseIf dProgress = 1 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
Map.refMyStatusBarVM.SetOutputMessage(sProgress, 3)
End If
bCancel = Map.refMyStatusBarVM.bStopProgress
Map.refMyStatusBarVM.SetLoadingProgress(dProgress * 100)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
End Sub
Private Sub GetGeneralParameters()
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(Map.refStrategyManagerVM.SelStrategyType.Id)
Dim sGeneralParametersFilePath As String = sStrategiesDirPath & "\" & GENERALPARAMETERS_FILE & ".json"
If File.Exists(sGeneralParametersFilePath) Then
Dim sReadedFiles As String = File.ReadAllText(sGeneralParametersFilePath)
Dim JsonGeneralParametersList As List(Of JsonGeneralParameters) = JsonConvert.DeserializeObject(Of List(Of JsonGeneralParameters))(sReadedFiles)
Map.refProjectVM.GeneralParametersList = New ObservableCollection(Of ProjectParameters)((From JsonGeneralParameter In JsonGeneralParametersList
Select JsonGeneralParameter.Deserialize(Map.refStrategyManagerVM.SelStrategyType.Id)).ToList())
For Each GenericItem As ProjectParameters In Map.refProjectVM.GeneralParametersList
Select Case GenericItem.sMinUserLevel
Case UserLevel.ADVANCED
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(Map.refMainMenuVM.UserAdmin_IsChecked, Visibility.Visible, Visibility.Collapsed))
Case Else
If Not Map.refMainMenuVM.UserAdmin_IsChecked Then
Map.refMainMenuVM.UserLevelGenericVisibility(GenericItem, If(GenericItem.sMinUserLevel = UserLevel.USER, Visibility.Visible, Visibility.Collapsed))
Map.refMainMenuVM.SetUnloackImage("pack://application:,,,/Resources/NewPage/padlock.png")
End If
End Select
Next
NotifyPropertyChanged(NameOf(Map.refProjectVM.GeneralParametersList))
End If
' Leggo info se presenti
Dim sInfo As String = String.Empty
For Each GeneralParameter In Map.refProjectVM.GeneralParametersList
Select Case GeneralParameter.GetType()
Case GetType(BooleanGenericParameter)
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
Dim sTmpBoolValue As Boolean = DirectCast(GeneralParameter, BooleanGenericParameter).bValue
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue) Then
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
Map.refProjectVM.SetbSaveGeneralParameters(False)
Map.refProjectVM.SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(DoubleGenericParameter)
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue) Then
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
Map.refProjectVM.SetbSaveGeneralParameters(False)
Map.refProjectVM.SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(ComboGenericParameter)
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue) Then
DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue = sTmpComboValue
Map.refProjectVM.SetbSaveGeneralParameters(False)
Map.refProjectVM.SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(StringGenericParameter)
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
Dim sTmpStringValue As String = DirectCast(GeneralParameter, StringGenericParameter).sValue
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue) Then
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
Map.refProjectVM.SetbSaveGeneralParameters(False)
Map.refProjectVM.SetGeneralParametersIsEnable(False)
Return
End If
Case GetType(ListGenericParameter)
Map.refProjectVM.SetbSaveGeneralParameters(True)
Map.refProjectVM.SetGeneralParametersIsEnable(True)
For Each Item As ToolParameter In DirectCast(GeneralParameter, ListGenericParameter).ListValue
If Item.bIsActive Then
sInfo &= Item.sUUID & "," & Item.sName & ";"
Dim sTmpInfo As String = sInfo
If Not EgtGetInfo(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.nPartId, GeneralParameter.sNameNge, sInfo) Then
sInfo = sTmpInfo
Map.refProjectVM.SetbSaveGeneralParameters(False)
Map.refProjectVM.SetGeneralParametersIsEnable(False)
Return
End If
End If
Next
End Select
Next
End Sub
#End Region ' Methods
#Region "COMMANDS"
#Region "CopyPart"
Public ReadOnly Property CopyPart_Command As ICommand
Get
If m_cmdCopyPart Is Nothing Then
m_cmdCopyPart = New Command(AddressOf CopyPart)
End If
Return m_cmdCopyPart
End Get
End Property
Public Sub CopyPart()
If IsNothing(ProjectManagerVM.CurrProd) Then Return
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
If IsNothing(SelPart) Then Return
' creo copia
Dim NewPart As BTLPartM = SelPart.Copy()
If Not IsNothing(NewPart) Then
' selezione ultimo che e' quello appena creato
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList(Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1), False, True)
End If
End Sub
#End Region ' CopyPart
#Region "RemovePart"
Public ReadOnly Property RemovePart_Command As ICommand
Get
If m_cmdRemovePart Is Nothing Then
m_cmdRemovePart = New Command(AddressOf RemovePartCmd)
End If
Return m_cmdRemovePart
End Get
End Property
Public Sub RemovePartCmd()
If IsNothing(ProjectManagerVM.CurrProd) Then Return
If MessageBox.Show(EgtMsg(62573), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Exclamation) = MessageBoxResult.OK Then
If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then
Dim CurrSelBTLParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList()
For RemoveIndex = CurrSelBTLParts.Count - 1 To 0 Step -1
RemovePart(CurrSelBTLParts(RemoveIndex), RemoveIndex = 0)
Next
End If
Else
Return
End If
End Sub
Public Sub RemovePart(BTLPartToDelete As BTLPartVM, bSelPrevious As Boolean)
' verifico se ci sono già copie in grezzi
Dim nDuploCount As Integer = 0
If EgtDuploCount(BTLPartToDelete.nPartId, nDuploCount) AndAlso nDuploCount > 0 Then
' avviso che il pezzo non è cancellabile perchè in produzione
MessageBox.Show(String.Format(EgtMsg(61929), nDuploCount), EgtMsg(15003), MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
' verifico se rimuovere sezione dalla lista
If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x IsNot BTLPartToDelete AndAlso x.Section = BTLPartToDelete.Section) Then
Map.refProjectVM.BTLStructureVM.SectionList.Remove(BTLPartToDelete.Section)
Map.refProjectVM.BTLStructureVM.SelSection = SectionXMaterial.Empty
End If
' Eseguo cancellazione
EgtBeamSetPart(BTLPartToDelete.nPartId)
' seleziono elemento precedente
Dim Index As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList.IndexOf(BTLPartToDelete)
Dim FilteredIndex As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.IndexOf(BTLPartToDelete)
Map.refProjectVM.BTLStructureVM.SelBTLParts.Remove(BTLPartToDelete)
If EgtBeamErasePart() Then
If bSelPrevious Then
If FilteredIndex = 0 Then
If Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count > 1 Then
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View(1))
Else
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing)
End If
ElseIf FilteredIndex = Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count - 1 Then
If Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count > 1 Then
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View.Count - 2))
Else
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing)
End If
Else
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.BTLPartVMList_View(FilteredIndex - 1))
End If
End If
' rimuovo dalla lista pezzi
Map.refProjectVM.BTLStructureVM.BTLPartVMList.RemoveAt(Index)
End If
End Sub
#End Region ' RemovePart
#Region "SimulateCommand"
Public ReadOnly Property Simulate_Command As ICommand
Get
If m_cmdSimulate Is Nothing Then
m_cmdSimulate = New Command(AddressOf Simulate)
End If
Return m_cmdSimulate
End Get
End Property
Friend Sub Simulate()
If ((IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
Dim ProjType As BWType
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
ProjType = Map.refProdManagerVM.CurrProd.nType
If Not CreateBarToSimulate(ProjType, BarList) Then Return
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000"), AddressOf ManageCalc)
End Sub
Private Function CreateBarToSimulate(ProjType As BWType, ByRef BarList As Bar()) As Boolean
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = ProjectManagerVM.CurrProd.sMachine,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000") & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
Return True
End Function
#End Region ' SimulateCommand
#Region "Edit"
Public ReadOnly Property Edit_Command As ICommand
Get
If m_cmdEdit Is Nothing Then
m_cmdEdit = New Command(AddressOf Edit)
End If
Return m_cmdEdit
End Get
End Property
Friend Sub Edit()
GetGeneralParameters()
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Collapsed)
Map.refProjectVM.SetFeatureListVisibility(Visibility.Collapsed)
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.FEATUREMANAGER)
' Disabilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(False)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(0.2)
End Sub
#End Region ' Edit
#Region "ResetCalc"
Public ReadOnly Property ResetCalc_Command As ICommand
Get
If m_cmdResetCalc Is Nothing Then
m_cmdResetCalc = New Command(AddressOf ResetCalc)
End If
Return m_cmdResetCalc
End Get
End Property
Public Sub ResetCalc()
If IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Return
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
If IsNothing(SelPart) Then Return
If SelPart.nGlobalState <> CalcStates.NOTCALCULATED Then
SelPart.ResetCalcTotalPart()
End If
End Sub
#End Region ' ResetCalc
#End Region ' COMMANDS
End Class
@@ -0,0 +1,701 @@
Imports System.Collections.ObjectModel
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLFeatureVM
Inherits Core.BTLFeatureVM
#Region "FIELDS & PROPERTIES"
Public Property GRPList As ObservableCollection(Of Integer)
Get
Return m_BTLFeatureM.GRPList
End Get
Set(value As ObservableCollection(Of Integer))
m_BTLFeatureM.GRPList = value
End Set
End Property
Public Overrides Property nSelGRP As Integer
Get
Return m_BTLFeatureM.nSelGRP
End Get
Set(value As Integer)
If value <> -1 Then
' verifico se solido attivo
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
' aggiorno la feature con nuovo valore
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
Dim vParQ() As String = Nothing
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(value, m_BTLFeatureM.nPRC, nSelSIDE, m_BTLFeatureM.sDES, m_BTLFeatureM.nPRID,
m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
If bOK Then
m_BTLFeatureM.nSelGRP = value
' seleziono feature in disegno
SelGeomFeature()
' rendo non calcolata questa feature
ResetCalcFeature()
End If
NotifyPropertyChanged(NameOf(nSelGRP))
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
EgtDraw()
End If
End Set
End Property
Public Property SIDEList As ObservableCollection(Of Integer)
Get
Return m_BTLFeatureM.SIDEList
End Get
Set(value As ObservableCollection(Of Integer))
m_BTLFeatureM.SIDEList = value
End Set
End Property
' Lato
Public Overrides Property nSelSIDE As Integer
Get
Return m_BTLFeatureM.nSelSIDE
End Get
Set(value As Integer)
If value <> -1 Then
' verifico se solido attivo
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
' se freecontour
If Me.m_BTLFeatureM.IsFreeContour() Then
' cambio faccia alla geometria
Dim frOld As New Frame3d
EgtBeamGetSideData(nSelSIDE, frOld)
frOld.Invert()
Dim frNew As New Frame3d
EgtBeamGetSideData(value, frNew)
Dim sAuxId As String = ""
If EgtGetInfo(nFeatureId, "AUXID", sAuxId) Then
' verifico se ha uno o due percorsi
Dim sAuxIdSplit() As String = sAuxId.Split(","c)
If Not IsNothing(sAuxIdSplit) AndAlso sAuxIdSplit.Length() >= 1 Then
Dim nAuxId As Integer = GDB_ID.NULL
If Integer.TryParse(sAuxIdSplit(0), nAuxId) Then
EgtTransform(nFeatureId + nAuxId, frOld, GDB_RT.GLOB)
EgtTransform(nFeatureId + nAuxId, frNew, GDB_RT.GLOB)
End If
End If
If Not IsNothing(sAuxIdSplit) AndAlso sAuxIdSplit.Length() >= 2 Then
Dim nAux2Id As Integer = GDB_ID.NULL
If Integer.TryParse(sAuxIdSplit(1), nAux2Id) Then
EgtTransform(nFeatureId + nAux2Id, frOld, GDB_RT.GLOB)
EgtTransform(nFeatureId + nAux2Id, frNew, GDB_RT.GLOB)
End If
End If
End If
End If
' aggiorno la feature con nuovo valore
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
Dim vParQ() As String = Nothing
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(nSelGRP, m_BTLFeatureM.nPRC, value, m_BTLFeatureM.sDES, m_BTLFeatureM.nPRID,
m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
If bOK Then
m_BTLFeatureM.nSelSIDE = value
SelGeomFeature()
' rendo non calcolata questa feature
ResetCalcFeature()
End If
NotifyPropertyChanged(NameOf(nSelSIDE))
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
EgtDraw()
End If
End Set
End Property
Public Property VARIANTList As ObservableCollection(Of Integer)
Get
Return m_BTLFeatureM.VARIANTList
End Get
Set(value As ObservableCollection(Of Integer))
m_BTLFeatureM.VARIANTList = value
End Set
End Property
Public Overrides Property nSelVARIANT As Integer
Get
Return m_BTLFeatureM.nSelVARIANT
End Get
Set(value As Integer)
If value <> m_BTLFeatureM.nSelVARIANT Then
m_BTLFeatureM.nSelVARIANT = value
Dim vPar As Double() = Nothing
Dim sPar As String = Nothing
Dim vParQ As String() = Nothing
CreateFeatureVariant(value, vPar, sPar, vParQ)
If IsNothing(vPar) Then
m_BTLFeatureM.nSelVARIANT = 0
CreateFeatureVariant(value, vPar, sPar, vParQ)
End If
m_BTLFeatureM.nSelVARIANT = value
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(nSelGRP, m_BTLFeatureM.nPRC, nSelSIDE, sDES, m_BTLFeatureM.nPRID,
m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
If bOK Then
EgtDuploSetModified(m_BTLPartM.nPartId)
' seleziono feature in disegno
SelGeomFeature()
' rendo non calcolata questa feature
ResetCalcFeature()
End If
NotifyPropertyChanged(NameOf(nSelVARIANT))
NotifyPropertyChanged(NameOf(PBTLParamVMList))
EgtDraw()
End If
End Set
End Property
Private Sub CreateFeatureVariant(value As Integer, ByRef vPar() As Double, ByRef sPar As String, ByRef vParQ() As String)
' crea parametri per questa feature da file ini
m_BTLFeatureM.CreateFeatureParams(m_BTLFeatureM)
m_BTLFeatureM.SetDefaultValues()
CreatePBTLParamVMList()
' aggiorno la feature con nuovo valore
vPar = Nothing
sPar = Nothing
vParQ = Nothing
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
If value > 0 AndAlso IO.File.Exists(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & "." & sDES & ".png") Then
Map.refPParameterListVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & "." & sDES & ".png")
Else
Map.refPParameterListVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png")
End If
End Sub
Public Property sPriority As String
Get
Return m_BTLFeatureM.nPriority.ToString()
End Get
Set(value As String)
Dim nTemp As Integer = 0
If Integer.TryParse(value, nTemp) Then
If EgtSetInfo(nFeatureId, BTL_FTR_PRIORITY, nTemp) Then
m_BTLFeatureM.nPriority = nTemp
' setto feature da ricalcolare
ResetCalcFeature()
' imposto modificato per copie
MyMachGroupPanelM.SetDuploModified(m_BTLPartM.nPartId)
End If
End If
NotifyPropertyChanged(NameOf(sPriority))
End Set
End Property
' proprieta' che indica se e' attivo l'update del parametro bDO su piu' feature (attiva/disattiva tutti su pezzo, o per tipo con tasto destro)
' necessario per evitare ricalcolo della grafica sulla modifica del parametro per ogni feature
Private Shared m_bDO_MultipleUpdate As Boolean = False
Public Shared Property bDO_MultipleUpdate As Boolean
Get
Return m_bDO_MultipleUpdate
End Get
Set(value As Boolean)
m_bDO_MultipleUpdate = value
End Set
End Property
Public Overrides Property bDO As Boolean
Get
Return m_BTLFeatureM.bDO
End Get
Set(value As Boolean)
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If value <> m_BTLFeatureM.bDO Then
If EgtBeamEnableProcess(nFeatureId, value, Not m_bDO_MultipleUpdate) Then
m_BTLFeatureM.bDO = value
' setto feature da ricalcolare
ResetCalcFeature()
If Not IsNothing(m_BTLPartM) Then
MyMachGroupPanelM.SetDuploModified(m_BTLPartM.nPartId)
End If
NotifyPropertyChanged(NameOf(bDO))
' aggiorno messaggio su context menu
For Each Item In MenuList
Item.NotifyPropertyChanged(NameOf(Item.sMsg))
Next
End If
If Not m_bDO_MultipleUpdate Then EgtDraw()
' aggiorno stato abilitazione del bottone modifica free contour
Map.refFeatureManagerVM.SetEditIsEnabled()
End If
End Set
End Property
Public ReadOnly Property sDrawPath As String
Get
If nPRC = 900 AndAlso nSelVARIANT > 0 Then
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & "." & sDES & ".png"
Else
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png"
End If
End Get
End Property
Private m_PBTLParamVMList As ObservableCollection(Of BTLParamVM)
Public Property PBTLParamVMList As ObservableCollection(Of BTLParamVM)
Get
Return m_PBTLParamVMList
End Get
Set(value As ObservableCollection(Of BTLParamVM))
m_PBTLParamVMList = value
End Set
End Property
Protected m_SelPBTLParam As BTLParamVM
Public Property SelPBTLParam As BTLParamVM
Get
Return m_SelPBTLParam
End Get
Set(value As BTLParamVM)
m_SelPBTLParam = value
If Not IsNothing(m_SelPBTLParam) Then
' imposto path disegno da mostrare in BottomPanel
If Not IsNothing(Map.refProjectVM) Then
Map.refPParameterListVM.SetCurrDraw(m_SelPBTLParam.sDrawPath)
End If
End If
NotifyPropertyChanged(NameOf(SelPBTLParam))
End Set
End Property
Public ReadOnly Property Edit_Visibility As Visibility
Get
Return If(BTLFeatureM.IsFreeContour AndAlso Not Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Public ReadOnly Property SaveCancel_Visibility As Visibility
Get
Return If(BTLFeatureM.IsFreeContour AndAlso Map.refFreeContourManagerVM.bIsActive, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Friend Sub RefreshFCMBtnVisibility()
NotifyPropertyChanged(NameOf(Edit_Visibility))
NotifyPropertyChanged(NameOf(SaveCancel_Visibility))
End Sub
Private m_MenuList As New List(Of MenuItemVm)
Public Property MenuList As List(Of MenuItemVm)
Get
Return m_MenuList
End Get
Set(value As List(Of MenuItemVm))
m_MenuList = value
End Set
End Property
#Region "Messages"
Public ReadOnly Property Edit_ToolTip As String
Get
Return EgtMsg(61939)
End Get
End Property
#End Region ' Messages
' Definizione comandi
Private m_cmdEdit As ICommand
Private m_cmdSave As ICommand
Private m_cmdCancel As ICommand
Private m_cmdDeleteFeature As ICommand
Private m_cmdEditFeature As ICommand
Private m_cmdStategyCmd As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(BTLFeatureM As BTLFeatureM, BTLPartM As BTLPartM)
m_BTLFeatureM = BTLFeatureM
AddHandler m_BTLFeatureM.PBTLParamAdded, AddressOf OnPBTLParamAdded
m_BTLPartM = BTLPartM
CreatePBTLParamVMList()
NotifyPropertyChanged(NameOf(Calc_Background))
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
m_MenuList.Add(New MenuItemVm(Me))
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"
Private Sub CreatePBTLParamVMList()
Dim all As List(Of BTLParamVM) = (From BTLParamM In m_BTLFeatureM.GetPBTLParams()
Select New BTLParamVM(BTLParamM, m_BTLFeatureM)).ToList()
For Each BTLParamVM As BTLParamVM In all
AddHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
Next
m_PBTLParamVMList = New ObservableCollection(Of BTLParamVM)(all)
AddHandler m_PBTLParamVMList.CollectionChanged, AddressOf OnPBTLParamVMListChanged
End Sub
' funzione che aggiorna lo stato, la rotazione e gli errori dopo calcolo
Friend Sub CalcFeatureUpdate(nProgramPage As Integer, ERR As Integer, ROT As Integer, MSG As String)
EgtSetInfo(nFeatureId, If(nProgramPage = ProjectType.PROJ, ITG_PROJ_ERR, ITG_PROD_ERR), ERR, True)
EgtSetInfo(nFeatureId, If(nProgramPage = ProjectType.PROJ, ITG_PROJ_MSG, ITG_PROD_MSG), MSG, True)
EgtSetInfo(nFeatureId, If(nProgramPage = ProjectType.PROJ, ITG_PROJ_ROT, ITG_PROD_ROT), ROT, True)
m_BTLFeatureM.nCALC_ERR = ERR
m_BTLFeatureM.nCALC_ROT = ROT
m_BTLFeatureM.sCALC_MSG = MSG
Select Case ERR
Case 0
m_BTLFeatureM.nState = CalcStates.OK
Case 22
m_BTLFeatureM.nState = CalcStates.COLLISION
Case 17, 19
m_BTLFeatureM.nState = CalcStates.WARNING
Case < 0
m_BTLFeatureM.nState = CalcStates.INFO
Case > 0
m_BTLFeatureM.nState = CalcStates.ERROR_
End Select
NotifyPropertyChanged(NameOf(Calc_Background))
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
NotifyPropertyChanged(NameOf(sCALC_MSG))
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
End Sub
' funzione che resetta gli errori del calcolo
Friend Sub ResetFeatureError()
Dim ERR As Integer = 0
Dim MSG As String = ""
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_ERR, ITG_PROD_ERR), ERR, True)
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_MSG, ITG_PROD_MSG), MSG, True)
m_BTLFeatureM.nCALC_ERR = ERR
m_BTLFeatureM.sCALC_MSG = MSG
Select Case ERR
Case 0
m_BTLFeatureM.nState = CalcStates.OK
Case 22
m_BTLFeatureM.nState = CalcStates.COLLISION
Case 17, 19
m_BTLFeatureM.nState = CalcStates.WARNING
Case < 0
m_BTLFeatureM.nState = CalcStates.INFO
Case > 0
m_BTLFeatureM.nState = CalcStates.ERROR_
End Select
NotifyPropertyChanged(NameOf(Calc_Background))
NotifyPropertyChanged(NameOf(sCALC_MSG))
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
End Sub
Friend Sub ResetCalcFeature()
EgtRemoveInfo(nFeatureId, If(IsNothing(m_BTLPartM), ITG_PROD_ERR, ITG_PROJ_ERR))
EgtRemoveInfo(nFeatureId, If(IsNothing(m_BTLPartM), ITG_PROD_MSG, ITG_PROJ_MSG))
EgtRemoveInfo(nFeatureId, If(IsNothing(m_BTLPartM), ITG_PROD_ROT, ITG_PROJ_ROT))
m_BTLFeatureM.nState = CalcStates.NOTCALCULATED
m_BTLFeatureM.nCALC_ERR = 0
m_BTLFeatureM.nCALC_ROT = 0
m_BTLFeatureM.sCALC_MSG = ""
NotifyPropertyChanged(NameOf(Calc_Background))
NotifyPropertyChanged(NameOf(CALC_ROT_Visibility))
NotifyPropertyChanged(NameOf(sCALC_MSG))
NotifyPropertyChanged(NameOf(CALC_ERR_Letter))
NotifyPropertyChanged(NameOf(CALC_ERR_Foreground))
End Sub
Public Function Copy() As BTLFeatureM
Return Copy(m_BTLPartM)
End Function
Public Function Copy(DestBTLPart As BTLPartM) As BTLFeatureM
' creo nuova feature
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
Dim vParQ() As String = Nothing
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
' imposto eventuali percorsi
Dim nCrvId As Integer = GDB_ID.NULL
Dim nCrv2Id As Integer = GDB_ID.NULL
m_BTLFeatureM.GetFreeContourPaths(nCrvId, nCrv2Id)
' creo la feature con nuovi valori
EgtBeamSetPart(DestBTLPart.nPartId)
Dim nNewFeatureId As Integer = EgtBeamAddProcess(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
DestBTLPart.NewProcId(), m_BTLFeatureM.frFRAME, vPar, sPar, vParQ, nCrvId, nCrv2Id)
' se è stata creata
If nNewFeatureId <> GDB_ID.NULL Then
' Riporto priority
EgtSetInfo(nNewFeatureId, BTL_FTR_PRIORITY, m_BTLFeatureM.nPriority)
Dim NewFeat As BTLFeatureM = BTLFeatureM.CreateBTLFeature(m_BTLPartM, nNewFeatureId)
' la aggiungo a struttura BTL pezzo di destinazione
DestBTLPart.AddBTLFeature(NewFeat)
Return NewFeat
End If
Return Nothing
End Function
Public Overrides Sub RefreshFeature()
' leggo gruppo, numero feature, lato e priorità
EgtGetInfo(nFeatureId, BTL_FTR_GRP, m_BTLFeatureM.nSelGRP)
EgtGetInfo(nFeatureId, BTL_FTR_PRC, m_BTLFeatureM.nPRC)
EgtGetInfo(nFeatureId, BTL_FTR_SIDE, m_BTLFeatureM.nSelSIDE)
EgtGetInfo(nFeatureId, BTL_FTR_PRIORITY, m_BTLFeatureM.nPriority)
Dim nDO As Integer = 1
If EgtGetInfo(nFeatureId, BTL_FTR_DO, nDO) Then
m_BTLFeatureM.bDO = (nDO <> 0)
Else
m_BTLFeatureM.bDO = True
End If
NotifyPropertyChanged(NameOf(bDO))
' leggo des,prid e frame
EgtGetInfo(nFeatureId, BTL_FTR_DES, m_BTLFeatureM.sDES)
EgtGetInfo(nFeatureId, BTL_FTR_PRID, m_BTLFeatureM.nPRID)
EgtGetInfo(nFeatureId, BTL_FTR_FRAME, m_BTLFeatureM.frFRAME)
' aggiorno parametri della feature
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "DeleteFeature"
Public ReadOnly Property DeleteFeature_Command As ICommand
Get
If m_cmdDeleteFeature Is Nothing Then
m_cmdDeleteFeature = New Command(AddressOf DeleteFeature)
End If
Return m_cmdDeleteFeature
End Get
End Property
Public Sub DeleteFeature()
If Map.refMainMenuVM.SelPage = Pages.VIEW Then Map.refFeatureListManagerVM.RemoveFeature()
End Sub
#End Region ' DeleteFeature
#Region "Edit"
Public ReadOnly Property Edit_Command As ICommand
Get
If m_cmdEdit Is Nothing Then
m_cmdEdit = New Command(AddressOf Edit)
End If
Return m_cmdEdit
End Get
End Property
Public Sub Edit()
' attivo modalita' contorno libero
Map.refFreeContourManagerVM.Open()
End Sub
#End Region ' Edit
#Region "Save"
Public ReadOnly Property Save_Command As ICommand
Get
If m_cmdSave Is Nothing Then
m_cmdSave = New Command(AddressOf Save)
End If
Return m_cmdSave
End Get
End Property
Public Sub Save()
Select Case Map.refFreeContourManagerVM.SelType
Case FreeContourManagerVM.FreeContourTypes.ONE
Case FreeContourManagerVM.FreeContourTypes.ONEWITHANGLES
Case FreeContourManagerVM.FreeContourTypes.TWO
End Select
' disattivo modalita' contorno libero
Map.refFreeContourManagerVM.Close(True)
End Sub
#End Region ' Save
#Region "Cancel"
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
Public Sub Cancel()
' disattivo modalita' contorno libero
Map.refFreeContourManagerVM.Close(False)
End Sub
#End Region ' Cancel
#Region "Strategy"
Public ReadOnly Property Strategy_Command As ICommand
Get
If m_cmdStategyCmd Is Nothing Then
m_cmdStategyCmd = New Command(AddressOf Strategy)
End If
Return m_cmdStategyCmd
End Get
End Property
Public Sub Strategy()
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.STRATEGYMANAGER)
' Disabilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(False)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(0.2)
Map.refForcedStrategyPanelVM.Init(BTLFeatureM)
End Sub
#End Region ' Strategy
#Region "Edit"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property EditFeature_Command As ICommand
Get
If m_cmdEditFeature Is Nothing Then
m_cmdEditFeature = New Command(AddressOf EditFeature)
End If
Return m_cmdEditFeature
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub EditFeature()
If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then
'Map.refForcedStrategyBTLVM.Init(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.BTLFeatureM)
Map.refForcedStrategyPanelVM.Init(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.BTLFeatureM)
End If
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Collapsed)
'Map.refProjectVM.SetStrategyManagerVisibility(Visibility.Visible)
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.FEATUREMANAGERBTL)
Map.refProjectVM.SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.STRATEGYMANAGERBTL)
' Disabilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(False)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(0.2)
End Sub
#End Region ' Edit
#End Region ' COMMANDS
#Region "EVENTS"
Private Sub OnPBTLParamAdded(sender As Object, e As BTLParamAddedEventArgs) Handles m_BTLFeatureM.PBTLParamAdded
Dim BTLParamVM As New BTLParamVM(e.NewBTLParam, m_BTLFeatureM)
PBTLParamVMList.Add(BTLParamVM)
End Sub
Private Sub OnPBTLParamVMListChanged(sender As Object, e As NotifyCollectionChangedEventArgs)
If Not IsNothing(e.NewItems) AndAlso e.NewItems.Count > 0 Then
For Each BTLParamVM As BTLParamVM In e.NewItems
AddHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
Next
End If
If Not IsNothing(e.OldItems) AndAlso e.OldItems.Count > 0 Then
For Each BTLParamVM As BTLParamVM In e.OldItems
RemoveHandler BTLParamVM.PropertyChanged, AddressOf OnPBTLParamVMPropertyChanged
Next
End If
End Sub
Private Sub OnPBTLParamVMPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
Select Case e.PropertyName
Case NameOf(sender.dValue), NameOf(sender.sValue)
' riseleziono questa feature
SelGeomFeature()
' rendo non calcolata questa feature
ResetCalcFeature()
End Select
End Sub
#End Region ' EVENTS
End Class
Public Class MenuItemVm
Inherits VMBase
Private m_ParentFeature As BTLFeatureVM
Public ReadOnly Property ParentFeature As BTLFeatureVM
Get
Return m_ParentFeature
End Get
End Property
Public ReadOnly Property sMsg As String
Get
Return If(ParentFeature.bDO, "Disable all ", "Enable all ") & ParentFeature.sDescGRP
End Get
End Property
' Definizione comando
Private m_cmdCommand As ICommand
Sub New(Parent As BTLFeatureVM)
m_ParentFeature = Parent
End Sub
#Region "Cancel"
Public ReadOnly Property MenuItem_Command As ICommand
Get
If m_cmdCommand Is Nothing Then
m_cmdCommand = New Command(AddressOf Command)
End If
Return m_cmdCommand
End Get
End Property
Public Sub Command()
Dim bNewDo As Boolean = Not ParentFeature.bDO
' imposto modalita' update multiplo
BTLFeatureVM.bDO_MultipleUpdate = True
' aggiorno tutte le feature del pezzo
Dim SameProcFeatureList As List(Of BTLFeatureVM) = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Where(Function(x) x.nPRC = ParentFeature.nPRC AndAlso x.GRPList.Contains(ParentFeature.nSelGRP)).ToList()
For FeatureVMIndex = 0 To SameProcFeatureList.Count - 1
If FeatureVMIndex = SameProcFeatureList.Count - 1 Then
' reset modalita' update multiplo
BTLFeatureVM.bDO_MultipleUpdate = False
End If
Dim FeatureVM As BTLFeatureVM = SameProcFeatureList(FeatureVMIndex)
If FeatureVM.nPRC = ParentFeature.nPRC AndAlso FeatureVM.GRPList.Contains(ParentFeature.nSelGRP) Then
FeatureVM.bDO = bNewDo
End If
Next
End Sub
#End Region ' Cancel
End Class
@@ -0,0 +1,342 @@
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLParamVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Protected m_BTLParamM As BTLParamM
Public ReadOnly Property BTLParamM As BTLParamM
Get
Return m_BTLParamM
End Get
End Property
Private m_BTLFeatureM As BTLFeatureM
Public ReadOnly Property bIsP As Boolean
Get
Return m_BTLParamM.bIsP
End Get
End Property
Public Property bIsModified As Boolean
Get
Return m_BTLParamM.bIsModified
End Get
Set(value As Boolean)
m_BTLParamM.bIsModified = value
End Set
End Property
Public ReadOnly Property Custom_Visibility As Visibility
Get
If bIsP Then
Return Visibility.Collapsed
Else
Return Visibility.Visible
End If
End Get
End Property
' parametri da struttura
Public Property sName As String
Get
Return m_BTLParamM.sName
End Get
Set(value As String)
m_BTLParamM.sName = value
End Set
End Property
Public ReadOnly Property nId As Integer
Get
Return m_BTLParamM.nId
End Get
End Property
Public Property sDescription As String
Get
Return m_BTLParamM.sDescription
End Get
Set(value As String)
m_BTLParamM.sDescription = value
End Set
End Property
Public ReadOnly Property sMin As String
Get
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_BTLParamM.dMin, 3)
Case BTLParamType.LENGTH
Return LenToString(m_BTLParamM.dMin, 3)
Case Else
Return ""
End Select
End Get
End Property
Public ReadOnly Property dMin As Double
Get
Return m_BTLParamM.dMin
End Get
End Property
Public ReadOnly Property sMax As String
Get
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_BTLParamM.dMax, 3)
Case BTLParamType.LENGTH
Return LenToString(m_BTLParamM.dMax, 3)
Case Else
Return ""
End Select
End Get
End Property
Public ReadOnly Property dMax As Double
Get
Return m_BTLParamM.dMax
End Get
End Property
' parametri da geometria
Public Property sValue As String
Get
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_BTLParamM.dValue, 3)
Case BTLParamType.LENGTH
Return LenToString(m_BTLParamM.dValue, 3)
Case Else ' stringhe
Return m_BTLParamM.sValue
End Select
Return If(m_BTLParamM.nType = BTLParamType.LENGTH, LenToString(m_BTLParamM.dValue, 3), DoubleToString(m_BTLParamM.dValue, 3))
End Get
Set(value As String)
Dim dNewValue As Double
' trasformo valori
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDoubleAdv(value, dNewValue, True)
Case BTLParamType.LENGTH
StringToLenAdv(value, dNewValue, True)
Case Else
' per string non faccio nulla
End Select
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
' verifico che sia compreso tra minimo e massimo
If dNewValue < m_BTLParamM.dMin OrElse dNewValue > m_BTLParamM.dMax Then
MessageBox.Show(EgtMsg(61856), EgtMsg(30007))
NotifyPropertyChanged(NameOf(sValue))
Return
End If
' recupero ParentPart
Dim ParentPart As BTLPartM = TryCast(m_BTLParamM.ParentFeature.ParentPart, BTLPartM)
' recupero PartId
Dim nPartId As Integer = ParentPart.nPartId
' numero di pezzi inseriti nelle barre
Dim INPROD As Integer = 0
EgtDuploInRawCount(nPartId, INPROD)
' recupero pezzi lavorati da Db
Dim nDoneCnt As Integer = DbControllers.m_ProjController.getCountItemState(ProjectManagerVM.CurrProd.nProdId, nPartId, ItemState.Assigned)
' controllo se i pezzi sono lavorati se si messaggio di warning altrimenti messaggio informativo
If nDoneCnt > 0 Then
MessageBox.Show("Pezzo " & nPartId & " non modificato in " & INPROD & " barra/e perche' settata/e come da produrre", EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Warning)
ElseIf INPROD > 0 Then
MessageBox.Show("Pezzo " & nPartId & " modificato in " & INPROD & " barra/e grezza/e", EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Information)
End If
UpdateParamValue(dNewValue, "")
Case Else
UpdateParamValue(0, value)
End Select
NotifyPropertyChanged(NameOf(bCustom))
End Set
End Property
Public Property dValue As Double
Get
Return m_BTLParamM.dValue
End Get
Set(value As Double)
m_BTLParamM.dValue = value
NotifyPropertyChanged(NameOf(sValue))
End Set
End Property
Public Property sDefault As String
Get
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_BTLParamM.dDefault, 3)
Case BTLParamType.LENGTH
Return LenToString(m_BTLParamM.dDefault, 3)
Case Else
Return ""
End Select
End Get
Set(value As String)
Dim dNewValue As Double
' trasformo valori
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDoubleAdv(value, dNewValue, True)
Case BTLParamType.LENGTH
StringToLenAdv(value, dNewValue, True)
Case Else
' per string non faccio nulla
End Select
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
' verifico che sia compreso tra minimo e massimo
If dNewValue < m_BTLParamM.dMin OrElse dNewValue > m_BTLParamM.dMax Then
MessageBox.Show(EgtMsg(61856), EgtMsg(30007))
NotifyPropertyChanged(NameOf(sDefault))
Return
End If
m_BTLParamM.dDefault = dNewValue
m_BTLParamM.bIsModified = True
Case Else
m_BTLParamM.dDefault = 0
m_BTLParamM.bIsModified = True
End Select
End Set
End Property
Public ReadOnly Property nType As BTLParamType
Get
Return m_BTLParamM.nType
End Get
End Property
Protected m_sDrawPath As String
Public ReadOnly Property sDrawPath As String
Get
Return Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Parameters\" & m_BTLFeatureM.sDescGRP & "_" & m_BTLParamM.sName & "_" & m_BTLFeatureM.nSelGRP & ".gif"
End Get
End Property
Public Property bCustom As Boolean
Get
Return m_BTLParamM.bCustom
End Get
Set(value As Boolean)
' Se de-checko il parametro settiamo il suo valore a quello di default
Dim bFound As Boolean = False
If Not value Then
' Cerco il parametro Q direttamente nel file ini
Dim ParamIndex As String = 1
Dim NewBTLParam As BTLParamM = Nothing
While BTLIniFile.GetBeamPrivateProfileParam(Me.m_BTLFeatureM.nSelGRP, Me.m_BTLFeatureM.nPRC, Me.m_BTLFeatureM.nSelVARIANT, False, ParamIndex, Nothing, NewBTLParam)
Dim QBTLParam As BTLParamVM = New BTLParamVM(NewBTLParam)
If QBTLParam.sName = Me.sName Then
Me.sValue = QBTLParam.sDefault
NotifyPropertyChanged(NameOf(sValue))
m_BTLParamM.bCustom = value
' setto nel DB che il parametro attuale è custom o meno
EgtSetInfo(m_BTLFeatureM.nFeatureId, m_BTLParamM.sName & "A", If(value, "1", ""))
NotifyPropertyChanged(NameOf(bCustom))
Exit While
End If
ParamIndex += 1
End While
End If
End Set
End Property
Public ReadOnly Property sBWType As String
Get
Return m_BTLParamM.sBWType
End Get
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(BTLParamM As BTLParamM, BTLFeatureM As BTLFeatureM)
m_BTLParamM = BTLParamM
m_BTLFeatureM = BTLFeatureM
End Sub
Sub New(BTLParamM As BTLParamM)
m_BTLParamM = BTLParamM
m_BTLFeatureM = Nothing
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Friend Sub UpdateParamValue(dNewValue As Double, sNewValue As String, Optional bDraw As Boolean = True)
' verifico se solido attivo
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
' Recupero i parametri attuali della feature
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
Dim vParQ() As String = Nothing
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
' se P
If m_BTLParamM.bIsP Then
' modifico parametro cambiato con value
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
vPar(m_BTLParamM.nId - 1) = dNewValue
Case BTLParamType.STRING_
sPar = sNewValue
End Select
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
If bOK Then
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
m_BTLParamM.dValue = dNewValue
NotifyPropertyChanged(NameOf(sValue))
Case BTLParamType.STRING_
m_BTLParamM.sValue = sNewValue
NotifyPropertyChanged(NameOf(sValue))
End Select
Else
NotifyPropertyChanged(NameOf(sValue))
End If
' se Q
Else
For Ind = 0 To vParQ.Length() - 1
If vParQ(Ind).StartsWith(m_BTLParamM.sName) Then
vParQ(Ind) = m_BTLParamM.sName & ":" & DoubleToString(dNewValue, 3)
End If
Next
Dim bOK As Boolean = m_BTLFeatureM.UpdateParams(m_BTLFeatureM.nSelGRP, m_BTLFeatureM.nPRC, m_BTLFeatureM.nSelSIDE, m_BTLFeatureM.sDES,
m_BTLFeatureM.nPRID, m_BTLFeatureM.frFRAME, vPar, sPar, vParQ)
If bOK Then
m_BTLParamM.bCustom = True
' se sono in ottimizzazione
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' setto nel progetto il fatto che il parametro attuale è custom o meno
EgtSetInfo(m_BTLFeatureM.nFeatureId, m_BTLParamM.sName & "A", If(bCustom, "1", ""))
NotifyPropertyChanged(NameOf(bCustom))
End If
m_BTLParamM.dValue = dNewValue
' modifica provvisoria per mancanza aggiornamento su freecontour
If m_BTLFeatureM.IsFreeContour Then
EgtSetInfo(m_BTLFeatureM.nFeatureId, sName, dNewValue)
End If
NotifyPropertyChanged(NameOf(dValue))
Else
NotifyPropertyChanged(NameOf(dValue))
End If
End If
If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
If bDraw Then EgtDraw()
End Sub
#End Region ' METHODS
End Class
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,45 @@
<EgtWPFLib5:EgtCustomWindow x:Class="BlockedWndV"
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}}"
Title="{Binding Title}" WindowStartupLocation="CenterOwner"
Height="200" Width="400">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<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 Msg_Text}"
TextAlignment="Center"
Margin="40,0,40,0"/>
<Grid Grid.Row="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="1" Content="{Binding Save_Msg}"
IsDefault="True"
Command="{Binding Save_Command}"
Visibility="{Binding Buttons_Visibility}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Grid.Column="3" Content="{Binding DoNotSave_Msg}"
Command="{Binding DoNotSave_Command}"
Visibility="{Binding Buttons_Visibility}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class BlockedWndV
Private WithEvents m_BlockedWndVM As BlockedWndVM
Sub New(Owner As Window, BlockedWndVM As BlockedWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = BlockedWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_BlockedWndVM = BlockedWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_BlockedWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,168 @@
Imports System.Windows.Threading
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class BlockedWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
Private m_Waiting_Timer As New DispatcherTimer
Private WaitingTimer_TickHandler As New EventHandler(AddressOf WaitingTimer_Tick)
Private m_Buttons_Visibility As Visibility = Visibility.Visible
Public ReadOnly Property Buttons_Visibility As Visibility
Get
Return m_Buttons_Visibility
End Get
End Property
Private m_nIndex As Integer = 0
#Region "Messages"
Private m_Msg_Text As String
Public ReadOnly Property Msg_Text As String
Get
Return m_Msg_Text
End Get
End Property
Public ReadOnly Property Save_Msg As String
Get
Return EgtMsg(61966)
End Get
End Property
Public ReadOnly Property DoNotSave_Msg As String
Get
Return EgtMsg(61967)
End Get
End Property
#End Region ' Messages
' Definizione comandi
Private m_cmdSave As ICommand
Private m_cmdDoNotSave As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
If DbControllers.bNetwork Then
m_Buttons_Visibility = Visibility.Visible
m_Msg_Text = "Ottimizzatore bloccato per ricalcolo trave. Salvare le modifiche apportate al progetto?"
Else
m_Msg_Text = "In attesa del ricalcolo da parte del supervisore."
m_Buttons_Visibility = Visibility.Collapsed
Save()
End If
NotifyPropertyChanged(NameOf(Msg_Text))
NotifyPropertyChanged(NameOf(Buttons_Visibility))
' avvio contatore
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(500)
AddHandler m_Waiting_Timer.Tick, WaitingTimer_TickHandler
m_Waiting_Timer.Start()
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Private Sub WaitingTimer_Tick()
' se notifica di chiusura da supervisor, esco
If Not SupervisorCommThread.bViewerOptimizerBlocked And Map.refMainWindowVM.m_ManagingSupervisorStop Then
If m_Waiting_Timer.IsEnabled Then
m_Waiting_Timer.Stop()
RemoveHandler m_Waiting_Timer.Tick, WaitingTimer_TickHandler
End If
' se mi viene passato un Id di MachGroup aggiunto
If SupervisorCommThread.m_AddedMachGroupId > 0 Then
' ricarico progetto
Dim sCurrFilePath As String = ""
EgtGetCurrFilePath(sCurrFilePath)
EgtOpenFile(sCurrFilePath)
' aggiungo a lista nuovo MachGroup
Map.refProjectVM.MachGroupPanelVM.AddMachGroupToList(SupervisorCommThread.m_AddedMachGroupId)
End If
Map.refMainWindowVM.m_ManagingSupervisorStop = False
RaiseEvent m_CloseWindow(True)
End If
' incremento contatore
m_nIndex += 1
' se passata attesa per risposta utente
If m_nIndex = 17 Then
' aggiorno finestra con attesa fine calcolo
m_Msg_Text = "In attesa del ricalcolo da parte del supervisore."
m_Buttons_Visibility = Visibility.Collapsed
NotifyPropertyChanged(NameOf(Buttons_Visibility))
NotifyPropertyChanged(NameOf(Msg_Text))
' mando messaggio di blocco avvenuto
DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
End If
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "Save"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property Save_Command As ICommand
Get
If m_cmdSave Is Nothing Then
m_cmdSave = New Command(AddressOf Save)
End If
Return m_cmdSave
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub Save()
' salvo progetto
'Map.refProdManagerVM.Save()
Map.refProdManagerVM.Save()
' mando messaggio di blocco avvenuto
DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
End Sub
#End Region ' Save
#Region "DoNotSave"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property DoNotSave_Command As ICommand
Get
If m_cmdDoNotSave Is Nothing Then
m_cmdDoNotSave = New Command(AddressOf DoNotSave)
End If
Return m_cmdDoNotSave
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub DoNotSave()
' mando messaggio di blocco avvenuto
DbControllers.m_StatusMapController.UpdateAction("", ProjectManagerVM.CurrProd.nProdId, ProjectManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ViewOptimStoped, "")
End Sub
#End Region ' DoNotSave
#End Region ' COMMANDS
End Class
@@ -0,0 +1,963 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Threading
Imports System.Windows.Threading
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Imports EgwMultiEngineManager.Data
Imports EgwMultiEngineManager.Data.Constants
Public Class CALCPanelVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Public Enum ProduceType As Integer
NULL = 0
PRODUCE = 1
PRODUCEALL = 2
End Enum
' timer e variabile per ricaricare progetto dopo edit
Private m_Waiting_Timer As New DispatcherTimer
Private m_ReloadEditedFile As Boolean = False
Private m_OrigSelectedMachine As Machine = Nothing
' imposta se il calcolo e' stato lanciato dal tasto produci(1), produci tutti(2) o nessuno(0)
Private m_FromProduce As ProduceType = ProduceType.NULL
Friend Sub SetFromProduce(value As ProduceType)
m_FromProduce = value
End Sub
Private m_IsMachineApplied As Boolean = False
Public Property IsMachineApplied As Boolean
Get
Return m_IsMachineApplied
End Get
Set(value As Boolean)
m_IsMachineApplied = value
End Set
End Property
'Private m_VerifyAll_IsEnabled As Boolean = True
'Public Property VerifyAll_IsEnabled As Boolean
' Get
' Return m_VerifyAll_IsEnabled
' End Get
' Set(value As Boolean)
' m_VerifyAll_IsEnabled = value
' End Set
'End Property
Private m_ChooseMachineBtn_Visibility As Boolean = True
Public Property ChooseMachineBtn_Visibility As Visibility
Get
Return If(m_ChooseMachineBtn_Visibility, Visibility.Visible, Visibility.Collapsed)
End Get
Set(value As Visibility)
m_ChooseMachineBtn_Visibility = (value = Visibility.Visible)
NotifyPropertyChanged(NameOf(ChooseMachineBtn_Visibility))
End Set
End Property
Friend Sub SetChooseMachineBtn_Visibility(IsVisible As Boolean)
m_ChooseMachineBtn_Visibility = IsVisible
NotifyPropertyChanged(NameOf(ChooseMachineBtn_Visibility))
End Sub
Private m_ChooseMachine_Visibility As Boolean = False
Public Property ChooseMachine_Visibility As Visibility
Get
Return If(m_ChooseMachine_Visibility, Visibility.Visible, Visibility.Collapsed)
End Get
Set(value As Visibility)
m_ChooseMachine_Visibility = (value = Visibility.Visible)
NotifyPropertyChanged(NameOf(ChooseMachine_Visibility))
End Set
End Property
Friend Sub SetChooseMachine_Visibility(IsVisible As Boolean)
m_ChooseMachine_Visibility = IsVisible
NotifyPropertyChanged(NameOf(ChooseMachine_Visibility))
End Sub
' Lista delle macchine disponibili per il tipo di progetto corrente
Private m_MachineList As New ObservableCollection(Of Machine)
Public Property MachineList As ObservableCollection(Of Machine)
Get
Return m_MachineList
End Get
Set(value As ObservableCollection(Of Machine))
m_MachineList = value
End Set
End Property
' Macchina correntemente selezionata e quindi attiva
Private m_SelectedMachine As Machine = Nothing
Public Property SelectedMachine As Machine
Get
Return m_SelectedMachine
End Get
Set(value As Machine)
If value IsNot m_SelectedMachine Then
m_SelectedMachine = value
NotifyPropertyChanged(NameOf(SelectedMachine))
End If
End Set
End Property
' Definizione comandi
Private m_cmdChooseMachine As ICommand
Private m_cmdOk As ICommand
#Region "Messages"
Public ReadOnly Property ResetCalc_ToolTip As String
Get
Return EgtMsg(61940)
End Get
End Property
Public ReadOnly Property ChooseMachine_ToolTip As String
Get
Return EgtMsg(61941)
End Get
End Property
#End Region ' Messages
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTORS"
Sub New()
' imposto riferimento in Map
Map.SetRefCALCPanelVM(Me)
Core.CalcIntegration.SetMaxCamInstances(Map.refMainWindowVM.MainWindowM.GetMaxCamInstances())
AddHandler Core.CalcIntegration.Calc_ProcessResult, AddressOf Calc_ProcessResult
AddHandler Core.CalcIntegration.Calc_Ended, AddressOf Calc_Ended
m_Waiting_Timer.Interval = TimeSpan.FromMilliseconds(500)
AddHandler m_Waiting_Timer.Tick, AddressOf Waiting_Timer_Tick
m_Waiting_Timer.Start()
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Private Sub Calc_ProcessResult(sender As Object, e As CalcResultEventArgs)
ProcessResults(e.m_Result)
End Sub
Private Sub Calc_Ended(sender As Object, e As CalcEndEventArgs)
If e.End_ = CalcEndEventArgs.Results.ERROR_ OrElse e.End_ = CalcEndEventArgs.Results.NULL Then
MessageBox.Show("Execution error (all processes are disabled)")
End If
If e.End_ = CalcEndEventArgs.Results.EDIT Then
Map.refMyStatusBarVM.SetOutputMessage("Editor closed")
m_ReloadEditedFile = True
End If
' se verify o verifyall, salvo il progetto per conservarne gli stati calcolati
If e.CmdType = CmdTypes.CHECKGEN Then
Map.refProdManagerVM.Save()
End If
' se modalita' assemblato attiva
If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' lo rimonto
Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False)
End If
Map.refProjectVM.SetCalcRunning(False)
Map.refMyStatusBarVM.ResetStopProgress()
' se lanciato dal produci, eseguo produci
If m_FromProduce <> ProduceType.NULL Then
Select Case m_FromProduce
Case ProduceType.PRODUCE
Map.refRawPartManagerVM.ProduceRawPart()
Case ProduceType.PRODUCEALL
Map.refRawPartManagerVM.ProduceAllRawPart()
End Select
m_FromProduce = ProduceType.NULL
End If
End Sub
Private Sub Waiting_Timer_Tick()
If m_ReloadEditedFile Then
m_ReloadEditedFile = False
Map.refMyStatusBarVM.SetOutputMessage("Reloading modified file")
' ricarico il progetto
Dim sCurrFilePath As String = ""
EgtGetCurrFilePath(sCurrFilePath)
EgtOpenFile(sCurrFilePath)
' imposto duplo modificato
MyMachGroupPanelM.SetDuploModified(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
' riseleziono il pezzo precedentemente selezionato
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Map.refProjectVM.BTLStructureVM.SelBTLPart)
Map.refMyStatusBarVM.SetOutputMessage("Modified file reloaded", 1)
Map.refProjectVM.SetCalcRunning(False)
Map.refMyStatusBarVM.ResetStopProgress()
End If
End Sub
Friend Shared Sub ProcessResults(MachGroupId As MyMachGroupVM)
ProcessResults(ProjectManagerVM.CurrProd.sProdDirPath & "/" & MachGroupId.nName & ".txt", ProjectType.PROD, MachGroupId.Id)
End Sub
Private Shared Sub ProcessResults(Bar As Bar)
If IsNothing(Bar) Then Return
ProcessResults(Bar.sBarPath, Bar.nProgramPage, Bar.nBarId)
End Sub
Friend Shared Sub ProcessResults(BtlPath As String, nProgramPage As ProjectType, nBarId As Integer)
Dim ResPath As String = Path.ChangeExtension(BtlPath, ".txt")
Dim bErrors As Boolean = False
Dim nLastErr As Integer = 0
Dim sLastMsg As String = ""
Dim nCurrCutId As Integer = 0
Dim nTotTime As Integer = 0
If File.Exists(ResPath) Then
Dim ProcessResultList As New List(Of ProcessResult)
Dim nErr As Integer = 0
Dim sMsg As String = ""
Dim dRot As Double = 0
Dim nFall As Integer = 0
Dim dPartRot As Double = 0
Dim dTotRot As Double = 0
Dim cutId As Integer = 0
Dim taskId As Integer = 0
Dim prevCutId As Integer = GDB_ID.NULL
Dim currBTLPart As BTLPartVM = Nothing
Dim lines As String() = System.IO.File.ReadAllLines(ResPath)
For Each line As String In lines
If line.StartsWith("ERR=") Then
Dim nVal As Integer? = GetVal(line, "ERR")
nErr = (If(Not IsNothing(nVal), nVal.Value, 0))
sMsg = ""
dRot = 0
nFall = 0
cutId = 0
taskId = 0
ElseIf line.StartsWith("ROT=") Then
Dim nVal As Integer? = GetVal(line, "ROT")
Dim nRot As Integer = (If(Not IsNothing(nVal), nVal.Value, 0))
dRot = Math.Abs(((4 - nRot) Mod 4) * 90)
dPartRot = Math.Max(dPartRot, dRot)
dTotRot = Math.Max(dTotRot, dRot)
ElseIf line.StartsWith("CUTID=") Then
Dim nVal As Integer? = GetVal(line, "CUTID")
cutId = If(Not IsNothing(nVal), nVal.Value, 0)
ElseIf line.StartsWith("TASKID=") Then
Dim nVal As Integer? = GetVal(line, "TASKID")
taskId = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultAdd(ProcessResultList, ProcessResult.CreateTaskResult(cutId, taskId, nErr, sMsg, dRot), nProgramPage)
ElseIf line.StartsWith("FALL=") Then
Dim nVal As Integer? = GetVal(line, "FALL")
nFall = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateFallResult(cutId, nErr, sMsg, nFall))
ElseIf line.StartsWith("TIME=") Then
Dim nVal As Integer? = GetVal(line, "TIME")
nTotTime = (If(Not IsNothing(nVal), nVal.Value, 0))
ProcessResultList.Add(ProcessResult.CreateTimeResult(cutId, nTotTime))
ElseIf Not String.IsNullOrWhiteSpace(line) AndAlso line <> "---" Then
sMsg = line
End If
Next
If ProcessResultList.Count > 0 Then
If nProgramPage = ProjectType.PROJ Then
' Inizializzo il pezzo in verifica
Dim BTLPart As BTLPartVM = GetBTLPartVMFromBTLPartId(nBarId)
BTLPart.CalcPartUpdate(0, 0, "")
' Resetto feature in collisione
For Each Feature In BTLPart.m_BTLFeatureVMList
If Feature.nState = CalcStates.COLLISION Then
Feature.ResetFeatureError()
End If
Next
Else
' Inizializzo i pezzi del gruppo di lavoro in verifica
Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(nBarId)
For Each Part As PartVM In Machgroup.PartVMList
Part.CalcPartUpdate(0, 0, "")
' Resetto feature in collisione
For Each Feature As BTLFeatureVM In Part.FeatureVMList
If Feature.nState = CalcStates.COLLISION Then
Feature.ResetFeatureError()
End If
Next
Next
Machgroup.CalcMachGroupUpdate(0, 0, "")
End If
' Ciclo ...
Dim nCUTID As Integer = -1
Dim CurrBTLPartVM As BTLPartVM = Nothing
Dim CurrPartVM As PartVM = Nothing
Dim CurrMachgroupVM As MyMachGroupVM = Nothing
Dim CurrBTLFeatureVM As BTLFeatureVM = Nothing
For Each Line In ProcessResultList
' se necessario recupero part
If Line.nCUTID <> 0 Then
If Line.nCUTID <> nCUTID Then
nCUTID = Line.nCUTID
If nProgramPage = ProjectType.PROJ Then
' aggiorno nuovo pezzo
CurrBTLPartVM = GetBTLPartVMFromBTLPartId(Line.nCUTID)
If IsNothing(CurrBTLPartVM) Then
Line.ResetTypePart()
EgtOutLog("Error in CALC ProcessResult. CUTID " & Line.nCUTID & "not found in project(BTLPartVM).")
End If
Else
' aggiorno nuovo pezzo
CurrPartVM = GetPartVMFromPartId(Line.nCUTID)
If IsNothing(CurrPartVM) Then
Line.ResetTypePart()
EgtOutLog("Error in CALC ProcessResult. CUTID " & Line.nCUTID & "not found in project(PartVM).")
End If
End If
End If
Else
' se CutId = 0
If nProgramPage = ProjectType.PROJ Then
' imposto unico pezzo presente
CurrBTLPartVM = GetBTLPartVMFromBTLPartId(nBarId)
If IsNothing(CurrBTLPartVM) Then
EgtOutLog("Error in CALC ProcessResult. CUTID " & nBarId & "not found in project(BTLPartVM).")
Continue For
End If
Else
' riporto errore barra
CurrMachgroupVM = GetMachgroupVMFromMachgroupId(nBarId)
If IsNothing(CurrMachgroupVM) Then
EgtOutLog("Error in CALC ProcessResult. CUTID " & nBarId & "not found in project(MachGroup).")
Continue For
End If
End If
End If
' se necessario recupero feature
If Line.nTASKID <> 0 Then
If nProgramPage = ProjectType.PROJ Then
CurrBTLFeatureVM = GetBTLFeatureVMFromBTLPartId(CurrBTLPartVM, Line.nTASKID)
If IsNothing(CurrBTLFeatureVM) Then
Line.ResetTypeFeature()
EgtOutLog("Error in CALC ProcessResult. TASKID " & Line.nTASKID & "not found in BTLPartVM " & CurrBTLPartVM.nPartId)
End If
Else
CurrBTLFeatureVM = GetFeatureVMFromPartId(CurrPartVM, Line.nTASKID)
If IsNothing(CurrBTLFeatureVM) Then
Line.ResetTypeFeature()
EgtOutLog("Error in CALC ProcessResult. TASKID " & Line.nTASKID & "not found in PartVM " & CurrPartVM.nPartId)
End If
End If
Else
CurrBTLFeatureVM = Nothing
End If
Select Case Line.Type
Case ProcessResult.ProcessResultTypes.BAR
If nProgramPage = ProjectType.PROJ Then
CurrBTLPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
Else
CurrMachgroupVM.CalcMachGroupUpdate(Line.nERR, Line.dROT, Line.sMSG)
End If
Case ProcessResult.ProcessResultTypes.PART
If nProgramPage = ProjectType.PROJ Then
CurrBTLPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
Else
CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
End If
Case ProcessResult.ProcessResultTypes.TASKID
CurrBTLFeatureVM.CalcFeatureUpdate(nProgramPage, Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.FALL
If nProgramPage = ProjectType.PROJ Then
CurrBTLPartVM.CalcFallUpdate(Line.nFALL)
Else
CurrPartVM.CalcFallUpdate(Line.nFALL)
End If
Case ProcessResult.ProcessResultTypes.TIME
If nProgramPage = ProjectType.PROJ Then
CurrBTLPartVM.CalcTimeUpdate(Line.nTIME)
Else
If IsNothing(CurrMachgroupVM) Then CurrMachgroupVM = GetMachgroupVMFromMachgroupId(nBarId)
CurrMachgroupVM.CalcTimeUpdate(Line.nTIME)
End If
End Select
Next
If nProgramPage = ProjectType.PROJ Then
' aggiorno il pezzo
Dim BTLPart As BTLPartVM = GetBTLPartVMFromBTLPartId(nBarId)
BTLPart.CalcGlobalUpdate()
' lancio aggiornamento tempo su BTL
Map.refProjectVM.BTLStructureVM.CalcGlobalTime()
Else
Dim Machgroup As MyMachGroupVM = GetMachgroupVMFromMachgroupId(nBarId)
For Each Part In Machgroup.PartVMList
Part.CalcGlobalUpdate()
Next
Machgroup.CalcGlobalUpdate()
' lancio aggiornamento tempo su MachgroupPanel
Map.refProjectVM.MachGroupPanelVM.CalcGlobalTime()
End If
End If
Else
bErrors = True
nLastErr = 25
sLastMsg = "Execution Error"
End If
End Sub
Private Shared Function GetVal(sText As String, sKey As String) As Integer?
Dim sParts As String() = sText.Split("="c)
If String.Compare(sParts(0), sKey) <> 0 Then Return Nothing
Dim nVal As Integer = Nothing
If Not Integer.TryParse(sParts(1), nVal) Then
Return Nothing
Else
Return nVal
End If
End Function
Private Shared Sub ProcessResultAdd(PRList As List(Of ProcessResult), NewPR As ProcessResult, nProgramPage As ProjectType)
Dim Prev As ProcessResult = Nothing
Select Case NewPR.Type
Case ProcessResult.ProcessResultTypes.BAR
If nProgramPage = ProjectType.PROJ Then
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.PART)
Else
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.BAR)
End If
Case ProcessResult.ProcessResultTypes.PART
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.PART AndAlso x.nCUTID = NewPR.nCUTID)
Case ProcessResult.ProcessResultTypes.TASKID
Prev = PRList.FirstOrDefault(Function(x) x.Type = ProcessResult.ProcessResultTypes.TASKID AndAlso x.nCUTID = NewPR.nCUTID AndAlso x.nTASKID = NewPR.nTASKID)
End Select
If IsNothing(Prev) Then
PRList.Add(NewPR)
ElseIf NewPR.nERR = 22 Or (NewPR.nERR > 0 And Prev.nERR <= 0) Or (NewPR.nERR < 0 And Prev.nERR = 0) Then
If NewPR.dROT = 0 And Prev.dROT <> NewPR.dROT Then
NewPR.SetROT(Prev.dROT)
End If
PRList.Remove(Prev)
PRList.Add(NewPR)
ElseIf Prev.dROT = 0 And Prev.dROT <> NewPR.dROT Then
Prev.SetROT(NewPR.dROT)
End If
End Sub
Friend Shared Function GetBTLPartVMFromBTLPartId(nBTLPartId As Integer) As BTLPartVM
Return Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nBTLPartId)
End Function
Friend Shared Function GetBTLPartVMFromPartId(nPartId As Integer) As BTLPartVM
Dim nBTLPartId As Integer = MyMachGroupPanelM.DuploGetOriginal(nPartId)
Return Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nBTLPartId)
End Function
Friend Shared Function GetPartVMFromPartId(nPartId As Integer) As PartVM
For Each MachGroupVM As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
Dim PartVM As PartVM = MachGroupVM.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId)
If Not IsNothing(PartVM) Then Return PartVM
Next
Return Nothing
End Function
Friend Shared Function GetMachgroupVMFromMachgroupId(nMachGroupId As Integer) As MyMachGroupVM
Return Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.FirstOrDefault(Function(x) x.Id = nMachGroupId)
End Function
Private Shared Function GetBTLFeatureVMFromBTLPartId(BTLPartVM As BTLPartVM, nFeatureId As Integer) As Core.BTLFeatureVM
Return BTLPartVM.BTLFeatureVMList.FirstOrDefault(Function(x) x.nFeatureId = nFeatureId)
End Function
Private Shared Function GetFeatureVMFromPartId(PartVM As PartVM, nFeatureId As Integer) As Core.BTLFeatureVM
Return PartVM.FeatureVMList.FirstOrDefault(Function(x) x.nFeatureId = nFeatureId)
End Function
Friend Sub LoadMachineList()
MachineList.Clear()
' ciclo per aggiungere macchine congrue al tipo del progetto corrente
For Each Machine In Map.refMachinePanelVM.MachineList
' se trovo una macchina chiamata come una già inserita ma con suffisso ".new" non la inserisco e passo al successivo elemento del For
If Machine.Name.EndsWith(".new", StringComparison.InvariantCultureIgnoreCase) AndAlso
MachineList.Count > 0 AndAlso
Not IsNothing(MachineList.FirstOrDefault(Function(x) x.Name.Equals(Machine.Name.Substring(0, Machine.Name.Length - 4)))) Then
Continue For
End If
Dim nMachType As MachineType = DirectCast(Machine, MyMachine).nType
Dim nProjType As BWType
Dim sMachineName As String = ""
nProjType = Map.refProdManagerVM.nProdType
sMachineName = If(Not IsNothing(ProjectManagerVM.CurrProd), ProjectManagerVM.CurrProd.sMachine, "")
If nMachType = nProjType OrElse
(nMachType = 3 And Not IsNothing(Map.refProdManagerVM) AndAlso Not IsNothing(ProjectManagerVM.CurrProd)) Then
MachineList.Add(Machine)
' Se il nome Macchina coincide setto la macchina selezionata con la macchina associata al progetto
If Machine.Name = sMachineName Then
SelectedMachine = MachineList(MachineList.IndexOf(Machine))
m_OrigSelectedMachine = SelectedMachine
End If
End If
Next
Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(MachineList.Count > 1 AndAlso GetMainPrivateProfileInt(S_MACH, K_CHANGEMACH, 0) = 1)
End Sub
Friend Function IsMachineModified() As Boolean
Return m_IsMachineApplied AndAlso
Not IsNothing(SelectedMachine) AndAlso
Not IsNothing(m_OrigSelectedMachine) AndAlso
SelectedMachine.Name <> m_OrigSelectedMachine.Name
End Function
Friend Sub CloseResetMachine()
' ritorno al valore originale e collasso CmBx e pulsante di conferma
RevertToOriginalMachine()
SetChooseMachine_Visibility(False)
End Sub
Friend Sub RevertToOriginalMachine()
' ri-setto SelectedMachine di CALCPanel e MachinePanel al valore originale
SelectedMachine = m_OrigSelectedMachine
Map.refMachinePanelVM.SelectedMachine = SelectedMachine
End Sub
Friend Sub ResetMachineModified()
' aggiorno l'originale SelectedMachine in modo che non appaia modificata
m_OrigSelectedMachine = SelectedMachine
End Sub
Friend Sub PartShowAllChanged()
'NotifyPropertyChanged(NameOf(Verify_IsEnabled))
'NotifyPropertyChanged(NameOf(Simulate_IsEnabled))
'NotifyPropertyChanged(NameOf(Edit_IsEnabled))
End Sub
Friend Sub Verify(ProgramPage As ProjectType)
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
Dim ProjType As BWType = ProjectManagerVM.CurrProd.nType
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
If GetMainPrivateProfileInt(S_GENERAL, "UseCam5", 0) = 1 Then
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
If Not CreateBarToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000"), AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
Else
Dim ExecThread As New Thread(Sub()
VerifyWithEngine(ProgramPage)
End Sub)
ExecThread.Start()
End If
End Sub
Private Sub VerifyProjWithEngine(CurrPart As BTLPartVM)
If Not CurrPart.bDO Then Return
Dim Args As New Dictionary(Of String, String)
Args.Add("BarId", CurrPart.nPartId)
Args.Add("ProgramPage", ProjectType.PROJ)
Dim BarPath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & CurrPart.nPROJ.ToString("0000")
Args.Add("BarPath", BarPath)
Args.Add("ProjType", ProjectManagerVM.CurrProd.nType)
Args.Add("MachineName", ProjectManagerVM.CurrProd.sMachine)
Args.Add("GlobState", CurrPart.nGlobalState)
Dim nCmdType As CalcIntegration.CmdTypes = CmdTypes.GENERATE
Select Case CurrPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED OrElse CurrPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = BarPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
nCmdType = CalcIntegration.CmdTypes.CHECKNOSIM
End Select
Args.Add("CmdType", nCmdType)
Dim ExecEnvironment As EXECENVIRONMENTS = EXECENVIRONMENTS.NULL
Select Case ProjectManagerVM.CurrProd.nType
Case BWType.BEAM
ExecEnvironment = EXECENVIRONMENTS.BEAM
Case BWType.WALL
ExecEnvironment = EXECENVIRONMENTS.WALL
End Select
Dim Request As New QuestionDTO(1, ExecEnvironment, Args)
Request.Args("BarPath") = CreateNewProjectFromPart(CurrPart.nPartId, BarPath)
EgtOutLog("Creato progetto " & CurrPart.nPartId)
If Request.ExecEnvironment <> EXECENVIRONMENTS.NULL Then
MyExecProcessManager.ExecProcessManagerList(Request.ExecEnvironment).ArgumentsEnqueue(Request)
End If
End Sub
Private Sub VerifyProdWithEngine(CurrMachGroup As MyMachGroupVM)
' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
If CurrMachGroup.nProduction_State >= ItemState.Assigned Then Return
Dim Args As New Dictionary(Of String, String)
Args.Add("BarId", CurrMachGroup.Id)
Args.Add("ProgramPage", ProjectType.PROD)
Dim BarPath As String = ProjectManagerVM.CurrProd.sProdDirPath
Args.Add("BarPath", BarPath)
Args.Add("ProjType", ProjectManagerVM.CurrProd.nType)
Dim MachineName As String = ""
EgtGetMachGroupMachineName(CurrMachGroup.Id, MachineName)
Args.Add("MachineName", MachineName)
Args.Add("GlobState", CurrMachGroup.nGlobalState)
Dim nCmdType As CalcIntegration.CmdTypes = CmdTypes.GENERATE
Select Case CurrMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (CurrMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = BarPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
Args.Add("CmdType", nCmdType)
Dim ExecEnvironment As EXECENVIRONMENTS = EXECENVIRONMENTS.NULL
Select Case ProjectManagerVM.CurrProd.nType
Case BWType.BEAM
ExecEnvironment = EXECENVIRONMENTS.BEAM
Case BWType.WALL
ExecEnvironment = EXECENVIRONMENTS.WALL
End Select
Dim Request As New QuestionDTO(1, ExecEnvironment, Args)
Request.Args("BarPath") = CreateNewProjectFromMachGroup(CurrMachGroup.Id, BarPath, CurrMachGroup.nGlobalState)
EgtOutLog("Creato progetto " & CurrMachGroup.Id)
If Request.ExecEnvironment <> EXECENVIRONMENTS.NULL Then
MyExecProcessManager.ExecProcessManagerList(Request.ExecEnvironment).ArgumentsEnqueue(Request)
End If
End Sub
Private Sub VerifyWithEngine(ProgramPage As ProjectType)
Dim ProjType As BWType = ProjectManagerVM.CurrProd.nType
' lancio calcolo
Dim ExecEnvironment As EXECENVIRONMENTS = EXECENVIRONMENTS.NULL
Select Case ProjType
Case BWType.BEAM
ExecEnvironment = EXECENVIRONMENTS.BEAM
Case BWType.WALL
ExecEnvironment = EXECENVIRONMENTS.WALL
End Select
If ProgramPage = ProjectType.PROJ Then
If Not Map.refProjectVM.BTLStructureVM.SelBTLPart.bDO Then Return
VerifyProjWithEngine(Map.refProjectVM.BTLStructureVM.SelBTLPart)
ElseIf ProgramPage = ProjectType.PROD Then
' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
If Map.refMachGroupPanelVM.SelectedMachGroup.nProduction_State >= ItemState.Assigned Then Return
VerifyProdWithEngine(Map.refMachGroupPanelVM.SelectedMachGroup)
End If
End Sub
Private Function CreateBarToVerify(SelPage As Pages, ProjType As BWType, ByRef BarList As Bar()) As Boolean
If SelPage = Pages.VIEW Then
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
If Not Map.refProjectVM.BTLStructureVM.SelBTLPart.bDO Then Return False
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = ProjectManagerVM.CurrProd.sMachine,
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
Select Case Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
ElseIf SelPage = Pages.MACHINING Then
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
' se barra gia' assegnata a supervisore, esco
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return False
Dim TempBarList(0) As EgtBEAMWALL.Core.Bar
Dim MachineName As String = ""
EgtGetMachGroupMachineName(SelMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = SelMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nGlobState = SelMachGroup.nGlobalState}
Select Case SelMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (SelMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
End If
Return True
End Function
' funzione che gestisce risposta da thread di verifica, aggiorna progress e segnala comando di interruzione
Private Sub ManageCalc(dProgress As Double, sProgress As String, ByRef bCancel As Boolean)
If dProgress = 0 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(True)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
Map.refMyStatusBarVM.SetStopProgress_IsActive(True)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(True)
ElseIf dProgress = 1 Then
Map.refMyStatusBarVM.SetLoadingProgress_Visibility(False)
Map.refMyStatusBarVM.SetStopProgress_IsActive(False)
Map.refMyStatusBarVM.SetStopProgress_IsEnabled(False)
Map.refMyStatusBarVM.SetOutputMessage(sProgress, 3)
End If
bCancel = Map.refMyStatusBarVM.bStopProgress
Map.refMyStatusBarVM.SetLoadingProgress(dProgress * 100)
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
End Sub
Friend Sub VerifyAll(ProgramPage As ProjectType)
Dim ProjType As BWType = ProjectManagerVM.CurrProd.nType
If GetMainPrivateProfileInt(S_GENERAL, "UseCam5", 0) = 1 Then
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST Then
If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath & "\Projs\" & Map.refProjectVM.BTLStructureVM.SelBTLPart.nPROJ.ToString("0000"), AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
Else
Dim ExecThread As New Thread(Sub()
VerifyAllWithEngine(ProgramPage)
End Sub)
ExecThread.Start()
End If
End Sub
Private Sub VerifyAllWithEngine(ProgramPage As ProjectType)
Dim QuestionList As New List(Of QuestionDTO)
If ProgramPage = ProjectType.PROJ Then
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex).bDO Then Continue For
VerifyProjWithEngine(Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex))
Next
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex).SetIsRowEnabled(True)
Next
Map.refLeftPanelVM.SetCALCPanel_IsEnabled(True)
ElseIf ProgramPage = ProjectType.PROD Then
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
If DirectCast(Map.refMachGroupPanelVM.MachGroupVMList(PartIndex), MyMachGroupVM).nProduction_State >= ItemState.Assigned Then Return
VerifyProdWithEngine(Map.refMachGroupPanelVM.MachGroupVMList(PartIndex))
Next
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
DirectCast(Map.refMachGroupPanelVM.MachGroupVMList(PartIndex), MyMachGroupVM).SetIsRowEnabled(True)
Next
Map.refRawPartManagerVM.SetCALCPanel_IsEnabled(True)
End If
End Sub
Private Function CreateBarListToVerify(SelPage As Pages, ProjType As BWType, ByRef BarList As Bar()) As Boolean
If SelPage = Pages.VIEW Then
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
For PartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim CurrPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex)
If Not CurrPart.bDO Then Continue For
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = ProjectManagerVM.CurrProd.sMachine,
.nGlobState = CurrPart.nGlobalState}
Select Case CurrPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrPart.nGlobalState = CalcStates.NOTCALCULATED OrElse CurrPart.nFeaturesGlobalState > CalcStates.INFO Then
Dim sBTLPartFilePath As String = ProjectManagerVM.CurrProj.sProjDirPath & "\" & CurrPart.nPDN.ToString() & ".ori.bwe"
If File.Exists(sBTLPartFilePath) Then File.Delete(sBTLPartFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList.Add(Bar)
Next
BarList = TempBarList.ToArray()
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
ElseIf SelPage = Pages.MACHINING Then
Dim TempBarList As New List(Of EgtBEAMWALL.Core.Bar)
For PartIndex = 0 To Map.refMachGroupPanelVM.MachGroupVMList.Count - 1
Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(PartIndex)
' se e' gia' stato assegnato a supervisor, la salto e vado alla prossima barra
If CurrMachGroup.nProduction_State >= ItemState.Assigned Then Continue For
Dim MachineName As String = ""
EgtGetMachGroupMachineName(CurrMachGroup.Id, MachineName)
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = CurrMachGroup.Id,
.nProgramPage = ProjectType.PROD,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = MachineName,
.nGlobState = CurrMachGroup.nGlobalState}
Select Case CurrMachGroup.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
Bar.nCmdType = CalcIntegration.CmdTypes.GENERATE
Case Else
If CurrMachGroup.nGlobalState = CalcStates.NOTCALCULATED OrElse (CurrMachGroup.nPartsGlobalState > CalcStates.INFO) Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & CurrMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
Bar.nCmdType = CalcIntegration.CmdTypes.CHECKGEN
End Select
TempBarList.Add(Bar)
Next
If TempBarList.Count = 0 Then Return False
BarList = TempBarList.ToArray()
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
End If
Return True
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "ChooseMachine"
Public ReadOnly Property ChooseMachine_Command As ICommand
Get
If m_cmdChooseMachine Is Nothing Then
m_cmdChooseMachine = New Command(AddressOf ChooseMachine)
End If
Return m_cmdChooseMachine
End Get
End Property
Friend Sub ChooseMachine()
' rendo visibile la CmBx per la scelta e il pulsante di conferma solo se il Proj corrente non ha associato alcun Prod
If ProjectManagerVM.CurrProd.nProjId > 0 Then
MessageBox.Show(EgtMsg(61929), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
SetChooseMachine_Visibility(True)
End If
End Sub
#End Region ' ChooseMachine
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Friend Sub Ok()
' aggiorno la Macchina selezionata nel Machine Panel e collasso CmBx e pulsante di conferma
If Not IsNothing(SelectedMachine) Then Map.refMachinePanelVM.SelectedMachine = SelectedMachine
m_IsMachineApplied = True
SetChooseMachine_Visibility(False)
' resetto i parametri errori integration ciclando su ogni Part e per ogni Part ogni Feature
Dim ProjId As Integer
Dim nPartProjId As Integer
'Dim TempList As New List(Of BTLPartM)
Dim nPartId As Integer = EgtGetFirstPart()
'If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
ProjId = ProjectManagerVM.CurrProd.nProjIdList(0)
'Else
' ProjId = ProjectManagerVM.CurrProj.nProjId
'End If
EgtGetInfo(nPartId, BTL_PRT_PROJ, nPartProjId)
While nPartId <> GDB_ID.NULL
' se devo filtrare un progetto
If ProjId > 0 Then
' verifico se il pezzo appartiene al ProjId
If nPartProjId = ProjId Then
EgtRemoveInfo(nPartId, ITG_PROJ_ERR)
EgtRemoveInfo(nPartId, ITG_PROJ_MSG)
EgtRemoveInfo(nPartId, ITG_PROJ_ROT)
EgtRemoveInfo(nPartId, ITG_PROJ_FALL)
' ora che ho resettato questo Part resetto le Feature di questo Part
Dim NewBTLPart As BTLPartM = BTLPartM.CreateBTLPart(nPartId)
Dim FeatureTempList As New List(Of BTLFeatureM)
' Leggo outline
Dim nOutlineLayerId As Integer = EgtGetFirstNameInGroup(nPartId, OUTLINE)
Dim nOutlineId As Integer = EgtGetFirstInGroup(nOutlineLayerId)
While nOutlineId <> GDB_ID.NULL
' verifico che sia una feature
Dim nGRP As Integer
If EgtGetInfo(nOutlineId, BTL_FTR_GRP, nGRP) Then
' creo la feature
FeatureTempList.Add(BTLFeatureM.CreateBTLFeature(NewBTLPart, nOutlineId))
End If
nOutlineId = EgtGetNext(nOutlineId)
End While
' Leggo 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
'EgtRemoveInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, ITG_PROJ_ERR, ITG_PROD_ERR))
EgtRemoveInfo(nFeatureId, ITG_PROD_ERR)
'EgtRemoveInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, ITG_PROJ_MSG, ITG_PROD_MSG))
EgtRemoveInfo(nFeatureId, ITG_PROD_MSG)
'EgtRemoveInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, ITG_PROJ_ROT, ITG_PROD_ROT))
EgtRemoveInfo(nFeatureId, ITG_PROD_ROT)
End If
nFeatureId = EgtGetNext(nFeatureId)
End While
End If
End If
nPartId = EgtGetNextPart(nPartId)
End While
' Se OnlyProdPage rimuovo MachGroup
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then
If MessageBox.Show(EgtMsg(61779), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Exclamation) = MessageBoxResult.OK Then
For Index As Integer = Map.refMachGroupPanelVM.MachGroupVMList.Count - 1 To 0 Step -1
Dim CurrMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.MachGroupVMList(Index)
CurrMachGroup.DeleteMachGroup()
Next
End If
End If
' rigenero struttura BTL
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(ProjId))
End Sub
#End Region ' Ok
#End Region ' COMMANDS
End Class
@@ -0,0 +1,32 @@
<StackPanel x:Class="CalcPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Style="{StaticResource OnlyProdPartManager_StackPanel}">
<Button ToolTip="{Binding ChooseMachine_ToolTip}"
Command="{Binding ChooseMachine_Command}"
IsEnabled="{Binding CALCPanel_IsEnabled}"
Visibility="{Binding ChooseMachineBtn_Visibility}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/CALCPanel/ChooseMachine.png" Stretch="Uniform"/>
</Button>
<Grid Margin="0,0,5,0" Visibility="{Binding ChooseMachine_Visibility}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!--Combobox per selezionare la macchina corrente-->
<ComboBox Grid.Column="0"
ItemsSource="{Binding Path=MachineList}"
DisplayMemberPath="Name"
SelectedItem="{Binding Path=SelectedMachine}"
SelectedValuePath="Name"
Style="{StaticResource OnlyProdCalcPanel_ComboBox}"/>
<Button Grid.Column="1"
Content="OK"
Command="{Binding Ok_Command}"
Style="{StaticResource ToolBarOnlyProdCalcPanel_Button}"/>
</Grid>
</StackPanel>
@@ -0,0 +1,3 @@
Public Class CalcPanelV
End Class
@@ -0,0 +1,76 @@
<EgtWPFLib5:EgtCustomWindow x:Class="ChangeMaterialWndV"
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}}"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
Title="ChangeMaterialWnd">
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid HorizontalAlignment="Center"
Grid.Row="0"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ProjMaterial_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<ComboBox ItemsSource="{Binding ProjMaterialList}"
SelectedItem="{Binding SelProjMaterial}"
Grid.Column="1"
Width="150"
Style="{StaticResource FeatureComboBox}"/>
</Grid>
<Grid HorizontalAlignment="Center"
Grid.Row="1"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding WjMaterial_Msg}"
Style="{StaticResource OptionTextBlock}"/>
<ComboBox ItemsSource="{Binding WhMaterialList}"
SelectedItem="{Binding SelWhMaterial}"
Grid.Column="1"
Width="150"
Style="{StaticResource FeatureComboBox}"/>
</Grid>
<Grid Grid.Row="2"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Content="{Binding Ok_Msg}"
Command="{Binding Ok_Command}"
IsDefault="True"
Grid.Column="1"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="{Binding Cancel_Msg}"
IsCancel="True"
Grid.Column="3"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class ChangeMaterialWndV
Private WithEvents m_ChangeMaterialWndVM As ChangeMaterialWndVM
Sub New(Owner As Window, ChangeMaterialWndVM As ChangeMaterialWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ChangeMaterialWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ChangeMaterialWndVM = ChangeMaterialWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ChangeMaterialWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,140 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Public Class ChangeMaterialWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
Private m_ProjMaterialList As New ObservableCollection(Of String)
Public Property ProjMaterialList As ObservableCollection(Of String)
Get
Return m_ProjMaterialList
End Get
Set(value As ObservableCollection(Of String))
m_ProjMaterialList = value
End Set
End Property
Private m_SelProjMaterial As String
Public Property SelProjMaterial As String
Get
Return m_SelProjMaterial
End Get
Set(value As String)
m_SelProjMaterial = value
NotifyPropertyChanged(NameOf(SelProjMaterial))
End Set
End Property
Private m_WhMaterialList As New ObservableCollection(Of String)
Public Property WhMaterialList As ObservableCollection(Of String)
Get
Return m_WhMaterialList
End Get
Set(value As ObservableCollection(Of String))
m_WhMaterialList = value
End Set
End Property
Private m_SelWhMaterial As String
Public Property SelWhMaterial As String
Get
Return m_SelWhMaterial
End Get
Set(value As String)
m_SelWhMaterial = value
NotifyPropertyChanged(NameOf(SelWhMaterial))
End Set
End Property
' Definizione comandi
Private m_cmdOk As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "MESSAGES"
Public ReadOnly Property ProjMaterial_Msg As String
Get
Return EgtMsg(61962)
End Get
End Property
Public ReadOnly Property WjMaterial_Msg As String
Get
Return EgtMsg(61963)
End Get
End Property
Public ReadOnly Property Ok_Msg As String
Get
Return EgtMsg(61761)
End Get
End Property
Public ReadOnly Property Cancel_Msg As String
Get
Return EgtMsg(61763)
End Get
End Property
#End Region ' MESSAGES
#Region "CONSTRUCTOR"
Sub New()
' recupero i materiali del progetto
m_ProjMaterialList.Clear()
For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
If Not m_ProjMaterialList.Contains(BTLPart.sMATERIAL) Then
m_ProjMaterialList.Add(BTLPart.sMATERIAL)
End If
Next
' recupero la lista dei SectionXMaterial presenti in Warehouse
Dim WhSectXMatList As List(Of SectionXMaterial) = WarehouseWndVM.GetSectionXMaterialsFromWarehouse()
' ricavo la lista dei materiali presenti in Warehouse
m_WhMaterialList.Clear()
For Each WhSectXMat In WhSectXMatList
For Each sMatItem In WhSectXMat.sMaterial
If Not m_WhMaterialList.Contains(sMatItem) Then
m_WhMaterialList.Add(sMatItem)
End If
Next
Next
End Sub
#End Region ' CONSTRUCTOR
#Region "COMMANDS"
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
'verifico che tutti i campi contengano un valore valido
If Not IsNothing(m_SelProjMaterial) AndAlso m_SelProjMaterial <> "" AndAlso
Not IsNothing(m_SelWhMaterial) AndAlso m_SelWhMaterial <> "" Then
RaiseEvent m_CloseWindow(True)
Else
MessageBox.Show(EgtMsg(61858), EgtMsg(30007))
End If
End Sub
#End Region ' Ok
#End Region ' COMMANDS
End Class
@@ -0,0 +1,94 @@
<EgtWPFLib5:EgtCustomWindow x:Class="ChangeParameterWndV"
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}}"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="Height"
Width="300"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
Title="ChangeParameterWnd">
<Grid Margin="5,5,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="5"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="5"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="5"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="5"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="Process"
Style="{StaticResource OptionTextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding PRCList}"
SelectedItem="{Binding SelPRC}"
DisplayMemberPath="ghDesc"
HorizontalAlignment="Stretch"
Style="{StaticResource FeatureComboBox}"/>
<TextBlock Grid.Row="2"
Text="Parameter"
Style="{StaticResource OptionTextBlock}"/>
<ComboBox Grid.Row="2" Grid.Column="1"
ItemsSource="{Binding ParamList}"
SelectedItem="{Binding SelParam}"
DisplayMemberPath="sNameAndDescription"
HorizontalAlignment="Stretch"
Style="{StaticResource FeatureComboBox}"/>
<TextBlock Grid.Row="4"
Text="Actual value"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Row="4" Grid.Column="1"
Text="{Binding SelParam.sActualValue}"
Visibility="{Binding SelParam.IsTextBox_Visibility}"/>
<CheckBox Grid.Row="4" Grid.Column="1"
IsChecked="{Binding SelParam.bActualValue}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Visibility="{Binding SelParam.IsCheckBox_Visibility}"/>
<TextBlock Grid.Row="6" Text="New Value"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Row="6" Grid.Column="1"
Text="{Binding SelParam.sNewValue}"
Visibility="{Binding SelParam.IsTextBox_Visibility}"/>
<CheckBox Grid.Row="6" Grid.Column="1"
IsChecked="{Binding SelParam.bNewValue}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Visibility="{Binding SelParam.IsCheckBox_Visibility}"/>
<Grid Grid.Row="8" Grid.ColumnSpan="2"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Content="Ok"
Command="{Binding Ok_Command}"
IsDefault="True"
Grid.Column="1"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="Cancel"
IsCancel="True"
Grid.Column="3"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,18 @@
Public Class ChangeParameterWndV
Private WithEvents m_ChangeParameterWndVM As ChangeParameterWndVM
Sub New(Owner As Window, ChangeParameterWndVM As ChangeParameterWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ChangeParameterWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ChangeParameterWndVM = ChangeParameterWndVM
End Sub
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_ChangeParameterWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
End Class
@@ -0,0 +1,234 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Public Class ChangeParameterWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
Private m_PRCList As New ObservableCollection(Of PRC)
Public ReadOnly Property PRCList As ObservableCollection(Of PRC)
Get
Return m_PRCList
End Get
End Property
Private m_SelPRC As PRC = Nothing
Public Property SelPRC As PRC
Get
Return m_SelPRC
End Get
Set(value As PRC)
If value IsNot m_SelPRC Then
m_SelPRC = value
' aggiorno lista parametri
m_ParamList.Clear()
Dim ParamIndex As Integer = 1
Dim NewBTLParam As BTLParamM = Nothing
' leggo tutti i P della feature
While BTLIniFile.GetBeamPrivateProfileParam(m_SelPRC.nGRP, m_SelPRC.nPRC, m_SelPRC.nVARIANT, True, ParamIndex, Nothing, NewBTLParam)
m_ParamList.Add(New Parameters(NewBTLParam))
ParamIndex += 1
End While
' aggiungo bDO come parametro
m_ParamList.Add(New Parameters(BTLParamM.CreateNewBTLParam(), True))
' seleziono parametro vuoto per dargli un valore iniziale ed evitare che visualizzi sia text che check
m_SelParam = New Parameters(BTLParamM.CreateNewBTLParam())
NotifyPropertyChanged(NameOf(SelParam))
End If
End Set
End Property
Private m_ParamList As New ObservableCollection(Of Parameters)
Public Property ParamList As ObservableCollection(Of Parameters)
Get
Return m_ParamList
End Get
Set(value As ObservableCollection(Of Parameters))
m_ParamList = value
End Set
End Property
Private m_SelParam As Parameters = New Parameters(BTLParamM.CreateNewBTLParam()) ' False, BTLParamType.STRING_, "") ' per dargli un valore iniziale ed evitare che visualizzi sia text che check
Public Property SelParam As Parameters
Get
Return m_SelParam
End Get
Set(value As Parameters)
m_SelParam = value
NotifyPropertyChanged(NameOf(SelParam))
End Set
End Property
' Definizione comandi
Private m_cmdOk As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
Dim TempPRCList As New ObservableCollection(Of Integer)
GetBeamPrivateProfileProcessList(GRPType.T, TempPRCList)
m_PRCList.Clear()
For Each PRC In TempPRCList
If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x.BTLFeatureVMList.Any(Function(y) y.nPRC = PRC AndAlso CalcBeamPrivateProfileGRP(y.nSelGRP) = 1)) Then
m_PRCList.Add(New PRC(GRPType.T, PRC, GetBeamPrivateProfileName(GRPType.T, PRC)))
End If
Next
GetBeamPrivateProfileProcessList(GRPType.L, TempPRCList)
For Each PRC In TempPRCList
If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x.BTLFeatureVMList.Any(Function(y) y.nPRC = PRC AndAlso CalcBeamPrivateProfileGRP(y.nSelGRP) = 0)) Then
m_PRCList.Add(New PRC(GRPType.L, PRC, GetBeamPrivateProfileName(GRPType.L, PRC)))
End If
Next
End Sub
#End Region ' CONSTRUCTOR
#Region "COMMANDS"
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
'verifico che tutti i campi contengano un valore valido
If Not IsNothing(m_SelPRC) AndAlso
Not IsNothing(m_SelParam) AndAlso m_SelParam.sName <> "" Then
RaiseEvent m_CloseWindow(True)
Else
MessageBox.Show(EgtMsg(61858), EgtMsg(30007))
End If
End Sub
#End Region ' Ok
#End Region ' COMMANDS
End Class
Public Class Parameters
Inherits BTLParamVM
Private m_dActualValue As Double
Private m_sActualValue As String
Public ReadOnly Property dActualValue As Double
Get
Return m_dActualValue
End Get
End Property
Public Property sActualValue As String
Get
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_dActualValue, 3)
Case BTLParamType.LENGTH
Return LenToString(m_dActualValue, 3)
Case Else ' BTLParamType.STRING_
Return m_sActualValue
End Select
End Get
Set(value As String)
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDoubleAdv(value, m_dActualValue, True)
Case BTLParamType.LENGTH
StringToLenAdv(value, m_dActualValue, True)
Case Else ' BTLParamType.STRING_
m_sActualValue = value
End Select
End Set
End Property
Private m_dNewValue As Double
Private m_sNewValue As String
Public ReadOnly Property dNewValue As Double
Get
Return m_dNewValue
End Get
End Property
Public Property sNewValue As String
Get
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
Return DoubleToString(m_dNewValue, 3)
Case BTLParamType.LENGTH
Return LenToString(m_dNewValue, 3)
Case Else ' BTLParamType.STRING_
Return m_sNewValue
End Select
End Get
Set(value As String)
Select Case m_BTLParamM.nType
Case BTLParamType.DOUBLE_
StringToDoubleAdv(value, m_dNewValue, True)
Case BTLParamType.LENGTH
StringToLenAdv(value, m_dNewValue, True)
Case Else ' BTLParamType.STRING_
m_sNewValue = value
End Select
End Set
End Property
Private m_bActualValue As Boolean
Public Property bActualValue As Boolean
Get
Return m_bActualValue
End Get
Set(value As Boolean)
m_bActualValue = value
End Set
End Property
Private m_bNewValue As Boolean
Public Property bNewValue As Boolean
Get
Return m_bNewValue
End Get
Set(value As Boolean)
m_bNewValue = value
End Set
End Property
Private m_bIsCheckBox As Boolean = False
Public Property IsTextBox_Visibility As Visibility
Get
Return If(m_bIsCheckBox, Visibility.Collapsed, Visibility.Visible)
End Get
Set(value As Visibility)
m_bIsCheckBox = Not value
End Set
End Property
Public Property IsCheckBox_Visibility As Visibility
Get
Return If(m_bIsCheckBox, Visibility.Visible, Visibility.Collapsed)
End Get
Set(value As Visibility)
m_bIsCheckBox = value
End Set
End Property
Public ReadOnly Property sNameAndDescription As String
Get
Return If(m_bIsCheckBox, "Attivazione", sName & " " & sDescription)
End Get
End Property
Sub New(BTLParamM As BTLParamM, Optional IsCheckBox As Boolean = False)
MyBase.New(BTLParamM)
m_bIsCheckBox = IsCheckBox
If IsCheckBox Then m_BTLParamM.SetType(BTLParamType.CHECKBOX)
End Sub
End Class
@@ -0,0 +1,9 @@
<DockPanel x:Class="ConfigurationPageV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer"
DataContext="{StaticResource ConfigurationPageVM}">
<OPTIMIZER:MachinePanelV DataContext="{Binding MachinePanelVM}"/>
</DockPanel>
@@ -0,0 +1,2 @@
Public Class ConfigurationPageV
End Class
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,55 @@
<DockPanel x:Class="ConfigurationProgramV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer"
DataContext="{StaticResource ConfigurationPageVM}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="6*"/>
</Grid.RowDefinitions>
<TabControl Grid.RowSpan="2" Grid.ColumnSpan="2"
SelectedIndex="{Binding SelConfigSubPage}"
Style="{StaticResource OnlyProd_TabControl}">
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="{Binding General_Msg}"
FontSize="15"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding General_Visibility}"
Style="{StaticResource SaveOptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALLCORE:OnlyProdGeneral_ConfigurationPageV/>
</TabItem.Content>
</TabItem>
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="{Binding PDFEditor_Msg}"
FontSize="15"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding PDFEditor_Visibility}"
Style="{StaticResource SaveOptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<OPTIMIZER:PDFEditorV/>
</TabItem.Content>
</TabItem>
</TabControl>
</Grid>
</DockPanel>
@@ -0,0 +1,3 @@
Public Class ConfigurationProgramV
End Class
@@ -0,0 +1,16 @@
Module ConstWarehouseIni
Public Const WH_BASIC_INI_FILE_NAME As String = "Basic.ini"
Public Const WH_MEDIUM_INI_FILE_NAME As String = "Medium.ini"
Public Const K_CURRENTL As String = "CurrentL"
Public Const K_CURRENTS As String = "CurrentS"
Public Const K_STARTOFFSET As String = "StartOffset"
Public Const K_KERF As String = "Kerf"
Public Const K_OFFSET As String = "Offset"
Public Const K_QUANTITY As String = "Quantity"
Public Const K_L As String = "L"
Public Const K_S As String = "S"
Public Const K_RANGE As String = "Range"
End Module
@@ -0,0 +1,4 @@
Public Interface IListItemConverter
Function Convert(ByVal masterListItem As Object) As Object
Function ConvertBack(ByVal targetListItem As Object) As Object
End Interface
@@ -0,0 +1,78 @@
Imports System.Windows.Controls.Primitives
Public Class MultiSelectorBehaviours
Public Shared ReadOnly SynchronizedSelectedItemsProperty As DependencyProperty = DependencyProperty.RegisterAttached("SynchronizedSelectedItems", GetType(IList), GetType(MultiSelectorBehaviours), New PropertyMetadata(Nothing, AddressOf OnSynchronizedSelectedItemsChanged))
Public Shared ReadOnly SynchronizationManagerProperty As DependencyProperty = DependencyProperty.RegisterAttached("SynchronizationManager", GetType(SynchronizationManager), GetType(MultiSelectorBehaviours), New PropertyMetadata(Nothing))
Public Shared Function GetSynchronizedSelectedItems(ByVal dependencyObject As DependencyObject) As IList
Return CType(dependencyObject.GetValue(SynchronizedSelectedItemsProperty), IList)
End Function
Public Shared Sub SetSynchronizedSelectedItems(ByVal dependencyObject As DependencyObject, ByVal value As IList)
dependencyObject.SetValue(SynchronizedSelectedItemsProperty, value)
End Sub
Private Shared Function GetSynchronizationManager(ByVal dependencyObject As DependencyObject) As SynchronizationManager
Return CType(dependencyObject.GetValue(SynchronizationManagerProperty), SynchronizationManager)
End Function
Private Shared Sub SetSynchronizationManager(ByVal dependencyObject As DependencyObject, ByVal value As SynchronizationManager)
dependencyObject.SetValue(SynchronizationManagerProperty, value)
End Sub
Private Shared Sub OnSynchronizedSelectedItemsChanged(ByVal dependencyObject As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
If e.OldValue IsNot Nothing Then
Dim synchronizer As SynchronizationManager = GetSynchronizationManager(dependencyObject)
synchronizer.StopSynchronizing()
SetSynchronizationManager(dependencyObject, Nothing)
End If
Dim list As IList = TryCast(e.NewValue, IList)
Dim selector As Selector = TryCast(dependencyObject, Selector)
If list IsNot Nothing AndAlso selector IsNot Nothing Then
Dim synchronizer As SynchronizationManager = GetSynchronizationManager(dependencyObject)
If synchronizer Is Nothing Then
synchronizer = New SynchronizationManager(selector)
SetSynchronizationManager(dependencyObject, synchronizer)
End If
synchronizer.StartSynchronizingList()
End If
End Sub
Private Class SynchronizationManager
Private ReadOnly _multiSelector As Selector
Private _synchronizer As TwoListSynchronizer
Friend Sub New(ByVal selector As Selector)
_multiSelector = selector
End Sub
Public Sub StartSynchronizingList()
Dim list As IList = GetSynchronizedSelectedItems(_multiSelector)
If list IsNot Nothing Then
_synchronizer = New TwoListSynchronizer(GetSelectedItemsCollection(_multiSelector), list)
_synchronizer.StartSynchronizing()
End If
End Sub
Public Sub StopSynchronizing()
_synchronizer.StopSynchronizing()
End Sub
Public Shared Function GetSelectedItemsCollection(ByVal selector As Selector) As IList
If TypeOf selector Is MultiSelector Then
Return (TryCast(selector, MultiSelector)).SelectedItems
ElseIf TypeOf selector Is ListBox Then
Return (TryCast(selector, ListBox)).SelectedItems
Else
Throw New InvalidOperationException("Target object has no SelectedItems property to bind.")
End If
End Function
End Class
End Class
@@ -0,0 +1,164 @@
Imports System.Collections.Specialized
Public Class TwoListSynchronizer
Implements IWeakEventListener
Private Shared ReadOnly DefaultConverter As IListItemConverter = New DoNothingListItemConverter()
Private ReadOnly _masterList As IList
Private ReadOnly _masterTargetConverter As IListItemConverter
Private ReadOnly _targetList As IList
Public Sub New(ByVal masterList As IList, ByVal targetList As IList, ByVal masterTargetConverter As IListItemConverter)
_masterList = masterList
_targetList = targetList
_masterTargetConverter = masterTargetConverter
End Sub
Public Sub New(ByVal masterList As IList, ByVal targetList As IList)
Me.New(masterList, targetList, DefaultConverter)
End Sub
Private Delegate Sub ChangeListAction(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
Public Sub StartSynchronizing()
ListenForChangeEvents(_masterList)
ListenForChangeEvents(_targetList)
SetListValuesFromSource(_masterList, _targetList, New Converter(Of Object, Object)(AddressOf ConvertFromMasterToTarget))
If Not TargetAndMasterCollectionsAreEqual() Then
SetListValuesFromSource(_targetList, _masterList, New Converter(Of Object, Object)(AddressOf ConvertFromTargetToMaster))
End If
End Sub
Public Sub StopSynchronizing()
StopListeningForChangeEvents(_masterList)
StopListeningForChangeEvents(_targetList)
End Sub
Public Function ReceiveWeakEvent(ByVal managerType As Type, ByVal sender As Object, ByVal e As EventArgs) As Boolean Implements IWeakEventListener.ReceiveWeakEvent
HandleCollectionChanged(TryCast(sender, IList), TryCast(e, NotifyCollectionChangedEventArgs))
Return True
End Function
Protected Sub ListenForChangeEvents(ByVal list As IList)
If TypeOf list Is INotifyCollectionChanged Then
CollectionChangedEventManager.AddListener(TryCast(list, INotifyCollectionChanged), Me)
End If
End Sub
Protected Sub StopListeningForChangeEvents(ByVal list As IList)
If TypeOf list Is INotifyCollectionChanged Then
CollectionChangedEventManager.RemoveListener(TryCast(list, INotifyCollectionChanged), Me)
End If
End Sub
Private Sub AddItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
Dim itemCount As Integer = e.NewItems.Count
For i As Integer = 0 To itemCount - 1
Dim insertionPoint As Integer = e.NewStartingIndex + i
If insertionPoint > list.Count Then
list.Add(converter(e.NewItems(i)))
Else
list.Insert(insertionPoint, converter(e.NewItems(i)))
End If
Next
End Sub
Private Function ConvertFromMasterToTarget(ByVal masterListItem As Object) As Object
Return If(_masterTargetConverter Is Nothing, masterListItem, _masterTargetConverter.Convert(masterListItem))
End Function
Private Function ConvertFromTargetToMaster(ByVal targetListItem As Object) As Object
Return If(_masterTargetConverter Is Nothing, targetListItem, _masterTargetConverter.ConvertBack(targetListItem))
End Function
Private Sub HandleCollectionChanged(ByVal sender As Object, ByVal e As NotifyCollectionChangedEventArgs)
Dim sourceList As IList = TryCast(sender, IList)
Select Case e.Action
Case NotifyCollectionChangedAction.Add
PerformActionOnAllLists(AddressOf AddItems, sourceList, e)
Case NotifyCollectionChangedAction.Move
PerformActionOnAllLists(AddressOf MoveItems, sourceList, e)
Case NotifyCollectionChangedAction.Remove
PerformActionOnAllLists(AddressOf RemoveItems, sourceList, e)
Case NotifyCollectionChangedAction.Replace
PerformActionOnAllLists(AddressOf ReplaceItems, sourceList, e)
Case NotifyCollectionChangedAction.Reset
UpdateListsFromSource(TryCast(sender, IList))
Case Else
End Select
End Sub
Private Sub MoveItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
RemoveItems(list, e, converter)
AddItems(list, e, converter)
End Sub
Private Sub PerformActionOnAllLists(ByVal action As ChangeListAction, ByVal sourceList As IList, ByVal collectionChangedArgs As NotifyCollectionChangedEventArgs)
If sourceList Is _masterList Then
PerformActionOnList(_targetList, action, collectionChangedArgs, New Converter(Of Object, Object)(AddressOf ConvertFromMasterToTarget))
Else
PerformActionOnList(_masterList, action, collectionChangedArgs, New Converter(Of Object, Object)(AddressOf ConvertFromTargetToMaster))
End If
End Sub
Private Sub PerformActionOnList(ByVal list As IList, ByVal action As ChangeListAction, ByVal collectionChangedArgs As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
StopListeningForChangeEvents(list)
action(list, collectionChangedArgs, converter)
ListenForChangeEvents(list)
End Sub
Private Sub RemoveItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
If e.OldItems.Count = 1 AndAlso e.OldStartingIndex <= list.Count - 1 Then
list.RemoveAt(e.OldStartingIndex)
Else
For Each Item In e.OldItems
list.Remove(Item)
Next
End If
End Sub
Private Sub ReplaceItems(ByVal list As IList, ByVal e As NotifyCollectionChangedEventArgs, ByVal converter As Converter(Of Object, Object))
RemoveItems(list, e, converter)
AddItems(list, e, converter)
End Sub
Private Sub SetListValuesFromSource(ByVal sourceList As IList, ByVal targetList As IList, ByVal converter As Converter(Of Object, Object))
StopListeningForChangeEvents(targetList)
targetList.Clear()
For Each o As Object In sourceList
targetList.Add(converter(o))
Next
ListenForChangeEvents(targetList)
End Sub
Private Function TargetAndMasterCollectionsAreEqual() As Boolean
Return _masterList.Cast(Of Object)().SequenceEqual(_targetList.Cast(Of Object)().[Select](Function(item) ConvertFromTargetToMaster(item)))
End Function
Private Sub UpdateListsFromSource(ByVal sourceList As IList)
If sourceList Is _masterList Then
SetListValuesFromSource(_masterList, _targetList, New Converter(Of Object, Object)(AddressOf ConvertFromMasterToTarget))
Else
SetListValuesFromSource(_targetList, _masterList, New Converter(Of Object, Object)(AddressOf ConvertFromTargetToMaster))
End If
End Sub
Friend Class DoNothingListItemConverter
Implements IListItemConverter
Public Function Convert(ByVal masterListItem As Object) As Object Implements IListItemConverter.Convert
Return masterListItem
End Function
Public Function ConvertBack(ByVal targetListItem As Object) As Object Implements IListItemConverter.ConvertBack
Return targetListItem
End Function
End Class
End Class
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,86 @@
Imports System.IO
Imports EgtBEAMWALL.Core.ConstIni
Imports EgtUILib
Imports EgtWPFLib5
Imports EgwMultiEngineManager.Core
Imports EgwMultiEngineManager.Data
Imports EgwMultiEngineManager.Data.Constants
Module MyExecProcessManager
Private m_ExecProcessManagerList As New Dictionary(Of EXECENVIRONMENTS, ExecProcessManager)
Public ReadOnly Property ExecProcessManagerList As Dictionary(Of EXECENVIRONMENTS, ExecProcessManager)
Get
Return m_ExecProcessManagerList
End Get
End Property
Friend Function Init() As Boolean
' creazione manager dei processi
Dim sCamExePath As String = ""
GetMainPrivateProfileString(S_GENERAL, K_CAMEXEPATH, "", sCamExePath)
EgtOutLog("CAMExePath = " & sCamExePath)
If Not File.Exists(sCamExePath) Then
Dim sMsg As String = "CAMExePath not found!"
EgtOutLog(sMsg)
Return False
End If
Dim sPipeLuaDir As String = ""
GetMainPrivateProfileString(S_GENERAL, K_PIPELUADIR, "", sPipeLuaDir)
EgtOutLog("PipeLuaDir = " & sPipeLuaDir)
If Not File.Exists(sCamExePath) Then
Dim sMsg As String = "PipeLuaDir not found!"
EgtOutLog(sMsg)
Return False
End If
Dim nGroupIndex As Integer = 1
Dim sEnvironment As String = ""
Dim sPipeLuaFile As String = ""
Dim nMaxCamInstances As Integer = 0
While GetMainPrivateProfileString(S_EXECGROUP & nGroupIndex.ToString(), K_ENVIRONMENT, "", sEnvironment) > 0 AndAlso
GetMainPrivateProfileString(S_EXECGROUP & nGroupIndex.ToString(), K_PIPELUAFILE, "", sPipeLuaFile) AndAlso
GetMainPrivateProfileString(S_EXECGROUP & nGroupIndex.ToString(), K_MAXCAMINSTANCES, "", nMaxCamInstances)
System.Console.WriteLine("Group" & nGroupIndex.ToString())
System.Console.WriteLine("Environment = " & sEnvironment)
System.Console.WriteLine("PipeLuaFile = " & sPipeLuaFile)
System.Console.WriteLine("MaxCAMInstances = " & nMaxCamInstances)
Dim Environment As EXECENVIRONMENTS = EXECENVIRONMENTS.NULL
Select Case sEnvironment
Case "BEAM"
Environment = EXECENVIRONMENTS.BEAM
Case "WALL"
Environment = EXECENVIRONMENTS.WALL
End Select
Dim PipeLuaPath As String = sPipeLuaDir & "\" & sPipeLuaFile
If nMaxCamInstances <= 0 OrElse Environment = EXECENVIRONMENTS.NULL OrElse Not File.Exists(PipeLuaPath) Then
System.Console.WriteLine(String.Format("Group{0} not created!", nGroupIndex.ToString()))
nGroupIndex += 1
Continue While
End If
Dim NewExecProcessManager As New ExecProcessManager(nGroupIndex, Environment, sCamExePath, PipeLuaPath, nMaxCamInstances, ExecProcessManager.ReturnModes.EVENT_, False)
AddHandler NewExecProcessManager.m_AnswerReceived, AddressOf ExecProcessManager_AnswerReceived
NewExecProcessManager.StartExecutionThread()
m_ExecProcessManagerList.Add(Environment, NewExecProcessManager)
nGroupIndex += 1
End While
Return True
End Function
Private Sub ExecProcessManager_AnswerReceived(Answer As AnswerDTO)
Dim sBarPath As String = Answer.Args("BarPath")
Dim nProgramPage As Integer = -1
Integer.TryParse(Answer.Args("ProgramPage"), nProgramPage)
Dim nBarId As Integer = -1
Integer.TryParse(Answer.Args("BarId"), nBarId)
EgtOutLog("Risultato progetto " & nBarId)
Map.refCALCPanelVM.ProcessResults(sBarPath, nProgramPage, nBarId)
End Sub
Friend Function Close()
For Each Key In m_ExecProcessManagerList.Keys
m_ExecProcessManagerList(Key).Dispose()
Next
Return True
End Function
End Module
@@ -0,0 +1,26 @@
<StackPanel x:Class="FeatureListManagerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DataContext="{StaticResource FeatureListManagerVM}"
Style="{StaticResource OnlyProdFeatureListManager_StackPanel}">
<Button Command="{Binding CopyFeature_Command}"
ToolTip="{Binding CopyFeature_ToolTip}"
IsEnabled="{Binding CopyFeature_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/CopyFeature.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding AddFeature_Command}"
ToolTip="{Binding AddFeature_ToolTip}"
IsEnabled="{Binding AddFeature_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/AddFeature.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding RemoveFeature_Command}"
ToolTip="{Binding RemoveFeature_ToolTip}"
IsEnabled="{Binding RemoveFeature_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
</Button>
</StackPanel>
@@ -0,0 +1,3 @@
Public Class FeatureListManagerV
End Class
@@ -0,0 +1,289 @@
Imports EgtBEAMWALL.Core
Imports EgtUILib.EgtInterface
Imports EgtWPFLib5
Public Class FeatureListManagerVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Public ReadOnly Property PartIsSelected As Boolean
Get
Return Not IsNothing(Map.refProjectVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart)
End Get
End Property
Public ReadOnly Property FeatureIsSelected As Boolean
Get
Return PartIsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM)
End Get
End Property
Public ReadOnly Property CopyFeature_IsEnabled As Boolean
Get
If Not IsNothing(Map.refBTLPartManagerVM) Then
Return Map.refBTLPartManagerVM.BTLPartManager_IsEnabled AndAlso PartIsSelected AndAlso FeatureIsSelected
End If
Return False
End Get
End Property
Public ReadOnly Property MacroFeature_IsEnabled As Boolean
Get
If Not IsNothing(Map.refBTLPartManagerVM) Then
Return Map.refBTLPartManagerVM.BTLPartManager_IsEnabled AndAlso PartIsSelected AndAlso FeatureIsSelected
End If
Return False
End Get
End Property
Public ReadOnly Property AddFeature_IsEnabled As Boolean
Get
Return PartIsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 1
End Get
End Property
Public ReadOnly Property RemoveFeature_IsEnabled As Boolean
Get
If Not IsNothing(Map.refBTLPartManagerVM) Then
Return Map.refBTLPartManagerVM.BTLPartManager_IsEnabled AndAlso PartIsSelected AndAlso FeatureIsSelected
End If
Return False
End Get
End Property
Private m_cmdCopyFeature As ICommand
Private m_cmdAddFeature As ICommand
Private m_cmdRemoveFeature As ICommand
#Region "Messages"
Public ReadOnly Property CopyFeature_ToolTip As String
Get
Return EgtMsg(61908)
End Get
End Property
Public ReadOnly Property AddFeature_ToolTip As String
Get
Return EgtMsg(61910)
End Get
End Property
Public ReadOnly Property RemoveFeature_ToolTip As String
Get
Return EgtMsg(61911)
End Get
End Property
#End Region ' Messages
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
Map.SetRefFeatureListManagerVM(Me)
End Sub
#End Region ' Constructor
#Region "METHODS"
Friend Sub PartShowAllChanged()
NotifyPropertyChanged(NameOf(AddFeature_IsEnabled))
End Sub
Friend Sub FeatureSelectionChanged()
NotifyPropertyChanged(NameOf(CopyFeature_IsEnabled))
NotifyPropertyChanged(NameOf(MacroFeature_IsEnabled))
NotifyPropertyChanged(NameOf(RemoveFeature_IsEnabled))
End Sub
Private Sub CreateNewFeature(MacroListCount As Integer, nSelMacro As Integer, AddFeatureWndVM As AddFeatureWndVM, nNewFeatureId As Integer, bMacroFlag As Boolean, NewFeat As BTLFeatureM)
' verifico se una Macro è selezionata
If MacroListCount > 0 AndAlso nSelMacro >= 0 Then
' Creo nuova feature sulla base della Macro selezionata
' Creo table e setto variabili
CreateMacroTable(AddFeatureWndVM)
Dim bOk As Boolean
If AddFeatureWndVM.nSelMacroDefault >= 0 Then
bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroCustomFilePathList(nSelMacro))
Else
bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroFilePathList(nSelMacro))
End If
' Leggo variabili
EgtLuaGetGlobIntVar("MACRO.FEATUREID", nNewFeatureId)
' Reset lua
EgtLuaResetGlobVar("MACRO")
If Not bOk Then
MessageBox.Show(EgtMsg(61869), EgtMsg(30007))
Return
End If
bMacroFlag = True
Else
' Creo nuova feature (Macro non selezionata)
NewFeat = BTLFeatureM.CreateBTLFeature(AddFeatureWndVM.nSelPRC.nPRC, AddFeatureWndVM.nSelPRC.nGRP, AddFeatureWndVM.nSelPRC.nSIDE)
NewFeat.SetDefaultValues()
Dim vPar() As Double = Nothing
Dim sPar As String = String.Empty
Dim vParQ() As String = Nothing
NewFeat.CalcParamArray(vPar, sPar, vParQ)
If NewFeat.nPRC = 900 Then NewFeat.sDES = "2"
' aggiorno la feature con nuovo valore
EgtBeamSetPart(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
nNewFeatureId = EgtBeamAddProcess(NewFeat.nSelGRP, NewFeat.nPRC, NewFeat.nSelSIDE, NewFeat.sDES,
Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId(),
New Frame3d(), vPar, sPar, vParQ, GDB_ID.NULL, GDB_ID.NULL)
bMacroFlag = False
End If
' se è stata creata
If nNewFeatureId <> GDB_ID.NULL Then
MyMachGroupPanelM.SetDuploModified(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
' la aggiungo a struttura BTL corrente
NewFeat = BTLFeatureM.CreateBTLFeature(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM, nNewFeatureId)
If Not bMacroFlag Then NewFeat.SetDefaultValues()
Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.AddBTLFeature(NewFeat)
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.FirstOrDefault(Function(x) x.BTLFeatureM Is NewFeat)
Map.refProjectVM.BTLStructureVM.SelBTLPart.ResetCalcPart()
End If
End Sub
Private Sub CreateMacroTable(AddFeatureWndVM As AddFeatureWndVM)
Dim nMacroW, nMacroH As Integer
If Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM) Then
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 0 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 180 Then
If Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 1 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 3 Then
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
Else
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
End If
ElseIf Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 90 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.nROTATED = 270 Then
If Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 1 OrElse Map.refProjectVM.BTLStructureVM.SelBTLPart.m_SelBTLFeatureVM.nSelSIDE = 3 Then
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
Else
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
End If
Else
nMacroW = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlW
nMacroH = Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlH
End If
End If
EgtLuaCreateGlobTable("MACRO")
EgtLuaSetGlobStringVar("MACRO.NAME", AddFeatureWndVM.nSelPRC.sName)
EgtLuaSetGlobNumVar("MACRO.L", Map.refProjectVM.BTLStructureVM.SelBTLPart.dBtlL)
EgtLuaSetGlobNumVar("MACRO.W", nMacroW)
EgtLuaSetGlobNumVar("MACRO.H", nMacroH)
EgtLuaSetGlobIntVar("MACRO.PROCID", Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLPartM.NewProcId())
End Sub
#End Region ' Methods
#Region "COMMANDS"
#Region "CopyFeature"
Public ReadOnly Property CopyFeature_Command As ICommand
Get
If m_cmdCopyFeature Is Nothing Then
m_cmdCopyFeature = New Command(AddressOf CopyFeature)
End If
Return m_cmdCopyFeature
End Get
End Property
Public Sub CopyFeature()
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
If IsNothing(SelPart) Then Return
Dim SelFeature As BTLFeatureVM = SelPart.SelBTLFeatureVM
If IsNothing(SelFeature) Then Return
' creo copia
Dim NewFeature = SelFeature.Copy()
If Not IsNothing(NewFeature) Then
SelPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.FirstOrDefault(Function(x) x.BTLFeatureM Is NewFeature)
MyMachGroupPanelM.SetDuploModified(SelPart.nPartId)
End If
SelPart.ResetCalcPart()
End Sub
#End Region ' CopyFeature
#Region "AddFeature"
Public ReadOnly Property AddFeature_Command As ICommand
Get
If m_cmdAddFeature Is Nothing Then
m_cmdAddFeature = New Command(AddressOf AddFeature)
End If
Return m_cmdAddFeature
End Get
End Property
Public Sub AddFeature(ByVal param As Object)
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
' apro finestra di definizione nuova feature
Dim AddFeatureWndVM As New AddFeatureWndVM()
Dim NewFeat As BTLFeatureM = Nothing
Dim nNewFeatureId As Integer = 0
Dim bMacroFlag As Boolean = False
Dim AddNewFeatureWnd As New AddFeatureWndV(Application.Current.MainWindow, AddFeatureWndVM)
If AddNewFeatureWnd.ShowDialog() Then
' verifico se una Macro è selezionata
If AddFeatureWndVM.nSelMacroDefault >= 0 Then
CreateNewFeature(AddFeatureWndVM.MacroDefaultList.Count, AddFeatureWndVM.nSelMacroDefault, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
Else
CreateNewFeature(AddFeatureWndVM.MacroCustomList.Count, AddFeatureWndVM.nSelMacroCustom, AddFeatureWndVM, nNewFeatureId, bMacroFlag, NewFeat)
End If
End If
End Sub
#End Region ' AddFeature
#Region "RemoveFeature"
Public ReadOnly Property RemoveFeature_Command As ICommand
Get
If m_cmdRemoveFeature Is Nothing Then
m_cmdRemoveFeature = New Command(AddressOf RemoveFeature)
End If
Return m_cmdRemoveFeature
End Get
End Property
Public Sub RemoveFeature()
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM) Then Return
If EgtBeamEraseProcess(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.nFeatureId) Then
MyMachGroupPanelM.SetDuploModified(Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId)
' rimuovo dalla lista feature
Dim Index As Integer = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.IndexOf(Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM)
If Index = 0 Then
If Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count > 0 Then
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(0)
Else
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Nothing
End If
ElseIf Index = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count - 1 Then
If Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count > 1 Then
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.Count - 2)
Else
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Nothing
End If
Else
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList(Index - 1)
End If
Map.refProjectVM.BTLStructureVM.SelBTLPart.BTLFeatureVMList.RemoveAt(Index)
EgtDraw()
Map.refProjectVM.BTLStructureVM.SelBTLPart.ResetCalcPart()
End If
End Sub
#End Region ' RemoveFeature
#End Region ' Commands
End Class
@@ -0,0 +1,85 @@
<Grid x:Class="FeatureManagerV"
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:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer"
Margin="30,4,0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Expander Header="{Binding Face_Msg}"
IsEnabled="{Binding FeatureManager_IsEnabled}"
Width="80">
<ListBox ItemsSource="{Binding Tag.SIDEList, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
SelectedItem="{Binding Tag.nSelSIDE, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
IsEnabled="{Binding FeatureManager_IsEnabled}"
Style="{StaticResource FeatureManager_ListBox}"
ItemContainerStyle="{StaticResource AlternationIndex_ListBoxItem}"/>
</Expander>
<Expander Grid.Column="1"
Header="{Binding Group_Msg}"
IsEnabled="{Binding FeatureManager_IsEnabled}"
Width="80">
<ListBox ItemsSource="{Binding Tag.GRPList, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
SelectedItem="{Binding Tag.nSelGRP, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
IsEnabled="{Binding FeatureManager_IsEnabled}"
Style="{StaticResource FeatureManager_ListBox}"
ItemContainerStyle="{StaticResource AlternationIndex_ListBoxItem}"/>
</Expander>
<TextBlock Grid.Column="2"
Text="{Binding Priority_Msg}"
IsEnabled="{Binding FeatureManager_IsEnabled}"
Visibility="{Binding Priority_Visibility}"
Style="{StaticResource OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="3"
Text="{Binding Tag.sPriority,
RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}},
UpdateSourceTrigger=Explicit}"
IsEnabled="{Binding FeatureManager_IsEnabled}"
Visibility="{Binding Priority_Visibility}"
Style="{StaticResource Dimension_TextBox}"/>
<TextBlock Grid.Column="4"
Text="{Binding Tag.sName, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
Style="{StaticResource OnlyProdFeatureManager_OnlyProd}"/>
<ComboBox Grid.Column="5"
ItemsSource="{Binding Tag.VARIANTList, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
SelectedItem="{Binding Tag.nSelVARIANT, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
IsEnabled="{Binding FeatureManager_IsEnabled}"
Visibility="{Binding Variant_Visibility}"
Style="{StaticResource FeatureComboBox}"/>
<Button Grid.Column="6"
Content="{Binding Edit_Msg}"
Command="{Binding Tag.Edit_Command, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
Visibility="{Binding Tag.Edit_Visibility, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
IsEnabled="{Binding Edit_IsEnabled}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
<Button Grid.Column="7"
Content="{Binding Save_Msg}"
Command="{Binding Tag.Save_Command, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
Visibility="{Binding Tag.SaveCancel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
<Button Grid.Column="8"
Content="{Binding Cancel_Msg}"
Command="{Binding Tag.Cancel_Command, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
Visibility="{Binding Tag.SaveCancel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type OPTIMIZER:FeatureManagerV}}}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
<Button Grid.Column="9" HorizontalAlignment="Right"
Command="{Binding MacroFeature_Command}"
ToolTip="{Binding MacroFeature_ToolTip}"
IsEnabled="{Binding MacroFeature_IsEnabled}"
Style="{StaticResource OnlyProdFeatureMan_Button}">
<Image Source="/Resources/LeftPanel/MacroFeature.png" Stretch="Uniform"/>
</Button>
</Grid>
@@ -0,0 +1,3 @@
Public Class FeatureManagerV
End Class
@@ -0,0 +1,150 @@
Imports EgtUILib
Imports EgtWPFLib5
Public Class FeatureManagerVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private m_FeatureManager_IsEnabled As Boolean = True
Public Property FeatureManager_IsEnabled As Boolean
Get
Return m_FeatureManager_IsEnabled
End Get
Set(value As Boolean)
m_FeatureManager_IsEnabled = value
End Set
End Property
Private m_Variant_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property Variant_Visibility As Visibility
Get
Return m_Variant_Visibility
End Get
End Property
Public Sub SetVariant_Visibility(value As Visibility)
m_Variant_Visibility = value
NotifyPropertyChanged(NameOf(Variant_Visibility))
End Sub
Public ReadOnly Property Edit_IsEnabled As Boolean
Get
Return m_FeatureManager_IsEnabled AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso
Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 AndAlso
Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLParts(0)) AndAlso
Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLParts(0).SelBTLFeatureVM) AndAlso
Map.refProjectVM.BTLStructureVM.SelBTLParts(0).SelBTLFeatureVM.BTLFeatureM.IsFreeContour() AndAlso
Map.refProjectVM.BTLStructureVM.SelBTLParts(0).SelBTLFeatureVM.bDO
End Get
End Property
Public ReadOnly Property Priority_Visibility As Visibility
Get
Return If(CurrentMachine.nType = Core.ConstBeam.MachineType.WALL AndAlso CurrentMachine.bIsEnabledPriority, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
#Region "Messages"
Public ReadOnly Property Face_Msg As String
Get
Return EgtMsg(61824)
End Get
End Property
Public ReadOnly Property Group_Msg As String
Get
Return EgtMsg(61825)
End Get
End Property
Public ReadOnly Property Priority_Msg As String
Get
Return EgtMsg(61895)
End Get
End Property
Public ReadOnly Property Edit_Msg As String
Get
Return EgtMsg(61826)
End Get
End Property
Public ReadOnly Property Save_Msg As String
Get
Return EgtMsg(61827)
End Get
End Property
Public ReadOnly Property Cancel_Msg As String
Get
Return EgtMsg(61828)
End Get
End Property
Public ReadOnly Property MacroFeature_ToolTip As String
Get
Return EgtMsg(61909)
End Get
End Property
#End Region ' Messages
' Definisco i comandi
Private m_cmdMacroFeature As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTORS"
Sub New()
' imposto riferimento in Map
Map.SetRefFeatureManagerVM(Me)
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Friend Sub SetFeatureManagerIsEnabled(bIsEnabled As Boolean)
m_FeatureManager_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(FeatureManager_IsEnabled))
NotifyPropertyChanged(NameOf(Edit_IsEnabled))
End Sub
Friend Sub SetEditIsEnabled()
' aggiorno stato abilitazione del bottone modifica free contour
NotifyPropertyChanged(NameOf(Edit_IsEnabled))
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "MacroFeature"
Public ReadOnly Property MacroFeature_Command As ICommand
Get
If m_cmdMacroFeature Is Nothing Then
m_cmdMacroFeature = New Command(AddressOf MacroFeature)
End If
Return m_cmdMacroFeature
End Get
End Property
Public Sub MacroFeature()
If IsNothing(ProjectManagerVM.CurrProd) Then Return
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
' apro finestra di creazione macro
Dim MacroFeatureWndVM As New MacroFeatureWndVM()
Dim MacroFeatureWnd As New MacroFeatureWnd(Application.Current.MainWindow, MacroFeatureWndVM)
If MacroFeatureWnd.ShowDialog() Then
End If
End Sub
#End Region ' MacroFeature
#End Region ' Commands
End Class
@@ -0,0 +1,55 @@
<UserControl x:Class="ForcedStrategyBTLV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Optimizer="clr-namespace:EgtBEAMWALL.Optimizer">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Margin="2,0,2,0"
Grid.RowSpan="2"
Style="{StaticResource OnlyProdPage_Border}">
<ListBox ItemsSource="{Binding StrategyList}"
SelectedItem="{Binding SelStrategy}"
IsSynchronizedWithCurrentItem="True"
HorizontalAlignment="Left"
Style="{StaticResource NewAddFeature_ListBox}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type Optimizer:Strategy}">
<StackPanel Orientation="Horizontal">
<RadioButton IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
GroupName="ForcedStrategy"/>
<Image Source="{Binding sStrategyImagePath}"
Stretch="Uniform"
Width="100"
Height="100"/>
<TextBlock Text="{Binding sStrategyName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<!--<EventSetter Event="PreviewMouseDown" Handler="AvailableStrategyList_PreviewMouseDown"/>-->
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Border>
<GroupBox Grid.Column="1"
Foreground="Black"
BorderThickness="2"
Margin="0,-5,0,0"
BorderBrush="{StaticResource BeamWall_Glacier}">
<GroupBox.Header>
<TextBlock Text="{Binding SelStrategy.sStrategyName}"
FontWeight="Bold"
Style="{StaticResource DialogWindow_TextBlock}"/>
</GroupBox.Header>
<Optimizer:ParameterStrategyV Tag="{Binding SelStrategy}"/>
</GroupBox>
</Grid>
</UserControl>
@@ -0,0 +1,3 @@
Public Class ForcedStrategyBTL
End Class
@@ -0,0 +1,74 @@
<UserControl x:Class="ForcedStrategyPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Grid.RowSpan="2"
Margin="2,0,2,0"
Style="{StaticResource OnlyProdPage_Border}">
<ListBox ItemsSource="{Binding StrategyList}"
SelectedItem="{Binding SelStrategy}"
Height="Auto"
IsSynchronizedWithCurrentItem="True"
Style="{StaticResource NewAddFeature_ListBox}">
<ListBox.Resources>
<DataTemplate DataType="{x:Type OPTIMIZER:Strategy}">
<StackPanel Orientation="Horizontal">
<RadioButton IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
GroupName="ForcedStrategy"/>
<Image Source="{Binding sStrategyImagePath}"
Stretch="Uniform"
Width="100"
Height="100"/>
<TextBlock Text="{Binding sStrategyName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<!--<EventSetter Event="PreviewMouseDown" Handler="AvailableStrategyList_PreviewMouseDown"/>-->
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Border>
<GroupBox Grid.Column="1"
Foreground="Black"
BorderThickness="2"
Margin="0,-5,0,0"
BorderBrush="{StaticResource BeamWall_Glacier}">
<GroupBox.Header>
<TextBlock Text="{Binding SelStrategy.sStrategyName}"
FontWeight="Bold"
Style="{StaticResource DialogWindow_TextBlock}"/>
</GroupBox.Header>
<OPTIMIZER:ParameterStrategyV Tag="{Binding SelStrategy}"/>
</GroupBox>
<StackPanel Grid.Row="2"
Grid.ColumnSpan="2"
HorizontalAlignment="Right"
Style="{StaticResource OnlyProdPartManager_StackPanel}">
<Button Command="{Binding Ok_Command}"
ToolTip="{Binding Ok_Msg}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/NewPage/Ok.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding Cancel_Command}"
ToolTip="{Binding Cancel_Msg}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/PDFEditor/Delete.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Grid>
</UserControl>
@@ -0,0 +1,3 @@
Public Class ForcedStrategyPanelV
End Class
@@ -0,0 +1,400 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Imports Newtonsoft.Json
Public Class ForcedStrategyPanelVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Public Const AUTOMATICSTRATEGYID As String = "AUTOMATIC"
Private m_StrategyList As New ObservableCollection(Of Strategy)
Public Property StrategyList As ObservableCollection(Of Strategy)
Get
Return m_StrategyList
End Get
Set(value As ObservableCollection(Of Strategy))
m_StrategyList = value
End Set
End Property
Private m_SelStrategy As Strategy
Public Property SelStrategy As Strategy
Get
Return m_SelStrategy
End Get
Set(value As Strategy)
m_SelStrategy = value
NotifyPropertyChanged(NameOf(SelStrategy))
End Set
End Property
Private m_CurrentFeature As BTLFeatureM
' Definizione Comandi
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
#Region "Messages"
Public ReadOnly Property UserMsg As String
Get
Return EgtMsg(61748)
End Get
End Property
Public ReadOnly Property AdvanceMsg As String
Get
Return EgtMsg(61749)
End Get
End Property
#End Region ' Messages
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
Map.SetRefForcedStrategyPanelVM(Me)
End Sub
#End Region ' Constructor
#Region "METHODS"
Friend Sub Init(Feature As BTLFeatureM)
m_CurrentFeature = Feature
Dim nTmpGRP As Integer = CalcBeamPrivateProfileGRP(Feature.nSelGRP)
LoadStrategyListFromTopology(Feature.nFeatureId, Feature.nPRC, nTmpGRP)
' leggo eventuali parametri forzati
Dim sStrategyID As String = ""
EgtGetInfo(m_CurrentFeature.nFeatureId, "STRATEGY", sStrategyID)
If String.IsNullOrWhiteSpace(sStrategyID) Then Return
Dim ForcedStrategy As Strategy = m_StrategyList.FirstOrDefault(Function(x) x.sStrategyId = sStrategyID)
If IsNothing(ForcedStrategy) Then
Else
SelStrategy = ForcedStrategy
For Each Param In SelStrategy.ParameterList
Select Case Param.GetType()
Case GetType(BooleanStrategyParameter)
Dim bValue As Boolean = False
EgtGetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, bValue)
DirectCast(Param, BooleanStrategyParameter).SetValue(bValue)
Case GetType(DoubleStrategyParameter)
Dim dValue As Double = 0
EgtGetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, dValue)
DirectCast(Param, DoubleStrategyParameter).SetValue(dValue)
Case GetType(ComboStrategyParameter)
Dim sValue As String = String.Empty
EgtGetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, sValue)
Dim ComboStrategyParameter As ComboStrategyParameter = DirectCast(Param, ComboStrategyParameter)
Dim SelCombo = ComboStrategyParameter.ComboList.FirstOrDefault(Function(x) x.sValue = sValue)
ComboStrategyParameter.SelValue = SelCombo
Case GetType(StringStrategyParameter)
Dim sValue As String = String.Empty
EgtGetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, sValue)
DirectCast(Param, StringStrategyParameter).SetValue(sValue)
Case GetType(ListStrategyParameter)
Dim sValue As String = String.Empty
EgtGetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, sValue)
Dim ListStrategyParameter As ListStrategyParameter = DirectCast(Param, ListStrategyParameter)
Dim SelValue As ToolParameter = Nothing
Dim sTrimValue As String = sValue.TrimEnd(";"c)
Dim sTmpValue As String() = sTrimValue.Split(";"c)
Dim sSplitValue As String() = Nothing
For Each ItemValue As String In sTmpValue
sSplitValue = ItemValue.Split(","c)
For Each ItemTool As ToolParameter In ListStrategyParameter.ListValue
If sSplitValue(0) = ItemTool.sUUID AndAlso sSplitValue(1) = ItemTool.sName Then
ItemTool.bIsActive = True
SelValue = ListStrategyParameter.ListValue.FirstOrDefault(Function(x) x.sName = ItemTool.sName AndAlso x.sUUID = ItemTool.sUUID)
End If
Next
Next
ListStrategyParameter.SelValue = SelValue
End Select
Next
End If
End Sub
Friend Function LoadStrategyListFromTopology(nFeatureId As Integer, nPRC As Integer, nGRP As Integer) As Boolean
m_StrategyList.Clear()
Dim sTopologyName As String = "Feature"
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(ProjectManagerVM.CurrProd.nType)
Dim sAvailableStrategiesFilePath As String = sStrategiesDirPath & "\" & AVAILABLESTRATEGYLIST_FILE & ".json"
Dim sReadedFile As String = String.Empty
' carico default
If File.Exists(sAvailableStrategiesFilePath) Then
sReadedFile = File.ReadAllText(sAvailableStrategiesFilePath)
Dim JsonStrategyFeatureList As List(Of JsonAvailableStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonAvailableStrategyFeature))(sReadedFile)
'nGRP = CalcBeamPrivateProfileGRP(nGRP)
Dim JsonAvailableStrategyFeature As JsonAvailableStrategyFeature = JsonStrategyFeatureList.FirstOrDefault(Function(x) x.nGrp = nGRP AndAlso x.nPrc = nPRC)
If IsNothing(JsonAvailableStrategyFeature) Then Return False
Dim JsonAvailableTopology As JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
If IsNothing(JsonAvailableTopology) Then
' ricavo topologia da feature
FindTopologyFromFeature(nFeatureId, sTopologyName)
JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
End If
If IsNothing(JsonAvailableTopology) Then Return False
m_StrategyList = New ObservableCollection(Of Strategy)((From JsonAvailableStrategy In JsonAvailableTopology.StrategyList
Select JsonAvailableStrategy.Deserialize(ProjectManagerVM.CurrProd.nType, -1)).ToList())
End If
If File.Exists(sAvailableStrategiesFilePath) Then
sReadedFile = File.ReadAllText(sAvailableStrategiesFilePath)
Dim JsonStrategyFeatureList As List(Of JsonAvailableStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonAvailableStrategyFeature))(sReadedFile)
'nGRP = CalcBeamPrivateProfileGRP(nGRP)
Dim JsonAvailableStrategyFeature As JsonAvailableStrategyFeature = JsonStrategyFeatureList.FirstOrDefault(Function(x) x.nGrp = nGRP AndAlso x.nPrc = nPRC)
If IsNothing(JsonAvailableStrategyFeature) Then Return False
Dim JsonAvailableTopology As JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
If IsNothing(JsonAvailableTopology) Then
' ricavo topologia da feature
FindTopologyFromFeature(nFeatureId, sTopologyName)
JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
End If
If IsNothing(JsonAvailableTopology) Then Return False
m_StrategyList = New ObservableCollection(Of Strategy)((From JsonAvailableStrategy In JsonAvailableTopology.StrategyList
Select JsonAvailableStrategy.Deserialize(ProjectManagerVM.CurrProd.nType, -1)).ToList())
End If
' recupero custom
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nFeatureId))
Dim nPartProjId As Integer = 0
If Not EgtGetInfo(nPartId, PROJ, nPartProjId) OrElse nPartProjId <= 0 Then Return False
Dim nBTLInfoLayerId As Integer = GetCurrProjBtlInfoLayerId(nPartProjId)
Dim sStrategySetupName As String = ""
EgtGetInfo(nBTLInfoLayerId, "AISETUP", sStrategySetupName)
If Not String.IsNullOrWhiteSpace(sStrategySetupName) Then
' carico custom
Dim sAISetupDirPath As String = Map.refMainWindowVM.MainWindowM.GetAISetupDirPath(ProjectManagerVM.CurrProd.nType, True)
Dim sStrategyConfigurationFilePath As String = sAISetupDirPath & "\" & sStrategySetupName & ".json"
If File.Exists(sStrategyConfigurationFilePath) Then
sReadedFile = File.ReadAllText(sStrategyConfigurationFilePath)
Dim JsonRoot As CustomJsonRoot = Nothing
Try
JsonRoot = JsonConvert.DeserializeObject(Of CustomJsonRoot)(sReadedFile)
Catch ex As Exception
JsonRoot = Nothing
End Try
Dim JsonFeatureList As ObservableCollection(Of JsonStrategyFeature) = Nothing
If Not IsNothing(JsonRoot) Then
JsonFeatureList = JsonRoot.FEATURE
Else
If IsNothing(JsonRoot) Then
EgtOutLog("JSON ERRATO: Il file Json importato non è nel formato corretto")
If File.Exists(sAvailableStrategiesFilePath) Then
sReadedFile = File.ReadAllText(sAvailableStrategiesFilePath)
Dim JsonStrategyFeatureList As List(Of JsonAvailableStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonAvailableStrategyFeature))(sReadedFile)
'nGRP = CalcBeamPrivateProfileGRP(nGRP)
Dim JsonAvailableStrategyFeature As JsonAvailableStrategyFeature = JsonStrategyFeatureList.FirstOrDefault(Function(x) x.nGrp = nGRP AndAlso x.nPrc = nPRC)
If IsNothing(JsonAvailableStrategyFeature) Then Return False
Dim JsonAvailableTopology As JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
If IsNothing(JsonAvailableTopology) Then
' ricavo topologia da feature
FindTopologyFromFeature(nFeatureId, sTopologyName)
JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
End If
If IsNothing(JsonAvailableTopology) Then Return False
m_StrategyList = New ObservableCollection(Of Strategy)((From JsonAvailableStrategy In JsonAvailableTopology.StrategyList
Select JsonAvailableStrategy.Deserialize(ProjectManagerVM.CurrProd.nType, -1)).ToList())
End If
Return True
Else
JsonFeatureList = JsonConvert.DeserializeObject(Of ObservableCollection(Of JsonStrategyFeature))(sReadedFile)
End If
End If
'Dim JsonStrategyFeatureList As List(Of JsonStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonStrategyFeature))(sReadedFile)
Dim JsonStrategyFeature As JsonStrategyFeature = JsonFeatureList.FirstOrDefault(Function(x) x.nGrp = nGRP AndAlso x.nPrc = nPRC)
If IsNothing(JsonStrategyFeature) Then Return False
Dim JsonTopology As JsonTopology = JsonStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
If IsNothing(JsonTopology) Then Return False
For Each Strategy In JsonTopology.StrategyList
Dim DefaultStrategy As Strategy = m_StrategyList.FirstOrDefault(Function(x) x.sStrategyId = Strategy.sStrategyId)
If IsNothing(DefaultStrategy) Then
' DefaultTopology.StrategyList.Add(New Strategy(DefaultTopology, Strategy))
' verifico indici!!
Else
DefaultStrategy.ReadConfiguration(Strategy)
End If
Next
End If
End If
' aggiungo strategia automatica
m_StrategyList.Insert(0, New Strategy() With {.sStrategyId = AUTOMATICSTRATEGYID, .sStrategyName = AUTOMATICSTRATEGYID})
If Map.refMainMenuVM.UnlockAllIsChecked Then
Map.refMainMenuVM.UnlockAll(m_StrategyList)
ElseIf Map.refMainMenuVM.UserAdmin_IsChecked Then
Map.refMainMenuVM.ShowParam(m_StrategyList)
End If
NotifyPropertyChanged(NameOf(StrategyList))
Return True
End Function
Friend Sub GetDefaultJsonStrategy(sStrategiesDirPath As String, sAvailableStrategiesFilePath As String, sTopologyName As String, nFeatureId As Integer, nPRC As Integer, nGRP As Integer)
If File.Exists(sAvailableStrategiesFilePath) Then
Dim sReadedFile As String = File.ReadAllText(sAvailableStrategiesFilePath)
Dim JsonStrategyFeatureList As List(Of JsonAvailableStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonAvailableStrategyFeature))(sReadedFile)
'nGRP = CalcBeamPrivateProfileGRP(nGRP)
Dim JsonAvailableStrategyFeature As JsonAvailableStrategyFeature = JsonStrategyFeatureList.FirstOrDefault(Function(x) x.nGrp = nGRP AndAlso x.nPrc = nPRC)
If IsNothing(JsonAvailableStrategyFeature) Then Return
Dim JsonAvailableTopology As JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
If IsNothing(JsonAvailableTopology) Then
' ricavo topologia da feature
FindTopologyFromFeature(nFeatureId, sTopologyName)
JsonAvailableTopology = JsonAvailableStrategyFeature.TopologyList.FirstOrDefault(Function(x) x.sName = sTopologyName)
End If
If IsNothing(JsonAvailableTopology) Then Return
m_StrategyList = New ObservableCollection(Of Strategy)((From JsonAvailableStrategy In JsonAvailableTopology.StrategyList
Select JsonAvailableStrategy.Deserialize(ProjectManagerVM.CurrProd.nType, -1)).ToList())
End If
End Sub
Friend Function GetCurrProjBtlInfoLayerId(nProjId As Integer) As Integer
' 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 = nProjId Then
Return nBTLInfoLayerId
End If
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
End While
Return -1
End Function
Friend Sub ForcedStrategy()
' cancello precedenti valori
Dim sPrecStrategyID As String = ""
EgtGetInfo(m_CurrentFeature.nFeatureId, "STRATEGY", sPrecStrategyID)
If Not String.IsNullOrWhiteSpace(sPrecStrategyID) Then
Dim PrecInfo As String() = {}
EgtGetAllInfo(m_CurrentFeature.nFeatureId, PrecInfo)
Dim PrecStrategyInfo As String() = PrecInfo.Where(Function(x) x.StartsWith(sPrecStrategyID)).ToArray()
For Each Info In PrecStrategyInfo
EgtRemoveInfo(m_CurrentFeature.nFeatureId, Info.Split("="c)(0))
Next
End If
If Not IsNothing(m_SelStrategy) Then
If m_SelStrategy.sStrategyId = AUTOMATICSTRATEGYID Then
EgtRemoveInfo(m_CurrentFeature.nFeatureId, "STRATEGY")
Else
EgtSetInfo(m_CurrentFeature.nFeatureId, "STRATEGY", SelStrategy.sStrategyId)
Dim sInfo As String = String.Empty
For Each Param In SelStrategy.ParameterList
Select Case Param.GetType()
Case GetType(BooleanStrategyParameter)
EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, DirectCast(Param, BooleanStrategyParameter).bValue)
Case GetType(DoubleStrategyParameter)
EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, DirectCast(Param, DoubleStrategyParameter).sValue)
Case GetType(ComboStrategyParameter)
EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, DirectCast(Param, ComboStrategyParameter).SelValue.sValue)
Case GetType(StringStrategyParameter)
EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, DirectCast(Param, StringStrategyParameter).sValue)
Case GetType(ListStrategyParameter)
For Each Item As ToolParameter In DirectCast(Param, ListStrategyParameter).ListValue
If Item.bIsActive Then
sInfo &= Item.sUUID & "," & Item.sName & ";"
EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, sInfo)
End If
Next
End Select
Next
End If
End If
End Sub
#End Region ' Methods
#Region "COMMANDS"
#Region "Ok_Command"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
'' cancello precedenti valori
'Dim sPrecStrategyID As String = ""
'EgtGetInfo(m_CurrentFeature.nFeatureId, "STRATEGY", sPrecStrategyID)
'If Not String.IsNullOrWhiteSpace(sPrecStrategyID) Then
' Dim PrecInfo As String() = {}
' EgtGetAllInfo(m_CurrentFeature.nFeatureId, PrecInfo)
' Dim PrecStrategyInfo As String() = PrecInfo.Where(Function(x) x.StartsWith(sPrecStrategyID)).ToArray()
' For Each Info In PrecStrategyInfo
' EgtRemoveInfo(m_CurrentFeature.nFeatureId, Info.Split("="c)(0))
' Next
'End If
'If m_SelStrategy.sStrategyId = AUTOMATICSTRATEGYID Then
' EgtRemoveInfo(m_CurrentFeature.nFeatureId, "STRATEGY")
'Else
' EgtSetInfo(m_CurrentFeature.nFeatureId, "STRATEGY", SelStrategy.sStrategyId)
' Dim sInfo As String = String.Empty
' For Each Param In SelStrategy.ParameterList
' Select Case Param.GetType()
' Case GetType(BooleanStrategyParameter)
' EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, DirectCast(Param, BooleanStrategyParameter).bValue)
' Case GetType(DoubleStrategyParameter)
' EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, DirectCast(Param, DoubleStrategyParameter).sValue)
' Case GetType(ComboStrategyParameter)
' EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, DirectCast(Param, ComboStrategyParameter).SelValue.sValue)
' Case GetType(StringStrategyParameter)
' EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, DirectCast(Param, StringStrategyParameter).sValue)
' Case GetType(ListStrategyParameter)
' For Each Item As ToolParameter In DirectCast(Param, ListStrategyParameter).ListValue
' If Item.bIsActive Then
' sInfo &= Item.sUUID & "," & Item.sName & ";"
' EgtSetInfo(m_CurrentFeature.nFeatureId, m_SelStrategy.sStrategyId & "_" & Param.sNameNge, sInfo)
' End If
' Next
' End Select
' Next
'End If
ForcedStrategy()
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
' Abilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(True)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(1)
End Sub
#End Region ' Ok_Command
#Region "Cancel_Command"
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
Public Sub Cancel()
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
' Abilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(True)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(1)
End Sub
#End Region ' Cancel_Command
#End Region ' Commands
End Class
@@ -0,0 +1,53 @@
<UserControl x:Class="FreeContourInputV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="32">
<StackPanel>
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Setter Property="Orientation" Value="Horizontal"/>
<Style.Triggers>
<DataTrigger Binding="{Binding FocusTextBox}" Value="True">
<Setter Property="FocusManager.FocusedElement" Value="{Binding ElementName=PropertySearch}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<TextBlock Text="{Binding Message}"
Visibility="{Binding Message_Visibility}"
Style="{StaticResource OptionTextBlock}"/>
<TextBox Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding Text_Visibility}"
Style="{StaticResource FreeContour_TextBox}">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding Done_Command, UpdateSourceTrigger=PropertyChanged}"/>
<KeyBinding Key="S" Modifiers="Control" Command="{Binding Show_Command}"/>
</TextBox.InputBindings>
</TextBox>
<CheckBox Content="{Binding CheckBoxText}"
IsChecked="{Binding IsChecked}"
Visibility="{Binding Check_Visibility}"
Style="{StaticResource FreeContourInput_CheckBox}"/>
<ComboBox ItemsSource="{Binding ComboItemsList}"
SelectedIndex="{Binding ComboSelectedIndex}"
Visibility="{Binding Combo_Visibility}"
Margin="5,0,5,0"/>
<Grid Margin="5,0,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Command="{Binding Show_Command}"
Visibility="{Binding ShowBtn_Visibility}"
Content="{Binding ShowMsg}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
<Button Grid.Column="1"
Command="{Binding Done_Command}"
Visibility="{Binding DoneBtn_Visibility}"
Content="{Binding OkMsg}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
</Grid>
</StackPanel>
</UserControl>
@@ -0,0 +1,3 @@
Public Class FreeContourInputV
End Class
@@ -0,0 +1,335 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Public Class FreeContourInputVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private m_Title As String
Public Property Title As String
Get
Return m_Title
End Get
Set(value As String)
m_Title = value
NotifyPropertyChanged(NameOf(Title))
End Set
End Property
' TextBlock fields
Private m_Message As String
Public Property Message As String
Get
Return m_Message
End Get
Set(value As String)
m_Message = value
NotifyPropertyChanged(NameOf(Message))
End Set
End Property
' TextBox fields
Private m_Text As String
Public Property Text As String
Get
Return m_Text
End Get
Set(value As String)
m_Text = value
'Map.refProjectVM.NotifyInputText(value)
NotifyPropertyChanged(NameOf(Text))
End Set
End Property
Private m_Text_Visibility As Visibility
Public Property Text_Visibility As Visibility
Get
Return m_Text_Visibility
End Get
Set(value As Visibility)
If value <> m_Text_Visibility Then
m_Text_Visibility = value
NotifyPropertyChanged(NameOf(Text_Visibility))
End If
End Set
End Property
Private m_Message_Visibility As Visibility
Public Property Message_Visibility As Visibility
Get
Return m_Message_Visibility
End Get
Set(value As Visibility)
If value <> m_Message_Visibility Then
m_Message_Visibility = value
NotifyPropertyChanged(NameOf(Message_Visibility))
End If
End Set
End Property
Private m_FocusTextBox As Boolean
Public Property FocusTextBox As Boolean
Get
Return m_FocusTextBox
End Get
Set(value As Boolean)
m_FocusTextBox = value
NotifyPropertyChanged(NameOf(FocusTextBox))
End Set
End Property
'CheckBox fields
Private m_CheckBoxText As String
Public Property CheckBoxText As String
Get
Return m_CheckBoxText
End Get
Set(value As String)
m_CheckBoxText = value
NotifyPropertyChanged(NameOf(CheckBoxText))
End Set
End Property
Private m_IsChecked As Boolean = False
Public Property IsChecked As Boolean
Get
Return m_IsChecked
End Get
Set(value As Boolean)
If value <> m_IsChecked Then
Map.refSceneHostVM.MainController.SetLastBoolean(value)
m_IsChecked = value
NotifyPropertyChanged(NameOf(IsChecked))
End If
End Set
End Property
Private m_Check_Visibility As Visibility
Public Property Check_Visibility As Visibility
Get
Return m_Check_Visibility
End Get
Set(value As Visibility)
If value <> m_Check_Visibility Then
m_Check_Visibility = value
NotifyPropertyChanged(NameOf(Check_Visibility))
End If
End Set
End Property
' ComboBox fields
Private m_ComboItemsList As New ObservableCollection(Of String)
Public Property ComboItemsList As ObservableCollection(Of String)
Get
Return m_ComboItemsList
End Get
Set(value As ObservableCollection(Of String))
m_ComboItemsList = value
NotifyPropertyChanged(NameOf(ComboItemsList))
End Set
End Property
Private m_ComboSelectedIndex As Integer
Public Property ComboSelectedIndex As Integer
Get
Return m_ComboSelectedIndex
End Get
Set(value As Integer)
Map.refSceneHostVM.MainController.SetLastInteger(value)
m_ComboSelectedIndex = value
NotifyPropertyChanged(NameOf(ComboSelectedIndex))
End Set
End Property
Private m_Combo_Visibility As Visibility
Public Property Combo_Visibility As Visibility
Get
Return m_Combo_Visibility
End Get
Set(value As Visibility)
If value <> m_Combo_Visibility Then
m_Combo_Visibility = value
NotifyPropertyChanged(NameOf(Combo_Visibility))
End If
End Set
End Property
' Buttons fields
Private m_ShowBtn_Visibility As Visibility
Public Property ShowBtn_Visibility As Visibility
Get
Return m_ShowBtn_Visibility
End Get
Set(value As Visibility)
m_ShowBtn_Visibility = value
NotifyPropertyChanged(NameOf(ShowBtn_Visibility))
End Set
End Property
Private m_DoneBtn_Visibility As Visibility
Public Property DoneBtn_Visibility As Visibility
Get
Return m_DoneBtn_Visibility
End Get
Set(value As Visibility)
m_DoneBtn_Visibility = value
NotifyPropertyChanged(NameOf(DoneBtn_Visibility))
End Set
End Property
' Commands definition
Private m_cmdShow As ICommand
Private m_cmdDone As ICommand
#Region "Messages"
Public ReadOnly Property ShowMsg As String
Get
Return EgtMsg(5364)
End Get
End Property
Public ReadOnly Property OkMsg As String
Get
Return EgtMsg(5365)
End Get
End Property
#End Region
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
' Creo riferimento a questa classe in EgtCAM5Map
Map.SetRefFreeContourInputVM(Me)
' nascondo input box
ResetInputBox()
End Sub
#End Region ' Constructor
#Region "METHODS"
Friend Sub ShowMessage(sTitle As String, sLabel As String)
Title = sTitle
If sLabel <> "" Then
Message = sLabel
Message_Visibility = Visibility.Visible
End If
End Sub
Friend Sub PrepareInputBox(sTitle As String, sLabel As String, sCheckLabel As String,
bShowCombo As Boolean, bShowBtn As Boolean)
Title = sTitle
If sLabel <> "" Then
Message = sLabel
Text = ""
Text_Visibility = Visibility.Visible
Message_Visibility = Visibility.Visible
End If
If bShowCombo Then
ComboItemsList.Clear()
Combo_Visibility = Visibility.Visible
End If
If bShowBtn Then
ShowBtn_Visibility = Visibility.Visible
End If
DoneBtn_Visibility = Visibility.Visible
FocusTextBox = True
End Sub
Friend Sub ResetInputBox()
Title = EgtMsg(5355)
Text_Visibility = Visibility.Collapsed
Message_Visibility = Visibility.Collapsed
Check_Visibility = Visibility.Collapsed
Combo_Visibility = Visibility.Collapsed
ShowBtn_Visibility = Visibility.Collapsed
DoneBtn_Visibility = Visibility.Collapsed
End Sub
Friend Function SetInputBoxText(sVal As String) As Boolean
Text = sVal
FocusTextBox = True
Return True
End Function
Friend Function ChangeInputBoxCheck() As Boolean
IsChecked = Not m_IsChecked
Return True
End Function
Friend Function SetInputBoxCheck(bCheck As Boolean) As Boolean
IsChecked = bCheck
Map.refSceneHostVM.MainController.SetLastBoolean(IsChecked)
Return True
End Function
Friend Function AddInputBoxCombo(sText As String, bSelected As Boolean) As Boolean
ComboItemsList.Add(sText)
If bSelected Then
ComboSelectedIndex = ComboItemsList.Count - 1
End If
Return True
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "Show"
''' <summary>
''' Returns a command that do Point.
''' </summary>
Public ReadOnly Property Show_Command As ICommand
Get
If m_cmdShow Is Nothing Then
m_cmdShow = New Command(AddressOf Show)
End If
Return m_cmdShow
End Get
End Property
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub Show(ByVal param As Object)
Map.refSceneHostVM.MainController.Show(m_Text)
End Sub
#End Region ' Show
#Region "Done"
''' <summary>
''' Returns a command that do Point.
''' </summary>
Public ReadOnly Property Done_Command As ICommand
Get
If m_cmdDone Is Nothing Then
m_cmdDone = New Command(AddressOf Done)
End If
Return m_cmdDone
End Get
End Property
''' <summary>
''' Execute the Point. This method is invoked by the PointCommand.
''' </summary>
Public Sub Done(ByVal param As Object)
If Map.refFreeContourManagerVM.bIsActive AndAlso Map.refFreeContourManagerVM.bIsModifyingTextAngle Then
Map.refFreeContourManagerVM.CloseIsModifyingTextAngle(True)
Else
Map.refSceneHostVM.MainController.Done(m_Text)
End If
End Sub
#End Region ' Done
#End Region ' COMMANDS
End Class
@@ -0,0 +1,66 @@
<StackPanel x:Class="FreeContourManagerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Style="{StaticResource OnlyProdBTLPartManager_StackPanel}">
<ComboBox ItemsSource="{Binding TypeList}"
SelectedIndex="{Binding SelType, Delay=1}"
Style="{StaticResource OnlyProdType_ComboBox}"/>
<ComboBox ItemsSource="{Binding PathList}"
SelectedIndex="{Binding SelPath}"
Visibility="{Binding PathList_Visibility}"
Style="{StaticResource OnlyProdPath_ComboBox}"/>
<Button Command="{Binding Line2P_Command}"
ToolTip="{Binding Line2P_ToolTip}"
IsEnabled="{Binding Line2P_IsEnabled}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/DrawPanel/Line2P.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding Delete_Command}"
ToolTip="{Binding Delete_ToolTip}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/DrawPanel/Delete.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding ModifyCurve_Command}"
ToolTip="{Binding ModifyCurve_ToolTip}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/DrawPanel/ModifyCurve.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding AddPointCurve_Command}"
ToolTip="{Binding AddPointCurve_ToolTip}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/DrawPanel/AddPointCurve.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding RemovePointCurve_Command}"
ToolTip="{Binding RemovePointCurve_ToolTip}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/DrawPanel/RemovePointCurve.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding ChangeStart_Command}"
ToolTip="{Binding ChangeStart_ToolTip}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/DrawPanel/ChangeStart.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding InvertCurve_Command}"
ToolTip="{Binding InvertCurve_ToolTip}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/DrawPanel/InvertCurve.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding Move_Command}"
ToolTip="{Binding Move_ToolTip}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/DrawPanel/Move.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding Rotate_Command}"
ToolTip="{Binding Rotate_ToolTip}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/DrawPanel/Rotate.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding TextAngle_Command}"
ToolTip="{Binding TextAngle_ToolTip}"
Visibility="{Binding TextAngle_Visibility}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/DrawPanel/Text.png" Stretch="Uniform"/>
</Button>
</StackPanel>
@@ -0,0 +1,3 @@
Public Class FreeContourManagerV
End Class
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,40 @@
<EgtWPFLib5:EgtCustomWindow x:Class="GeneralParametersStrategyV"
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:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="True"
IsMinimizable="False"
IsResizable="False"
MinWidth="500"
MinHeight="250"
Height="Auto"
Width="Auto"
TitleBarHeight="30"
Title="GeneralParameters"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<OPTIMIZER:ProjectParametersV Margin="0,10,0,0"/>
<StackPanel Grid.Row="1"
Orientation="Horizontal"
HorizontalAlignment="Right"
Margin="10">
<Button Command="{Binding Ok_Command}"
ToolTip="{Binding SaveAsToolTip}"
Style="{StaticResource SaveStrategy_Button}">
<Image Source="/Resources/NewPage/Ok.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,31 @@
Imports System.Windows.Forms
Public Class GeneralParametersStrategyV
#Region "FIELDS & PROPERTIES"
Private WithEvents m_GeneralParametersStrategyVM As GeneralParametersStrategyVM
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New(Owner As Window, GeneralParametersStrategyVM As GeneralParametersStrategyVM)
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
Me.DataContext = GeneralParametersStrategyVM
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
m_GeneralParametersStrategyVM = GeneralParametersStrategyVM
End Sub
#End Region ' Constructor
#Region "EVENTS"
Private Sub CloseWindow(DialogResult As Boolean) Handles m_GeneralParametersStrategyVM.m_CloseWindow
Me.DialogResult = DialogResult
End Sub
#End Region ' Events
End Class
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,42 @@
<EgtWPFLib5:EgtCustomWindow x:Class="GeneralParametersWnd"
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:OPTIMIZER="clr-namespace:EgtBEAMWALL.Optimizer"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
IsClosable="True"
IsMinimizable="False"
IsResizable="False"
Title="GeneralParametersWnd"
Name="GeneralParametersWnd"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox ItemsSource="{Binding StrategySetupList}"
SelectedItem="{Binding SelStrategySetup, UpdateSourceTrigger=PropertyChanged}"
Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="0,10,0,10"
Style="{StaticResource Strategy_ComboBox}" />
<OPTIMIZER:ProjectParametersV Grid.Row="1" Grid.RowSpan="2" IsEnabled="{Binding GeneralParametersIsEnable}"/>
<UniformGrid Rows="2" Grid.Row="1" Grid.Column="1" Margin="0,0,5,0">
<CheckBox IsChecked="{Binding bSaveGeneralParameters, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Top" HorizontalAlignment="Center" Margin="10,10,0,0"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_CheckBox}"/>
<Button Command="{Binding Ok_Command}" VerticalAlignment="Bottom" Margin="5,0,0,5"
ToolTip="{Binding SaveAsToolTip}"
Style="{StaticResource SaveStrategy_Button}">
<Image Source="/Resources/NewPage/Ok.png" Stretch="Uniform"/>
</Button>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
@@ -0,0 +1,30 @@
Public Class GeneralParametersWnd
#Region "FIELDS & PROPERTIES"
Private WithEvents m_GeneralParametersWndVM As GeneralParametersWndVM
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New(Owner As Window, GeneralParametersWndVM As GeneralParametersWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = GeneralParametersWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_GeneralParametersWndVM = GeneralParametersWndVM
End Sub
#End Region ' Constructor
#Region "EVENTS"
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_GeneralParametersWndVM.m_CloseWindow
Me.DialogResult = bDialogResult
End Sub
#End Region ' Events
End Class

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