Compare commits

...

128 Commits

Author SHA1 Message Date
Demetrio Cassarino 7857588b18 Optimizer 2.7.10.5
-Test nuova datagrid in PParamters da testare
2025-10-29 09:49:28 +01:00
Demetrio Cassarino 9832d6bfd2 Optimizer 2.7.10.4
-aggiornato funzione salvataggio bwe
-aggiornato salvataggio pdf
2025-10-29 08:17:22 +01:00
Demetrio Cassarino 40cc369244 -piccola modifica a pdfhelper 2025-10-27 15:11:35 +01: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
242 changed files with 16390 additions and 8662 deletions
+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}">
+10 -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,7 +393,7 @@ 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
Return String.Empty
@@ -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"
+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
-14
View File
@@ -222,12 +222,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" />
@@ -406,14 +400,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>
+101 -140
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
@@ -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
@@ -45,4 +45,4 @@ Public Class MyMachine
Return True
End Function
End Class
End Class
@@ -98,9 +98,7 @@ Public Class AddFeatureWndVM
NotifyPropertyChanged(NameOf(sDrawPath))
' carico eventuali file Macro
MacroCustomList.Clear()
If Core.Configuration.bOnlyProd Then
MacroDefaultList.Clear()
End If
MacroDefaultList.Clear()
m_MacroFilePathList = New List(Of String)
m_MacroCustomFilePathList = New List(Of String)
If Not IsNothing(nSelPRC) Then
@@ -111,7 +109,7 @@ Public Class AddFeatureWndVM
' ricavo lista file Macro Default
GetMacroListDefault(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
' ricavo lista file Macro Custom
If Core.Configuration.bOnlyProd Then GetMacroListCustom(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
GetMacroListCustom(nGRPFromFileName, nPRCFromFileName, sMacroNameFromFileName, nIdMacroName)
If MacroCustomList.Count > 0 Then
MacroList_IsEnabled = True
Else
@@ -211,39 +209,34 @@ Public Class AddFeatureWndVM
#Region "CONSTRUCTOR"
Sub New()
If Core.Configuration.bOnlyProd Then
' 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))
Else
SelGRPType = 0
nSelPRC = PRCList(0)
End If
' 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
@@ -267,11 +260,7 @@ Public Class AddFeatureWndVM
sMacroNameFromFileName = DataFromFileName(1)
End If
If nGRPFromFileName = CalcBeamPrivateProfileGRP(nSelPRC.nGRP) AndAlso nPRCFromFileName = nSelPRC.nPRC Then
If Core.Configuration.bOnlyProd Then
MacroCustomList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\Template\" & sMacroNameFromFileName & ".png"))
Else
MacroCustomList.Add(New IdNameStruct(nIdMacroName, sMacroNameFromFileName))
End If
MacroCustomList.Add(New NewMacro(nIdMacroName, sMacroNameFromFileName, Map.refMainWindowVM.MainWindowM.sMacroCustomDir & "\Template\" & sMacroNameFromFileName & ".png"))
m_MacroFilePathList.Add(File)
nIdMacroName += 1
End If
@@ -25,7 +25,6 @@
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Margin="5"
ColumnHeaderBackground="{x:Null}"
BindingColumns="{Binding SectXMatColumns}">
<DataGrid.Resources>
<!-- SectionXMaterial -->
@@ -232,7 +232,7 @@ Public Class AddSectionXMaterialWndVM
#End Region ' Cancel
#End Region ' CONSTRUCTOR
#End Region ' COMMANDS
#Region "METHODS"
@@ -5,6 +5,13 @@
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 OnlyProdMainWindowV
' Mostro la View principale
+156 -142
View File
@@ -12,148 +12,162 @@
Title="BTLDataWndV"
Name="BTLDataWndV"
Style="{StaticResource OnlyProd_EgtCustomWindow}">
<UniformGrid Margin="5"
Columns="6" Rows="7">
<TextBlock Text="{Binding PROJNUM_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJNUM, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJPART_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJPART, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding PROJGUID_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sPROJGUID, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding LISTNAME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sLISTNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding CUSTOMER_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sCUSTOMER, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding ARCHITECT_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sARCHITECT, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EDITOR_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEDITOR, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding DELIVDATE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sDELIVDATE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPDATE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPDATE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPTIME_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPTIME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPRELEASE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPRELEASE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding LANGUAGE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sLANGUAGE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding RANGE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocRANGE,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.SelRANGE,
Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource PartParam_ComboBox}"/>
<TextBlock Text="{Binding PROCESSINGQUALITY_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocPROCESSINGQUALITY,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.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 Tag.sCOMPUTERNAME, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding USER_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sUSER, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding SRCFILE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sSRCFILE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding EXPFILE_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding Tag.sEXPFILE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<TextBlock Text="{Binding RECESS_MSG}"
Style="{StaticResource PartParam_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.ocRECESS,
Mode=OneWay}"
SelectedIndex="{Binding RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}},
Path=Tag.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 Tag.sUSERATTRIBUTE, UpdateSourceTrigger=Explicit,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:BTLDataWndV}}}"
Style="{StaticResource PartParam_TextBox}"/>
<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>
<EgtBEAMWALL: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>
</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>
@@ -7,7 +7,6 @@
' This call is required by the designer.
InitializeComponent()
Me.DataContext = BTLDataWndVM
Me.Tag = Map.refProjectVM.BTLStructureVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_BTLDataWndVM = BTLDataWndVM
End Sub
@@ -1,9 +1,442 @@
Imports EgtWPFLib5
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.refOnlyProdManagerVM.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.refOnlyProdManagerVM.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
@@ -134,10 +567,6 @@ Public Class BTLDataWndVM
#End Region ' Messages
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
' Definizione comandi
Private m_cmdOk As ICommand
@@ -145,12 +574,159 @@ Public Class BTLDataWndVM
#Region "CONSTRUCTOR"
Sub New()
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"
@@ -165,6 +741,56 @@ Public Class BTLDataWndVM
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.refOnlyProdManagerVM.Save()
RaiseEvent m_CloseWindow(True)
End Sub
File diff suppressed because it is too large Load Diff
@@ -1,84 +1,49 @@
<StackPanel x:Class="OnlyProdBTLPartManagerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DataContext="{StaticResource BTLPartManagerVM}"
Style="{StaticResource OnlyProdBTLPartManager_StackPanel}">
<Button Command="{Binding CopyPart_Command}"
Visibility="{Binding ViewPage_Visibility}"
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}"
Visibility="{Binding ViewPage_Visibility}"
ToolTip="{Binding RemovePart_ToolTip}"
IsEnabled="{Binding RemovePart_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/RemovePart.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding Simulate_ToolTip}"
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}"
Command="{Binding Edit_Command}"
IsEnabled="{Binding Edit_IsEnabled}"
Visibility="{Binding Edit_Visibility}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/Edit.png" Stretch="Uniform"/>
</Button>
<!--<Button Command="{Binding NewRawPart_Command}"
Visibility="{Binding MachiningPage_Visibility}"
ToolTip="{Binding NewRawPart_ToolTip}"
IsEnabled="{Binding BTLPartManager_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/NewRawPart.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding NewRawPartLast_Command}"
Visibility="{Binding MachiningPage_Visibility}"
ToolTip="{Binding NewRawPartLast_ToolTip}"
IsEnabled="{Binding BTLPartManager_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/NewRawPartAuto.png" Stretch="Uniform"/>
</Button>-->
<!--<Button Command="{Binding AddToRawPart_Command}"
Visibility="{Binding MachiningPage_Visibility}"
ToolTip="{Binding AddToRawPart_ToolTip}"
IsEnabled="{Binding BTLPartManager_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/AddToRawPart.png" Stretch="Uniform"/>
</Button>-->
<!--<Button Command="{Binding Invert_Command}"
Visibility="{Binding ViewPage_Visibility}"
ToolTip="{Binding InvertSx_ToolTip}"
IsEnabled="{Binding RotatePart_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/PartManager/LeftInvert.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding Invert_Command}"
Visibility="{Binding ViewPage_Visibility}"
ToolTip="{Binding InvertDx_ToolTip}"
IsEnabled="{Binding RotatePart_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/PartManager/RightInvert.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding BackRotation_Command}"
Visibility="{Binding ViewPage_Visibility}"
ToolTip="{Binding BackRotation_ToolTip}"
IsEnabled="{Binding RotatePart_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/PartManager/LeftRotate.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding ForwardRotation_Command}"
Visibility="{Binding ViewPage_Visibility}"
ToolTip="{Binding ForwardRotation_ToolTip}"
IsEnabled="{Binding RotatePart_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/PartManager/RightRotate.png" Stretch="Uniform"/>
</Button>-->
<Border x:Class="OnlyProdBTLPartManagerV"
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>
<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>
@@ -1,3 +1,14 @@
Public Class OnlyProdBTLPartManagerV
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 OnlyProdBTLPartManagerV = DirectCast(StackPanel.Parent, OnlyProdBTLPartManagerV)
Dim Popup As Primitives.Popup = DirectCast(OnlyProdBTLPartManagerV.Parent, Primitives.Popup)
If Not IsNothing(Popup) Then
Popup.IsOpen = False
End If
End Sub
End Class
@@ -8,6 +8,8 @@ Imports EgtWPFLib5
Public Class BTLFeatureVM
Inherits Core.BTLFeatureVM
#Region "FIELDS & PROPERTIES"
Public Property GRPList As ObservableCollection(Of Integer)
Get
Return m_BTLFeatureM.GRPList
@@ -167,12 +169,11 @@ Public Class BTLFeatureVM
sPar = Nothing
vParQ = Nothing
m_BTLFeatureM.CalcParamArray(vPar, sPar, vParQ)
'' imposto path disegno da mostrare in BottomPanel
'If value > 0 AndAlso File.Exists(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & "." & sDES & ".png") Then
' Map.refBottomPanelVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & "." & sDES & ".png")
'Else
' Map.refBottomPanelVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & sDescGRP & ".png")
'End If
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
@@ -186,11 +187,8 @@ Public Class BTLFeatureVM
m_BTLFeatureM.nPriority = nTemp
' setto feature da ricalcolare
ResetCalcFeature()
' se in View
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' imposto modificato per copie
MyMachGroupPanelM.SetDuploModified(m_BTLPartM.nPartId)
End If
' imposto modificato per copie
MyMachGroupPanelM.SetDuploModified(m_BTLPartM.nPartId)
End If
End If
NotifyPropertyChanged(NameOf(sPriority))
@@ -215,16 +213,11 @@ Public Class BTLFeatureVM
Set(value As Boolean)
Dim bShowSolid As Boolean = Map.refShowBeamPanelVM.ShowSolid_IsChecked
If value <> m_BTLFeatureM.bDO Then
'If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' ' verifico se solido attivo
' If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
'End If
If EgtBeamEnableProcess(nFeatureId, value, Not m_bDO_MultipleUpdate) Then
m_BTLFeatureM.bDO = value
' setto feature da ricalcolare
ResetCalcFeature()
' se in View
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(m_BTLPartM)) Then
If Not IsNothing(m_BTLPartM) Then
MyMachGroupPanelM.SetDuploModified(m_BTLPartM.nPartId)
End If
NotifyPropertyChanged(NameOf(bDO))
@@ -233,10 +226,6 @@ Public Class BTLFeatureVM
Item.NotifyPropertyChanged(NameOf(Item.sMsg))
Next
End If
'If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' ' eventualmente ripristino solido
' If bShowSolid Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, True, False)
'End If
If Not m_bDO_MultipleUpdate Then EgtDraw()
' aggiorno stato abilitazione del bottone modifica free contour
Map.refFeatureManagerVM.SetEditIsEnabled()
@@ -273,9 +262,9 @@ Public Class BTLFeatureVM
m_SelPBTLParam = value
If Not IsNothing(m_SelPBTLParam) Then
' imposto path disegno da mostrare in BottomPanel
'If Not IsNothing(Map.refBottomPanelVM) Then
' Map.refBottomPanelVM.SetCurrDraw(m_SelPBTLParam.sDrawPath)
'End If
If Not IsNothing(Map.refProjectVM) Then
Map.refPParameterListVM.SetCurrDraw(m_SelPBTLParam.sDrawPath)
End If
End If
NotifyPropertyChanged(NameOf(SelPBTLParam))
End Set
@@ -298,10 +287,6 @@ Public Class BTLFeatureVM
End Get
Set(value As BTLParamVM)
m_SelQParam = value
'If Not IsNothing(m_SelQParam) AndAlso Not IsNothing(Map.refBottomPanelVM) Then
' ' imposto path disegno da mostrare in BottomPanel
' Map.refBottomPanelVM.SetCurrDraw(m_SelQParam.sDrawPath)
'End If
NotifyPropertyChanged(NameOf(SelQBTLParam))
End Set
End Property
@@ -349,6 +334,8 @@ Public Class BTLFeatureVM
Private m_cmdEditFeature As ICommand
Private m_cmdStategyCmd As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(BTLFeatureM As BTLFeatureM, BTLPartM As BTLPartM)
@@ -407,10 +394,10 @@ Public Class BTLFeatureVM
End Sub
' funzione che aggiorna lo stato, la rotazione e gli errori dopo calcolo
Friend Sub CalcFeatureUpdate(ERR As Integer, ROT As Integer, 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)
EgtSetInfo(nFeatureId, If(Map.refMainMenuVM.SelPage = Pages.VIEW, ITG_PROJ_ROT, ITG_PROD_ROT), ROT, True)
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
@@ -622,11 +609,48 @@ Public Class BTLFeatureVM
End Property
Public Sub Strategy()
' disattivo modalita' contorno libero
Map.refProjectVM.SetSelManagerTab(ProjectVM.ManagerTab.STRATEGYMANAGER)
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 ' Cancel
#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
@@ -5,6 +5,8 @@ Imports EgtWPFLib5
Public Class BTLParamVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Protected m_BTLParamM As BTLParamM
Public ReadOnly Property BTLParamM As BTLParamM
Get
@@ -142,7 +144,7 @@ Public Class BTLParamVM
Dim INPROD As Integer = 0
EgtDuploInRawCount(nPartId, INPROD)
' recupero pezzi lavorati da Db
Dim nDoneCnt As Integer = DbControllers.m_ProjController.getCountItemState(ProjectManagerVM.CurrProj.nProjId, nPartId, ItemState.Assigned)
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)
@@ -252,6 +254,8 @@ Public Class BTLParamVM
End Get
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(BTLParamM As BTLParamM, BTLFeatureM As BTLFeatureM)
@@ -266,6 +270,8 @@ Public Class BTLParamVM
#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
@@ -331,4 +337,6 @@ Public Class BTLParamVM
If bDraw Then EgtDraw()
End Sub
#End Region ' METHODS
End Class
+105 -143
View File
@@ -1,10 +1,9 @@
Imports System.Collections.ObjectModel
Imports EgtWPFLib5
Imports EgtUILib
Imports EgtBEAMWALL.Core
Imports System.Collections.Specialized
Imports System.ComponentModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Public Class BTLPartVM
Inherits VMBase
@@ -1525,50 +1524,84 @@ Public Class BTLPartVM
End Get
End Property
Private m_PrevSelBTLFeatureVM As BTLFeatureVM
Public m_SelBTLFeatureVM As BTLFeatureVM
Public Property SelBTLFeatureVM As BTLFeatureVM
Get
Return m_SelBTLFeatureVM
End Get
Set(value As BTLFeatureVM)
If Not IsNothing(m_PrevSelBTLFeatureVM) Then m_PrevSelBTLFeatureVM.DeselGeomFeature()
m_SelBTLFeatureVM = value
'If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART) Then
If Not IsNothing(m_SelBTLFeatureVM) Then
DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).SelGeomFeature()
' deseleziono i parametri
If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
' rinfresco bottoni freecontour
m_SelBTLFeatureVM.RefreshFCMBtnVisibility()
' aggiorno stato abilitazione del bottone modifica free contour
If Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then
Map.refFeatureManagerVM.SetEditIsEnabled()
Map.refFeatureManagerVM.NotifyPropertyChanged(NameOf(Map.refFeatureManagerVM.Priority_Visibility))
End If
' Controlo se nPRC è 900 rendo visibile combobox Variant
If m_SelBTLFeatureVM.nPRC = 900 Then
Map.refFeatureManagerVM.SetVariant_Visibility(Visibility.Visible)
Dim nVariant As Integer = 0
If Integer.TryParse(m_SelBTLFeatureVM.sDES, nVariant) Then
m_SelBTLFeatureVM.nSelVARIANT = nVariant
End If
Else
If Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then Map.refFeatureManagerVM.SetVariant_Visibility(Visibility.Collapsed)
End If
Else
EgtDeselectAll()
End If
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
'End If
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
EgtResetCurrMachGroup()
ResetSearchFound()
m_SelBTLFeatureVM.SelGeomFeature()
m_PrevSelBTLFeatureVM = value
Map.refPParameterListVM.SetCurrDraw(DirectCast(m_SelBTLFeatureVM, BTLFeatureVM).sDrawPath)
' deseleziono i parametri
If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
' rinfresco bottoni freecontour
m_SelBTLFeatureVM.RefreshFCMBtnVisibility()
Map.refStatisticsTimePanelVM.SetViewPage_Visibility(Visibility.Visible)
Map.refStatisticsTimePanelVM.SetMachiningPage_Visibility(Visibility.Collapsed)
' Controlo se nPRC è 900 rendo visibile combobox Variant
If m_SelBTLFeatureVM.nPRC = 900 Then
Map.refFeatureManagerVM.SetVariant_Visibility(Visibility.Visible)
Dim nVariant As Integer = 0
If Integer.TryParse(m_SelBTLFeatureVM.sDES, nVariant) Then
m_SelBTLFeatureVM.nSelVARIANT = nVariant
End If
If m_SelBTLFeatureVM.nSelVARIANT > 0 AndAlso
System.IO.File.Exists(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & m_SelBTLFeatureVM.sDescGRP & "." & m_SelBTLFeatureVM.sDES & ".png") Then
' imposto path disegno da mostrare in BottomPanel
Map.refPParameterListVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & m_SelBTLFeatureVM.sDescGRP & "." & m_SelBTLFeatureVM.sDES & ".png")
Else
Map.refPParameterListVM.SetCurrDraw(Map.refMainWindowVM.MainWindowM.sResourcesRoot & "\Features\" & m_SelBTLFeatureVM.sDescGRP & ".png")
End If
Else
Map.refFeatureManagerVM.SetVariant_Visibility(Visibility.Collapsed)
End If
' Forzo strategia
'Map.refForcedStrategyBTLVM.Init(m_SelBTLFeatureVM.BTLFeatureM)
Map.refForcedStrategyPanelVM.Init(m_SelBTLFeatureVM.BTLFeatureM)
'Else
' EgtDeselectAll()
End If
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
EgtDraw()
NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
' se modalità building, la tolgo
If Not IsNothing(m_SelBTLFeatureVM) AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
Map.refShowBeamPanelVM.SetShowBuilding(False)
End If
End Set
End Property
'Public Property SelBTLFeatureVMOnlyGraph As BTLFeatureVM
' Get
' Return m_SelBTLFeatureVM
' End Get
' Set(value As BTLFeatureVM)
' m_SelBTLFeatureVM = value
' If Not IsNothing(m_SelBTLFeatureVM) Then
' m_SelBTLFeatureVM.SelGeomFeature()
' ' deseleziono i parametri
' If Not IsNothing(SelBTLFeatureVM.SelPBTLParam) Then SelBTLFeatureVM.SelPBTLParam = Nothing
' End If
' If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
' EgtResetCurrMachGroup()
' ResetSearchFound()
' Map.refStatisticsTimePanelVM.SetViewPage_Visibility(Visibility.Visible)
' Map.refStatisticsTimePanelVM.SetMachiningPage_Visibility(Visibility.Collapsed)
' EgtDraw()
' NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
' NotifyPropertyChanged(NameOf(SelBTLFeatureVMOnlyGraph))
' ' se modalità building, la tolgo
' If Not IsNothing(m_SelBTLFeatureVM) AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
' Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
' Map.refShowBeamPanelVM.SetShowBuilding(False)
' End If
' End Set
'End Property
Private m_Calc_PartEnd As Boolean = False
Public ReadOnly Property Calc_PartEnd As Boolean
@@ -1594,7 +1627,7 @@ Public Class BTLPartVM
Public ReadOnly Property Search_Background As SolidColorBrush
Get
Return If(m_bSearchFound AndAlso Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Brushes.Purple, Brushes.Transparent)
Return If(m_bSearchFound, Brushes.Purple, Brushes.Transparent)
End Get
End Property
@@ -1626,6 +1659,33 @@ Public Class BTLPartVM
NotifyPropertyChanged(NameOf(IsSettingBtnOpen))
End Sub
Public Property IsInverted As Boolean
Get
Return BTLPartM.nINVERTED = 180
End Get
Set(value As Boolean)
' eseguo inversione
m_BTLPartM.Inversion(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
' setto part e tutte le feature da ricalcolare
ResetCalcTotalPart()
EgtDraw()
' imposto lock
bLockInversion = True
NotifyPropertyChanged(NameOf(IsInverted))
End Set
End Property
Private m_IsRowEnabled As Boolean = True
Public ReadOnly Property IsRowEnabled As Boolean
Get
Return m_IsRowEnabled
End Get
End Property
Friend Sub SetIsRowEnabled(bIsRowEnabled As Boolean)
m_IsRowEnabled = bIsRowEnabled
NotifyPropertyChanged(NameOf(IsRowEnabled))
End Sub
' Definizione comandi
Private m_cmdInvert As ICommand
Private m_cmdBackRotation As ICommand
@@ -1688,6 +1748,7 @@ Public Class BTLPartVM
' Aggiorno stato da stati feature
CalcGlobalUpdate()
NotifyPropertyChanged(NameOf(CALC_FALL_Visibility))
NotifyPropertyChanged(NameOf(IsInverted))
End Sub
Private Function FeatureFilter(Feature As Object) As Boolean
@@ -2230,16 +2291,9 @@ Public Class BTLPartVM
' .FullOpen = True,
' .Color = Col.ToColor()
'}
Dim ColorDlg As Object
If bOnlyProd Then
ColorDlg = New OnlyProdEgtColorPickerV(Application.Current.MainWindow, New EgtColorPickerVM()) With {
.Color = Col.ToColor()
}
Else
ColorDlg = New EgtColorPickerV(Application.Current.MainWindow, New EgtColorPickerVM()) With {
.Color = Col.ToColor()
}
End If
Dim ColorDlg As New OnlyProdEgtColorPickerV(Application.Current.MainWindow, New EgtColorPickerVM()) With {
.Color = Col.ToColor()
}
' Visualizzo dialogo
If ColorDlg.ShowDialog() <> Forms.DialogResult.OK Then Return False
' Recupero colore scelto
@@ -2288,102 +2342,9 @@ Public Class BTLPartVM
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Verify()
If ((IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
Dim ProjType As BWType
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
ProjType = ProjectManagerVM.CurrProd.nType
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
If Not CreateBarToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refOnlyProdManagerVM.CurrProj.sProjDirPath, 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, Map.refOnlyProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
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 = Map.refMachinePanelVM.SelectedMachine.Name,
.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)
If IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Return
Map.refCALCPanelVM.Verify(ProjectType.PROJ)
Return
End Sub
#End Region ' Verify
@@ -2567,7 +2528,7 @@ Public Class BTLPartVM
nRawId = EgtGetFirstRawPart()
End While
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
If Not ExecBeam(sLogPath, ProjectManagerVM.CurrProd.sMachine, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallito inserimento grezzo nella barra in AddPartToBeam")
' elimino duplo
For Each nDuploId In nPartDuploIdList
@@ -2589,7 +2550,7 @@ Public Class BTLPartVM
EgtRemoveRawPart(nRawId)
nRawId = EgtGetFirstRawPart()
End While
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
If Not ExecBeam(sLogPath, ProjectManagerVM.CurrProd.sMachine, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallita esecuzione ExecBeam. ERRORE")
End If
End If
@@ -2742,6 +2703,7 @@ Public Class BTLPartVM
CalcGlobalUpdate(True)
' imposto path disegno da mostrare in BottomPanel
Dim SelPBTLParam As BTLParamVM = Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.SelPBTLParam
If Not IsNothing(Map.refProjectVM) AndAlso Not IsNothing(SelPBTLParam) Then Map.refPParameterListVM.SetCurrDraw(SelPBTLParam.sDrawPath)
Case NameOf(sender.bDO), NameOf(sender.sPriority)
NotifyPropertyChanged(NameOf(bDOALL))
' setto pezzo da ricalcolare
@@ -2761,6 +2723,6 @@ Public Class BTLPartVM
End Select
End Sub
#End Region
#End Region ' EVENTS
End Class
File diff suppressed because it is too large Load Diff
@@ -52,6 +52,8 @@ Public Class BlockedWndVM
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
If DbControllers.bNetwork Then
m_Buttons_Visibility = Visibility.Visible
@@ -69,6 +71,10 @@ Public Class BlockedWndVM
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
@@ -102,6 +108,8 @@ Public Class BlockedWndVM
End If
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "Save"
+176 -427
View File
@@ -1,13 +1,18 @@
Imports System.IO
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Threading
Imports System.Windows.Threading
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Imports System.Collections.ObjectModel
Imports System.Windows.Threading
Imports EgwMultiEngineManager.Data
Imports EgwMultiEngineManager.Data.Constants
Public Class CALCPanelVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Public Enum ProduceType As Integer
NULL = 0
PRODUCE = 1
@@ -35,16 +40,6 @@ Public Class CALCPanelVM
End Set
End Property
'Private m_CALCPanel_IsEnabled As Boolean = True
'Public Property CALCPanel_IsEnabled As Boolean
' Get
' Return m_CALCPanel_IsEnabled
' End Get
' Set(value As Boolean)
' m_CALCPanel_IsEnabled = value
' End Set
'End Property
'Private m_VerifyAll_IsEnabled As Boolean = True
'Public Property VerifyAll_IsEnabled As Boolean
' Get
@@ -110,80 +105,12 @@ Public Class CALCPanelVM
End Set
End Property
'Public ReadOnly Property ViewPage_Visibility As Visibility
' Get
' Return If(Map.refMainMenuVM.SelPage = Pages.VIEW, Visibility.Visible, Visibility.Collapsed)
' End Get
'End Property
'Public ReadOnly Property Edit_Visibility As Visibility
' Get
' Return If(Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso GetMainPrivateProfileInt(S_GENERAL, K_ENABLEEDIT, 0) = 1, Visibility.Visible, Visibility.Collapsed)
' End Get
'End Property
'Public ReadOnly Property Verify_IsEnabled As Boolean
' Get
' Return If(Map.refMainMenuVM.SelPage = Pages.VIEW,
' m_CALCPanel_IsEnabled AndAlso Not Map.refShowBeamPanelVM.bShowAll AndAlso
' Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt > 1,
' m_CALCPanel_IsEnabled)
' End Get
'End Property
'Public ReadOnly Property Simulate_IsEnabled As Boolean
' Get
' Return If(Map.refMainMenuVM.SelPage = Pages.VIEW,
' m_CALCPanel_IsEnabled And Not Map.refShowBeamPanelVM.bShowAll AndAlso
' Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt > 1,
' m_CALCPanel_IsEnabled)
' End Get
'End Property
'Public ReadOnly Property Edit_IsEnabled As Boolean
' Get
' Return If(Map.refMainMenuVM.SelPage = Pages.VIEW,
' m_CALCPanel_IsEnabled And Not Map.refShowBeamPanelVM.bShowAll AndAlso
' Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Not Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt > 1,
' True)
' End Get
'End Property
' Definizione comandi
'Private m_cmdVerify As ICommand
'Private m_cmdVerifyAll As ICommand
'Private m_cmdResetCalc As ICommand
'Private m_cmdSimulate As ICommand
'Private m_cmdEdit As ICommand
Private m_cmdChooseMachine As ICommand
Private m_cmdOk As ICommand
#Region "Messages"
'Public ReadOnly Property Verify_ToolTip As String
' Get
' Return EgtMsg(61901)
' End Get
'End Property
'Public ReadOnly Property VerifyAll_ToolTip As String
' Get
' Return EgtMsg(61928)
' 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)
@@ -198,6 +125,8 @@ Public Class CALCPanelVM
#End Region ' Messages
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTORS"
Sub New()
@@ -215,28 +144,6 @@ Public Class CALCPanelVM
#Region "METHODS"
Friend Sub SetCalcPanelIsEnabled(bIsEnabled As Boolean)
'm_CALCPanel_IsEnabled = bIsEnabled
'm_VerifyAll_IsEnabled = bIsEnabled
'NotifyPropertyChanged(NameOf(CALCPanel_IsEnabled))
'NotifyPropertyChanged(NameOf(VerifyAll_IsEnabled))
'NotifyPropertyChanged(NameOf(Verify_IsEnabled))
'NotifyPropertyChanged(NameOf(Simulate_IsEnabled))
'NotifyPropertyChanged(NameOf(Edit_IsEnabled))
End Sub
Friend Sub SetIsEnabledForSelPart()
'NotifyPropertyChanged(NameOf(Verify_IsEnabled))
'm_VerifyAll_IsEnabled = False
'NotifyPropertyChanged(NameOf(VerifyAll_IsEnabled))
'NotifyPropertyChanged(NameOf(Simulate_IsEnabled))
'NotifyPropertyChanged(NameOf(Edit_IsEnabled))
End Sub
Friend Sub SetVerifyIsEnabled(bIsEnabled As Boolean)
'm_CALCPanel_IsEnabled = bIsEnabled
'NotifyPropertyChanged(NameOf(CALCPanel_IsEnabled))
'NotifyPropertyChanged(NameOf(Verify_IsEnabled))
End Sub
Private Sub Calc_ProcessResult(sender As Object, e As CalcResultEventArgs)
ProcessResults(e.m_Result)
End Sub
@@ -251,11 +158,6 @@ Public Class CALCPanelVM
End If
' se verify o verifyall, salvo il progetto per conservarne gli stati calcolati
If e.CmdType = CmdTypes.CHECKGEN Then
'If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' Map.refProjManagerVM.Save()
'ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
' Map.refProdManagerVM.Save()
'End If
Map.refOnlyProdManagerVM.Save()
End If
' se modalita' assemblato attiva
@@ -304,7 +206,7 @@ Public Class CALCPanelVM
ProcessResults(Bar.sBarPath, Bar.nProgramPage, Bar.nBarId)
End Sub
Private Shared Sub ProcessResults(BtlPath As String, nProgramPage As ProjectType, nBarId As Integer)
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
@@ -466,7 +368,7 @@ Public Class CALCPanelVM
CurrPartVM.CalcPartUpdate(Line.nERR, Line.dROT, Line.sMSG)
End If
Case ProcessResult.ProcessResultTypes.TASKID
CurrBTLFeatureVM.CalcFeatureUpdate(Line.nERR, Line.dROT, Line.sMSG)
CurrBTLFeatureVM.CalcFeatureUpdate(nProgramPage, Line.nERR, Line.dROT, Line.sMSG)
Case ProcessResult.ProcessResultTypes.FALL
If nProgramPage = ProjectType.PROJ Then
CurrBTLPartVM.CalcFallUpdate(Line.nFALL)
@@ -634,54 +536,123 @@ Public Class CALCPanelVM
'NotifyPropertyChanged(NameOf(Edit_IsEnabled))
End Sub
#End Region ' METHODS
#Region "COMMANDS"
'#Region "Verify"
' ''' <summary>
' ''' Returns a command that do Open.
' ''' </summary>
' Public ReadOnly Property Verify_Command As ICommand
' Get
' If m_cmdVerify Is Nothing Then
' m_cmdVerify = New Command(AddressOf Verify)
' End If
' Return m_cmdVerify
' End Get
' End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Verify()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
Dim ProjType As BWType
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 Map.refMainMenuVM.SelPage = Pages.VIEW Then
ProjType = ProjectManagerVM.CurrProj.nType
If Not CreateBarToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
ProjType = ProjectManagerVM.CurrProd.nType
If Not CreateBarToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
ProjType = ProjectManagerVM.CurrProd.nType
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, Map.refOnlyProdManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
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, Map.refOnlyProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
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
@@ -694,7 +665,7 @@ Public Class CALCPanelVM
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = Map.refMachinePanelVM.SelectedMachine.Name,
.nMachineName = ProjectManagerVM.CurrProd.sMachine,
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
Select Case Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
@@ -768,54 +739,49 @@ Public Class CALCPanelVM
Map.refMyStatusBarVM.SetOutputMessage(sProgress)
End Sub
'#End Region ' Verify
'#Region "VerifyAll"
' ''' <summary>
' ''' Returns a command that do Open.
' ''' </summary>
' Public ReadOnly Property VerifyAll_Command As ICommand
' Get
' If m_cmdVerifyAll Is Nothing Then
' m_cmdVerifyAll = New Command(AddressOf VerifyAll)
' End If
' Return m_cmdVerifyAll
' End Get
' End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub VerifyAll()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
Dim ProjType As BWType
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
ProjType = ProjectManagerVM.CurrProj.nType
If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
ProjType = ProjectManagerVM.CurrProd.nType
If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
ProjType = ProjectManagerVM.CurrProd.nType
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.CurrProj.sProjDirPath, AddressOf ManageCalc)
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
@@ -829,7 +795,7 @@ Public Class CALCPanelVM
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = Map.refMachinePanelVM.SelectedMachine.Name,
.nMachineName = ProjectManagerVM.CurrProd.sMachine,
.nGlobState = CurrPart.nGlobalState}
Select Case CurrPart.nGlobalState
Case Core.CalcStates.OK, CalcStates.INFO
@@ -880,223 +846,12 @@ Public Class CALCPanelVM
Return True
End Function
'#End Region ' VerifyAll
#End Region ' METHODS
'#Region "ResetCalc"
' ''' <summary>
' ''' Returns a command that do Exec.
' ''' </summary>
' 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
' ''' <summary>
' ''' Execute the Exec. This method is invoked by the ExecCommand.
' ''' </summary>
' Public Sub ResetCalc()
' If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
' (Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
' (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
' If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST)) Then
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
' For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
' If Part.nGlobalState <> CalcStates.NOTCALCULATED Then
' ' resetto stato dei calcoli
' Part.ResetCalcTotalPart()
' End If
' Next
' ElseIf Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt > 1 Then
' Else
' Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
' If IsNothing(SelPart) Then Return
' If SelPart.nGlobalState <> CalcStates.NOTCALCULATED Then
' SelPart.ResetCalcTotalPart()
' End If
' End If
' ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP) Then
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
' For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
' If MachGroup.nProduction_State >= ItemState.Assigned Then Continue For
' If MachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
' MachGroup.ResetCalcTotalMachGroup()
' End If
' Next
' Else
' Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
' If IsNothing(SelMachGroup) Then Return
' ' se barra gia' assegnata a supervisore, esco
' If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
' If SelMachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
' SelMachGroup.ResetCalcTotalMachGroup()
' End If
' End If
' End If
' End Sub
'#End Region ' ResetCalc
'#Region "Simulate"
' ''' <summary>
' ''' Returns a command that do Open.
' ''' </summary>
' 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
' ''' <summary>
' ''' Execute the Open. This method is invoked by the OpenCommand.
' ''' </summary>
' Friend Sub Simulate()
' If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
' (Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
' (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (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
' If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' ProjType = ProjectManagerVM.CurrProj.nType
' If Not CreateBarToSimulate(Pages.VIEW, ProjType, BarList) Then Return
' ' lancio simulazione
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
' ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
' ProjType = ProjectManagerVM.CurrProd.nType
' If Not CreateBarToSimulate(Pages.MACHINING, ProjType, BarList) Then Return
' ' lancio simulazione
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
' ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' ProjType = Map.refOnlyProdManagerVM.CurrProd.nType
' If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
' If Not CreateBarToSimulate(Pages.VIEW, ProjType, BarList) Then Return
' ' lancio simulazione
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
' ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
' If Not CreateBarToSimulate(Pages.MACHINING, ProjType, BarList) Then Return
' ' lancio simulazione
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
' End If
' End If
' End Sub
' Private Function CreateBarToSimulate(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
' Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
' .nProgramPage = ProjectType.PROJ,
' .nProjType = ProjType,
' .bBarOk = True,
' .nMachineName = Map.refMachinePanelVM.SelectedMachine.Name,
' .nCmdType = CalcIntegration.CmdTypes.SIMULATE,
' .nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
' If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED 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
' 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
' 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,
' .nCmdType = CalcIntegration.CmdTypes.SIMULATE,
' .nGlobState = SelMachGroup.nGlobalState}
' If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
' Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
' If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
' End If
' TempBarList(0) = Bar
' BarList = TempBarList
' Else
' Return False
' End If
' ' disabilito interfaccia
' Map.refProjectVM.SetCalcRunning(True)
' End If
' Return True
' End Function
'#End Region ' Simulate
'#Region "Edit"
' ''' <summary>
' ''' Returns a command that do Open.
' ''' </summary>
' 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
' ''' <summary>
' ''' Execute the Open. This method is invoked by the OpenCommand.
' ''' </summary>
' Friend Sub Edit()
' If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) Then Return
' Dim ProjType As BWType
' If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' ProjType = ProjectManagerVM.CurrProj.nType
' Else
' ProjType = ProjectManagerVM.CurrProd.nType
' End If
' Dim BarList() As EgtBEAMWALL.Core.Bar
' If Map.refMainMenuVM.SelPage = Pages.VIEW Then
' If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
' ' salvo il progetto prima di editarlo
' Map.refProjManagerVM.Save()
' 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 = Map.refMachinePanelVM.SelectedMachine.Name,
' .nCmdType = CalcIntegration.CmdTypes.EDIT,
' .nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
' TempBarList(0) = Bar
' BarList = TempBarList
' Else
' Return
' End If
' ' disabilito interfaccia
' Map.refProjectVM.SetCalcRunning(True)
' ' lancio edit
' EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
' End If
' End Sub
'#End Region ' Edit
#Region "COMMANDS"
#Region "ChooseMachine"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property ChooseMachine_Command As ICommand
Get
If m_cmdChooseMachine Is Nothing Then
@@ -1106,12 +861,9 @@ Public Class CALCPanelVM
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
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.CurrProj.nProdId > 0 AndAlso Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then
If ProjectManagerVM.CurrProd.nProjId > 0 Then
MessageBox.Show(EgtMsg(61929), EgtMsg(30009), MessageBoxButton.OK, MessageBoxImage.Exclamation)
Else
SetChooseMachine_Visibility(True)
@@ -1122,9 +874,6 @@ Public Class CALCPanelVM
#Region "Ok"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
@@ -1134,9 +883,6 @@ Public Class CALCPanelVM
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
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
@@ -1147,17 +893,17 @@ Public Class CALCPanelVM
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
'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 OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
If ProjId > 0 Then
' verifico se il pezzo appartiene al ProjId
If nPartProjId = ProjId OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
If nPartProjId = ProjId Then
EgtRemoveInfo(nPartId, ITG_PROJ_ERR)
EgtRemoveInfo(nPartId, ITG_PROJ_MSG)
EgtRemoveInfo(nPartId, ITG_PROJ_ROT)
@@ -1184,9 +930,12 @@ Public Class CALCPanelVM
' 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, If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, ITG_PROJ_MSG, 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, 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
@@ -1195,7 +944,7 @@ Public Class CALCPanelVM
nPartId = EgtGetNextPart(nPartId)
End While
' Se OnlyProdPage rimuovo MachGroup
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then
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)
@@ -4,37 +4,6 @@
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
Style="{StaticResource OnlyProdPartManager_StackPanel}">
<!--<Button ToolTip="{Binding Verify_ToolTip}"
Command="{Binding Verify_Command}"
IsEnabled="{Binding Verify_IsEnabled}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/CALCPanel/Verify.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding VerifyAll_ToolTip}"
Command="{Binding VerifyAll_Command}"
IsEnabled="{Binding VerifyAll_IsEnabled}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/CALCPanel/VerifyAll.png" Stretch="Uniform"/>
</Button>-->
<!--<Button Command="{Binding ResetCalc_Command}"
ToolTip="{Binding ResetCalc_ToolTip}"
IsEnabled="{Binding CALCPanel_IsEnabled}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/CALCPanel/ResetCalc.png" Stretch="Uniform"/>
</Button>-->
<!--<Button ToolTip="{Binding Simulate_ToolTip}"
Command="{Binding Simulate_Command}"
IsEnabled="{Binding Simulate_IsEnabled}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/CALCPanel/Simulate.png" Stretch="Uniform"/>
</Button>-->
<!--<Button ToolTip="{Binding Edit_ToolTip}"
Command="{Binding Edit_Command}"
IsEnabled="{Binding Edit_IsEnabled}"
Visibility="{Binding Edit_Visibility}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/CALCPanel/Edit.png" Stretch="Uniform"/>
</Button>-->
<Button ToolTip="{Binding ChooseMachine_ToolTip}"
Command="{Binding ChooseMachine_Command}"
IsEnabled="{Binding CALCPanel_IsEnabled}"
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:EgtBEAMWALL="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>
<EgtBEAMWALL:OnlyProdPDFEditorV/>
</TabItem.Content>
</TabItem>
</TabControl>
</Grid>
</DockPanel>
@@ -0,0 +1,3 @@
Public Class ConfigurationProgramV
End Class
@@ -1,143 +0,0 @@
<Grid x:Class="OnlyProdCheckVersionV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer">
<Grid.Resources>
<!--<EgtBEAMWALL:IsPermittedConverter x:Key="IsPermittedConverter"/>-->
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Margin="10"
VerticalAlignment="Top"
HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="{Binding ActVersion_Msg}"
VerticalAlignment="Center"
FontSize="15"
FontWeight="Bold"
Margin="10,0,0,0"
Style="{StaticResource OptionTextBlock_OnlyProd}"/>
<TextBlock Text="{Binding ActualVersion}"
VerticalAlignment="Center"
FontSize="15"
FontWeight="Bold"
Margin="10,0,0,0"
Style="{StaticResource OptionTextBlock_OnlyProd}"/>
</StackPanel>
<UniformGrid Grid.Row="1"
Columns="2"
Margin="0,20,0,10">
<Button Content="{Binding AllVersion_Msg}"
Width="180"
Command="{Binding GetAllReleaseCommand}"
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
<Button Content="{Binding VersionFrom_Msg}"
Width="150"
Command="{Binding GetVersionFromCommand}"
Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
</UniformGrid>
<Border Grid.Row="2"
Margin="0,10,10,10"
Visibility="{Binding ProgramVersionListVisibility}"
Style="{StaticResource OnlyProdPage_Border}">
<DataGrid ItemsSource="{Binding ProgramVersionList}"
SelectedItem="{Binding ProgramVersionListItem}"
AutoGenerateColumns="False"
CanUserSortColumns="False"
CanUserResizeColumns="False"
CanUserResizeRows="False"
CanUserReorderColumns="False"
SelectionMode="Single"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
RowStyle="{StaticResource RowDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.ColumnHeaderStyle>
<Style TargetType="{x:Type DataGridColumnHeader}">
<Setter Property="Background" Value="{StaticResource BeamWall_Teal}"/>
<Setter Property="Foreground" Value="{StaticResource BeamWall_White}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="15"/>
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Columns>
<!--Numero Versione-->
<DataGridTemplateColumn Width="170">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.NumVersion_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding VersNum}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Versione-->
<DataGridTemplateColumn Width="110">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Version_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding VersText}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Data di Rilascio-->
<DataGridTemplateColumn Width="160">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.DateVersion_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding ReleaseDate, StringFormat=dd/MM/yyyy}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Stato Versione-->
<DataGridTemplateColumn Width="150">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.StateVersion_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<!--<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource IsPermittedConverter}}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>-->
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Border>
</Grid>
<Border Grid.Column="1"
Margin="0,10,10,10"
Style="{StaticResource OnlyProdPage_Border}">
<!--<WebView:WebView2 Grid.Column="1"
Source="{Binding LinkVersionView}"/>-->
</Border>
</Grid>
@@ -1,3 +0,0 @@
Public Class OnlyProdCheckVersionV
End Class
@@ -5,91 +5,6 @@
xmlns:EgtBEAMWALL="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.Row="0" Grid.Column="0" 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 ParameterQ_Msg}"
FontSize="15"/>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Visibility="{Binding ParameterQ_Visibility}"
Style="{StaticResource SaveOptionPanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALLCORE:OnlyProdQParameter_ConfigurationPageV/>
</TabItem.Content>
</TabItem>-->
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="{Binding Machine_Msg}"
FontSize="15"/>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALLCORE:OnlyProdMachine_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>
<EgtBEAMWALL:OnlyProdPDFEditorV/>
</TabItem.Content>
</TabItem>
<!--<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal" Margin="5">
<TextBlock Text="{Binding CtrlVersion_Msg}"
FontSize="15"/>
</StackPanel>
</TabItem.Header>
<TabItem.Content>
<EgtBEAMWALL:OnlyProdCheckVersionV/>
</TabItem.Content>
</TabItem>-->
</TabControl>
</Grid>
<EgtBEAMWALL:OnlyProdMachinePanelV DataContext="{Binding MachinePanelVM}"/>
</DockPanel>
@@ -0,0 +1,23 @@
<Grid x:Class="OnlyProdMachine_ConfigurationPageV"
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:local="clr-namespace:EgtBEAMWALL.Optimizer"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
<local:OnlyProdMachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
</GroupBox>
</StackPanel>
</Grid>
@@ -0,0 +1,3 @@
Public Class OnlyProdMachine_ConfigurationPageV
End Class
@@ -14,6 +14,21 @@
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
@@ -48,6 +63,9 @@
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\EgtBEAMWALL.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="EgtBEAMWALL.Core">
<HintPath>..\EgtBEAMWALL.Core\bin\Debug\EgtBEAMWALL.Core.dll</HintPath>
@@ -85,9 +103,6 @@
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="Windows">
<HintPath>..\..\..\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22000.0\Windows.winmd</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@@ -122,14 +137,46 @@
<DependentUpon>Application.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="ConfigurationPage\ConfigurationProgramV.xaml.vb">
<DependentUpon>ConfigurationProgramV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\OnlyProdMachine_ConfigurationPageV.xaml.vb">
<DependentUpon>OnlyProdMachine_ConfigurationPageV.xaml</DependentUpon>
</Compile>
<Compile Include="ExecProcessManager\MyExecProcessManager.vb" />
<Compile Include="ForcedStrategyBTL\ForcedStrategyBTLV.xaml.vb">
<DependentUpon>ForcedStrategyBTLV.xaml</DependentUpon>
</Compile>
<Compile Include="ForcedStrategyPanel\ForcedStrategyPanelV.xaml.vb">
<DependentUpon>ForcedStrategyPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="ForcedStrategyPanel\ForcedStrategyPanelVM.vb" />
<Compile Include="GeneralParametersStrategy\GeneralParametersStrategyV.xaml.vb">
<DependentUpon>GeneralParametersStrategyV.xaml</DependentUpon>
</Compile>
<Compile Include="GeneralParametersStrategy\GeneralParametersStrategyVM.vb" />
<Compile Include="GeneralParametersStrategy\GeneralParametersWnd.xaml.vb">
<DependentUpon>GeneralParametersWnd.xaml</DependentUpon>
</Compile>
<Compile Include="GeneralParametersStrategy\GeneralParametersWndVM.vb" />
<Compile Include="GeneralParametersStrategy\JsonGeneralParameters.vb" />
<Compile Include="GeneralParametersStrategy\JsonGenericParametersHelper.vb" />
<Compile Include="GeneralParametersStrategy\JsonParameters.vb" />
<Compile Include="GeneralParametersStrategy\JsonParametersHelper.vb" />
<Compile Include="GeneralParametersStrategy\ProjectParametersV.xaml.vb">
<DependentUpon>ProjectParametersV.xaml</DependentUpon>
</Compile>
<Compile Include="MachinePanel\OnlyProdMachinePanelV.xaml.vb">
<DependentUpon>OnlyProdMachinePanelV.xaml</DependentUpon>
</Compile>
<Compile Include="NestingRunningWnd\NestingRunningWndVM.vb" />
<Compile Include="NestingRunningWnd\OnlyProdNestingRunningWndV.xaml.vb">
<DependentUpon>OnlyProdNestingRunningWndV.xaml</DependentUpon>
</Compile>
<Compile Include="NewOpenProjectFileDialog\NewOpenProjectFileDialogVM.vb" />
<Compile Include="OnlyProdManager\OnlyProdManagerV.vb" />
<Compile Include="OnlyProdManager\OnlyProdManagerV.xaml.vb" />
<Compile Include="OnlyProdManager\OnlyProdManagerVM.vb" />
<Compile Include="OnlyProdProject\OnlyProdProjectV.xaml.vb">
<Compile Include="Project\OnlyProdProjectV.xaml.vb">
<DependentUpon>OnlyProdProjectV.xaml</DependentUpon>
</Compile>
<Compile Include="OpenProjectFileDialog\OpenProjectFileDialogVM.vb" />
@@ -155,9 +202,6 @@
<Compile Include="ProjectTypeWnd\OnlyProdProjectTypeWndV.xaml.vb">
<DependentUpon>OnlyProdProjectTypeWndV.xaml</DependentUpon>
</Compile>
<Compile Include="ProjectTypeWnd\ProjectTypeWndV.xaml.vb">
<DependentUpon>ProjectTypeWndV.xaml</DependentUpon>
</Compile>
<Compile Include="ProjectTypeWnd\ProjectTypeWndVM.vb" />
<Compile Include="Project\ProjectVM.vb" />
<Compile Include="RawPartManager\OnlyProdRawPartManagerV.xaml.vb">
@@ -167,10 +211,23 @@
<Compile Include="RawPartManager\RawPartManagerWndV.xaml.vb">
<DependentUpon>RawPartManagerWndV.xaml</DependentUpon>
</Compile>
<Compile Include="SaveAsStrategyWnd\SaveAsStrategyV.xaml.vb">
<DependentUpon>SaveAsStrategyV.xaml</DependentUpon>
</Compile>
<Compile Include="SaveAsStrategyWnd\SaveAsStrategyVM.vb" />
<Compile Include="SceneHost\MySceneHostVM.vb" />
<Compile Include="SceneHost\SceneHostV.xaml.vb">
<DependentUpon>SceneHostV.xaml</DependentUpon>
</Compile>
<Compile Include="SceneShowBulding\SceneBuildingV.xaml.vb">
<DependentUpon>SceneBuildingV.xaml</DependentUpon>
</Compile>
<Compile Include="SceneShowBulding\SceneBuildingVM.vb" />
<Compile Include="SceneShowBulding\SceneShowBuldingV.xaml.vb">
<DependentUpon>SceneShowBuldingV.xaml</DependentUpon>
</Compile>
<Compile Include="SceneShowBulding\SceneShowBuldingVM.vb" />
<Compile Include="SceneShowBulding\ViewPanelShowBuildingVM.vb" />
<Compile Include="SetUp\SetUpSupportClass.vb" />
<Compile Include="SetUp\SetUpV.xaml.vb">
<DependentUpon>SetUpV.xaml</DependentUpon>
@@ -187,6 +244,9 @@
<DependentUpon>OnlyProdSpecialPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="SpecialPanel\SpecialPanelVM.vb" />
<Compile Include="SplashScreen\SplashScreenV.xaml.vb">
<DependentUpon>SplashScreenV.xaml</DependentUpon>
</Compile>
<Compile Include="StatisticsTimePanel\OnlyProdStatisticsTimePanelV.xaml.vb">
<DependentUpon>OnlyProdStatisticsTimePanelV.xaml</DependentUpon>
</Compile>
@@ -194,6 +254,9 @@
<Compile Include="StatisticsWnd\OptimizerStatisticsWndV.xaml.vb">
<DependentUpon>OptimizerStatisticsWndV.xaml</DependentUpon>
</Compile>
<Compile Include="StatisticsWnd\StatisticsWndV.xaml.vb">
<DependentUpon>StatisticsWndV.xaml</DependentUpon>
</Compile>
<Compile Include="Statistics\OnlyProdOptimizerStatisticsV.xaml.vb">
<DependentUpon>OnlyProdOptimizerStatisticsV.xaml</DependentUpon>
</Compile>
@@ -211,6 +274,24 @@
<Compile Include="StatusBar\StatusBarV.xaml.vb">
<DependentUpon>StatusBarV.xaml</DependentUpon>
</Compile>
<Compile Include="StrategyManager\JsonAvailableStrategyHelper.vb" />
<Compile Include="StrategyManager\JsonStrategyHelper.vb" />
<Compile Include="StrategyManager\ParameterStrategyV.xaml.vb">
<DependentUpon>ParameterStrategyV.xaml</DependentUpon>
</Compile>
<Compile Include="StrategyManager\StrategyManagerV.xaml.vb">
<DependentUpon>StrategyManagerV.xaml</DependentUpon>
</Compile>
<Compile Include="StrategyManager\StrategyManagerVM.vb" />
<Compile Include="StrategyManager\StrategyProductionV.xaml.vb">
<DependentUpon>StrategyProductionV.xaml</DependentUpon>
</Compile>
<Compile Include="StrategyManager\StrategyV.xaml.vb">
<DependentUpon>StrategyV.xaml</DependentUpon>
</Compile>
<Compile Include="StrategyManager\UserAdminV.xaml.vb">
<DependentUpon>UserAdminV.xaml</DependentUpon>
</Compile>
<Compile Include="SupervisorCommThread\SupervisorComm.vb" />
<Compile Include="SupervisorCommThread\SupervisorCommThread.vb" />
<Compile Include="ToolsDbWindow\MyToolDbWindowVM.vb" />
@@ -239,10 +320,13 @@
<Compile Include="Utility\LuaExec.vb" />
<Compile Include="Utility\MachParamIniFile.vb" />
<Compile Include="Utility\Map.vb" />
<Compile Include="Utility\MapV.vb" />
<Compile Include="Utility\MyMachine.vb" />
<Compile Include="Utility\PartsObservableCollection.vb" />
<Compile Include="Utility\SectionXMaterialToBeAdded.vb" />
<Compile Include="Utility\Statistic_Messages.vb" />
<Compile Include="Utility\TextBlockUtils.vb" />
<Compile Include="Utility\TreeHelperManager.vb" />
<Compile Include="Utility\TreeViewItemBase.vb" />
<Compile Include="ViewPanel\OnlyProdViewPanelV.xaml.vb">
<DependentUpon>OnlyProdViewPanelV.xaml</DependentUpon>
@@ -302,9 +386,6 @@
</Compile>
<Compile Include="ChangeParameterWnd\ChangeParameterWndVM.vb" />
<Compile Include="ConfigurationPage\ConfigurationPageVM.vb" />
<Compile Include="ConfigurationPage\OnlyProdCheckVersionV.xaml.vb">
<DependentUpon>OnlyProdCheckVersionV.xaml</DependentUpon>
</Compile>
<Compile Include="ConfigurationPage\OnlyProdConfigurationPageV.xaml.vb">
<DependentUpon>OnlyProdConfigurationPageV.xaml</DependentUpon>
</Compile>
@@ -483,11 +564,15 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ConfigurationPage\OnlyProdCheckVersionV.xaml">
<Page Include="ConfigurationPage\ConfigurationProgramV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ConfigurationPage\OnlyProdConfigurationPageV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ConfigurationPage\OnlyProdConfigurationPageV.xaml">
<Page Include="ConfigurationPage\OnlyProdMachine_ConfigurationPageV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
@@ -499,6 +584,14 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ForcedStrategyBTL\ForcedStrategyBTLV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ForcedStrategyPanel\ForcedStrategyPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="FreeContourInput\OnlyProdFreeContourInputV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -507,6 +600,18 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="GeneralParametersStrategy\GeneralParametersStrategyV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="GeneralParametersStrategy\GeneralParametersWnd.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="GeneralParametersStrategy\ProjectParametersV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="InputPwdWnd\OnlyProdInputPwdWndV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -563,6 +668,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MachinePanel\OnlyProdMachinePanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MacroFeatureWnd\NewMacroFeatureWnd.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -591,7 +700,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="OnlyProdProject\OnlyProdProjectV.xaml">
<Page Include="Project\OnlyProdProjectV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
@@ -615,10 +724,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ProjectTypeWnd\ProjectTypeWndV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="RawPartManager\OnlyProdRawPartManagerV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -627,10 +732,22 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SaveAsStrategyWnd\SaveAsStrategyV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SceneHost\SceneHostV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SceneShowBulding\SceneBuildingV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SceneShowBulding\SceneShowBuldingV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SetUp\SetUpV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -647,6 +764,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SplashScreen\SplashScreenV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StatisticsTimePanel\OnlyProdStatisticsTimePanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -655,6 +776,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="StatisticsWnd\StatisticsWndV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Statistics\OnlyProdOptimizerStatisticsV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -671,6 +796,26 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="StrategyManager\ParameterStrategyV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StrategyManager\StrategyManagerV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StrategyManager\StrategyProductionV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StrategyManager\StrategyV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StrategyManager\UserAdminV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UpdateBTLWnd\OnlyProdUpdateBTLWndV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -876,6 +1021,15 @@
<PackageReference Include="DotNetZip">
<Version>1.16.0</Version>
</PackageReference>
<PackageReference Include="EgwMultiEngineManager.Core">
<Version>2.7.10.1</Version>
</PackageReference>
<PackageReference Include="EgwMultiEngineManager.Data">
<Version>2.7.10.1</Version>
</PackageReference>
<PackageReference Include="EgwWPFBaseLib">
<Version>2.7.10-beta.8</Version>
</PackageReference>
<PackageReference Include="EntityFramework">
<Version>6.4.4</Version>
</PackageReference>
@@ -928,11 +1082,121 @@
<ItemGroup>
<Resource Include="Resources\NewPage\Ok.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\+.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\SaveModify.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\LogoProvaStrategy.png" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 e x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\VerifyIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\AddToRawPartIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\SettingIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\InversionIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\Rotate.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\RotateIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\ProduceRawPartIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\SimulateIntestazione.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\RotateIntestazioneRawPart.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\InversionIntestazioneRawPart.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\Remove.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\MoveDown.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\MoveUp.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\MoveLeft.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\MoveRight.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\Inversion.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\deselectall.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\selectall.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\configuration.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\configurationIsChecked.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\padlock.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\padlock-unlock.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\play.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\add.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\diskette.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\pezzo.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewPage\adjustment.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.OptimizerR32.exe
IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.OptimizerD32.exe
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.OptimizerR64.exe
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.OptimizerD64.exe</PostBuildEvent>
IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.OptimizerD64.exe
IF "$(ConfigurationName)" == "Debug" copy c:\EgtDev\EgtBEAMWALL\EgtBEAMWALL.Optimizer\bin\x86\Debug\EgwMultiEngineManager.Data.dll c:\EgtProg\EgtBEAMWALL\EgwMultiEngineManager.Data.dll
IF "$(ConfigurationName)" == "Release" copy c:\EgtDev\EgtBEAMWALL\EgtBEAMWALL.Optimizer\bin\x86\Release\EgwMultiEngineManager.Data.dll c:\EgtProg\EgtBEAMWALL\EgwMultiEngineManager.Data.dll
IF "$(ConfigurationName)" == "Debug" copy c:\EgtDev\EgtBEAMWALL\EgtBEAMWALL.Optimizer\bin\x86\Debug\EgwMultiEngineManager.Core.dll c:\EgtProg\EgtBEAMWALL\EgwMultiEngineManager.Core.dll
IF "$(ConfigurationName)" == "Release" copy c:\EgtDev\EgtBEAMWALL\EgtBEAMWALL.Optimizer\bin\x86\Release\EgwMultiEngineManager.Core.dll c:\EgtProg\EgtBEAMWALL\EgwMultiEngineManager.Core.dll</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
</Project>
@@ -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
@@ -7,12 +7,6 @@ Public Class FeatureListManagerVM
#Region "FIELDS & PROPERTIES"
Public ReadOnly Property ViewPage_Visibility As Visibility
Get
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
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)
@@ -25,39 +19,43 @@ Public Class FeatureListManagerVM
End Get
End Property
Public ReadOnly Property CopyFeature_IsEnabled As Boolean
Get
Return PartIsSelected AndAlso FeatureIsSelected
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
Return PartIsSelected AndAlso FeatureIsSelected
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.SelBTLPartsCnt > 1
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
Return PartIsSelected AndAlso FeatureIsSelected
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_cmdMacroFeature As ICommand
Private m_cmdAddFeature As ICommand
Private m_cmdRemoveFeature As ICommand
#End Region ' Fields & Properties
#Region "Messages"
Public ReadOnly Property CopyFeature_ToolTip As String
@@ -66,12 +64,6 @@ Public Class FeatureListManagerVM
End Get
End Property
Public ReadOnly Property MacroFeature_ToolTip As String
Get
Return EgtMsg(61909)
End Get
End Property
Public ReadOnly Property AddFeature_ToolTip As String
Get
Return EgtMsg(61910)
@@ -84,9 +76,10 @@ Public Class FeatureListManagerVM
End Get
End Property
#End Region ' Messages
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
@@ -97,17 +90,6 @@ Public Class FeatureListManagerVM
#Region "METHODS"
Friend Sub UpdateView()
NotifyPropertyChanged(NameOf(ViewPage_Visibility))
End Sub
Friend Sub SetLeftPanelIsEnabled(bIsEnabled As Boolean)
NotifyPropertyChanged(NameOf(CopyFeature_IsEnabled))
NotifyPropertyChanged(NameOf(AddFeature_IsEnabled))
NotifyPropertyChanged(NameOf(RemoveFeature_IsEnabled))
NotifyPropertyChanged(NameOf(MacroFeature_IsEnabled))
End Sub
Friend Sub PartShowAllChanged()
NotifyPropertyChanged(NameOf(AddFeature_IsEnabled))
End Sub
@@ -123,7 +105,7 @@ Public Class FeatureListManagerVM
If MacroListCount > 0 AndAlso nSelMacro >= 0 Then
' Creo nuova feature sulla base della Macro selezionata
' Creo table e setto variabili
CreateMacroTable()
CreateMacroTable(AddFeatureWndVM)
Dim bOk As Boolean
If AddFeatureWndVM.nSelMacroDefault >= 0 Then
bOk = EgtLuaExecFile(AddFeatureWndVM.m_MacroCustomFilePathList(nSelMacro))
@@ -167,7 +149,7 @@ Public Class FeatureListManagerVM
End If
End Sub
Private Sub CreateMacroTable()
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
@@ -191,8 +173,8 @@ Public Class FeatureListManagerVM
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)
@@ -205,9 +187,6 @@ Public Class FeatureListManagerVM
#Region "CopyFeature"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property CopyFeature_Command As ICommand
Get
If m_cmdCopyFeature Is Nothing Then
@@ -217,11 +196,7 @@ Public Class FeatureListManagerVM
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub CopyFeature()
If IsNothing(ProjectManagerVM.CurrProj) Then Return
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
If IsNothing(SelPart) Then Return
Dim SelFeature As BTLFeatureVM = SelPart.SelBTLFeatureVM
@@ -237,40 +212,8 @@ Public Class FeatureListManagerVM
#End Region ' CopyFeature
#Region "MacroFeature"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
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
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub MacroFeature()
If IsNothing(ProjectManagerVM.CurrProj) Then Return
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
' apro finestra di creazione macro
Dim MacroFeatureWndVM As New MacroFeatureWndVM()
Dim NewMacroFeatureWnd As New NewMacroFeatureWnd(Application.Current.MainWindow, MacroFeatureWndVM)
If NewMacroFeatureWnd.ShowDialog() Then
End If
End Sub
#End Region ' MacroFeature
#Region "AddFeature"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property AddFeature_Command As ICommand
Get
If m_cmdAddFeature Is Nothing Then
@@ -280,11 +223,7 @@ Public Class FeatureListManagerVM
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub AddFeature(ByVal param As Object)
If IsNothing(ProjectManagerVM.CurrProj) Then Return
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then Return
' apro finestra di definizione nuova feature
Dim AddFeatureWndVM As New AddFeatureWndVM()
@@ -306,9 +245,6 @@ Public Class FeatureListManagerVM
#Region "RemoveFeature"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property RemoveFeature_Command As ICommand
Get
If m_cmdRemoveFeature Is Nothing Then
@@ -318,11 +254,7 @@ Public Class FeatureListManagerVM
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub RemoveFeature()
If IsNothing(ProjectManagerVM.CurrProj) Then Return
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
@@ -10,12 +10,6 @@
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/CopyFeature.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding MacroFeature_Command}"
ToolTip="{Binding MacroFeature_ToolTip}"
IsEnabled="{Binding MacroFeature_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/MacroFeature.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding AddFeature_Command}"
ToolTip="{Binding AddFeature_ToolTip}"
IsEnabled="{Binding AddFeature_IsEnabled}"
@@ -26,7 +20,7 @@
ToolTip="{Binding RemoveFeature_ToolTip}"
IsEnabled="{Binding RemoveFeature_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/RemoveFeature.png" Stretch="Uniform"/>
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
</Button>
</StackPanel>
@@ -1,5 +1,4 @@
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtUILib
Imports EgtWPFLib5
Public Class FeatureManagerVM
@@ -84,8 +83,17 @@ Public Class FeatureManagerVM
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"
@@ -112,4 +120,37 @@ Public Class FeatureManagerVM
#End Region ' METHODS
#Region "COMMANDS"
#Region "MacroFeature"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
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
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
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 NewMacroFeatureWnd As New NewMacroFeatureWnd(Application.Current.MainWindow, MacroFeatureWndVM)
If NewMacroFeatureWnd.ShowDialog() Then
End If
End Sub
#End Region ' MacroFeature
#End Region ' Commands
End Class
@@ -14,6 +14,8 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Expander Header="{Binding Face_Msg}"
@@ -50,21 +52,34 @@
<TextBlock Grid.Column="4"
Text="{Binding Tag.sName, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
Style="{StaticResource OnlyProdFeatureManager_OnlyProd}"/>
<Button Grid.Column="5"
<ComboBox Grid.Column="5"
ItemsSource="{Binding Tag.VARIANTList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
SelectedItem="{Binding Tag.nSelVARIANT, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
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 EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
Visibility="{Binding Tag.Edit_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
IsEnabled="{Binding Edit_IsEnabled}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
<Button Grid.Column="6"
<Button Grid.Column="7"
Content="{Binding Save_Msg}"
Command="{Binding Tag.Save_Command, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
Visibility="{Binding Tag.SaveCancel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
<Button Grid.Column="7"
<Button Grid.Column="8"
Content="{Binding Cancel_Msg}"
Command="{Binding Tag.Cancel_Command, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
Visibility="{Binding Tag.SaveCancel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureManagerV}}}"
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,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,314 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Imports Newtonsoft.Json
Public Class ForcedStrategyBTLVM
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
If Map.refStrategyManagerVM.bOK AndAlso Not IsNothing(m_SelStrategy) Then
For Each Param As StrategyParameter In m_SelStrategy.ParameterList
' Rendo visibili i parametri che hanno sMinUserLevel a 10
SetUserAdmin_IsChecked(True)
Map.refStrategyManagerVM.UserLevelVisibility(Param, Visibility.Visible)
Next
End If
If m_bUserAdmin_IsChecked AndAlso Not IsNothing(m_SelStrategy) Then
Map.refStrategyManagerVM.ShowParamStrategy(m_SelStrategy)
End If
NotifyPropertyChanged(NameOf(SelStrategy))
End Set
End Property
Private m_bUserAdmin_IsChecked As Boolean = False
Public Property UserAdmin_IsChecked As Boolean
Get
Return m_bUserAdmin_IsChecked
End Get
Set(value As Boolean)
m_bUserAdmin_IsChecked = value
Map.refStrategyManagerVM.ShowParamStrategy(m_SelStrategy)
NotifyPropertyChanged(NameOf(UserAdmin_IsChecked))
End Set
End Property
Friend Sub SetUserAdmin_IsChecked(value As Boolean)
m_bUserAdmin_IsChecked = value
NotifyPropertyChanged(NameOf(UserAdmin_IsChecked))
End Sub
Private m_UserFontWeight As FontWeight = FontWeights.Bold
Public ReadOnly Property UserFontWeight As FontWeight
Get
Return m_UserFontWeight
End Get
End Property
Friend Sub SetUserFontWeight(value As FontWeight)
m_UserFontWeight = value
NotifyPropertyChanged(NameOf(UserFontWeight))
End Sub
Private m_AdminFontWeight As FontWeight = FontWeights.Normal
Public ReadOnly Property AdminFontWeight As FontWeight
Get
Return m_AdminFontWeight
End Get
End Property
Friend Sub SetAdminFontWeight(value As FontWeight)
m_AdminFontWeight = value
NotifyPropertyChanged(NameOf(AdminFontWeight))
End Sub
Private m_UnloackImage As String = "pack://application:,,,/Resources/NewPage/padlock.png"
Public ReadOnly Property UnloackImage As String
Get
Return m_UnloackImage
End Get
End Property
Friend Sub SetUnloackImage(value As String)
m_UnloackImage = value
NotifyPropertyChanged(NameOf(UnloackImage))
End Sub
Private m_bUnlockAllIsChecked As Boolean = False
Public Property UnlockAllIsChecked As Boolean
Get
Return m_bUnlockAllIsChecked
End Get
Set(value As Boolean)
m_bUnlockAllIsChecked = value
If m_bUnlockAllIsChecked Then
Map.refStrategyManagerVM.UnlockAll(m_SelStrategy)
SetUnloackImage("pack://application:,,,/Resources/NewPage/padlock-unlock.png")
Else
Map.refStrategyManagerVM.LockAll(m_SelStrategy)
SetUnloackImage("pack://application:,,,/Resources/NewPage/padlock.png")
End If
NotifyPropertyChanged(NameOf(UnlockAllIsChecked))
End Set
End Property
Private m_CurrentFeature As BTLFeatureM
#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.SetRefForcedStrategyBTLVM(Me)
End Sub
#End Region ' Constructor
#Region "METHODS"
Friend Sub Init(Feature As BTLFeatureM)
m_CurrentFeature = Feature
LoadStrategyListFromTopology(Feature.nFeatureId, Feature.nPRC, Feature.nSelGRP)
' 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"
' carico default
Dim sStrategiesDirPath As String = Map.refMainWindowVM.MainWindowM.GetStrategiesDirPath(ProjectManagerVM.CurrProd.nType)
Dim sAvailableStrategiesFilePath As String = sStrategiesDirPath & "\" & AVAILABLESTRATEGYLIST_FILE & ".json"
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 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
Dim sReadedFile As String = File.ReadAllText(sStrategyConfigurationFilePath)
Dim JsonStrategyFeatureList As List(Of JsonStrategyFeature) = JsonConvert.DeserializeObject(Of List(Of JsonStrategyFeature))(sReadedFile)
Dim JsonStrategyFeature As JsonStrategyFeature = JsonStrategyFeatureList.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})
NotifyPropertyChanged(NameOf(StrategyList))
Return True
End Function
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
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,45 @@
<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:Optmizer="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>
<Optmizer: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>
<!--<Button Command="{Binding CloseCommand}"
ToolTip="{Binding SaveAsToolTip}"
Style="{StaticResource SaveStrategy_Button}">
<Image Source="/Resources/PDFEditor/Delete.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:EgtBEAMWALL="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}" />
<EgtBEAMWALL: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
@@ -0,0 +1,256 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows.Forms
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Optimizer.MainMenuVM
Imports EgtUILib
Imports EgtWPFLib5
Imports Newtonsoft.Json
Public Class GeneralParametersWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As Boolean)
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
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)
m_SelStrategySetup = value
NotifyPropertyChanged(NameOf(SelStrategySetup))
End Set
End Property
' Definizione Comandi
Private m_cmdOk_Command As ICommand
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
' 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
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 nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, PROJECTINFO)
Dim sInfo As String = String.Empty
EgtGetInfo(nBTLInfoLayerId, "AISETUP", m_SelStrategySetup)
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(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue) Then
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
DirectCast(GeneralParameter, BooleanGenericParameter).bValue = sTmpBoolValue
Return
End If
Case GetType(DoubleGenericParameter)
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
Dim sTmpDoubleValue As String = DirectCast(GeneralParameter, DoubleGenericParameter).sValue
If Not EgtGetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue) Then
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
DirectCast(GeneralParameter, DoubleGenericParameter).sValue = sTmpDoubleValue
Return
End If
Case GetType(ComboGenericParameter)
SetbSaveGeneralParameters(True)
SetGeneralParametersIsEnable(True)
Dim sTmpComboValue As String = DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue
If Not EgtGetInfo(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(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, StringGenericParameter).sValue) Then
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
DirectCast(GeneralParameter, StringGenericParameter).sValue = sTmpStringValue
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(nBTLInfoLayerId, GeneralParameter.sNameNge, sInfo) Then
SetbSaveGeneralParameters(False)
SetGeneralParametersIsEnable(False)
sInfo = sTmpInfo
Return
End If
End If
Next
End Select
Next
End Sub
#End Region ' Constructor
#Region "COMMANDS"
#Region "Ok_Command"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk_Command Is Nothing Then
m_cmdOk_Command = New Command(AddressOf Ok)
End If
Return m_cmdOk_Command
End Get
End Property
Public Sub Ok()
Dim sInfo As String = String.Empty
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, PROJECTINFO)
If m_bSaveGeneralParameters Then
EgtSetInfo(nBTLInfoLayerId, "AISETUP", m_SelStrategySetup)
For Each GeneralParameter In m_GeneralParametersList
Select Case GeneralParameter.GetType()
Case GetType(BooleanGenericParameter)
EgtSetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, BooleanGenericParameter).bValue)
Case GetType(DoubleGenericParameter)
EgtSetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, DoubleGenericParameter).sValue)
Case GetType(ComboGenericParameter)
EgtSetInfo(nBTLInfoLayerId, GeneralParameter.sNameNge, DirectCast(GeneralParameter, ComboGenericParameter).SelValue.sValue)
Case GetType(StringGenericParameter)
EgtSetInfo(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(nBTLInfoLayerId, GeneralParameter.sNameNge, sInfo)
End If
Next
End Select
Next
Else
EgtRemoveInfo(nBTLInfoLayerId, "AISETUP")
For Each GeneralParameter In m_GeneralParametersList
Select Case GeneralParameter.GetType()
Case GetType(BooleanGenericParameter)
EgtRemoveInfo(nBTLInfoLayerId, GeneralParameter.sNameNge)
Case GetType(DoubleGenericParameter)
EgtRemoveInfo(nBTLInfoLayerId, GeneralParameter.sNameNge)
Case GetType(ComboGenericParameter)
EgtRemoveInfo(nBTLInfoLayerId, GeneralParameter.sNameNge)
Case GetType(StringGenericParameter)
EgtRemoveInfo(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(nBTLInfoLayerId, GeneralParameter.sNameNge)
End If
Next
End Select
Next
End If
Map.refOnlyProdManagerVM.Save()
' Chiudo finestra
RaiseEvent m_CloseWindow(DialogResult.OK)
End Sub
#End Region ' Ok_Command
#End Region ' Commands
End Class
@@ -0,0 +1,203 @@
Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtWPFLib5
Imports Newtonsoft.Json
Imports EgtUILib
Public Class JsonGeneralParameters
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_nGroup As String
Public Property nGroup As String
Get
Return m_nGroup
End Get
Set(value As String)
m_nGroup = value
NotifyPropertyChanged(NameOf(nGroup))
End Set
End Property
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
NotifyPropertyChanged(NameOf(sName))
End Set
End Property
Private m_sNameNge As String
Public Property sNameNge As String
Get
Return m_sNameNge
End Get
Set(value As String)
m_sNameNge = value
NotifyPropertyChanged(NameOf(sNameNge))
End Set
End Property
Private m_sDescriptionShort As String
Public Property sDescriptionShort As String
Get
Return m_sDescriptionShort
End Get
Set(value As String)
m_sDescriptionShort = value
NotifyPropertyChanged(NameOf(sDescriptionShort))
End Set
End Property
Private m_sDescriptionLong As String
Public Property sDescriptionLong As String
Get
Return m_sDescriptionLong
End Get
Set(value As String)
m_sDescriptionLong = value
NotifyPropertyChanged(NameOf(sDescriptionLong))
End Set
End Property
Private m_sValue As String
Public Property sValue As String
Get
Return m_sValue
End Get
Set(value As String)
m_sValue = value
NotifyPropertyChanged(NameOf(sValue))
End Set
End Property
Private m_sType As String
Public Property sType As String
Get
Return m_sType
End Get
Set(value As String)
m_sType = value
NotifyPropertyChanged(NameOf(sType))
End Set
End Property
Private m_Choices As New ObservableCollection(Of JsonDefaultComboParameter)
Public Property Choices As ObservableCollection(Of JsonDefaultComboParameter)
Get
Return m_Choices
End Get
Set(value As ObservableCollection(Of JsonDefaultComboParameter))
m_Choices = value
NotifyPropertyChanged(NameOf(Choices))
End Set
End Property
Private m_sMinUserLevel As Integer
Public Property sMinUserLevel As Integer
Get
Return m_sMinUserLevel
End Get
Set(value As Integer)
m_sMinUserLevel = value
NotifyPropertyChanged(NameOf(sMinUserLevel))
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(nGroup As String, sName As String, sNameNge As String, sValue As String, sDescriptionShort As String, sDescriptionLong As String, sType As String, sMinUserLevel As String)
m_nGroup = nGroup
m_sName = sName
m_sNameNge = sNameNge
m_sValue = sValue
m_sDescriptionShort = sDescriptionShort
m_sDescriptionLong = sDescriptionLong
m_sType = sType
m_sMinUserLevel = sMinUserLevel
End Sub
Sub New(ProjectParameters As ProjectParameters)
m_sName = ProjectParameters.sName
m_sNameNge = ProjectParameters.sNameNge
Select Case ProjectParameters.GetType()
Case GetType(BooleanGenericParameter)
m_sValue = If(DirectCast(ProjectParameters, BooleanGenericParameter).bValue, "true", "false")
Case GetType(DoubleGenericParameter)
m_sValue = DirectCast(ProjectParameters, DoubleGenericParameter).sValue
Case GetType(ComboGenericParameter)
m_sValue = DirectCast(ProjectParameters, ComboGenericParameter).SelValue.sValue
Case GetType(StringGenericParameter)
m_sValue = DirectCast(ProjectParameters, StringGenericParameter).sValue
Case GetType(ListGenericParameter)
m_sValue = DirectCast(ProjectParameters, ListGenericParameter).SelValue.sName
End Select
m_nGroup = ProjectParameters.nGroup
m_sDescriptionShort = ProjectParameters.sDescriptionShort
m_sDescriptionLong = ProjectParameters.sDescriptionLong
m_sMinUserLevel = ProjectParameters.sMinUserLevel
End Sub
#End Region ' Constructor
#Region "METHODS"
Friend Function Deserialize(StrategyType As BWType) As ProjectParameters
Dim ProjectParameters As ProjectParameters = Nothing
Select Case m_sType
Case "b"
ProjectParameters = New BooleanGenericParameter()
DirectCast(ProjectParameters, BooleanGenericParameter).SetValue(m_sValue)
If m_sMinUserLevel = 1 Then
DirectCast(ProjectParameters, BooleanGenericParameter).SetbBooleanVisibility(Visibility.Visible)
End If
Case "d"
ProjectParameters = New DoubleGenericParameter()
DirectCast(ProjectParameters, DoubleGenericParameter).SetValue(m_sValue)
If m_sMinUserLevel = 1 Then
DirectCast(ProjectParameters, DoubleGenericParameter).SetbDoubleVisibility(Visibility.Visible)
End If
Case "combo"
ProjectParameters = New ComboGenericParameter()
For Each Choice In Choices
DirectCast(ProjectParameters, ComboGenericParameter).ComboList.Add(Choice.Deserialize())
Next
DirectCast(ProjectParameters, ComboGenericParameter).SetSelValue(m_sValue)
If m_sMinUserLevel = 1 Then
DirectCast(ProjectParameters, ComboGenericParameter).SetbComboBoxVisibility(Visibility.Visible)
End If
Case "tool"
'ProjectParameters = New ListGenericParameter(m_sSubType)
'DirectCast(ProjectParameters, ListGenericParameter).CreateToolsViews()
'If m_sMinUserLevel = 1 Then
' DirectCast(ProjectParameters, ListGenericParameter).SetbListBoxVisibility(Visibility.Visible)
'End If
Case "s"
ProjectParameters = New StringGenericParameter()
DirectCast(ProjectParameters, StringGenericParameter).SetValue(m_sValue)
If m_sMinUserLevel = 1 Then
DirectCast(ProjectParameters, StringGenericParameter).SetbStringVisibility(Visibility.Visible)
End If
Case Else
EgtOutLog("Tipo: " & m_sType & " non presente")
Return Nothing
End Select
ProjectParameters.nGroup = m_nGroup
ProjectParameters.sName = m_sName
ProjectParameters.sNameNge = m_sNameNge
ProjectParameters.sDescriptionShort = m_sDescriptionShort
ProjectParameters.sDescriptionLong = m_sDescriptionLong
ProjectParameters.sMinUserLevel = m_sMinUserLevel
Return ProjectParameters
End Function
#End Region ' Methods
End Class
@@ -0,0 +1,202 @@
Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtWPFLib5
Imports Newtonsoft.Json
Imports EgtUILib
Public Class JsonProjectParameters
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_nGroup As String
Public Property nGroup As String
Get
Return m_nGroup
End Get
Set(value As String)
m_nGroup = value
NotifyPropertyChanged(NameOf(nGroup))
End Set
End Property
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
NotifyPropertyChanged(NameOf(sName))
End Set
End Property
Private m_sNameNge As String
Public Property sNameNge As String
Get
Return m_sNameNge
End Get
Set(value As String)
m_sNameNge = value
NotifyPropertyChanged(NameOf(sNameNge))
End Set
End Property
Private m_sDescriptionShort As String
Public Property sDescriptionShort As String
Get
Return m_sDescriptionShort
End Get
Set(value As String)
m_sDescriptionShort = value
NotifyPropertyChanged(NameOf(sDescriptionShort))
End Set
End Property
Private m_sDescriptionLong As String
Public Property sDescriptionLong As String
Get
Return m_sDescriptionLong
End Get
Set(value As String)
m_sDescriptionLong = value
NotifyPropertyChanged(NameOf(sDescriptionLong))
End Set
End Property
Private m_sValue As String
Public Property sValue As String
Get
Return m_sValue
End Get
Set(value As String)
m_sValue = value
NotifyPropertyChanged(NameOf(sValue))
End Set
End Property
Private m_sType As String
Public Property sType As String
Get
Return m_sType
End Get
Set(value As String)
m_sType = value
NotifyPropertyChanged(NameOf(sType))
End Set
End Property
Private m_Choices As New ObservableCollection(Of JsonDefaultComboParameter)
Public Property Choices As ObservableCollection(Of JsonDefaultComboParameter)
Get
Return m_Choices
End Get
Set(value As ObservableCollection(Of JsonDefaultComboParameter))
m_Choices = value
NotifyPropertyChanged(NameOf(Choices))
End Set
End Property
Private m_sMinUserLevel As Integer
Public Property sMinUserLevel As Integer
Get
Return m_sMinUserLevel
End Get
Set(value As Integer)
m_sMinUserLevel = value
NotifyPropertyChanged(NameOf(sMinUserLevel))
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(mGroup As String, sName As String, sNameNge As String, sValue As String, sType As String, sDescriptionShort As String, sDescriptionLong As String, sMinUserLevel As String)
m_nGroup = nGroup
m_sName = sName
m_sNameNge = sNameNge
m_sValue = sValue
m_sType = sType
m_sDescriptionShort = sDescriptionShort
m_sDescriptionLong = sDescriptionLong
m_sMinUserLevel = sMinUserLevel
End Sub
Sub New(ProjectParameters As ProjectParameters)
m_sName = ProjectParameters.sName
m_sNameNge = ProjectParameters.sNameNge
Select Case ProjectParameters.GetType()
Case GetType(BooleanGenericParameter)
m_sValue = If(DirectCast(ProjectParameters, BooleanGenericParameter).bValue, "true", "false")
Case GetType(DoubleGenericParameter)
m_sValue = DirectCast(ProjectParameters, DoubleGenericParameter).sValue
Case GetType(ComboGenericParameter)
m_sValue = DirectCast(ProjectParameters, ComboGenericParameter).SelValue.sValue
Case GetType(StringGenericParameter)
m_sValue = DirectCast(ProjectParameters, StringGenericParameter).sValue
Case GetType(ListGenericParameter)
m_sValue = DirectCast(ProjectParameters, ListGenericParameter).SelValue.sName
End Select
m_sDescriptionShort = ProjectParameters.sDescriptionShort
m_sDescriptionLong = ProjectParameters.sDescriptionLong
m_sMinUserLevel = ProjectParameters.sMinUserLevel
End Sub
#End Region ' Constructor
#Region "METHODS"
Friend Function Deserialize(StrategyType As BWType) As ProjectParameters
Dim ProjectParameters As ProjectParameters = Nothing
Select Case m_sType
Case "b"
ProjectParameters = New BooleanGenericParameter()
DirectCast(ProjectParameters, BooleanGenericParameter).SetValue(m_sValue)
If m_sMinUserLevel = 1 Then
DirectCast(ProjectParameters, BooleanGenericParameter).SetbBooleanVisibility(Visibility.Visible)
End If
Case "d"
ProjectParameters = New DoubleGenericParameter()
DirectCast(ProjectParameters, DoubleGenericParameter).SetValue(m_sValue)
If m_sMinUserLevel = 1 Then
DirectCast(ProjectParameters, DoubleGenericParameter).SetbDoubleVisibility(Visibility.Visible)
End If
Case "combo"
ProjectParameters = New ComboGenericParameter()
For Each Choice In Choices
DirectCast(ProjectParameters, ComboGenericParameter).ComboList.Add(Choice.Deserialize())
Next
DirectCast(ProjectParameters, ComboGenericParameter).SetSelValue(m_sValue)
If m_sMinUserLevel = 1 Then
DirectCast(ProjectParameters, ComboGenericParameter).SetbComboBoxVisibility(Visibility.Visible)
End If
Case "tool"
'ProjectParameters = New ListGenericParameter(m_sSubType)
'DirectCast(ProjectParameters, ListGenericParameter).CreateToolsViews()
'If m_sMinUserLevel = 1 Then
' DirectCast(ProjectParameters, ListGenericParameter).SetbListBoxVisibility(Visibility.Visible)
'End If
Case "s"
ProjectParameters = New StringGenericParameter()
DirectCast(ProjectParameters, StringGenericParameter).SetValue(m_sValue)
If m_sMinUserLevel = 1 Then
DirectCast(ProjectParameters, StringGenericParameter).SetbStringVisibility(Visibility.Visible)
End If
Case Else
EgtOutLog("Tipo: " & m_sType & " non presente")
Return Nothing
End Select
ProjectParameters.nGroup = nGroup
ProjectParameters.sName = m_sName
ProjectParameters.sNameNge = m_sNameNge
ProjectParameters.sDescriptionShort = m_sDescriptionShort
ProjectParameters.sDescriptionLong = m_sDescriptionLong
ProjectParameters.sMinUserLevel = m_sMinUserLevel
Return ProjectParameters
End Function
#End Region ' Methods
End Class
@@ -0,0 +1,61 @@
Imports EgtWPFLib5
Imports Newtonsoft.Json
Public Class JsonParameters
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
NotifyPropertyChanged(NameOf(sName))
End Set
End Property
Private m_sNameNge As String
Public Property sNameNge As String
Get
Return m_sNameNge
End Get
Set(value As String)
m_sNameNge = value
NotifyPropertyChanged(NameOf(sNameNge))
End Set
End Property
Private m_sValue As String
Public Property sValue As String
Get
Return m_sValue
End Get
Set(value As String)
m_sValue = value
NotifyPropertyChanged(NameOf(sValue))
End Set
End Property
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sName As String, sNameNge As String, sValue As String)
m_sName = sName
m_sNameNge = sNameNge
m_sValue = sValue
End Sub
Sub New(ProjectParameters As ProjectParameters)
m_sName = ProjectParameters.sName
m_sNameNge = ProjectParameters.sNameNge
m_sValue = ProjectParameters.sValue
End Sub
#End Region ' Constructor
End Class
@@ -0,0 +1,97 @@
Imports EgtWPFLib5
Imports Newtonsoft.Json
Public Class JsonParametersHelper
Inherits VMBase
#Region "FIELDS & PROPETIES"
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
NotifyPropertyChanged(NameOf(sName))
End Set
End Property
Private m_sNameNge As String
Public Property sNameNge As String
Get
Return m_sNameNge
End Get
Set(value As String)
m_sNameNge = value
NotifyPropertyChanged(NameOf(sNameNge))
End Set
End Property
Private m_sValue As String
Public Property sValue As String
Get
Return m_sValue
End Get
Set(value As String)
m_sValue = value
NotifyPropertyChanged(NameOf(sValue))
End Set
End Property
Private m_sType As String
<JsonIgnore>
Public Property sType As String
Get
Return m_sType
End Get
Set(value As String)
m_sType = value
NotifyPropertyChanged(NameOf(sType))
End Set
End Property
Private m_sMinUserLevel As Integer
<JsonIgnore>
Public Property sMinUserLevel As Integer
Get
Return m_sMinUserLevel
End Get
Set(value As Integer)
m_sMinUserLevel = value
NotifyPropertyChanged(NameOf(sMinUserLevel))
End Set
End Property
#End Region ' Fields & Propeties
#Region "CONSTRUCTOR"
<JsonConstructor>
Sub New(sName As String, sNameNge As String, sValue As String, sType As String)
m_sName = sName
m_sNameNge = sNameNge
m_sValue = sValue
m_sType = sType
End Sub
Sub New(ProjectParameters As ProjectParameters)
m_sName = ProjectParameters.sName
m_sNameNge = ProjectParameters.sNameNge
Select Case ProjectParameters.GetType()
'Case GetType(BooleanStrategyParameter)
' m_sValue = If(DirectCast(ProjectParameters, BooleanStrategyParameter).bValue, "true", "false")
Case GetType(DoubleGenericParameter)
m_sValue = DirectCast(ProjectParameters, DoubleGenericParameter).sValue
Case GetType(ComboGenericParameter)
m_sValue = DirectCast(ProjectParameters, ComboGenericParameter).SelValue.sValue
'Case GetType(StringStrategyParameter)
' m_sValue = DirectCast(ProjectParameters, StringStrategyParameter).sValue
'Case GetType(ListStrategyParameter)
' m_sValue = DirectCast(ProjectParameters, ListStrategyParameter).SelValue.sName
End Select
End Sub
#End Region ' Constructor
End Class
@@ -0,0 +1,220 @@
<UserControl x:Class="ProjectParametersV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Optmizer="clr-namespace:EgtBEAMWALL.Optimizer">
<UserControl.Resources>
<Optmizer:GroupVisibilityConverter x:Key="GroupVisibilityConverter"/>
<CollectionViewSource x:Key="GroupedParameters" Source="{Binding GeneralParametersList}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="nGroup"/>
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>
</UserControl.Resources>
<GroupBox Foreground="Black"
BorderThickness="2"
Margin="0,-11,0,0"
BorderBrush="{StaticResource BeamWall_Glacier}">
<GroupBox.Header>
<TextBlock Text="GENERAL PARAMETERS"
FontWeight="Bold"
Style="{StaticResource DialogWindow_TextBlock}"/>
</GroupBox.Header>
<ItemsControl ItemsSource="{Binding Source={StaticResource GroupedParameters}}"
Foreground="Black"
Margin="5,10,0,0"
Style="{StaticResource UsersControlStyle}">
<ItemsControl.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<StackPanel/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<GroupBox Margin="0,5,0,0"
BorderBrush="{StaticResource BeamWall_Glacier}"
BorderThickness="1"
Foreground="Black">
<GroupBox.Header>
<TextBlock Text="{Binding Name}"
FontWeight="Bold"
Style="{StaticResource DialogWindow_TextBlock}"/>
</GroupBox.Header>
<ItemsPresenter />
<GroupBox.Visibility>
<MultiBinding Converter="{StaticResource GroupVisibilityConverter}">
<Binding Path="Items"/>
</MultiBinding>
</GroupBox.Visibility>
</GroupBox>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
</GroupStyle>
</ItemsControl.GroupStyle>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type Optmizer:BooleanGenericParameter}">
<UniformGrid Columns="2"
Margin="2,2,2,5"
Visibility="{Binding bBooleanVisibility}">
<TextBlock Text="{Binding sDescriptionShort}"
HorizontalAlignment="Left"
TextWrapping="WrapWithOverflow"
Style="{StaticResource DialogWindow_TextBlock}"/>
<CheckBox IsChecked="{Binding bValue, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_CheckBox}"/>
</UniformGrid>
</DataTemplate>
<DataTemplate DataType="{x:Type Optmizer:DoubleGenericParameter}">
<UniformGrid Columns="2"
Margin="2,2,2,5"
Visibility="{Binding bDoubleVisibility}">
<TextBlock Text="{Binding sDescriptionShort}"
HorizontalAlignment="Left"
TextWrapping="WrapWithOverflow"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Text="{Binding sValue}"
Style="{StaticResource ColorPicker_TextBox}"/>
</UniformGrid>
</DataTemplate>
<DataTemplate DataType="{x:Type Optmizer:ComboGenericParameter}">
<UniformGrid Columns="2"
Margin="2,2,2,5"
Visibility="{Binding bComboBoxVisibility}">
<TextBlock Text="{Binding sDescriptionShort}"
HorizontalAlignment="Left"
TextWrapping="WrapWithOverflow"
Style="{StaticResource DialogWindow_TextBlock}"/>
<ComboBox ItemsSource="{Binding ComboList}"
SelectedItem="{Binding SelValue}"
DisplayMemberPath="sValue"
Margin="0"
Foreground="Black"
Style="{StaticResource OnlyProdCalcPanel_ComboBox}">
</ComboBox>
</UniformGrid>
</DataTemplate>
<DataTemplate DataType="{x:Type Optmizer:StringGenericParameter}">
<UniformGrid Columns="2"
Margin="5,2,5,0"
Visibility="{Binding bStringVisibility}">
<TextBlock Text="{Binding sDescriptionShort}"
HorizontalAlignment="Left"
TextWrapping="WrapWithOverflow"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Text="{Binding sValue}"
Style="{StaticResource ColorPicker_TextBox}"/>
</UniformGrid>
</DataTemplate>
<DataTemplate DataType="{x:Type Optmizer:ListGenericParameter}">
<Grid Margin="5,5,5,0"
Visibility="{Binding bListBoxVisibility}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.3*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sDescriptionShort}"
HorizontalAlignment="Left"
VerticalAlignment="Top"
TextWrapping="WrapWithOverflow"
Style="{StaticResource DialogWindow_TextBlock}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="0,7,5,0" HorizontalAlignment="Right">
<Button VerticalAlignment="Top"
Width="50"
Margin="0,0,0,5"
ToolTip="{Binding OpenToolListToolTip}"
IsEnabled="{Binding OpenToolListIsEnable}"
Command="{Binding OpenToolListCommand}"
Style="{StaticResource MachineToolBar_ParameterMachineButton}">
<Image Source="/Resources/NewPage/+.png" Stretch="Uniform"/>
</Button>
<Button VerticalAlignment="Top"
Width="50"
Margin="0"
ToolTip="{Binding DeselectAllToolTip}"
IsEnabled="{Binding ActiveToolListIsEnable}"
Command="{Binding DeselectAllCommand}"
Style="{StaticResource MachineToolBar_ParameterMachineButton}">
<Image Source="/Resources/NewPage/deselectall.png" Stretch="Uniform"/>
</Button>
</StackPanel>
<Border Margin="2,0,2,0"
Style="{StaticResource OnlyProdPage_Border}">
<ItemsControl ItemsSource="{Binding ActiveToolList_View}"
BorderThickness="0"
Height="95"
Width="180"
Foreground="Black"
Style="{StaticResource UsersControlStyle}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Style="{StaticResource StackPanel_List}">
<CheckBox IsChecked="{Binding bIsActive, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource FreeContourInput_CheckBox}"/>
<TextBlock Text="{Binding sName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Border>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" Visibility="{Binding AvailableToolListVisibility}">
<StackPanel Orientation="Vertical" Margin="0,7,5,0" HorizontalAlignment="Right">
<Button VerticalAlignment="Top"
Width="50"
Margin="0,0,0,5"
ToolTip="{Binding CloseToolListToolTip}"
Command="{Binding CloseToolListCommand}"
Style="{StaticResource MachineToolBar_ParameterMachineButton}">
<Image Source="/Resources/PDFEditor/Delete.png" Stretch="Uniform"/>
</Button>
<Button VerticalAlignment="Top"
Width="50"
Margin="0,0,0,5"
ToolTip="{Binding SelectAllToolTip}"
IsEnabled="{Binding AvailableToolListIsEnable}"
Command="{Binding SelectAllCommand}"
Style="{StaticResource MachineToolBar_ParameterMachineButton}">
<Image Source="/Resources/NewPage/selectall.png" Stretch="Uniform"/>
</Button>
</StackPanel>
<Border Margin="2,5,2,0"
Style="{StaticResource OnlyProdPage_Border}">
<ItemsControl ItemsSource="{Binding AvailableToolList_View}"
BorderThickness="0"
Height="200"
Width="180"
Foreground="Black"
Style="{StaticResource UsersControlStyle}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Style="{StaticResource StackPanel_List}">
<CheckBox IsChecked="{Binding bIsActive, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource FreeContourInput_CheckBox}"/>
<TextBlock Text="{Binding sName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Border>
</StackPanel>
</Grid>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl>
</GroupBox>
</UserControl>
@@ -0,0 +1,3 @@
Public Class ProjectParametersV
End Class
@@ -6,6 +6,8 @@ Imports EgtBEAMWALL.Core
Public Class MyInstrumentPanelVM
Inherits InstrumentPanelVM
#Region "FIELDS & PROPERTIES"
Public ReadOnly Property ChangeParam_Visibility As Visibility
Get
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW, Visibility.Visible, Visibility.Collapsed)
@@ -18,24 +20,6 @@ Public Class MyInstrumentPanelVM
End Get
End Property
Public ReadOnly Property Statistic_Visibility As Visibility
Get
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Public ReadOnly Property VisStatistic_Visibility As Visibility
Get
Return If(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Public ReadOnly Property OtStatistic_Visibility As Visibility
Get
Return If(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
Private m_InstrumentPanel_IsEnabled As Boolean = True
Public Property InstrumentPanel_IsEnabled As Boolean
Get
@@ -46,90 +30,9 @@ Public Class MyInstrumentPanelVM
End Set
End Property
Private m_Statistics_IsEnabled As Boolean = True
Public Property Statistics_IsEnabled As Boolean
Get
Return m_Statistics_IsEnabled
End Get
Set(value As Boolean)
m_Statistics_IsEnabled = value
End Set
End Property
' flag per verificare se è stato selezionato il pulsante VIS o OTT se 0 = VIS se 1 = OTT
Private m_bVisOtt_Selected As Boolean = False
Public Property bVisOtt_Selected As Boolean
Get
Return m_bVisOtt_Selected
End Get
Set(value As Boolean)
m_bVisOtt_Selected = value
NotifyPropertyChanged(NameOf(bVisOtt_Selected))
End Set
End Property
'Dim m_PrevBottomPanelPage As BottomPanelVM.PartFeatureTab = BottomPanelVM.PartFeatureTab.STRUCTURE_
Private m_Statistics_IsChecked As Boolean = False
Public Property Statistics_IsChecked As Boolean
Get
Return m_Statistics_IsChecked
End Get
Set(value As Boolean)
m_Statistics_IsChecked = value
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
If value Then
'' salvo pagina precedente
'm_PrevBottomPanelPage = Map.refBottomPanelVM.SelPartFeatureTab
' aggiorno valori totali
Map.refProjectVM.BTLStructureVM.CalcGlobalUpdate()
'' seleziono pagina Statistics
'Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.STATISTICS)
Else
'' seleziono pagina precedente
'Map.refBottomPanelVM.SetSelPartFeatureTab(m_PrevBottomPanelPage)
End If
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
If value Then
' aggiorno valori totali
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Map.refProjectVM.MachGroupPanelVM.CalcGlobalUpdate()
' aggiorno conto materiali usati
If Not IsNothing(ProjectManagerVM.CurrProd) Then Map.refStatisticsVM.LoadRawPart()
End If
End If
End Set
End Property
Friend Sub SetStatisticsIsChecked(value As Boolean)
m_Statistics_IsChecked = value
NotifyPropertyChanged(NameOf(Statistics_IsChecked))
End Sub
Private m_VisStatistic_IsEnabled As Boolean = True
Public Property VisStatistic_IsEnabled As Boolean
Get
Return m_VisStatistic_IsEnabled
End Get
Set(value As Boolean)
m_VisStatistic_IsEnabled = value
End Set
End Property
Private m_OtStatistic_IsEnabled As Boolean = True
Public Property OtStatistic_IsEnabled As Boolean
Get
Return m_OtStatistic_IsEnabled
End Get
Set(value As Boolean)
m_OtStatistic_IsEnabled = value
End Set
End Property
' Definizione comandi
Private m_cmdData As ICommand
Private m_cmdChangeParameter As ICommand
Private m_cmdChangeMaterial As ICommand
Private m_cmdStatistics As ICommand
Private m_cmdVisualization As ICommand
Private m_cmdOptimizer As ICommand
#Region "Messages"
@@ -145,14 +48,10 @@ Public Class MyInstrumentPanelVM
End Get
End Property
Public ReadOnly Property Statistics_Msg As String
Get
Return EgtMsg(61923)
End Get
End Property
#End Region ' Messages
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTORS"
Sub New()
@@ -173,28 +72,9 @@ Public Class MyInstrumentPanelVM
GetDistIsChecked = bIsChecked
End Sub
Friend Sub ResetStatisticsIsChecked()
If Statistics_IsChecked Then
Statistics_IsChecked = False
NotifyPropertyChanged(NameOf(Statistics_IsChecked))
End If
End Sub
Friend Sub SetInstrumentPanelIsEnabled(bIsEnabled As Boolean)
m_InstrumentPanel_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(InstrumentPanel_IsEnabled))
If Map.refFreeContourManagerVM.bIsActive Then
m_Statistics_IsEnabled = bIsEnabled
m_VisStatistic_IsEnabled = bIsEnabled
m_OtStatistic_IsEnabled = bIsEnabled
Else
m_Statistics_IsEnabled = True
m_VisStatistic_IsEnabled = True
m_OtStatistic_IsEnabled = True
End If
NotifyPropertyChanged(NameOf(Statistics_IsEnabled))
NotifyPropertyChanged(NameOf(VisStatistic_IsEnabled))
NotifyPropertyChanged(NameOf(OtStatistic_IsEnabled))
End Sub
#End Region ' METHODS
@@ -203,9 +83,6 @@ Public Class MyInstrumentPanelVM
#Region "ChangeParameter"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property ChangeParameter_Command As ICommand
Get
If m_cmdChangeParameter Is Nothing Then
@@ -215,12 +92,8 @@ Public Class MyInstrumentPanelVM
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub ChangeParameter()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
Dim ChangeParameterWndVM As New ChangeParameterWndVM
Dim ChangeParameterWnd As New ChangeParameterWndV(Application.Current.MainWindow, ChangeParameterWndVM)
If ChangeParameterWnd.ShowDialog() Then
@@ -241,7 +114,7 @@ Public Class MyInstrumentPanelVM
For Each Param In ParamList.Where(Function(x) x.sName = ChangeParameterWndVM.SelParam.sName)
Select Case Param.nType
Case BTLParamType.DOUBLE_, BTLParamType.LENGTH
If Math.Abs( Param.dValue - ChangeParameterWndVM.SelParam.dActualValue) < EPS_SMALL Then
If Math.Abs(Param.dValue - ChangeParameterWndVM.SelParam.dActualValue) < EPS_SMALL Then
Param.UpdateParamValue(ChangeParameterWndVM.SelParam.dNewValue, "")
End If
Case BTLParamType.STRING_
@@ -262,9 +135,6 @@ Public Class MyInstrumentPanelVM
#Region "ChangeMaterial"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property ChangeMaterial_Command As ICommand
Get
If m_cmdChangeMaterial Is Nothing Then
@@ -274,12 +144,8 @@ Public Class MyInstrumentPanelVM
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub ChangeMaterial()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)))) Then Return
If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
Dim ChangeMaterialWndVM As New ChangeMaterialWndVM
Dim ChangeMaterialWnd As New ChangeMaterialWndV(Application.Current.MainWindow, ChangeMaterialWndVM)
If ChangeMaterialWnd.ShowDialog() Then
@@ -296,56 +162,6 @@ Public Class MyInstrumentPanelVM
#End Region ' ChangeMaterial
#Region "Visualization"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property Visualization_Command As ICommand
Get
If m_cmdVisualization Is Nothing Then
m_cmdVisualization = New Command(AddressOf Visualization)
End If
Return m_cmdVisualization
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Visualization()
m_bVisOtt_Selected = False
Dim StatisticsWndV As New OptimizerStatisticsWndV(Application.Current.MainWindow, New StatisticsVM())
StatisticsWndV.ShowDialog()
End Sub
#End Region ' Visualization
#Region "Ottimization"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property Optimizer_Command As ICommand
Get
If m_cmdOptimizer Is Nothing Then
m_cmdOptimizer = New Command(AddressOf Optimizer)
End If
Return m_cmdOptimizer
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Optimizer()
m_bVisOtt_Selected = True
Dim OptimizerStatisticsWndV As New OptimizerStatisticsWndV(Application.Current.MainWindow, New StatisticsVM())
OptimizerStatisticsWndV.ShowDialog()
End Sub
#End Region ' Ottimization
#End Region ' COMMANDS
End Class
@@ -26,28 +26,4 @@
FontSize="12"
Style="{StaticResource ToolBarViewPanel_Button}"/>
<!--<ToggleButton ToolTip="{Binding Statistics_Msg}"
Visibility="{Binding Statistic_Visibility}"
IsChecked="{Binding Statistics_IsChecked}"
IsEnabled="{Binding Statistics_IsEnabled}"
Style="{StaticResource ToolBarOnlyProdPage_ToggleButton}">
<Image Source="/Resources/InstrumentPanel/Statistics.png" Stretch="Uniform"/>
</ToggleButton>
<Button Command="{Binding Visualization_Command}"
ToolTip="{Binding Statistics_Msg}"
Visibility="{Binding VisStatistic_Visibility}"
IsEnabled="{Binding VisStatistic_IsEnabled}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/InstrumentPanel/Vis.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding Optimizer_Command}"
ToolTip="{Binding Statistics_Msg}"
Visibility="{Binding OtStatistic_Visibility}"
IsEnabled="{Binding OtStatistic_IsEnabled}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/InstrumentPanel/Ott.png" Stretch="Uniform"/>
</Button>-->
</StackPanel>
@@ -267,3 +267,36 @@ Public Class BooleanToVisibilityConverter
End Function
End Class
Class FractionHeightConverter
Implements IValueConverter
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
If TypeOf value IsNot Double Then Return ""
If TypeOf parameter IsNot Double Then Return ""
Dim dListBoxHeight As Double = CDbl(value)
Dim dWrapPanelHeight As Double = CDbl(parameter)
Return Math.Floor((dListBoxHeight - 40) * dWrapPanelHeight)
End Function
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New NotImplementedException()
End Function
End Class
Class ExpanderWidthConverter
Implements IValueConverter
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
If TypeOf value IsNot Double Then Return ""
Dim dListBoxHeight As Double = CDbl(value)
Return Math.Floor(dListBoxHeight - 20)
End Function
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New NotImplementedException()
End Function
End Class
@@ -6,6 +6,8 @@ Imports EgtWPFLib5
Public Class FeatureInPartInRawPartListVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private m_colFeatureInPartInRawPart_Do As EgtDataGridColumn
Public ReadOnly Property colFeatureInPartInRawPart_Do As EgtDataGridColumn
Get
@@ -52,6 +54,10 @@ Public Class FeatureInPartInRawPartListVM
#End Region ' Messages
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
' creo riferimento in Map
Map.SetRefFeatureInPartInRawPartListVM(Me)
@@ -62,10 +68,16 @@ Public Class FeatureInPartInRawPartListVM
m_colFeatureInPartInRawPart_Priority = FeatureInPartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_PRIORITY)
End Sub
Friend Sub UpdateColumns(nMachType As MachineType)
#End Region ' Constructor
#Region "METHODS"
Friend Sub UpdateColumns(nProjectType As BWType)
If Not IsNothing(m_colFeatureInPartInRawPart_Priority) Then
m_colFeatureInPartInRawPart_Priority.Visible = (nMachType = MachineType.WALL AndAlso CurrentMachine.bIsEnabledPriority)
m_colFeatureInPartInRawPart_Priority.Visible = (nProjectType = BWType.WALL AndAlso CurrentMachine.bIsEnabledPriority)
End If
End Sub
#End Region ' Methods
End Class
@@ -100,7 +100,17 @@ Public Class FeatureListVM
End Property
Public Sub Ok()
Map.refProjectVM.SetSelManagerTab(ProjectVM.ManagerTab.RAWPARTMANAGER)
'Map.refForcedStrategyBTLVM.ForcedStrategy()
Map.refForcedStrategyPanelVM.ForcedStrategy()
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.ResetCalcFeature()
Map.refProjectVM.BTLStructureVM.SelBTLPart.ResetCalcPart()
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Visible)
Map.refProjectVM.SetStrategyManagerVisibility(Visibility.Collapsed)
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
Map.refProjectVM.SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATURERAWPARTMANAGER)
' Abilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(True)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(1)
End Sub
@@ -119,7 +129,11 @@ Public Class FeatureListVM
End Property
Public Sub Cancel()
Map.refProjectVM.SetSelManagerTab(ProjectVM.ManagerTab.RAWPARTMANAGER)
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Visible)
Map.refProjectVM.SetStrategyManagerVisibility(Visibility.Collapsed)
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
Map.refProjectVM.SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATURERAWPARTMANAGER)
' Abilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(True)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(1)
End Sub
@@ -1,18 +1,20 @@
<UserControl x:Class="OnlyProdBTLPartListV"
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:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
<UserControl.Resources>
<EgtBEAMWALL:DataGridCellBorderThicknessConverter x:Key="DataGridCellBorderThicknessConverter"/>
<EgtBEAMWALL:ProjIdToBtlFileName x:Key="ProjIdToBtlFileName"/>
<EgtBEAMWALL:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<EgtBEAMWALL:FractionHeightConverter x:Key="FractionHeightConverter"/>
<EgtBEAMWALL:ExpanderWidthConverter x:Key="ExpanderWidthConverter"/>
<sys:Double x:Key="FeatureWrapPanelHeight">0.6</sys:Double>
</UserControl.Resources>
<EgtBEAMWALLCORE:EgtDataGrid x:Name="BTLPart_DataGrid"
ItemsSource="{Binding Tag.BTLPartVMList,
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding Tag.BTLPartVMList,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
SelectionMode="Extended"
PreviewMouseDown="DataGrid_PreviewMouseDown"
PreviewMouseMove="DataGrid_PreviewMouseMove"
Margin="0,0,0,5"
EgtBEAMWALL:MultiSelectorBehaviours.SynchronizedSelectedItems="{Binding Tag.SelBTLParts,
@@ -21,18 +23,19 @@
IsEnabled="{Binding PartList_IsEnabled}"
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"
AreRowDetailsFrozen="True"
ScrollViewer.CanContentScroll="True"
VirtualizingPanel.ScrollUnit="Pixel"
EnableRowVirtualization="True"
EnableColumnVirtualization="True"
VirtualizingStackPanel.VirtualizationMode="Recycling"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingPanel.IsVirtualizingWhenGrouping="True"
VirtualizingPanel.ScrollUnit="Pixel"
RenderOptions.CachingHint="Cache"
VirtualizingPanel.CacheLength="10"
VirtualizingPanel.CacheLengthUnit="Pixel"
RowBackground="{StaticResource BeamWall_BLackSqueeze}"
ColumnHeaderStyle="{StaticResource Main_DataGridColumnHeader}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.InputBindings>
<KeyBinding Key="Delete" Command="{Binding Tag.DeletePart_Command,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}" />
@@ -45,27 +48,35 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="True">
<Expander IsExpanded="True"
Width="{Binding ActualWidth, Converter={StaticResource ExpanderWidthConverter}, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALLCORE:EgtDataGrid}}}">
<Expander.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Name}"
Margin="0,0,5,0"/>
<TextBlock Text="{Binding Path=Name}"
Margin="0,0,5,0" FontSize="14"/>
<TextBlock Text="{Binding Path=Name, Converter={StaticResource ProjIdToBtlFileName}}"
Margin="0,0,5,0"/>
Margin="0,0,5,0" FontSize="14"/>
<Button Command="{Binding Tag.Data_Command, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding Path=Name}"
ToolTip="{Binding Tag.Data_ToolTip, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
Height="20" Width="20" Margin="5,0,0,0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding Tag.AddPart_Command, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding Path=Name}"
ToolTip="{Binding Tag.AddPart_ToolTip, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
Height="20" Width="20" Margin="5,0,0,0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/LeftPanel/AddPart.png" Stretch="Uniform"/>
</Button>
<Button Command="{Binding Tag.UpdateBTL_Command, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
CommandParameter="{Binding Path=Name}"
ToolTip="{Binding Tag.UpdateBTL_ToolTip, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
Height="20" Width="20" Margin="5,0,0,0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/ProjectManager/UpdateBTL.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Expander.Header>
<Expander.Content>
@@ -96,15 +107,21 @@
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<Setter Property="DetailsVisibility" Value="{Binding bOpenFeatureList, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<EventSetter Event="PreviewMouseDown" Handler="PartList_PreviewMouseDown"/>
<EventSetter Event="PreviewMouseUp" Handler="PartList_PreviewMouseUp"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsRowEnabled}" Value="False">
<Setter Property="IsEnabled" Value="False"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<!--PDN - Nome-->
<DataGridTextColumn x:Key="colPDN" Binding="{Binding nPDN}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.PDN_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.PDN_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Validità pezzo-->
<DataGridTemplateColumn x:Key="colCALC" CanUserResize="False"
@@ -114,29 +131,15 @@
<Grid Style="{StaticResource GlobalState_Grid}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="25"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<TextBlock Text="↓"
Visibility="{Binding CALC_FALL_Visibility}"
Style="{StaticResource CALC_FALL_TextBlock}"/>
Style="{StaticResource OnlyProdRawPartList_TextBlock}"/>
<Border Grid.Column="1"
BorderBrush="{Binding Calc_BorderBrush}"
Style="{StaticResource CALC_FALL_Border}">
<ItemsControl ItemsSource="{Binding BTLFeatureVMList_View}"
Style="{StaticResource CALC_FALL_ItemsControl}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="6" Rows="5"
Margin="0"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="{Binding Calc_Background}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}"
Background="{Binding Calc_BorderBrush}">
</Border>
<Grid Grid.Column="2"
HorizontalAlignment="Center">
@@ -176,47 +179,61 @@
</DataGridTemplateColumn>
<!--W - Larghezza-->
<DataGridTextColumn x:Key="colW" Binding="{Binding sW}" SortMemberPath="dW">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.W_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.W_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--H - Altezza-->
<DataGridTextColumn x:Key="colH" Binding="{Binding sH}" SortMemberPath="dH">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.H_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.H_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--L - Lunghezza-->
<DataGridTextColumn x:Key="colL" Binding="{Binding sL}" SortMemberPath="dL">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.L_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.L_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--NAM - Descrizione-->
<DataGridTextColumn x:Key="colNAM" Binding="{Binding sNAM}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--MAT - Materiale-->
<DataGridTextColumn x:Key="colMATERIAL" Binding="{Binding sMATERIAL}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MAT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.MAT_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--CNT - Richiesti da BTL-->
<DataGridTextColumn x:Key="colCNT" Binding="{Binding sCNT}" SortMemberPath="nCNT">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.ShortCNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
ToolTip="{Binding Path=DataContext.CNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="QTY"
ToolTip="{Binding DataContext.CNT_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--ADDED - Aggiunti-->
<DataGridTextColumn x:Key="colADDED" Binding="{Binding sADDED}" SortMemberPath="nADDED">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.ShortADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
ToolTip="{Binding Path=DataContext.ADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.ShortADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
ToolTip="{Binding DataContext.ADDED_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Blue" />
@@ -225,35 +242,43 @@
</DataGridTextColumn>
<!--INPROD - IN OTTIMIZZAZIONE-->
<DataGridTextColumn x:Key="colINPROD" Binding="{Binding nINPROD}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.ShortINPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
ToolTip="{Binding Path=DataContext.INPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.ShortINPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
ToolTip="{Binding DataContext.INPROD_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--DONE - PRODOTTI-->
<DataGridTextColumn x:Key="colDONE" Binding="{Binding nDONE}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.ShortDONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
ToolTip="{Binding Path=DataContext.DONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.ShortDONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
ToolTip="{Binding DataContext.DONE_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--GRP - Gruppo-->
<DataGridTextColumn x:Key="colGROUP" Binding="{Binding sGROUP}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--STOREY - Sottogruppo-->
<DataGridTextColumn x:Key="colSTOREY" Binding="{Binding sSTOREY}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--ROT - Rotazione-->
<DataGridTemplateColumn x:Key="colROT" SortMemberPath="dROT">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.ROTATION_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
<Image Source="/Resources/NewPage/RotateIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -261,18 +286,17 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sROTATED}"
TextAlignment="Center"
Margin="2,0,2,0"/>
<Button Grid.Column="1"
Command="{Binding ForwardRotation_Command}"
ToolTip="{Binding ForwardRotation_ToolTip}"
IsEnabled="{Binding RotatePart_IsEnabled}"
Height="15" Width="15" Margin="2,0,2,0">
<Image Source="/Resources/PartManager/RightRotate.png" Stretch="Uniform"/>
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/NewPage/Rotate.png" Stretch="Uniform"/>
</Button>
</Grid>
</DataTemplate>
@@ -282,12 +306,12 @@
<DataGridTemplateColumn x:Key="colFLIP">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.INVERSION_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
<Image Source="/Resources/NewPage/InversionIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox Command="{Binding Invert_Command}"
<CheckBox IsChecked="{Binding IsInverted, UpdateSourceTrigger=PropertyChanged}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</DataTemplate>
@@ -297,7 +321,7 @@
<DataGridTemplateColumn x:Key="colVERIFY">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Verifica"/>
<Image Source="/Resources/NewPage/VerifyIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -305,8 +329,7 @@
<Button ToolTip="{Binding Verify_ToolTip}"
Command="{Binding Verify_Command}"
IsEnabled="{Binding Verify_IsEnabled}"
Height="15" Width="15" Margin="0"
Style="{StaticResource ToolBarViewPanel_Button}">
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/CALCPanel/Verify.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
@@ -316,7 +339,7 @@
<DataGridTemplateColumn x:Key="colADD">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.AddToRawPart_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
<Image Source="/Resources/NewPage/AddToRawPartIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -325,8 +348,7 @@
Visibility="{Binding MachiningPage_Visibility}"
ToolTip="{Binding AddToRawPart_ToolTip}"
IsEnabled="{Binding BTLPartManager_IsEnabled}"
Height="15" Width="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/LeftPanel/AddToRawPart.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
@@ -336,82 +358,146 @@
<DataGridTemplateColumn x:Key="colSETTING">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Opzioni"/>
<Image Source="/Resources/NewPage/SettingIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<StackPanel>
<Button Command="{Binding ShowPopUpSettingBtnCommand}"
ToolTip="{Binding Settings_Command_ToolTip}"
Height="15" Width="15" Margin="0">
Style="{StaticResource BTLPanel_Button}"
Click="OpenPopUp_Click">
<Image Source="/Resources/NewPage/Setting.png" Stretch="Uniform"/>
</Button>
<Popup IsOpen="{Binding IsSettingBtnOpen}"
AllowsTransparency="True"
PopupAnimation="Scroll"
StaysOpen="False"
PlacementTarget="{Binding ElementName=BTLPart_DataGrid.Button}">
<Popup AllowsTransparency="True"
PopupAnimation="None"
Placement="Right"
StaysOpen="False">
<Popup.VerticalOffset>
<MultiBinding Converter="{StaticResource DataGridCellBorderThicknessConverter}">
<Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}"/>
<Binding Path="ActualWidth" ElementName="SettingsBtn"/>
</MultiBinding>
</Popup.VerticalOffset>
<EgtBEAMWALL:OnlyProdBTLPartManagerV/>
</Popup>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Resources>
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<ListBox ItemsSource="{Binding BTLFeatureVMList}"
SelectedItem="{Binding SelBTLFeatureVM, UpdateSourceTrigger=PropertyChanged}"
PreviewMouseWheel="ListBox_PreviewMouseWheel"
SelectionMode="Single"
IsSynchronizedWithCurrentItem="True">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<CheckBox IsChecked="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="15,0,2.5,0"/>
<TextBlock Grid.Column="1"
Text="{Binding sDescGRP}"
Margin="2.5,0,10,0"
Style="{StaticResource OnlyProd_TextBlock}"/>
<Grid Grid.Column="2"
Margin="2.5,0,2.5,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<EgtBEAMWALL:OnlyProdFeatureListManagerV/>
<ListBox Grid.Column="1"
ItemsSource="{Binding BTLFeatureVMList}"
SelectedItem="{Binding SelBTLFeatureVM, UpdateSourceTrigger=PropertyChanged}"
PreviewMouseWheel="ListBox_PreviewMouseWheel"
Grid.IsSharedSizeScope="True"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto"
Style="{StaticResource BTL_ListBox}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"
MaxHeight="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALLCORE:EgtDataGrid}},
Converter={StaticResource FractionHeightConverter},
ConverterParameter={StaticResource FeatureWrapPanelHeight}}"
MinHeight="{Binding Parent.Children[0].ActualHeight, RelativeSource={RelativeSource AncestorType={x:Type Grid}}}"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,50,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="Feature_Grp"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="Feature_Prc"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="Feature_Name"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}"
Background="{Binding Calc_Background}"/>
<TextBlock Text="{Binding nPRID}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Ellipse Visibility="{Binding CALC_ROT_Visibility}"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_Ellipse}"/>
<TextBlock Grid.Row="1"
Text="{Binding CALC_ERR_Letter}"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_TextBlock}"/>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<Border Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}"
Background="{Binding Calc_Background}"/>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Ellipse Visibility="{Binding CALC_ROT_Visibility}"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_Ellipse}"/>
<TextBlock Grid.Row="1"
Text="{Binding CALC_ERR_Letter}"
Foreground="{Binding CALC_ERR_Foreground}"
Style="{StaticResource OnlyProdFeatureInPartInRawPartList_TextBlock}"/>
</Grid>
</Grid>
<CheckBox Grid.Column="2"
IsChecked="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="3"
Text="["
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="4"
Text="{Binding nSelGRP}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="5"
Text="-"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="6"
Text="{Binding nPRC, StringFormat={}{0:000}}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="7"
Text="] "
Style="{StaticResource OnlyProd_TextBlock}"/>
<TextBlock Grid.Column="8"
Text="{Binding sName}" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource OnlyProd_TextBlock}"/>
<Button Grid.Column="9"
Command="{Binding EditFeature_Command}"
Click="SelectButton_Click"
Style="{StaticResource EditFeature_Button}">
<Image Source="/Resources/CALCPanel/Edit.png" Stretch="Uniform"/>
</Button>
</Grid>
<TextBlock Grid.Column="3"
Text="{Binding sName}"
Margin="2.5,0,10,0"
Style="{StaticResource OnlyProd_TextBlock}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" Margin="0,2,0,0"
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}">
<TextBlock Text="STATUS:" Foreground="{StaticResource BeamWall_Corduroy}" HorizontalAlignment="Left" Margin="0,0,10,0"/>
<TextBlock Text="{Binding Tag.SelBTLPart.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
HorizontalAlignment="Left" Foreground="{StaticResource BeamWall_Corduroy}"
Visibility="{Binding Tag.SelBTLPart.CALC_MSG_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"/>
<TextBlock Text="{Binding Tag.SelBTLPart.SelBTLFeatureVM.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdBTLPartListV}}}"
HorizontalAlignment="Left" Foreground="{StaticResource BeamWall_Corduroy}" />
</StackPanel>
</Grid>
</DataTemplate>
</DataGrid.RowDetailsTemplate>
@@ -1,128 +1,28 @@
Imports System.Reflection
Imports System.Windows.Controls.Primitives
Public Class OnlyProdBTLPartListV
Private m_BTLPartListVM As BTLPartListVM
Private m_SelectBtn As MouseButton = MouseButton.Left
Private m_HighlightBtn As MouseButton = MouseButton.Right
Private m_NameDataGridType As Type
Private s_isDraggingSelectionField As FieldInfo
Private s_endDraggingMethod As MethodInfo
Private m_DataGridType As Type = GetType(DataGrid)
Private m_isDraggingSelectionField As FieldInfo
Private m_endDraggingMethod As MethodInfo
Sub New()
' This call is required by the designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
m_BTLPartListVM = DataContext
m_NameDataGridType = BTLPart_DataGrid.GetType()
' Evita il drag sulla selezione multipla
s_isDraggingSelectionField = m_NameDataGridType.GetField("_isDraggingSelection", BindingFlags.Instance Or BindingFlags.NonPublic)
s_endDraggingMethod = m_NameDataGridType.GetMethod("EndDragging", BindingFlags.Instance Or BindingFlags.NonPublic)
'SetSelButton(MouseButton.Right)
m_isDraggingSelectionField = m_DataGridType.GetField("_isDraggingSelection", BindingFlags.Instance Or BindingFlags.NonPublic)
m_endDraggingMethod = m_DataGridType.GetMethod("EndDragging", BindingFlags.Instance Or BindingFlags.NonPublic)
End Sub
Public Sub SetSelButton(SelButton As MouseButton)
Select Case SelButton
Case MouseButton.Right
m_SelectBtn = MouseButton.Right
m_HighlightBtn = MouseButton.Left
Case Else ' MouseButton.Left
m_SelectBtn = MouseButton.Left
m_HighlightBtn = MouseButton.Right
End Select
End Sub
Public Sub DataGrid_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
'If e.ChangedButton = MouseButton.Left Then
' If e.ChangedButton = m_SelectBtn Then
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
' e.Handled = True
' Else
' Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.SELECT_)
' End If
' ElseIf e.ChangedButton = m_HighlightBtn AndAlso (Map.refProjectVM.BTLStructureVM.SelectionType = BTLStructureVM.SelectionTypes.SELECT_ AndAlso
' ((Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control)) Then
' e.Handled = True
' ElseIf e.ChangedButton = m_HighlightBtn Then
' Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.HIGHLIGHT)
' End If
' If TypeOf sender Is EgtBEAMWALL.Core.EgtDataGrid Then
' Dim EgtDataGridList As EgtBEAMWALL.Core.EgtDataGrid = DirectCast(sender, EgtBEAMWALL.Core.EgtDataGrid)
' If Not IsNothing(EgtDataGridList) AndAlso Not IsNothing(EgtDataGridList.SelectedItem) Then
' Map.refProjectVM.BTLStructureVM.SelectBTLPart(EgtDataGridList.SelectedItem)
' 'If TypeOf EgtDataGridList.SelectedItem IsNot BTLPartVM Then Return
' 'Dim VM As BTLPartVM = DirectCast(EgtDataGridList.SelectedItem, BTLPartVM)
' 'VM.SetOpenFeatureList(Not VM.bOpenFeatureList)
' 'If EgtDataGridList.SelectedItem Then
' ' VM.bOpenFeatureList = Not VM.bOpenFeatureList
' 'Else
' 'VM.bOpenFeatureList = False
' 'End If
' End If
' End If
' ' imposto tipo di grid selezionata
' If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.PART)
'Else
' ' imposto tipo di grid selezionata
' If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.MACHGROUP)
' Map.refSceneHostVM.MainScene.ZoomAll()
' End If
'End If
End Sub
Public Sub DataGrid_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs)
'If e.ChangedButton = MouseButton.Right Then
' If e.ChangedButton = m_SelectBtn Then
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
' e.Handled = True
' Else
' Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.SELECT_)
' End If
' ElseIf e.ChangedButton = m_HighlightBtn Then
' Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.HIGHLIGHT)
' End If
' ' imposto tipo di grid selezionata
' If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.PART)
'End If
End Sub
Public Shared Function FindVisualParent(Of T As DependencyObject)(ByVal child As DependencyObject) As T
Dim parentObject As DependencyObject = VisualTreeHelper.GetParent(child)
If parentObject Is Nothing Then Return Nothing
Dim parent As T = TryCast(parentObject, T)
If parent IsNot Nothing Then
Return parent
Else
Return FindVisualParent(Of T)(parentObject)
End If
End Function
Public Shared Function FindVisualParents(Of T As DependencyObject, U As DependencyObject, V As DependencyObject)(ByVal child As DependencyObject) As Object
Dim parentObject As DependencyObject = VisualTreeHelper.GetParent(child)
If parentObject Is Nothing Then Return Nothing
If TypeOf parentObject Is T Then
Return parentObject
ElseIf TypeOf parentObject Is U Then
Return parentObject
ElseIf TypeOf parentObject Is V Then
Return parentObject
Else
Return FindVisualParents(Of T, U, V)(parentObject)
End If
End Function
Public Sub DataGrid_PreviewMouseMove(sender As Object, e As MouseEventArgs)
' Evita il drag sulla selezione multipla
If m_SelectBtn = MouseButton.Left AndAlso e.LeftButton = MouseButtonState.Pressed Then
If CBool(If(s_isDraggingSelectionField?.GetValue(BTLPart_DataGrid), False)) Then s_endDraggingMethod.Invoke(BTLPart_DataGrid, New Object(-1) {})
If e.LeftButton = MouseButtonState.Pressed Then
If CBool(If(m_isDraggingSelectionField?.GetValue(sender), False)) Then m_endDraggingMethod.Invoke(sender, New Object(-1) {})
End If
End Sub
@@ -133,84 +33,16 @@ Public Class OnlyProdBTLPartListV
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
If TypeOf Row.DataContext IsNot BTLPartVM Then Return
Dim BTLPartVM As BTLPartVM = DirectCast(Row.DataContext, BTLPartVM)
Dim DataGridDetailsPresenter As Object = FindVisualParents(Of Button, CheckBox, Primitives.DataGridDetailsPresenter)(e.OriginalSource)
Dim DataGridDetailsPresenter As Object = TreeHelperManager.FindVisualParents(Of Button, CheckBox, Primitives.DataGridDetailsPresenter)(e.OriginalSource)
If Not IsNothing(DataGridDetailsPresenter) Then Return
'Dim parent = e.OriginalSource
'While Not IsNothing(parent)
' parent = VisualTreeHelper.GetParent(parent)
'End While
If Map.refProjectVM.BTLStructureVM.SelBTLParts.Contains(BTLPartVM) Then
BTLPartVM.SetOpenFeatureList(Not BTLPartVM.bOpenFeatureList)
End If
If Not IsNothing(Row) AndAlso Row.IsSelected AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso Map.refProjectVM.BTLStructureVM.SelBTLPart.Equals(BTLPartVM) Then
Map.refProjectVM.BTLStructureVM.SelectBTLPart(BTLPartVM, True)
End If
End If
End If
'If TypeOf sender Is DataGridRow Then
' Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
' If Not Row.IsSelected Then Return
' If TypeOf Row.DataContext IsNot BTLPartVM Then Return
' Dim VM As BTLPartVM = DirectCast(Row.DataContext, BTLPartVM)
' If VM.bOpenFeatureList Then
' VM.bOpenFeatureList = False
' End If
'End If
'If TypeOf sender Is DataGridRow Then
' Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
' If Not Row.IsSelected Then Return
' Select Case e.ChangedButton
' Case MouseButton.Left
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
' Return
' Else
' BTLPart_DataGrid.SelectedItem = Nothing
' BTLPart_DataGrid.SelectedItem = Row.DataContext
' End If
' Case MouseButton.Right
' End Select
'End If
End Sub
Private Sub PartList_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs)
'If e.ChangedButton = MouseButton.Left Then
' If TypeOf sender Is DataGridRow Then
' Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
' If TypeOf Row.DataContext IsNot BTLPartVM Then Return
' Dim VM As BTLPartVM = DirectCast(Row.DataContext, BTLPartVM)
' VM.SetOpenFeatureList(Not VM.bOpenFeatureList)
' If Row.IsSelected Then
' VM.bOpenFeatureList = Not VM.bOpenFeatureList
' Else
' VM.bOpenFeatureList = False
' End If
' End If
'End If
'If TypeOf sender Is DataGridRow Then
' Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
' If Not Row.IsSelected Then Return
' Select Case e.ChangedButton
' Case MouseButton.Right
' If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
' Row.IsSelected = Not Row.IsSelected
' Else
' BTLPart_DataGrid.SelectedItem = Nothing
' BTLPart_DataGrid.SelectedItem = Row.DataContext
' ' metto focus su cella selezionata per evitare errori di focus del sistema normale
' Dim dep As DependencyObject = CType(e.OriginalSource, DependencyObject)
' While (dep IsNot Nothing) AndAlso Not (TypeOf dep Is DataGridCell)
' dep = VisualTreeHelper.GetParent(dep)
' End While
' If dep Is Nothing Then Return
' If TypeOf dep Is DataGridCell Then
' Dim cell As DataGridCell = TryCast(dep, DataGridCell)
' cell.Focus()
' End If
' End If
' End Select
'End If
End Sub
Private Sub ListBox_PreviewMouseWheel(ByVal sender As Object, ByVal e As MouseWheelEventArgs)
@@ -232,4 +64,57 @@ Public Class OnlyProdBTLPartListV
.Source = sender})
End Sub
Private Sub OpenPopUp_Click(sender As Object, e As RoutedEventArgs)
Dim btn As Button = DirectCast(sender, Button) ' Ottieni il bottone che ha generato l'evento
Dim parent As DependencyObject = btn
' Cerca il Popup nel Visual Tree
While Not IsNothing(parent) AndAlso TypeOf parent IsNot DataGridRow
parent = VisualTreeHelper.GetParent(parent)
End While
If Not IsNothing(parent) Then
Dim row As DataGridRow = DirectCast(parent, DataGridRow)
Dim popup As Popup = TryCast(TreeHelperManager.FindVisualChild(Of Popup)(row), Popup)
If Not IsNothing(popup) Then
popup.PlacementTarget = btn ' Associa il popup al bottone
popup.IsOpen = True ' Mostra il popup
End If
End If
End Sub
Private Sub SelectButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim button = TryCast(sender, Button)
Dim listBoxItem = FindAncestor(Of ListBoxItem)(button)
If Not IsNothing(listBoxItem) Then
listBoxItem.IsSelected = True
End If
End Sub
Private Function FindAncestor(Of T As DependencyObject)(ByVal current As DependencyObject) As T
While Not IsNothing(current)
If TypeOf current Is T Then
Return CType(current, T)
End If
current = VisualTreeHelper.GetParent(current)
End While
Return Nothing
End Function
End Class
Public Class SettingsBtnVerticalOffsetMultiConverter
Implements IMultiValueConverter
Public Function Convert(values() As Object, targetType As Type, parameter As Object, culture As Globalization.CultureInfo) As Object Implements IMultiValueConverter.Convert
Dim x = 3
Return 10
End Function
Public Function ConvertBack(value As Object, targetTypes() As Type, parameter As Object, culture As Globalization.CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
Throw New NotImplementedException()
End Function
End Class
@@ -14,13 +14,8 @@
BeginningEdit="FeatureInPartInRawPartList_BeginningEdit"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_NeonCarrot}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight_PartList}"
ColumnHeaderStyle="{StaticResource Main_DataGridColumnHeader}"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.InputBindings>
@@ -10,21 +10,16 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding Tag.BTLFeatureVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"
SelectedItem="{Binding Tag.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"
SelectionMode="Single"
Margin="0,0,0,5"
IsEnabled="{Binding FeatureList_IsEnabled}"
BindingColumns="{Binding FeatureColumns}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Keppel}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
SelectedItem="{Binding Tag.SelBTLFeatureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureListV}}}"
SelectionMode="Single"
Margin="0,0,0,5"
IsEnabled="{Binding FeatureList_IsEnabled}"
BindingColumns="{Binding FeatureColumns}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderStyle="{StaticResource Feature_DataGridColumnHeader}"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.Resources>
<!--DO - Abilitazione-->
@@ -135,7 +130,7 @@
<Button Command="{Binding Cancel_Command}"
ToolTip="{Binding Cancel_Msg}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/NewPage/Cancel.png" Stretch="Uniform"/>
<Image Source="/Resources/PDFEditor/Delete.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Grid>
@@ -2,128 +2,154 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
xmlns:EgwWPFBaseLib="clr-namespace:EgwWPFBaseLib;assembly=EgwWPFBaseLib">
<EgtBEAMWALLCORE:EgtDataGrid CanUserDeleteRows="False"
SelectionMode="Single"
Margin="0,0,0,5"
ItemsSource="{Binding Tag.PBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdPParameterListV}}}"
SelectedItem="{Binding Tag.SelPBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdPParameterListV}}}"
IsEnabled="{Binding PParameterList_IsEnabled}"
BindingColumns="{Binding PParameterListColumns}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Downy}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<EventSetter Event="PreviewMouseDown" Handler="PParameterList_PreviewMouseDown"/>
</Style>
</DataGrid.RowStyle>
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<EgwWPFBaseLib:EgwDataGrid CanUserDeleteRows="False"
SelectionMode="Single"
Margin="0,0,0,5"
ItemsSource="{Binding Tag.PBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdPParameterListV}}}"
SelectedItem="{Binding Tag.SelPBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdPParameterListV}}}"
IsEnabled="{Binding PParameterList_IsEnabled}"
ColumnLayouts="{Binding PParameterListColumns}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderStyle="{StaticResource PParam_DataGridColumnHeader}"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<EventSetter Event="PreviewMouseDown" Handler="PParameterList_PreviewMouseDown"/>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<EgtBEAMWALL:TrimmedTextBlockVisibilityConverter x:Key="TrimToVisConverter" />
<!--Custom-->
<DataGridTemplateColumn x:Key="colCUSTOM">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Custom_Msg, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding bCustom, UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
VerticalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Nome-->
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Descrizione-->
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDescription}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"
Style="{StaticResource OnlyProd_TextBlock}">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OnlyProd_ToolTip}">
<ToolTip.Content>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"/>
<Image Source="{Binding sDrawPath}"
Style="{StaticResource OnlyProdFeatureList_Image}"/>
</StackPanel>
</ToolTip.Content>
</ToolTip>
</TextBlock.ToolTip>
<DataGrid.Resources>
<EgtBEAMWALL:TrimmedTextBlockVisibilityConverter x:Key="TrimToVisConverter" />
<!--Custom-->
<DataGridTemplateColumn x:Key="colCUSTOM">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Custom_Msg, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding bCustom, UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"
VerticalAlignment="Center"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--Nome-->
<DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Descrizione-->
<DataGridTextColumn x:Key="colDESC" Binding="{Binding sDescription}">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"
Style="{StaticResource OnlyProd_TextBlock}">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OnlyProd_ToolTip}">
<ToolTip.Content>
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<!--<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content.Text}"
Style="{StaticResource OnlyProd_TextBlock}"/>
<Image Source="{Binding sDrawPath}"
Style="{StaticResource OnlyProdFeatureList_Image}"/>
</StackPanel>-->
</ToolTip.Content>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="{StaticResource BeamWall_White}" />
<Setter Property="Background" Value="{StaticResource BeamWall_FountainBlue}" />
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
<!--Valore-->
<DataGridTextColumn x:Key="colVALUE" Binding="{Binding sValue}" SortMemberPath="dValue">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Value_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="{StaticResource BeamWall_White}" />
<Setter Property="Background" Value="{StaticResource BeamWall_FountainBlue}" />
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
<!--Minimo-->
<DataGridTextColumn x:Key="colMIN" Binding="{Binding sMin}" SortMemberPath="dMin">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Min_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Massimo-->
<DataGridTextColumn x:Key="colMAX" Binding="{Binding sMax}" SortMemberPath="dMax">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Max_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
</DataGrid.Resources>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="{StaticResource BeamWall_White}" />
<Setter Property="Background" Value="{StaticResource BeamWall_FountainBlue}" />
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
<!--Valore-->
<DataGridTextColumn x:Key="colVALUE" Binding="{Binding sValue}" SortMemberPath="dValue">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Value_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Foreground" Value="{StaticResource BeamWall_White}" />
<Setter Property="Background" Value="{StaticResource BeamWall_FountainBlue}" />
</Style>
</DataGridTextColumn.EditingElementStyle>
</DataGridTextColumn>
<!--Minimo-->
<DataGridTextColumn x:Key="colMIN" Binding="{Binding sMin}" SortMemberPath="dMin">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Min_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
<!--Massimo-->
<DataGridTextColumn x:Key="colMAX" Binding="{Binding sMax}" SortMemberPath="dMax">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.Max_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
</DataGridTextColumn>
</DataGrid.Resources>
</EgwWPFBaseLib:EgwDataGrid>
</EgtBEAMWALLCORE:EgtDataGrid>
<Image Grid.Column="1" Width="250"
Source="{Binding sCurrDraw}"
Margin="2.5"/>
<StackPanel Grid.Row="1"
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>
@@ -16,12 +16,7 @@
BeginningEdit="PartInRawPartList_BeginningEdit"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Jaffa}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
ColumnHeaderStyle="{StaticResource PartInRawPart_DataGridColumnHeader}"
CellStyle="{StaticResource CellDataGrid_CustomHighLight_PartList}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.RowStyle>
@@ -14,12 +14,6 @@
BindingColumns="{Binding QParameterListColumns}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_TexasRose}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight_PartList}"
Style="{StaticResource DataGrid_OnlyProd}">
@@ -14,12 +14,6 @@
BindingColumns="{Binding QParameterListColumns}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Downy}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
@@ -4,8 +4,7 @@
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer"
xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">
<EgtBEAMWALLCORE:EgtDataGrid Name="MachGroupVMList_DataGrid"
ItemsSource="{Binding Tag.MachGroupVMList,
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding Tag.MachGroupVMList,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"
SelectedItem="{Binding Tag.SelectedMachGroup,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"
@@ -16,18 +15,19 @@
BeginningEdit="RawPartList_BeginningEdit"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Christine}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight_PartList}"
ColumnHeaderStyle="{StaticResource Main_DataGridColumnHeader}"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
RowBackground="{StaticResource BeamWall_BLackSqueeze}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight_PartList}">
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<Setter Property="Background" Value="{Binding Background}"/>
<EventSetter Event="PreviewMouseDown" Handler="RawPartRow_PreviewMouseDown"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsRowEnabled}" Value="False">
<Setter Property="IsEnabled" Value="False"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
@@ -39,7 +39,7 @@
<TextBlock Text="{Binding Path=DataContext.ID_Msg, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight_PartList}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderBrush" Value="{Binding Search_Background}"/>
<Setter Property="BorderThickness" Value="2,2,0,2"/>
</Style>
@@ -53,7 +53,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="15"/>
</Grid.ColumnDefinitions>
<TextBlock Text="↓"
Visibility="{Binding CALC_FALL_Visibility}"
@@ -167,7 +167,7 @@
<DataGridTemplateColumn x:Key="colVERIFY">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Verifica"/>
<Image Source="/Resources/NewPage/VerifyIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -175,8 +175,7 @@
<Button ToolTip="{Binding Verify_ToolTip}"
Command="{Binding Verify_Command}"
IsEnabled="{Binding Verify_IsEnabled}"
Height="15" Width="15" Margin="0"
Style="{StaticResource ToolBarViewPanel_Button}">
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/CALCPanel/Verify.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
@@ -186,7 +185,7 @@
<DataGridTemplateColumn x:Key="colSIMUL">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Simula"/>
<TextBlock Text="CAM"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -194,8 +193,7 @@
<Button ToolTip="{Binding Simulate_ToolTip}"
Command="{Binding Simulate_Command}"
IsEnabled="{Binding Simulate_IsEnabled}"
Width="15" Height="15" Margin="0"
Style="{StaticResource ToolBarViewPanel_Button}">
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/CALCPanel/Simulate.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
@@ -205,7 +203,7 @@
<DataGridTemplateColumn x:Key="colPROD">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Produci"/>
<Image Source="/Resources/NewPage/ProduceRawPartIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -213,8 +211,7 @@
<Button Command="{Binding ProduceRawPart_Command}"
ToolTip="{Binding ProduceRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
Style="{StaticResource BTLPanel_Button}">
<Image Source="/Resources/TopPanel/ProduceRawPart.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
@@ -224,7 +221,7 @@
<DataGridTemplateColumn x:Key="colSETTING">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Opzioni"/>
<Image Source="/Resources/NewPage/SettingIntestazione.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -232,57 +229,48 @@
<StackPanel Margin="2">
<Button Command="{Binding ShowPopUpSettingBtnCommand}"
ToolTip="{Binding Settings_Command_ToolTip}"
Height="15" Width="15" Margin="0">
Style="{StaticResource BTLPanel_Button}"
Click="Button_Click">
<Image Source="/Resources/NewPage/Setting.png" Stretch="Uniform"/>
</Button>
<Popup IsOpen="{Binding IsSettingBtnOpen}"
AllowsTransparency="True"
<Popup AllowsTransparency="True"
PopupAnimation="Scroll"
StaysOpen="False"
PlacementTarget="{Binding ElementName=MachGroupVMList_DataGrid.Button}">
StaysOpen="False">
<StackPanel Style="{StaticResource OnlyProdBTLPartManager_StackPanel}">
<!--COPY - Copia-->
<Button Command="{Binding CopyRawPart_Command}"
ToolTip="{Binding CopyRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Height="20" Width="20"
Click="ClosePopUp_Click"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/CopyRawPart.png" Stretch="Uniform"/>
</Button>
<!--DELETE - Elimina-->
<Button Command="{Binding RemoveRawPart_Command}"
ToolTip="{Binding RemoveRawPart_ToolTip}"
IsEnabled="{Binding RawPartManagerIsEnabled}"
Height="20" Width="20"
Click="ClosePopUp_Click"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/RemoveRawPart.png" Stretch="Uniform"/>
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
</Button>
<!--CAM - CAM-->
<Button ToolTip="{Binding Simulate_ToolTip}"
Command="{Binding Simulate_Command}"
IsEnabled="{Binding Simulate_IsEnabled}"
Width="20" Height="20"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/CALCPanel/Simulate.png" Stretch="Uniform"/>
</Button>
<!--REORDER - Riordina-->
<Button Command="{Binding ReOrderPart_Command}"
Visibility="{Binding MovePart_Visibility}"
ToolTip="{Binding ReOrderPart_ToolTip}"
IsEnabled="{Binding PartInRawPartManager_IsEnabled}"
Width="20" Height="20"
Click="ClosePopUp_Click"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/ReOrderPart.png" Stretch="Uniform"/>
</Button>
<!--RESET - Reset-->
<Button Command="{Binding ResetCalc_Command}"
ToolTip="{Binding ResetCalc_ToolTip}"
IsEnabled="{Binding CALCPanel_IsEnabled}"
Width="20" Height="20"
Click="ClosePopUp_Click"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/ResetCalc.png" Stretch="Uniform"/>
</Button>
</StackPanel>
</Popup>
</StackPanel>
@@ -297,27 +285,27 @@
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<StackPanel>
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding PartVMList}"
SelectedItem="{Binding SelPart, UpdateSourceTrigger=PropertyChanged}"
<EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding Tag.SelectedMachGroup.PartVMList,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"
SelectedItem="{Binding Tag.SelectedMachGroup.SelPart,
RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"
CanUserDeleteRows="False"
CanUserSortColumns="False"
SelectionMode="Single"
Margin="20,0,0,5"
Margin="15,0,0,5"
BeginningEdit="PartInRawPartList_BeginningEdit"
BindingColumns="{Binding DataContext.PartInRawPartColumns, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"
AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
AlternationCount="2"
ColumnHeaderBackground="{StaticResource BeamWall_Christine}"
ColumnHeaderForeground="{StaticResource BeamWall_White}"
ColumnHeaderHorizontalContentAlignment="Center"
ColumnHeaderFontWeight="Bold"
ColumnHeaderFontSize="15"
ColumnHeaderPadding="0,2,0,2"
CellStyle="{StaticResource CellDataGrid_CustomHighLight_PartList}"
ColumnHeaderStyle="{StaticResource RawPart_DataGridColumnHeader}"
GridLinesVisibility="None"
BorderThickness="0"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
Width="860"
CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
Style="{StaticResource DataGrid_OnlyProd}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight_PartList}">
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
<Setter Property="Background" Value="{Binding Background}"/>
<!--<EventSetter Event="PreviewMouseDown" Handler="PartInRawPartRow_PreviewMouseDown"/>-->
<EventSetter Event="PreviewMouseDown" Handler="PartInRawPartRow_PreviewMouseDown"/>
</Style>
</DataGrid.RowStyle>
@@ -328,9 +316,9 @@
<TextBlock Text="{Binding Path=DataContext.PDN_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight_PartList}">
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderBrush" Value="{Binding Search_Background}"/>
<Setter Property="BorderThickness" Value="2,2,0,2"/>
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
@@ -362,7 +350,7 @@
</Grid.RowDefinitions>
<Ellipse Width="5"
Height="5"
Fill="Red"
Fill="{StaticResource Omag_Blue}"
Visibility="{Binding CALC_ROT_Visibility}"
HorizontalAlignment="Center"/>
<TextBlock Grid.Row="1"
@@ -382,30 +370,28 @@
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!--W - Larghezza-->
<DataGridTextColumn x:Key="colW" Binding="{Binding sW}" SortMemberPath="dW">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.W_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
</DataGridTextColumn>
<!--H - Altezza-->
<DataGridTextColumn x:Key="colH" Binding="{Binding sH}" SortMemberPath="dH">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.H_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--L - Lunghezza-->
<DataGridTextColumn x:Key="colL" Binding="{Binding sL}" SortMemberPath="dL">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.L_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--ROT - Rotazione-->
<DataGridTemplateColumn x:Key="colROT" SortMemberPath="dROT">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.ROTATION_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
<Image Source="/Resources/NewPage/RotateIntestazioneRawPart.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -416,12 +402,13 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sROT}"
TextAlignment="Center"/>
TextAlignment="Center"
Margin="2,3,0,2"/>
<Button Grid.Column="1"
Command="{Binding ForwardRotation_Command}"
Height="15" Width="15"
Margin="-5,0,5,0">
<Image Source="/Resources/PartManager/RightRotate.png" Stretch="Uniform"/>
Margin="-5,0,5,0"
Style="{StaticResource RawPart_Button}">
<Image Source="/Resources/NewPage/Rotate.png" Stretch="Uniform"/>
</Button>
</Grid>
</DataTemplate>
@@ -431,7 +418,7 @@
<DataGridTemplateColumn x:Key="colFLIP">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=DataContext.INVERSION_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
<Image Source="/Resources/NewPage/InversionIntestazioneRawPart.png" Stretch="Uniform" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
@@ -449,6 +436,11 @@
<TextBlock Text="{Binding Path=DataContext.PosX_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Blue" />
@@ -462,6 +454,11 @@
<TextBlock Text="{Binding Path=DataContext.PosY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Blue" />
@@ -475,6 +472,11 @@
<TextBlock Text="{Binding Path=DataContext.Offset_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="Blue" />
@@ -486,33 +488,48 @@
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.MAT_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--GRP - Gruppo-->
<DataGridTextColumn x:Key="colGROUP" Binding="{Binding sGROUP}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.GRP_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--STOREY - Sottogruppo-->
<DataGridTextColumn x:Key="colSTOREY" Binding="{Binding sSTOREY}">
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.STOREY_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdRawPartListV}}}"/>
</DataGridTextColumn.Header>
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource CellDataGrid_CustomHighLight}">
<Setter Property="BorderThickness" Value="2,4,0,2"/>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--MUP - MoveUp-->
<DataGridTemplateColumn x:Key="colMOVEUP">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Move Up"/>
<TextBlock Text=""/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Command="{Binding MoveUpPart_Command}"
ToolTip="{Binding MoveUpPart_ToolTip}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/MoveUpPart.png" Stretch="Uniform"/>
Margin="0"
Style="{StaticResource RawPart_Button}">
<Image Source="/Resources/NewPage/MoveUp.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
@@ -521,16 +538,16 @@
<DataGridTemplateColumn x:Key="colMOVEDOWN">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Move Down"/>
<TextBlock Text=""/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Command="{Binding MoveDownPart_Command}"
ToolTip="{Binding MoveDownPart_ToolTip}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/MoveDownPart.png" Stretch="Uniform"/>
Margin="0"
Style="{StaticResource RawPart_Button}">
<Image Source="/Resources/NewPage/MoveDown.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
@@ -539,16 +556,16 @@
<DataGridTemplateColumn x:Key="colREMOVE">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="Remove"/>
<TextBlock Text=""/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Command="{Binding RemovePart_Command}"
ToolTip="{Binding RemovePart_ToolTip}"
Width="15" Height="15" Margin="0"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/TopPanel/RemovePart.png" Stretch="Uniform"/>
Margin="0"
Style="{StaticResource RawPart_Button}">
<Image Source="/Resources/NewPage/Remove.png" Stretch="Uniform"/>
</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
@@ -1,4 +1,6 @@
Imports EgtBEAMWALL.Core
Imports EgtUILib.EgtInterface
Imports System.Windows.Controls.Primitives
Public Class OnlyProdRawPartListV
@@ -8,7 +10,9 @@ Public Class OnlyProdRawPartListV
If TypeOf sender Is DataGridRow Then
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
Dim RowVM As MyMachGroupVM = DirectCast(Row.DataContext, MyMachGroupVM)
' se gia' selezionato rifaccio selezione perche' potrbbe essere selezionato un BTLPart
Dim DataGridDetailsPresenter As Object = TreeHelperManager.FindVisualParents(Of Button, CheckBox, Primitives.DataGridDetailsPresenter)(e.OriginalSource)
If Not IsNothing(DataGridDetailsPresenter) Then Return
' se gia' selezionato rifaccio selezione perche' potrebbe essere selezionato un BTLPart
If Not IsNothing(Row) AndAlso Row.IsSelected Then
Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup
End If
@@ -46,27 +50,57 @@ Public Class OnlyProdRawPartListV
})
End Sub
'' funzione che permette di selezionare un pezzo anche quando gia' selezionato
'Private Sub PartInRawPartRow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
' If TypeOf sender Is DataGridRow Then
' Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
' If Not IsNothing(Row) Then
' Dim MyMachGroup As Core.MyMachGroupVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup
' If EgtGetCurrMachGroup() = GDB_ID.NULL Then Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = MyMachGroup
' MyMachGroup.SelPart = MyMachGroup.SelPart
' End If
' End If
'End Sub
Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
Dim btn As Button = DirectCast(sender, Button) ' Ottieni il bottone che ha generato l'evento
Dim parent As DependencyObject = btn
'' funzione che impedisce di editare le righe che sono gia' in produzione
'Private Sub PartInRawPartList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs)
' If IsNothing(e.Row) Then Return
' Dim RowVM As PartVM = DirectCast(e.Row.DataContext, PartVM)
' ' se in produzione impedisco modifica dei parametri
' If RowVM.nProduction_State > ItemState.ND Then
' 'For Each cell In Row.Item
' e.Cancel = True
' End If
'End Sub
' Cerca il Popup nel Visual Tree
While parent IsNot Nothing AndAlso Not TypeOf parent Is DataGridRow
parent = VisualTreeHelper.GetParent(parent)
End While
If parent IsNot Nothing Then
Dim row As DataGridRow = DirectCast(parent, DataGridRow)
Dim popup As Popup = TryCast(TreeHelperManager.FindVisualChild(Of Popup)(row), Popup)
If popup IsNot Nothing Then
popup.PlacementTarget = btn ' Associa il popup al bottone
popup.IsOpen = True ' Mostra il popup
End If
End If
End Sub
' funzione che permette di selezionare un pezzo anche quando gia' selezionato
Private Sub PartInRawPartRow_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
If TypeOf sender Is DataGridRow Then
Dim Row As DataGridRow = DirectCast(sender, DataGridRow)
If Not IsNothing(Row) Then
Dim MyMachGroup As Core.MyMachGroupVM = Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup
If EgtGetCurrMachGroup() = GDB_ID.NULL Then Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup = MyMachGroup
MyMachGroup.SelPart = MyMachGroup.SelPart
End If
End If
End Sub
' funzione che impedisce di editare le righe che sono gia' in produzione
Private Sub PartInRawPartList_BeginningEdit(sender As Object, e As DataGridBeginningEditEventArgs)
If IsNothing(e.Row) Then Return
Dim RowVM As PartVM = DirectCast(e.Row.DataContext, PartVM)
' se in produzione impedisco modifica dei parametri
If RowVM.nProduction_State > ItemState.ND Then
'For Each cell In Row.Item
e.Cancel = True
End If
End Sub
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 Popup As Primitives.Popup = DirectCast(StackPanel.Parent, Primitives.Popup)
If Not IsNothing(Popup) Then
Popup.IsOpen = False
End If
End Sub
End Class
@@ -8,19 +8,19 @@ Public Class PParameterListVM
#Region "FIELDS & PROPERTIES"
Private m_colPParam_Value As EgtDataGridColumn
Public ReadOnly Property colPParam_Value As EgtDataGridColumn
Private m_colPParam_Value As EgwWPFBaseLib.ColumnLayout
Public ReadOnly Property colPParam_Value As EgwWPFBaseLib.ColumnLayout
Get
Return m_colPParam_Value
End Get
End Property
Private m_PParameterListColumns As New ObservableCollection(Of EgtDataGridColumn)
Public Property PParameterListColumns As ObservableCollection(Of EgtDataGridColumn)
Private m_PParameterListColumns As New ObservableCollection(Of EgwWPFBaseLib.ColumnLayout)
Public Property PParameterListColumns As ObservableCollection(Of EgwWPFBaseLib.ColumnLayout)
Get
Return m_PParameterListColumns
End Get
Set(value As ObservableCollection(Of EgtDataGridColumn))
Set(value As ObservableCollection(Of EgwWPFBaseLib.ColumnLayout))
m_PParameterListColumns = value
End Set
End Property
@@ -35,6 +35,17 @@ Public Class PParameterListVM
End Set
End Property
Private m_sCurrDraw As String
Public ReadOnly Property sCurrDraw As String
Get
Return m_sCurrDraw
End Get
End Property
Friend Sub SetCurrDraw(sCurrDraw As String)
m_sCurrDraw = sCurrDraw
NotifyPropertyChanged(NameOf(sCurrDraw))
End Sub
#Region "Messages"
Public ReadOnly Property Custom_Msg As String
@@ -72,8 +83,24 @@ Public Class PParameterListVM
End Get
End Property
Public ReadOnly Property Ok_Msg As String
Get
Return EgtMsg(61761)
End Get
End Property
Public ReadOnly Property Cancel_Msg_Msg As String
Get
Return EgtMsg(61763)
End Get
End Property
#End Region ' Messages
' Definizione Comandi
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
@@ -81,17 +108,88 @@ Public Class PParameterListVM
Sub New()
' Aggiungo riferimento a Map
Map.SetRefPParameterListVM(Me)
'Dim NewColumnList As New ObservableCollection(Of EgwWPFBaseLib.ColumnLayout)({New EgwWPFBaseLib.ColumnLayout("colNAME", DataGridLengthUnitType.Auto, 1, True, Nothing, False, False, True, True, False, False),
' New EgwWPFBaseLib.ColumnLayout("colDESC", DataGridLengthUnitType.Pixel, 30, True, Nothing, True, True, True, True, True, True),
' New EgwWPFBaseLib.ColumnLayout("colVALUE", DataGridLengthUnitType.Pixel, 30, True, Nothing, True, True, True, False, True, True),
' New EgwWPFBaseLib.ColumnLayout("colMIN", DataGridLengthUnitType.Pixel, 30, True, Nothing, True, True, True, False, True, True),
' New EgwWPFBaseLib.ColumnLayout("colMAX", DataGridLengthUnitType.Pixel, 30, True, Nothing, True, True, True, False, True, True)})
'EgwWPFBaseLib.EgwDataGrid.WriteColumnLayout("C:\Temp\prova.json", S_PARAMETERLIST_P, NewColumnList)
' carico le colonne della datagrid
GetPrivateProfileColumns(S_PARAMETERLIST_P, PParameterListColumns)
EgwWPFBaseLib.EgwDataGrid.ReadColumnLayout("C:\Temp\prova.json", S_PARAMETERLIST_P, PParameterListColumns)
'' carico le colonne della datagrid
'GetPrivateProfileColumns(S_PARAMETERLIST_P, PParameterListColumns)
' recupero riferimento a colonna Value
m_colPParam_Value = PParameterListColumns.FirstOrDefault(Function(x) x.Name = COL_VALUE)
m_colPParam_Value = PParameterListColumns.FirstOrDefault(Function(x) x.Key = COL_VALUE)
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Friend Sub SetPParameterListIsEnabled(bIsEnabled As Boolean)
m_PParameterList_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(PParameterList_IsEnabled))
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()
'Map.refForcedStrategyBTLVM.ForcedStrategy()
Map.refOnlyProdManagerVM.CopyBuilding()
Map.refProjectVM.BTLStructureVM.SelBTLPart.SelBTLFeatureVM.ResetCalcFeature()
Map.refProjectVM.BTLStructureVM.SelBTLPart.ResetCalcPart()
Map.refForcedStrategyPanelVM.ForcedStrategy()
Map.refProjectVM.SetRawPartManagerVisibility(Visibility.Visible)
Map.refProjectVM.SetStrategyManagerVisibility(Visibility.Collapsed)
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
Map.refProjectVM.SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATURERAWPARTMANAGER)
' 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.SetRawPartManagerVisibility(Visibility.Visible)
Map.refProjectVM.SetStrategyManagerVisibility(Visibility.Collapsed)
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
Map.refProjectVM.SetSelFeatureManagerTab(ProjectVM.FeatureManagerTab.FEATURERAWPARTMANAGER)
' Abilito LeftPanel
Map.refProjectVM.SetOnlyProdLeftPanel_IsEnabled(True)
Map.refProjectVM.SetOnlyProdLeftPanel_Opacity(1)
End Sub
#End Region ' Cancel_Command
#End Region ' Commands
End Class
@@ -4,6 +4,8 @@ Imports EgtUILib
Public Class PartInRawPartListVM
#Region "FIELDS & PROPERTIES"
Private m_colPartInRawPart_Offset As EgtDataGridColumn
Public ReadOnly Property colPartInRawPart_Offset As EgtDataGridColumn
Get
@@ -128,6 +130,8 @@ Public Class PartInRawPartListVM
#End Region ' Messages
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
@@ -137,6 +141,8 @@ Public Class PartInRawPartListVM
#End Region ' CONSTRUCTOR
#Region "METHODS"
Friend Sub UpdateColumns(nMachType As MachineType)
If nMachType = MachineType.BEAM Then
PartInRawPartColumns.Clear()
@@ -153,7 +159,7 @@ Public Class PartInRawPartListVM
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
' aggiorno la visibilità delle colonne
For Each col In PartInRawPartColumns
If Not bOnlyProd AndAlso nMachType = MachineType.BEAM AndAlso (col.Name.Equals(COL_ROT) OrElse col.Name.Equals(COL_FLIP) OrElse col.Name.Equals(COL_POSX)) Then
If nMachType = MachineType.BEAM AndAlso (col.Name.Equals(COL_ROT) OrElse col.Name.Equals(COL_FLIP) OrElse col.Name.Equals(COL_POSX)) Then
col.Visible = False
Else
col.Visible = True
@@ -162,4 +168,6 @@ Public Class PartInRawPartListVM
Next
End Sub
#End Region ' METHODS
End Class
@@ -3,6 +3,8 @@
Public Class QBTLParamVM
Inherits BTLParamVM
#Region "FIELDS & PROPERTIES"
Private m_Process As Integer
Public Property Process As Integer
Get
@@ -35,6 +37,8 @@ Public Class QBTLParamVM
End Get
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New(BTLParamM As BTLParamM, GroupType As GRPType, Process As Integer)
@@ -97,9 +97,13 @@ Public Class QParameterListVM
#End Region ' CONSTRUCTOR
#Region "METHODS"
Friend Sub SetQParameterListIsEnabled(bIsEnabled As Boolean)
m_QParameterList_IsEnabled = bIsEnabled
NotifyPropertyChanged(NameOf(QParameterList_IsEnabled))
End Sub
#End Region ' METHODS
End Class
@@ -217,13 +217,13 @@ Public Class RawPartListVM
#Region "METHODS"
Friend Sub UpdateColumns(nMachType As MachineType)
If nMachType = MachineType.BEAM Then
Friend Sub UpdateColumns(nProjectType As BWType)
If nProjectType = BWType.BEAM Then
RawPartColumns.Clear()
GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
PartInRawPartColumns.Clear()
GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns)
ElseIf nMachType = MachineType.WALL Then
ElseIf nProjectType = BWType.WALL Then
RawPartColumns.Clear()
GetPrivateProfileColumns(S_RAWPARTLIST_WALL, RawPartColumns)
PartInRawPartColumns.Clear()
@@ -239,18 +239,18 @@ Public Class RawPartListVM
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
Next
' recupero riferimento a colonne Offset, Rot, Flip, PosX, PosY
m_colPartInRawPart_Offset = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_OFFSET)
m_colPartInRawPart_Rot = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_ROT)
m_colPartInRawPart_Flip = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
m_colPartInRawPart_PosX = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
m_colPartInRawPart_Offset = PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_OFFSET)
m_colPartInRawPart_Rot = PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_ROT)
m_colPartInRawPart_Flip = PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
m_colPartInRawPart_PosX = PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
m_colPartInRawPart_PosY = PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
' aggiorno la visibilità delle colonne
For Each col In PartInRawPartColumns
If Not bOnlyProd AndAlso nMachType = MachineType.BEAM AndAlso (col.Name.Equals(COL_ROT) OrElse col.Name.Equals(COL_FLIP) OrElse col.Name.Equals(COL_POSX)) Then
col.Visible = False
Else
col.Visible = True
End If
'If nProjectType = BWType.WALL AndAlso (col.Name.Equals(COL_ROT) OrElse col.Name.Equals(COL_FLIP)) Then
' col.Visible = False
'Else
' col.Visible = True
'End If
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
Next
End Sub
+144 -154
View File
@@ -2,7 +2,6 @@
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports EgtWPFLib5
Imports System.IO
Public Class LeftPanelVM
Inherits VMBase
@@ -58,17 +57,49 @@ Public Class LeftPanelVM
NotifyPropertyChanged(NameOf(IsFilterBtnOpen))
End Sub
'Public ReadOnly Property RotatePart_IsEnabled As Boolean
' Get
' Return Not IsNothing(Map.refProjectVM) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 1
' End Get
'End Property
Private m_RotateAll_IsEnabled As Boolean = False
Public ReadOnly Property RotateAll_IsEnabled As Boolean
Get
Return m_RotateAll_IsEnabled
End Get
End Property
Friend Sub SetRotateAll_IsEnabled(value As Boolean)
m_RotateAll_IsEnabled = value
NotifyPropertyChanged(NameOf(RotateAll_IsEnabled))
End Sub
Private m_IsProjectParametersBtnOpen As Boolean = False
Public Property IsProjectParametersBtnOpen As Boolean
Get
Return m_IsProjectParametersBtnOpen
End Get
Set(value As Boolean)
m_IsProjectParametersBtnOpen = value
End Set
End Property
Friend Sub SetIsProjectParametersBtnOpen(bIsProjectParametersBtnOpen As Boolean)
m_IsProjectParametersBtnOpen = bIsProjectParametersBtnOpen
NotifyPropertyChanged(NameOf(IsProjectParametersBtnOpen))
End Sub
Private m_CALCPanel_IsEnabled As Boolean = True
Public ReadOnly Property CALCPanel_IsEnabled As Boolean
Get
Return m_CALCPanel_IsEnabled
End Get
End Property
Friend Sub SetCALCPanel_IsEnabled(value As Boolean)
m_CALCPanel_IsEnabled = value
NotifyPropertyChanged(NameOf(CALCPanel_IsEnabled))
End Sub
' Definizione comandi
Private m_cmdVerifyAll As ICommand
Private m_cmdShowPopUpFilterBtnCmd As ICommand
Private m_cmdBackRotation As ICommand
Private m_cmdInvert As ICommand
Private m_cmdRotateAll As ICommand
Private m_cmdInvertAll As ICommand
Private m_cmdResetCalc As ICommand
Private m_cmdProjectParametersBtnCmd As ICommand
#Region "Messages"
@@ -125,6 +156,36 @@ Public Class LeftPanelVM
End Get
End Property
Public ReadOnly Property FilterAll_ToolTip As String
Get
Return EgtMsg(62570)
End Get
End Property
Public ReadOnly Property ResetCalc_ToolTip As String
Get
Return EgtMsg(61940)
End Get
End Property
Public ReadOnly Property RotateAll_ToolTip As String
Get
Return EgtMsg(63029)
End Get
End Property
Public ReadOnly Property InvertAll_ToolTip As String
Get
Return EgtMsg(63030)
End Get
End Property
Public ReadOnly Property MultipleModify_ToolTip As String
Get
Return EgtMsg(63031)
End Get
End Property
#End Region ' Messages
#End Region 'FIELDS & PROPERTIES
@@ -148,35 +209,12 @@ Public Class LeftPanelVM
NotifyPropertyChanged(NameOf(SearchFilter_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
#End Region ' METHODS
#Region "COMMANDS"
#Region "VerifyAll"
''' <summary>
''' Returns a command that do Open.
''' </summary>
Public ReadOnly Property VerifyAll_Command As ICommand
Get
If m_cmdVerifyAll Is Nothing Then
@@ -186,102 +224,16 @@ Public Class LeftPanelVM
End Get
End Property
''' <summary>
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub VerifyAll()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
Dim ProjType As BWType
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
ProjType = ProjectManagerVM.CurrProj.nType
If Not CreateBarListToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING Then
ProjType = ProjectManagerVM.CurrProd.nType
If Not CreateBarListToVerify(Pages.MACHINING, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
ProjType = ProjectManagerVM.CurrProd.nType
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.CurrProj.sProjDirPath, 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
End If
If (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM)) Then Return
SetCALCPanel_IsEnabled(False)
For PartIndex As Integer = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Map.refProjectVM.BTLStructureVM.BTLPartVMList(PartIndex).SetIsRowEnabled(False)
Next
Map.refCALCPanelVM.VerifyAll(ProjectType.PROJ)
Return
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 = Map.refMachinePanelVM.SelectedMachine.Name,
.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 ' VerifyAll
#Region "ShowPopUpFilterBtnCommand"
@@ -305,30 +257,48 @@ Public Class LeftPanelVM
#End Region ' ShowPopUpFilterBtnCommand
#Region "BackRotation"
#Region "ProjectParameters_Command"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property BackRotation_Command As ICommand
Public ReadOnly Property ProjectParameters_Command As ICommand
Get
If m_cmdBackRotation Is Nothing Then
m_cmdBackRotation = New Command(AddressOf BackRotation)
If m_cmdProjectParametersBtnCmd Is Nothing Then
m_cmdProjectParametersBtnCmd = New Command(AddressOf ProjectParameters)
End If
Return m_cmdBackRotation
Return m_cmdProjectParametersBtnCmd
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub BackRotation()
If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
Public Sub ProjectParameters()
'Map.refOnlyProdManagerVM.GeneralParametersStrategyVM = New GeneralParametersStrategyVM()
'Dim GeneralParametersStrategyWnd As New GeneralParametersStrategyV(Application.Current.MainWindow, Map.refOnlyProdManagerVM.GeneralParametersStrategyVM)
'GeneralParametersStrategyWnd.ShowDialog()
Dim GeneralParametersWnd As New GeneralParametersWnd(Application.Current.MainWindow, New GeneralParametersWndVM())
GeneralParametersWnd.ShowDialog()
End Sub
#End Region ' ProjectParameters_Command
#Region "RotateAll"
Public ReadOnly Property RotateAll_Command As ICommand
Get
If m_cmdRotateAll Is Nothing Then
m_cmdRotateAll = New Command(AddressOf RotateAll)
End If
Return m_cmdRotateAll
End Get
End Property
Public Sub RotateAll()
If IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
' salvo sezione impostata
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
Configuration.AssembledMode(bShowBuilding)
If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
' ruoto i pezzi selezionati
For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
Part.BackRotation(False, False)
@@ -344,30 +314,27 @@ Public Class LeftPanelVM
EgtDraw()
End Sub
#End Region ' BackRotation
#End Region ' RotateAll
#Region "Invert"
#Region "InvertAll"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property Invert_Command As ICommand
Public ReadOnly Property InvertAll_Command As ICommand
Get
If m_cmdInvert Is Nothing Then
m_cmdInvert = New Command(AddressOf Invert)
If m_cmdInvertAll Is Nothing Then
m_cmdInvertAll = New Command(AddressOf InvertAll)
End If
Return m_cmdInvert
Return m_cmdInvertAll
End Get
End Property
''' <summary>
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub Invert()
If ((Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE) AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
Public Sub InvertAll()
If IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
Configuration.AssembledMode(bShowBuilding)
If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
' inverto i pezzi selezionati
For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
Part.Invert()
@@ -376,7 +343,30 @@ Public Class LeftPanelVM
If bShowBuilding Then Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False)
End Sub
#End Region ' Invert
#End Region ' InvertAll
#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
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
If Part.nGlobalState <> CalcStates.NOTCALCULATED Then
' resetto stato dei calcoli
Part.ResetCalcTotalPart()
End If
Next
End Sub
#End Region ' ResetCalc
#End Region ' COMMANDS
@@ -26,19 +26,28 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button ToolTip="{Binding VerifyAll_ToolTip}"
<Button ToolTip="{Binding VerifyAll_ToolTip}" VerticalAlignment="Top"
Command="{Binding VerifyAll_Command}"
IsEnabled="{Binding VerifyAll_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/VerifyAll.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="1"
Name="FilterAllBtn"
Command="{Binding ResetCalc_Command}" VerticalAlignment="Top"
ToolTip="{Binding ResetCalc_ToolTip}"
IsEnabled="{Binding CALCPanel_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/ResetCalc.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="2"
Name="FilterAllBtn" VerticalAlignment="Top"
ToolTip="{Binding FilterAll_ToolTip}"
Command="{Binding ShowPopUpFilterBtnCommand}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
@@ -91,7 +100,7 @@
</Expander>
</UniformGrid>
</Popup>
<Expander Grid.Column="2"
<Expander Grid.Column="3"
Header="{Binding Section_Msg}"
Width="135"
Margin="0,4.5,5,0">
@@ -101,38 +110,42 @@
Style="{StaticResource OnlyProdLeftPanel_ListBox}"
ItemContainerStyle="{StaticResource AlternationIndex_ListBoxItem}"/>
</Expander>
<EgtWPFLib5:EgtTextBox Grid.Column="3"
<EgtWPFLib5:EgtTextBox Grid.Column="4"
Text="{Binding Tag.SearchText, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdLeftPanelV}}}"
TextAlignment="Justify"
Height="25"
Margin="0,6,4,0"
Style="{StaticResource SearchText_TextBox}"/>
<Button Grid.Column="4"
Command="{Binding BackRotation_Command}"
Visibility="{Binding ViewPage_Visibility}"
ToolTip="Ruota Tutti"
IsEnabled="{Binding RotatePart_IsEnabled}"
<Button Grid.Column="5" Visibility="Collapsed"
Command="{Binding RotateAll_Command}"
ToolTip="{Binding RotateAll_ToolTip}"
IsEnabled="{Binding RotateAll_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/PartManager/LeftRotate.png" Stretch="Uniform"/>
<Image Source="/Resources/NewPage/Rotate.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="5"
Command="{Binding Invert_Command}"
Visibility="{Binding ViewPage_Visibility}"
ToolTip="Inverti Tutti"
IsEnabled="{Binding RotatePart_IsEnabled}"
<Button Grid.Column="6" Visibility="Collapsed"
Command="{Binding InvertAll_Command}"
ToolTip="{Binding InvertAll_ToolTip}"
IsEnabled="{Binding RotateAll_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/PartManager/LeftInvert.png" Stretch="Uniform"/>
<Image Source="/Resources/NewPage/Inversion.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="6"
ToolTip="Modifica Multipla"
<Button Grid.Column="7" Visibility="Collapsed"
Command="{Binding Edit_Command}"
IsEnabled="{Binding Edit_IsEnabled}"
Visibility="{Binding Edit_Visibility}"
ToolTip="{Binding MultipleModify_ToolTip}"
IsEnabled="{Binding RotateAll_IsEnabled}"
HorizontalAlignment="Right"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/CALCPanel/Edit.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="8"
VerticalAlignment="Top"
Command="{Binding ProjectParameters_Command}"
ToolTip="Parametri Progetto"
HorizontalAlignment="Right"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/NewPage/adjustment.png" Stretch="Uniform"/>
</Button>
</Grid>
<EgtBEAMWALL:OnlyProdBTLPartListV Grid.Row="1"
@@ -13,60 +13,36 @@ Public Class MyMachGroupPanelVM
End Get
Set(value As MyMachGroupVM)
' deevidenzio BTLPart di questo pezzo
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
EgtBeamShowFacesName(False)
EgtBeamShowLoadingSide(False, False)
' mostro pezzi selezionati
'If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count = 1 Then
' ' se pezzo evidenziato da selezione precedente
' If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST Then
' Dim nSelBTLPartId As Integer = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).nPartId
' ' deevidenzio MachGroup e Duplo di questo pezzo
' Configuration.ResetSearchPiece(nSelBTLPartId)
' End If
'End If
'If Not IsNothing(SelectedMachGroup) AndAlso Not IsNothing(SelectedMachGroup.SelPart) AndAlso Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
' Configuration.ResetSearch(SelectedMachGroup.SelPart.nPartId)
'End If
' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
' se precedente pezzo selezionato
If Not IsNothing(value) AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART AndAlso Map.refProjectVM.BTLStructureVM.SelBTLParts.Count > 0 Then
Dim SelBTLPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLParts(0)
' deseleziono pezzo in lista BTLPart
For BTLPartIndex = Map.refProjectVM.BTLStructureVM.SelBTLParts.Count - 1 To 0 Step -1
Map.refProjectVM.BTLStructureVM.SelBTLParts.RemoveFromList(Map.refProjectVM.BTLStructureVM.SelBTLParts(BTLPartIndex))
Next
' e lo evidenzio
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
Map.refShowBeamPanelVM.SetShowSolid(False)
Else
Map.refProjectVM.BTLStructureVM.SetSelectionType(BTLStructureVM.SelectionTypes.HIGHLIGHT)
End If
Map.refProjectVM.BTLStructureVM.SelBTLParts.Add(SelBTLPart)
End If
EgtBeamShowFacesName(False)
EgtBeamShowLoadingSide(False, False)
' se modalita' assemblato
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
Map.refProjectVM.SetSceneShowBuldingVisibility(Visibility.Collapsed)
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
Map.refShowBeamPanelVM.SetShowBuilding(False)
Map.refProjectVM.SetManagerTabVisibility(Visibility.Visible)
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Map.refProjectVM.SetFeatureListVisibility(Visibility.Visible)
End If
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound()
Next
End If
If Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then Map.refShowBeamPanelVM.bShowAll = False
m_SelectedMachGroup = value
If Not IsNothing(value) Then
OnPreSetCurrMachGroup()
EgtSetCurrMachGroup(value.Id)
OnPostSetCurrMachGroup()
' imposto tipo di grid selezionata
Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.MACHGROUP)
Map.refStatisticsTimePanelVM.SetMachiningPage_Visibility(Visibility.Visible)
Map.refStatisticsTimePanelVM.SetViewPage_Visibility(Visibility.Collapsed)
End If
If IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) Then
Map.refProjectVM.SetFeatureListVisibility(Visibility.Collapsed)
End If
NotifyPropertyChanged(NameOf(SelectedMachGroup))
'' imposto tipo di grid selezionata
'If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Not IsNothing(value) Then
' Map.refProjectVM.SetLastSelGridType(ProjectVM.GridSelTypes.MACHGROUP)
' Map.refStatisticsTimePanelVM.SetMachiningPage_Visibility(Visibility.Visible)
'End If
' se MachGroup gia' mandato in produzione,disabilito pulsanti verify e reset
If Not IsNothing(SelectedMachGroup) AndAlso SelectedMachGroup.nProduction_State >= ItemState.Assigned Then
Map.refCALCPanelVM.SetVerifyIsEnabled(False)
Else
Map.refCALCPanelVM.SetCalcPanelIsEnabled(True)
End If
End Set
End Property
@@ -20,50 +20,51 @@ Public Class MyMachGroupVM
Return m_SelPart
End Get
Set(value As Core.PartVM)
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
' mostro pezzi selezionati
Map.refShowBeamPanelVM.bShowAll = False
' se pezzo evidenziato da ultima selezione precedente
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST AndAlso Map.refProjectVM.BTLStructureVM.SelBTLParts.Count = 1 Then
Dim nSelBTLPartId As Integer = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).nPartId
' deevidenzio MachGroup e Duplo di questo pezzo
Configuration.ResetSearchPiece(nSelBTLPartId)
End If
If Not IsNothing(m_SelPart) Then
' deevidenzio BTLPart di questo pezzo
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim nDuploOriginalId As Integer = 0
If EgtGetInfo(m_SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound()
Exit For
' mostro pezzi selezionati
Map.refShowBeamPanelVM.bShowAll = False
' se pezzo evidenziato da ultima selezione precedente
If Map.refProjectVM.BTLStructureVM.SelBTLParts.Count = 1 Then
' deevidenzio MachGroup e Duplo di questo pezzo
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
Dim MachGroupList As New List(Of MyMachGroupVM)
For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
Dim bFound As Boolean = False
For Each Part As PartVM In Machgroup.PartVMList
If EgtDuploGetOriginal(Part.nPartId) = Map.refProjectVM.BTLStructureVM.SelBTLParts(0).nPartId Then
Part.ResetSearchFound()
bFound = True
End If
Next
End If
Map.refProjectVM.SetFeatureListVisibility(False)
If bFound Then
Machgroup.ResetSearchFound()
End If
Next
End If
' se modalita' assemblato
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
If Not IsNothing(m_SelPart) Then
' deevidenzio BTLPart di questo pezzo
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim nDuploOriginalId As Integer = 0
If EgtGetInfo(m_SelPart.nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound()
Exit For
End If
Next
End If
Map.refProjectVM.SetFeatureListVisibility(Visibility.Collapsed)
End If
' se modalita' assemblato
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
m_SelPart = value
' seleziono pezzo
EgtDeselectAll()
If Not IsNothing(value) Then
If Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
'' deseleziono pezzo in lista BTLPart
'For BTLPartIndex = Map.refProjectVM.BTLStructureVM.SelBTLParts.Count - 1 To 0 Step -1
' Map.refProjectVM.BTLStructureVM.SelBTLParts.RemoveFromList(Map.refProjectVM.BTLStructureVM.SelBTLParts(BTLPartIndex))
'Next
Map.refProjectVM.SetFeatureListVisibility(True)
End If
Map.refProjectVM.SetFeatureListVisibility(Visibility.Visible)
EgtSelectObj(SelPart.nPartId)
If Map.refMainMenuVM.SelPage = Pages.MACHINING Then
DirectCast(m_SelPart, PartVM).SelectBTLPart()
End If
' trovo ed evidenzio BTLPart di questo pezzo
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
@@ -77,6 +78,14 @@ Public Class MyMachGroupVM
End If
If Not IsNothing(value) Then EgtDraw()
NotifyPropertyChanged(NameOf(SelPart))
' se modalità building, la tolgo
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
Map.refProjectVM.SetSceneShowBuldingVisibility(Visibility.Collapsed)
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
Map.refShowBeamPanelVM.SetShowBuilding(False)
Map.refProjectVM.SetManagerTabVisibility(Visibility.Visible)
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Map.refProjectVM.SetFeatureListVisibility(Visibility.Visible)
End If
End Set
End Property
Friend Sub SetSelPart(value As Core.PartVM)
@@ -123,7 +132,14 @@ Public Class MyMachGroupVM
If m_PartVMList.Count > 0 Then
' verifico se la dimensione e' maggiore del box minimo dei pezzi
Dim b3Parts As New BBox3d
Configuration.VerifyMaxDimension(m_PartVMList, b3Parts)
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(m_PartVMList(0).nPartId, "Box")
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Parts)
For PartIndex = 1 To m_PartVMList.Count - 1
Dim b3Part As New BBox3d
nBoxLayerId = EgtGetFirstNameInGroup(m_PartVMList(PartIndex).nPartId, "Box")
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Part)
b3Parts.Add(b3Part)
Next
Dim b3RawPart As New BBox3d
EgtGetRawPartBBox(nRawPartId, b3RawPart)
Dim dMinValue As Double = 0
@@ -140,7 +156,19 @@ Public Class MyMachGroupVM
If EgtModifyRawPartSize(nRawPartId, dValue, MyMachGroupM.dW, MyMachGroupM.dH) Then
' riporto il grezzo nell'angolo tavola di origine
Dim b3Tab As New BBox3d
Configuration.SelectCorner(b3Tab, nRawPartId)
EgtGetTableArea(1, b3Tab)
Dim p3OrigOnTab As Point3d
Select Case CurrentMachine.OrigCorner
Case MCH_CR.BL
p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.BR
p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TL
p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TR
p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
End Select
EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner)
' sposto tutti i pezzi di quanto si e' accorciato il grezzo
If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.BR Then
For Each Part In m_PartVMList
@@ -179,7 +207,14 @@ Public Class MyMachGroupVM
If m_PartVMList.Count > 0 Then
' verifico se la dimensione e' maggiore del box minimo dei pezzi
Dim b3Parts As New BBox3d
Configuration.VerifyMaxDimension(m_PartVMList, b3Parts)
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(m_PartVMList(0).nPartId, "Box")
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Parts)
For PartIndex = 1 To m_PartVMList.Count - 1
Dim b3Part As New BBox3d
nBoxLayerId = EgtGetFirstNameInGroup(m_PartVMList(PartIndex).nPartId, "Box")
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Part)
b3Parts.Add(b3Part)
Next
Dim b3RawPart As New BBox3d
EgtGetRawPartBBox(nRawPartId, b3RawPart)
Dim dMinValue As Double = 0
@@ -196,7 +231,19 @@ Public Class MyMachGroupVM
If EgtModifyRawPartSize(nRawPartId, MyMachGroupM.dL, dValue, MyMachGroupM.dH) Then
' riporto il grezzo nell'angolo tavola di origine
Dim b3Tab As New BBox3d
Configuration.SelectCorner(b3Tab, nRawPartId)
EgtGetTableArea(1, b3Tab)
Dim p3OrigOnTab As Point3d
Select Case CurrentMachine.OrigCorner
Case MCH_CR.BL
p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.BR
p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TL
p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TR
p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
End Select
EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner)
' sposto tutti i pezzi di quanto si e' accorciato il grezzo
If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.TL Then
For Each Part In m_PartVMList
@@ -268,6 +315,17 @@ Public Class MyMachGroupVM
NotifyPropertyChanged(NameOf(IsSettingBtnOpen))
End Sub
Private m_IsRowEnabled As Boolean = True
Public ReadOnly Property IsRowEnabled As Boolean
Get
Return m_IsRowEnabled
End Get
End Property
Friend Sub SetIsRowEnabled(bIsRowEnabled As Boolean)
m_IsRowEnabled = bIsRowEnabled
NotifyPropertyChanged(NameOf(IsRowEnabled))
End Sub
#Region "Messages"
Public ReadOnly Property Verify_ToolTip As String
@@ -473,7 +531,7 @@ Public Class MyMachGroupVM
BeamWallMachGroup = Map.refMachGroupPanelVM.GetLastMachGroup()
' eseguo script creazione grezzo
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
If Not ExecBeam(sLogPath, ProjectManagerVM.CurrProd.sMachine, CalcIntegration.CmdTypes.RAWPART, False) Then
BeamWallMachGroup.DeleteMachGroup()
Dim LogFile As String() = File.ReadAllLines(sLogPath)
If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
@@ -550,7 +608,7 @@ Public Class MyMachGroupVM
BeamWallMachGroup = Map.refMachGroupPanelVM.GetLastMachGroup()
' eseguo script creazione grezzo
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
If Not ExecWall(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False, False) Then
If Not ExecWall(sLogPath, ProjectManagerVM.CurrProd.sMachine, CalcIntegration.CmdTypes.RAWPART, False, False) Then
BeamWallMachGroup.DeleteMachGroup()
Dim LogFile As String() = File.ReadAllLines(sLogPath)
If LogFile.Count >= 2 AndAlso Not IsNothing(LogFile(1)) Then
@@ -600,7 +658,7 @@ Public Class MyMachGroupVM
nRawId = EgtGetFirstRawPart()
End While
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
Return ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False)
Return ExecBeam(sLogPath, ProjectManagerVM.CurrProd.sMachine, CalcIntegration.CmdTypes.RAWPART, False)
End Function
Friend Sub MoveBeam(Beam As PartVM, MoveDirection As MoveDirections)
@@ -895,12 +953,6 @@ Public Class MyMachGroupVM
#End Region ' Parts
#End Region ' METHODS
#Region "COMMANDS"
#Region "DeleteMachGroup"
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Overrides Sub DeleteMachGroup(Optional bMultipleCommand As Boolean = False)
If EgtSetCurrMachGroup(Me.Id) Then
@@ -956,7 +1008,9 @@ Public Class MyMachGroupVM
Map.refMachGroupPanelVM.MachGroupVMList.Remove(Me)
End Sub
#End Region ' DeleteMachGroup
#End Region ' METHODS
#Region "COMMANDS"
#Region "ShowPopUpSettingBtnCommand"
@@ -998,101 +1052,8 @@ Public Class MyMachGroupVM
''' </summary>
Friend Sub Verify()
If ((IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
Dim ProjType As BWType
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
ProjType = ProjectManagerVM.CurrProd.nType
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
If Not CreateBarToVerify(Pages.VIEW, ProjType, BarList) Then Return
' lancio calcolo
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, Map.refOnlyProdManagerVM.CurrProj.sProjDirPath, 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, Map.refOnlyProdManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
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 = Map.refMachinePanelVM.SelectedMachine.Name,
.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)
Map.refCALCPanelVM.Verify(ProjectType.PROD)
Return
End Sub
#End Region ' VerifyCommand
@@ -1115,71 +1076,63 @@ Public Class MyMachGroupVM
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Simulate()
If ((IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
If ((IsNothing(ProjectManagerVM.CurrProd) 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.refOnlyProdManagerVM.CurrProd.nType
If Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART Then
If Not CreateBarToSimulate(Pages.VIEW, ProjType, BarList) Then Return
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProj.sProjDirPath, AddressOf ManageCalc)
ElseIf Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP Then
If Not CreateBarToSimulate(Pages.MACHINING, ProjType, BarList) Then Return
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End If
If Not CreateBarToSimulate(ProjType, BarList) Then Return
' lancio simulazione
EgtBEAMWALL.Core.CalcIntegration.Run(BarList, ProjectManagerVM.CurrProd.sProdDirPath, AddressOf ManageCalc)
End Sub
Private Function CreateBarToSimulate(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
Dim Bar As New EgtBEAMWALL.Core.Bar With {.nBarId = Map.refProjectVM.BTLStructureVM.SelBTLPart.nPartId,
.nProgramPage = ProjectType.PROJ,
.nProjType = ProjType,
.bBarOk = True,
.nMachineName = Map.refMachinePanelVM.SelectedMachine.Name,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
.nGlobState = Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState}
If Map.refProjectVM.BTLStructureVM.SelBTLPart.nGlobalState = CalcStates.NOTCALCULATED 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
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
Private Function CreateBarToSimulate(ProjType As BWType, ByRef BarList As Bar()) As Boolean
If Not IsNothing(Map.refMachGroupPanelVM.SelectedMachGroup) Then
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
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,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
.nGlobState = SelMachGroup.nGlobalState}
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
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
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,
.nCmdType = CalcIntegration.CmdTypes.SIMULATE,
.nGlobState = SelMachGroup.nGlobalState}
If SelMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
Dim sMachGroupFilePath As String = ProjectManagerVM.CurrProd.sProdDirPath & "\" & SelMachGroup.Name.ToString() & ".ori.bwe"
If File.Exists(sMachGroupFilePath) Then File.Delete(sMachGroupFilePath)
End If
TempBarList(0) = Bar
BarList = TempBarList
Else
Return False
End If
' disabilito interfaccia
Map.refProjectVM.SetCalcRunning(True)
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
#End Region ' SimulateCommand
#Region "ProduceRawPart"
@@ -1205,7 +1158,7 @@ Public Class MyMachGroupVM
' se attiva opzione e non ancora calcolato
If GetMainPrivateProfileInt(S_GENERAL, K_FASTPRODUCE, 0) = 1 And Map.refMachGroupPanelVM.SelectedMachGroup.nGlobalState = CalcStates.NOTCALCULATED Then
Map.refCALCPanelVM.SetFromProduce(CALCPanelVM.ProduceType.PRODUCE)
Map.refCALCPanelVM.Verify()
Map.refCALCPanelVM.Verify(ProjectType.PROD)
Return
End If
' verifico se modalita' supervisore attiva
@@ -1327,7 +1280,11 @@ Public Class MyMachGroupVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub RemoveRawPartCmd()
RemoveRawPart()
If MessageBox.Show(EgtMsg(62574) & Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.Name & " ?", EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Exclamation) = MessageBoxResult.OK Then
RemoveRawPart()
Else
Return
End If
End Sub
Public Sub RemoveRawPart(Optional bAll As Boolean = False)
@@ -1414,42 +1371,13 @@ Public Class MyMachGroupVM
''' Execute the Exec. This method is invoked by the ExecCommand.
''' </summary>
Public Sub ResetCalc()
If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PART OrElse Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.PARTLIST)) Then
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
For Each Part In Map.refProjectVM.BTLStructureVM.BTLPartVMList
If Part.nGlobalState <> CalcStates.NOTCALCULATED Then
' resetto stato dei calcoli
Part.ResetCalcTotalPart()
End If
Next
ElseIf Map.refProjectVM.BTLStructureVM.SelBTLPartsCnt > 1 Then
Else
Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart
If IsNothing(SelPart) Then Return
If SelPart.nGlobalState <> CalcStates.NOTCALCULATED Then
SelPart.ResetCalcTotalPart()
End If
End If
ElseIf Map.refMainMenuVM.SelPage = Pages.MACHINING OrElse (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso Map.refProjectVM.LastSelGridType = ProjectVM.GridSelTypes.MACHGROUP) Then
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
For Each MachGroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
If MachGroup.nProduction_State >= ItemState.Assigned Then Continue For
If MachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
MachGroup.ResetCalcTotalMachGroup()
End If
Next
Else
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
If IsNothing(SelMachGroup) Then Return
' se barra gia' assegnata a supervisore, esco
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
If SelMachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
SelMachGroup.ResetCalcTotalMachGroup()
End If
End If
If ((IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
If IsNothing(SelMachGroup) Then Return
' se barra gia' assegnata a supervisore, esco
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
If SelMachGroup.nGlobalState <> CalcStates.NOTCALCULATED Then
SelMachGroup.ResetCalcTotalMachGroup()
End If
End Sub
+26 -17
View File
@@ -222,11 +222,11 @@ Public Class PartVM
Dim vtDeltaBox As Vector3d = b3Box.Min - b3Part.Min
' reinserisco il pezzo nel grezzo
EgtAddPartToRawPart(nPartId, New Point3d(dTempPosX - vtDeltaBox.x, dTempPosY - vtDeltaBox.y, 0), ParentMachGroupVM.MyMachGroupM.nRawPartId)
ElseIf bOnlyProd AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
ElseIf Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
' elimino vecchio grezzo ed eseguo script creazione nuovo
DeleteOldRaw()
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
If Not ExecBeam(sLogPath, ProjectManagerVM.CurrProd.sMachine, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallita creazione barra nell'ExecBeam in bFlip")
' elimino vecchio grezzo ed eseguo script creazione nuovo
DeleteOldRaw()
@@ -236,7 +236,7 @@ Public Class PartVM
Else
NotifyPropertyChanged(NameOf(m_PartM.nFLIP))
End If
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
If Not ExecBeam(sLogPath, ProjectManagerVM.CurrProd.sMachine, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallita esecuzione ExecBeam. ERRORE")
End If
End If
@@ -280,6 +280,8 @@ Public Class PartVM
End Set
End Property
#Region "Messages"
Public ReadOnly Property MoveUpPart_ToolTip As String
Get
Return EgtMsg(61917)
@@ -298,6 +300,8 @@ Public Class PartVM
End Get
End Property
#End Region ' Messages
' Definizione comandi
Private m_cmdBackRotation As ICommand
Private m_cmdForwardRotation As ICommand
@@ -368,7 +372,7 @@ Public Class PartVM
End Sub
Private Sub Rotate(IsPositive As Boolean)
If bOnlyProd AndAlso Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
If Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.BEAM Then
' elimino vecchio grezzo ed eseguo script creazione nuovo
DeleteOldRaw()
' recupero layer del box
@@ -400,7 +404,7 @@ Public Class PartVM
' ripristino eventuale inversione
If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB)
Dim sLogPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\RawPartLog.txt"
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
If Not ExecBeam(sLogPath, ProjectManagerVM.CurrProd.sMachine, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallita creazione barra nell'ExecBeam in Rotate")
' elimino vecchio grezzo ed eseguo script creazione nuovo
DeleteOldRaw()
@@ -418,7 +422,7 @@ Public Class PartVM
EgtSetInfo(nPartId, MGR_PRT_ROT, m_PartM.dROT)
EgtRotate(nPartId, b3Box.Center, Vector3d.X_AX, -dRot, GDB_RT.GLOB)
If bFLIP Then EgtRotate(nPartId, b3Box.Center, Vector3d.Z_AX, 180, GDB_RT.GLOB)
If Not ExecBeam(sLogPath, Map.refMachinePanelVM.SelectedMachine.Name, CalcIntegration.CmdTypes.RAWPART, False) Then
If Not ExecBeam(sLogPath, ProjectManagerVM.CurrProd.sMachine, CalcIntegration.CmdTypes.RAWPART, False) Then
EgtOutLog("Fallita esecuzione ExecBeam. ERRORE")
End If
NotifyPropertyChanged(NameOf(sROT))
@@ -494,6 +498,7 @@ Public Class PartVM
nRawId = EgtGetFirstRawPart()
End While
End Sub
Friend Sub SelectBTLPart()
' eseguo la selezione nella lista pezzi
Dim nBTLPartId As Integer = MyMachGroupPanelM.DuploGetOriginal(nPartId)
@@ -841,17 +846,21 @@ Public Class PartVM
Public Sub RemovePart()
If IsNothing(ProjectManagerVM.CurrProd) Then Return
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
' Recupero indice elemento selezionato in lista
Dim Index As Integer = ParentMachGroupVM.PartVMList.IndexOf(SelMachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId))
If IsNothing(SelMachGroup) Then Return
' se barra gia' assegnata a supervisore, esco
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
Dim SelPart As PartVM = SelMachGroup.PartVMList(Index)
If IsNothing(SelPart) Then Return
SelPart.DeletePart()
SelMachGroup.UpdateUsage()
SelMachGroup.ResetCalcMachGroup()
If MessageBox.Show(EgtMsg(62575), EgtMsg(30009), MessageBoxButton.OKCancel, MessageBoxImage.Exclamation) = MessageBoxResult.OK Then
Dim SelMachGroup As MyMachGroupVM = Map.refMachGroupPanelVM.SelectedMachGroup
' Recupero indice elemento selezionato in lista
Dim Index As Integer = ParentMachGroupVM.PartVMList.IndexOf(SelMachGroup.PartVMList.FirstOrDefault(Function(x) x.nPartId = nPartId))
If IsNothing(SelMachGroup) Then Return
' se barra gia' assegnata a supervisore, esco
If SelMachGroup.nProduction_State >= ItemState.Assigned Then Return
Dim SelPart As PartVM = SelMachGroup.PartVMList(Index)
If IsNothing(SelPart) Then Return
SelPart.DeletePart()
SelMachGroup.UpdateUsage()
SelMachGroup.ResetCalcMachGroup()
Else
Return
End If
End Sub
#End Region ' RemovePart
@@ -8,58 +8,59 @@ Public Class MachinePanelVM
#Region "FIELDS & PROPERTIES"
Friend Enum ConfigTabs As Integer
EMPTY = 0
STRATEGYMANAGER = 1
MACHINEPARAMS = 2
End Enum
' Radice del direttorio delle macchine
Private m_sMachinesRoot As String
' Macchina correntemente selezionata e quindi attiva
Private m_SelectedMachine As Machine = Nothing
Public Overrides Property SelectedMachine As Machine
Public Shadows Property SelectedMachine As MyMachine
Get
Return m_SelectedMachine
End Get
Set(value As Machine)
Set(value As MyMachine)
If value IsNot m_SelectedMachine Then
' imposto macchina in DbGeometrico
If Not IsNothing(value) AndAlso EgtSetCurrMachine(value.Name) OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
If Not IsNothing(value) AndAlso EgtSetCurrMachine(value.Name) Then
m_SelectedMachine = value
' crea l'elenco dei parametri della macchina corrente
SelectedMachine.CreateMachParams()
' aggiorno lista strategie
Map.refStrategyManagerVM.Update()
End If
' Salvo impostazione macchina corrente
SaveCurrentMachine()
NotifyPropertyChanged(NameOf(SelectedMachine))
' Salvo impostazione macchina corrente
' SaveCurrentMachine()
' inizializzo la macchina selezionata come macchina corrente
Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType
SectionXMaterial.SetType(nMachType)
If Not IsNothing(value) Then
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
Else
InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, m_SelectedMachine.Name, nMachType)
End If
' mostro bottone tabella beam o wall a seconda del tipo
m_BeamTable_Visibility = If(nMachType = MachineType.BEAM OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
m_WallTable_Visibility = If(nMachType = MachineType.WALL OrElse nMachType = MachineType.BOTH, Visibility.Visible, Visibility.Collapsed)
NotifyPropertyChanged(NameOf(BeamTable_Visibility))
NotifyPropertyChanged(NameOf(WallTable_Visibility))
' carico i Parametri Q da mostrare (Beam, Wall o entrambi) in base al tipo di macchina selezionata
If Not IsNothing(Map.refConfigurationPageVM) Then
' carico i parametri Q dei Process letti dall'ini
Map.refConfigurationPageVM.GetQParamsList()
' carico la lista di tutti i parametri Q ciclando su ogni Process di PRCList
If Not IsNothing(Map.refConfigurationPageVM.QBTLParamVMList) Then
Map.refConfigurationPageVM.QBTLParamVMList.Clear()
End If
For Each PRCItem In Map.refConfigurationPageVM.PRCList
For Each QBTLParam In PRCItem.QBTLParamVMList
Map.refConfigurationPageVM.QBTLParamVMList.Add(QBTLParam)
Next
Next
NotifyPropertyChanged(NameOf(Map.refConfigurationPageVM.QBTLParamVMList))
End If
' aggiorno nome macchina in statusbar
Map.refMyStatusBarVM.RefreshMachName()
'Dim nMachType As MachineType = DirectCast(m_SelectedMachine, MyMachine).nType
'If Not IsNothing(value) Then
' InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, value.Name, nMachType)
'Else
' InitCurrentMachine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, m_SelectedMachine.Name, nMachType)
'End If
End If
End Set
End Property
Private m_nSelTab As ConfigTabs
Public Property nSelTab As Integer
Get
Return m_nSelTab
End Get
Set(value As Integer)
m_nSelTab = value
End Set
End Property
Friend Sub SetSelTab(nValue As ConfigTabs)
m_nSelTab = nValue
NotifyPropertyChanged(NameOf(nSelTab))
End Sub
Private m_MachPanel_IsEnabled As Boolean = True
Public Property MachPanel_IsEnabled As Boolean
Get
@@ -71,19 +72,19 @@ Public Class MachinePanelVM
End Set
End Property
Private m_BeamTable_Visibility As Visibility
Public ReadOnly Property BeamTable_Visibility As Visibility
Get
Return m_BeamTable_Visibility
End Get
End Property
'Private m_BeamTable_Visibility As Visibility
'Public ReadOnly Property BeamTable_Visibility As Visibility
' Get
' Return m_BeamTable_Visibility
' End Get
'End Property
Private m_WallTable_Visibility As Visibility
Public ReadOnly Property WallTable_Visibility As Visibility
Get
Return m_WallTable_Visibility
End Get
End Property
'Private m_WallTable_Visibility As Visibility
'Public ReadOnly Property WallTable_Visibility As Visibility
' Get
' Return m_WallTable_Visibility
' End Get
'End Property
Public ReadOnly Property SetUp_Visibility As Visibility
Get
@@ -91,6 +92,65 @@ Public Class MachinePanelVM
End Get
End Property
Private m_ChooseMachine_Visibility As Visibility = Visibility.Collapsed
Public ReadOnly Property ChooseMachine_Visibility As Visibility
Get
Return m_ChooseMachine_Visibility
End Get
End Property
Friend Sub SetChooseMachine_Visibility(IsVisible As Visibility)
m_ChooseMachine_Visibility = IsVisible
NotifyPropertyChanged(NameOf(ChooseMachine_Visibility))
End Sub
Private m_SelMachineName As String = String.Empty
Public ReadOnly Property SelMachineName As String
Get
Return m_SelMachineName
End Get
End Property
Friend Sub SetSelMachineName(value As String)
m_SelMachineName = value
NotifyPropertyChanged(NameOf(SelMachineName))
End Sub
Private m_bStrategyManagerIsChecked As Boolean = False
Public Property StrategyManagerIsChecked As Boolean
Get
Return m_bStrategyManagerIsChecked
End Get
Set(value As Boolean)
m_bStrategyManagerIsChecked = value
SetStrategyManagerIsChecked(m_bStrategyManagerIsChecked)
End Set
End Property
Friend Sub SetStrategyManagerIsChecked(value As Boolean)
m_bStrategyManagerIsChecked = value
m_bMachineParamsIsChecked = False
SetSelTab(ConfigTabs.STRATEGYMANAGER)
NotifyPropertyChanged(NameOf(StrategyManagerIsChecked))
NotifyPropertyChanged(NameOf(MachineParamsIsChecked))
End Sub
Private m_bMachineParamsIsChecked As Boolean = False
Public Property MachineParamsIsChecked As Boolean
Get
Return m_bMachineParamsIsChecked
End Get
Set(value As Boolean)
m_bMachineParamsIsChecked = value
SetMachineParamsIsChecked(m_bMachineParamsIsChecked)
End Set
End Property
Friend Sub SetMachineParamsIsChecked(value As Boolean)
m_bMachineParamsIsChecked = value
m_bStrategyManagerIsChecked = False
SetSelTab(ConfigTabs.MACHINEPARAMS)
NotifyPropertyChanged(NameOf(MachineParamsIsChecked))
NotifyPropertyChanged(NameOf(StrategyManagerIsChecked))
End Sub
#Region "Messages"
Public ReadOnly Property ToolDBMsg As String
@@ -98,22 +158,42 @@ Public Class MachinePanelVM
Return EgtMsg(90706)
End Get
End Property
Public ReadOnly Property MachiningDbMsg As String
Get
Return EgtMsg(90707)
End Get
End Property
Public ReadOnly Property SetUpMsg As String
Get
Return EgtMsg(90933)
End Get
End Property
Public ReadOnly Property ParameterMachineMsg As String
Public ReadOnly Property MachineParamsMsg As String
Get
Return EgtMsg(61778)
End Get
End Property
Public ReadOnly Property StrategyManagerMsg As String
Get
Return EgtMsg(62569)
End Get
End Property
Public ReadOnly Property CurrentMachineMsg As String
Get
Return EgtMsg(6565)
End Get
End Property
Public ReadOnly Property ChooseMachine_ToolTip As String
Get
Return EgtMsg(61941)
End Get
End Property
#End Region ' Messages
#Region "ToolTip"
@@ -123,25 +203,32 @@ Public Class MachinePanelVM
Return EgtMsg(5003)
End Get
End Property
Public ReadOnly Property MachiningDbToolTip As String
Get
Return EgtMsg(5004)
End Get
End Property
Public ReadOnly Property SetUpToolTip As String
Get
Return EgtMsg(31501)
End Get
End Property
Public ReadOnly Property SaveToolTip As String
Get
Return EgtMsg(30503)
End Get
End Property
#End Region ' ToolTip
' Definizione comandi
Private m_cmdBeamTable As ICommand
Private m_cmdWallTable As ICommand
Private m_cmdParameterMachine As ICommand
Private m_cmdChooseMachine As ICommand
Private m_cmdOk As ICommand
#End Region 'FIELDS & PROPERTIES
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
@@ -154,7 +241,7 @@ Public Class MachinePanelVM
MyMachine.MachineListInit(m_sMachinesRoot, MachineList)
End Sub
#End Region ' CONSTRUCTOR
#End Region ' Constructor
#Region "METHODS"
@@ -210,12 +297,7 @@ Public Class MachinePanelVM
' apro finestra di gestione lavorazioni travi
Dim sTitle = EgtMsg(9000) 'Tabelle delle lavorazioni delle travi
Dim BeamMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath)
Dim BeamMchsWinV As Object = Nothing
If bOnlyProd Then
BeamMchsWinV = New OnlyProdBeamMachiningsWindowV(Application.Current.MainWindow, BeamMchsWinVM)
Else
BeamMchsWinV = New BeamMachiningsWindowV(Application.Current.MainWindow, BeamMchsWinVM)
End If
Dim BeamMchsWinV As New OnlyProdBeamMachiningsWindowV(Application.Current.MainWindow, BeamMchsWinVM)
BeamMchsWinV.ShowDialog()
Else
' Impossibile aprire l'Editor delle lavorazioni delle travi.<br/>Mancano i file di configurazione. - Errore
@@ -234,12 +316,7 @@ Public Class MachinePanelVM
' apro finestra di gestione lavorazioni pareti
Dim sTitle = EgtMsg(9010) 'Tabelle delle lavorazioni delle pareti
Dim WallMchsWinVM As New MyBeamMachiningsWindowVM(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, False)
Dim WallMchsWinV As Object = Nothing
If bOnlyProd Then
WallMchsWinV = New OnlyProdBeamMachiningsWindowV(Application.Current.MainWindow, WallMchsWinVM)
Else
WallMchsWinV = New BeamMachiningsWindowV(Application.Current.MainWindow, WallMchsWinVM)
End If
Dim WallMchsWinV As New OnlyProdBeamMachiningsWindowV(Application.Current.MainWindow, WallMchsWinVM)
WallMchsWinV.ShowDialog()
Else
' Impossibile aprire l'Editor delle lavorazioni delle pareti.<br/>Mancano i file di configurazione. - Errore
@@ -249,21 +326,17 @@ Public Class MachinePanelVM
End Function
Public Overrides Sub ToolDb(ByVal param As Object)
SetSelTab(ConfigTabs.EMPTY)
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtTdbReload() Then
EgtOutLog("Impossible reloading tool Db")
MessageBox.Show(EgtMsg(MSG_TOOLDBERRORS + 30), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
MessageBox.Show(EgtMsg(31130), EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
Dim ToolDbWindowVM As New MyToolDbWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Beam")
Dim ToolDbWindowV = Nothing
If bOnlyProd Then
ToolDbWindowV = New OnlyProdToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
Else
ToolDbWindowV = New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
End If
Dim ToolDbWindowV = New ToolDbWindowV(Application.Current.MainWindow, ToolDbWindowVM)
If ToolDbWindowVM.MatType <> 0 Then
ToolDbWindowV.Height = 640
@@ -275,20 +348,16 @@ Public Class MachinePanelVM
End Sub
Public Overrides Sub MachDb(ByVal param As Object)
SetSelTab(ConfigTabs.EMPTY)
If Not VerifyMachinesDir(m_sMachinesRoot) Then Return
' ricarico il database per intercettare eventuali aggiornamenti fatti da altre istanze del programma (se la cartella Machines è condivisa)
If Not EgtMdbReload() Then
EgtOutLog("Impossible reloading machining Db")
MessageBox.Show(EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
MessageBox.Show(EgtMsg(31408), EgtMsg(15001), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(CurrentMachine.sMachIniFile, Map.refSceneHostVM.MainScene.GetCtx(), "Stone")
Dim MachDbWindowV = Nothing
If bOnlyProd Then
MachDbWindowV = New OnlyProdMachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM)
Else
MachDbWindowV = New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM)
End If
Dim MachDbWindowV = New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM)
If EgtWPFLib5.MachiningTreeViewItem.m_MatType <> 0 Then
MachDbWindowV.Height = 768
@@ -300,10 +369,11 @@ Public Class MachinePanelVM
End Sub
Public Overrides Sub SetUp(ByVal param As Object)
SetSelTab(ConfigTabs.EMPTY)
' verifico che il file di configurazione attrezzaggio (lua) della macchina esista
If Not File.Exists(CurrentMachine.sMachDir & "\Scripts\" & SETUP_LUA) Then
EgtOutLog("SetUp error: SetUp configuration file doesn't exist ")
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 7), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
MessageBox.Show(EgtMsg(6477), EgtMsg(6471), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' carico Lua che contiene le funzioni per ottenere le posizioni valide dell'utensile selezionato,
@@ -322,7 +392,7 @@ Public Class MachinePanelVM
EgtLuaGetGlobIntVar("STU.ERR", nErr)
If nErr = 0 Then
If EgtGetHeadExitCount(sHead) = 0 Then
MessageBox.Show(EgtMsg(MSG_SETUPERRORS + 8), EgtMsg(MSG_SETUPERRORS + 1), MessageBoxButton.OK, MessageBoxImage.Error)
MessageBox.Show(EgtMsg(6478), EgtMsg(6471), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
End If
@@ -331,83 +401,52 @@ Public Class MachinePanelVM
' Reset lua
EgtLuaResetGlobVar("STU")
Dim SetUpWindow As Object = Nothing
If bOnlyProd Then
SetUpWindow = New OnlyProdSetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) With {
Dim SetUpWindow As New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) With {
.Height = 614,
.Width = 1024
}
Else
SetUpWindow = New SetUpWindowV(Application.Current.MainWindow, New SetUpWindowVM(CurrentMachine.sMachDir, CurrentMachine.sMachineName)) With {
.Height = 614,
.Width = 1024
}
End If
SetUpWindow.ShowDialog()
End Sub
#End Region
#End Region ' Methods
#Region "COMMANDS"
#Region "BeamTable"
#Region "ChooseMachine"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property BeamTable_Command As ICommand
Public ReadOnly Property ChooseMachine_Command As ICommand
Get
If m_cmdBeamTable Is Nothing Then
m_cmdBeamTable = New Command(AddressOf BeamMachDb)
If m_cmdChooseMachine Is Nothing Then
m_cmdChooseMachine = New Command(AddressOf ChooseMachine)
End If
Return m_cmdBeamTable
Return m_cmdChooseMachine
End Get
End Property
#End Region ' BeamTable
#Region "WallTable"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property WallTable_Command As ICommand
Get
If m_cmdWallTable Is Nothing Then
m_cmdWallTable = New Command(AddressOf WallMachDb)
End If
Return m_cmdWallTable
End Get
End Property
#End Region ' WallTable
#Region "ParameterMachine"
''' <summary>
''' Returns a command that do Exec.
''' </summary>
Public ReadOnly Property ParameterMachine_Command As ICommand
Get
If m_cmdParameterMachine Is Nothing Then
m_cmdParameterMachine = New Command(AddressOf ParameterMachineVisibility)
End If
Return m_cmdParameterMachine
End Get
End Property
Public Sub ParameterMachineVisibility()
If Map.refConfigurationPageVM.m_MachineParameter_Visibility Then
Map.refConfigurationPageVM.SetMachineParameter_Visibility(Visibility.Visible)
Map.refConfigurationPageVM.SetMachine_Visibility(Visibility.Visible)
Else
Map.refConfigurationPageVM.SetMachineParameter_Visibility(Visibility.Collapsed)
Map.refConfigurationPageVM.SetMachine_Visibility(Visibility.Collapsed)
End If
Friend Sub ChooseMachine()
SetChooseMachine_Visibility(Visibility.Visible)
End Sub
#End Region ' ParameterMachine
#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()
SetSelMachineName(m_SelectedMachine.Name)
SetChooseMachine_Visibility(Visibility.Collapsed)
End Sub
#End Region ' Ok
#End Region ' COMMANDS
@@ -0,0 +1,156 @@
<Grid x:Class="OnlyProdMachinePanelV"
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:local="clr-namespace:EgtBEAMWALL.Optimizer"
Margin="0,10,0,10"
IsEnabled="{Binding MachPanel_IsEnabled}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Margin="0,0,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding CurrentMachineMsg}"
Margin="10,0,5,0"
Foreground="{StaticResource BeamWall_Corduroy}"
Style="{StaticResource OnlyProdStatisticTimePanel_TextBlock}"/>
<TextBlock Grid.Column="1"
Text="{Binding SelMachineName}"
VerticalAlignment="Center"
FontWeight="Bold"
Margin="10,0,5,0"
Foreground="{StaticResource BeamWall_Corduroy}"
Style="{StaticResource OnlyProdStatisticTimePanel_TextBlock}"/>
<Button Grid.Column="2"
ToolTip="{Binding ChooseMachine_ToolTip}"
Command="{Binding ChooseMachine_Command}"
Style="{StaticResource ToolBarViewPanel_Button}">
<Image Source="/Resources/CALCPanel/ChooseMachine.png" Stretch="Uniform"/>
</Button>
<Grid Grid.Column="3" 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 x:Name="SelMachineCombo"
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>
</Grid>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
<RadioButton Content="{Binding StrategyManagerMsg}"
ToolTip="{Binding ParameterMachineMsg}"
IsChecked="{Binding StrategyManagerIsChecked}"
Margin="0,0,50,0"
Style="{StaticResource OnlyProdMainMenu_ToggleButton}" Width="140"/>
<Button Content="{Binding ToolDBMsg}"
ToolTip="{Binding ToolDBToolTip}"
Command="{Binding ToolDbCommand}"
Click="Button_Click"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"/>
<Button Content="{Binding SetUpMsg}"
Command="{Binding SetUpCommand}"
Click="Button_Click"
ToolTip="{Binding SetUpToolTip}"
Style="{StaticResource GeneralConfigurationToolBar_TextButton}"
Visibility="{Binding SetUp_Visibility}"/>
<RadioButton Content="{Binding MachineParamsMsg}"
ToolTip="{Binding MachineParamsMsg}"
IsChecked="{Binding MachineParamsIsChecked}"
Margin="5,0,10,0"
Style="{StaticResource OnlyProdMainMenu_ToggleButton}" Width="155"/>
</StackPanel>
</Grid>
<TabControl Grid.Row="1"
BorderThickness="0"
SelectedIndex="{Binding nSelTab}"
Style="{StaticResource OnlyProd_TabControl}">
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</TabControl.ItemContainerStyle>
<TabItem Header="EMPTY"/>
<TabItem Header="STRATEGIES">
<StackPanel>
<local:StrategyManagerV DataContext="{StaticResource StrategyManagerVM}"/>
</StackPanel>
</TabItem>
<TabItem Header="PARAMETERS">
<StackPanel Orientation="Horizontal">
<ItemsControl ItemsSource="{Binding SelectedItem.MachTableList, ElementName=SelMachineCombo}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto" Foreground="{StaticResource BeamWall_Corduroy}">
<ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="0,0,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
ToolTip="{Binding sName}"
TextWrapping="WrapWithOverflow"
Width="150"
Style="{StaticResource MachParamTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="1"
Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
Width="60"/>
<TextBlock Grid.Column="2"
Text="{Binding sDescription}"
ToolTip="{Binding sDescription}"
TextWrapping="WrapWithOverflow"
Width="148"
Style="{StaticResource MachParamTextBlock}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
Style="{StaticResource SaveMachinePanel_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
</Button>-->
</StackPanel>
</TabItem>
</TabControl>
</Grid>
@@ -0,0 +1,8 @@
Public Class OnlyProdMachinePanelV
Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
Map.refMachinePanelVM.SetStrategyManagerIsChecked(False)
Map.refMachinePanelVM.SetMachineParamsIsChecked(False)
End Sub
End Class

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