Compare commits

..

106 Commits

Author SHA1 Message Date
Demetrio Cassarino 212e4882e6 -modifica a stile tooltip in dizionario 2026-05-14 15:53:42 +02:00
Demetrio Cassarino 187394102e -ripristinato finestre dialog e messagebox 2026-05-14 14:37:42 +02:00
Demetrio Cassarino 90ec48526b Merge commit '21ff4be8ec6c25ca49c8cafec81c231539379d73' into feature/Tooltip 2026-05-14 10:31:45 +02:00
Demetrio Cassarino af8690cf33 -modifica a finestre di dialogo 2026-05-14 10:24:16 +02:00
Dario Sassi 21ff4be8ec Icarus :
- aggiunta impostazione tolleranza di importazione da INI ( [Import] AdvToler=XXX) con default 0.1.
2026-05-12 10:18:39 +02:00
Dario Sassi 228a751335 Icarus 3.1e1 :
- aggiunto parametro di lavorazione SingleLeadIn (default false).
2026-05-06 12:16:01 +02:00
Dario Sassi d5188fcd96 Icarus :
- aggiornata simulazione come EgtCAM5.
2026-04-28 19:26:55 +02:00
Dario Sassi 1b131fd781 Icarus 3.1d2 :
- aggiunta gestione tipo di estrusione da NewSlicingType di Ini macchina.
2026-04-28 11:39:10 +02:00
Dario Sassi 6f1ea25aaa Icarus 3.1d1 :
- aggiunta gestione modo Multiplanar_45deg.
2026-04-14 19:47:07 +02:00
Dario Sassi 6d18e9eba5 Icarus :
- correzione per conversioni di stringhe in double e viceversa.
2026-03-18 18:16:47 +01:00
Dario Sassi bd43571e10 Icarus :
- permessa l'esecuzione di un massimo di quattro istanze (prima una sola).
2026-03-12 17:34:37 +01:00
Dario Sassi 757c4d7b6f Icarus 3.1c2 :
- correzione per crash dopo conferma edit materiali senza materiale corrente in top bar (progetto nuovo).
2026-03-10 16:16:21 +01:00
Dario Sassi 251ae061f1 Icarus 3.1c1 :
- ricompilazione con cambio versione.
2026-03-03 16:36:51 +01:00
Dario Sassi f0eec3b4da Icarus :
- corretta lettura da ini e applicazione del formato di salvataggio.
2026-02-22 16:30:37 +01:00
Emmanuele Sassi b529aa7e99 - gestito click su TextBox di cambio nome pezzi ed entita' per evitare che chiudesse anche il pannello ManagePartPanel 2026-02-18 13:28:00 +01:00
Dario Sassi dd31c112a6 Icarus 3.1b2 :
- aggiunto parametro SpiralVaseLen (abilitato solo se SpiralVase lo è).
2026-02-16 11:33:16 +01:00
Dario Sassi 738945927b Icarus 3.1b1 :
- prime modifiche per aggiungere tipo di slicing MultiPlanar.
2026-02-11 20:04:01 +01:00
Dario Sassi 6827c7f971 Icarus 3.1a1 :
- ricompilazione con cambio major version
- piccola correzione in messaggio di AboutBox.
2026-01-02 19:22:51 +01:00
Dario Sassi 7abeca0815 Icarus :
- aggiunta gestione direzione di vista standard da ini macchina ([General] StandardView=SE (ammessi SW, SE, NE, NW con SW default).
2025-11-28 12:28:19 +01:00
Dario Sassi c758f5474e Icarus 2.7k1 :
- piccola modifica per indicare il numero di chiave nel messaggio emesso quando manca la licenza.
2025-11-12 15:36:23 +01:00
Dario Sassi 99750342ad Icarus 2.7j1 :
- ricompilazione con cambio versione.
2025-10-30 16:37:58 +01:00
Dario Sassi dfb555c7ea Icarus 2.7i2 :
- ricompilazione con cambio versione.
2025-09-30 19:34:11 +02:00
Emmanuele Sassi 429e82e349 Icarus 2.7h1:
- aggiunti parametri RibsStrandOverlap e MaxSlicesNumber
2025-09-08 19:26:05 +02:00
Dario Sassi c1a0d1267e Icarus 2.7g2 :
- ricompilazione con cambio versione.
2025-07-28 08:48:53 +02:00
Dario Sassi efbc378b9e Icarus 2.7g1 :
- modifiche per gestione traccia utensile in simulazione (va abilitata da Ini programma e da macchina).
2025-07-15 13:07:34 +02:00
Dario Sassi 60323f2929 Icarus 2.7f2 :
- ricompilazione con cambio versione.
2025-06-26 15:42:33 +02:00
Dario Sassi da1e7b8104 Icarus :
- completata gestione drop file.
2025-04-30 12:25:11 +02:00
Dario Sassi b8fdd83f88 Icarus 2.7d2 :
- ricompilazione con cambio versione.
2025-04-30 11:30:45 +02:00
Dario Sassi 5a3a36c02d Icarus 2.7a4 :
- modifica per nuova impostazione di SetAdvImpTolerance oltre a SetSurfTmTolerance.
2025-01-31 09:27:23 +01:00
Dario Sassi e65a5a7b4b Icarus 2.7a2 :
- cambio annuale di versione.
2025-01-23 14:54:39 +01:00
Dario Sassi 4e80a94013 Icarus 2.6k1 :
- alcuni parametri generali (PREFLOWDELAY, POSTFLOWDELAY e SCREWBACK) impostati come numeri e non lunghezze per evitare conversioni mm/inches.
2024-11-27 15:39:30 +01:00
Dario Sassi 98f9a3917c Icarus 2.6g7 :
- ricompilazione con cambio versione.
2024-07-31 17:08:14 +02:00
Dario Sassi a737a9313d Icarus 2.6g1 :
- inserito ingrandimento area della tavola per consentire di posizionare i pezzi anche parzialmente fuori nei casi ove possibile (aree ammesse secondo tipo di estrusione).
2024-07-03 20:00:20 +02:00
Dario Sassi 1f94bff09b Icarus 2.6f4 :
- ricompilazione con cambio versione.
2024-07-01 12:44:20 +02:00
Dario Sassi 849b5e6f45 Icarus 2.6e2 :
- ricompilazione con cambio versione.
2024-05-15 15:01:07 +02:00
Emmanuele Sassi 0a77a8e32f Merge branch 'main' of https://gitlab.steamware.net/egalware/icarus 2024-05-14 09:45:21 +02:00
Emmanuele Sassi 084a71bf54 - aggiunta gestione parametri Ribs LinkFillet e LeadFillet 2024-05-14 09:45:18 +02:00
Dario Sassi bdc26a0bf6 Icarus 2.6e1 :
- ricompilazione con cambio versione.
2024-05-10 16:06:13 +02:00
Emmanuele Sassi ca32de50f0 - aggiunto flag per uso sezione strand semplificata 2024-05-10 11:55:00 +02:00
Dario Sassi a0d7687214 Icarus :
- piccole modifiche per simulazione con Virtual Additive.
2024-04-29 12:48:18 +02:00
Emmanuele Sassi 412c3c4b5d - aggiunto flag per VirtualAdditive 2024-04-29 11:41:17 +02:00
Dario Sassi 90b1fa9221 Icarus :
- modifiche per sistemazione riferimenti oggetti inseriti.
2024-04-12 11:03:47 +02:00
Dario Sassi 11704fa33d Icarus 2.6d2 :
- migliorie nella segnalazione problemi con chiave di rete
- aggiunta gestione AdvFlag=0/1 della sezione [Import] nel file INI per Flag importatore formati avanzati
- eliminata gestione eventi OnImport... perchè ImportProject non usato, aggiunta gestione evento OnInsertingProject.
2024-04-12 08:56:04 +02:00
Dario Sassi 97442a5d65 Icarus 2.6b1 :
- ricompilazione con cambio versione.
2024-02-13 14:55:15 +01:00
Dario Sassi 4f1a9b8938 Icarus 2.6a1 :
- corretto controllo movimento pezzo (ora anche fuori da tavola purchè in area di stampa)
- aggiunta indicazione giorni mancanti alla fine del piano di manutenzione.
2024-01-26 16:14:34 +01:00
Emmanuele Sassi c96c3ef581 - aggiunta variabile temperatura essicatore 2024-01-10 12:37:14 +01:00
Dario Sassi fdf33ef796 Icarus :
- eliminata opzione CreateJson su Shift+Save perchè serviva solo per debug iniziale.
2024-01-09 18:28:03 +01:00
Dario Sassi a599fde07a Merge commit '1ebf4a3f54f1bcd305d8b3a0e8076b7d0b76653b' 2024-01-09 18:11:16 +01:00
Dario Sassi 7267b77522 Icarus :
- per export macchina (icrx) aggiunta abilitazione aggiuntiva da Ini ([General] ExportMachine=0/1 default 1).
2024-01-09 18:09:46 +01:00
Emmanuele Sassi 1ebf4a3f54 Merge branch 'main' of https://gitlab.steamware.net/egalware/icarus 2024-01-09 17:57:51 +01:00
Emmanuele Sassi 4b85c118cd - aggiunti parametri per merge delle rib con shell interna 2024-01-09 17:57:47 +01:00
Dario Sassi 53a79186c9 Merge commit '12081cec286176e5b9067a1fa81cf6eb1c57a0b6' 2024-01-09 17:46:53 +01:00
Dario Sassi 4d37978789 Icarus 2.5l1 :
- modifiche per gestione griglia come tavola / standard.
2024-01-09 17:31:08 +01:00
Emmanuele Sassi 12081cec28 - modifiche per export del 3dm per la macchina 2023-12-19 14:57:46 +01:00
Dario Sassi 109feeb6f7 Icarus :
- in import aggiunto ai tipi di file da visualizzare tutti quelli importati.
2023-11-13 16:56:23 +01:00
Dario Sassi da0bcbac69 Icarus 2.5k1 :
- tolta perdita fuoco da edit quando si passa sopra finestra grafica
- sostituito Ionic.zip con DotNetZip
- in feedback ora solo file con il nome del progetto oltre a macchina e log.
2023-11-13 16:25:46 +01:00
Emmanuele Sassi 27a54b0034 - modifiche per nuova esportazione 3mf 2023-10-24 11:03:04 +02:00
Emmanuele Sassi c1aee47e53 - aggiunto StrandH in json e corretto valore strandW 2023-10-13 15:40:38 +02:00
Demetrio Cassarino 6eb6e817b8 modifica controllo OverwritePrompt 2023-10-12 17:23:02 +02:00
Demetrio Cassarino f3f48f0794 Modifca dialog result close window 2023-10-12 17:05:12 +02:00
Demetrio Cassarino 3ad5e8085d Aggiunta controlli finestra di dialogo 2023-10-12 09:59:32 +02:00
Demetrio Cassarino 2b48a26032 Modifica egtMessageBox importata dalla libreria Lib5 2023-10-04 12:10:03 +02:00
Demetrio Cassarino cf066275a5 Merge remote-tracking branch 'origin/feature/OpenDialog' into feature/Tooltip 2023-10-04 10:21:47 +02:00
Emmanuele Sassi 37abbd79d5 - Gestito progetto modificato all'interno del programma 2023-10-04 10:18:53 +02:00
Emmanuele Sassi f959cb157c Merge remote-tracking branch 'ICARUS/main' into feature/OpenDialog 2023-10-04 09:32:22 +02:00
Demetrio Cassarino 8353132036 Merge commit '93b573f1f05b8c73c29ed9f264bd43e2dc167eab' into feature/Tooltip 2023-10-03 11:23:25 +02:00
Dario Sassi 93b573f1f0 Icarus 2.5j1 :
- ricompilazione con cambio versione.
2023-10-02 16:15:23 +02:00
Dario Sassi e19c3bf83d Merge remote-tracking branch 'origin/feature/DifferentTypeWidth' 2023-10-02 16:00:09 +02:00
Dario Sassi 63fa6ba9b8 Icarus 2.5h2 :
- ricompilazione con cambio versione.
2023-10-02 10:26:00 +02:00
Emmanuele Sassi e59d50923b Merge branch 'main' into feature/ExportForMachine 2023-09-26 11:41:08 +02:00
Emmanuele Sassi e5fca60809 - aggiunti dati nel json
- evito creazione icrx se generazione andata male
2023-09-26 11:40:21 +02:00
Emmanuele Sassi 91582b4ab9 - aggiunti parametri larghezza strand per tutti i tipi di strand
- corretto errore di modifica alpha colore dopo creazione degli strand
- eliminata la colonna FMin
2023-09-25 16:20:45 +02:00
Emmanuele Sassi f7631e5201 - creazione del pacchetto di export per la macchina 2023-09-20 11:14:35 +02:00
Dario Sassi 4604ae3558 Icarus :
- migliorata gestione di progetto modificato.
2023-08-30 12:14:26 +02:00
Dario Sassi 624eb0566f Icarus 2.5h1 :
- modifiche per visualizzare meglio l'area di valido posizionamento dei pezzi.
2023-08-28 19:50:01 +02:00
Emmanuele Sassi f45efb2310 - creazione Json degli strati 2023-08-28 18:05:43 +02:00
Demetrio Cassarino 88f863407a Aggiunta al nome del tooltip l'informazione beta per i relativi parametri 2023-08-25 15:55:51 +02:00
Demetrio Cassarino 9e4f05f2cc Merge remote-tracking branch 'origin/feature/Beta&SlicingHeightParam' into feature/Tooltip 2023-08-25 09:51:48 +02:00
Emmanuele Sassi c32bfd55d0 - aggiunta indicazione parametri beta
- aggiunto parametro SlicingHeight
- corretti alcuni testi parametri
2023-08-24 19:04:44 +02:00
Demetrio Cassarino 8a7ec79689 aggiornamanto tooltipmsg 2023-08-21 12:38:18 +02:00
Demetrio Cassarino ec29054009 aggiornamento descrizione tooltip 2023-08-21 10:41:48 +02:00
Demetrio Cassarino 96be2e5fbf Aggiunta elemento tooltip con relative immagini e file ini 2023-08-11 16:48:46 +02:00
Demetrio Cassarino 3ef8843b1d -Modifica denominazione templete
-Aggiornamento indice estensione
2023-08-08 15:05:44 +02:00
Emmanuele Sassi cb261ce99b - Modifiche e milgiorie a finestra ManageFileDialog 2023-08-07 12:54:39 +02:00
Demetrio Cassarino 13bfc40f9f Migliorie codice e aggiunta doppio click su seleziona cartella 2023-08-02 09:44:14 +02:00
Demetrio Cassarino 1acf7d0d87 Aggiunta migliorie finestra di dialogo 2023-07-26 15:14:30 +02:00
Demetrio Cassarino eb0f3adec2 Merge branch 'feature/ColorPicker' into feature/OpenDialog 2023-07-21 17:30:29 +02:00
Demetrio Cassarino 958dd8d029 Merge branch 'temp' into feature/ColorPicker 2023-07-21 17:28:57 +02:00
Demetrio Cassarino 43f8c020c6 Merge branch 'feature/ColorPicker' of https://gitlab.steamware.net/egalware/icarus into feature/ColorPicker 2023-07-21 17:27:28 +02:00
Demetrio Cassarino 6dcaf822a6 Creazione finestra di dialogo e aggiornamento rettangoli colore del ColorPicker 2023-07-21 16:40:53 +02:00
Emmanuele Sassi db65ef9e15 - correzione errore di aggiornamento area di stampa su cambio tipo 2023-07-10 13:24:26 +02:00
Emmanuele Sassi d2a6a27200 Icarus 2.5g1 :
- ricompilazione con cambio versione
- aggiunta gestione parametri per link degli infill e strand count sui filled solids
2023-07-07 18:39:25 +02:00
Emmanuele Sassi d2463769ec - modifiche parziali per migliorare selezione colore 2023-07-07 17:02:07 +02:00
Emmanuele Sassi 6bad0e177f Merge branch 'feature/InfillParams' 2023-06-16 19:18:11 +02:00
Demetrio Cassarino 9a17bd37b7 Aggiornamento gradazione rettangolo colore 2023-06-16 18:31:23 +02:00
Emmanuele Sassi 667b8fde7c - introduzione parametri per infill
- modifica dei parametri auxSolid con gestione infill
- correzione creazione shellnumber e filled solid con esc su creazione percorso
2023-06-15 12:28:31 +02:00
Demetrio Cassarino fddc66b820 -Aggiornamento di tutti i colorpicker a egtcolorpicker 2023-06-12 15:26:20 +02:00
Emmanuele Sassi 48d0063167 Merge remote-tracking branch 'ICARUS/main' into feature/InfillParams 2023-06-12 12:51:52 +02:00
DarioS 13d89a3857 Icarus 2.5f1 :
- modificate costanti per Infill
- aggiunta gestione chiave di rete
- eliminata gestione codici protezione per nesting
- aggiornato codice di protezione mensile.
2023-06-12 09:20:59 +02:00
DarioS df7bb978b8 Icarus 2.5e2 :
- ricompilazione con cambio versione.
2023-05-26 10:47:28 +02:00
Demetrio Cassarino d4b55f730a - Aggiornamento di tutte le messagebox a egtmessagebox 2023-05-26 10:21:46 +02:00
Emmanuele Sassi d74bc0f4d2 - ottimizzazione costruttori in EgtMessageBoxVM 2023-05-25 15:54:32 +02:00
Emmanuele Sassi c17e80af2b - Aggiunta EgtMessageBox 2023-05-25 14:57:31 +02:00
DarioS 088be26abf Icarus 2.5e1 :
- ricompilazione con cambio versione
- miglioria indicazione unità di misura di tempo (min:s).
2023-05-03 11:54:59 +02:00
DarioS 2e81f09a85 Icarus :
- modifica per far funzionara la ProgressBar anche con il calcolo dei solidi.
2023-04-24 15:35:11 +02:00
DarioS 21692af684 Icarus 2.5d4 :
- al parametro ScrewBack viene assegnato valore di default 45 (per progetti vecchi o nuove lavorazioni di libreria).
2023-04-20 16:16:10 +02:00
168 changed files with 7320 additions and 947 deletions
+12
View File
@@ -18,12 +18,24 @@ Public Class AboutBoxV
Dim sLeftDays As String = ""
Dim nLeftDays As Integer
If EgtGetKeyLeftDays(nLeftDays) AndAlso nLeftDays < 500 Then sLeftDays = " (" & nLeftDays.ToString() & ")"
Dim sAssStatus As String = " discontinued"
Dim nAssLeftDays As Integer
If EgtGetKeyAssLeftDays( nAssLeftDays) And nAssLeftDays >= 0 Then
If nAssLeftDays > 30 then
sAssStatus = "expires within " & nAssLeftDays.ToString() & " days"
Else If nAssLeftDays > 0 then
sAssStatus = "to be renewed within " & nAssLeftDays.ToString() & " days"
Else
sAssStatus = "to be renewed by today"
End If
End If
sInfo = If(EgtIsDebug(), "*** Debug Libraries ***" & Environment.NewLine, "")
sInfo &= "User " & Environment.MachineName & "\" & Environment.UserName &
" Inst" & Map.refMainWindowVM.MainWindowM.nInstance.ToString() &
" Ulv" & Map.refMainWindowVM.MainWindowM.nUserLevel.ToString() &
" Dbg" & Map.refMainWindowVM.MainWindowM.DebugLevel().ToString() & Environment.NewLine
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
sInfo &= "Maintenance plan " & sAssStatus & Environment.NewLine
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
Dim sOpSys As String = String.Empty
@@ -72,13 +72,15 @@ Public Module TreeViewItemHelper
Dim treeViewItem As TreeViewItem = VisualUpwardSearch(Of TreeViewItem)(TryCast(e.OriginalSource, DependencyObject))
If treeViewItem IsNot Nothing Then
treeViewItem.IsSelected = True
Dim Tree As TreeView = VisualUpwardSearch(Of TreeView)(TryCast(treeViewItem, DependencyObject))
If Not IsNothing(Tree) Then
Dim myTransform As GeneralTransform = treeViewItem.TransformToAncestor(Tree)
If Not IsNothing(treeViewItem.ContextMenu) Then
Dim Tree As TreeView = VisualUpwardSearch(Of TreeView)(TryCast(treeViewItem, DependencyObject))
If Not IsNothing(Tree) Then
Dim myTransform As GeneralTransform = treeViewItem.TransformToAncestor(Tree)
Dim myOffset As Point = myTransform.Transform(New Point(0, 0))
treeViewItem.ContextMenu.HorizontalOffset = -treeViewItem.ActualWidth + (-myOffset.X) + Tree.ActualWidth - 3
treeViewItem.ContextMenu.VerticalOffset = -3
Dim myOffset As Point = myTransform.Transform(New Point(0, 0))
treeViewItem.ContextMenu.HorizontalOffset = -treeViewItem.ActualWidth + (-myOffset.X) + Tree.ActualWidth - 3
treeViewItem.ContextMenu.VerticalOffset = -3
End If
End If
e.Handled = True
End If
@@ -1,6 +1,4 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports EgtUILib
Imports EgtWPFLib5
Public Class ChooseMachineWndVM
+37
View File
@@ -3,6 +3,7 @@
Public Const TABLE = "Table"
Public Const TABLE_OUTLINE = "TableOutline"
Public Const EXTRUSION_AREA = "ExtrusionArea"
Public Const EXTRUSION_RECT = "ExtrusionRect"
Public Const PART = "Part"
Public Const PRINT_SOLID = "PrintSolid"
Public Const LAY_MACH_START = "MachStart"
@@ -67,6 +68,7 @@
Public Const MAT_KW = "KW"
Public Const MAT_KZ = "KZ"
Public Const MAT_KN = "KN"
Public Const MAT_TDRYER = "TDRYER"
Public Const MAT_ORIG = "Orig"
' parametri Lavorazione
@@ -89,8 +91,10 @@
Public Const MAC_LINKTYPE = "LinkType"
Public Const MAC_LINKPARAM = "LinkParam"
Public Const MAC_LINKZUP = "LinkZup"
Public Const MAC_INNERSHELLWIDTH = "InnerStrandW"
Public Const MAC_OFFSETLEADPOINT = "OffsetLeadPoint"
Public Const MAC_LEADIN = "LeadIn"
Public Const MAC_SINGLELEADIN = "SingleLeadIn"
Public Const MAC_LEADINTANGDIST = "LeadInTangDist"
Public Const MAC_LEADINORTHODIST = "LeadInOrthoDist"
Public Const MAC_LEADOUT = "LeadOut"
@@ -100,6 +104,7 @@
Public Const MAC_COASTINGFEEDPU = "CoastingFeedPu"
Public Const MAC_WIPELEN = "WipeLen"
Public Const MAC_WIPEFEEDPU = "WipeFeedPu"
Public Const MAC_SPIRALVASELEN = "SpiralVaseLen"
Public Const MAC_WIPEDIR = "WipeDir"
Public Const MAC_FLOORCOUNT = "FloorCount"
Public Const MAC_G0FEED = "G0Feed"
@@ -108,10 +113,17 @@
Public Const MAC_PREFLOWDELAY = "PreFlowDelay"
Public Const MAC_POSTFLOWDELAY = "PostFlowDelay"
Public Const MAC_SCREWBACK = "ScrewBack"
Public Const MAC_SLICINGHEIGHT = "SlicingHeight"
Public Const MAC_MAXSLICESNUMBER = "MaxSlicesNumber"
Public Const MAC_RIBSSTRANDWIDTH = "RibsStrandW"
Public Const MAC_RIBSTYPE = "RibsType"
Public Const MAC_RIBSOVERLAP = "RibsOverlap"
Public Const MAC_RIBSSTRANDOVERLAP = "RibsStrandOverlap"
Public Const MAC_RIBSSTRANDCOUNT = "RibsStrandCount"
Public Const MAC_RIBSLINK = "RibsLink"
Public Const MAC_RIBSLINKFILLET = "RibsLinkFillet"
Public Const MAC_RIBSMERGEWITHSHELL = "RibsMergeWithShell"
Public Const MAC_RIBSINVERTMERGEDSHELLMAINLINK = "InvertRibsMergedShellMainLink"
Public Const MAC_RIBSINVERTORDER = "RibsInvertOrder"
Public Const MAC_RIBSINVERTDIRECTION = "RibsInvertDirection"
Public Const MAC_RIBSINVERTSTRANDORDER = "RibsInvertStrandOrder"
@@ -122,20 +134,45 @@
Public Const MAC_RIBSLEADOUTCOASTING = "RibsLeadOutCoasting"
Public Const MAC_RIBSLEADOUTWIPE = "RibsLeadOutWipe"
Public Const MAC_RIBSLEADOUTWIPEDIR = "RibsLeadOutWipeDir"
Public Const MAC_RIBSLEADFILLET = "RibsLeadFillet"
Public Const MAC_RIBSLIMITUNBOUNDEDWITHSOLID = "LimitUnboundedRibsWithSolid"
Public Const MAC_SHELLNBRDIFFERENCE = "ShellNbrDifference"
Public Const MAC_SHELLNBRCOASTING = "ShellNbrCoasting"
Public Const MAC_SHELLNBRWIPE = "ShellNbrWipe"
Public Const MAC_SHELLNBRWIPEDIR = "ShellNbrWipeDir"
Public Const MAC_AUXSOLIDSSTRANDWIDTH = "AuxSolidsStrandW"
Public Const MAC_AUXSOLIDSOVERLAP = "AuxSolidsOverlap"
Public Const MAC_AUXSOLIDSINFILL = "AuxSolidsInfill"
Public Const MAC_AUXSOLIDSINFILLLINK = "AuxSolidsInfillLink"
Public Const MAC_AUXSOLIDSSTRANDCOUNT = "AuxSolidsStrandCount"
Public Const MAC_AUXSOLIDSSTRANDORDER = "AuxSolidsStrandOrder"
Public Const MAC_AUXSOLIDSLINKTYPE = "AuxSolidsLinkType"
Public Const MAC_AUXSOLIDSLINKPARAM = "AuxSolidsLinkParam"
Public Const MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE = "AuxSolidsStartPointOffsetOnSlice"
Public Const MAC_AUXSOLIDSOFFSETLEADPOINT = "AuxSolidsOffsetLeadPoint"
Public Const MAC_AUXSOLIDSDENSITY = "AuxSolidsDensity"
Public Const MAC_AUXSOLIDSGRIDOVERLAP = "AuxSolidsGridOverlap"
Public Const MAC_AUXSOLIDSDIRECTION = "AuxSolidsDirection"
Public Const MAC_AUXSOLIDSOFFSETX = "AuxSolidsOffsetX"
Public Const MAC_AUXSOLIDSOFFSETY = "AuxSolidsOffsetY"
Public Const MAC_AUXSOLIDSCOASTINGLEN = "AuxSolidsCoastingLen"
Public Const MAC_AUXSOLIDSWIPELEN = "AuxSolidsWipeLen"
Public Const MAC_AUXSOLIDSWIPEDIR = "AuxSolidsWipeDir"
Public Const MAC_INFILLSTRANDWIDTH = "InfillStrandW"
Public Const MAC_FLOORTYPE = "FloorType"
Public Const MAC_CEILCOUNT = "CeilCount"
Public Const MAC_CEILTYPE = "CeilType"
Public Const MAC_INFILLTYPE = "InfillType"
Public Const MAC_INFILLLINK = "InfillLink"
Public Const MAC_INFILLDENSITY = "InfillDensity"
Public Const MAC_INFILLOVERLAP = "InfillOverlap"
Public Const MAC_INFILLGRIDOVERLAP = "InfillGridOverlap"
Public Const MAC_INFILLDIRECTION = "InfillDirection"
Public Const MAC_INFILLOFFSETX = "InfillOffsetX"
Public Const MAC_INFILLOFFSETY = "InfillOffsetY"
Public Const MAC_INFILLCOASTING = "InfillCoasting"
Public Const MAC_INFILLWIPE = "InfillWipe"
Public Const MAC_INFILLWIPEDIR = "InfillWipeDir"
Public Const MAC_DYNAMICMODE = "DynamicMode"
Public Const MAC_PRINTORDER = "PrintOrder"
Public Const MAC_CONSTANT = "Constant"
+5
View File
@@ -21,6 +21,7 @@ Public Module ConstGen
' File con dati di licenza
Public Const LIC_FILE_NAME As String = "Icarus.lic"
Public Const S_LICENCE As String = "Licence"
Public Const K_LOCKID As String = "LockId"
Public Const K_KEY As String = "Key"
Public Const K_NESTKEY As String = "NestKey"
@@ -52,6 +53,7 @@ Public Module ConstGen
' Abilitazioni licenza
Friend Enum KEY_OPT As UInteger
BASE = 1 ' Prodotto Icarus
MACHINE_EXPORT = 2 ' opzione per esportare file icrx per macchina
End Enum
' File di log generale
@@ -76,4 +78,7 @@ Public Module ConstGen
' Nome file Lua con le funzioni di attrezzaggio
Public Const SETUP_LUA As String = "SetUp.lua"
' Chiave di Info in gruppo di lavoro per attivazione Virtual Milling
Public Const KEY_MCHGRP_VM As String = "Vm"
End Module
+12
View File
@@ -26,8 +26,10 @@ Public Module ConstIni
'Public Const K_MESSAGES As String = "Messages"
'Public Const K_WINPLACE As String = "WinPlace"
'Public Const K_LASTPROJ As String = "LastProj"
Public Const K_NETKEY As String = "NetKey"
Public Const K_LASTNGEDIR As String = "LastNgeDir"
Public Const K_LASTIMPDIR As String = "LastImpDir"
Public Const K_MACHINEEXPORT As String = "MachineExport"
'Public Const K_SUPPORT As String = "Support"
'Public Const S_LANGUAGES As String = "Languages"
@@ -101,11 +103,15 @@ Public Module ConstIni
Public Const K_DXFSCALE As String = "DxfScale"
Public Const K_STLSCALE As String = "StlScale"
Public Const K_CNCFLAG As String = "CncFlag"
Public Const K_ADVFLAG As String = "AdvFlag"
Public Const K_ADVTOLER As String = "AdvToler"
'Public Const S_SIMUL As String = "Simul"
'Public Const K_SLIDERX As String = "SliderX"
'Public Const K_SLIDERVAL As String = "SliderVal"
Public Const K_MACHVIEWMODE As String = "MachViewMode"
Public Const K_VIRTUALADDITIVE As String = "VirtualAdditive"
Public Const K_TRACEENABLE As String = "TraceEnable"
Public Const S_PRINTING3D As String = "3dPrinting"
Public Const K_3PRNBASEDIR As String = "BaseDir"
@@ -114,6 +120,9 @@ Public Module ConstIni
Public Const K_VIEWSLIDER As String = "ViewSlider"
Public Const K_IMPORTCURREXTENSION As String = "ImportCurrExtension"
Public Const S_SOLIDS As String = "Solids"
Public Const K_SIMPLIFIEDSECTION As String = "SimplifiedSection"
Public Const S_COLORS As String = "Colors"
Public Const K_CLR_PRINTPART As String = "PrintPart"
Public Const K_CLR_RIBS As String = "Ribs"
@@ -125,4 +134,7 @@ Public Module ConstIni
Public Const S_MRUFILES As String = "MruFiles"
Public Const S_MRUIMPORTFILES As String = "MruImportFiles"
Public Const S_TEMPLETESEL As String = "TempleteSel"
Public Const K_CURRTEMPLETESEL As String = "CurrTempleteSel"
End Module
+2
View File
@@ -14,6 +14,7 @@
Public Module ConstMachDataIni
Public Const MACHDATA_INI_FILE_NAME As String = "Data.ini"
Public Const TOOLTIP_INI_FILE_NAME As String = "TooltipData.ini"
Public Const S_TABLE As String = "Table"
Public Const K_DIMX As String = "DimX"
@@ -26,6 +27,7 @@ Public Module ConstMachDataIni
Public Const S_45DEGX As String = "45DegX"
Public Const S_45DEGY As String = "45DegY"
Public Const S_HORIZONTAL As String = "Horizontal"
Public Const S_MULTIPLANAR As String = "MultiPlanar"
Public Const K_MINX As String = "MinX"
Public Const K_MAXX As String = "MaxX"
Public Const K_MINY As String = "MinY"
+20 -1
View File
@@ -1,6 +1,7 @@
Public Module ConstMachIni
Public Const MACH_INI_FILE_NAME As String = "MachData.ini"
Public Const S_GENERAL As String = "General"
Public Const K_GEN_STD_VIEW As String = "StandardView"
Public Const S_MACHINING As String = "Machining"
Public Const K_MACH_INITSCRIPT As String = "InitScript"
@@ -8,9 +9,27 @@
Public Const S_MACH_PRINTING3D As String = "3dPrinting"
Public Const K_SLICINGTYPE As String = "SlicingType"
Public Const K_NEWSLICINGTYPE As String = "NewSlicingType"
Public Const K_SPEED_MIN As String = "SpeedMin"
Public Const K_SPEED_MAX As String = "SpeedMax"
Public Const K_MAX_HEIGHT As String = "HMax"
Public Const S_MINMAX As String = "MinMax"
#Region "ToolTip"
Public Const K_TITLE As String = "Title"
Public Const K_DESCRIPTION As String = "Description"
Public Const K_FIRST_ICON As String = "Icon_First"
Public Const K_SECOND_ICON As String = "Icon_Second"
Public Const K_ORIENTATION_ICON As String = "IconOrientation"
#End Region
Public Const S_VMILL As String = "VMill"
Public Const K_VM_ENABLE As String = "Enable"
Public Const S_TOOLTRACE As String = "ToolTrace"
Public Const K_TT_ENABLE As String = "Enable"
End Module
+323 -46
View File
@@ -106,11 +106,12 @@ Public Class CurrMachining
Else
m_nIndex = 0
End If
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.GENERAL, nPartId, m_nIndex, False))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.LINK, nPartId, m_nIndex, False))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.RIBS, nPartId, m_nIndex, False))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.SHELL_NUMBER, nPartId, m_nIndex, False))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.AUX_SOLID, nPartId, m_nIndex, False))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.GENERAL, nPartId, m_nIndex, False, Me))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.LINK, nPartId, m_nIndex, False, Me))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.RIBS, nPartId, m_nIndex, False, Me))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.SHELL_NUMBER, nPartId, m_nIndex, False, Me))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.AUX_SOLID, nPartId, m_nIndex, False, Me))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.INFILL, nPartId, m_nIndex, False, Me))
For Each Cathegory In m_CathegoryList
For Each MachiningParam In Cathegory.MachiningParamList
AddHandler MachiningParam.PropertyChanged, AddressOf OnMachiningParamPropertyChanged
@@ -123,11 +124,12 @@ Public Class CurrMachining
' ricavo lavorazione da lista
Dim CurrMachiningInDb As MachiningIndex = Map.refTopPanelVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
m_sCurrGUID = CurrMachiningInDb.sGUID
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.GENERAL, nPartId, m_nIndex, True))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.LINK, nPartId, m_nIndex, True))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.RIBS, nPartId, m_nIndex, True))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.SHELL_NUMBER, nPartId, m_nIndex, True))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.AUX_SOLID, nPartId, m_nIndex, True))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.GENERAL, nPartId, m_nIndex, True, Me))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.LINK, nPartId, m_nIndex, True, Me))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.RIBS, nPartId, m_nIndex, True, Me))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.SHELL_NUMBER, nPartId, m_nIndex, True, Me))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.AUX_SOLID, nPartId, m_nIndex, True, Me))
m_CathegoryList.Add(New CurrMachiningCathegory(MachiningCathegory.Cathegories.INFILL, nPartId, m_nIndex, True, Me))
For Each Cathegory In m_CathegoryList
For Each MachiningParam In Cathegory.MachiningParamList
AddHandler MachiningParam.PropertyChanged, AddressOf OnMachiningParamPropertyChanged
@@ -194,8 +196,9 @@ End Class
Public Class CurrMachiningCathegory
Inherits MachiningCathegory
Sub New(Type As Cathegories, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean)
Sub New(Type As Cathegories, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean, Machining As Machining)
m_Type = Type
m_Machining = Machining
Select Case m_Type
Case Cathegories.GENERAL
m_sName = "General"
@@ -209,7 +212,6 @@ Public Class CurrMachiningCathegory
New CurrNumericMachiningParam(MachiningParam.Params.STARTPOINTOFFSETONSLICE, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.STRANDORDER, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.DIRECTION, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEED, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEEDZ, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.LINKZUP, nPartId, nIndex, bForceFromDb, Me),
@@ -219,30 +221,40 @@ Public Class CurrMachiningCathegory
New CurrOrderedMachiningParam(MachiningParam.Params.PRINT_ORDER, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.PREFLOWDELAY, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.POSTFLOWDELAY, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.SCREWBACK, nPartId, nIndex, bForceFromDb, Me)})
New CurrNumericMachiningParam(MachiningParam.Params.SCREWBACK, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.SLICINGHEIGHT, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.MAXSLICESNUMBER, nPartId, nIndex, bForceFromDb, Me)})
Case Cathegories.LINK
m_sName = "Shell"
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.LINKTYPE, nPartId, nIndex, bForceFromDb, Me),
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.INNERSHELLWIDTH, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.OFFSETLEADPOINT, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.LINKTYPE, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.LINKPARAM, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.LEADIN, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.SINGLELEADIN, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.LEADINTANGDIST, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.LEADINORTHODIST, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.OFFSETLEADPOINT, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.LEADOUT, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTTANGDIST, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTORTHODIST, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGLEN, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGFEED_PC, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.WIPELEN, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.WIPEFEED_PC, nPartId, nIndex, bForceFromDb, Me)})
New CurrNumericMachiningParam(MachiningParam.Params.WIPEFEED_PC, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.SPIRALVASELEN, nPartId, nIndex, bForceFromDb, Me)})
'New CurrNumericMachiningParam(MachiningParam.Params.WIPEDIR, nPartId, nIndex, bForceFromDb, Me)})
Case Cathegories.RIBS
m_sName = "Ribs"
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.RIBSTYPE, nPartId, nIndex, bForceFromDb, Me),
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.RIBSSTRANDWIDTH, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.RIBSTYPE, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLIMITUNBOUNDEDWITHSOLID, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSSTRANDOVERLAP, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLINK, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLINKFILLET, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSMERGEWITHSHELL, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTMERGEDSHELLMAINLINK, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTSTRANDORDER, nPartId, nIndex, bForceFromDb, Me),
@@ -252,7 +264,8 @@ Public Class CurrMachiningCathegory
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTLEN, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTCOASTING, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPE, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPEDIR, nPartId, nIndex, bForceFromDb, Me)})
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPEDIR, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADFILLET, nPartId, nIndex, bForceFromDb, Me)})
Case Cathegories.SHELL_NUMBER
m_sName = "Reduce Shell Number"
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRDIFFERENCE, nPartId, nIndex, bForceFromDb, Me),
@@ -261,15 +274,42 @@ Public Class CurrMachiningCathegory
New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRWIPEDIR, nPartId, nIndex, bForceFromDb, Me)})
Case Cathegories.AUX_SOLID
m_sName = "Filled Solid"
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOVERLAP, nPartId, nIndex, bForceFromDb, Me),
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDWIDTH, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSINFILL, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.AUXSOLIDSINFILLLINK, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDCOUNT, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDORDER, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSLINKTYPE, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSLINKPARAM, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOFFSETLEADPOINT, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSDENSITY, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSGRIDOVERLAP, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSDIRECTION, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOFFSETX, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOFFSETY, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOVERLAP, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSCOASTINGLEN, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPELEN, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPEDIR, nPartId, nIndex, bForceFromDb, Me)})
Case Cathegories.INFILL
m_sName = "Infill"
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.INFILLSTRANDWIDTH, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.FLOORTYPE, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.CEILCOUNT, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.CEILTYPE, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.INFILLTYPE, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.INFILLLINK, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.INFILLDENSITY, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.INFILLGRIDOVERLAP, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.INFILLDIRECTION, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.INFILLOFFSETX, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.INFILLOFFSETY, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.INFILLOVERLAP, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.INFILLCOASTING, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.INFILLWIPE, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.INFILLWIPEDIR, nPartId, nIndex, bForceFromDb, Me)})
End Select
' verifico dipendenze tra parametri
Select Case m_Type
@@ -278,6 +318,11 @@ Public Class CurrMachiningCathegory
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
For Each Param In {MachiningParam.Params.SPIRALVASE}
Dim GeneralCathegory As MachiningCathegory = Machining.CathegoryList.FirstOrDefault(Function(z) z.Type = Cathegories.GENERAL)
Dim MachiningParam As CheckMachiningParam = GeneralCathegory.MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam(Me)
Next
Case Cathegories.RIBS
For Each Param In {MachiningParam.Params.RIBSTYPE}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
@@ -288,6 +333,19 @@ Public Class CurrMachiningCathegory
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
For Each Param In {MachiningParam.Params.AUXSOLIDSSTRANDCOUNT}
Dim MachiningParam As NumericMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
Case Cathegories.INFILL
For Each Param In {MachiningParam.Params.FLOORCOUNT, MachiningParam.Params.CEILCOUNT}
Dim MachiningParam As NumericMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
For Each Param In {MachiningParam.Params.INFILLTYPE}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
End Select
End Sub
@@ -310,7 +368,7 @@ Public Class CurrNumericMachiningParam
Public Overrides Property sValue As String
Get
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
Return If(m_bIsLen, LenToString(m_dValue, 2), DoubleToString(m_dValue, 2))
End Get
Set(value As String)
Dim dTempValue As Double = 0
@@ -320,14 +378,32 @@ Public Class CurrNumericMachiningParam
StringToDouble(value, dTempValue)
End If
If m_bIsActiveMinMax Then
If dTempValue >= m_dMinValue AndAlso dTempValue <= m_dMaxValue Then
m_dValue = dTempValue
If m_MinMaxType = MinMaxTypes.ABSOLUT Then
If dTempValue >= m_dMinValue AndAlso dTempValue <= m_dMaxValue Then
m_dValue = dTempValue
End If
ElseIf m_MinMaxType = MinMaxTypes.PERCENTAGE Then
Dim LinkedParam As MachiningParam = Nothing
' cerco il parametro a cui e' collegato
For Each CurrCathegory In Map.refMachiningDbVM.SelMachining.CathegoryList
LinkedParam = CurrCathegory.MachiningParamList.FirstOrDefault(Function(x) x.Type = m_MinMaxLinkedParam)
If Not IsNothing(LinkedParam) Then Exit For
Next
If Not IsNothing(LinkedParam) AndAlso TypeOf LinkedParam Is NumericMachiningParam Then
Dim NumericLinkedParam As NumericMachiningParam = DirectCast(LinkedParam, NumericMachiningParam)
If dTempValue >= NumericLinkedParam.dValue * m_dMinValue / 100 AndAlso dTempValue <= NumericLinkedParam.dValue * m_dMaxValue / 100 Then
m_dValue = dTempValue
End If
Else
m_dValue = dTempValue
End If
End If
Else
m_dValue = dTempValue
End If
NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
ManageDependencyParam()
End Set
End Property
@@ -375,6 +451,9 @@ Public Class CurrNumericMachiningParam
Case Params.LINKZUP
bReadFromPart = EgtGetInfo(nPartId, MAC_LINKZUP, m_dValue)
m_bIsLen = True
Case Params.INNERSHELLWIDTH
bReadFromPart = EgtGetInfo(nPartId, MAC_INNERSHELLWIDTH, m_dValue)
m_bIsLen = True
Case Params.OFFSETLEADPOINT
bReadFromPart = EgtGetInfo(nPartId, MAC_OFFSETLEADPOINT, m_dValue)
m_bIsLen = True
@@ -402,6 +481,9 @@ Public Class CurrNumericMachiningParam
Case Params.WIPEFEED_PC
bReadFromPart = EgtGetInfo(nPartId, MAC_WIPEFEEDPU, m_dValue)
m_bIsLen = False
Case Params.SPIRALVASELEN
bReadFromPart = EgtGetInfo(nPartId, MAC_SPIRALVASELEN, m_dValue)
m_bIsLen = True
'Case Params.WIPEDIR
' bReadFromPart = EgtGetInfo(nPartId, MAC_WIPEDIR, m_dValue)
' m_bIsLen = True
@@ -419,19 +501,34 @@ Public Class CurrNumericMachiningParam
m_bIsLen = True
Case Params.PREFLOWDELAY
bReadFromPart = EgtGetInfo(nPartId, MAC_PREFLOWDELAY, m_dValue)
m_bIsLen = True
m_bIsLen = False
Case Params.POSTFLOWDELAY
bReadFromPart = EgtGetInfo(nPartId, MAC_POSTFLOWDELAY, m_dValue)
m_bIsLen = True
m_bIsLen = False
Case Params.SCREWBACK
bReadFromPart = EgtGetInfo(nPartId, MAC_SCREWBACK, m_dValue)
m_bIsLen = False
Case Params.SLICINGHEIGHT
bReadFromPart = EgtGetInfo(nPartId, MAC_SLICINGHEIGHT, m_dValue)
m_bIsLen = True
Case Params.MAXSLICESNUMBER
bReadFromPart = EgtGetInfo(nPartId, MAC_MAXSLICESNUMBER, m_dValue)
m_bIsLen = False
Case Params.RIBSSTRANDWIDTH
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSSTRANDWIDTH, m_dValue)
m_bIsLen = True
Case Params.RIBSOVERLAP
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSOVERLAP, m_dValue)
m_bIsLen = False
Case Params.RIBSSTRANDOVERLAP
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSSTRANDOVERLAP, m_dValue)
m_bIsLen = False
Case Params.RIBSSTRANDCOUNT
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSSTRANDCOUNT, m_dValue)
m_bIsLen = False
Case Params.RIBSLINKFILLET
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLINKFILLET, m_dValue)
m_bIsLen = True
Case Params.RIBSLEADINLEN
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADINLEN, m_dValue)
m_bIsLen = True
@@ -447,6 +544,9 @@ Public Class CurrNumericMachiningParam
Case Params.RIBSLEADOUTWIPEDIR
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADOUTWIPEDIR, m_dValue)
m_bIsLen = False
Case Params.RIBSLEADFILLET
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADFILLET, m_dValue)
m_bIsLen = True
Case Params.SHELLNBRDIFFERENCE
bReadFromPart = EgtGetInfo(nPartId, MAC_SHELLNBRDIFFERENCE, m_dValue)
m_bIsLen = False
@@ -459,15 +559,39 @@ Public Class CurrNumericMachiningParam
Case Params.SHELLNBRWIPEDIR
bReadFromPart = EgtGetInfo(nPartId, MAC_SHELLNBRWIPEDIR, m_dValue)
m_bIsLen = False
Case Params.AUXSOLIDSSTRANDWIDTH
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSSTRANDWIDTH, m_dValue)
m_bIsLen = True
Case Params.AUXSOLIDSOVERLAP
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSOVERLAP, m_dValue)
m_bIsLen = False
Case Params.AUXSOLIDSLINKPARAM
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSLINKPARAM, m_dValue)
m_bIsLen = True
Case Params.AUXSOLIDSSTRANDCOUNT
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSSTRANDCOUNT, m_dValue)
m_bIsLen = False
Case Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, m_dValue)
m_bIsLen = True
Case Params.AUXSOLIDSOFFSETLEADPOINT
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSOFFSETLEADPOINT, m_dValue)
m_bIsLen = True
Case Params.AUXSOLIDSDENSITY
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSDENSITY, m_dValue)
m_bIsLen = True
Case Params.AUXSOLIDSGRIDOVERLAP
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSGRIDOVERLAP, m_dValue)
m_bIsLen = True
Case Params.AUXSOLIDSDIRECTION
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSDIRECTION, m_dValue)
m_bIsLen = True
Case Params.AUXSOLIDSOFFSETX
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSOFFSETX, m_dValue)
m_bIsLen = True
Case Params.AUXSOLIDSOFFSETY
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSOFFSETY, m_dValue)
m_bIsLen = True
Case Params.AUXSOLIDSCOASTINGLEN
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSCOASTINGLEN, m_dValue)
m_bIsLen = True
@@ -480,27 +604,66 @@ Public Class CurrNumericMachiningParam
Case Params.FLOWRATE_PC
bReadFromPart = EgtGetInfo(nPartId, MAC_CONSTANT, m_dValue)
m_bIsLen = False
Case Params.CEILCOUNT
bReadFromPart = EgtGetInfo(nPartId, MAC_CEILCOUNT, m_dValue)
m_bIsLen = False
Case Params.INFILLSTRANDWIDTH
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLSTRANDWIDTH, m_dValue)
m_bIsLen = True
Case Params.INFILLDENSITY
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLDENSITY, m_dValue)
m_bIsLen = False
Case Params.INFILLOVERLAP
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLOVERLAP, m_dValue)
m_bIsLen = False
Case Params.INFILLGRIDOVERLAP
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLGRIDOVERLAP, m_dValue)
m_bIsLen = False
Case Params.INFILLDIRECTION
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLDIRECTION, m_dValue)
m_bIsLen = False
Case Params.INFILLOFFSETX
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLOFFSETX, m_dValue)
m_bIsLen = True
Case Params.INFILLOFFSETY
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLOFFSETY, m_dValue)
m_bIsLen = True
Case Params.INFILLCOASTING
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLCOASTING, m_dValue)
m_bIsLen = True
Case Params.INFILLWIPE
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLWIPE, m_dValue)
m_bIsLen = True
Case Params.INFILLWIPEDIR
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLWIPEDIR, m_dValue)
m_bIsLen = False
End Select
m_dOrigValue = m_dValue
If nIndex > 0 Then
Dim DbMachining As Machining = Map.refMachiningDbVM.MachiningList.FirstOrDefault(Function(x) x.nIndex = nIndex)
Select Case Type
Case Params.STRANDH, Params.STRANDW, Params.STRANDCOUNT, Params.OFFSET, Params.STRANDOVERLAP, Params.STARTPOINTOFFSETONSLICE,
Params.FLOORCOUNT, Params.G0FEED, Params.G0FEEDZ, Params.LINKZUP, Params.TOOLDIAM, Params.FLOWRATE_PC, Params.PREFLOWDELAY, Params.POSTFLOWDELAY, Params.SCREWBACK
Params.G0FEED, Params.G0FEEDZ, Params.LINKZUP, Params.TOOLDIAM, Params.FLOWRATE_PC, Params.PREFLOWDELAY, Params.POSTFLOWDELAY, Params.SCREWBACK, Params.SLICINGHEIGHT, Params.MAXSLICESNUMBER
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.LINKPARAM, Params.OFFSETLEADPOINT, Params.LEADINTANGDIST, Params.LEADINORTHODIST,
Case Params.LINKPARAM, Params.INNERSHELLWIDTH, Params.OFFSETLEADPOINT, Params.LEADINTANGDIST, Params.LEADINORTHODIST,
Params.LEADOUTTANGDIST, Params.LEADOUTORTHODIST, Params.COASTINGLEN, Params.COASTINGFEED_PC,
Params.WIPELEN, Params.WIPEFEED_PC ' Params.WIPEDIR
Params.WIPELEN, Params.WIPEFEED_PC, Params.SPIRALVASELEN, Params.SINGLELEADIN ' Params.WIPEDIR
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.LINK).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.RIBSOVERLAP, Params.RIBSSTRANDCOUNT, Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION,
Case Params.RIBSSTRANDWIDTH, Params.RIBSOVERLAP, Params.RIBSSTRANDOVERLAP, Params.RIBSSTRANDCOUNT, Params.RIBSLINK, Params.RIBSLINKFILLET, Params.RIBSMERGEWITHSHELL, Params.RIBSINVERTMERGEDSHELLMAINLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION,
Params.RIBSLEADININVERT, Params.RIBSLEADINLEN, Params.RIBSLEADOUTINVERT, Params.RIBSLEADOUTLEN, Params.RIBSLEADOUTCOASTING,
Params.RIBSLEADOUTWIPE, Params.RIBSLEADOUTWIPEDIR
Params.RIBSLEADOUTWIPE, Params.RIBSLEADOUTWIPEDIR, Params.RIBSLEADFILLET
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.SHELLNBRDIFFERENCE, Params.SHELLNBRCOASTING, Params.SHELLNBRWIPE, Params.SHELLNBRWIPEDIR
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.SHELL_NUMBER).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.AUXSOLIDSOVERLAP, Params.AUXSOLIDSLINKPARAM, Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE,
Params.AUXSOLIDSCOASTINGLEN, Params.AUXSOLIDSWIPELEN, Params.AUXSOLIDSWIPEDIR
Case Params.AUXSOLIDSSTRANDWIDTH, Params.AUXSOLIDSOVERLAP, Params.AUXSOLIDSLINKPARAM, Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE,
Params.AUXSOLIDSOFFSETLEADPOINT, Params.AUXSOLIDSDENSITY, Params.AUXSOLIDSGRIDOVERLAP,
Params.AUXSOLIDSDIRECTION, Params.AUXSOLIDSOFFSETX, Params.AUXSOLIDSOFFSETY,
Params.AUXSOLIDSCOASTINGLEN, Params.AUXSOLIDSWIPELEN, Params.AUXSOLIDSWIPEDIR, Params.AUXSOLIDSSTRANDCOUNT
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.AUX_SOLID).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.INFILLSTRANDWIDTH, Params.FLOORCOUNT, Params.CEILCOUNT, Params.INFILLDENSITY, Params.INFILLOVERLAP,
Params.INFILLGRIDOVERLAP, Params.INFILLDIRECTION, Params.INFILLOFFSETX,
Params.INFILLOFFSETY, Params.INFILLCOASTING, Params.INFILLWIPE, Params.INFILLWIPEDIR
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.INFILL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
End Select
If bForceFromDb OrElse Not bReadFromPart Then
m_dValue = m_DbParam.dOrigValue
@@ -539,6 +702,8 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_LINKPARAM, sWriteValue)
Case Params.LINKZUP
EgtSetInfo(nPartId, MAC_LINKZUP, sWriteValue)
Case Params.INNERSHELLWIDTH
EgtSetInfo(nPartId, MAC_INNERSHELLWIDTH, sWriteValue)
Case Params.OFFSETLEADPOINT
EgtSetInfo(nPartId, MAC_OFFSETLEADPOINT, sWriteValue)
Case Params.LEADINTANGDIST
@@ -557,6 +722,8 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_WIPELEN, sWriteValue)
Case Params.WIPEFEED_PC
EgtSetInfo(nPartId, MAC_WIPEFEEDPU, sWriteValue)
Case Params.SPIRALVASELEN
EgtSetInfo(nPartId, MAC_SPIRALVASELEN, sWriteValue)
'Case Params.WIPEDIR
' EgtSetInfo(nPartId, MAC_WIPEDIR, sWriteValue)
Case Params.FLOORCOUNT
@@ -573,10 +740,20 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_POSTFLOWDELAY, sWriteValue)
Case Params.SCREWBACK
EgtSetInfo(nPartId, MAC_SCREWBACK, sWriteValue)
Case Params.SLICINGHEIGHT
EgtSetInfo(nPartId, MAC_SLICINGHEIGHT, sWriteValue)
Case Params.MAXSLICESNUMBER
EgtSetInfo(nPartId, MAC_MAXSLICESNUMBER, sWriteValue)
Case Params.RIBSSTRANDWIDTH
EgtSetInfo(nPartId, MAC_RIBSSTRANDWIDTH, sWriteValue)
Case Params.RIBSOVERLAP
EgtSetInfo(nPartId, MAC_RIBSOVERLAP, sWriteValue)
Case Params.RIBSSTRANDOVERLAP
EgtSetInfo(nPartId, MAC_RIBSSTRANDOVERLAP, sWriteValue)
Case Params.RIBSSTRANDCOUNT
EgtSetInfo(nPartId, MAC_RIBSSTRANDCOUNT, sWriteValue)
Case Params.RIBSLINKFILLET
EgtSetInfo(nPartId, MAC_RIBSLINKFILLET, sWriteValue)
Case Params.RIBSLEADINLEN
EgtSetInfo(nPartId, MAC_RIBSLEADINLEN, sWriteValue)
Case Params.RIBSLEADOUTLEN
@@ -587,6 +764,8 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_RIBSLEADOUTWIPE, sWriteValue)
Case Params.RIBSLEADOUTWIPEDIR
EgtSetInfo(nPartId, MAC_RIBSLEADOUTWIPEDIR, sWriteValue)
Case Params.RIBSLEADFILLET
EgtSetInfo(nPartId, MAC_RIBSLEADFILLET, sWriteValue)
Case Params.SHELLNBRDIFFERENCE
EgtSetInfo(nPartId, MAC_SHELLNBRDIFFERENCE, sWriteValue)
Case Params.SHELLNBRCOASTING
@@ -595,12 +774,28 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_SHELLNBRWIPE, sWriteValue)
Case Params.SHELLNBRWIPEDIR
EgtSetInfo(nPartId, MAC_SHELLNBRWIPEDIR, sWriteValue)
Case Params.AUXSOLIDSSTRANDWIDTH
EgtSetInfo(nPartId, MAC_AUXSOLIDSSTRANDWIDTH, sWriteValue)
Case Params.AUXSOLIDSSTRANDCOUNT
EgtSetInfo(nPartId, MAC_AUXSOLIDSSTRANDCOUNT, sWriteValue)
Case Params.AUXSOLIDSOVERLAP
EgtSetInfo(nPartId, MAC_AUXSOLIDSOVERLAP, sWriteValue)
Case Params.AUXSOLIDSLINKPARAM
EgtSetInfo(nPartId, MAC_AUXSOLIDSLINKPARAM, sWriteValue)
Case Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE
EgtSetInfo(nPartId, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, sWriteValue)
Case Params.AUXSOLIDSOFFSETLEADPOINT
EgtSetInfo(nPartId, MAC_AUXSOLIDSOFFSETLEADPOINT, sWriteValue)
Case Params.AUXSOLIDSDENSITY
EgtSetInfo(nPartId, MAC_AUXSOLIDSDENSITY, sWriteValue)
Case Params.AUXSOLIDSGRIDOVERLAP
EgtSetInfo(nPartId, MAC_AUXSOLIDSGRIDOVERLAP, sWriteValue)
Case Params.AUXSOLIDSDIRECTION
EgtSetInfo(nPartId, MAC_AUXSOLIDSDIRECTION, sWriteValue)
Case Params.AUXSOLIDSOFFSETX
EgtSetInfo(nPartId, MAC_AUXSOLIDSOFFSETX, sWriteValue)
Case Params.AUXSOLIDSOFFSETY
EgtSetInfo(nPartId, MAC_AUXSOLIDSOFFSETY, sWriteValue)
Case Params.AUXSOLIDSCOASTINGLEN
EgtSetInfo(nPartId, MAC_AUXSOLIDSCOASTINGLEN, sWriteValue)
Case Params.AUXSOLIDSWIPELEN
@@ -609,6 +804,28 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_AUXSOLIDSWIPEDIR, sWriteValue)
Case Params.FLOWRATE_PC
EgtSetInfo(nPartId, MAC_CONSTANT, sWriteValue)
Case Params.INFILLSTRANDWIDTH
EgtSetInfo(nPartId, MAC_INFILLSTRANDWIDTH, sWriteValue)
Case Params.CEILCOUNT
EgtSetInfo(nPartId, MAC_CEILCOUNT, sWriteValue)
Case Params.INFILLDENSITY
EgtSetInfo(nPartId, MAC_INFILLDENSITY, sWriteValue)
Case Params.INFILLOVERLAP
EgtSetInfo(nPartId, MAC_INFILLOVERLAP, sWriteValue)
Case Params.INFILLGRIDOVERLAP
EgtSetInfo(nPartId, MAC_INFILLGRIDOVERLAP, sWriteValue)
Case Params.INFILLDIRECTION
EgtSetInfo(nPartId, MAC_INFILLDIRECTION, sWriteValue)
Case Params.INFILLOFFSETX
EgtSetInfo(nPartId, MAC_INFILLOFFSETX, sWriteValue)
Case Params.INFILLOFFSETY
EgtSetInfo(nPartId, MAC_INFILLOFFSETY, sWriteValue)
Case Params.INFILLCOASTING
EgtSetInfo(nPartId, MAC_INFILLCOASTING, sWriteValue)
Case Params.INFILLWIPE
EgtSetInfo(nPartId, MAC_INFILLWIPE, sWriteValue)
Case Params.INFILLWIPEDIR
EgtSetInfo(nPartId, MAC_INFILLWIPEDIR, sWriteValue)
End Select
End Sub
@@ -750,17 +967,15 @@ Public Class CurrComboMachiningParam
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.SLICINGTYPE
Dim nSlicingType As Integer = GetPrivateProfileInt(S_MACH_PRINTING3D, K_SLICINGTYPE, 0, CurrentMachine.sMachIniFile)
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical")})
If nSlicingType >= 1 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45deg X"))
If nSlicingType >= 2 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45_Y, "45deg Y"))
If nSlicingType >= 3 Then
m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
End If
End If
End If
Dim nNewSlicingType As Integer = CurrentMachine.GetSlicingType()
m_ValueList = New List(Of IdNameStruct)
If (nNewSlicingType And 1) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.VERTICAL, "Vertical"))
If (nNewSlicingType And 2) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45, "45deg X"))
If (nNewSlicingType And 4) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.DEG45_Y, "45deg Y"))
If (nNewSlicingType And 8) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.HORIZONTAL, "Horizontal"))
If (nNewSlicingType And 16) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.MULTIPLANAR, "MultiPlanar"))
If (nNewSlicingType And 32) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.MULTIPLANAR_DEG45, "MultiPlanar 45deg"))
If (nNewSlicingType And 64) <> 0 Then m_ValueList.Add(New IdNameStruct(Machining.MPAR_SLICINGTYPE.MULTIPLANAR_HORIZ, "MultiPlanar Horiz"))
Dim nSelValue As Integer = 0
bReadFromPart = EgtGetInfo(nPartId, MAC_SLICINGTYPE, nSelValue)
If Not bReadFromPart Then
@@ -811,9 +1026,14 @@ Public Class CurrComboMachiningParam
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSTYPE, nSelValue)
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
Case Params.AUXSOLIDSINFILL
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_INFILL.NONE, "None"),
New IdNameStruct(Machining.MPAR_INFILL.OFFSET, "Offset"),
New IdNameStruct(Machining.MPAR_INFILL.ZIGZAG, "ZigZag")})
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_INFILL_TYPE.NONE, "None"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.OFFSET, "Offset"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.ZIGZAG, "ZigZag"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.LINES, "Lines"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.GRID, "Grid"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.ZIGZAG_GRID, "Zigzag Grid"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.HONEYCOMB, "Honeycomb"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.HONEYCOMB_GRID, "Honeycomb Grid")})
Dim nSelValue As Integer = 0
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSINFILL, nSelValue)
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
@@ -836,6 +1056,28 @@ Public Class CurrComboMachiningParam
Dim nSelValue As Integer = 0
bReadFromPart = EgtGetInfo(nPartId, MAC_DYNAMICMODE, nSelValue)
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
Case Params.FLOORTYPE
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_INFILL_TYPE.OFFSET, "Offset"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.ZIGZAG, "ZigZag")})
Dim nSelValue As Integer = 0
bReadFromPart = EgtGetInfo(nPartId, MAC_FLOORTYPE, nSelValue)
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
Case Params.CEILTYPE
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_INFILL_TYPE.OFFSET, "Offset"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.ZIGZAG, "ZigZag")})
Dim nSelValue As Integer = 0
bReadFromPart = EgtGetInfo(nPartId, MAC_CEILTYPE, nSelValue)
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
Case Params.INFILLTYPE
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_INFILL_TYPE.NONE, "None"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.LINES, "Lines"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.GRID, "Grid"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.ZIGZAG_GRID, "Zigzag Grid"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.HONEYCOMB, "Honeycomb"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.HONEYCOMB_GRID, "Honeycomb Grid")})
Dim nSelValue As Integer = 0
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLTYPE, nSelValue)
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
End Select
m_OrigSelValue = m_SelValue
If nIndex > 0 Then
@@ -849,6 +1091,8 @@ Public Class CurrComboMachiningParam
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.AUXSOLIDSINFILL, Params.AUXSOLIDSSTRANDORDER, Params.AUXSOLIDSLINKTYPE
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.AUX_SOLID).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.FLOORTYPE, Params.CEILTYPE, Params.INFILLTYPE
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.INFILL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
End Select
If bForceFromDb OrElse Not bReadFromPart Then
m_SelValue = m_DbParam.OrigSelValue
@@ -887,6 +1131,12 @@ Public Class CurrComboMachiningParam
EgtSetInfo(nPartId, MAC_AUXSOLIDSLINKTYPE, m_SelValue.Id)
Case Params.DYNAMIC_MODE
EgtSetInfo(nPartId, MAC_DYNAMICMODE, m_SelValue.Id)
Case Params.FLOORTYPE
EgtSetInfo(nPartId, MAC_FLOORTYPE, m_SelValue.Id)
Case Params.CEILTYPE
EgtSetInfo(nPartId, MAC_CEILTYPE, m_SelValue.Id)
Case Params.INFILLTYPE
EgtSetInfo(nPartId, MAC_INFILLTYPE, m_SelValue.Id)
End Select
End Sub
@@ -937,6 +1187,7 @@ Public Class CurrCheckMachiningParam
m_bValue = value
NotifyPropertyChanged(NameOf(bValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
ManageDependencyParam()
End Set
End Property
@@ -962,8 +1213,14 @@ Public Class CurrCheckMachiningParam
Select Case Type
Case Params.SPIRALVASE
bReadFromPart = EgtGetInfo(nPartId, MAC_SPIRALVASE, m_bValue)
Case Params.SINGLELEADIN
bReadFromPart = EgtGetInfo(nPartId, MAC_SINGLELEADIN, m_bValue)
Case Params.RIBSLINK
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLINK, m_bValue)
Case Params.RIBSMERGEWITHSHELL
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSMERGEWITHSHELL, m_bValue)
Case Params.RIBSINVERTMERGEDSHELLMAINLINK
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTMERGEDSHELLMAINLINK, m_bValue)
Case Params.RIBSINVERTORDER
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSINVERTORDER, m_bValue)
Case Params.RIBSINVERTDIRECTION
@@ -976,6 +1233,10 @@ Public Class CurrCheckMachiningParam
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADOUTINVERT, m_bValue)
Case Params.RIBSLIMITUNBOUNDEDWITHSOLID
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLIMITUNBOUNDEDWITHSOLID, m_bValue)
Case Params.AUXSOLIDSINFILLLINK
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSINFILLLINK, m_bValue)
Case Params.INFILLLINK
bReadFromPart = EgtGetInfo(nPartId, MAC_INFILLLINK, m_bValue)
End Select
m_bOrigValue = m_bValue
If nIndex > 0 Then
@@ -983,8 +1244,14 @@ Public Class CurrCheckMachiningParam
Select Case Type
Case Params.SPIRALVASE
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSINVERTSTRANDORDER, Params.RIBSLEADININVERT, Params.RIBSLEADOUTINVERT, Params.RIBSLIMITUNBOUNDEDWITHSOLID
Case Params.SINGLELEADIN
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.LINK).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.RIBSLINK, Params.RIBSMERGEWITHSHELL, Params.RIBSINVERTMERGEDSHELLMAINLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION, Params.RIBSINVERTSTRANDORDER, Params.RIBSLEADININVERT, Params.RIBSLEADOUTINVERT, Params.RIBSLIMITUNBOUNDEDWITHSOLID
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.RIBS).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.AUXSOLIDSINFILLLINK
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.AUX_SOLID).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.INFILLLINK
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.INFILL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
End Select
If bForceFromDb OrElse Not bReadFromPart Then
m_bValue = m_DbParam.bOrigValue
@@ -997,8 +1264,14 @@ Public Class CurrCheckMachiningParam
Select Case Type
Case Params.SPIRALVASE
EgtSetInfo(nPartId, MAC_SPIRALVASE, If(m_bValue, 1, 0))
Case Params.SINGLELEADIN
EgtSetInfo(nPartId, MAC_SINGLELEADIN, If(m_bValue, 1, 0))
Case Params.RIBSLINK
EgtSetInfo(nPartId, MAC_RIBSLINK, If(m_bValue, 1, 0))
Case Params.RIBSMERGEWITHSHELL
EgtSetInfo(nPartId, MAC_RIBSMERGEWITHSHELL, If(m_bValue, 1, 0))
Case Params.RIBSINVERTMERGEDSHELLMAINLINK
EgtSetInfo(nPartId, MAC_RIBSINVERTMERGEDSHELLMAINLINK, If(m_bValue, 1, 0))
Case Params.RIBSINVERTORDER
EgtSetInfo(nPartId, MAC_RIBSINVERTORDER, If(m_bValue, 1, 0))
Case Params.RIBSINVERTDIRECTION
@@ -1011,6 +1284,10 @@ Public Class CurrCheckMachiningParam
EgtSetInfo(nPartId, MAC_RIBSLEADOUTINVERT, If(m_bValue, 1, 0))
Case Params.RIBSLIMITUNBOUNDEDWITHSOLID
EgtSetInfo(nPartId, MAC_RIBSLIMITUNBOUNDEDWITHSOLID, If(m_bValue, 1, 0))
Case Params.AUXSOLIDSINFILLLINK
EgtSetInfo(nPartId, MAC_AUXSOLIDSINFILLLINK, If(m_bValue, 1, 0))
Case Params.INFILLLINK
EgtSetInfo(nPartId, MAC_INFILLLINK, If(m_bValue, 1, 0))
End Select
End Sub
@@ -54,9 +54,17 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
ToolTip="{StaticResource MachiningParam_Tooltip}"
Style="{StaticResource ParameterList_TextBlock}"/>
<TextBlock Text=" (BETA)"
Margin="0,0,2.5,0"
Foreground="Red"
Visibility="{Binding IsBeta_Visibility}"
Style="{StaticResource ParameterList_TextBlock}"/>
</StackPanel>
<EgtWPFLib5:EgtTextBox2 Grid.Column="1"
Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
Margin="2.5,0,2.5,0"
@@ -79,9 +87,18 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
ToolTip="{StaticResource MachiningParam_Tooltip}"
Style="{StaticResource ParameterList_TextBlock}">
</TextBlock>
<TextBlock Text=" (BETA)"
Margin="0,0,2.5,0"
Foreground="Red"
Visibility="{Binding IsBeta_Visibility}"
Style="{StaticResource ParameterList_TextBlock}"/>
</StackPanel>
<ComboBox Grid.Column="1"
ItemsSource="{Binding ValueList}"
SelectedItem="{Binding SelValue}"
@@ -107,9 +124,17 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
ToolTip="{StaticResource MachiningParam_Tooltip}"
Style="{StaticResource ParameterList_TextBlock}"/>
<TextBlock Text=" (BETA)"
Margin="0,0,2.5,0"
Foreground="Red"
Visibility="{Binding IsBeta_Visibility}"
Style="{StaticResource ParameterList_TextBlock}"/>
</StackPanel>
<CheckBox Grid.Column="1"
IsChecked="{Binding bValue}"
HorizontalAlignment="Center"
@@ -135,6 +160,7 @@
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
ToolTip="{StaticResource MachiningParam_Tooltip}"
Style="{StaticResource ParameterList_TextBlock}"/>
<CheckBox Grid.Column="1"
IsChecked="{Binding bValue}"
@@ -160,6 +186,7 @@
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
ToolTip="{StaticResource MachiningParam_Tooltip}"
Style="{StaticResource ParameterList_TextBlock}"/>
<ListBox Grid.Column="1"
ItemsSource="{Binding ValueList}"
@@ -140,7 +140,7 @@ Public Class CurrMachiningPanelVM
WriteMachiningParam(nIndex, MAC_GUID, sNewMachGUID.ToString())
WriteMachiningParam(nIndex, MAC_NAME, SaveInDbWndVM.sName)
' creo categoria materiali con attivo materiale corrente
Dim MaterialCathegory As New MachiningCathegory(MachiningCathegory.Cathegories.MATERIALS, 0)
Dim MaterialCathegory As New MachiningCathegory(MachiningCathegory.Cathegories.MATERIALS, 0, m_CurrMachining)
Dim SelMaterialParam As MaterialMachiningParam = MaterialCathegory.MachiningParamList.FirstOrDefault(Function(x As MaterialMachiningParam) x.sGUID = Map.refTopPanelVM.SelMaterial.sGUID)
If Not IsNothing(SelMaterialParam) Then
SelMaterialParam.bValue = True
@@ -21,8 +21,8 @@ Public Class DispositionPanelVM
Dim dNewXPos As Double = ptReference.x
StringToLen(value, dNewXPos)
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
Dim dMin As Double = 0
Dim dMax As Double = CurrentMachine.b3Tab.DimX
Dim dMin As Double = Math.Min( 0, CurrentMachine.b3ExtrusionArea.Min.x)
Dim dMax As Double = Math.Max( CurrentMachine.b3Tab.DimX, CurrentMachine.b3ExtrusionArea.Max.x)
If b3Print.Max.x > ptReference.x Then
dMax -= b3Print.Max.x - ptReference.x
End If
@@ -60,8 +60,8 @@ Public Class DispositionPanelVM
Dim dNewYPos As Double = ptReference.y
StringToLen(value, dNewYPos)
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
Dim dMin As Double = 0
Dim dMax As Double = CurrentMachine.b3Tab.DimY
Dim dMin As Double = Math.Min( 0, CurrentMachine.b3ExtrusionArea.Min.y)
Dim dMax As Double = Math.Max( CurrentMachine.b3Tab.DimY, CurrentMachine.b3ExtrusionArea.Max.y)
If b3Print.Max.y > ptReference.y Then
dMax -= b3Print.Max.y - ptReference.y
End If
+324
View File
@@ -0,0 +1,324 @@
<EgtWPFLib5:EgtMainWindow x:Class="EgtColorPickerV"
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 sTitle}"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
Style="{StaticResource Dialog_Window}">
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Text="{Binding BasicColor_Msg}"
Margin="5,0,5,0"
Style="{StaticResource DialogWindow_TextBlock}"/>
<ListBox Grid.Row="1"
ItemsSource="{Binding BasicColors}"
SelectedItem="{Binding SelColor}"
HorizontalAlignment="Center">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="8"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Rectangle Width="20"
Height="20"
Margin="4"
Stroke="Black"
StrokeThickness="0.5"
Fill="{Binding Fill}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock Grid.Row="2"
Text="{Binding CustomColor_Msg}"
Margin="5,0,5,0"
Style="{StaticResource DialogWindow_TextBlock}"/>
<ListBox Grid.Row="3"
Margin="5,0,0,0"
ItemsSource="{Binding CustomColors}"
SelectedItem="{Binding SelCustomColor}"
HorizontalAlignment="Center">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="8"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Rectangle Width="20"
Height="20"
Margin="4"
Stroke="Black"
StrokeThickness="0.5"
Fill="{Binding Fill}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid x:Name="CanvasGrid"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Margin="5,10,5,0">
<Canvas x:Name="MyCanvas"
MouseDown="ColorRectangle_MouseDown"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Width="260"
Height="{Binding ActualHeight, ElementName=CanvasGrid}">
<Rectangle Grid.Column="0"
Width="{Binding ActualWidth, ElementName=MyCanvas}"
Height="{Binding ActualHeight, ElementName=MyCanvas}"
Stroke="Black"
StrokeThickness="0.5"
IsEnabled="True">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0, 0.5" EndPoint="1.6, 0.5" >
<GradientStop Color="Red" Offset="0" />
<GradientStop Color="Yellow" Offset="0.1" />
<GradientStop Color="Lime" Offset="0.2" />
<GradientStop Color="Cyan" Offset="0.3" />
<GradientStop Color="Blue" Offset="0.4" />
<GradientStop Color="Purple" Offset="0.5" />
<GradientStop Color="Red" Offset="0.6" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle Grid.Column="0"
Width="{Binding ActualWidth, ElementName=MyCanvas}"
Height="{Binding ActualHeight, ElementName=MyCanvas}"
Stroke="Black"
StrokeThickness="0.5"
IsEnabled="True">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1" >
<GradientStop Color="#00ffffff" Offset="0" />
<GradientStop Color="Gray" Offset="1" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Ellipse x:Name="Ellipse"
Stroke="Black"
StrokeThickness="1"
Width="15"
Height="15"/>
</Canvas>
</Grid>
<Grid x:Name="CanvasGridL"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Grid.Column="1"
Margin="5,10,10,0">
<Canvas x:Name="MyCanvasL"
MouseMove="Luminosity_MouseMove"
MouseDown="Luminosity_MouseDown"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Height="{Binding ActualHeight, ElementName=CanvasGridL}"
Width="20">
<!--<Rectangle x:Name="LRect"
Grid.Column="1"
Width="20"
Height="{Binding ActualHeight, ElementName=MyCanvasL}"
Stroke="Black"
StrokeThickness="0.5"
Fill="{Binding Luminosity_Fill}"/>-->
<Rectangle Grid.Column="1"
Width="20"
Height="{Binding ActualHeight, ElementName=MyCanvasL}"
Stroke="Black"
StrokeThickness="0.5">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.5, 1" >
<GradientStop Color="White" Offset="0" />
<GradientStop x:Name="LightnessColor" Offset="0.5"/>
<GradientStop Color="Black" Offset="1" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Path x:Name="Arrow"
Grid.Column="1"
Data="M0,0 l4,4 l0,2 l-4,-4 l-4,4 l0,-2 z "
Canvas.Left="0"
Canvas.Top="10"
Stroke="Black"
Fill="Black"
StrokeThickness="1">
<!--Data="M13.5,10.697 l-3.497-3.6,-3.497,3.6 L6.494,8.328 l3.503-3.631 l3.48,3.592 L13.494,10.697z"-->
<Path.RenderTransform>
<RotateTransform Angle="270" />
</Path.RenderTransform>
</Path>
</Canvas>
</Grid>
</Grid>
<Grid Grid.Row="1" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Margin="0,10,5,0"
HorizontalAlignment="Left">
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Rectangle Width="100"
Height="70"
Stroke="Black"
StrokeThickness="0.5"
Fill="{Binding CurrColor}"/>
<Button x:Name="SaveColor"
Grid.Row="1"
Margin="0,5,0,0"
Content="{Binding AddCColor_Msg}"
Command="{Binding SaveColor_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</Grid>
<Grid Grid.Column="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Red_Msg}"
Margin="0,10,5,0"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="1"
HorizontalAlignment="Right"
Margin="0,10,5,0"
IsReadOnly="False"
Text="{Binding Red, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ParameterList_TextBox}"/>
<TextBlock Grid.Row="1"
Text="{Binding Green_Msg}"
Margin="5,5,5,0"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="1"
Grid.Row="1"
HorizontalAlignment="Right"
Margin="5,5,5,0"
IsReadOnly="False"
Text="{Binding Green, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ParameterList_TextBox}"/>
<TextBlock Grid.Row="2"
Text="{Binding Blu_Msg}"
Margin="5,5,5,0"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="1"
Grid.Row="2"
HorizontalAlignment="Right"
Margin="5,5,5,0"
IsReadOnly="False"
Text="{Binding Blue, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ParameterList_TextBox}"/>
<TextBlock Grid.Column="2"
Text="H"
Margin="0,10,5,0"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="3"
HorizontalAlignment="Right"
Margin="0,10,5,0"
IsReadOnly="False"
Text="{Binding Hue, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ParameterList_TextBox}"/>
<TextBlock Grid.Row="1"
Grid.Column="2"
Text="S"
Margin="5,5,5,0"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="3"
Grid.Row="1"
HorizontalAlignment="Right"
Margin="5,5,5,0"
IsReadOnly="False"
Text="{Binding Saturation, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ParameterList_TextBox}"/>
<TextBlock Grid.Row="2"
Grid.Column="2"
Text="L"
Margin="5,5,5,0"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="3"
Grid.Row="2"
HorizontalAlignment="Right"
Margin="5,5,5,0"
IsReadOnly="False"
Text="{Binding Lightness, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ParameterList_TextBox}"/>
<TextBlock Grid.Row="3"
Grid.ColumnSpan="2"
Text="{Binding Hexadecimal_Msg}"
Margin="5,5,5,0"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="2"
Grid.ColumnSpan="2"
Grid.Row="3"
HorizontalAlignment="Right"
Margin="5,5,5,0"
Text="{Binding Hexadecimal, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ParameterList_TextBox}"/>
</Grid>
</Grid>
</Grid>
</Grid>
<UniformGrid Grid.Row="2"
Rows="1"
Margin="10,10,10,0">
<Button IsDefault="True"
Content="OK"
Command="{Binding Ok_Command}"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
<Button Content="Cancel"
Command="{Binding Cancel_Command}"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtMainWindow>
@@ -0,0 +1,313 @@
Imports System.Drawing.Configuration
Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Public Class EgtColorPickerV
#Region "FIELDS & PROPERTIES"
Private WithEvents m_EgtColorPickerVM As EgtColorPickerVM
Private Shadows DialogResult As DialogResult
Public Property CustomColors As Integer()
Get
Return m_EgtColorPickerVM.GetCustomColors()
End Get
Set(value As Integer())
m_EgtColorPickerVM.SetCustomColors(value)
End Set
End Property
Public Property Color As System.Drawing.Color
Get
Dim RgbColor As Color = HSLColor.HslToRgb(m_EgtColorPickerVM.HSLColor)
Return System.Drawing.Color.FromArgb(255, RgbColor.R, RgbColor.G, RgbColor.B)
End Get
Set(value As System.Drawing.Color)
m_EgtColorPickerVM.SetHSLColor(System.Windows.Media.Color.FromArgb(255, value.R, value.G, value.B))
End Set
End Property
Private m_dH As Double = 0
Private m_dS As Double = 0
Private m_dL As Double = 0.5
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New(Owner As Window, EtgColorPickerVM As EgtColorPickerVM)
MyBase.New(Owner)
InitializeComponent()
Me.DataContext = EtgColorPickerVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_EgtColorPickerVM = EtgColorPickerVM
End Sub
#End Region
#Region "EVENTS"
Private Sub CloseWindow(DialogResult As MessageBoxResult) Handles m_EgtColorPickerVM.m_CloseWindow
Me.DialogResult = DialogResult
Me.Close()
End Sub
Private Sub EgtColorPickerVM_SetLuminosityFill(color As Color) Handles m_EgtColorPickerVM.m_SetLuminosityFill
LightnessColor.Color = color
End Sub
Private Sub EgtColorPickerVM_SetLuminosityFills() Handles m_EgtColorPickerVM.m_UpdateCursorsPos
Dim dX As Double = m_EgtColorPickerVM.HSLColor.Hue / 360 * MyCanvas.ActualWidth
Dim dY As Double = (1 - m_EgtColorPickerVM.HSLColor.Saturation) * MyCanvas.ActualHeight
Dim dYL As Double = (1 - m_EgtColorPickerVM.HSLColor.Lightness) * MyCanvasL.ActualHeight
Canvas.SetLeft(Ellipse, dX - (Ellipse.Width / 2))
Canvas.SetTop(Ellipse, dY - (Ellipse.Height / 2))
Canvas.SetTop(Arrow, dYL)
Canvas.SetLeft(Arrow, MyCanvasL.ActualWidth)
End Sub
Private Sub EgtColorPickerV_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
EgtColorPickerVM_SetLuminosityFills()
End Sub
''' <summary>
''' Seleziona il colore all'interno del rettangolo nominato ColorRectangle attraverso un'ellisse
''' </summary>
Private Sub ColorRectangle_MouseDown(sender As Object, e As MouseButtonEventArgs)
Dim dX As Double = Mouse.GetPosition(MyCanvas).X
Dim dY As Double = Mouse.GetPosition(MyCanvas).Y
Dim sat As Double = dX / MyCanvas.ActualWidth * 360
Dim ton As Double = 1 - dY / MyCanvas.ActualHeight
m_EgtColorPickerVM.UpdateHue(Math.Round(sat, MidpointRounding.AwayFromZero))
m_EgtColorPickerVM.UpdateSaturation(Math.Round(ton, 2))
m_EgtColorPickerVM.UpdateLightness(0.5)
'Dim r, g, b As Integer
If dX > 0 AndAlso dX < MyCanvas.ActualWidth And dY > 0 AndAlso dY < MyCanvas.ActualHeight Then
Canvas.SetTop(Ellipse, dY - (Ellipse.Height / 2))
Canvas.SetLeft(Ellipse, dX - (Ellipse.Width / 2))
Canvas.SetTop(Arrow, MyCanvas.Height / 2)
Canvas.SetLeft(Arrow, MyCanvasL.ActualWidth)
End If
'HlsToRgb(sat, lum, 1 - ton, r, g, b)
'Dim colargb As System.Drawing.Color = ColorFromHSV(sat, ton, lum)
'Dim col As Color = Media.Color.FromRgb(colargb.R, colargb.G, colargb.B)
'Dim col As Color = Media.Color.FromRgb(r, g, b)
'm_EgtColorPickerVM.SetCurrColorFill(col)
End Sub
''' <summary>
''' Permette il movimento della freccia dall'alto verso il basso
''' </summary>
Private Sub Luminosity_MouseMove(sender As Object, e As Input.MouseEventArgs)
'Dim dX As Double = Mouse.GetPosition(MyCanvasL).X
'Dim dY As Double = Mouse.GetPosition(MyCanvasL).Y
'If dX > 0 AndAlso dX < MyCanvasL.ActualWidth And dY > 0 AndAlso dY < MyCanvasL.ActualHeight Then
' Arrow.Visibility = Visibility.Visible
' Canvas.SetTop(Arrow, dY)
' Canvas.SetLeft(Arrow, MyCanvasL.ActualWidth)
'Else
' Arrow.Visibility = Visibility.Collapsed
'End If
End Sub
''' <summary>
''' Modifica la luminosità del colore selezionato
''' </summary>
Private Sub Luminosity_MouseDown(sender As Object, e As MouseButtonEventArgs)
Arrow.Visibility = Visibility.Visible
Dim dYPos As Double = Mouse.GetPosition(MyCanvasL).Y
Canvas.SetTop(Arrow, dYPos)
Dim dX As Double = Canvas.GetLeft(Ellipse)
Dim dY As Double = Canvas.GetTop(Ellipse)
Dim dL As Double = Mouse.GetPosition(MyCanvasL).Y
Dim sat As Double = dX / MyCanvas.ActualWidth * 360
Dim ton As Double = dY / MyCanvas.ActualHeight
Dim lum As Double = dL / MyCanvasL.ActualHeight
m_EgtColorPickerVM.UpdateLightness(1 - Math.Round(lum, 2))
Dim r, g, b As Integer
HslToRgb(m_dH, m_dS, 1 - m_dL, r, g, b)
' HslToRgb(sat, 1 - ton, 1 - lum, r, g, b)
' HlsToRgb(sat, 1 - lum, 1 - ton, r, g, b)
'Dim col As Color = Media.Color.FromRgb(r, g, b)
'm_EgtColorPickerVM.SetCurrColorFill(col)
End Sub
#End Region
#Region "METHODS"
Private Shared Function HslToRgb(ByVal h As Double, ByVal s As Double, ByVal l As Double, ByRef r As Integer, ByRef g As Integer, ByRef b As Integer) As Color
Dim dConversionH As Double = Math.Round(h, MidpointRounding.AwayFromZero)
Dim dConversionS As Double = Math.Round(s, 2)
Dim dConversionL As Double = Math.Round(l, 2)
Dim C As Double = (1 - Math.Abs(2 * dConversionL - 1)) * dConversionS
Dim X = C * (1 - Math.Abs((dConversionH / 60) Mod 2 - 1))
Dim m = dConversionL - C / 2
Dim dRPrimo As Double
Dim dGPrimo As Double
Dim dBPrimo As Double
If dConversionH >= 0 Then
If dConversionH < 60 Then
dRPrimo = C
dGPrimo = X
dBPrimo = 0
ElseIf dConversionH < 120 Then
dRPrimo = X
dGPrimo = C
dBPrimo = 0
ElseIf dConversionH < 180 Then
dRPrimo = 0
dGPrimo = C
dBPrimo = X
ElseIf dConversionH < 240 Then
dRPrimo = 0
dGPrimo = X
dBPrimo = C
ElseIf dConversionH < 300 Then
dRPrimo = X
dGPrimo = 0
dBPrimo = C
ElseIf dConversionH < 360 Then
dRPrimo = C
dGPrimo = 0
dBPrimo = X
End If
End If
r = (dRPrimo + m) * 255
g = (dGPrimo + m) * 255
b = (dBPrimo + m) * 255
End Function
Friend Shared Function RgbToHsl(ByVal r As Integer, ByVal g As Integer, ByVal b As Integer, ByRef h As Double, ByRef s As Double, ByRef l As Double) As Color
Dim dRPrimo As Double = r / 255
Dim dGPrimo As Double = g / 255
Dim dBPrimo As Double = b / 255
Dim CMax As Double = Math.Max(Math.Max(dRPrimo, dGPrimo), dBPrimo)
Dim CMin As Double = Math.Min(Math.Min(dRPrimo, dGPrimo), dBPrimo)
Dim Delta As Double = CMax - CMin
If Delta = 0 Then
h = 0
ElseIf CMax = dRPrimo Then
h = 60 * (((dGPrimo - dBPrimo) / Delta) Mod 6)
ElseIf CMax = dGPrimo Then
h = 60 * (((dBPrimo - dRPrimo) / Delta) + 2)
ElseIf CMax = dBPrimo Then
h = 60 * (((dRPrimo - dRPrimo) / Delta) + 4)
End If
l = (CMax + CMin) / 2
If Delta = 0 Then
s = 0
Else
s = Delta / (1 - Math.Abs(2 * l - 1))
End If
End Function
'''' <summary>
'''' Converte il colore selezionato da HLS ( tonalità, luminosità, saturazione) in RGB
'''' </summary>
'''' <param name="h">Tonalità del colore selezionato espressa in double</param>
'''' <param name="l">Luminosità del colore selezionato espressa in double</param>
'''' <param name="s">Saturazione del colore selezionato espressa in double</param>
'''' <param name="r">Colore Rosso restituito dalla funzione espresso in intero</param>
'''' <param name="g">Colore Verde restituito dalla funzione espresso in intero</param>
'''' <param name="b">Colore Blu restituito dalla funzione espresso in intero</param>
'Private Shared Sub HlsToRgb(ByVal h As Double, ByVal l As Double, ByVal s As Double, <Out> ByRef r As Integer, <Out> ByRef g As Integer, <Out> ByRef b As Integer)
' Dim p2 As Double
' If l <= 0.5 Then
' p2 = l * (1 + s)
' Else
' p2 = l + s - l * s
' End If
' Dim p1 As Double = 2 * l - p2
' Dim double_r, double_g, double_b As Double
' If s = 0 Then
' double_r = l
' double_g = l
' double_b = l
' Else
' double_r = QqhToRgb(p1, p2, h + 120)
' double_g = QqhToRgb(p1, p2, h)
' double_b = QqhToRgb(p1, p2, h - 120)
' End If
' r = CInt((double_r * 255.0))
' g = CInt((double_g * 255.0))
' b = CInt((double_b * 255.0))
'End Sub
'Private Shared Function QqhToRgb(ByVal q1 As Double, ByVal q2 As Double, ByVal hue As Double) As Double
' If hue > 360 Then
' hue -= 360
' ElseIf hue < 0 Then
' hue += 360
' End If
' If hue < 60 Then Return q1 + (q2 - q1) * hue / 60
' If hue < 180 Then Return q2
' If hue < 240 Then Return q1 + (q2 - q1) * (240 - hue) / 60
' Return q1
'End Function
Public Shared Function ColorFromHSV(ByVal hue As Double, ByVal saturation As Double, ByVal value As Double) As System.Drawing.Color
Dim hi As Integer = Convert.ToInt32(Math.Floor(hue / 60)) Mod 6
Dim f As Double = hue / 60 - Math.Floor(hue / 60)
value *= 255
Dim v As Integer = Convert.ToInt32(value)
Dim p As Integer = Convert.ToInt32(value * (1 - saturation))
Dim q As Integer = Convert.ToInt32(value * (1 - f * saturation))
Dim t As Integer = Convert.ToInt32(value * (1 - (1 - f) * saturation))
If hi = 0 Then
Return System.Drawing.Color.FromArgb(255, v, t, p)
ElseIf hi = 1 Then
Return System.Drawing.Color.FromArgb(255, q, v, p)
ElseIf hi = 2 Then
Return System.Drawing.Color.FromArgb(255, p, v, t)
ElseIf hi = 3 Then
Return System.Drawing.Color.FromArgb(255, p, q, v)
ElseIf hi = 4 Then
Return System.Drawing.Color.FromArgb(255, t, p, v)
Else
Return System.Drawing.Color.FromArgb(255, v, p, q)
End If
End Function
''' <summary>
''' Apre una finestra EgtColorPicker
''' </summary>
''' <returns></returns>
Public Overloads Function ShowDialog() As DialogResult
MyBase.ShowDialog()
Return Me.DialogResult
End Function
#End Region
End Class
+873
View File
@@ -0,0 +1,873 @@
Imports System.Windows.Forms
Imports EgtUILib
Imports EgtWPFLib5
Public Class EgtColorPickerVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(bDialogResult As MessageBoxResult)
Friend Event m_SetLuminosityFill(color As Color)
Friend Event m_UpdateCursorsPos()
Private m_sTitle As String = ""
Public ReadOnly Property sTitle As String
Get
Return m_sTitle
End Get
End Property
Private m_BasicColors As New List(Of EgtColorPicker)
Public Property BasicColors As List(Of EgtColorPicker)
Get
Return m_BasicColors
End Get
Set(value As List(Of EgtColorPicker))
m_BasicColors = value
End Set
End Property
Private m_CustomColors As New List(Of EgtColorPicker)
Public Property CustomColors As List(Of EgtColorPicker)
Get
Return m_CustomColors
End Get
Set(value As List(Of EgtColorPicker))
m_CustomColors = value
End Set
End Property
Friend Sub SetCustomColors(value As Integer())
Dim coloraRGB As System.Drawing.Color
Dim colorRGB As Color
For i As Integer = 0 To value.Length - 1
coloraRGB = System.Drawing.Color.FromArgb(value(i).ToString)
colorRGB = Color.FromRgb(coloraRGB.R, coloraRGB.G, coloraRGB.B)
m_CustomColors.Insert(i, New EgtColorPicker(New SolidColorBrush(colorRGB)))
m_CustomColors.RemoveAt(m_CustomColors.Count - 1)
Next
m_CustomColors.Reverse()
SelCustomColor = m_CustomColors(0)
NotifyPropertyChanged(NameOf(SelCustomColor))
End Sub
Friend Function GetCustomColors() As Integer()
Dim arrayColor As Integer() = New Integer(m_CustomColors.Count - 1) {}
Dim coloraRGB As System.Drawing.Color
Dim colorCode As Integer
For i As Integer = 0 To m_CustomColors.Count - 1
Dim intValue As Integer = Integer.Parse(m_CustomColors(i).Fill.ToString().TrimStart("#FF"), System.Globalization.NumberStyles.HexNumber)
coloraRGB = System.Drawing.Color.FromArgb(intValue)
'colorCode = BitConverter.ToInt32(New Byte() {coloraRGB.R, coloraRGB.G, coloraRGB.B, &H0}, i)
colorCode = coloraRGB.ToArgb()
'arrayColor.Append(colorCode)
arrayColor(i) = colorCode
Next
Return arrayColor
End Function
Private m_HSLColor As New HSLColor
Public ReadOnly Property HSLColor As HSLColor
Get
Return m_HSLColor
End Get
End Property
Friend Sub SetHSLColor(value As Color)
Dim dHue, dSaturation, dLightness As Double
HSLColor.RgbToHsl(value, dHue, dSaturation, dLightness)
m_HSLColor.SetHue(dHue)
m_HSLColor.SetSaturation(dSaturation)
m_HSLColor.SetLightness(dLightness)
NotifyPropertyChanged(NameOf(CurrColor))
SetLightnessColor()
UpdateHue()
UpdateSaturation()
UpdateLightness()
NotifyPropertyChanged(NameOf(Red))
NotifyPropertyChanged(NameOf(Green))
NotifyPropertyChanged(NameOf(Blue))
NotifyPropertyChanged(NameOf(Hexadecimal))
RaiseEvent m_UpdateCursorsPos()
End Sub
Private m_CurrColor As Color
Public ReadOnly Property CurrColor As SolidColorBrush
Get
Return New SolidColorBrush(HSLColor.HslToRgb(m_HSLColor.Hue, m_HSLColor.Saturation, m_HSLColor.Lightness))
End Get
End Property
Private m_SelColor As EgtColorPicker
Public Property SelColor As EgtColorPicker
Get
Return m_SelColor
End Get
Set(value As EgtColorPicker)
m_SelColor = value
SetHSLColor(value.Fill.Color)
'm_Fill = m_Color.Fill
'm_CurrColor = m_Color.Fill.Color
'm_Luminosity_Fill = m_Color.Fill.Color
'm_Red = m_Color.Fill.Color.R.ToString
'm_Green = m_Color.Fill.Color.G.ToString
'm_Blue = m_Color.Fill.Color.B.ToString
'm_Hexadecimal = "#" + System.Drawing.Color.FromArgb(m_Red, m_Green, m_Blue).ToArgb().ToString("X6")
'NotifyPropertyChanged(NameOf(Hexadecimal))
'NotifyPropertyChanged(NameOf(Fill))
'NotifyPropertyChanged(NameOf(CurrColor))
'NotifyPropertyChanged(NameOf(Luminosity_Fill))
'NotifyPropertyChanged(NameOf(Red))
'NotifyPropertyChanged(NameOf(Green))
'NotifyPropertyChanged(NameOf(Blue))
'If Not IsNothing(m_CustomColor) Then
' m_CustomColor.SetFill(m_Color.Fill)
'End If
End Set
End Property
Private m_CustomColor As EgtColorPicker
Public Property SelCustomColor As EgtColorPicker
Get
Return m_CustomColor
End Get
Set(value As EgtColorPicker)
m_CustomColor = value
m_CurrColor = m_CustomColor.Fill.Color
m_Luminosity_Fill = m_CustomColor.Fill.Color
m_Red = m_CustomColor.Fill.Color.R.ToString
m_Green = m_CustomColor.Fill.Color.G.ToString
m_Blue = m_CustomColor.Fill.Color.B.ToString
m_Hexadecimal = "#" + System.Drawing.Color.FromArgb(m_Red, m_Green, m_Blue).ToArgb().ToString("X6")
NotifyPropertyChanged(NameOf(Hexadecimal))
NotifyPropertyChanged(NameOf(CurrColor))
NotifyPropertyChanged(NameOf(Luminosity_Fill))
NotifyPropertyChanged(NameOf(Red))
NotifyPropertyChanged(NameOf(Green))
NotifyPropertyChanged(NameOf(Blue))
UpdateHue()
UpdateSaturation()
UpdateLightness()
End Set
End Property
Private m_Fill As SolidColorBrush
Public ReadOnly Property Fill As SolidColorBrush
Get
Return m_Fill
End Get
End Property
Friend Sub SetCurrColorFill(value As Color)
m_CurrColor = value
SetRed(m_CurrColor.R)
SetGreen(m_CurrColor.G)
SetBlu(m_CurrColor.B)
SetHexadecimal(m_CurrColor.ToString)
NotifyPropertyChanged(NameOf(CurrColor))
NotifyPropertyChanged(NameOf(Luminosity_Fill))
UpdateHue()
UpdateSaturation()
UpdateLightness()
End Sub
Private m_Luminosity_Fill As Color
Public ReadOnly Property Luminosity_Fill As SolidColorBrush
Get
Return New SolidColorBrush(m_Luminosity_Fill)
End Get
End Property
Friend Sub SetLuminosityColorFill(value As Color)
m_CurrColor = value
SetRed(m_CurrColor.R)
SetGreen(m_CurrColor.G)
SetBlu(m_CurrColor.B)
SetHexadecimal(m_CurrColor.ToString)
NotifyPropertyChanged(NameOf(CurrColor))
RaiseEvent m_SetLuminosityFill(value)
UpdateHue()
UpdateSaturation()
UpdateLightness()
End Sub
Private m_Hexadecimal As String
Public Property Hexadecimal As String
Get
Dim RgbColor As Color = HSLColor.HslToRgb(m_HSLColor)
Return "#" & System.Drawing.Color.FromArgb(RgbColor.R, RgbColor.G, RgbColor.B).ToArgb().ToString("X6")
End Get
Set(value As String)
m_Hexadecimal = value
If m_Hexadecimal.Length >= 8 AndAlso m_Hexadecimal >= "#FF000000" And m_Hexadecimal <= "#FFFFFFFF" Then
Dim Color As Color = CType(ColorConverter.ConvertFromString(m_Hexadecimal), Color)
SetCurrColorFill(Color)
End If
NotifyPropertyChanged(NameOf(Fill))
NotifyPropertyChanged(NameOf(Hexadecimal))
End Set
End Property
Friend Sub SetHexadecimal(value As String)
m_Hexadecimal = value
NotifyPropertyChanged(NameOf(Hexadecimal))
End Sub
Private m_Red As Double
Public Property Red As String
Get
Dim RgbColor As Color = HSLColor.HslToRgb(m_HSLColor)
Return DoubleToString(RgbColor.R, 0)
End Get
Set(value As String)
If StringToDouble(value, m_Red) And (m_Red >= 0 AndAlso m_Red <= 255) Then
UpdateRed(m_Red)
'm_Red = value
m_Fill = New SolidColorBrush(Color.FromRgb(m_Red, m_Green, m_Blue))
SetCurrColorFill(m_Fill.Color)
NotifyPropertyChanged(NameOf(Fill))
NotifyPropertyChanged(NameOf(Red))
Else
NotifyPropertyChanged(NameOf(Red))
End If
End Set
End Property
Friend Sub SetRed(value As Double)
m_Red = value
NotifyPropertyChanged(NameOf(Red))
End Sub
Private m_Green As Double
Public Property Green As String
Get
Dim RgbColor As Color = HSLColor.HslToRgb(m_HSLColor)
Return DoubleToString(RgbColor.G, 0)
End Get
Set(value As String)
If StringToDouble(value, m_Green) And (m_Green >= 0 AndAlso m_Green <= 255) Then
UpdateGreen(value)
m_Green = value
m_Fill = New SolidColorBrush(Color.FromRgb(m_Red, m_Green, m_Blue))
SetCurrColorFill(m_Fill.Color)
NotifyPropertyChanged(NameOf(Fill))
Else
NotifyPropertyChanged(NameOf(Green))
End If
End Set
End Property
Friend Sub SetGreen(value As Double)
m_Green = value
NotifyPropertyChanged(NameOf(Green))
End Sub
Private m_Blue As Double
Public Property Blue As String
Get
Dim RgbColor As Color = HSLColor.HslToRgb(m_HSLColor)
Return DoubleToString(RgbColor.B, 0)
End Get
Set(value As String)
If StringToDouble(value, m_Blue) And (m_Blue >= 0 AndAlso m_Blue <= 255) Then
UpdateBlue(value)
m_Blue = value
m_Fill = New SolidColorBrush(Color.FromRgb(m_Red, m_Green, m_Blue))
SetCurrColorFill(m_Fill.Color)
NotifyPropertyChanged(NameOf(Fill))
Else
NotifyPropertyChanged(NameOf(Blue))
End If
End Set
End Property
Friend Sub SetBlu(value As Double)
m_Blue = value
NotifyPropertyChanged(NameOf(Blue))
End Sub
Private m_Hue As String
Public Property Hue As String
Get
Return m_Hue
End Get
Set(value As String)
Dim dHue As Double = 0
If StringToDouble(value, dHue) AndAlso dHue >= 0 AndAlso dHue < 360 Then
UpdateHue(dHue)
m_Hue = If(value.Last() = "."c, value, DoubleToString(m_HSLColor.Hue, 2))
RaiseEvent m_UpdateCursorsPos()
Else
NotifyPropertyChanged(NameOf(Hue))
End If
End Set
End Property
Friend Sub UpdateHue()
m_Hue = DoubleToString(m_HSLColor.Hue, 0)
NotifyPropertyChanged(NameOf(Hue))
End Sub
Private m_Saturation As String
Public Property Saturation As String
Get
Return m_Saturation
End Get
Set(value As String)
Dim dSaturation As Double = 0
If StringToDouble(value, dSaturation) AndAlso dSaturation >= 0 AndAlso dSaturation <= 100 Then
UpdateSaturation(dSaturation / 100)
m_Saturation = If(value.Last() = "."c, value, DoubleToString(m_HSLColor.Saturation * 100, 2))
RaiseEvent m_UpdateCursorsPos()
Else
NotifyPropertyChanged(NameOf(Saturation))
End If
End Set
End Property
Friend Sub UpdateSaturation()
m_Saturation = DoubleToString(m_HSLColor.Saturation * 100, 2)
NotifyPropertyChanged(NameOf(Saturation))
End Sub
Private m_Lightness As String
Public Property Lightness As String
Get
Return m_Lightness
End Get
Set(value As String)
Dim dLightness As Double = 0
If StringToDouble(value, dLightness) AndAlso dLightness >= 0 AndAlso dLightness <= 100 Then
UpdateLightness(dLightness / 100)
m_Lightness = If(value.Last() = "."c, value, DoubleToString(m_HSLColor.Lightness * 100, 2))
RaiseEvent m_UpdateCursorsPos()
Else
NotifyPropertyChanged(NameOf(Lightness))
End If
End Set
End Property
Friend Sub UpdateLightness()
m_Lightness = DoubleToString(m_HSLColor.Lightness * 100, 2)
NotifyPropertyChanged(NameOf(Lightness))
End Sub
' Definizione comandi
Private m_cmdCancel As ICommand
Private m_cmdOk As ICommand
Private m_cmdSaveColor As ICommand
#Region "Messages"
Public ReadOnly Property Red_Msg As String
Get
Return EgtMsg(15050)
End Get
End Property
Public ReadOnly Property Green_Msg As String
Get
Return EgtMsg(15051)
End Get
End Property
Public ReadOnly Property Blu_Msg As String
Get
Return EgtMsg(15052)
End Get
End Property
Public ReadOnly Property Hexadecimal_Msg As String
Get
Return EgtMsg(15053)
End Get
End Property
Public ReadOnly Property AddCColor_Msg As String
Get
Return EgtMsg(15054)
End Get
End Property
Public ReadOnly Property BasicColor_Msg As String
Get
Return EgtMsg(15055)
End Get
End Property
Public ReadOnly Property CustomColor_Msg As String
Get
Return EgtMsg(15056)
End Get
End Property
#End Region
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New()
EgtColorPicker.SetOwner(Me)
'Colori di Base
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.LightCoral)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Khaki)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.LightGreen)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.PaleGreen)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Aqua)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.SteelBlue)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Pink)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.HotPink)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Red)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Yellow)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Lime)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.LimeGreen)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Cyan)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.CornflowerBlue)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.MediumPurple)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Magenta)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Brown)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Orange)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Green)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.MediumSeaGreen)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.MediumBlue)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.MediumSlateBlue)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.MediumVioletRed)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.DeepPink)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.DarkRed)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.DarkOrange)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.OliveDrab)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.DarkOliveGreen)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Blue)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Navy)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.DarkMagenta)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.BlueViolet)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Maroon)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Firebrick)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.ForestGreen)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.DarkGreen)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.DarkBlue)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.MidnightBlue)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.DarkSlateBlue)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Indigo)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Black)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.DarkKhaki)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Olive)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.DarkGray)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.MediumAquamarine)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.Gray)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.DarkViolet)))
m_BasicColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
'Colori Personalizzati
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
m_CustomColors.Add(New EgtColorPicker(New SolidColorBrush(Colors.White)))
NotifyPropertyChanged(NameOf(BasicColors))
NotifyPropertyChanged(NameOf(CustomColors))
SelCustomColor = m_CustomColors(0)
NotifyPropertyChanged(NameOf(SelCustomColor))
End Sub
#End Region 'CONTRUCTORS"
Friend Sub UpdateHue(value As Double)
m_HSLColor.SetHue(value)
NotifyPropertyChanged(NameOf(CurrColor))
SetLightnessColor()
UpdateSaturation()
UpdateLightness()
NotifyPropertyChanged(NameOf(Red))
NotifyPropertyChanged(NameOf(Green))
NotifyPropertyChanged(NameOf(Blue))
NotifyPropertyChanged(NameOf(Hexadecimal))
End Sub
Friend Sub UpdateSaturation(value As Double)
m_HSLColor.SetSaturation(value)
NotifyPropertyChanged(NameOf(CurrColor))
SetLightnessColor()
UpdateHue()
UpdateLightness()
NotifyPropertyChanged(NameOf(Red))
NotifyPropertyChanged(NameOf(Green))
NotifyPropertyChanged(NameOf(Blue))
NotifyPropertyChanged(NameOf(Hexadecimal))
End Sub
Friend Sub UpdateLightness(value As Double)
m_HSLColor.SetLightness(value)
NotifyPropertyChanged(NameOf(CurrColor))
SetLightnessColor()
UpdateHue()
UpdateSaturation()
NotifyPropertyChanged(NameOf(Red))
NotifyPropertyChanged(NameOf(Green))
NotifyPropertyChanged(NameOf(Blue))
NotifyPropertyChanged(NameOf(Hexadecimal))
End Sub
Friend Sub UpdateRed(value As Double)
Dim RGBColor As Color = HSLColor.HslToRgb(m_HSLColor)
Dim h, s, l As Double
HSLColor.RgbToHsl(Color.FromRgb(value, RGBColor.G, RGBColor.B), h, s, l)
SetRed(value)
m_HSLColor.SetHue(h)
m_HSLColor.SetSaturation(s)
m_HSLColor.SetLightness(l)
NotifyPropertyChanged(NameOf(CurrColor))
SetLightnessColor()
UpdateHue()
UpdateSaturation()
UpdateLightness()
NotifyPropertyChanged(NameOf(Red))
NotifyPropertyChanged(NameOf(Green))
NotifyPropertyChanged(NameOf(Blue))
NotifyPropertyChanged(NameOf(Hexadecimal))
End Sub
Friend Sub UpdateGreen(value As Double)
Dim RGBColor As Color = HSLColor.HslToRgb(m_HSLColor)
Dim h, s, l As Double
HSLColor.RgbToHsl(Color.FromRgb(RGBColor.R, value, RGBColor.B), h, s, l)
m_HSLColor.SetHue(h)
m_HSLColor.SetSaturation(s)
m_HSLColor.SetLightness(l)
NotifyPropertyChanged(NameOf(CurrColor))
SetLightnessColor()
UpdateHue()
UpdateSaturation()
UpdateLightness()
NotifyPropertyChanged(NameOf(Red))
NotifyPropertyChanged(NameOf(Green))
NotifyPropertyChanged(NameOf(Blue))
NotifyPropertyChanged(NameOf(Hexadecimal))
End Sub
Friend Sub UpdateBlue(value As Double)
Dim RGBColor As Color = HSLColor.HslToRgb(m_HSLColor)
Dim h, s, l As Double
HSLColor.RgbToHsl(Color.FromRgb(RGBColor.R, RGBColor.G, value), h, s, l)
m_HSLColor.SetHue(h)
m_HSLColor.SetSaturation(s)
m_HSLColor.SetLightness(l)
NotifyPropertyChanged(NameOf(CurrColor))
SetLightnessColor()
UpdateHue()
UpdateSaturation()
UpdateLightness()
NotifyPropertyChanged(NameOf(Red))
NotifyPropertyChanged(NameOf(Green))
NotifyPropertyChanged(NameOf(Blue))
NotifyPropertyChanged(NameOf(Hexadecimal))
End Sub
Friend Sub SetLightnessColor()
RaiseEvent m_SetLuminosityFill(HSLColor.HslToRgb(m_HSLColor.Hue, m_HSLColor.Saturation, 0.5))
End Sub
#Region "COMMANDS"
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()
RaiseEvent m_CloseWindow(DialogResult.OK)
End Sub
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()
RaiseEvent m_CloseWindow(DialogResult.Cancel)
End Sub
Public ReadOnly Property SaveColor_Command As ICommand
Get
If m_cmdSaveColor Is Nothing Then
m_cmdSaveColor = New Command(AddressOf SaveColor)
End If
Return m_cmdSaveColor
End Get
End Property
Public Sub SaveColor()
If Not IsNothing(m_CustomColor) Then
m_CustomColor.SetFill(CurrColor)
Dim nIndex As Integer = m_CustomColors.IndexOf(SelCustomColor)
m_CustomColor = If(nIndex >= 0 AndAlso nIndex < m_CustomColors.Count - 1, m_CustomColors(nIndex + 1), m_CustomColors(0))
NotifyPropertyChanged(NameOf(SelCustomColor))
End If
End Sub
#End Region 'COMMANDS
End Class
Public Class EgtColorPicker
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private Shared Owner As EgtColorPickerVM
Private m_Fill As SolidColorBrush
Public ReadOnly Property Fill As SolidColorBrush
Get
Return m_Fill
End Get
End Property
Friend Sub SetFill(value As SolidColorBrush)
m_Fill = value
NotifyPropertyChanged(NameOf(Fill))
End Sub
Private m_Luminosity_Fill As SolidColorBrush
Public ReadOnly Property Luminosity_Fill As SolidColorBrush
Get
Return m_Luminosity_Fill
End Get
End Property
Friend Sub SetLumFill(value As SolidColorBrush)
m_Luminosity_Fill = value
NotifyPropertyChanged(NameOf(Luminosity_Fill))
End Sub
Private m_CurrColorFill As SolidColorBrush
Public ReadOnly Property CurrColor_Fill As SolidColorBrush
Get
Return m_CurrColorFill
End Get
End Property
Friend Sub SetCurrFill(value As SolidColorBrush)
m_CurrColorFill = value
NotifyPropertyChanged(NameOf(CurrColor_Fill))
End Sub
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New(Fill As SolidColorBrush)
m_Fill = Fill
End Sub
#End Region 'CONTRUCTORS"
#Region "METHODS"
Friend Shared Sub SetOwner(value As EgtColorPickerVM)
Owner = value
End Sub
#End Region ' METHODS
End Class
Public Class HSLColor
Private m_Hue As Double
Public ReadOnly Property Hue As Double
Get
Return m_Hue
End Get
End Property
Friend Sub SetHue(value As Double)
m_Hue = value
End Sub
Private m_Saturation As Double
Public ReadOnly Property Saturation As Double
Get
Return m_Saturation
End Get
End Property
Friend Sub SetSaturation(value As Double)
m_Saturation = value
End Sub
Private m_Lightness As Double
Public ReadOnly Property Lightness As Double
Get
Return m_Lightness
End Get
End Property
Friend Sub SetLightness(value As Double)
m_Lightness = value
End Sub
Sub New()
End Sub
Sub New(Hue As Double, Saturation As Double, Lightness As Double)
m_Hue = Hue
m_Saturation = Saturation
m_Lightness = Lightness
End Sub
'Private Shared Function HslToRgb(ByVal h As Double, ByVal s As Double, ByVal l As Double, ByRef r As Integer, ByRef g As Integer, ByRef b As Integer) As Boolean
' Dim dConversionH As Double = Math.Round(h, MidpointRounding.AwayFromZero)
' Dim dConversionS As Double = Math.Round(s, 2)
' Dim dConversionL As Double = Math.Round(l, 2)
' Dim C As Double = (1 - Math.Abs(2 * dConversionL - 1)) * dConversionS
' Dim X = C * (1 - Math.Abs((dConversionH / 60) Mod 2 - 1))
' Dim m = dConversionL - C / 2
' Dim dRPrimo As Double
' Dim dGPrimo As Double
' Dim dBPrimo As Double
' If dConversionH >= 0 Then
' If dConversionH < 60 Then
' dRPrimo = C
' dGPrimo = X
' dBPrimo = 0
' ElseIf dConversionH < 120 Then
' dRPrimo = X
' dGPrimo = C
' dBPrimo = 0
' ElseIf dConversionH < 180 Then
' dRPrimo = 0
' dGPrimo = C
' dBPrimo = X
' ElseIf dConversionH < 240 Then
' dRPrimo = 0
' dGPrimo = X
' dBPrimo = C
' ElseIf dConversionH < 300 Then
' dRPrimo = X
' dGPrimo = 0
' dBPrimo = C
' ElseIf dConversionH < 360 Then
' dRPrimo = C
' dGPrimo = 0
' dBPrimo = X
' End If
' End If
' r = (dRPrimo + m) * 255
' g = (dGPrimo + m) * 255
' b = (dBPrimo + m) * 255
'End Function
Friend Shared Function HslToRgb(ByVal h As Double, ByVal s As Double, ByVal l As Double) As Color
Dim dConversionH As Double = Math.Round(h, MidpointRounding.AwayFromZero)
Dim dConversionS As Double = Math.Round(s, 2)
Dim dConversionL As Double = Math.Round(l, 2)
Dim C As Double = (1 - Math.Abs(2 * dConversionL - 1)) * dConversionS
Dim X = C * (1 - Math.Abs((dConversionH / 60) Mod 2 - 1))
Dim m = dConversionL - C / 2
Dim dRPrimo As Double
Dim dGPrimo As Double
Dim dBPrimo As Double
If dConversionH >= 0 Then
If dConversionH < 60 Then
dRPrimo = C
dGPrimo = X
dBPrimo = 0
ElseIf dConversionH < 120 Then
dRPrimo = X
dGPrimo = C
dBPrimo = 0
ElseIf dConversionH < 180 Then
dRPrimo = 0
dGPrimo = C
dBPrimo = X
ElseIf dConversionH < 240 Then
dRPrimo = 0
dGPrimo = X
dBPrimo = C
ElseIf dConversionH < 300 Then
dRPrimo = X
dGPrimo = 0
dBPrimo = C
ElseIf dConversionH < 360 Then
dRPrimo = C
dGPrimo = 0
dBPrimo = X
End If
End If
Dim r As Double = Math.Floor((dRPrimo + m) * 255)
Dim g As Double = Math.Floor((dGPrimo + m) * 255)
Dim b As Double = Math.Floor((dBPrimo + m) * 255)
Return Color.FromArgb(255, r, g, b)
End Function
Friend Shared Function HslToRgb(HSLColor As HSLColor) As Color
Return HslToRgb(HSLColor.Hue, HSLColor.Saturation, HSLColor.Lightness)
End Function
Friend Shared Function RgbToHsl(ByVal r As Integer, ByVal g As Integer, ByVal b As Integer, ByRef h As Double, ByRef s As Double, ByRef l As Double) As Boolean
Dim dRPrimo As Double = r / 255
Dim dGPrimo As Double = g / 255
Dim dBPrimo As Double = b / 255
Dim CMax As Double = Math.Max(dRPrimo, Math.Max(dGPrimo, dBPrimo))
Dim CMin As Double = Math.Min(dRPrimo, Math.Min(dGPrimo, dBPrimo))
Dim Delta As Double = CMax - CMin
If Delta = 0 Then
h = 0
ElseIf CMax = dRPrimo Then
Dim hMod = (((dGPrimo - dBPrimo) / Delta) Mod 6)
If hMod < 0 Then
h = 60 * (hMod + 6)
Else
h = 60 * hMod
End If
ElseIf CMax = dGPrimo Then
h = 60 * ((dBPrimo - dRPrimo) / Delta + 2)
ElseIf CMax = dBPrimo Then
h = 60 * ((dRPrimo - dGPrimo) / Delta + 4)
End If
l = (CMax + CMin) / 2
If Delta = 0 Then
s = 0
Else
s = Delta / (1 - Math.Abs(2 * l - 1))
End If
h = Math.Round(h, 1)
s = Math.Round(s, 1)
l = Math.Round(l, 1)
Return True
End Function
Friend Shared Function RgbToHsl(RgbColor As Color, ByRef h As Double, ByRef s As Double, ByRef l As Double) As Boolean
Return RgbToHsl(RgbColor.R, RgbColor.G, RgbColor.B, h, s, l)
End Function
Friend Shared Function RgbToHsl(RgbColor As System.Drawing.Color, ByRef h As Double, ByRef s As Double, ByRef l As Double) As Boolean
Return RgbToHsl(RgbColor.R, RgbColor.G, RgbColor.B, h, s, l)
End Function
Friend Shared Function RgbToHsl(RgbColor As System.Drawing.Color) As HSLColor
Dim h, s, l As Double
RgbToHsl(RgbColor.R, RgbColor.G, RgbColor.B, h, s, l)
Dim NewHSLColor As New HSLColor(h, s, l)
Return NewHSLColor
End Function
End Class
@@ -0,0 +1,407 @@
<EgtWPFLib5:EgtMainWindow x:Class="EgtManageFileDialogV"
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:Icarus"
Title="{Binding sTitle}"
Height="500"
Width="800"
WindowStartupLocation="CenterOwner"
Style="{StaticResource Dialog_Window}">
<Grid Margin="5,5,5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Margin="5,5,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Command="{Binding GoBack_Command}"
HorizontalAlignment="Right"
Margin="2.5,0,5,0"
BorderBrush="Transparent"
Style="{StaticResource RightPanel_Button}">
<Image Source="\Resources\EgtDialog\Restore.png"
Style="{StaticResource Button_Image}"/>
</Button>
<TextBlock Grid.Column="1"
Margin="5"
Text="{Binding sSelPath}"
HorizontalAlignment="Left"
Style="{StaticResource DialogWindow_TextBlock}"/>
<ComboBox Grid.Column="2"
HorizontalAlignment="Right"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding ViewModeList}"
SelectedItem="{Binding SelViewMode}"
Width="200"
Height="30"
Margin="2.5,5,2.5,5"
Style="{StaticResource RightPanel_ComboBox}"/>
</Grid>
<Grid Grid.Row="1"
Margin="5,5,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<TreeView x:Name="FileTree"
ItemsSource="{Binding RootList}"
Margin="10"
FontSize="15"
BorderBrush="White"
Foreground="{StaticResource Icarus_Gray}">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type local:EgtFolder}"
ItemsSource="{Binding TreeItemList_View}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding sIconSource}"
Height="15"
Style="{StaticResource Button_Image}"/>
<TextBlock Text="{Binding sName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type local:EgtItem}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding sIconSource}"
Height="15"
Style="{StaticResource Button_Image}"/>
<TextBlock Text="{Binding sName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</StackPanel>
</DataTemplate>
</TreeView.Resources>
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
</Style>
</TreeView.ItemContainerStyle>
</TreeView>
<TabControl Grid.Column="1"
Background="Transparent"
BorderBrush="White"
BorderThickness="0"
SelectedIndex="{Binding nSelTab}">
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</TabControl.ItemContainerStyle>
<TabItem Header="LISTBOX">
<ListBox x:Name="FileList"
Grid.Row="1"
Margin="5,5,5,5"
BorderBrush="White"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding SelTreeItem.FolderList, Mode=TwoWay}"
SelectedItem="{Binding ItemSelected, Mode=TwoWay}">
<ListBox.Resources>
<DataTemplate x:Key="ListTemplateView"
DataType="{x:Type local:EgtDirectory}">
<Grid Margin="5,5,5,0"
Height="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding sIconSource}"
Height="15"
Style="{StaticResource Button_Image}"/>
<TextBlock Grid.Column="1"
Text="{Binding sName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</Grid>
</DataTemplate>
<DataTemplate x:Key="TilesTemplateView"
DataType="{x:Type local:EgtDirectory}">
<Grid Margin="5,5,5,0"
Height="50"
Width="250">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding sIconSource}"
Style="{StaticResource Button_Image}"/>
<UniformGrid Grid.Column="1"
Rows="3"
Margin="2.5,0,2.5,5">
<TextBlock TextAlignment="Left"
Text="{Binding sName}"
HorizontalAlignment="Left"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock TextAlignment="Left"
Text="{Binding ghTypeItem}"
HorizontalAlignment="Left"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock TextAlignment="Left"
Text="{Binding sDimension}"
HorizontalAlignment="Left"
Style="{StaticResource DialogWindow_TextBlock}"/>
</UniformGrid>
</Grid>
</DataTemplate>
<DataTemplate x:Key="ContentTemplateView"
DataType="{x:Type local:EgtDirectory}">
<Grid Margin="5,5,5,0"
Height="50">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding sIconSource}"
Style="{StaticResource Button_Image}"/>
<UniformGrid Grid.Column="1"
Rows="2"
Margin="2.5,0,2.5,5">
<TextBlock TextAlignment="Left"
HorizontalAlignment="Left"
Text="{Binding sName}"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock TextAlignment="Left"
HorizontalAlignment="Left"
Text="{Binding ghTypeItem}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</UniformGrid>
<UniformGrid Grid.Column="2"
Rows="2"
Margin="2.5,0,2.5,5">
<TextBlock TextAlignment="Left"
HorizontalAlignment="Left"
Text="{Binding sLastModifyDate}"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBlock TextAlignment="Left"
HorizontalAlignment="Left"
Text="{Binding sDimension}"
Style="{StaticResource DialogWindow_TextBlock}"/>
</UniformGrid>
</Grid>
<Border Grid.Row="1"
BorderThickness="1"
BorderBrush="LightGray"/>
</Grid>
</DataTemplate>
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type local:EgtDirectory}">
<ContentControl Content="{Binding}">
<ContentControl.Style>
<Style TargetType="{x:Type ContentControl}">
<Style.Triggers>
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="0">
<Setter Property="ContentTemplate" Value="{StaticResource ListTemplateView}" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="1">
<Setter Property="ContentTemplate" Value="{StaticResource TilesTemplateView}" />
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}" Value="2">
<Setter Property="ContentTemplate" Value="{StaticResource ContentTemplateView}" />
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<EventSetter Event="MouseDoubleClick" Handler="ListBoxItem_MouseDoubleClick"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.Style>
<Style TargetType="{x:Type ListBox}">
<Style.Triggers>
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}"
Value="0">
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}"
Value="1">
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding DataContext.nSelTempleteListView, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}"
Value="2">
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"
HorizontalAlignment="Stretch"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ListBox.Style>
</ListBox>
</TabItem>
<TabItem Header="DATAGRID">
<DataGrid AutoGenerateColumns="False"
IsReadOnly="True"
HeadersVisibility="Column"
ItemsSource="{Binding SelTreeItem.FolderList, Mode=TwoWay}"
SelectedItem="{Binding ItemSelected}"
ColumnHeaderStyle="{StaticResource DataGridColumnHeader}"
RowStyle="{StaticResource RowDataGrid_CustomHighLight}">
<DataGrid.Columns>
<DataGridTemplateColumn Width="5*">
<DataGridTemplateColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Name_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"
HorizontalAlignment="Left"/>
</DataTemplate>
</DataGridTemplateColumn.HeaderTemplate>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding sIconSource}"
Margin="2.5,0,2.5,0"
Style="{StaticResource Button_Image}"/>
<TextBlock Grid.Column="1"
Text="{Binding sName}"
VerticalAlignment="Center"
Margin="2.5,0,0,0"/>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Binding="{Binding sLastModifyDate}"
Width="2*">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.LastModify_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"
HorizontalAlignment="Left"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="TextAlignment" Value="Left"/>
<Setter Property="Padding" Value="12,6,12,6"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding ghTypeItem}"
Width="1*">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Type_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"
HorizontalAlignment="Left"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="TextAlignment" Value="Left"/>
<Setter Property="Padding" Value="12,6,12,6"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding sDimension}"
Width="1*">
<DataGridTextColumn.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding DataContext.Dimension_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"
HorizontalAlignment="Left"/>
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="TextAlignment" Value="Right"/>
<Setter Property="Padding" Value="12,6,12,6"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns>
<DataGrid.InputBindings>
<MouseBinding MouseAction="LeftDoubleClick" Command="{Binding DataContext.DoubleClick_Command, RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}"/>
</DataGrid.InputBindings>
</DataGrid>
</TabItem>
</TabControl>
</Grid>
<Grid Grid.Row="2"
Margin="5,5,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Margin="5,5,5,5"
Text="{Binding FileName_Msg}"
HorizontalAlignment="Right"
Style="{StaticResource DialogWindow_TextBlock}"/>
<TextBox Grid.Column="1"
Margin="2.5,2.5,2.5,5"
TextAlignment="Left"
HorizontalAlignment="Stretch"
Text="{Binding sSaveFileName, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
Style="{StaticResource ParameterList_TextBox}"/>
<ComboBox Grid.Column="2"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding FilterList}"
SelectedItem="{Binding SelFilter, Mode=OneWayToSource}"
DisplayMemberPath="sNameExstension"
HorizontalAlignment="Right"
Width="200"
Height="30"
Margin="10,2.5,2.5,5"
Style="{StaticResource RightPanel_ComboBox}"/>
</Grid>
<UniformGrid Grid.Row="3"
Rows="1"
Margin="2.5,0,2.5,0">
<Button IsDefault="True"
Content="OK"
Command="{Binding Ok_Command}"
HorizontalAlignment="Right"
Margin="15,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
<Button Content="Cancel"
Command="{Binding Cancel_Command}"
HorizontalAlignment="Left"
Margin="2.5,0,0,0"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtMainWindow>
@@ -0,0 +1,141 @@
Imports System.Windows.Forms
Imports EgtWPFLib5
Public Class EgtManageFileDialogV
#Region "FIELDS & PROPERTIES"
Private WithEvents m_EgtManageFileDialogVM As EgtManageFileDialogVM
Private Shadows DialogResult As DialogResult
''' <summary>
''' Stringa che specifica il titolo da mostrare
''' </summary>
Public Overloads Property Title As String
Get
Return m_EgtManageFileDialogVM.sTitle
End Get
Set(value As String)
m_EgtManageFileDialogVM.sTitle = value
End Set
End Property
Public Property Filter As String
Get
Return m_EgtManageFileDialogVM.sFilter
End Get
Set(value As String)
m_EgtManageFileDialogVM.sFilter = value
End Set
End Property
Public Property InitialDirectory As String
Get
Return m_EgtManageFileDialogVM.sInitialDirectory
End Get
Set(value As String)
m_EgtManageFileDialogVM.sInitialDirectory = value
End Set
End Property
Public Property SafeFileName As String
Get
Return m_EgtManageFileDialogVM.sSaveFileName
End Get
Set(value As String)
m_EgtManageFileDialogVM.sSaveFileName = value
End Set
End Property
Public Property FileName As String
Get
Return m_EgtManageFileDialogVM.sFileName
End Get
Set(value As String)
m_EgtManageFileDialogVM.sFileName = value
End Set
End Property
Public Property FilterIndex As Integer
Get
Return m_EgtManageFileDialogVM.nFilterIndex
End Get
Set(value As Integer)
m_EgtManageFileDialogVM.nFilterIndex = value
End Set
End Property
Public Property Mode As Integer
Get
Return m_EgtManageFileDialogVM.nMode
End Get
Set(value As Integer)
m_EgtManageFileDialogVM.nMode = value
End Set
End Property
Public Property CheckFileExists As Boolean
Get
Return m_EgtManageFileDialogVM.bCheckFileExists
End Get
Set(value As Boolean)
m_EgtManageFileDialogVM.bCheckFileExists = value
End Set
End Property
Public Property ValidateNames As Boolean
Get
Return m_EgtManageFileDialogVM.bValidateNames
End Get
Set(value As Boolean)
m_EgtManageFileDialogVM.bValidateNames = value
End Set
End Property
Public Property OverwritePrompt As Boolean
Get
Return m_EgtManageFileDialogVM.bOverwritePrompt
End Get
Set(value As Boolean)
m_EgtManageFileDialogVM.bOverwritePrompt = value
End Set
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New(Owner As Window, EgtManageFileDialogVM As EgtManageFileDialogVM)
MyBase.New(Owner)
InitializeComponent()
Me.DataContext = EgtManageFileDialogVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_EgtManageFileDialogVM = EgtManageFileDialogVM
End Sub
#End Region
#Region "EVENTS"
Private Sub CloseWindow(DialogResult As DialogResult) Handles m_EgtManageFileDialogVM.m_CloseWindow
Me.DialogResult = DialogResult
Me.Close()
End Sub
#End Region
#Region "METHODS"
Public Overloads Function ShowDialog() As DialogResult
MyBase.ShowDialog()
Return Me.DialogResult
End Function
Private Sub ListBoxItem_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs)
m_EgtManageFileDialogVM.MouseDoubleClick()
End Sub
#End Region ' METHODS
End Class
@@ -0,0 +1,965 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows.Forms
Imports EgtWPFLib5
Imports EgtUILib
Imports System.Data
Public Class EgtManageFileDialogVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Public Enum VisualizationContainerType As Integer
LISTBOX = 0
DATAGRID = 1
End Enum
Public Enum VisualizationType As Integer
LISTTEMPLATE = 0
TILESTEMPLATE = 1
CONTENTTEMPLATE = 2
DETAILSTEMPLATE = 3
End Enum
Public Enum ModeTypes As Integer
FILE = 1
FOLDER = 2
End Enum
Private m_sTitle As String
Public Property sTitle As String
Get
Return m_sTitle
End Get
Set(value As String)
m_sTitle = value
End Set
End Property
'Scelta della modalità di salvataggio 1 = file 2 = folder
Private m_nMode As Integer
Public Property nMode As Integer
Get
Return m_nMode
End Get
Set(value As Integer)
m_nMode = value
End Set
End Property
Private m_bCheckFileExists As Boolean
Public Property bCheckFileExists As Boolean
Get
Return m_bCheckFileExists
End Get
Set(value As Boolean)
m_bCheckFileExists = value
End Set
End Property
Private m_bValidateNames As Boolean
Public Property bValidateNames As Boolean
Get
Return m_bValidateNames
End Get
Set(value As Boolean)
m_bValidateNames = value
End Set
End Property
Private m_bOverwritePrompt As Boolean
Public Property bOverwritePrompt As Boolean
Get
Return m_bOverwritePrompt
End Get
Set(value As Boolean)
m_bOverwritePrompt = value
End Set
End Property
Private m_RootList As New ObservableCollection(Of EgtDirectory)
Public Property RootList As ObservableCollection(Of EgtDirectory)
Get
Return m_RootList
End Get
Set(value As ObservableCollection(Of EgtDirectory))
m_RootList = value
End Set
End Property
Public m_SelTreeItem As EgtDirectory
Public Property SelTreeItem As EgtDirectory
Get
Return m_SelTreeItem
End Get
Set(value As EgtDirectory)
m_SelTreeItem = value
NotifyPropertyChanged(NameOf(SelTreeItem))
End Set
End Property
Friend Sub UpdateSelTreeItem(Item As EgtDirectory)
m_SelTreeItem = Item
NotifyPropertyChanged(NameOf(SelTreeItem))
End Sub
Public m_ItemSelected As EgtDirectory
Public Property ItemSelected As EgtDirectory
Get
Return m_ItemSelected
End Get
Set(value As EgtDirectory)
m_ItemSelected = value
Dim Item As EgtItem = TryCast(m_ItemSelected, EgtItem)
If Not IsNothing(Item) Then
sSaveFileName = Item.sName
Else
Dim Folder As EgtFolder = TryCast(m_ItemSelected, EgtFolder)
If Not IsNothing(Folder) Then
sSaveFileName = Folder.sName
End If
End If
End Set
End Property
Friend Sub SetItemSelected(value As EgtDirectory)
m_ItemSelected = value
NotifyPropertyChanged(NameOf(ItemSelected))
End Sub
'Percorso del file o della cartella
Private m_sSelPath As String
Public Overloads Property sSelPath As String
Get
Return m_sSelPath
End Get
Set(value As String)
m_sSelPath = value
NotifyPropertyChanged(NameOf(sSelPath))
End Set
End Property
'Textbox per visualizzare il file o la folder selezionata
Private m_sSaveFileName As String
Public Property sSaveFileName As String
Get
Return m_sSaveFileName
End Get
Set(value As String)
m_sSaveFileName = value
NotifyPropertyChanged(NameOf(sSaveFileName))
End Set
End Property
'Lista filtri estensione
Private m_FilterList As ObservableCollection(Of EgtExstension)
Public Property FilterList As ObservableCollection(Of EgtExstension)
Get
Return m_FilterList
End Get
Set(value As ObservableCollection(Of EgtExstension))
m_FilterList = value
End Set
End Property
'Scelta filtro estensione per visualizzazione
Public m_SelFilter As EgtExstension
Public Property SelFilter As EgtExstension
Get
Return m_SelFilter
End Get
Set(value As EgtExstension)
m_SelFilter = value
Dim CurrItem As EgtFolder = TryCast(m_SelTreeItem, EgtFolder)
If Not IsNothing(CurrItem) Then
CollectionViewSource.GetDefaultView(CurrItem.FolderList).Refresh()
End If
End Set
End Property
' Lista modalita' di visualizzazione
Private m_ViewModeList As ObservableCollection(Of IdNameStruct)
Public Property ViewModeList As ObservableCollection(Of IdNameStruct)
Get
Return m_ViewModeList
End Get
Set(value As ObservableCollection(Of IdNameStruct))
m_ViewModeList = value
End Set
End Property
'Scelta modalita' di visualizzazione
Private m_SelViewMode As IdNameStruct
Public Property SelViewMode As IdNameStruct
Get
Return m_SelViewMode
End Get
Set(value As IdNameStruct)
m_SelViewMode = value
Select Case m_SelViewMode.Id
Case VisualizationType.LISTTEMPLATE
m_nSelTab = VisualizationContainerType.LISTBOX
nSelTempleteListView = 0
WriteMainPrivateProfileString(S_TEMPLETESEL, K_CURRTEMPLETESEL, VisualizationType.LISTTEMPLATE)
Case VisualizationType.TILESTEMPLATE
m_nSelTab = VisualizationContainerType.LISTBOX
nSelTempleteListView = 1
WriteMainPrivateProfileString(S_TEMPLETESEL, K_CURRTEMPLETESEL, VisualizationType.TILESTEMPLATE)
Case VisualizationType.CONTENTTEMPLATE
m_nSelTab = VisualizationContainerType.LISTBOX
nSelTempleteListView = 2
WriteMainPrivateProfileString(S_TEMPLETESEL, K_CURRTEMPLETESEL, VisualizationType.CONTENTTEMPLATE)
Case VisualizationType.DETAILSTEMPLATE
m_nSelTab = VisualizationContainerType.DATAGRID
WriteMainPrivateProfileString(S_TEMPLETESEL, K_CURRTEMPLETESEL, VisualizationType.DETAILSTEMPLATE)
End Select
NotifyPropertyChanged(NameOf(nSelTab))
End Set
End Property
' Indice modalita' di visualizzazione
Private m_nSelViewModeIndex As Integer
Public Property nSelViewModeIndex As Integer
Get
Return m_nSelViewModeIndex
End Get
Set(value As Integer)
m_nSelViewModeIndex = value
End Set
End Property
' indice di selezione del TabControl che cambia la ListBox/DataGrid
Private m_nSelTab As Integer
Public Property nSelTab As Integer
Get
Return m_nSelTab
End Get
Set(value As Integer)
m_nSelTab = value
End Set
End Property
#Region "Initial data from window opening"
' Indice del filtro estensione impostato durante creazione finestra
Private m_nFilterIndex As Integer
Public Property nFilterIndex As Integer
Get
Return m_nFilterIndex
End Get
Set(value As Integer)
m_nFilterIndex = value
m_SelFilter = m_FilterList.FirstOrDefault(Function(x) x.nIndexExstension = m_nFilterIndex)
End Set
End Property
' lista delle estensioni impostata durante creazione finestra
Private m_sFilter As String
Public Property sFilter As String
Get
Return m_sFilter
End Get
Set(value As String)
m_sFilter = value
Dim nIndex As Integer = 1
If Not IsNothing(sFilter) Then
Dim FilterListSplit As String() = sFilter.Split("|"c)
For i As Integer = 0 To FilterListSplit.Count - 1
If i Mod 2 = 0 Then
Dim strExstension As New EgtExstension() With {.m_nIndexExstension = nIndex, .m_sNameExstension = FilterListSplit(i), .m_sExstension = FilterListSplit(i + 1)}
m_FilterList.Add(strExstension)
nIndex += 1
End If
Next
End If
End Set
End Property
' Path della cartella iniziale impostata durante creazione finestra
Private m_sInitialDirectory As String
Public Property sInitialDirectory As String
Get
Return m_sInitialDirectory
End Get
Set(value As String)
m_sInitialDirectory = value
If m_sFileName = String.Empty Then m_sSaveFileName = "New.icrs"
m_sSelPath = m_sInitialDirectory
Dim DirectoryStart As String() = m_sInitialDirectory.Split("\"c)
Dim m_RootListTmp As New ObservableCollection(Of EgtDirectory)
Dim dir As EgtDirectory
Dim count As Integer = 1
Dim currItem As EgtFolder
m_RootListTmp = m_RootList
For Each directory As String In DirectoryStart
dir = m_RootListTmp.FirstOrDefault(Function(x) x.sName.Trim("\") = directory)
dir.IsExpanded = True
currItem = TryCast(dir, EgtFolder)
m_RootListTmp = currItem.FolderList
If count = DirectoryStart.Count Then
dir.IsSelected = True
Else
count += 1
End If
Next
'For i As Integer = 0 To m_RootList.Count - 1
' If m_RootList(i).sName.Trim("\") = DirectoryStart(0) Then
' m_RootList(i).IsExpanded = True
' Dim CurrItem As EgtFolder = TryCast(m_RootList(i), EgtFolder)
' If Not IsNothing(CurrItem) Then
' For j As Integer = 0 To CurrItem.FolderList.Count - 1
' If CurrItem.FolderList(j).sName = DirectoryStart(1) Then
' CurrItem.FolderList(j).IsExpanded = True
' Dim ItemFolder As EgtFolder = TryCast(CurrItem.FolderList(j), EgtFolder)
' If Not IsNothing(ItemFolder) Then
' For y As Integer = 0 To ItemFolder.FolderList.Count - 1
' If ItemFolder.FolderList(y).sName = DirectoryStart(2) Then
' ItemFolder.FolderList(y).IsExpanded = True
' ItemFolder.FolderList(y).IsSelected = True
' End If
' Next
' End If
' End If
' Next
' End If
' End If
'Next
End Set
End Property
' Nome del file iniziale impostato durante creazione finestra
Private m_sFileName As String
Public Property sFileName As String
Get
Return m_sFileName
End Get
Set(value As String)
m_sFileName = value
m_sSaveFileName = Path.GetFileName(m_sFileName)
End Set
End Property
#End Region ' Initial data from window opening
' Scelta per la visualizzazione del templete della lista
Private m_nSelTempleteListView As Integer
Public Property nSelTempleteListView As Integer
Get
Return m_nSelTempleteListView
End Get
Set(value As Integer)
m_nSelTempleteListView = value
NotifyPropertyChanged(NameOf(nSelTempleteListView))
End Set
End Property
#Region "Messages"
Public ReadOnly Property Name_Msg As String
Get
Return EgtMsg(15060)
End Get
End Property
Public ReadOnly Property LastModify_Msg As String
Get
Return EgtMsg(15061)
End Get
End Property
Public ReadOnly Property Type_Msg As String
Get
Return EgtMsg(15062)
End Get
End Property
Public ReadOnly Property Dimension_Msg As String
Get
Return EgtMsg(15063)
End Get
End Property
Public ReadOnly Property FileName_Msg As String
Get
Return If(m_nMode = ModeTypes.FILE, EgtMsg(15065), EgtMsg(15066)) ' File Name Folder Name
End Get
End Property
#End Region
'Comandi
Private m_cmdCancel As ICommand
Private m_cmdOk As ICommand
Private m_cmdGoBack As ICommand
Private m_cmdDoubleClick As ICommand
Friend Event m_CloseWindow(bDialogResult As DialogResult)
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New()
m_RootList.Clear()
EgtDirectory.refUpdateSelTreeItem = AddressOf UpdateSelTreeItem
Dim drives As DriveInfo() = DriveInfo.GetDrives().Where(Function(d) d.IsReady).ToArray()
m_FilterList = New ObservableCollection(Of EgtExstension)
EgtFolder.SetEgtManageFileDialogVM(Me)
For i As Integer = 0 To drives.Count() - 1
Dim directory As New EgtFolder(drives(i).RootDirectory, Nothing, "\Resources\EgtDialog\Root.png")
m_RootList.Add(directory)
Next
m_SelFilter = New EgtExstension()
SetVisualizzationList()
Dim IndexTemplete As Integer = GetMainPrivateProfileInt(S_TEMPLETESEL, K_CURRTEMPLETESEL, VisualizationContainerType.DATAGRID)
SelViewMode = m_ViewModeList.FirstOrDefault(Function(x) x.Id = IndexTemplete)
'If IndexTemplete = 3 Then
' m_nSelTab = VisualizationContainerType.DATAGRID
'Else
' nSelTempleteListView = IndexTemplete
'End If
NotifyPropertyChanged(NameOf(RootList))
NotifyPropertyChanged(NameOf(FilterList))
NotifyPropertyChanged(NameOf(ViewModeList))
NotifyPropertyChanged(NameOf(FileName_Msg))
NotifyPropertyChanged(NameOf(SelViewMode))
End Sub
#End Region ' CONTRUCTORS
#Region "METHODS"
'Private Function RootListFilter(CurrItem As Object) As Boolean
' Return TypeOf CurrItem Is EgtFolder
'End Function
''' <summary>
''' Inizializza la ComboBox per la scelta dei template
''' </summary>
Private Sub SetVisualizzationList()
m_ViewModeList = New ObservableCollection(Of IdNameStruct)
Dim ItemVisualization As New IdNameStruct With {
.Id = 0,
.Name = EgtMsg(15067) 'List Templete
}
m_ViewModeList.Add(ItemVisualization)
ItemVisualization.Id = 3
ItemVisualization.Name = EgtMsg(15068) 'Detalis Templete
m_ViewModeList.Add(ItemVisualization)
ItemVisualization.Id = 1
ItemVisualization.Name = EgtMsg(15069) 'Tiles Templete
m_ViewModeList.Add(ItemVisualization)
ItemVisualization.Id = 2
ItemVisualization.Name = EgtMsg(15070) 'Content Templete
m_ViewModeList.Add(ItemVisualization)
End Sub
'Private Sub Directory_PropertyChanged(sender As Object, e As PropertyChangedEventArgs)
' If e.PropertyName = "IsSelected" Then
' 'UpdateSelRoot()
' End If
'End Sub
#End Region
#Region "COMMANDS"
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
Dim CurrItem As EgtItem = TryCast(m_ItemSelected, EgtItem)
Dim simbolsCharacter As String() = {"<"c, ">"c, ":"c, "'"c, "/"c, "\"c, "|"c, "?"c, "*"c,
"CON", "PRN", "AUX", "NUL", "COM0", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
"LPT0", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}
If nMode = ModeTypes.FILE Then
If Not IsNothing(CurrItem) And m_bCheckFileExists And m_bValidateNames Then
For Each simbol As String In simbolsCharacter
If m_sSaveFileName.Contains(simbol) Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(15072), sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.Cancel Then
sSaveFileName = CurrItem.sName
Return
End If
Else
m_sFileName = m_SelTreeItem.sFullName & "\" & m_sSaveFileName
End If
Next
ElseIf m_bValidateNames = False And m_bOverwritePrompt Then
If Not IsNothing(CurrItem) Then
If m_sFileName.Equals(m_sSaveFileName) OrElse m_sSaveFileName.Equals(CurrItem.sName) Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(15073), sTitle, MessageBoxButton.YesNo, MessageBoxImage.Warning) = MessageBoxResult.No Then
Return
End If
End If
Else
m_sFileName = m_SelTreeItem.sFullName & "\" & m_sSaveFileName
End If
Else
m_sFileName = m_SelTreeItem.sFullName & "\" & m_sSaveFileName
End If
ElseIf nMode = ModeTypes.FOLDER Then
For Each simbol As String In simbolsCharacter
If m_sSaveFileName.Contains(simbol) Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(15072), sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.Cancel Then
Return
End If
Else
m_sFileName = m_SelTreeItem.sFullName
End If
Next
End If
RaiseEvent m_CloseWindow(DialogResult.OK)
End Sub
#End Region 'Ok
#Region "GoBack"
Public ReadOnly Property GoBack_Command As ICommand
Get
If m_cmdGoBack Is Nothing Then
m_cmdGoBack = New Command(AddressOf GoBack)
End If
Return m_cmdGoBack
End Get
End Property
Public Sub GoBack()
If Not IsNothing(m_SelTreeItem) AndAlso Not IsNothing(m_SelTreeItem.m_ParentFolder) Then
If TypeOf m_SelTreeItem.m_ParentFolder Is EgtFolder Then
Dim CurrParentFolder As EgtFolder = DirectCast(m_SelTreeItem.m_ParentFolder, EgtFolder)
CurrParentFolder.SetIsSelected(True, False)
End If
m_sSelPath = DirectCast(m_SelTreeItem, EgtFolder).sFullName
NotifyPropertyChanged(NameOf(sSelPath))
End If
End Sub
#End Region 'GoBack
#Region "Cancel"
Public ReadOnly Property Cancel_Command As ICommand
Get
If m_cmdCancel Is Nothing Then
m_cmdCancel = New Command(AddressOf Cancel)
End If
Return m_cmdCancel
End Get
End Property
Public Sub Cancel()
RaiseEvent m_CloseWindow(DialogResult.Cancel)
End Sub
#End Region 'Cancel
#Region "DoubleClick"
Public ReadOnly Property DoubleClick_Command As ICommand
Get
If m_cmdDoubleClick Is Nothing Then
m_cmdDoubleClick = New Command(AddressOf MouseDoubleClick)
End If
Return m_cmdDoubleClick
End Get
End Property
Public Sub MouseDoubleClick()
m_ItemSelected.IsExpanded = True
If TypeOf m_ItemSelected Is EgtFolder Then
Dim CurrItemSelected As EgtFolder = DirectCast(m_ItemSelected, EgtFolder)
CurrItemSelected.SetIsSelected(True, True)
m_sSelPath = CurrItemSelected.sFullName
Else
m_ItemSelected.IsSelected = True
End If
NotifyPropertyChanged(NameOf(sSelPath))
End Sub
#End Region 'DoubleClick
#End Region ' COMMANDS
End Class
Public Class EgtExstension
Inherits VMBase
' Indice estensione
Public m_nIndexExstension As Integer
Public Property nIndexExstension As Integer
Get
Return m_nIndexExstension
End Get
Set(value As Integer)
m_nIndexExstension = value
NotifyPropertyChanged(NameOf(nIndexExstension))
End Set
End Property
' Nome della stringa Filter Splittata m_sNameExstension = Icarus project
Public m_sNameExstension As String
Public Property sNameExstension As String
Get
Return m_sNameExstension
End Get
Set(value As String)
m_sNameExstension = value
NotifyPropertyChanged(NameOf(sNameExstension))
End Set
End Property
' Estensione della stringa Filter Splittata m_sExstension = *.icrs
Public m_sExstension As String
Public Property sExstension As String
Get
Return m_sExstension
End Get
Set(value As String)
m_sExstension = value
NotifyPropertyChanged(NameOf(sExstension))
End Set
End Property
End Class
Public MustInherit Class EgtDirectory
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Shared refUpdateSelTreeItem As Action(Of EgtDirectory)
Friend Shared m_refEgtManageFileDialogVM As EgtManageFileDialogVM
Friend Shared Sub SetEgtManageFileDialogVM(EgtManageFileDialogVM As EgtManageFileDialogVM)
m_refEgtManageFileDialogVM = EgtManageFileDialogVM
End Sub
Protected m_bIsSelected As Boolean
Public MustOverride Property IsSelected As Boolean
Protected m_bIsExpanded As Boolean
Public Overridable Property IsExpanded As Boolean
Public MustOverride ReadOnly Property sFullName As String
Protected m_sName As String
Public MustOverride ReadOnly Property sName As String
Protected m_sIconSource As String
Public Overridable ReadOnly Property sIconSource As String
Get
Return m_sIconSource
End Get
End Property
Protected m_sTypeItem As String
Public MustOverride ReadOnly Property sTypeItem As String
Protected m_ghTypeItem As String
Public Overridable ReadOnly Property ghTypeItem As String
Protected m_dtLastModifyDate As Date
Public MustOverride ReadOnly Property sLastModifyDate As String
Public m_ParentFolder As EgtFolder
Public Property ParentFolder As EgtFolder
Get
Return m_ParentFolder
End Get
Set(value As EgtFolder)
m_ParentFolder = value
End Set
End Property
#End Region ' FIELDS & PROPERTIES
End Class
Public Class EgtFolder
Inherits EgtDirectory
#Region "FIELDS & PROPERTIES"
Private m_ItemList_View As CollectionView = Nothing
Private m_TreeItemList_ViewSource As CollectionViewSource = Nothing
Private m_TreeItemList_View As CollectionView = Nothing
Public ReadOnly Property TreeItemList_View As CollectionView
Get
Return m_TreeItemList_View
End Get
End Property
Private m_DirectoryInfo As DirectoryInfo
Private m_FolderList As New ObservableCollection(Of EgtDirectory)
Public Property FolderList As ObservableCollection(Of EgtDirectory)
Get
Return m_FolderList
End Get
Set(value As ObservableCollection(Of EgtDirectory))
m_FolderList = value
End Set
End Property
Public Overrides ReadOnly Property sFullName As String
Get
Return m_DirectoryInfo.FullName
End Get
End Property
Public Overrides ReadOnly Property sName As String
Get
Return m_DirectoryInfo.Name
End Get
End Property
Public Overrides ReadOnly Property sTypeItem As String
Get
Return EgtMsg(15064)
End Get
End Property
Public Overrides ReadOnly Property sLastModifyDate As String
Get
Return m_DirectoryInfo.LastWriteTime.ToString("dd/MM/yyyy HH:mm:ss")
End Get
End Property
Public Overrides Property IsExpanded As Boolean
Get
Return m_bIsExpanded
End Get
Set(value As Boolean)
m_bIsExpanded = value
NotifyPropertyChanged(NameOf(IsExpanded))
If m_bIsExpanded Then
SetFolderList()
End If
End Set
End Property
Public Overrides Property IsSelected As Boolean
Get
Return m_bIsSelected
End Get
Set(value As Boolean)
m_bIsSelected = value
m_refEgtManageFileDialogVM.sSelPath = m_DirectoryInfo.FullName
If m_bIsSelected Then
SetFolderList()
refUpdateSelTreeItem(Me)
NotifyPropertyChanged(NameOf(IsSelected))
End If
End Set
End Property
Friend Sub SetIsSelected(value As Boolean, bRefreshList As Boolean)
Dim sSelListItemPath As String = ""
If Not IsNothing(m_refEgtManageFileDialogVM.SelTreeItem) Then
sSelListItemPath = m_refEgtManageFileDialogVM.SelTreeItem.sFullName
End If
m_bIsSelected = value
m_refEgtManageFileDialogVM.sSelPath = m_DirectoryInfo.FullName
If m_bIsSelected Then
If bRefreshList Then SetFolderList()
refUpdateSelTreeItem(Me)
End If
If Not IsNothing(sSelListItemPath) Then
Dim SelFolderItem As EgtDirectory = m_FolderList.FirstOrDefault(Function(x) x.sFullName = sSelListItemPath)
If Not IsNothing(SelFolderItem) Then
m_refEgtManageFileDialogVM.SetItemSelected(SelFolderItem)
End If
End If
NotifyPropertyChanged(NameOf(IsSelected))
End Sub
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New()
End Sub
Sub New(DirectoryInfo As DirectoryInfo, Parent As EgtDirectory, Optional IconSource As String = "\Resources\EgtDialog\Folder.png")
m_DirectoryInfo = DirectoryInfo
m_sIconSource = IconSource
Try
If DirectoryInfo.EnumerateDirectories.Count > 0 Then
m_FolderList.Add(New EgtFolder())
End If
Catch ex As Exception
End Try
m_ParentFolder = Parent
m_ItemList_View = CollectionViewSource.GetDefaultView(m_FolderList)
m_ItemList_View.Filter = AddressOf ItemFilter
m_TreeItemList_ViewSource = New CollectionViewSource() With {.Source = m_FolderList}
m_TreeItemList_View = m_TreeItemList_ViewSource.View
m_TreeItemList_View.Filter = AddressOf TreeItemListFilter
NotifyPropertyChanged(NameOf(sName))
NotifyPropertyChanged(NameOf(sLastModifyDate))
NotifyPropertyChanged(NameOf(sTypeItem))
NotifyPropertyChanged(NameOf(sIconSource))
NotifyPropertyChanged(NameOf(FolderList))
NotifyPropertyChanged(NameOf(ParentFolder))
End Sub
#End Region ' CONTRUCTORS
#Region "METHODS"
''' <summary>
''' Funzione per la visualizzazione delle sole cartelle nell'albero TreeView
''' </summary>
''' <param name="CurrItem"></param>
''' <returns></returns>
Private Function TreeItemListFilter(CurrItem As Object) As Boolean
Return TypeOf CurrItem Is EgtFolder
End Function
''' <summary>
''' Funzione per il controllo del filtro per i singoli Item se l'estensione scelta e' .icrs verrano visualizzati tutti i file con l'estensione .icrs
''' </summary>
''' <param name="Item"></param>
''' <returns></returns>
Private Function ItemFilter(Item As Object) As Boolean
Dim CurrItem As EgtItem = TryCast(Item, EgtItem)
If Not IsNothing(CurrItem) AndAlso Not IsNothing(m_refEgtManageFileDialogVM.m_SelFilter.m_sExstension) Then
If CurrItem.sTypeItem = m_refEgtManageFileDialogVM.m_SelFilter.m_sExstension.TrimStart("*") Then
Return True
ElseIf m_refEgtManageFileDialogVM.m_SelFilter.m_sExstension.TrimStart("*") = ".*" Then
Return True
Else
Return False
End If
End If
Return True
End Function
''' <summary>
''' Funzione per popolare la lista FolderList
''' </summary>
Private Sub SetFolderList()
Dim DirectoryList() As DirectoryInfo
Dim FileList() As FileInfo
Try
DirectoryList = m_DirectoryInfo.GetDirectories().Where(Function(file) (file.Attributes And FileAttributes.Hidden And file.Name <> EgtMsg(15071)) = 0).ToArray()
FileList = m_DirectoryInfo.GetFiles().Where(Function(file) (file.Attributes And FileAttributes.Hidden) = 0).ToArray()
Catch ex As Exception
DirectoryList = Nothing
FileList = Nothing
End Try
m_FolderList.Clear()
If Not IsNothing(DirectoryList) AndAlso m_FolderList.Count = 0 Then
For Each subDir As DirectoryInfo In DirectoryList
Dim directory As New EgtFolder(subDir, Me)
m_FolderList.Add(directory)
Next
End If
If Not IsNothing(FileList) Then
For Each files As FileInfo In FileList
Dim file As New EgtItem(files)
m_FolderList.Add(file)
Next
End If
End Sub
#End Region
End Class
Public Class EgtItem
Inherits EgtDirectory
#Region "FIELDS & PROPERTIES"
Private m_FileInfo As FileInfo
Public Overrides ReadOnly Property sFullName As String
Get
Return m_FileInfo.FullName
End Get
End Property
Public Overrides ReadOnly Property sName As String
Get
Return m_FileInfo.Name
End Get
End Property
Public Overrides ReadOnly Property sTypeItem As String
Get
If Not IsNothing(m_FileInfo) AndAlso Not IsNothing(m_FileInfo.Extension) AndAlso Not String.IsNullOrWhiteSpace(m_FileInfo.Extension) Then
Return m_FileInfo.Extension
Else
Return ""
End If
End Get
End Property
Public Overrides ReadOnly Property ghTypeItem As String
Get
Return If(Not String.IsNullOrWhiteSpace(sTypeItem), "File " & sTypeItem.ToUpper(), "")
End Get
End Property
Public ReadOnly Property sDimension As String
Get
Return If(m_FileInfo.Length / 1024 / 1024 > 1, String.Format("{0:#,##0.00}", m_FileInfo.Length / 1024 / 1024) & " Mb", String.Format("{0:#,##0.00}", m_FileInfo.Length / 1024) & " Kb")
End Get
End Property
Public Overrides ReadOnly Property sLastModifyDate As String
Get
Return m_FileInfo.LastWriteTime.ToString("dd/MM/yyyy HH:mm:ss")
End Get
End Property
Public Overrides Property IsSelected As Boolean
Get
Return m_bIsSelected
End Get
Set(value As Boolean)
m_bIsSelected = value
refUpdateSelTreeItem(Me)
End Set
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New(FileInfo As FileInfo)
m_FileInfo = FileInfo
m_sIconSource = "\Resources\EgtDialog\New.png"
NotifyPropertyChanged(NameOf(sName))
NotifyPropertyChanged(NameOf(sDimension))
NotifyPropertyChanged(NameOf(sLastModifyDate))
NotifyPropertyChanged(NameOf(sTypeItem))
NotifyPropertyChanged(NameOf(sIconSource))
End Sub
#End Region ' CONTRUCTORS
End Class
+55
View File
@@ -0,0 +1,55 @@
<EgtWPFLib5:EgtMainWindow x:Class="EgtMessageBoxV"
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 sTitle}"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
Style="{StaticResource Dialog_Window}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Margin="20,20,20,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding sIconSource}"
Margin="0,0,0,0"/>
<TextBlock Grid.Column="1"
Text="{Binding sMessage}"
Margin="5,0,5,0"
Style="{StaticResource DialogWindow_TextBlock}"/>
</Grid>
<ItemsControl Grid.Row="1"
ItemsSource="{Binding ButtonList}"
HorizontalAlignment="Center">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="1"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button IsDefault="{Binding bIsDefault}"
Content="{Binding sMessage}"
Command="{Binding Command_Command}"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<UniformGrid Grid.Column="1"
Grid.Row="1"
Rows="1">
<Button IsCancel="True"
Content="Ok"
Command="{Binding Ok_Command}"
Style="{StaticResource RightPanel_HalfRound_Button}"/>
</UniformGrid>-->
</Grid>
</EgtWPFLib5:EgtMainWindow>
+109
View File
@@ -0,0 +1,109 @@
Imports EgtWPFLib5
Public Class EgtMessageBoxV
#Region "FIELDS & PROPERTIES"
Private WithEvents m_EgtMessageBoxVM As EgtMessageBoxVM
Private Shadows DialogResult As MessageBoxResult
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New(Owner As Window, EgtMessageBoxVM As EgtMessageBoxVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = EgtMessageBoxVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_EgtMessageBoxVM = EgtMessageBoxVM
End Sub
#End Region
#Region "METHODS"
''' <summary>
''' Apre una EgtMessageBox con un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <param name="Button">Valore che specifica quali bottoni mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String, Button As MessageBoxButton) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption, Button))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <param name="Button">Valore che specifica quali bottoni mostrare</param>
''' <param name="Icon">Valore che specifica quale icona mostrare</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String, Button As MessageBoxButton, Icon As MessageBoxImage) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption, Button, Icon))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
''' <summary>
''' Apre una EgtMessageBox con un titolo ed un messaggio che ritorna un risultato
''' </summary>
''' <param name="Owner">Finestra di appartenenza</param>
''' <param name="sMessageBoxText">Stringa che specifica il messaggio da mostrare</param>
''' <param name="sCaption">Stringa che specifica il titolo da mostrare</param>
''' <param name="Button">Valore che specifica quali bottoni mostrare</param>
''' <param name="Icon">Valore che specifica quale icona mostrare</param>
''' <param name="DefaultResult">Valore che specifica il bottone di default</param>
''' <returns>Valore che specifica quale bottone e' stato premuto dall'utente</returns>
Public Overloads Shared Function Show(Owner As Window, sMessageBoxText As String, sCaption As String, Button As MessageBoxButton, Icon As MessageBoxImage, DefaultResult As MessageBoxResult) As MessageBoxResult
Dim NewMessagebox As New EgtMessageBoxV(Owner, New EgtMessageBoxVM(sMessageBoxText, sCaption, Button, Icon, DefaultResult))
NewMessagebox.ShowDialog()
Return NewMessagebox.DialogResult
End Function
#End Region ' METHODS
#Region "EVENTS"
Private Sub CloseWindow(DialogResult As MessageBoxResult) Handles m_EgtMessageBoxVM.OnCloseWindow
Me.DialogResult = DialogResult
Me.Close()
End Sub
#End Region
End Class
+10 -79
View File
@@ -595,6 +595,7 @@ Public Class FilledSolidPanelVM
Friend Sub Dispose()
' ripristino frame originale
EgtSetGridFrame(m_OriginalGridFrame)
EgtSetGridGeoAdv( -1, -1, -1, 0, CurrentMachine.b3Tab.DimX(), 0, CurrentMachine.b3Tab.DimY())
' se in modifica parametri
If m_bMachParam_IsChecked Then
' ripristino modalita' standard
@@ -735,6 +736,7 @@ Public Class FilledSolidPanelVM
If NewGeomType = GDB_TY.CRV_COMPO Then
If Not EgtCurveIsClosed(nNewEntityId) Then
EgtCloseCurveCompo(nNewEntityId)
m_bEscOnLine2P = True
End If
EgtSetName(nNewEntityId, RIB_CURVE)
' resetto colore entita'
@@ -763,9 +765,6 @@ Public Class FilledSolidPanelVM
If Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.EXTRUDE) Then
m_bIsCreatingExtrusion = True
Map.refControllerInputPanelVM.IsChecked = True
If Not EgtCurveIsClosed(nNewEntityId) Then
m_bEscOnLine2P = True
End If
Else
' cancello layer
EgtErase(nNewExtrusionLayerId)
@@ -1077,6 +1076,7 @@ Public Class FilledSolidPanelVM
''' </summary>
Public Sub CPlaneTop(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 OrElse m_bCPlaneObj_IsActive Then Return
EgtSetGridGeoAdv( -1, -1, -1, 0, CurrentMachine.b3Tab.DimX(), 0, CurrentMachine.b3Tab.DimY())
Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.TOP)
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
End Sub
@@ -1102,6 +1102,7 @@ Public Class FilledSolidPanelVM
''' </summary>
Public Sub CPlaneFront(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 OrElse m_bCPlaneObj_IsActive Then Return
EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep)
Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.FRONT)
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
End Sub
@@ -1127,6 +1128,7 @@ Public Class FilledSolidPanelVM
''' </summary>
Public Sub CPlaneRight(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 OrElse m_bCPlaneObj_IsActive Then Return
EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep)
Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.RIGHT)
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
End Sub
@@ -1152,6 +1154,7 @@ Public Class FilledSolidPanelVM
''' </summary>
Public Sub CPlaneBack(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 OrElse m_bCPlaneObj_IsActive Then Return
EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep)
Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.BACK)
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
End Sub
@@ -1177,6 +1180,7 @@ Public Class FilledSolidPanelVM
''' </summary>
Public Sub CPlaneLeft(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 OrElse m_bCPlaneObj_IsActive Then Return
EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep)
Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.LEFT)
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
End Sub
@@ -1202,6 +1206,7 @@ Public Class FilledSolidPanelVM
''' </summary>
Public Sub CPlaneBottom(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 OrElse m_bCPlaneObj_IsActive Then Return
EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep)
Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.BOTTOM)
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
End Sub
@@ -1228,6 +1233,7 @@ Public Class FilledSolidPanelVM
Public Sub CPlaneElevation(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 OrElse m_bCPlaneObj_IsActive Then Return
ManageInterface(False)
EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep)
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_ELEVATION)
End Sub
@@ -1253,87 +1259,12 @@ Public Class FilledSolidPanelVM
Public Sub CPlaneOrigin(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 OrElse m_bCPlaneObj_IsActive Then Return
ManageInterface(False)
EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep)
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_ORIGIN)
End Sub
#End Region ' CPlaneOrigin
#Region "CPlaneRotate"
''' <summary>
''' Returns a command that do CPlaneRotate.
''' </summary>
Public ReadOnly Property CPlaneRotate_Command As ICommand
Get
If m_cmdCPlaneRotate Is Nothing Then
m_cmdCPlaneRotate = New Command(AddressOf CPlaneRotate)
End If
Return m_cmdCPlaneRotate
End Get
End Property
''' <summary>
''' Execute the CPlaneRotate. This method is invoked by the CPlaneRotateCommand.
''' </summary>
Public Sub CPlaneRotate(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 OrElse m_bCPlaneObj_IsActive Then Return
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_ROTATE)
Else
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_ROTATE3D)
End If
End Sub
#End Region ' CPlaneRotate
#Region "CPlane3P"
''' <summary>
''' Returns a command that do CPlane3P.
''' </summary>
Public ReadOnly Property CPlane3P_Command As ICommand
Get
If m_cmdCPlane3P Is Nothing Then
m_cmdCPlane3P = New Command(AddressOf CPlane3P)
End If
Return m_cmdCPlane3P
End Get
End Property
''' <summary>
''' Execute the CPlane3P. This method is invoked by the CPlane3PCommand.
''' </summary>
Public Sub CPlane3P(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 OrElse m_bCPlaneObj_IsActive Then Return
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_3P)
End Sub
#End Region ' CPlane3P
#Region "CPlanePerpObj"
''' <summary>
''' Returns a command that do CPlanePerpObj.
''' </summary>
Public ReadOnly Property CPlanePerpObj_Command As ICommand
Get
If m_cmdCPlanePerpObj Is Nothing Then
m_cmdCPlanePerpObj = New Command(AddressOf CPlanePerpObj)
End If
Return m_cmdCPlanePerpObj
End Get
End Property
''' <summary>
''' Execute the CPlanePerpObj. This method is invoked by the CPlanePerpObjCommand.
''' </summary>
Public Sub CPlanePerpObj(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 OrElse m_bCPlaneObj_IsActive Then Return
Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_PERPCURVE)
End Sub
#End Region ' CPlanePerpObj
#Region "CPlaneObj"
Private m_bCPlaneObj_IsActive As Boolean = False
@@ -84,6 +84,32 @@
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:CheckMachiningParam}">
<Grid Margin="0,1,2.5,1"
IsEnabled="{Binding bIsActive}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<CheckBox Grid.Column="1"
IsChecked="{Binding bValue}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="2.5,0,0,0"/>
<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromPart}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="2.5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl>
</ScrollViewer>
@@ -42,12 +42,21 @@ Public Class FilledSolidParamPanelVM
m_Type = Cathegories.AUX_SOLID
m_sName = "Filled Solid"
m_MachiningParamList = New List(Of MachiningParam)({New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOVERLAP, nFilledSolidId, nPartId, Me),
m_MachiningParamList = New List(Of MachiningParam)({New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDWIDTH, nFilledSolidId, nPartId, Me),
New FilledSolidComboMachiningParam(MachiningParam.Params.AUXSOLIDSINFILL, nFilledSolidId, nPartId, Me),
New FilledSolidCheckMachiningParam(MachiningParam.Params.AUXSOLIDSINFILLLINK, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDCOUNT, nFilledSolidId, nPartId, Me),
New FilledSolidComboMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDORDER, nFilledSolidId, nPartId, Me),
New FilledSolidComboMachiningParam(MachiningParam.Params.AUXSOLIDSLINKTYPE, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSLINKPARAM, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOFFSETLEADPOINT, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSDENSITY, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSGRIDOVERLAP, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSDIRECTION, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOFFSETX, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOFFSETY, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSOVERLAP, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSCOASTINGLEN, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPELEN, nFilledSolidId, nPartId, Me),
New FilledSolidNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPEDIR, nFilledSolidId, nPartId, Me)})
@@ -157,13 +166,13 @@ Public Class FilledSolidNumericMachiningParam
Public Overrides Property sValue As String
Get
Return If(m_bIsLen, LenToString(m_dValue, 1), m_dValue)
Return If(m_bIsLen, LenToString(m_dValue, 2), DoubleToString(m_dValue, 2))
End Get
Set(value As String)
If m_bIsLen Then
StringToLen(value, m_dValue)
Else
m_dValue = value
StringToDouble(value, m_dValue)
End If
NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
@@ -190,6 +199,14 @@ Public Class FilledSolidNumericMachiningParam
MyBase.New(Type, Cathegory)
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.AUXSOLIDSSTRANDWIDTH
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSSTRANDWIDTH, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSSTRANDWIDTH, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSSTRANDCOUNT
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSSTRANDCOUNT, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSSTRANDCOUNT, m_dPartValue)
m_bIsLen = False
Case Params.AUXSOLIDSOVERLAP
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSOVERLAP, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSOVERLAP, m_dPartValue)
@@ -202,6 +219,30 @@ Public Class FilledSolidNumericMachiningParam
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSOFFSETLEADPOINT
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSOFFSETLEADPOINT, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSOFFSETLEADPOINT, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSDENSITY
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSDENSITY, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSDENSITY, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSGRIDOVERLAP
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSGRIDOVERLAP, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSGRIDOVERLAP, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSDIRECTION
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSDIRECTION, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSDIRECTION, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSOFFSETX
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSOFFSETX, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSOFFSETX, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSOFFSETY
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSOFFSETY, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSOFFSETY, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSCOASTINGLEN
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSCOASTINGLEN, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSCOASTINGLEN, m_dPartValue)
@@ -230,6 +271,18 @@ Public Class FilledSolidNumericMachiningParam
sWriteValue = DoubleToString(m_dValue, 2)
End If
Select Case Type
Case Params.AUXSOLIDSSTRANDWIDTH
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSSTRANDWIDTH, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSSTRANDWIDTH)
End If
Case Params.AUXSOLIDSSTRANDCOUNT
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSSTRANDCOUNT, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSSTRANDCOUNT)
End If
Case Params.AUXSOLIDSOVERLAP
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSOVERLAP, sWriteValue)
@@ -248,6 +301,42 @@ Public Class FilledSolidNumericMachiningParam
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE)
End If
Case Params.AUXSOLIDSOFFSETLEADPOINT
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSOFFSETLEADPOINT, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSOFFSETLEADPOINT)
End If
Case Params.AUXSOLIDSDENSITY
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSDENSITY, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSDENSITY)
End If
Case Params.AUXSOLIDSGRIDOVERLAP
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSGRIDOVERLAP, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSGRIDOVERLAP)
End If
Case Params.AUXSOLIDSDIRECTION
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSDIRECTION, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSDIRECTION)
End If
Case Params.AUXSOLIDSOFFSETX
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSOFFSETX, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSOFFSETX)
End If
Case Params.AUXSOLIDSOFFSETY
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSOFFSETY, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSOFFSETY)
End If
Case Params.AUXSOLIDSCOASTINGLEN
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSCOASTINGLEN, sWriteValue)
@@ -339,9 +428,14 @@ Public Class FilledSolidComboMachiningParam
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.AUXSOLIDSINFILL
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_INFILL.NONE, "None"),
New IdNameStruct(Machining.MPAR_INFILL.OFFSET, "Offset"),
New IdNameStruct(Machining.MPAR_INFILL.ZIGZAG, "ZigZag")})
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_INFILL_TYPE.NONE, "None"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.OFFSET, "Offset"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.ZIGZAG, "ZigZag"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.LINES, "Lines"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.GRID, "Grid"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.ZIGZAG_GRID, "Zigzag Grid"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.HONEYCOMB, "Honeycomb"),
New IdNameStruct(Machining.MPAR_INFILL_TYPE.HONEYCOMB_GRID, "Honeycomb Grid")})
Dim nSelValue As Integer = 1
bReadFromRib = EgtGetInfo(nRibId, MAC_AUXSOLIDSINFILL, nSelValue)
If bReadFromRib Then
@@ -379,7 +473,7 @@ Public Class FilledSolidComboMachiningParam
Else
Select Case Type
Case Params.AUXSOLIDSINFILL
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_INFILL.NONE)
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_INFILL_TYPE.NONE)
m_SelValue = m_OrigSelValue
Case Params.AUXSOLIDSSTRANDORDER
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_STRANDORDERS.OUTTOIN)
@@ -447,4 +541,95 @@ Public Class FilledSolidComboMachiningParam
#End Region ' COMMANDS
End Class
Public Class FilledSolidCheckMachiningParam
Inherits CheckMachiningParam
Public Overrides Property bValue As Boolean
Get
Return m_bValue
End Get
Set(value As Boolean)
m_bValue = value
NotifyPropertyChanged(NameOf(bValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Set
End Property
Protected m_bPartValue As Boolean
Public ReadOnly Property bPartValue As Boolean
Get
Return m_bPartValue
End Get
End Property
Public ReadOnly Property bIsModifiedFromPart As Boolean
Get
Return m_bValue <> m_bPartValue
End Get
End Property
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nAuxSolidId As Integer, nPartId As Integer, Cathegory As MachiningCathegory)
MyBase.New(Type, Cathegory)
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.AUXSOLIDSINFILLLINK
bReadFromPart = EgtGetInfo(nAuxSolidId, MAC_AUXSOLIDSINFILLLINK, m_bValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSINFILLLINK, m_bPartValue)
End Select
m_bOrigValue = m_bValue
If Not bReadFromPart Then
m_bValue = m_bPartValue
m_bOrigValue = m_bPartValue
End If
End Sub
Friend Sub WriteParamInRib(nAuxSolidId As Integer)
Select Case Type
Case Params.AUXSOLIDSINFILLLINK
If bIsModifiedFromPart Then
EgtSetInfo(nAuxSolidId, MAC_AUXSOLIDSINFILLLINK, If(m_bValue, 1, 0))
Else
EgtRemoveInfo(nAuxSolidId, MAC_AUXSOLIDSINFILLLINK)
End If
End Select
End Sub
Friend Overrides Sub SaveParam()
m_bOrigValue = m_bValue
End Sub
Friend Overrides Sub ResetParam()
m_bValue = m_bOrigValue
NotifyPropertyChanged(NameOf(bValue))
End Sub
#Region "COMMANDS"
#Region "ResetParam"
Public ReadOnly Property ResetParam_Command As ICommand
Get
If m_cmdResetParam Is Nothing Then
m_cmdResetParam = New Command(AddressOf ResetParamCmd)
End If
Return m_cmdResetParam
End Get
End Property
Public Sub ResetParamCmd()
m_bValue = m_bPartValue
NotifyPropertyChanged(NameOf(bValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Sub
#End Region ' ResetParam
#End Region ' COMMANDS
End Class
+237 -2
View File
@@ -76,6 +76,9 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="DotNetZip">
<HintPath>..\..\..\EgtProg\Icarus\DotNetZip.dll</HintPath>
</Reference>
<Reference Include="EgtUILib, Version=2.4.7.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
@@ -84,8 +87,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EgtProg\DllD32\EgtWPFLib5.dll</HintPath>
</Reference>
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework.Aero2" />
<Reference Include="System.Core" />
@@ -150,6 +153,17 @@
<DependentUpon>DispositionPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="DispositionPanel\DispositionPanelVM.vb" />
<Compile Include="EgtManageFileDialog\EgtManageFileDialogVM.vb" />
<Compile Include="EgtMessageBox\EgtMessageBoxV.xaml.vb">
<DependentUpon>EgtMessageBoxV.xaml</DependentUpon>
</Compile>
<Compile Include="EgtColorPicker\EgtColorPickerV.xaml.vb">
<DependentUpon>EgtColorPickerV.xaml</DependentUpon>
</Compile>
<Compile Include="EgtColorPicker\EgtColorPickerVM.vb" />
<Compile Include="EgtManageFileDialog\EgtManageFileDialogV.xaml.vb">
<DependentUpon>EgtManageFileDialogV.xaml</DependentUpon>
</Compile>
<Compile Include="FilledSolidPanel\FilledSolidPanelV.xaml.vb">
<DependentUpon>FilledSolidPanelV.xaml</DependentUpon>
</Compile>
@@ -206,6 +220,7 @@
<DependentUpon>MaterialDbV.xaml</DependentUpon>
</Compile>
<Compile Include="MaterialDb\MaterialDbVM.vb" />
<Compile Include="Resources\TooltipMsg.vb" />
<Compile Include="TSFEditor\ColumnHeader.xaml.vb">
<DependentUpon>ColumnHeader.xaml</DependentUpon>
</Compile>
@@ -320,6 +335,7 @@
<Compile Include="Utility\DisableModifiedMgr.vb" />
<Compile Include="Utility\EgwCrypto.vb" />
<Compile Include="Utility\GeomEntityColors.vb" />
<Compile Include="Utility\JsonUtility.vb" />
<Compile Include="Utility\LuaExec.vb" />
<Compile Include="Utility\Map.vb" />
<Compile Include="Utility\MyMachine.vb" />
@@ -362,6 +378,18 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="EgtMessageBox\EgtMessageBoxV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EgtColorPicker\EgtColorPickerV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EgtManageFileDialog\EgtManageFileDialogV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="FilledSolidPanel\FilledSolidPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -604,6 +632,8 @@
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="packages.config" />
<None Include="Resources\TooltipData.ini" />
<Resource Include="Resources\EgtMessageBox\Error.png" />
<Resource Include="Resources\Fonts\Roboto-Regular.ttf" />
<Resource Include="Resources\Fonts\Roboto-Light.ttf" />
</ItemGroup>
@@ -855,6 +885,211 @@
<ItemGroup>
<Resource Include="Resources\RibParamPanel\CopyFrom.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\SpiralVase_1.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\SpiralVase_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\StrandOrder_1.png" />
<Resource Include="Resources\ToolTip\StrandOrder_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\StrandHeight_1.png" />
<Resource Include="Resources\ToolTip\StrandHeight_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\StrandWidth_1.png" />
<Resource Include="Resources\ToolTip\StrandWidth_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\StrandCount_1.png" />
<Resource Include="Resources\ToolTip\StrandCount_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\Offset_1.png" />
<Resource Include="Resources\ToolTip\Offset_2.png" />
<Resource Include="Resources\ToolTip\StrandOverlap_1.png" />
<Resource Include="Resources\ToolTip\StrandOverlap_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\StrandPointOffset.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\Direction.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\LinkZUp_1.png" />
<Resource Include="Resources\ToolTip\LinkZUp_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\Diameter_1.png" />
<Resource Include="Resources\ToolTip\Diameter_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\LinkType_1.png" />
<Resource Include="Resources\ToolTip\LinkType_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\LinkParam_1.png" />
<Resource Include="Resources\ToolTip\LinkParam_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\LeadIn_1.png" />
<Resource Include="Resources\ToolTip\LeadIn_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\OffsetLeadPoint_1.png" />
<Resource Include="Resources\ToolTip\OffsetLeadPoint_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\LeadOut_1.png" />
<Resource Include="Resources\ToolTip\LeadOut_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\CoastingLen.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\WipeLen_1.png" />
<Resource Include="Resources\ToolTip\WipeLen_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\OverlapRibs_1.png" />
<Resource Include="Resources\ToolTip\OverlapRibs_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\StrandCountRibs_1.png" />
<Resource Include="Resources\ToolTip\StrandCountRibs_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\LinkRibs.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\InvertDirectionRibs_1.png" />
<Resource Include="Resources\ToolTip\InvertDirectionRibs_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\InvertStrandOrderRibs_1.png" />
<Resource Include="Resources\ToolTip\InvertStrandOrderRibs_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\LeadInInvertRibs_1.png" />
<Resource Include="Resources\ToolTip\LeadInInvertRibs_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\LeadOutInvertRibs_1.png" />
<Resource Include="Resources\ToolTip\LeadOutInvertRibs_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\LeadOutCoasting.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\LeadOutWipeRibs_1.png" />
<Resource Include="Resources\ToolTip\LeadOutWipeRibs_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\LeadOutWipeDirRibs_1.png" />
<Resource Include="Resources\ToolTip\LeadOutWipeDirRibs_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\Difference.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\Coasting.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\Wipe_1.png" />
<Resource Include="Resources\ToolTip\Wipe_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\Infill_1.png" />
<Resource Include="Resources\ToolTip\Infill_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\Density_1.png" />
<Resource Include="Resources\ToolTip\Density_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\Direction_1.png" />
<Resource Include="Resources\ToolTip\Direction_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\Directionx_1.png" />
<Resource Include="Resources\ToolTip\Directionx_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\Directiony_1.png" />
<Resource Include="Resources\ToolTip\Directiony_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\CoastingLength.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\WipeLength.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\FloorCount_1.png" />
<Resource Include="Resources\ToolTip\FloorCount_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\FloorType_1.png" />
<Resource Include="Resources\ToolTip\FloorType_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\CeilCount_1.png" />
<Resource Include="Resources\ToolTip\CeilCount_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\InfillType.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\InfillDensity_1.png" />
<Resource Include="Resources\ToolTip\InfillDensity_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\GridOverlap_1.png" />
<Resource Include="Resources\ToolTip\GridOverlap_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\PDirection_1.png" />
<Resource Include="Resources\ToolTip\PDirection_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\OffsetX_1.png" />
<Resource Include="Resources\ToolTip\OffsetX_2.png" />
<Resource Include="Resources\ToolTip\OffsetY_1.png" />
<Resource Include="Resources\ToolTip\OffsetY_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\CoastingLength_1.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\WipeLength_1.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\WipeDirection_1.png" />
<Resource Include="Resources\ToolTip\WipeDirection_2.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ToolTip\InvertOrderRibs_1.png" />
<Resource Include="Resources\ToolTip\InvertOrderRibs_2.png" />
<Resource Include="Resources\EgtMessageBox\Information.png" />
<Resource Include="Resources\EgtMessageBox\Question.png" />
<Resource Include="Resources\EgtMessageBox\Warning.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\EgtDialog\Restore.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\EgtDialog\New.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\EgtDialog\Folder.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\EgtDialog\Root.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR32.exe
@@ -302,8 +302,8 @@ Public Class ImportExportMachiningPanelVM
End If
Next
MessageBox.Show("Impossible to import the package because materials named:" & Environment.NewLine &
sDuplicatedMaterialList & Environment.NewLine &
"Please modify the names of these machining and then retry to import the materials.")
sDuplicatedMaterialList & Environment.NewLine &
"Please modify the names of these machining and then retry to import the materials.")
Return
End If
' aggiorno/aggiungo materiali
@@ -354,8 +354,8 @@ Public Class ImportExportMachiningPanelVM
sMaterialList &= " - " & m_MachiningList(Index).sName & " (" & If(ImportedMaterialList(Index) = MaterialState.NOTFOUND, "New", "Updated") & ")" & Environment.NewLine
Next
MessageBox.Show("List of the materials:" & Environment.NewLine &
sMaterialList & Environment.NewLine &
"Import successfully completed.")
sMaterialList & Environment.NewLine &
"Import successfully completed.")
Return
End Sub
@@ -471,7 +471,7 @@ Public Class ImportExportMachiningPanelVM
End Select
Case WindowModeEnum.EXPORT, WindowModeEnum.EXPORT_ORIG
' chiedo il nome con cui salvare il file
Dim sExtension As String =""
Dim sExtension As String = ""
If m_WindowType = WindowTypeEnum.MATERIAL Then
If m_WindowMode = WindowModeEnum.EXPORT_ORIG Then
sExtension = OriginalMaterialDataExtension
+35 -28
View File
@@ -1,30 +1,37 @@
<StackPanel x:Class="InstrumentPanelV"
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:local="clr-namespace:Icarus"
IsEnabled="{Binding InstrumentPanel_IsEnabled}"
Orientation="Horizontal">
<Border x:Class="InstrumentPanelV"
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:local="clr-namespace:Icarus"
IsEnabled="{Binding InstrumentPanel_IsEnabled}"
Background="{DynamicResource EgaltechWhite}"
CornerRadius="0,4,0,0"
Padding="0,0,8,0">
<StackPanel Orientation="Horizontal">
<local:CheckedImageToggleButton ToolTip="{Binding GetDist_ToolTip}"
IsChecked="{Binding GetDistIsChecked}"
ImageSource="/Resources/InstrumentPanel/GetDist.png"
CheckedImageSource="/Resources/InstrumentPanel/GetDist_White.png"
Width="15"
Margin="2.5,0,2.5,0"
Style="{StaticResource BottomPanel_ToggleButton}">
<local:CheckedImageToggleButton.Resources>
<sys:Double x:Key="ToggleButton.Image.Height">25</sys:Double>
<sys:Double x:Key="ToggleButton.Image.Width">25</sys:Double>
</local:CheckedImageToggleButton.Resources>
</local:CheckedImageToggleButton>
<local:CheckedImageToggleButton ToolTip="{Binding EdgeAnalysis_ToolTip}"
IsChecked="{Binding bEdgeAnalysis_IsChecked}"
IsEnabled="{Binding bEdgeAnalysis_IsEnabled}"
ImageSource="/Resources/InstrumentPanel/EdgeAnalysis.png"
CheckedImageSource="/Resources/InstrumentPanel/EdgeAnalysis_White.png"
Margin="2.5,0,2.5,0"
Style="{StaticResource BottomPanel_ToggleButton}">
</local:CheckedImageToggleButton>
</StackPanel>
<local:CheckedImageToggleButton ToolTip="{Binding GetDist_ToolTip}"
IsChecked="{Binding GetDistIsChecked}"
ImageSource="/Resources/InstrumentPanel/GetDist.png"
CheckedImageSource="/Resources/InstrumentPanel/GetDist_White.png"
Width="15"
Margin="2.5,0,2.5,0"
Style="{StaticResource BottomPanel_ToggleButton}">
<local:CheckedImageToggleButton.Resources>
<sys:Double x:Key="ToggleButton.Image.Height">25</sys:Double>
<sys:Double x:Key="ToggleButton.Image.Width">25</sys:Double>
</local:CheckedImageToggleButton.Resources>
</local:CheckedImageToggleButton>
<local:CheckedImageToggleButton ToolTip="{Binding EdgeAnalysis_ToolTip}"
IsChecked="{Binding bEdgeAnalysis_IsChecked}"
IsEnabled="{Binding bEdgeAnalysis_IsEnabled}"
ImageSource="/Resources/InstrumentPanel/EdgeAnalysis.png"
CheckedImageSource="/Resources/InstrumentPanel/EdgeAnalysis_White.png"
Margin="2.5,0,2.5,0"
Style="{StaticResource BottomPanel_ToggleButton}">
</local:CheckedImageToggleButton>
</StackPanel>
</Border>
File diff suppressed because it is too large Load Diff
+34 -9
View File
@@ -140,9 +140,17 @@
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
ToolTip="{StaticResource MachiningParam_Tooltip}"
Style="{StaticResource ParameterList_TextBlock}"/>
<TextBlock Text=" (BETA)"
Margin="0,0,2.5,0"
Foreground="Red"
Visibility="{Binding IsBeta_Visibility}"
Style="{StaticResource ParameterList_TextBlock}"/>
</StackPanel>
<EgtWPFLib5:EgtTextBox2 Grid.Column="1"
Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
Margin="2.5,0,0,0"
@@ -156,9 +164,17 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
ToolTip="{StaticResource MachiningParam_Tooltip}"
Style="{StaticResource ParameterList_TextBlock}"/>
<TextBlock Text=" (BETA)"
Margin="0,0,2.5,0"
Foreground="Red"
Visibility="{Binding IsBeta_Visibility}"
Style="{StaticResource ParameterList_TextBlock}"/>
</StackPanel>
<ComboBox Grid.Column="1"
ItemsSource="{Binding ValueList}"
SelectedItem="{Binding SelValue}"
@@ -175,9 +191,17 @@
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
ToolTip="{StaticResource MachiningParam_Tooltip}"
Style="{StaticResource ParameterList_TextBlock}"/>
<TextBlock Text=" (BETA)"
Margin="0,0,2.5,0"
Foreground="Red"
Visibility="{Binding IsBeta_Visibility}"
Style="{StaticResource ParameterList_TextBlock}"/>
</StackPanel>
<CheckBox Grid.Column="1"
IsChecked="{Binding bValue}"
HorizontalAlignment="Center"
@@ -210,6 +234,7 @@
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
ToolTip="{StaticResource MachiningParam_Tooltip}"
Style="{StaticResource ParameterList_TextBlock}"/>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
+1 -23
View File
@@ -112,28 +112,6 @@ Public Class MachiningDbVM
End Get
End Property
#Region "Tooltip"
Public ReadOnly Property Import_ToolTip As String
Get
Return "Import"
End Get
End Property
Public ReadOnly Property Export_ToolTip As String
Get
Return "Export"
End Get
End Property
Public ReadOnly Property EditName_ToolTip As String
Get
Return "Edit Name"
End Get
End Property
#End Region ' Tooltip
' Definizione comandi
Private m_cmdOk As ICommand
Private m_cmdNew As ICommand
@@ -385,4 +363,4 @@ Public Class MachiningDbVM
#End Region ' COMMANDS
End Class
End Class
+12 -16
View File
@@ -8,7 +8,7 @@ Public Class MainWindowM
#Region "FIELDS"
' massimo numero di istanze del programma ammesse
Const MAX_INST As Integer = 32
Const MAX_INST As Integer = 4
Private m_objMutex As Mutex
@@ -75,13 +75,6 @@ Public Class MainWindowM
End Get
End Property
Private m_bAutoNestOption As Boolean = False
Friend ReadOnly Property AutoNestOption As Boolean
Get
Return m_bAutoNestOption
End Get
End Property
Friend ReadOnly Property sVersion As String
Get
Return My.Application.Info.Version.Major.ToString() & "." &
@@ -189,14 +182,17 @@ Public Class MainWindowM
Dim sKey As String = String.Empty
EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
EgtSetKey(sKey)
Dim sNestKey As String = ""
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
'EgtSetNestKey(sNestKey)
' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace(sNestKey)
' Impostazioni per chiave di rete
Dim bNetKey As Boolean = ( GetMainPrivateProfileInt( S_GENERAL, K_NETKEY, 0) = 1)
EgtSetNetHwKey( bNetKey)
Dim sLockId As String = ""
EgtUILib.GetPrivateProfileString( S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
If Not String.IsNullOrEmpty( sLockId) Then
EgtSetLockId( sLockId)
End If
' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2504, 1, m_nKeyLevel) And
EgtGetKeyOptions(5583, 2504, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5583, 3105, 1, m_nKeyLevel) And
EgtGetKeyOptions(5583, 3105, 1, m_nKeyOptions)
' Inizializzazione generale di EgtInterface
m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
@@ -321,7 +317,7 @@ Public Class MainWindowM
Friend Function GetMaxInstances() As Integer
' Leggo il massimo numero di istanze ammesse
Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
Return 1 ' Max(1, Min(nMaxInst, MAX_INST))
Return Max(1, Min(nMaxInst, MAX_INST))
End Function
Friend Sub Close()
+3 -1
View File
@@ -40,7 +40,7 @@ Class MainWindowV
End Sub
Private Sub MainWindowV_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt AndAlso Keyboard.IsKeyDown(Key.F4) Then
e.Cancel = True
Return
End If
@@ -61,6 +61,8 @@ Class MainWindowV
Me.Activate()
' Recupero l'array di stringhe con i nomi del file
Dim sFiles() As String = DirectCast(e.Data.GetData(DataFormats.FileDrop), String())
' Apro il primo
Map.refSecondaryWindowVM.OpenStdFile(sFiles(0))
End If
End Sub
+9 -11
View File
@@ -116,7 +116,7 @@ Public Class MainWindowVM
End If
' annullo trasparenza attivata durante edit rib
If Not IsNothing(Map.refRibPanelVM.SelRib) Then
EgtSetAlpha(Map.refRibPanelVM.SelRib.nExtrusionId, 100)
'EgtSetAlpha(Map.refRibPanelVM.SelRib.nExtrusionId, 100)
End If
ElseIf Map.refTopPanelVM.SelModifyMode.ModifyMode = ModifyModes.SHELLNUMBER Then
' cancello eventuali layer di modifica
@@ -132,7 +132,7 @@ Public Class MainWindowVM
End If
' annullo trasparenza attivata durante edit rib
If Not IsNothing(Map.refShellNumberPanelVM.SelShellNumber) Then
EgtSetAlpha(Map.refShellNumberPanelVM.SelShellNumber.nExtrusionId, 100)
'EgtSetAlpha(Map.refShellNumberPanelVM.SelShellNumber.nExtrusionId, 100)
End If
End If
End If
@@ -148,7 +148,7 @@ Public Class MainWindowVM
End Sub
Private Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
If Map.refSliceManagerVM.bCalculating Then
If Map.refSliceManagerVM.bCalculating OrElse Map.refSliceManagerVM.bCalcSolid Then
Map.refSliceManagerVM.ProcessEvents(nProg, nPause)
End If
If Not IsNothing(Map.refImportLoadingWndVM) Then
@@ -159,21 +159,19 @@ Public Class MainWindowVM
End Function
Friend Sub CloseApplication()
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
' Se simulazione in corso
If Not IsNothing( Map.refSimulationPanelVM) AndAlso Map.refSimulationPanelVM.MySimul.bSimExecuting Then
' Avvio l'arresto della simulazione
Map.refSimulationPanelVM.MySimul.SetSimulationStatus(MCH_SIM_ST.UI_STOP)
Map.refSimulationPanelVM.MySimul.m_bSimulEndExitApp = True
Return
End If
' gestisco la chiusura della simulazione
' Chiusura della simulazione
If Map.refRightPanelVM.SelPanel = RightPanelVM.Panels.SIMULATION AndAlso Not IsNothing(Map.refSimulationPanelVM) Then
Map.refSimulationPanelVM.MySimul.ResetSimulation()
End If
' Gestisco eventuale file corrente modificato
Dim bOk As Boolean = True
'bOk = ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ)
' se salvataggio annullato, rimango
If Not bOk Then Return
Dim bAllowClose As Boolean = Map.refSceneHostVM.MainController.ManageModified()
' Salvo impostazione macchina corrente
'Map.refMachinePanelVM.SaveCurrentMachine()
' Se non confermata chiusura, esco
If Not bAllowClose Then Return
' salvo modo di visualizzazione
+14 -4
View File
@@ -49,8 +49,13 @@
Style="{StaticResource BaseTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding TextBox_Visibility}"
Style="{StaticResource OptionTextBox}"/>
Visibility="{Binding TextBox_Visibility}">
<EgtWPFLib5:EgtTextBox.Style>
<Style TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource OptionTextBox}">
<EventSetter Event="PreviewKeyDown" Handler="TextBox_PreviewKeyDown"/>
</Style>
</EgtWPFLib5:EgtTextBox.Style>
</EgtWPFLib5:EgtTextBox>
</Grid>
</StackPanel>
</HierarchicalDataTemplate>
@@ -69,8 +74,13 @@
Style="{StaticResource BaseTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding TextBox_Visibility}"
Style="{StaticResource OptionTextBox}"/>
Visibility="{Binding TextBox_Visibility}">
<EgtWPFLib5:EgtTextBox.Style>
<Style TargetType="{x:Type EgtWPFLib5:EgtTextBox}" BasedOn="{StaticResource OptionTextBox}">
<EventSetter Event="PreviewKeyDown" Handler="TextBox_PreviewKeyDown"/>
</Style>
</EgtWPFLib5:EgtTextBox.Style>
</EgtWPFLib5:EgtTextBox>
</Grid>
</HierarchicalDataTemplate>
<!-- Menu' tasto destro -->
@@ -23,4 +23,12 @@
End Select
End Sub
Private Sub TextBox_PreviewKeyDown(sender As Object, e As KeyEventArgs)
' per evitare che il click del tasto Enter a fine edit faccia scattare anche la chiusura
' di tutto il pannello a causa del IsDefault sul tasto di chiusura, termino la gestione del click
If e.Key = Key.Enter Then
e.Handled = True
End If
End Sub
End Class
@@ -471,14 +471,6 @@ Public Class ManagePartPanelVM
Map.refSliceManagerVM.UpdateDimensions()
Next
End If
'EgtAddMachGroup("3dPrint")
'EgtSetTable("Tab")
'Dim nRawId As Integer = EgtAddRawPart(b3PrintSolid.Min, b3PrintSolid.DimX, b3PrintSolid.DimY, b3PrintSolid.DimZ, New Color3d(128, 128, 128, 30))
'EgtAddPartToRawPart(nPartId, b3PrintSolid.Min, nRawId)
'EgtMoveToCornerRawPart(nRawId, New Point3d(dPosX, dPosY, 0), MCH_CR.BL)
'EgtResetCurrMachGroup()
' seleziono ultimo pezzo aggiunto
Map.refTopPanelVM.SelLastPart()
+13 -2
View File
@@ -285,6 +285,8 @@ Public Class MaterialIndex
sParamKey = MAT_KZ
Case MaterialParam.Params.KN
sParamKey = MAT_KN
Case MaterialParam.Params.TDRYER
sParamKey = MAT_TDRYER
End Select
Return ReadMaterialParamDouble(m_nIndex, sParamKey, dDefault)
End Function
@@ -346,6 +348,7 @@ Public Class MaterialCathegory
m_MaterialParamList = New List(Of MaterialParam)({New NumericMaterialParam(MaterialParam.Params.K_EXTRUSION, nIndex),
New NumericMaterialParam(MaterialParam.Params.K_LAY_TIME, nIndex),
New NumericMaterialParam(MaterialParam.Params.DENSITY, nIndex),
New NumericMaterialParam(MaterialParam.Params.TDRYER, nIndex),
New StringMaterialParam(MaterialParam.Params.ORIG, nIndex)})
m_Cathegory_Visibility = Visibility.Visible
Case Cathegories.TEMPERATURES
@@ -419,6 +422,7 @@ Public MustInherit Class MaterialParam
KZ = 20
KN = 21
ORIG = 22
TDRYER = 23
End Enum
Private m_Type As Params
@@ -478,6 +482,8 @@ Public MustInherit Class MaterialParam
m_sName = "KZ"
Case Params.KN
m_sName = "KN"
Case Params.TDRYER
m_sName = "Dryer Temperature"
Case Params.ORIG
m_sName = "Original"
End Select
@@ -498,13 +504,13 @@ Public Class NumericMaterialParam
Private m_dValue As Double
Public Property dValue As String
Get
Return If(m_bIsLen, LenToString(m_dValue, 1), m_dValue)
Return If(m_bIsLen, LenToString(m_dValue, 5), DoubleToString(m_dValue, 5))
End Get
Set(value As String)
If m_bIsLen Then
StringToLen(value, m_dValue)
Else
m_dValue = value
StringToDouble(value, m_dValue)
End If
NotifyPropertyChanged(NameOf(dValue))
End Set
@@ -583,6 +589,9 @@ Public Class NumericMaterialParam
Case Params.KN
m_dValue = ReadMaterialParamDouble(nIndex, MAT_KN, 0)
m_bIsLen = False
Case Params.TDRYER
m_dValue = ReadMaterialParamDouble(nIndex, MAT_TDRYER, 0)
m_bIsLen = False
End Select
m_dOrigValue = m_dValue
End Sub
@@ -633,6 +642,8 @@ Public Class NumericMaterialParam
WriteMaterialParam(nIndex, MAT_KZ, sWriteValue, sFilePath)
Case Params.KN
WriteMaterialParam(nIndex, MAT_KN, sWriteValue, sFilePath)
Case Params.TDRYER
WriteMaterialParam(nIndex, MAT_TDRYER, sWriteValue, sFilePath)
End Select
End Sub
+11 -9
View File
@@ -283,17 +283,19 @@ Public Class MaterialDbVM
' aggiorno lista materiali Db
Init()
' aggiorno lista materiali TopBar
Dim PrevMaterialGuid As String = Map.refTopPanelVM.SelMaterial.sGUID
Map.refTopPanelVM.InitMaterialList()
Dim PrevMaterial As MaterialIndex = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sGUID = PrevMaterialGuid)
If Not IsNothing(PrevMaterial) Then
Map.refTopPanelVM.SetSelMaterial(PrevMaterial)
Else
Map.refTopPanelVM.SelMaterial = Nothing
Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.SelMaterial))
If Not IsNothing(Map.refTopPanelVM.SelMaterial) Then
Dim PrevMaterialGuid As String = Map.refTopPanelVM.SelMaterial.sGUID
Dim PrevMaterial As MaterialIndex = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sGUID = PrevMaterialGuid)
If Not IsNothing(PrevMaterial) Then
Map.refTopPanelVM.SetSelMaterial(PrevMaterial)
Else
Map.refTopPanelVM.SelMaterial = Nothing
Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.SelMaterial))
End If
' ricarico lavorazioni per aggiorno liste materiali all'interno
Map.refMachiningDbVM.Init()
End If
' ricarico lavorazioni per aggiorno liste materiali all'interno
Map.refMachiningDbVM.Init()
End If
' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY
+3 -3
View File
@@ -30,7 +30,7 @@ Imports System.Windows
#End If
<Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("Icarus")>
<Assembly: AssemblyCopyright("Copyright © 2022-2023 by Egalware s.r.l.")>
<Assembly: AssemblyCopyright("Copyright © 2022-2026 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)>
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.4.3")>
<Assembly: AssemblyFileVersion("2.5.4.3")>
<Assembly: AssemblyVersion("3.1.5.1")>
<Assembly: AssemblyFileVersion("3.1.5.1")>
+19
View File
@@ -15,6 +15,8 @@ Friend Module OptionModule
Friend m_bThickLine As Boolean
' Flag per visualizzazione smussata delle superfici
Friend m_bSmoothTriMesh As Boolean
' Flag per visualizzazione semplificate sezione strand
Friend m_bUseSimplifiedSection As Boolean
' Colore di default in disegno
Friend m_DefMaterialColor As Color3d
@@ -43,6 +45,14 @@ Friend Module OptionModule
Friend m_sFont As String
Friend m_dTextHeight As Double
' Parametri per la griglia
Friend m_bGridVisibility As Boolean
Friend m_dSnapStepMm As Double
Friend m_dSnapStepInch As Double
Friend m_nMinLineSStep As Integer
Friend m_nMajLineSStep As Integer
Friend m_nExtSStep As Integer
' Variabili che indicano per ogni tipo di lavorazione quale geometria è selezionabile
'Friend m_SelGeomSawing As SceneSelModeOpt
'Friend m_SelGeomDrilling As SceneSelModeOpt
@@ -99,6 +109,8 @@ Friend Module OptionModule
m_bThickLine = GetMainPrivateProfileInt(S_SCENE, K_LINEWIDTH, 1) <> 1
' Inizializzo flag visualizzazione smussata delle superfici
m_bSmoothTriMesh = GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0
' Inizializzo flag visualizzazione sezione strand semplificata
m_bUseSimplifiedSection = GetMainPrivateProfileInt(S_SOLIDS, K_SIMPLIFIEDSECTION, 0) <> 0
' Inizio colore di default in disegno
Dim DefColor As New Color3d(0, 0, 0)
GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
@@ -108,6 +120,13 @@ Friend Module OptionModule
' Inizializzo variabili per import
m_dDxfScaleFactor = GetMainPrivateProfileDouble(S_IMPORT, K_DXFSCALE, 1)
m_dStlScaleFactor = GetMainPrivateProfileDouble(S_IMPORT, K_STLSCALE, 1)
' Inizializzo parametri griglia
m_bGridVisibility = (GetMainPrivateProfileInt(S_GRID, K_SHOWGRID, 1) <> 0)
m_dSnapStepMm = GetMainPrivateProfileDouble(S_GRID, K_SNAPSTEP, 10)
m_dSnapStepInch = GetMainPrivateProfileDouble(S_GRID, K_SNAPSTEPINCH, 12.7)
m_nMinLineSStep = GetMainPrivateProfileInt(S_GRID, K_MINLINESSTEP, 1)
m_nMajLineSStep = GetMainPrivateProfileInt(S_GRID, K_MAJLINESSTEP, 10)
m_nExtSStep = GetMainPrivateProfileInt(S_GRID, K_EXTSSTEP, 100)
End Sub
End Module
+5
View File
@@ -61,6 +61,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ThickLineMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,5,0,5"/>
@@ -70,6 +71,10 @@
Grid.Row="1" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding SmoothTriMesh}"
Grid.Column="1" Grid.Row="1" Margin="22,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding UseSimplifiedSectionMsg}" VerticalAlignment="Center"
Grid.Row="2" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding UseSimplifiedSection}"
Grid.Column="1" Grid.Row="2" Margin="22,5,0,5" VerticalAlignment="Center"/>
</Grid>
<!--<UniformGrid Columns="2"
Margin="0,0,0,5">
+52 -193
View File
@@ -147,6 +147,7 @@ Public Class OptionWindowVM
If StringToLen(value, dVal) AndAlso dVal > 0 Then
OptionModule.m_dGeometryTolerance = dVal
Map.refSceneHostVM.MainController.SetSurfTmTolerance(OptionModule.m_dGeometryTolerance)
Map.refSceneHostVM.MainController.SetAdvImpTolerance(OptionModule.m_dGeometryTolerance)
WriteMainPrivateProfileString(S_GEOMDB, K_SURFTMTOLER, DoubleToString(OptionModule.m_dGeometryTolerance, 5))
End If
End Set
@@ -214,6 +215,16 @@ Public Class OptionWindowVM
End Set
End Property
Public Property UseSimplifiedSection As Boolean
Get
Return OptionModule.m_bUseSimplifiedSection
End Get
Set(value As Boolean)
OptionModule.m_bUseSimplifiedSection = value
WriteMainPrivateProfileString(S_SOLIDS, K_SIMPLIFIEDSECTION, If(value, "1", "0"))
End Set
End Property
'Public Property SelectedTextFont As String
' Get
' Return m_FontList(m_FontList.IndexOf(OptionModule.m_sFontText))
@@ -257,152 +268,6 @@ Public Class OptionWindowVM
End Set
End Property
'Public Property ImageScaleFactor As String
' Get
' Return LenToString(OptionModule.m_dImgScaleFactor, 5)
' End Get
' Set(value As String)
' Dim dVal As Double = 0
' If StringToLen(value, dVal) AndAlso dVal > 0 Then
' OptionModule.m_dImgScaleFactor = dVal
' WritePrivateProfileString(S_IMPORT, K_IMGSCALE, DoubleToString(OptionModule.m_dImgScaleFactor, 5))
' Map.refProjectVM.GetController().SetScaleForImageImport(OptionModule.m_dImgScaleFactor)
' NotifyPropertyChanged("ImageScaleFactor")
' End If
' End Set
'End Property
'Public Property ImageWidth As String
' Get
' Return OptionModule.m_nImgWidth.ToString()
' End Get
' Set(value As String)
' Dim nVal As Integer = 0
' If Integer.TryParse(value, nVal) AndAlso nVal > 0 Then
' OptionModule.m_nImgWidth = nVal
' WritePrivateProfileString(S_EXPORT, K_IMGWIDTH, OptionModule.m_nImgWidth.ToString())
' Map.refProjectVM.GetController().SetDefaultForImageExport(OptionModule.m_nImgWidth, OptionModule.m_nImgHeight)
' End If
' End Set
'End Property
'Public Property ImageHeight As String
' Get
' Return OptionModule.m_nImgHeight.ToString()
' End Get
' Set(value As String)
' Dim nVal As Integer = 0
' If Integer.TryParse(value, nVal) AndAlso nVal > 0 Then
' OptionModule.m_nImgHeight = nVal
' WritePrivateProfileString(S_EXPORT, K_IMGHEIGHT, OptionModule.m_nImgHeight.ToString())
' Map.refProjectVM.GetController().SetDefaultForImageExport(OptionModule.m_nImgWidth, OptionModule.m_nImgHeight)
' End If
' End Set
'End Property
'Public Property ExtLineLen As String
' Get
' Return LenToString(OptionModule.m_dExtLineLen, 5)
' End Get
' Set(value As String)
' Dim dVal As Double = 0
' If StringToLen(value, dVal) AndAlso dVal > 0 Then
' OptionModule.m_dExtLineLen = dVal
' EgtSetCurrDimensionStyle(m_dExtLineLen, m_dArrowLen, m_dTextDist, m_nLenIsMM, m_nDecDigit, m_sFont, m_dTextHeight)
' WritePrivateProfileString(S_DIMENSIONSTYLE, K_EXTLINELEN, DoubleToString(OptionModule.m_dExtLineLen, 5))
' End If
' End Set
'End Property
'Public Property ArrowLen As String
' Get
' Return LenToString(OptionModule.m_dArrowLen, 5)
' End Get
' Set(value As String)
' Dim dVal As Double = 0
' If StringToLen(value, dVal) AndAlso dVal > 0 Then
' OptionModule.m_dArrowLen = dVal
' EgtSetCurrDimensionStyle(m_dExtLineLen, m_dArrowLen, m_dTextDist, m_nLenIsMM, m_nDecDigit, m_sFont, m_dTextHeight)
' WritePrivateProfileString(S_DIMENSIONSTYLE, K_ARROWLEN, DoubleToString(OptionModule.m_dArrowLen, 5))
' End If
' End Set
'End Property
'Public Property TextDist As String
' Get
' Return LenToString(OptionModule.m_dTextDist, 5)
' End Get
' Set(value As String)
' Dim dVal As Double = 0
' If StringToLen(value, dVal) AndAlso dVal > 0 Then
' OptionModule.m_dTextDist = dVal
' EgtSetCurrDimensionStyle(m_dExtLineLen, m_dArrowLen, m_dTextDist, m_nLenIsMM, m_nDecDigit, m_sFont, m_dTextHeight)
' WritePrivateProfileString(S_DIMENSIONSTYLE, K_TEXTDIST, DoubleToString(OptionModule.m_dTextDist, 5))
' End If
' End Set
'End Property
'Public Property SelectedUnitMeasure As String
' Get
' If OptionModule.m_nLenIsMM = 0 Then
' Return "inch"
' ElseIf OptionModule.m_nLenIsMM = 1 Then
' Return "mm"
' Else
' Return EgtMsg(MSG_OPTIONPAGE + 45)
' End If
' End Get
' Set(value As String)
' Dim nVal As Integer = 2
' If value = "inch" Then
' nVal = 0
' ElseIf value = "mm" Then
' nVal = 1
' End If
' OptionModule.m_nLenIsMM = nVal
' EgtSetCurrDimensionStyle(m_dExtLineLen, m_dArrowLen, m_dTextDist, m_nLenIsMM, m_nDecDigit, m_sFont, m_dTextHeight)
' WritePrivateProfileString(S_DIMENSIONSTYLE, K_LENISMM, OptionModule.m_nLenIsMM.ToString())
' End Set
'End Property
'Public Property DecDigit As String
' Get
' Return OptionModule.m_nDecDigit.ToString()
' End Get
' Set(value As String)
' Dim nVal As Integer = 0
' If Integer.TryParse(value, nVal) AndAlso nVal > 0 Then
' OptionModule.m_nDecDigit = nVal
' EgtSetCurrDimensionStyle(m_dExtLineLen, m_dArrowLen, m_dTextDist, m_nLenIsMM, m_nDecDigit, m_sFont, m_dTextHeight)
' WritePrivateProfileString(S_DIMENSIONSTYLE, K_DECDIGIT, OptionModule.m_nDecDigit.ToString())
' End If
' End Set
'End Property
'Public Property SelectedFont As String
' Get
' Return m_FontList(m_FontList.IndexOf(OptionModule.m_sFont))
' End Get
' Set(value As String)
' OptionModule.m_sFont = value
' EgtSetCurrDimensionStyle(m_dExtLineLen, m_dArrowLen, m_dTextDist, m_nLenIsMM, m_nDecDigit, m_sFont, m_dTextHeight)
' WritePrivateProfileString(S_DIMENSIONSTYLE, K_DIMFONT, OptionModule.m_sFont)
' End Set
'End Property
'Public Property TextHeight As String
' Get
' Return LenToString(OptionModule.m_dTextHeight, 5)
' End Get
' Set(value As String)
' Dim dVal As Double = 0
' If StringToLen(value, dVal) AndAlso dVal > 0 Then
' OptionModule.m_dTextHeight = dVal
' EgtSetCurrDimensionStyle(m_dExtLineLen, m_dArrowLen, m_dTextDist, m_nLenIsMM, m_nDecDigit, m_sFont, m_dTextHeight)
' WritePrivateProfileString(S_DIMENSIONSTYLE, K_TEXTHEIGHT, DoubleToString(OptionModule.m_dTextHeight, 5))
' End If
' End Set
'End Property
Private m_DXFScaleEnable As Boolean = False
Public Property DXFScaleEnable As Boolean
@@ -487,32 +352,6 @@ Public Class OptionWindowVM
End Set
End Property
'Public Property SelectedImageScale As String
' Get
' If Math.Abs(OptionModule.m_dImgScaleFactor - ONEMM) < EPS_SMALL * 10 Then
' Return ScaleImageList(ScaleImageList.IndexOf("mm"))
' ElseIf Math.Abs(OptionModule.m_dImgScaleFactor - ONEINCH) < EPS_SMALL * 10 Then
' Return ScaleImageList(ScaleImageList.IndexOf("inch"))
' Else
' ImageScaleEnable = True
' Return ScaleImageList(ScaleImageList.IndexOf(EgtMsg(6546)))
' ImageScaleEnable = True
' End If
' End Get
' Set(value As String)
' If value = "mm" Then
' ImageScaleFactor = LenToString(ONEMM, 3)
' ImageScaleEnable = False
' ElseIf value = "inch" Then
' ImageScaleFactor = LenToString(ONEINCH, 4)
' ImageScaleEnable = False
' Else
' ImageScaleFactor = LenToString(OptionModule.m_dImgScaleFactor, 4)
' ImageScaleEnable = True
' End If
' End Set
'End Property
' Definizione comandi
Private m_cmdTopSceneBackground As ICommand
@@ -563,17 +402,23 @@ Public Class OptionWindowVM
End Property
Public ReadOnly Property ThickLineMsg As String
Get
Return EgtMsg( 6536) ' Linee spesse
Return EgtMsg(6536) ' Linee spesse
End Get
End Property
Public ReadOnly Property SmoothTriMeshMsg As String
Get
Return EgtMsg( 6518) ' Superfici smussate
Return EgtMsg(6518) ' Superfici smussate
End Get
End Property
Public ReadOnly Property UseSimplifiedSectionMsg As String
Get
Return "Use simplified strand section"
End Get
End Property
Public ReadOnly Property UpdateLicenceMsg As String
Get
Return EgtMsg( 6553) ' Aggiorna licenza
Return EgtMsg(6553) ' Aggiorna licenza
End Get
End Property
@@ -763,11 +608,15 @@ Public Class OptionWindowVM
ColorDlg.FullOpen = True
ColorDlg.CustomColors = nCustomColors.ToArray()
ColorDlg.Color = Col.ToColor()
'Dim ColorDlg As New EgtColorPickerV(Application.Current.MainWindow, New EgtColorPickerVM()) With {
' .CustomColors = nCustomColors.ToArray(),
' .Color = Col.ToColor()
'}
' Visualizzo dialogo
If ColorDlg.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return False
' Recupero colore scelto
'Recupero colore scelto
NewCol.FromColor(ColorDlg.Color)
' Salvo eventuali modifiche ai colori custom
''Salvo eventuali modifiche ai colori custom
sCustomColors = ""
For Each Color In ColorDlg.CustomColors
sCustomColors &= Color.ToString() & ","
@@ -797,6 +646,9 @@ Public Class OptionWindowVM
''' Manage the MachiningDb closing. This method is invoked by the CloseMachiningDbCommand.
''' </summary>
Public Sub TopSceneBackgroundCmd()
Dim x As New Forms.ColorDialog
x.ShowDialog()
' Recupero colore da Ini
Dim BackTopColor As New Color3d(192, 192, 192)
GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
@@ -953,31 +805,31 @@ Public Class OptionWindowVM
Dim sMachDir As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, sMachName)
' Preparo direttorio temporaneo
Dim sTempDir As String = Path.Combine(Map.refMainWindowVM.MainWindowM.sMachinesRoot, "Temp")
If My.Computer.FileSystem.DirectoryExists( sTempDir) Then
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists(sTempDir) Then
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CreateDirectory( sTempDir)
My.Computer.FileSystem.CreateDirectory(sTempDir)
' Unzip nel direttorio temporaneo
Using zip As New Ionic.Zip.ZipFile(sMachZip)
zip.ExtractAll( sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
zip.ExtractAll(sTempDir, Ionic.Zip.ExtractExistingFileAction.DoNotOverwrite)
End Using
' Se non è una macchina segnalo il problema ed esco
If Not My.Computer.FileSystem.FileExists( Path.Combine( sTempDir, sMachName, sMachName & ".ini")) Or
Not My.Computer.FileSystem.FileExists( Path.Combine( sTempDir, sMachName, sMachName & ".mlde")) Then
If Not My.Computer.FileSystem.FileExists(Path.Combine(sTempDir, sMachName, sMachName & ".ini")) Or
Not My.Computer.FileSystem.FileExists(Path.Combine(sTempDir, sMachName, sMachName & ".mlde")) Then
' Il file {0} non contiene una macchina - Avviso
Dim sOut As String = String.Format(EgtMsg(6529), sMachZip)
MessageBox.Show(sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning)
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
End If
' Imposto data e ora correnti al file mlde della macchina
Try
File.SetLastWriteTime( Path.Combine( sTempDir, sMachName, sMachName & ".mlde"), System.DateTime.Now)
File.SetLastWriteTime(Path.Combine(sTempDir, sMachName, sMachName & ".mlde"), System.DateTime.Now)
Catch ex As Exception
End Try
' Verifico esistenza di una macchina con lo stesso nome
Dim bOldExists As Boolean = My.Computer.FileSystem.DirectoryExists( sMachDir)
Dim bOldExists As Boolean = My.Computer.FileSystem.DirectoryExists(sMachDir)
Dim bUpdate As Boolean = True
If bOldExists Then
Dim MachBox As New UpdateMachineV(Application.Current.MainWindow, New UpdateMachineVM(sMachName))
@@ -994,14 +846,14 @@ Public Class OptionWindowVM
End Select
' Faccio una copia di backup della macchina corrente
Dim sBackupDir As String = sMachDir & ".old"
If My.Computer.FileSystem.DirectoryExists( sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory( sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists(sBackupDir) Then
My.Computer.FileSystem.DeleteDirectory(sBackupDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
Try
My.Computer.FileSystem.MoveDirectory( sMachDir, sBackupDir, True)
My.Computer.FileSystem.MoveDirectory(sMachDir, sBackupDir, True)
Catch ex As Exception
' Ripristino lo stato originale ed esco
My.Computer.FileSystem.MoveDirectory( sBackupDir, sMachDir, True)
My.Computer.FileSystem.MoveDirectory(sBackupDir, sMachDir, True)
' L'aggiornamento della macchina "{0}" non è riuscito.
Dim sKo As String = String.Format(EgtMsg(6535), sMachName)
EgtOutLog( sKo)
@@ -1010,7 +862,7 @@ Public Class OptionWindowVM
End Try
End If
' Installo la macchina
My.Computer.FileSystem.MoveDirectory( Path.Combine( sTempDir, sMachName), sMachDir, True)
My.Computer.FileSystem.MoveDirectory(Path.Combine(sTempDir, sMachName), sMachDir, True)
' Se è un aggiornamento, recupero utensili, lavorazioni, attrezzaggi e dati per travi
If bOldExists And bUpdate Then
Dim sBackupDir As String = sMachDir & ".old"
@@ -1050,7 +902,7 @@ Public Class OptionWindowVM
EgtOutLog( sOk)
MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
' Rimuovo il direttorio temporaneo
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
' Aggiorno la lista delle macchina
MyMachine.InsertMachine(sMachDir, Map.refMachinePanelVM.MachineList)
End Sub
@@ -1093,10 +945,12 @@ Public Class OptionWindowVM
End If
Try
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
zip.AlternateEncodingUsage = Ionic.Zip.ZipOption.Always
zip.AlternateEncoding = Text.Encoding.UTF8
' aggiungo i file della Macchina
Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sCurrMachineName
If Directory.Exists(sMachineDir) Then
zip.AddSelectedFiles( "name != *\.git\*.* and name != *.git*", sMachineDir, sCurrMachineName, True)
zip.AddSelectedFiles("name != *\.git\*.* and name != *.git*", sMachineDir, sCurrMachineName, True)
End If
' salvo lo zip
zip.Save()
@@ -1223,6 +1077,11 @@ Public Class LayerColor
ColorDlg.CustomColors = nCustomColors.ToArray()
ColorDlg.Color = Col.ToColor()
' Visualizzo dialogo
'Dim ColorDlg As New EgtColorPickerV(Application.Current.MainWindow, New EgtColorPickerVM()) With {
' .CustomColors = nCustomColors.ToArray(),
' .Color = Col.ToColor()
'}
' Visualizzo dialogo
If ColorDlg.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return False
' Recupero colore scelto
NewCol.FromColor(ColorDlg.Color)
+23 -3
View File
@@ -2,6 +2,7 @@
Imports System.IO
Imports EgtWPFLib5
Imports EgtUILib
Imports Newtonsoft.Json
Public Class ProjManagerVM
Inherits VMBase
@@ -150,6 +151,20 @@ Public Class ProjManagerVM
''' </summary>
Public Sub NewProjectCmd()
NewProject(True)
'Dim x As New OpenFileDialog()
'x.ShowDialog()
Dim sDir As String = "C:\EgtData\Test3dPrinting"
Dim od As New EgtManageFileDialogV(Application.Current.MainWindow, New EgtManageFileDialogVM()) With {
.Title = "Open",
.Filter = "Icarus project(*.icrs)|*.icrs" &
"|New geometry EgalTech(*.nge)|*.nge",
.FileName = "New.icrs",
.FilterIndex = 1,
.InitialDirectory = sDir,
.Mode = 1}
od.ShowDialog()
Dim sFilePath As String = od.FileName
End Sub
Friend Sub NewProject(bDialog As Boolean)
@@ -385,7 +400,7 @@ Public Class ProjManagerVM
Map.refSceneHostVM.SaveProject()
End If
EgtGetCurrFilePath(sCurrProject)
' se modificato, chiedo se si vuole salvare
' se modificato, chiedo se si vuole salvare
Else
If EgtGetModified() Then
If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
@@ -417,9 +432,12 @@ Public Class ProjManagerVM
If Not String.IsNullOrWhiteSpace(sCurrProject) Then
Dim sCurrProjectDir As String = Path.GetDirectoryName(sCurrProject)
If Not String.IsNullOrWhiteSpace(sCurrProjectDir) Then
Dim sCurrProjName As String = Path.GetFileNameWithoutExtension(sCurrProject).ToUpper()
Dim TempFiles() As String = Directory.GetFiles(sCurrProjectDir)
For FileIndex = 0 To TempFiles.Count - 1
If Path.GetFileNameWithoutExtension(TempFiles(FileIndex)).Contains(Path.GetFileNameWithoutExtension(sCurrProject)) AndAlso TempFiles(FileIndex) <> sCurrProject Then
If TempFiles(FileIndex) = sCurrProject Then Continue For
Dim sCurrFileName As String = Path.GetFileNameWithoutExtension(TempFiles(FileIndex)).ToUpper()
If String.Compare(sCurrFileName, sCurrProjName) = 0 Then
OtherFiles.Add(TempFiles(FileIndex))
End If
Next
@@ -432,11 +450,13 @@ Public Class ProjManagerVM
End If
Try
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
zip.AlternateEncodingUsage = Ionic.Zip.ZipOption.Always
zip.AlternateEncoding = Text.Encoding.UTF8
' aggiungo file macchine
For Each sMachineName As String In Machines
Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sMachineName
If Directory.Exists(sMachineDir) Then
zip.AddItem(sMachineDir, sMachineName)
zip.AddSelectedFiles("name != *\.git\*.* and name != *.git*", sMachineDir, sMachineName, True)
End If
Next
' aggiungo progetto corrente
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

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