Compare commits

...

104 Commits

Author SHA1 Message Date
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
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 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
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 c32bfd55d0 - aggiunta indicazione parametri beta
- aggiunto parametro SlicingHeight
- corretti alcuni testi parametri
2023-08-24 19:04:44 +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
DarioS 6c36f856e6 Icarus 2.5d3 :
- ricompilazione con cambio versione.
2023-04-18 19:36:16 +02:00
Emmanuele Sassi 33b90967c6 - disattivato pannello Instrument quando modifiche in corso
- gestita visibilita' contemporanea di InputPanele MessagePanel
2023-04-18 17:21:03 +02:00
Emmanuele Sassi 47ea4e3646 - correzioni creazione solidi
- migliorata dis/attivazione interfaccia durante creazione solidi
2023-04-18 09:01:20 +02:00
Emmanuele Sassi cc41ca8d82 - correzione disabilitazione parametri LeadOut in CurrMachining
- cambiata gestione della modalita' di modifica selezionata
- corezione impostazione pagina modifica dopo apertura progetto
- verifica che non ci siano operazioni di modifica in corso prima di far partire slice
- correzione errore su chiusura percorso disegnato
- disabilitata interfaccia quando comando in corso in modifica
2023-04-17 20:00:50 +02:00
DarioS 554b1a662e Icarus :
- correzione per caricamento file icrs con drag.
2023-04-11 15:24:16 +02:00
DarioS 10a0745449 Merge remote-tracking branch 'origin/FlowDocument' 2023-04-11 13:38:26 +02:00
Emmanuele Sassi f47b202499 - introdotta EgtTextBox2 su lavorazioni da Db e Curr 2023-04-11 13:36:19 +02:00
DarioS 1a0eb0cb31 Icarus :
- lettura MinMax ora da Ini macchina.
2023-04-11 13:27:10 +02:00
DarioS 33176f40fa Icarus 2.5d2 :
- ricompilazione con cambio versione.
2023-04-11 11:19:41 +02:00
Emmanuele Sassi bbb6d16483 Merge branch 'FlowDocument' 2023-04-11 09:40:29 +02:00
Emmanuele Sassi 317321d46c - eliminata funzione import inutile
- trasformate funzioni di gestione progetto da sub a function
2023-04-11 09:40:13 +02:00
Emmanuele Sassi 57baab72d5 Merge branch 'FlowDocument' 2023-04-08 12:30:03 +02:00
Emmanuele Sassi 13401bc486 - aggiunta area di estrusione
- aggiunto file di dati della macchina
- messaggi di errore su slice se pezzo fuori da area stampabile
2023-04-08 12:29:45 +02:00
Emmanuele Sassi 91d8e8aa1f Merge branch 'develop' 2023-04-07 15:54:38 +02:00
Emmanuele Sassi 65288427f3 Merge remote-tracking branch 'ICARUS/main' into develop 2023-04-07 15:54:10 +02:00
Emmanuele Sassi a234c6f6f1 - Aggiunta estensione icrs in apertura progetto 2023-04-07 15:53:58 +02:00
DarioS f1819fc61c Icarus 2.5d1 :
- ricompilazione con cambio versione e aggiornamento codici di protezione mensili.
2023-04-07 10:30:15 +02:00
Emmanuele Sassi e67c79992c - aggiornati bottoni Ok, Cancel su molte pagine
- cambiate icone Reference
- aggiunte icone in slice manager
- spostato Update in TFS vicino a Reset
2023-04-07 09:49:44 +02:00
Emmanuele Sassi 209cab548b - aggiunta finestra di caricamento import
- spostato processEvent in main che rimanda alle varie parti del programma
2023-04-03 18:05:01 +02:00
Emmanuele Sassi fa737c7c80 - riattivata visualizzazione macchina su simulazione
- aggiornata icona vista tool
- gestita visualizzazione strati dopo calcolo slice
- uniformata textbox assi macchina in simulazione
2023-04-03 13:33:44 +02:00
Emmanuele Sassi 4811a37fe7 - aggiunto nuovo splashscreen
- aggiunta opacita' finestra all'avvio
2023-04-03 08:53:59 +02:00
Emmanuele Sassi d43acd1678 - aggiunto messaggio input su griglia da oggetto
- migliorata gestione griglia da oggetto
2023-04-01 12:36:00 +02:00
Emmanuele Sassi 2850e07360 - correzione attivazione parametri di lavorazione 2023-03-30 09:03:44 +02:00
Emmanuele Sassi 9ae9a6df88 - aggiunta gestione dipendenze tra parametri di lavorazione
- aggiunti min e max per parametri di lavorazione
2023-03-30 08:58:45 +02:00
Emmanuele Sassi f5206ce8bf - aggiunta possibilita' di impostare min e max per parametri di lavorazione 2023-03-29 16:26:48 +02:00
Emmanuele Sassi f4dea984be - introdotta estensione progetti icrs 2023-03-29 15:15:00 +02:00
Emmanuele Sassi 8a7af066d9 - fermato timer splashscreen
- introdotta estensione progetti icrs
2023-03-29 15:14:34 +02:00
Emmanuele Sassi bbb52b6ade Merge branch 'NewWidow' into develop 2023-03-28 20:34:19 +02:00
Emmanuele Sassi 7fe2c09bca Merge branch 'NewInterface' into NewWidow 2023-03-28 20:31:22 +02:00
Emmanuele Sassi a5be2180ea - aggiornate finestre a EgtMainWindow
- aggiunti nome e path del progetto
- gestito bordo della finestra che sparisce quando massimizzata
- creata finestra UpdateMachine al posto di MachineBox
2023-03-28 20:28:36 +02:00
Emmanuele Sassi 6e5db6e147 - modifiche a finestre 2023-03-24 19:42:58 +01:00
Emmanuele Sassi 589156d963 - modificata grafica delle finestre 2023-03-24 16:44:30 +01:00
Emmanuele Sassi 54c5d41c67 - correzione eliminazione superficie pezzo
- correzione contextMenu in ManagePart
- Tooltip su tutte le icone
- gestione disattivazione interfaccia durante import
2023-03-13 18:32:58 +01:00
Emmanuele Sassi 0c2a5343ee - disabilitato tutto quando sta importando progetto
- gestiti frame del pezzo e di stampa con z = 0
2023-03-13 16:20:28 +01:00
Emmanuele Sassi cbedfdc767 - correzione visibilita' pezzi durante importazione
- scrittura flag visibilita' anche per le pagine diverse da modify e slice
2023-03-13 10:19:03 +01:00
Emmanuele Sassi 566770255c - Convertiti alla nuova window ed alla nuova grafica tutti i dialoghi 2023-03-11 11:04:32 +01:00
Emmanuele Sassi 8cac7b43fb - riattivati comandi su aboutBox e CloseApplication 2023-03-08 17:35:36 +01:00
Emmanuele Sassi 3c0490e659 - aggiunte icone finestra
- aggiunta gestione TitlePanel
2023-03-08 10:35:20 +01:00
Emmanuele Sassi 55da29a72c - introdotto bottone per annullare calcoli in SliceManager 2023-03-06 15:10:00 +01:00
Emmanuele Sassi 93864624fd Merge remote-tracking branch 'ICARUS/main' into NewInterface 2023-03-06 10:56:32 +01:00
Emmanuele Sassi db66fa17cd - aggiunti ProjectName e ProjectPath 2023-03-06 10:53:20 +01:00
DarioS becbf3c682 Icarus 2.5c1 :
- eliminati alcuni crash
- in geometrie si chiude Edit dopo aver cancellato l'ultima
- piccoli aggiustamenti ai tooltip.
2023-03-03 19:59:19 +01:00
DarioS da22e9217c Merge branch 'NewInterface' of https://gitlab.steamware.net/egalware/icarus 2023-03-03 18:37:12 +01:00
Emmanuele Sassi f7b4f710ef - introdotto check per limitare ribs unbounded al solido di stampa 2023-03-03 17:31:54 +01:00
Emmanuele Sassi 2a248795b1 - work in progress 2023-03-03 15:08:27 +01:00
Emmanuele Sassi 08088592f9 - aggiunta vista SE 2023-03-02 14:22:36 +01:00
Emmanuele Sassi ad24522010 - aggiunti titoli CurrMach, MachDb, MatDb
- aggiornamento grafica MaterialDb
- correzioni aggiornamento tempo e massa
2023-03-02 10:44:00 +01:00
Emmanuele Sassi 8a1186676f Merge branch 'ImportExportMaterialDb' into NewInterface 2023-03-01 19:26:16 +01:00
Emmanuele Sassi 2b4d5f9c92 - eliminato plurale da nomi per evitare scroll orizzontale
- salvato a parte nuova grafica finestra opzioni
2023-03-01 13:16:19 +01:00
Emmanuele Sassi 7592a8d888 - Aggiunti FilledSolid
- Aggiunto ShellNumberId fisso
- Gestiti messaggi in StatusBar per misure
- Aggiornate icone TopPanel
2023-03-01 10:36:46 +01:00
Emmanuele Sassi e621fb46d0 - Aggiornato AboutBox
- Aggiunti bottoni v e x
- Aggiunte dimansioni oggetto
- Esteso uso EgtTextBox2
- Modificato RibParamPanel e ShellNumberParamPanel
2023-02-25 12:24:29 +01:00
Emmanuele Sassi 94e9952e82 Merge branch 'develop' into NewInterface 2023-02-23 12:50:32 +01:00
Emmanuele Sassi 71ad5dd682 - nuova grafica per simulazione
- introdotta possibilita' di muovere coordinate macchina in simulazione
- introduzione nuova EgtTextBox2
- nuova grafica per ControllerInputPanel
- nuovo componente che gestisce visibilita' macchina
- gestita stop e uscita da simulazione su chiusura programma
-
2023-02-23 12:03:00 +01:00
DarioS c9102a5602 Icarus 2.5b3 :
- ricompilazione con cambio versione.
2023-02-17 12:12:48 +01:00
Emmanuele Sassi 1a34b2fef9 - Posizionamento corretto contextMenu in TreeView
- introduzione iconcine per parametri lavorazione in TopBar
- Miglioramento ControllerInput
2023-02-17 09:55:16 +01:00
Emmanuele Sassi ed1ac1b238 - sviluppo componente TreeView 2023-02-15 08:56:58 +01:00
Emmanuele Sassi 5ef1a25bb5 Merge branch 'develop' into NewInterface 2023-02-03 17:35:03 +01:00
Emmanuele Sassi 341eab87ab Merge branch 'develop' into NewInterface 2023-02-03 09:37:33 +01:00
Emmanuele Sassi 55d69bdcf7 - modificata grafica MachiningDb e CurrMachining
- migliorata gestione colori
- customizzato expander
2023-01-19 11:21:20 +01:00
Emmanuele Sassi 34c4d1e644 - aggiunti bottonmi con cambio icona quando premuti
- corretto errore in visualizzazione posizione cursore
- modificati colori griglia TFSEditor
- cambiata grafica slider
- migliorati stati bottoni
2023-01-17 10:43:34 +01:00
Emmanuele Sassi 95e5751c3d Merge branch 'develop' into NewInterface 2023-01-12 10:53:31 +01:00
Emmanuele Sassi 0be02be5f7 - modificato stile slider
- modificato TFSEditor
2023-01-09 15:38:10 +01:00
Emmanuele Sassi a52227b1ea Merge remote-tracking branch 'ICARUS/main' into NewInterface 2023-01-04 12:24:30 +01:00
Emmanuele Sassi e13c3bf106 - mighliorata grafica DataGrid in TFSEditor 2023-01-04 12:23:24 +01:00
Emmanuele Sassi 20bb3dae68 - aggiornamento grafica TFSEditor
- correzione visibilita' AdvancementSlider
- aggiornamento di alcune icone
- correzione foreground su TFSEditor
- riuniti textbox in uno solo in TFSEditor
2023-01-04 12:12:20 +01:00
Emmanuele Sassi 970a11c758 - correzione visibilita' slider orizzontale
- aggiornamento grafico StatusBar, SliceManager, ecc...
2022-12-30 19:11:09 +01:00
Emmanuele Sassi ba09f8634e Merge branch 'main' into NewInterface 2022-12-29 16:59:51 +01:00
Emmanuele Sassi 7c277f129b - Aggiornamento grafica ProjManager, TopPanel e LeftPanel 2022-12-29 16:59:13 +01:00
Emmanuele Sassi 503d91396e - modifiche grafiche TopPanel 2022-12-28 09:15:28 +01:00
Emmanuele Sassi ac401afe20 Merge branch 'develop' into NewInterface 2022-12-27 17:27:54 +01:00
Emmanuele Sassi e2fbc74a58 Merge branch 'ImportExportMachiningDb&Material' into NewInterface 2022-12-14 15:16:45 +01:00
339 changed files with 17871 additions and 5590 deletions
+60 -31
View File
@@ -1,52 +1,81 @@
<Window x:Class="AboutBoxV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="AboutBox" Height="400" Width="360" WindowStyle="None" ResizeMode="NoResize"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="AboutBox"
Height="486"
Width="735"
WindowStyle="None"
ResizeMode="NoResize"
AllowsTransparency="True"
Background="Transparent"
ShowInTaskbar="False"
WindowStartupLocation="CenterOwner">
<Border BorderThickness="2" BorderBrush="LightBlue">
<Border Style="{StaticResource WhiteBottomBlueRow_Border}">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="2.5*"/>
<RowDefinition Height="0.35*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.35*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Column="1" Grid.Row="1">
<Grid Grid.Column="3" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Border Name="LogoBrd" Grid.Column="1" Background="White">
<Image Source="/Resources/AboutBoxImage.png" Stretch="Uniform"/>
</Border>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Image Grid.RowSpan="2"
Source="/Resources/AboutBox/IcarusLogo.png"
Height="65"
Style="{StaticResource Button_Image}"/>
<TextBlock Grid.Column="2"
Name="DescriptionLbl"
VerticalAlignment="Bottom"
Style="{StaticResource Version_AboutBox_TextBlock}"/>
<TextBlock Grid.Column="2"
Grid.Row="1"
Name="VersionLbl"
VerticalAlignment="Top"
Style="{StaticResource Version_AboutBox_TextBlock}"/>
</Grid>
<TextBlock Name="DescriptionLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18" />
<TextBlock Name="VersionLbl" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="12" />
<TextBox Name="InfoLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" FontSize="12" IsReadOnly="True" TextWrapping="Wrap"/>
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="8" IsCancel="True"
Margin="100,0"/>
<Image Grid.Column="1"
Grid.Row="3"
Source="/Resources/AboutBox/EgalwareLogo.png"
Height="190"
Style="{StaticResource Button_Image}"/>
<TextBox Name="InfoLbl"
Grid.Column="3"
Grid.Row="3"
Style="{StaticResource AboutBox_TextBox}"/>
<TextBlock Name="CopyrightLbl"
Grid.Column="3"
Grid.Row="5"
Style="{StaticResource Copyright_AboutBox_TextBlock}"/>
<Button Grid.Column="3"
Grid.Row="7"
IsCancel="True"
HorizontalAlignment="Right"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</Border>
</Window>
+7 -8
View File
@@ -16,30 +16,29 @@ Public Class AboutBoxV
Dim sKlev As String = Map.refMainWindowVM.MainWindowM.nKeyLevel.ToString()
Dim sOpts As String = Map.refMainWindowVM.MainWindowM.nKeyOptions.ToString()
Dim sLeftDays As String = ""
Dim nLeftDays As Integer
if EgtGetKeyLeftDays( nLeftDays) AndAlso nLeftDays < 500 Then sLeftDays= " (" & nLeftDays.ToString() & ")"
sInfo = If( EgtIsDebug(), "*** Debug Libraries ***" & Environment.NewLine, "")
Dim nLeftDays As Integer
If EgtGetKeyLeftDays(nLeftDays) AndAlso nLeftDays < 500 Then sLeftDays = " (" & nLeftDays.ToString() & ")"
sInfo = If(EgtIsDebug(), "*** Debug Libraries ***" & Environment.NewLine, "")
sInfo &= "User " & Environment.MachineName & "\" & Environment.UserName &
" Inst" & Map.refMainWindowVM.MainWindowM.nInstance.ToString() &
" Ulv" & Map.refMainWindowVM.MainWindowM.nUserLevel.ToString() &
" Dbg" & Map.refMainWindowVM.MainWindowM.DebugLevel().ToString() & Environment.NewLine
" Dbg" & Map.refMainWindowVM.MainWindowM.DebugLevel().ToString() & Environment.NewLine
sInfo &= sKey & " - " & sKlev & " - " & sOpts & sLeftDays & Environment.NewLine
sInfo &= "DataRoot " & Map.refMainWindowVM.MainWindowM.sDataRoot & Environment.NewLine
sInfo &= "MachinesRoot " & Map.refMainWindowVM.MainWindowM.sMachinesRoot & Environment.NewLine
Dim sOpSys As String = String.Empty
EgtGetOsInfo( sOpSys)
EgtGetOsInfo(sOpSys)
sInfo &= sOpSys & Environment.NewLine
Dim sCPU As String = String.Empty
EgtGetCpuInfo( sCPU)
EgtGetCpuInfo(sCPU)
sInfo &= sCPU & Environment.NewLine
Dim sMem As String = String.Empty
EgtGetMemoryInfo( sMem)
EgtGetMemoryInfo(sMem)
sInfo &= sMem & Environment.NewLine
Dim sScene As String = String.Empty
EgtGetSceneInfo(sScene)
sInfo &= sScene
InfoLbl.Text = sInfo
ExitBtn.Content = EgtMsg(MSG_MISSINGKEYWD + 4) 'Ok
End Sub
End Class
@@ -0,0 +1,167 @@
Imports System.Globalization
Imports System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox
Imports System.Windows.Media.Media3D
Public Module TreeViewItemHelper
' Gestione MouseOver come in ListBox
Private CurrentItem As TreeViewItem
Private ReadOnly UpdateOverItemEvent As RoutedEvent = EventManager.RegisterRoutedEvent("UpdateOverItem", RoutingStrategy.Bubble, GetType(RoutedEventHandler), GetType(TreeViewItemHelper))
Private ReadOnly IsMouseDirectlyOverItemKey As DependencyPropertyKey = DependencyProperty.RegisterAttachedReadOnly("IsMouseDirectlyOverItem", GetType(Boolean), GetType(TreeViewItemHelper), New FrameworkPropertyMetadata(Nothing, New CoerceValueCallback(AddressOf CalculateIsMouseDirectlyOverItem)))
Public ReadOnly IsMouseDirectlyOverItemProperty As DependencyProperty = IsMouseDirectlyOverItemKey.DependencyProperty
Sub New()
EventManager.RegisterClassHandler(GetType(TreeViewItem), UIElement.MouseEnterEvent, New MouseEventHandler(AddressOf OnMouseTransition), True)
EventManager.RegisterClassHandler(GetType(TreeViewItem), UIElement.MouseLeaveEvent, New MouseEventHandler(AddressOf OnMouseTransition), True)
EventManager.RegisterClassHandler(GetType(TreeViewItem), UpdateOverItemEvent, New RoutedEventHandler(AddressOf OnUpdateOverItem))
End Sub
Function GetIsMouseDirectlyOverItem(ByVal obj As DependencyObject) As Boolean
Return CBool(obj.GetValue(IsMouseDirectlyOverItemProperty))
End Function
Private Function CalculateIsMouseDirectlyOverItem(ByVal item As DependencyObject, ByVal value As Object) As Object
Return item Is CurrentItem
End Function
Private Sub OnUpdateOverItem(ByVal sender As Object, ByVal e As RoutedEventArgs)
CurrentItem = TryCast(sender, TreeViewItem)
CurrentItem.InvalidateProperty(IsMouseDirectlyOverItemProperty)
e.Handled = True
End Sub
Private Sub OnMouseTransition(ByVal sender As Object, ByVal e As MouseEventArgs)
SyncLock IsMouseDirectlyOverItemProperty
If Not IsNothing(CurrentItem) Then
Dim oldItem As DependencyObject = CurrentItem
CurrentItem = Nothing
oldItem.InvalidateProperty(IsMouseDirectlyOverItemProperty)
End If
Mouse.DirectlyOver?.RaiseEvent(New RoutedEventArgs(UpdateOverItemEvent))
End SyncLock
End Sub
' Gestione click destro del mouse che seleziona l'elemento
Public ReadOnly SelectItemOnRightClickProperty As DependencyProperty = DependencyProperty.RegisterAttached("SelectItemOnRightClick", GetType(Boolean), GetType(TreeViewItemHelper), New UIPropertyMetadata(False, AddressOf OnSelectItemOnRightClickChanged))
Public Function GetSelectItemOnRightClick(ByVal d As DependencyObject) As Boolean
Return CBool(d.GetValue(SelectItemOnRightClickProperty))
End Function
Public Sub SetSelectItemOnRightClick(ByVal d As DependencyObject, ByVal value As Boolean)
d.SetValue(SelectItemOnRightClickProperty, value)
End Sub
Private Sub OnSelectItemOnRightClickChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
Dim selectItemOnRightClick As Boolean = CBool(e.NewValue)
Dim treeView As TreeView = TryCast(d, TreeView)
If treeView IsNot Nothing Then
If selectItemOnRightClick Then
AddHandler treeView.PreviewMouseRightButtonDown, AddressOf OnPreviewMouseRightButtonDown
Else
RemoveHandler treeView.PreviewMouseRightButtonDown, AddressOf OnPreviewMouseRightButtonDown
End If
End If
End Sub
Private Sub OnPreviewMouseRightButtonDown(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
Dim treeViewItem As TreeViewItem = VisualUpwardSearch(Of TreeViewItem)(TryCast(e.OriginalSource, DependencyObject))
If treeViewItem IsNot Nothing Then
treeViewItem.IsSelected = True
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
End If
End If
e.Handled = True
End If
End Sub
Private Function VisualUpwardSearch(Of T As DependencyObject)(ByVal source As DependencyObject) As T
Dim returnVal As DependencyObject = source
While returnVal IsNot Nothing AndAlso Not (TypeOf returnVal Is T)
Dim tempReturnVal As DependencyObject = Nothing
If TypeOf returnVal Is Visual OrElse TypeOf returnVal Is Visual3D Then
tempReturnVal = VisualTreeHelper.GetParent(returnVal)
End If
If tempReturnVal Is Nothing Then
returnVal = LogicalTreeHelper.GetParent(returnVal)
Else
returnVal = tempReturnVal
End If
End While
Return TryCast(returnVal, T)
End Function
' Gestione indentazione sottoelementi
Public Function GetDepth(item As TreeViewItem) As Integer
Dim parent As TreeViewItem = GetParent(item)
If Not IsNothing(parent) Then Return GetDepth(parent) + 1
Return 0
End Function
Private Function GetParent(item As TreeViewItem) As TreeViewItem
Dim parent As DependencyObject = If(Not IsNothing(item), VisualTreeHelper.GetParent(item), Nothing)
While Not IsNothing(parent) AndAlso Not (TypeOf parent Is TreeViewItem OrElse TypeOf parent Is TreeView)
parent = VisualTreeHelper.GetParent(parent)
End While
Return TryCast(parent, TreeViewItem)
End Function
Private Function GetTreeParent(item As TreeViewItem) As TreeViewItem
Dim parent As DependencyObject = If(Not IsNothing(item), VisualTreeHelper.GetParent(item), Nothing)
While Not IsNothing(parent) AndAlso Not (TypeOf parent Is TreeViewItem OrElse TypeOf parent Is TreeView)
parent = VisualTreeHelper.GetParent(parent)
End While
Return TryCast(parent, TreeViewItem)
End Function
' Gestione indentazione sottoelementi
Public Function GetHeight(Item As TreeViewItem, SearchedItem As TreeViewItem, ByRef nHeight As Integer) As Boolean
Dim Index As Integer = 0
While Index <= Item.Items.Count - 1
If GetHeight(Item.Items(Index), SearchedItem, nHeight) Then
nHeight += 1
Return True
End If
Index += 1
End While
Return False
End Function
End Module
Public Class LeftMarginMultiplierConverter
Implements IValueConverter
Public Property Length As Double
Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert
Dim item As TreeViewItem = TryCast(value, TreeViewItem)
If item Is Nothing Then Return New Thickness(0)
Return New Thickness(Length * GetDepth(item), 0, 0, 0)
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New System.NotImplementedException()
End Function
End Class
+47 -68
View File
@@ -1,71 +1,50 @@
<EgtWPFLib5:EgtCustomWindow x:Class="ChooseMachineWndV"
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:Icarus="clr-namespace:Icarus"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
MinWidth="500"
WindowStartupLocation="CenterOwner"
IsClosable="False"
IsMinimizable="False"
IsResizable="False"
Title="ProjectType">
<StackPanel Margin="5,5,5,0">
<Border Grid.Row="1"
BorderThickness="1"
BorderBrush="DarkGray"
Background="White"
Margin="5">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<EgtWPFLib5:EgtMainWindow x:Class="ChooseMachineWndV"
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:Icarus="clr-namespace:Icarus"
Title="New Project"
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"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid HorizontalAlignment="Center"
Grid.Row="0"
Margin="15">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding ChooseMachine_Msg}"
Style="{StaticResource OptionTextBlock}"
Grid.Row="0" Grid.ColumnSpan="2"/>
<Rectangle Height="22" Grid.Row="1"/>
<ComboBox ItemsSource="{Binding MachineList}" DisplayMemberPath="Name"
SelectedItem="{Binding SelMachine}" SelectedValuePath="Name"
Grid.Row="2"
Style="{StaticResource BtlData_ComboBox}"/>
</Grid>
<TextBlock Text="{Binding ChooseMachine_Msg}"
Margin="20,20,20,2.5"
Style="{StaticResource DialogWindow_TextBlock}"/>
<ComboBox Grid.Row="1"
ItemsSource="{Binding MachineList}"
SelectedItem="{Binding SelMachine}"
DisplayMemberPath="Name"
SelectedValuePath="Name"
Width="160"
HorizontalAlignment="Center"
HorizontalContentAlignment="Center"
Margin="2.5,10,2.5,2.5"
Style="{StaticResource RightPanel_ComboBox}"/>
<Grid Grid.Row="2" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Content="Ok"
Command="{Binding Ok_Command}"
IsDefault="True"
Grid.Column="1"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Content="Cancel"
IsCancel="True"
Grid.Column="3"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</Grid>
<UniformGrid Grid.Row="2"
Rows="1"
Margin="0,20,0,0">
<Button Command="{Binding Ok_Command}"
IsDefault="True"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button IsCancel="True"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Cancel.png"
Style="{StaticResource Button_Image}"/>
</Button>
</UniformGrid>
</Grid>
</Border>
</StackPanel>
</EgtWPFLib5:EgtCustomWindow>
</Grid>
</EgtWPFLib5:EgtMainWindow>
@@ -40,7 +40,7 @@ Public Class ChooseMachineWndVM
Public ReadOnly Property ChooseMachine_Msg As String
Get
Return "Macchina: "
Return "Select the new project machine from the list"
End Get
End Property
@@ -66,7 +66,8 @@ Public Class ChooseMachineWndVM
RaiseEvent m_CloseWindow(True)
Else
' se non seleziono nessuna macchina lo segnalo con un MessageBox
MessageBox.Show("No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
' MessageBox.Show("No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "No machine selected", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
End If
End Sub
+36
View File
@@ -2,9 +2,12 @@
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"
Public Const LAY_PARTREFERENCE = "PartFrame"
Public Const LAY_REFERENCE = "Frame"
Public Const LAY_OTHERS = "Aux"
Public Const LAY_RIBS = "Ribs"
@@ -15,6 +18,8 @@
Public Const RIB_EXTRUSION = "RibExtrusion"
Public Const RIB_CURVE = "RibCurve"
Public Const RIB_ID = "RibId"
Public Const SHELLNUMBER_ID = "ShellNumberId"
Public Const FILLEDSOLID_ID = "FilledSolidId"
Public Const VIEWPARAMS = "ViewParams"
Public Const IMPORTED_SOLID = "ImportedSolid"
Public Const RESULT_READ_PROG = "ResultReadProg"
@@ -85,6 +90,7 @@
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_LEADINTANGDIST = "LeadInTangDist"
@@ -101,6 +107,11 @@
Public Const MAC_G0FEED = "G0Feed"
Public Const MAC_G0FEEDZ = "G0FeedZ"
Public Const MAC_TOOLDIAM = "ToolDiam"
Public Const MAC_PREFLOWDELAY = "PreFlowDelay"
Public Const MAC_POSTFLOWDELAY = "PostFlowDelay"
Public Const MAC_SCREWBACK = "ScrewBack"
Public Const MAC_SLICINGHEIGHT = "SlicingHeight"
Public Const MAC_RIBSSTRANDWIDTH = "RibsStrandW"
Public Const MAC_RIBSTYPE = "RibsType"
Public Const MAC_RIBSOVERLAP = "RibsOverlap"
Public Const MAC_RIBSSTRANDCOUNT = "RibsStrandCount"
@@ -115,19 +126,44 @@
Public Const MAC_RIBSLEADOUTCOASTING = "RibsLeadOutCoasting"
Public Const MAC_RIBSLEADOUTWIPE = "RibsLeadOutWipe"
Public Const MAC_RIBSLEADOUTWIPEDIR = "RibsLeadOutWipeDir"
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"
+1
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"
+5
View File
@@ -26,6 +26,7 @@ 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_SUPPORT As String = "Support"
@@ -105,6 +106,7 @@ Public Module ConstIni
'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 S_PRINTING3D As String = "3dPrinting"
Public Const K_3PRNBASEDIR As String = "BaseDir"
@@ -124,4 +126,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
+35
View File
@@ -0,0 +1,35 @@
'----------------------------------------------------------------------------
' EgalTech 2015-2015
'----------------------------------------------------------------------------
' File : ConstIni.vb Data : 12.02.15 Versione : 1.6b3
' Contenuto : Modulo costanti sezione e chiavi per file Ini.
'
'
'
' Modifiche : 12.02.15 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Public Module ConstMachDataIni
Public Const MACHDATA_INI_FILE_NAME As String = "Data.ini"
Public Const S_TABLE As String = "Table"
Public Const K_DIMX As String = "DimX"
Public Const K_DIMY As String = "DimY"
Public Const K_POSX As String = "PosX"
Public Const K_POSY As String = "PosY"
Public Const K_POSZ As String = "PosZ"
Public Const S_VERTICAL As String = "Vertical"
Public Const S_45DEGX As String = "45DegX"
Public Const S_45DEGY As String = "45DegY"
Public Const S_HORIZONTAL As String = "Horizontal"
Public Const K_MINX As String = "MinX"
Public Const K_MAXX As String = "MaxX"
Public Const K_MINY As String = "MinY"
Public Const K_MAXY As String = "MaxY"
End Module
+3 -25
View File
@@ -1,31 +1,6 @@
Public Module ConstMachIni
Public Const MACH_INI_FILE_NAME As String = "MachData.ini"
Public Const GETWALLDATA_FILE_NAME As String = "GetWallData.lua"
Public Const GETTS3DATA_FILE_NAME As String = "GetTs3Data.lua"
Public Const K_NCTYPE As String = "NCType"
Public Const K_CONNECTIONSTRING As String = "ConnectionString"
Public Const S_CHANNELS As String = "Channels"
Public Const S_PARTPROGRAM As String = "PartProgram"
Public Const S_EXTENSION As String = "Extension"
' Variables della macchina corrente
Public Const S_MAINVARIABLES As String = "MainVariables"
Public Const S_VARIABLES As String = "Variables"
Public Const S_INPUTVARIABLES As String = "InputVariables"
Public Const S_OUTPUTVARIABLES As String = "OutputVariables"
Public Const S_MDI As String = "MDI"
Public Const K_BEAM As String = "Beam"
Public Const K_WALL As String = "Wall"
Public Const K_SCRIPT As String = "Scripts"
Public Const K_SETUP As String = "Setup"
Public Const K_FLOW As String = "Flow"
Public Const TS3DATA_FILE As String = "Ts3Data.lua"
Public Const S_MACHINING As String = "Machining"
Public Const K_MACH_INITSCRIPT As String = "InitScript"
@@ -35,5 +10,8 @@
Public Const K_SLICINGTYPE As String = "SlicingType"
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"
End Module
@@ -1,10 +1,16 @@
<UserControl x:Class="ControllerInputPanelV"
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"
Height="32">
<Border x:Class="ControllerInputPanelV"
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"
Height="38"
Visibility="{Binding Message_Visibility}"
HorizontalAlignment="Left"
Margin="45,0,0,0"
Padding="0"
Style="{StaticResource ViewLayerManager_Border}">
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal"
Margin="2.5">
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Style.Triggers>
@@ -16,31 +22,46 @@
</StackPanel.Style>
<TextBlock Text="{Binding Message}"
Visibility="{Binding Message_Visibility}"
Style="{StaticResource OptionTextBlock}"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource ControllerInput_TextBlock}"/>
<TextBox Text="{Binding Text, UpdateSourceTrigger=PropertyChanged}"
Width="200"
Visibility="{Binding Text_Visibility}" Margin="5,0,5,0"
Width="150"
Visibility="{Binding Text_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ControllerInputPanel_TextBox}">
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding Done_Command, UpdateSourceTrigger=PropertyChanged}"/>
<KeyBinding Key="S" Modifiers="Control" Command="{Binding Show_Command}"/>
</TextBox.InputBindings>
</TextBox>
<CheckBox Content="{Binding CheckBoxText}" IsChecked="{Binding IsChecked}"
Visibility="{Binding Check_Visibility}" Margin="5,0,5,0"
<CheckBox Content="{Binding CheckBoxText}"
IsChecked="{Binding IsChecked}"
Visibility="{Binding Check_Visibility}"
Margin="2.5,0,2.5,0"
VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding ComboItemsList}" SelectedIndex="{Binding ComboSelectedIndex}"
Visibility="{Binding Combo_Visibility}" Margin="5,0,5,0"/>
<Grid Margin="5,0,5,0">
<ComboBox ItemsSource="{Binding ComboItemsList}"
SelectedIndex="{Binding ComboSelectedIndex}"
Visibility="{Binding Combo_Visibility}"
Margin="2.5,0,2.5,0"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Command="{Binding Show_Command}" Visibility="{Binding ShowBtn_Visibility}"
Content="{Binding ShowMsg}" Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Command="{Binding Done_Command}" Visibility="{Binding DoneBtn_Visibility}"
Grid.Column="1"
Content="{Binding OkMsg}" Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Button Command="{Binding Show_Command}"
Visibility="{Binding ShowBtn_Visibility}"
Content="{Binding ShowMsg}"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_Button}"/>
<Button Grid.Column="1"
Command="{Binding Done_Command}"
Visibility="{Binding DoneBtn_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</StackPanel>
</UserControl>
</Border>
+368 -87
View File
@@ -111,6 +111,7 @@ Public Class CurrMachining
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.INFILL, nPartId, m_nIndex, False))
For Each Cathegory In m_CathegoryList
For Each MachiningParam In Cathegory.MachiningParamList
AddHandler MachiningParam.PropertyChanged, AddressOf OnMachiningParamPropertyChanged
@@ -128,6 +129,7 @@ Public Class CurrMachining
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.INFILL, nPartId, m_nIndex, True))
For Each Cathegory In m_CathegoryList
For Each MachiningParam In Cathegory.MachiningParamList
AddHandler MachiningParam.PropertyChanged, AddressOf OnMachiningParamPropertyChanged
@@ -199,73 +201,137 @@ Public Class CurrMachiningCathegory
Select Case m_Type
Case Cathegories.GENERAL
m_sName = "General"
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.SLICINGTYPE, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.SPIRALVASE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDH, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDW, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDCOUNT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.OFFSET, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDOVERLAP, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.STARTPOINTOFFSETONSLICE, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.STRANDORDER, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.DIRECTION, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.FLOORCOUNT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEED, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEEDZ, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.TOOLDIAM, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.DYNAMIC_MODE, nPartId, nIndex, bForceFromDb),
New CurrOrderedMachiningParam(MachiningParam.Params.PRINT_ORDER, nPartId, nIndex, bForceFromDb)})
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.SLICINGTYPE, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.SPIRALVASE, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDH, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDW, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDCOUNT, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.OFFSET, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.STRANDOVERLAP, nPartId, nIndex, bForceFromDb, Me),
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.G0FEED, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.G0FEEDZ, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.LINKZUP, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.TOOLDIAM, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.FLOWRATE_PC, nPartId, nIndex, bForceFromDb, Me),
New CurrComboMachiningParam(MachiningParam.Params.DYNAMIC_MODE, nPartId, nIndex, bForceFromDb, Me),
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.SLICINGHEIGHT, nPartId, nIndex, bForceFromDb, Me)})
Case Cathegories.LINK
m_sName = "Shell"
m_MachiningParamList = New List(Of MachiningParam)({New CurrComboMachiningParam(MachiningParam.Params.LINKTYPE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LINKPARAM, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LINKZUP, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.LEADIN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LEADINTANGDIST, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LEADINORTHODIST, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.OFFSETLEADPOINT, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.LEADOUT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTTANGDIST, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.LEADOUTORTHODIST, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGLEN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.COASTINGFEED_PC, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.WIPELEN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.WIPEFEED_PC, nPartId, nIndex, bForceFromDb)})
'New CurrNumericMachiningParam(MachiningParam.Params.WIPEDIR, nPartId, nIndex, bForceFromDb)})
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 CurrNumericMachiningParam(MachiningParam.Params.LEADINTANGDIST, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.LEADINORTHODIST, 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.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),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSOVERLAP, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSSTRANDCOUNT, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLINK, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTORDER, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTDIRECTION, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSINVERTSTRANDORDER, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nPartId, nIndex, bForceFromDb),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTLEN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTCOASTING, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADOUTWIPEDIR, nPartId, nIndex, bForceFromDb)})
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.RIBSSTRANDCOUNT, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLINK, 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),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADININVERT, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.RIBSLEADINLEN, nPartId, nIndex, bForceFromDb, Me),
New CurrCheckMachiningParam(MachiningParam.Params.RIBSLEADOUTINVERT, nPartId, nIndex, bForceFromDb, Me),
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)})
Case Cathegories.SHELL_NUMBER
m_sName = "Reduce Shell Number"
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRDIFFERENCE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRCOASTING, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRWIPE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRWIPEDIR, nPartId, nIndex, bForceFromDb)})
m_MachiningParamList = New List(Of MachiningParam)({New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRDIFFERENCE, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRCOASTING, nPartId, nIndex, bForceFromDb, Me),
New CurrNumericMachiningParam(MachiningParam.Params.SHELLNBRWIPE, nPartId, nIndex, bForceFromDb, Me),
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),
New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSINFILL, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSSTRANDORDER, nPartId, nIndex, bForceFromDb),
New CurrComboMachiningParam(MachiningParam.Params.AUXSOLIDSLINKTYPE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSLINKPARAM, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSCOASTINGLEN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPELEN, nPartId, nIndex, bForceFromDb),
New CurrNumericMachiningParam(MachiningParam.Params.AUXSOLIDSWIPEDIR, nPartId, nIndex, bForceFromDb)})
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
Case Cathegories.LINK
For Each Param In {MachiningParam.Params.LINKTYPE, MachiningParam.Params.LEADIN, MachiningParam.Params.LEADOUT}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
Case Cathegories.RIBS
For Each Param In {MachiningParam.Params.RIBSTYPE}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
Case Cathegories.AUX_SOLID
For Each Param In {MachiningParam.Params.AUXSOLIDSINFILL}
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
@@ -291,13 +357,39 @@ Public Class CurrNumericMachiningParam
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
End Get
Set(value As String)
Dim dTempValue As Double = 0
If m_bIsLen Then
StringToLen(value, m_dValue)
StringToLen(value, dTempValue)
Else
StringToDouble(value, m_dValue)
StringToDouble(value, dTempValue)
End If
If m_bIsActiveMinMax Then
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
@@ -317,8 +409,8 @@ Public Class CurrNumericMachiningParam
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean)
MyBase.New(Type, nIndex)
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean, Cathegory As MachiningCathegory)
MyBase.New(Type, nIndex, Cathegory)
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.STRANDH
@@ -345,6 +437,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
@@ -387,6 +482,21 @@ Public Class CurrNumericMachiningParam
Case Params.TOOLDIAM
bReadFromPart = EgtGetInfo(nPartId, MAC_TOOLDIAM, m_dValue)
m_bIsLen = True
Case Params.PREFLOWDELAY
bReadFromPart = EgtGetInfo(nPartId, MAC_PREFLOWDELAY, m_dValue)
m_bIsLen = True
Case Params.POSTFLOWDELAY
bReadFromPart = EgtGetInfo(nPartId, MAC_POSTFLOWDELAY, m_dValue)
m_bIsLen = True
Case Params.SCREWBACK
bReadFromPart = EgtGetInfo(nPartId, MAC_SCREWBACK, m_dValue)
m_bIsLen = True
Case Params.SLICINGHEIGHT
bReadFromPart = EgtGetInfo(nPartId, MAC_SLICINGHEIGHT, m_dValue)
m_bIsLen = True
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
@@ -420,15 +530,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
@@ -441,27 +575,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.TOOLDIAM, Params.FLOWRATE_PC
Params.G0FEED, Params.G0FEEDZ, Params.LINKZUP, Params.TOOLDIAM, Params.FLOWRATE_PC, Params.PREFLOWDELAY, Params.POSTFLOWDELAY, Params.SCREWBACK, Params.SLICINGHEIGHT
m_DbParam = DbMachining.CathegoryList.FirstOrDefault(Function(y) y.Type = MachiningCathegory.Cathegories.GENERAL).MachiningParamList.FirstOrDefault(Function(z) z.Type = m_Type)
Case Params.LINKPARAM, Params.LINKZUP, 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
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.RIBSSTRANDCOUNT, Params.RIBSLINK, Params.RIBSINVERTORDER, Params.RIBSINVERTDIRECTION,
Params.RIBSLEADININVERT, Params.RIBSLEADINLEN, Params.RIBSLEADOUTINVERT, Params.RIBSLEADOUTLEN, Params.RIBSLEADOUTCOASTING,
Params.RIBSLEADOUTWIPE, Params.RIBSLEADOUTWIPEDIR
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
@@ -500,6 +673,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
@@ -528,6 +703,16 @@ Public Class CurrNumericMachiningParam
EgtSetInfo(nPartId, MAC_G0FEEDZ, sWriteValue)
Case Params.TOOLDIAM
EgtSetInfo(nPartId, MAC_TOOLDIAM, sWriteValue)
Case Params.PREFLOWDELAY
EgtSetInfo(nPartId, MAC_PREFLOWDELAY, sWriteValue)
Case Params.POSTFLOWDELAY
EgtSetInfo(nPartId, MAC_POSTFLOWDELAY, sWriteValue)
Case Params.SCREWBACK
EgtSetInfo(nPartId, MAC_SCREWBACK, sWriteValue)
Case Params.SLICINGHEIGHT
EgtSetInfo(nPartId, MAC_SLICINGHEIGHT, sWriteValue)
Case Params.RIBSSTRANDWIDTH
EgtSetInfo(nPartId, MAC_RIBSSTRANDWIDTH, sWriteValue)
Case Params.RIBSOVERLAP
EgtSetInfo(nPartId, MAC_RIBSOVERLAP, sWriteValue)
Case Params.RIBSSTRANDCOUNT
@@ -550,12 +735,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
@@ -564,6 +765,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
@@ -620,8 +843,8 @@ Public Class CurrStringMachiningParam
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type, nIndex)
Sub New(Type As Params, nIndex As Integer, Cathegory As MachiningCathegory)
MyBase.New(Type, nIndex, Cathegory)
m_sValue = sValue
m_sOrigValue = m_sValue
End Sub
@@ -676,6 +899,11 @@ Public Class CurrComboMachiningParam
m_SelValue = value
NotifyPropertyChanged(NameOf(SelValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
ManageDependencyParam()
' se aggiorno SlicingType
If m_Type = Params.SLICINGTYPE Then
CurrentMachine.UpdateExtrusionArea()
End If
End Set
End Property
@@ -695,8 +923,8 @@ Public Class CurrComboMachiningParam
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean)
MyBase.New(Type, nIndex)
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean, Cathegory As MachiningCathegory)
MyBase.New(Type, nIndex, Cathegory)
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.SLICINGTYPE
@@ -761,9 +989,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)
@@ -786,6 +1019,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
@@ -799,6 +1054,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
@@ -837,6 +1094,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
@@ -847,6 +1110,7 @@ Public Class CurrComboMachiningParam
Friend Overrides Sub ResetParam()
m_SelValue = m_OrigSelValue
NotifyPropertyChanged(NameOf(SelValue))
CurrentMachine.UpdateExtrusionArea()
End Sub
#Region "COMMANDS"
@@ -866,6 +1130,7 @@ Public Class CurrComboMachiningParam
m_SelValue = DbParam.OrigSelValue
NotifyPropertyChanged(NameOf(SelValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
CurrentMachine.UpdateExtrusionArea()
End Sub
#End Region ' ResetParam
@@ -904,8 +1169,8 @@ Public Class CurrCheckMachiningParam
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean)
MyBase.New(Type, nIndex)
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean, Cathegory As MachiningCathegory)
MyBase.New(Type, nIndex, Cathegory)
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.SPIRALVASE
@@ -922,6 +1187,12 @@ Public Class CurrCheckMachiningParam
bReadFromPart = EgtGetInfo(nPartId, MAC_RIBSLEADININVERT, m_bValue)
Case Params.RIBSLEADOUTINVERT
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
@@ -929,8 +1200,12 @@ 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
Case Params.RIBSLINK, 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
@@ -955,6 +1230,12 @@ Public Class CurrCheckMachiningParam
EgtSetInfo(nPartId, MAC_RIBSLEADININVERT, If(m_bValue, 1, 0))
Case Params.RIBSLEADOUTINVERT
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
@@ -1011,8 +1292,8 @@ Public Class CurrOrderedMachiningParam
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean)
MyBase.New(Type, nIndex)
Sub New(Type As Params, nPartId As Integer, nIndex As Integer, bForceFromDb As Boolean, Cathegory As MachiningCathegory)
MyBase.New(Type, nIndex, Cathegory)
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.PRINT_ORDER
@@ -1025,13 +1306,13 @@ Public Class CurrOrderedMachiningParam
Machining.MPAR_PRINT_ORDER.RIB_INTERNAL,
Machining.MPAR_PRINT_ORDER.RIB_SUPPORT})
m_ValueList = New ObservableCollection(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_PRINT_ORDER.SHELL, "Shell"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shells"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infills"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solids"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Ribs"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Ribs"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Ribs"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Ribs")})
New IdNameStruct(Machining.MPAR_PRINT_ORDER.EXTRA_SHELL, "Extra Shell"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.INFILL, "Infill"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.AUX_SOLID, "Filled Solid"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_UNBOUNDED, "Unbounded Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_EXTERNAL, "External Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_INTERNAL, "Internal Rib"),
New IdNameStruct(Machining.MPAR_PRINT_ORDER.RIB_SUPPORT, "Support Rib")})
Dim sValue As String = ""
bReadFromPart = EgtGetInfo(nPartId, MAC_PRINTORDER, sValue)
Value = sValue
@@ -1,17 +1,31 @@
<UserControl x:Class="CurrMachiningPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:PrintApp="clr-namespace:Icarus"
Width="300">
<Border VerticalAlignment="Center"
Style="{StaticResource RightPanel_Border}">
<Grid>
<Grid x:Class="CurrMachiningPanelV"
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:PrintApp="clr-namespace:Icarus"
Width="310"
VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Margin="0,0,0,2.5"
Style="{StaticResource Title_Border}">
<TextBlock Text="CURRENT MACHINING"
Style="{StaticResource Title_TextBlock}"/>
</Border>
<Border Grid.Row="1"
VerticalAlignment="Center"
Margin="0,2.5,0,0"
Style="{StaticResource BottomGrayRow_Border}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
HorizontalScrollBarVisibility="Disabled"
Margin="1,0,0,2.5">
<ItemsControl Grid.Row="1"
ItemsSource="{Binding CurrMachining.CathegoryList}">
<ItemsControl.ItemsPanel>
@@ -27,134 +41,178 @@
<ItemsControl ItemsSource="{Binding MachiningParamList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
<StackPanel Orientation="Vertical"
Margin="0"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type PrintApp:NumericMachiningParam}">
<Grid>
<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}"/>
<TextBox Grid.Column="1"
Text="{Binding sValue}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
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"
Style="{StaticResource ParameterList_TextBox2}"/>
<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Margin="2.5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:ComboMachiningParam}">
<Grid>
<Grid Margin="0,1,2.5,1"
IsEnabled="{Binding bIsActive}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
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}"
HorizontalAlignment="Stretch"/>
HorizontalAlignment="Stretch"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_ComboBox}"/>
<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Margin="2.5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:CheckMachiningParam}">
<Grid>
<Grid Height="22"
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}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
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"
VerticalAlignment="Center"/>
VerticalAlignment="Center"
Margin="2.5,0,0,0"/>
<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Margin="2.5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:MaterialMachiningParam}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"/>
<CheckBox Grid.Column="1"
IsChecked="{Binding bValue}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}">
<Grid>
<Grid Height="22"
Margin="0,1,2.5,1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
VerticalAlignment="Center"/>
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,2.5,0"/>
<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="2.5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}">
<Grid Margin="0,1,2.5,1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<ListBox Grid.Column="1"
ItemsSource="{Binding ValueList}"
SelectedItem="{Binding SelValue}"/>
SelectedItem="{Binding SelValue}"
Margin="2.5,0,2.5,0"/>
<StackPanel Grid.Column="2"
Orientation="Vertical"
VerticalAlignment="Center"
Margin="5,0,0,0">
Margin="2.5,0,0,0">
<Button Content="˄"
Command="{Binding MoveUpOrder_Command}"
Margin="0"
Style="{StaticResource ToolBar_SmallButton}"/>
Command="{Binding MoveUpOrder_Command}"
Margin="0,0,0,2.5"
Style="{StaticResource ToolBar_SmallButton}"/>
<Button Content="˅"
Command="{Binding MoveDownOrder_Command}"
Margin="0"
Style="{StaticResource ToolBar_SmallButton}"/>
Command="{Binding MoveDownOrder_Command}"
Margin="0,2.5,0,2.5"
Style="{StaticResource ToolBar_SmallButton}"/>
<Button Content="&lt;>"
Command="{Binding ResetOrder_Command}"
Margin="0"
Style="{StaticResource ToolBar_SmallButton}"/>
Command="{Binding ResetOrder_Command}"
Margin="0,2.5,0,2.5"
Style="{StaticResource ToolBar_SmallButton}"/>
<Button Content="R"
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="0"
Style="{StaticResource ToolBar_SmallButton}"/>
Command="{Binding ResetParam_Command}"
IsEnabled="{Binding bIsModifiedFromDb}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="0,2.5,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</StackPanel>
</Grid>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl>
</Expander>
@@ -162,17 +220,29 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<UniformGrid Grid.Row="1" Rows="1">
<Button Content="Ok"
Command="{Binding Ok_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Cancel"
Command="{Binding Cancel_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Save in Db"
Command="{Binding SaveInDb_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
<UniformGrid Grid.Row="1"
Rows="1"
Margin="0,2.5,0,0">
<Button Command="{Binding Ok_Command}"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding Cancel_Command}"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Cancel.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding SaveInDb_Command}"
ToolTip="{Binding SaveInDb_ToolTip}"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\CurrMachining\SaveInDb.png"
Style="{StaticResource Button_Image}"/>
</Button>
</UniformGrid>
</Grid>
</Border>
</UserControl>
</Grid>
@@ -18,6 +18,16 @@ Public Class CurrMachiningPanelVM
Map.refTopPanelVM.UpdateCurrMachining()
End Sub
#Region "Tooltip"
Public ReadOnly Property SaveInDb_ToolTip As String
Get
Return "Save in Db"
End Get
End Property
#End Region ' Tooltip
' Definizione comandi
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
@@ -75,6 +85,7 @@ Public Class CurrMachiningPanelVM
If bIsModifiedRibsType Then
Map.refReferencePanelVM.UpdateFramePosition()
Map.refDispositionPanelVM.UpdateZPos()
Map.refSliceManagerVM.UpdateDimensions()
End If
' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY
@@ -0,0 +1,49 @@
<RadioButton x:Class="CheckedImageRadioButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<RadioButton.Resources>
<SolidColorBrush x:Key="RadioButton.MouseOver.Background" Color="White"/>
<SolidColorBrush x:Key="RadioButton.MouseOver.Border" Color="#FF5593FF"/>
<SolidColorBrush x:Key="RadioButton.Pressed.Background" Color="#afcfe9"/>
<SolidColorBrush x:Key="RadioButton.Pressed.Border" Color="#FF3C77DD"/>
<SolidColorBrush x:Key="RadioButton.Disabled.Background" Color="#FFE6E6E6"/>
<SolidColorBrush x:Key="RadioButton.Disabled.Border" Color="#FFBCBCBC"/>
</RadioButton.Resources>
<RadioButton.Template>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Border x:Name="RadioButtonBorder"
CornerRadius="4"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="True">
<Image x:Name="RadioButtonImage"
Source="{Binding ImageSource, RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}"
Stretch="Uniform"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.Disabled.Background}"/>
<Setter Property="BorderBrush" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.Disabled.Border}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="RadioButtonBorder" Value="{StaticResource RadioButton.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Source" TargetName="RadioButtonImage" Value="{Binding CheckedImageSource, RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}"/>
<Setter Property="Background" TargetName="RadioButtonBorder" Value="{StaticResource Icarus_Gray}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</RadioButton.Template>
</RadioButton>
@@ -0,0 +1,25 @@
Public Class CheckedImageRadioButton
Public Shared ReadOnly ImageSourceProperty As DependencyProperty = DependencyProperty.Register("ImageSource", GetType(String), GetType(CheckedImageRadioButton), New FrameworkPropertyMetadata(""))
Public Shadows Property ImageSource As String
Get
Return CStr(MyBase.GetValue(ImageSourceProperty))
End Get
Set(value As String)
MyBase.SetValue(ImageSourceProperty, value)
End Set
End Property
Public Shared ReadOnly CheckedImageSourceProperty As DependencyProperty = DependencyProperty.Register("CheckedImageSource", GetType(String), GetType(CheckedImageRadioButton), New FrameworkPropertyMetadata(""))
Public Shadows Property CheckedImageSource As String
Get
Return CStr(MyBase.GetValue(CheckedImageSourceProperty))
End Get
Set(value As String)
MyBase.SetValue(ImageSourceProperty, value)
End Set
End Property
End Class
@@ -0,0 +1,47 @@
<ToggleButton x:Class="CheckedImageToggleButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ToggleButton.Template>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border Name="ToggleButtonBorder"
CornerRadius="4"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="true">
<Image Name="ToggleButtonImage"
Height="{DynamicResource ToggleButton.Image.Height}"
Width="{DynamicResource ToggleButton.Image.Width}"
Stretch="Uniform"
Source="{Binding ImageSource, RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Button.IsDefaulted" Value="true">
<Setter Property="BorderBrush" TargetName="ToggleButtonBorder" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.Pressed.Background}"/>
<Setter Property="BorderBrush" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.Pressed.Border}"/>
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter Property="Source" TargetName="ToggleButtonImage" Value="{Binding CheckedImageSource, RelativeSource={RelativeSource AncestorType={x:Type ToggleButton}}}"/>
<Setter Property="Background" TargetName="ToggleButtonBorder" Value="{StaticResource Icarus_Gray}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<!--<Setter Property="Background" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.Disabled.Background}"/>-->
<Setter Property="BorderBrush" TargetName="ToggleButtonBorder" Value="{StaticResource Button.NoBackground.Disabled.Border}"/>
<Setter Property="OpacityMask" Value="#54707070"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
@@ -0,0 +1,25 @@
Public Class CheckedImageToggleButton
Public Shared ReadOnly ImageSourceProperty As DependencyProperty = DependencyProperty.Register("ImageSource", GetType(String), GetType(CheckedImageToggleButton), New FrameworkPropertyMetadata(""))
Public Shadows Property ImageSource As String
Get
Return CStr(MyBase.GetValue(ImageSourceProperty))
End Get
Set(value As String)
MyBase.SetValue(ImageSourceProperty, value)
End Set
End Property
Public Shared ReadOnly CheckedImageSourceProperty As DependencyProperty = DependencyProperty.Register("CheckedImageSource", GetType(String), GetType(CheckedImageToggleButton), New FrameworkPropertyMetadata(""))
Public Shadows Property CheckedImageSource As String
Get
Return CStr(MyBase.GetValue(CheckedImageSourceProperty))
End Get
Set(value As String)
MyBase.SetValue(ImageSourceProperty, value)
End Set
End Property
End Class
+41 -40
View File
@@ -1,14 +1,15 @@
<Grid x:Class="DispositionPanelV"
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:PrintApp="clr-namespace:Icarus"
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:PrintApp="clr-namespace:Icarus"
VerticalAlignment="Stretch"
Margin="5">
Margin="5,0,0,0">
<Grid.Resources>
<PrintApp:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@@ -23,20 +24,21 @@
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ToggleButton x:Name="MoveBtn"
Grid.Row="3"
Content="Move"
IsChecked="{Binding bMove_IsChecked}"
Style="{StaticResource ToolBar_TextToggleButton}"/>
Margin="0,0,0,2.5"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border x:Name="PopupBrd"
Grid.Column="1"
Grid.Row="1"
Grid.RowSpan="5"
VerticalAlignment="Center"
Margin="5,0,0,0"
Visibility="{Binding IsChecked, ElementName=MoveBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanelPopup_Border}">
Style="{StaticResource LeftPanel_Popup_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@@ -50,67 +52,65 @@
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="X"
VerticalAlignment="Center"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sXPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox}"/>
Style="{StaticResource Move_TextBlock}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sXPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/>
</Grid>
<Grid Grid.Row="1"
Margin="0,2.5,0,2.5">
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Y"
VerticalAlignment="Center"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sYPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox}"/>
Style="{StaticResource Move_TextBlock}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sYPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/>
</Grid>
<Grid Grid.Row="2"
Margin="0,2.5,0,0">
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Z"
VerticalAlignment="Center"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sZPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox}"/>
Style="{StaticResource Move_TextBlock}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sZPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/>
</Grid>
<Grid Grid.Row="3"
Margin="0,2.5,0,0">
Margin="0,2.5,0,0">
<Button Content="Drag"
Command="{Binding DragMove_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
Command="{Binding DragMove_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</Grid>
</Grid>
</Border>
<ToggleButton x:Name="RotateBtn"
Grid.Row="4"
Content="Rotate"
IsChecked="{Binding bRotate_IsChecked}"
Style="{StaticResource ToolBar_TextToggleButton}"/>
Margin="0,2.5,0,0"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="2"
Grid.RowSpan="5"
VerticalAlignment="Center"
Margin="5,0,0,0"
Visibility="{Binding IsChecked, ElementName=RotateBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanelPopup_Border}">
Style="{StaticResource LeftPanel_Popup_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<UniformGrid Columns="3">
<RadioButton Content="X"
@@ -126,14 +126,15 @@
IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid>
<EgtWPFLib5:EgtTextBox Grid.Row="1"
Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}"
Margin="0,5,0,0"/>
<EgtWPFLib5:EgtTextBox2 Grid.Row="1"
Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}"
ResetValueOnLostFocus="False"
Margin="0,5,0,2.5"/>
<Grid Grid.Row="2"
Margin="0,2.5,0,0">
Margin="0,2.5,0,0">
<Button Content="Drag"
Command="{Binding DragRotate_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
Command="{Binding DragRotate_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</Grid>
</Grid>
</Border>
+3 -23
View File
@@ -87,7 +87,7 @@ Public Class DispositionPanelVM
Get
If Not IsNothing(Map.refTopPanelVM.SelPart) Then
Dim ptReference As New Point3d
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference)
Return LenToString(ptReference.z, 1)
Else
Return ""
@@ -95,7 +95,7 @@ Public Class DispositionPanelVM
End Get
Set(value As String)
Dim ptReference As New Point3d
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewZPos As Double = ptReference.z
StringToLen(value, dNewZPos)
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
@@ -118,7 +118,7 @@ Public Class DispositionPanelVM
Friend Sub UpdateZPos()
Dim ptReference As New Point3d
EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference)
EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference)
Dim dNewZPos As Double = ptReference.z
Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart)
Dim dMin As Double = 0
@@ -395,26 +395,6 @@ Public Class DispositionPanelVM
End Class
Public Class CenterToolTipConverter
Implements IMultiValueConverter
Public Function Convert(ByVal values As Object(), ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IMultiValueConverter.Convert
For Each value In values
If TypeOf (value) IsNot Double Then
Return Double.NaN
End If
Next
Dim placementTargetHeight As Double = CDbl(values(0))
Dim toolTipHeight As Double = CDbl(values(1))
Return (placementTargetHeight / 2.0) - (toolTipHeight / 2.0)
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetTypes As Type(), ByVal parameter As Object, ByVal culture As CultureInfo) As Object() Implements IMultiValueConverter.ConvertBack
Throw New NotSupportedException()
End Function
End Class
Public Class FromBooleanToVisibility
Implements IValueConverter
+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,426 @@
<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"
Margin="5,5,5,10"
ItemsSource="{Binding SelTreeItem.FolderList, Mode=TwoWay}"
SelectedItem="{Binding ItemSelected}"
ColumnHeaderStyle="{StaticResource EgtManageFile_DataGridColumnHeader}">
<DataGrid.Columns>
<!--<DataGridTemplateColumn Width="SizeToCells">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding sIconSource}"
Height="15"
Style="{StaticResource Button_Image}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
<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.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>
</DataGridTemplateColumn.ElementStyle>-->
</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.RowStyle>
<Style TargetType="DataGridRow" BasedOn="{StaticResource RowDataGrid_CustomHighLight}"/>
</DataGrid.RowStyle>
<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}"
Style="{StaticResource ParameterList_TextBox}"/>
<ComboBox Grid.Column="2"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding FilterList}"
SelectedItem="{Binding SelFilter}"
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,104 @@
Imports System.Windows.Forms
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 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
#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 MessageBoxResult) 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,882 @@
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Windows.Forms
Imports EgtWPFLib5
Imports EgtUILib
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_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, .sNameExstension = FilterListSplit(i), .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
m_sSaveFileName = "New.icrs"
m_sSelPath = m_sInitialDirectory
Dim DirectoryStart As String() = m_sInitialDirectory.Split("\"c)
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 = 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 String
Get
Return m_nSelTempleteListView
End Get
Set(value As String)
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 MessageBoxResult)
#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)
If nMode = ModeTypes.FILE Then
If Not IsNothing(CurrItem) Then
m_sFileName = m_SelTreeItem.sFullName
Else
m_sFileName = m_SelTreeItem.sFullName & "\" & m_sSaveFileName
End If
ElseIf nMode = ModeTypes.FOLDER Then
m_sFileName = m_SelTreeItem.sFullName
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
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>
+107
View File
@@ -0,0 +1,107 @@
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.m_CloseWindow
Me.DialogResult = DialogResult
Me.Close()
End Sub
#End Region
End Class
+236
View File
@@ -0,0 +1,236 @@
Imports EgtUILib
Imports EgtWPFLib5
Public Class EgtMessageBoxVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Friend Event m_CloseWindow(DialogResult As MessageBoxResult)
Private m_sTitle As String = ""
Public ReadOnly Property sTitle As String
Get
Return m_sTitle
End Get
End Property
Private m_sMessage As String = ""
Public ReadOnly Property sMessage As String
Get
Return m_sMessage
End Get
End Property
Private m_Button As MessageBoxButton
Private m_Icon As MessageBoxImage
Public ReadOnly Property sIconSource As String
Get
Select Case m_Icon
Case MessageBoxImage.Hand
Return "\Resources\EgtMessageBox\Error.png"
Case MessageBoxImage.Question
Return "\Resources\EgtMessageBox\Question.png"
Case MessageBoxImage.Exclamation
Return "\Resources\EgtMessageBox\Warning.png"
Case MessageBoxImage.Asterisk
Return "\Resources\EgtMessageBox\Information.png"
Case MessageBoxImage.Stop
Return "\Resources\EgtMessageBox\Error.png"
Case MessageBoxImage.Error
Return "\Resources\EgtMessageBox\Error.png"
Case MessageBoxImage.Warning
Return "\Resources\EgtMessageBox\Warning.png"
Case MessageBoxImage.Information
Return "\Resources\EgtMessageBox\Information.png"
Case Else ' MessageBoxImage.None
Return ""
End Select
End Get
End Property
Private m_ButtonList As New List(Of EgtMsgBoxButton)
Public Property ButtonList As List(Of EgtMsgBoxButton)
Get
Return m_ButtonList
End Get
Set(value As List(Of EgtMsgBoxButton))
m_ButtonList = value
End Set
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New(sMessageBoxText As String)
EgtMsgBoxButton.SetOwner(Me)
m_sMessage = sMessageBoxText
m_Button = MessageBoxButton.OK
m_Icon = MessageBoxImage.None
NotifyPropertyChanged(NameOf(ButtonList))
NotifyPropertyChanged(NameOf(sIconSource))
End Sub
Sub New(sMessageBoxText As String, sCaption As String)
MyClass.New(sMessageBoxText)
m_sTitle = sCaption
End Sub
Sub New(sMessageBoxText As String, sCaption As String, Button As MessageBoxButton)
MyClass.New(sMessageBoxText, sCaption)
m_Button = Button
Select Case m_Button
Case MessageBoxButton.OK
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.OK))
Case MessageBoxButton.OKCancel
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.OK))
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.CANCEL))
Case MessageBoxButton.YesNoCancel
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.YES))
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.NO))
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.CANCEL))
Case MessageBoxButton.YesNo
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.YES))
m_ButtonList.Add(New EgtMsgBoxButton(EgtMsgBoxButton.Types.NO))
End Select
NotifyPropertyChanged(NameOf(ButtonList))
End Sub
Sub New(sMessageBoxText As String, sCaption As String, Button As MessageBoxButton, Icon As MessageBoxImage)
MyClass.New(sMessageBoxText, sCaption, Button)
m_Icon = Icon
NotifyPropertyChanged(NameOf(sIconSource))
End Sub
Sub New(sMessageBoxText As String, sCaption As String, Button As MessageBoxButton, Icon As MessageBoxImage, DefaultResult As MessageBoxResult)
MyClass.New(sMessageBoxText, sCaption, Button, Icon)
Dim DefaultBtn As EgtMsgBoxButton = m_ButtonList.FirstOrDefault(Function(x) (x.Type = EgtMsgBoxButton.Types.OK AndAlso DefaultResult = MessageBoxResult.OK) OrElse
(x.Type = EgtMsgBoxButton.Types.CANCEL AndAlso DefaultResult = MessageBoxResult.Cancel) OrElse
(x.Type = EgtMsgBoxButton.Types.YES AndAlso DefaultResult = MessageBoxResult.Yes) OrElse
(x.Type = EgtMsgBoxButton.Types.NO AndAlso DefaultResult = MessageBoxResult.No))
If Not IsNothing(DefaultBtn) Then
DefaultBtn.SetIsDefault(True)
End If
NotifyPropertyChanged(NameOf(ButtonList))
End Sub
#End Region ' CONTRUCTORS
#Region "METHODS"
Friend Sub CloseWindow(DialogResult As MessageBoxResult)
RaiseEvent m_CloseWindow(DialogResult)
End Sub
#End Region ' METHODS
End Class
Public Class EgtMsgBoxButton
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Public Enum Types As Integer
OK = 1
CANCEL = 2
YES = 3
NO = 4
End Enum
Private Shared Owner As EgtMessageBoxVM
Private m_Type As Types
Public ReadOnly Property Type As Types
Get
Return m_Type
End Get
End Property
Private m_sMessage As String
Public ReadOnly Property sMessage As String
Get
Return m_sMessage
End Get
End Property
Private m_bIsDefault As Boolean = False
Public ReadOnly Property bIsDefault As Boolean
Get
Return m_bIsDefault
End Get
End Property
Friend Sub SetIsDefault(bValue As Boolean)
m_bIsDefault = bValue
End Sub
' Definizione comandi
Private m_cmdCommand As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONTRUCTORS"
Sub New(Type As Types)
m_Type = Type
Select Case m_Type
Case Types.OK
m_sMessage = EgtMsg(35001)
Case Types.CANCEL
m_sMessage = EgtMsg(35002)
Case Types.YES
m_sMessage = EgtMsg(35003)
Case Types.NO
m_sMessage = EgtMsg(35004)
End Select
End Sub
Sub New(Type As Types, bIsDefault As Boolean)
MyClass.New(Type)
m_bIsDefault = bIsDefault
End Sub
#End Region ' CONTRUCTORS
#Region "METHODS"
Friend Shared Sub SetOwner(value As EgtMessageBoxVM)
Owner = value
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "Command"
Public ReadOnly Property Command_Command As ICommand
Get
If m_cmdCommand Is Nothing Then
m_cmdCommand = New Command(AddressOf Command)
End If
Return m_cmdCommand
End Get
End Property
Public Sub Command()
Select Case m_Type
Case Types.OK
Owner.CloseWindow(MessageBoxResult.OK)
Case Types.CANCEL
Owner.CloseWindow(MessageBoxResult.Cancel)
Case Types.YES
Owner.CloseWindow(MessageBoxResult.Yes)
Case Types.NO
Owner.CloseWindow(MessageBoxResult.No)
End Select
End Sub
#End Region ' Command
#End Region ' COMMANDS
End Class
@@ -0,0 +1,361 @@
<Grid x:Class="FilledSolidPanelV"
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:PrintApp="clr-namespace:Icarus"
Margin="5">
<Grid.Resources>
<PrintApp:FromBooleanToVisibility x:Key="FromBooleanToVisibility"/>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="{Binding ActualHeight, ElementName=MoveBtn}"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ComboBox Grid.Row="3"
ItemsSource="{Binding FilledSolidList}"
SelectedItem="{Binding SelFilledSolid}"
IsEnabled="{Binding FilledSolidList_IsEnabled}"
DisplayMemberPath="ghName"
Style="{StaticResource LeftPanel_ComboBox}"/>
<!--Add Button-->
<ToggleButton x:Name="AddBtn"
Grid.Row="4"
Content="Add"
IsChecked="{Binding bAdd_IsChecked}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="3"
Grid.RowSpan="3"
VerticalAlignment="Center"
Visibility="{Binding IsChecked, ElementName=AddBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_PopupButton_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
Command="{Binding Import_Command}"
ToolTip="{Binding Import_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/Import.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="1"
Command="{Binding Line2P_Command}"
ToolTip="{Binding Line2P_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/Line2P.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</Border>
<!--Edit Button-->
<ToggleButton x:Name="EditBtn"
Grid.Row="5"
Content="Edit"
IsChecked="{Binding bEdit_IsChecked}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="4"
Grid.RowSpan="3"
VerticalAlignment="Center"
Visibility="{Binding IsChecked, ElementName=EditBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_PopupButton_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
Command="{Binding Delete_Command}"
ToolTip="{Binding Delete_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/Delete.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="1"
Command="{Binding ModifyCurve_Command}"
ToolTip="{Binding ModifyCurve_ToolTip}"
Visibility="{Binding Compo_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/ModifyCurve.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="2"
Command="{Binding AddPointCurve_Command}"
ToolTip="{Binding AddPointCurve_ToolTip}"
Visibility="{Binding Compo_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/AddPointCurve.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="3"
Command="{Binding RemovePointCurve_Command}"
ToolTip="{Binding RemovePointCurve_ToolTip}"
Visibility="{Binding Compo_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/RemovePointCurve.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="4"
Command="{Binding Extrude_Command}"
ToolTip="{Binding Extrude_ToolTip}"
Visibility="{Binding Compo_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/DrawPanel/Extrude.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</Border>
<!--Grid Button-->
<ToggleButton x:Name="GridBtn"
Grid.Row="6"
Content="Grid"
IsChecked="{Binding bGrid_IsChecked}"
IsEnabled="{Binding bGrid_IsEnabled}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="5"
Grid.RowSpan="3"
VerticalAlignment="Center"
Visibility="{Binding IsChecked, ElementName=GridBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_PopupButton_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Command="{Binding CPlaneTop_Command}"
ToolTip="{Binding CPlaneTop_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneTOP.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="1"
Command="{Binding CPlaneFront_Command}"
ToolTip="{Binding CPlaneFront_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneFRONT.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="2"
Command="{Binding CPlaneRight_Command}"
ToolTip="{Binding CPlaneRight_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneRIGHT.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="3"
Command="{Binding CPlaneBack_Command}"
ToolTip="{Binding CPlaneBack_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneBACK.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="4"
Command="{Binding CPlaneLeft_Command}"
ToolTip="{Binding CPlaneLeft_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneLEFT.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="5"
Command="{Binding CPlaneBottom_Command}"
ToolTip="{Binding CPlaneBottom_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneBOTTOM.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="6"
Command="{Binding CPlaneElevation_Command}"
ToolTip="{Binding CPlaneElevation_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneELEVATION.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="7"
Command="{Binding CPlaneOrigin_Command}"
ToolTip="{Binding CPlaneOrigin_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CPlaneORIGIN.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="8"
Command="{Binding CPlaneObj_Command}"
ToolTip="{Binding CPlaneObj_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/GridViewPanel/CplaneOBJECT.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</Border>
<!--Move Button-->
<ToggleButton x:Name="MoveBtn"
Grid.Row="7"
Content="Move"
IsChecked="{Binding bMove_IsChecked}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="5"
Grid.RowSpan="5"
VerticalAlignment="Center"
Visibility="{Binding IsChecked, ElementName=MoveBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_Popup_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Margin="0,0,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="X"
Style="{StaticResource Move_TextBlock}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sXPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/>
</Grid>
<Grid Grid.Row="1"
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Y"
Style="{StaticResource Move_TextBlock}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sYPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/>
</Grid>
<Grid Grid.Row="2"
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="Z"
Style="{StaticResource Move_TextBlock}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding sZPos, UpdateSourceTrigger=Explicit}"
Grid.Column="1"
Margin="5,0,0,0"
Style="{StaticResource LeftPanel_TextBox2}"/>
</Grid>
<Grid Grid.Row="3"
Margin="0,2.5,0,0">
<Button Content="Drag"
Command="{Binding DragMove_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</Grid>
</Grid>
</Border>
<!--Rotate Button-->
<ToggleButton x:Name="RotateBtn"
Grid.Row="8"
Content="Rotate"
IsChecked="{Binding bRotate_IsChecked}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_ToggleButton}"/>
<Border Grid.Column="1"
Grid.Row="6"
Grid.RowSpan="5"
VerticalAlignment="Center"
Visibility="{Binding IsChecked, ElementName=RotateBtn, Converter={StaticResource FromBooleanToVisibility}}"
Style="{StaticResource LeftPanel_Popup_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<UniformGrid Columns="3">
<RadioButton Content="X"
GroupName="Axes"
IsChecked="{Binding RotX}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Y"
GroupName="Axes"
IsChecked="{Binding RotY}"
Style="{StaticResource ToolBar_ToggleButton}"/>
<RadioButton Content="Z"
GroupName="Axes"
IsChecked="{Binding RotZ}"
Style="{StaticResource ToolBar_ToggleButton}"/>
</UniformGrid>
<EgtWPFLib5:EgtTextBox2 Grid.Row="1"
Text="{Binding sRotAngle, UpdateSourceTrigger=Explicit}"
ResetValueOnLostFocus="False"
Margin="0,5,0,2.5"/>
<Grid Grid.Row="2"
Margin="0,2.5,0,0">
<Button Content="Drag"
Command="{Binding DragRotate_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</Grid>
</Grid>
</Border>
<!--Parameters Button-->
<ToggleButton Content="Parameters"
Grid.Row="9"
IsChecked="{Binding bMachParam_IsChecked}"
Margin="0,2.5,0,2.5"
Style="{StaticResource LeftPanel_Parameters_ToggleButton}"/>
</Grid>
@@ -0,0 +1,3 @@
Public Class FilledSolidPanelV
End Class
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,135 @@
<Grid x:Class="FilledSolidParamPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:PrintApp="clr-namespace:Icarus"
Width="310"
VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Margin="0,0,0,2.5"
Style="{StaticResource Title_Border}">
<TextBlock Text="REDUCE SHELL NUMBER PARAMETERS"
Style="{StaticResource Title_TextBlock}"/>
</Border>
<Border Grid.Row="1"
Padding="0,2.5,0,0"
Margin="0,2.5,0,0"
Style="{StaticResource BottomGrayRow_Border}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl ItemsSource="{Binding MachiningParamList}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="1"
HorizontalAlignment="Stretch"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type PrintApp:NumericMachiningParam}">
<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}"/>
<TextBox Grid.Column="1"
Text="{Binding sValue}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ParameterList_TextBox}"/>
<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>
<DataTemplate DataType="{x:Type PrintApp:ComboMachiningParam}">
<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}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding ValueList}"
SelectedItem="{Binding SelValue}"
HorizontalAlignment="Stretch"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_ComboBox}"/>
<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>
<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>
<UniformGrid Grid.Row="1"
Rows="1"
Margin="0,2.5,0,0">
<Button Command="{Binding Ok_Command}"
IsDefault="True"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding Cancel_Command}"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Cancel.png"
Style="{StaticResource Button_Image}"/>
</Button>
</UniformGrid>
</Grid>
</Border>
</Grid>
@@ -0,0 +1,3 @@
Public Class FilledSolidParamPanelV
End Class
@@ -0,0 +1,635 @@
Imports System.Collections.ObjectModel
Imports System.Reflection
Imports EgtUILib
Imports EgtWPFLib5
Public Class FilledSolidParamPanelVM
Inherits MachiningCathegory
#Region "FIELDS & PROPERTIES"
' Definizione comandi
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTORS"
Sub New()
' Creo riferimento a questa classe in EgtCAM5Map
Map.SetRefFilledSolidParamPanelVM(Me)
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Friend Sub Init()
If IsNothing(Map.refFilledSolidPanelVM.SelFilledSolid) Then
' ripristino modalita' standard
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
Return
End If
Dim nPartId As Integer = Map.refTopPanelVM.SelPart.nPartId
Dim nFilledSolidId As Integer = GDB_ID.NULL
Select Case Map.refFilledSolidPanelVM.SelFilledSolid.Type
Case RibEntity.RibTypes.FROMDRAW
nFilledSolidId = Map.refFilledSolidPanelVM.SelFilledSolid.nCurveId
Case RibEntity.RibTypes.FROMIMPORT
nFilledSolidId = Map.refFilledSolidPanelVM.SelFilledSolid.nExtrusionId
End Select
m_Type = Cathegories.AUX_SOLID
m_sName = "Filled Solid"
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)})
NotifyPropertyChanged(NameOf(MachiningParamList))
NotifyPropertyChanged(NameOf(sName))
' verifico dipendenze tra parametri
Select Case m_Type
Case Cathegories.AUX_SOLID
For Each Param In {MachiningParam.Params.AUXSOLIDSINFILL}
Dim MachiningParam As ComboMachiningParam = MachiningParamList.FirstOrDefault(Function(z) z.Type = Param)
MachiningParam.ManageDependencyParam()
Next
End Select
End Sub
Friend Sub SaveCurrParams()
For Each Param In m_MachiningParamList
Param.SaveParam()
Next
End Sub
Friend Sub ResetCurrParams()
For Each Param In m_MachiningParamList
Param.ResetParam()
Next
End Sub
Friend Sub WriteParamsInFilledSolid(nRibId As Integer)
' se parametri modificati
Dim bModified As Boolean = False
For Each Param In m_MachiningParamList
Select Case Param.GetType()
Case GetType(FilledSolidNumericMachiningParam)
Dim NumericParam As FilledSolidNumericMachiningParam = TryCast(Param, FilledSolidNumericMachiningParam)
If NumericParam.bIsModified AndAlso Not bModified Then bModified = True
NumericParam.WriteParamInFilledSolid(nRibId)
Case GetType(FilledSolidComboMachiningParam)
Dim NumericParam As FilledSolidComboMachiningParam = TryCast(Param, FilledSolidComboMachiningParam)
If NumericParam.bIsModified AndAlso Not bModified Then bModified = True
NumericParam.WriteParamInFilledSolid(nRibId)
End Select
Next
If bModified Then
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End If
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
If Not IsNothing(Map.refFilledSolidPanelVM.SelFilledSolid) Then
' scrivo i parametri modificati
Select Case Map.refFilledSolidPanelVM.SelFilledSolid.Type
Case FilledSolidEntity.FilledSolidTypes.FROMDRAW
WriteParamsInFilledSolid(Map.refFilledSolidPanelVM.SelFilledSolid.nCurveId)
WriteParamsInFilledSolid(Map.refFilledSolidPanelVM.SelFilledSolid.nExtrusionId)
Case FilledSolidEntity.FilledSolidTypes.FROMIMPORT
WriteParamsInFilledSolid(Map.refFilledSolidPanelVM.SelFilledSolid.nExtrusionId)
End Select
End If
' ripristino modalita' standard
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
Map.refFilledSolidPanelVM.ResetMachParamIsChecked()
End Sub
#End Region ' Ok
#Region "Cancel"
Public ReadOnly Property Cancel_Command As ICommand
Get
If m_cmdCancel Is Nothing Then
m_cmdCancel = New Command(AddressOf Cancel)
End If
Return m_cmdCancel
End Get
End Property
Public Sub Cancel()
' ripristino modalita' standard
Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
Map.refFilledSolidPanelVM.ResetMachParamIsChecked()
End Sub
#End Region ' Cancel
#End Region ' COMMANDS
End Class
Public Class FilledSolidNumericMachiningParam
Inherits NumericMachiningParam
Public Overrides Property sValue As String
Get
Return If(m_bIsLen, LenToString(m_dValue, 1), m_dValue)
End Get
Set(value As String)
If m_bIsLen Then
StringToLen(value, m_dValue)
Else
m_dValue = value
End If
NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Set
End Property
Private m_dPartValue As Double
Public ReadOnly Property dPartValue As Double
Get
Return m_dPartValue
End Get
End Property
Public ReadOnly Property bIsModifiedFromPart As Boolean
Get
Return m_dValue <> m_dPartValue
End Get
End Property
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nFilledSolidId As Integer, nPartId As Integer, Cathegory As MachiningCathegory)
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)
m_bIsLen = True
Case Params.AUXSOLIDSLINKPARAM
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSLINKPARAM, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSLINKPARAM, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE
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)
m_bIsLen = True
Case Params.AUXSOLIDSWIPELEN
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSWIPELEN, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSWIPELEN, m_dPartValue)
m_bIsLen = True
Case Params.AUXSOLIDSWIPEDIR
bReadFromPart = EgtGetInfo(nFilledSolidId, MAC_AUXSOLIDSWIPEDIR, m_dValue)
EgtGetInfo(nPartId, MAC_AUXSOLIDSWIPEDIR, m_dPartValue)
m_bIsLen = True
End Select
m_dOrigValue = m_dValue
If Not bReadFromPart Then
m_dValue = m_dPartValue
m_dOrigValue = m_dPartValue
End If
End Sub
Friend Sub WriteParamInFilledSolid(nFilledSolidId As Integer)
Dim sWriteValue As String = ""
If m_bIsLen Then
sWriteValue = LenToString(m_dValue, 2)
Else
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)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSOVERLAP)
End If
Case Params.AUXSOLIDSLINKPARAM
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSLINKPARAM, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSLINKPARAM)
End If
Case Params.AUXSOLIDSSTARTPOINTOFFSETONSLICE
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSSTARTPOINTOFFSETONSLICE, sWriteValue)
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)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSCOASTINGLEN)
End If
Case Params.AUXSOLIDSWIPELEN
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSWIPELEN, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSWIPELEN)
End If
Case Params.AUXSOLIDSWIPEDIR
If bIsModifiedFromPart Then
EgtSetInfo(nFilledSolidId, MAC_AUXSOLIDSWIPEDIR, sWriteValue)
Else
EgtRemoveInfo(nFilledSolidId, MAC_AUXSOLIDSWIPEDIR)
End If
End Select
End Sub
Friend Overrides Sub SaveParam()
m_dOrigValue = m_dValue
End Sub
Friend Overrides Sub ResetParam()
m_dValue = m_dOrigValue
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_dValue = m_dPartValue
NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Sub
#End Region ' ResetParam
#End Region ' COMMANDS
End Class
Public Class FilledSolidComboMachiningParam
Inherits ComboMachiningParam
Public Overrides Property SelValue As IdNameStruct
Get
Return m_SelValue
End Get
Set(value As IdNameStruct)
m_SelValue = value
NotifyPropertyChanged(NameOf(SelValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
ManageDependencyParam()
End Set
End Property
Protected m_PartSelValue As IdNameStruct
Public ReadOnly Property PartSelValue As IdNameStruct
Get
Return m_PartSelValue
End Get
End Property
Public ReadOnly Property bIsModifiedFromPart As Boolean
Get
Return m_SelValue.Id <> m_PartSelValue.Id
End Get
End Property
' Definizione comandi
Private m_cmdResetParam As ICommand
Sub New(Type As Params, nRibId As Integer, nPartId As Integer, Cathegory As MachiningCathegory)
MyBase.New(Type, Cathegory)
Dim bReadFromRib As Boolean = False
Dim bReadFromPart As Boolean = False
Select Case Type
Case Params.AUXSOLIDSINFILL
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
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
End If
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSINFILL, nSelValue)
m_PartSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
Case Params.AUXSOLIDSSTRANDORDER
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_STRANDORDERS.OUTTOIN, "From Outside To Inside"),
New IdNameStruct(Machining.MPAR_STRANDORDERS.INTOOUT, "From Inside To Outside")})
Dim nSelValue As Integer = 1
bReadFromRib = EgtGetInfo(nRibId, MAC_AUXSOLIDSSTRANDORDER, nSelValue)
If bReadFromRib Then
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
End If
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSSTRANDORDER, nSelValue)
m_PartSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
Case Params.AUXSOLIDSLINKTYPE
m_ValueList = New List(Of IdNameStruct)({New IdNameStruct(Machining.MPAR_LINKTYPES.NONE, "None"),
New IdNameStruct(Machining.MPAR_LINKTYPES.LINEAR, "Linear"),
New IdNameStruct(Machining.MPAR_LINKTYPES.BIARC, "Biarc")})
Dim nSelValue As Integer = 1
bReadFromRib = EgtGetInfo(nRibId, MAC_AUXSOLIDSLINKTYPE, nSelValue)
If bReadFromRib Then
m_SelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
End If
bReadFromPart = EgtGetInfo(nPartId, MAC_AUXSOLIDSLINKTYPE, nSelValue)
m_PartSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = nSelValue)
End Select
m_OrigSelValue = m_SelValue
If Not bReadFromRib Then
If bReadFromPart Then
m_SelValue = m_PartSelValue
m_OrigSelValue = m_PartSelValue
Else
Select Case Type
Case Params.AUXSOLIDSINFILL
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)
m_SelValue = m_OrigSelValue
Case Params.AUXSOLIDSLINKTYPE
m_OrigSelValue = m_ValueList.FirstOrDefault(Function(x) x.Id = Machining.MPAR_LINKTYPES.NONE)
m_SelValue = m_OrigSelValue
End Select
End If
End If
End Sub
Friend Sub WriteParamInFilledSolid(nRibId As Integer)
Select Case Type
Case Params.AUXSOLIDSINFILL
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_AUXSOLIDSINFILL, m_SelValue.Id)
Else
EgtRemoveInfo(nRibId, MAC_AUXSOLIDSINFILL)
End If
Case Params.AUXSOLIDSSTRANDORDER
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_AUXSOLIDSSTRANDORDER, m_SelValue.Id)
Else
EgtRemoveInfo(nRibId, MAC_AUXSOLIDSSTRANDORDER)
End If
Case Params.AUXSOLIDSLINKTYPE
If bIsModifiedFromPart Then
EgtSetInfo(nRibId, MAC_AUXSOLIDSLINKTYPE, m_SelValue.Id)
Else
EgtRemoveInfo(nRibId, MAC_AUXSOLIDSLINKTYPE)
End If
End Select
End Sub
Friend Overrides Sub SaveParam()
m_OrigSelValue = m_SelValue
End Sub
Friend Overrides Sub ResetParam()
m_SelValue = m_OrigSelValue
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_SelValue = m_PartSelValue
NotifyPropertyChanged(NameOf(SelValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
End Sub
#End Region ' ResetParam
#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
+247 -32
View File
@@ -87,6 +87,7 @@
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<HintPath>..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework.Aero2" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
@@ -112,20 +113,18 @@
<Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb">
<DependentUpon>AboutBoxV.xaml</DependentUpon>
</Compile>
<Compile Include="AttachedProperties\TreeViewItemHelper.vb" />
<Compile Include="ChooseMachineWnd\ChooseMachineWndV.xaml.vb">
<DependentUpon>ChooseMachineWndV.xaml</DependentUpon>
</Compile>
<Compile Include="ChooseMachineWnd\ChooseMachineWndVM.vb" />
<Compile Include="ChooseReferenceWnd\ChooseReferenceWndV.xaml.vb">
<DependentUpon>ChooseReferenceWndV.xaml</DependentUpon>
</Compile>
<Compile Include="ChooseReferenceWnd\ChooseReferenceWndVM.vb" />
<Compile Include="Constants\Const3dPrint.vb" />
<Compile Include="Constants\ConstBeam.vb" />
<Compile Include="Constants\ConstColumns.vb" />
<Compile Include="Constants\ConstDataGridColumnsIni.vb" />
<Compile Include="Constants\ConstDims.vb" />
<Compile Include="Constants\ConstGen.vb" />
<Compile Include="Constants\ConstMachDataIni.vb" />
<Compile Include="Constants\ConstIni.vb" />
<Compile Include="Constants\ConstMachComm.vb" />
<Compile Include="Constants\ConstMachIni.vb" />
@@ -138,6 +137,12 @@
<DependentUpon>CurrLayerSliderV.xaml</DependentUpon>
</Compile>
<Compile Include="CurrLayerSlider\CurrLayerSliderVM.vb" />
<Compile Include="CustomControls\CheckedImageRadioButton.xaml.vb">
<DependentUpon>CheckedImageRadioButton.xaml</DependentUpon>
</Compile>
<Compile Include="CustomControls\CheckedImageToggleButton.xaml.vb">
<DependentUpon>CheckedImageToggleButton.xaml</DependentUpon>
</Compile>
<Compile Include="DataGridMultiselectManaging\IListItemConverter.vb" />
<Compile Include="DataGridMultiselectManaging\MultiSelectorBehaviours.vb" />
<Compile Include="DataGridMultiselectManaging\TwoListSynchronizer.vb" />
@@ -145,10 +150,34 @@
<DependentUpon>DispositionPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="DispositionPanel\DispositionPanelVM.vb" />
<Compile Include="EgtMessageBox\EgtMessageBoxV.xaml.vb">
<DependentUpon>EgtMessageBoxV.xaml</DependentUpon>
</Compile>
<Compile Include="EgtMessageBox\EgtMessageBoxVM.vb" />
<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="EgtManageFileDialog\EgtManageFileDialogVM.vb" />
<Compile Include="FilledSolidPanel\FilledSolidPanelV.xaml.vb">
<DependentUpon>FilledSolidPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="FilledSolidPanel\FilledSolidPanelVM.vb" />
<Compile Include="FilledSolidParamPanel\FilledSolidParamPanelV.xaml.vb">
<DependentUpon>FilledSolidParamPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="FilledSolidParamPanel\FilledSolidParamPanelVM.vb" />
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml.vb">
<DependentUpon>ImportExportMachiningPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="ImportExportMachiningPanel\ImportExportMachiningPanelVM.vb" />
<Compile Include="ImportLoadingWnd\ImportLoadingWndV.xaml.vb">
<DependentUpon>ImportLoadingWndV.xaml</DependentUpon>
</Compile>
<Compile Include="ImportLoadingWnd\ImportLoadingWndVM.vb" />
<Compile Include="InstrumentPanel\InstrumentPanelV.xaml.vb">
<DependentUpon>InstrumentPanelV.xaml</DependentUpon>
</Compile>
@@ -161,6 +190,10 @@
<DependentUpon>MachinePanelV.xaml</DependentUpon>
</Compile>
<Compile Include="MachinePanel\MachinePanelVM.vb" />
<Compile Include="MachineViewPanel\MachineViewPanelV.xaml.vb">
<DependentUpon>MachineViewPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="MachineViewPanel\MachineViewPanelVM.vb" />
<Compile Include="MachiningDb\MachiningDbV.xaml.vb">
<DependentUpon>MachiningDbV.xaml</DependentUpon>
</Compile>
@@ -185,8 +218,11 @@
<DependentUpon>MaterialDbV.xaml</DependentUpon>
</Compile>
<Compile Include="MaterialDb\MaterialDbVM.vb" />
<Compile Include="OptionsWindow\MachineBox.xaml.vb">
<DependentUpon>MachineBox.xaml</DependentUpon>
<Compile Include="TSFEditor\ColumnHeader.xaml.vb">
<DependentUpon>ColumnHeader.xaml</DependentUpon>
</Compile>
<Compile Include="UpdateMachine\UpdateMachineV.xaml.vb">
<DependentUpon>UpdateMachineV.xaml</DependentUpon>
</Compile>
<Compile Include="OptionsWindow\OptionModule.vb" />
<Compile Include="OptionsWindow\OptionWindowV.xaml.vb">
@@ -240,6 +276,7 @@
<Compile Include="ShowPanel\ShowPanelV.xaml.vb">
<DependentUpon>ShowPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="ShowPanel\ShowPanelVM.vb" />
<Compile Include="ShowValueSlider\ShowValueSlider.xaml.vb">
<DependentUpon>ShowValueSlider.xaml</DependentUpon>
</Compile>
@@ -272,6 +309,9 @@
<DependentUpon>StartMachPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="StartMachPanel\StartMachPanelVM.vb" />
<Compile Include="StatusBar\MessagePanelV.xaml.vb">
<DependentUpon>MessagePanelV.xaml</DependentUpon>
</Compile>
<Compile Include="StatusBar\MyStatusBarVM.vb" />
<Compile Include="StatusBar\StatusBarV.xaml.vb">
<DependentUpon>StatusBarV.xaml</DependentUpon>
@@ -284,6 +324,7 @@
<Compile Include="TSFEditor\TFSEditorV.xaml.vb">
<DependentUpon>TFSEditorV.xaml</DependentUpon>
</Compile>
<Compile Include="UpdateMachine\UpdateMachineVM.vb" />
<Compile Include="Utility\CurrentMachine.vb" />
<Compile Include="Utility\Dictionary.xaml.vb">
<DependentUpon>Dictionary.xaml</DependentUpon>
@@ -313,10 +354,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ChooseReferenceWnd\ChooseReferenceWndV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ControllerInputPanel\ControllerInputPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -325,14 +362,46 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="CustomControls\CheckedImageRadioButton.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="CustomControls\CheckedImageToggleButton.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DispositionPanel\DispositionPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml">
<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>
</Page>
<Page Include="FilledSolidParamPanel\FilledSolidParamPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ImportExportMachiningPanel\ImportExportMachiningPanelV.xaml">
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="ImportLoadingWnd\ImportLoadingWndV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="InstrumentPanel\InstrumentPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -345,6 +414,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MachineViewPanel\MachineViewPanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MachiningDb\MachiningDbV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -381,7 +454,11 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OptionsWindow\MachineBox.xaml">
<Page Include="TSFEditor\ColumnHeader.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UpdateMachine\UpdateMachineV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
@@ -469,6 +546,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="StatusBar\MessagePanelV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="StatusBar\StatusBarV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -547,6 +628,7 @@
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="packages.config" />
<Resource Include="Resources\EgtMessageBox\Error.png" />
<Resource Include="Resources\Fonts\Roboto-Regular.ttf" />
<Resource Include="Resources\Fonts\Roboto-Light.ttf" />
</ItemGroup>
@@ -558,16 +640,12 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ProjectManager\ExportProject.png" />
<Resource Include="Resources\ProjectManager\GoToProd.png" />
<Resource Include="Resources\ProjectManager\GoToProj.png" />
<Resource Include="Resources\ProjectManager\ImportBTL.png" />
<Resource Include="Resources\ProjectManager\ImportProject.png" />
<Resource Include="Resources\ProjectManager\New.png" />
<Resource Include="Resources\ProjectManager\Open.png" />
<Resource Include="Resources\ProjectManager\Options.png" />
<Resource Include="Resources\ProjectManager\Save.png" />
<Resource Include="Resources\ProjectManager\SaveAs.png" />
<Resource Include="Resources\ProjectManager\UpdateBTL.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ProjectManager\Import.png" />
@@ -579,16 +657,11 @@
<Resource Include="Resources\ViewPanel\LookFromBACK.png" />
<Resource Include="Resources\ViewPanel\LookFromBOTTOM.png" />
<Resource Include="Resources\ViewPanel\LookFromFRONT.png" />
<Resource Include="Resources\ViewPanel\LookFromISO_NE.png" />
<Resource Include="Resources\ViewPanel\LookFromISO_NW.png" />
<Resource Include="Resources\ViewPanel\LookFromISO_SE.png" />
<Resource Include="Resources\ViewPanel\LookFromISO_SW.png" />
<Resource Include="Resources\ViewPanel\LookFromLEFT.png" />
<Resource Include="Resources\ViewPanel\LookFromRIGHT.png" />
<Resource Include="Resources\ViewPanel\LookFromTOP.png" />
<Resource Include="Resources\ViewPanel\ZoomAll.png" />
<Resource Include="Resources\ViewPanel\ZoomIn.png" />
<Resource Include="Resources\ViewPanel\ZoomOut.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ShowPanel\CurveDir.png" />
@@ -597,10 +670,7 @@
<Resource Include="Resources\ShowPanel\RenderingWF.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\InstrumentPanel\Analyze.png" />
<Resource Include="Resources\InstrumentPanel\ChangeParam.png" />
<Resource Include="Resources\InstrumentPanel\GetDist.png" />
<Resource Include="Resources\InstrumentPanel\Statistics.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TreeView\Folder.png" />
@@ -612,7 +682,6 @@
<Resource Include="Resources\DrawPanel\Line2P.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\GridViewPanel\Cplane3POINTS.png" />
<Resource Include="Resources\GridViewPanel\CplaneBACK.png" />
<Resource Include="Resources\GridViewPanel\CplaneBOTTOM.png" />
<Resource Include="Resources\GridViewPanel\CplaneELEVATION.png" />
@@ -620,11 +689,8 @@
<Resource Include="Resources\GridViewPanel\CplaneLEFT.png" />
<Resource Include="Resources\GridViewPanel\CplaneOBJECT.png" />
<Resource Include="Resources\GridViewPanel\CplaneORIGIN.png" />
<Resource Include="Resources\GridViewPanel\CplanePERPCURVE.png" />
<Resource Include="Resources\GridViewPanel\CplaneRIGHT.png" />
<Resource Include="Resources\GridViewPanel\CplaneROTATE.png" />
<Resource Include="Resources\GridViewPanel\CplaneTOP.png" />
<Resource Include="Resources\GridViewPanel\CplaneView.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\DrawPanel\Delete.png" />
@@ -669,19 +735,168 @@
<ItemGroup>
<Resource Include="Resources\TopPanel\Edit.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\MachiningDb\Export.png" />
<Resource Include="Resources\MachiningDb\Import.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SplashScreen\GoldSplashscreen.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SplashScreen\LogoEgalware.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TopPanel\ManagePart.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TopPanel\MaterialDb.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TopPanel\MachiningDb.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\StatusBar\GridVisibility.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\InstrumentPanel\EdgeAnalysis.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ViewPanel\CplaneView.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\StatusBar\GridVisibilityWhite.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\MachiningDb\MachiningExport.png" />
<Resource Include="Resources\MachiningDb\MachiningImport.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TFSEditor\Expand.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SliderManager\FromSelected.png" />
<Resource Include="Resources\SliderManager\OnlySelected.png" />
<Resource Include="Resources\SliderManager\UntilSelected.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ProjectManager\Export.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ShowPanel\CurveDir_White.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ShowPanel\RenderingHL_White.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ShowPanel\RenderingSH_White.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ShowPanel\RenderingWF_White.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\InstrumentPanel\EdgeAnalysis_White.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\InstrumentPanel\GetDist_White.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\MachiningDb\Edit.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TopPanel\Offset.png" />
<Resource Include="Resources\TopPanel\SlicingDirection.png" />
<Resource Include="Resources\TopPanel\StrandCount.png" />
<Resource Include="Resources\TopPanel\StrandH.png" />
<Resource Include="Resources\TopPanel\StrandW.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Common\Cancel.png" />
<Resource Include="Resources\Common\Ok.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SimulationPanel\HeadMode.png" />
<Resource Include="Resources\SimulationPanel\MachMode.png" />
<Resource Include="Resources\SimulationPanel\ToolMode.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\AboutBox\EgalwareLogo.png" />
<Resource Include="Resources\AboutBox\IcarusLogo.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\CurrMachining\SaveInDb.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\MaterialDb\Edit.png" />
<Resource Include="Resources\MaterialDb\MaterialExport.png" />
<Resource Include="Resources\MaterialDb\MaterialImport.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ViewPanel\LookFromISO_SE.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Common\Close.png" />
<Resource Include="Resources\Common\Maximize.png" />
<Resource Include="Resources\Common\Minimize.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Common\Restore.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SliceManager\StopCalculation.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SplashScreen\BlueSplashscreen.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SliceManager\Dimensions.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\TFSEditor\Reduce.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ReferencePanel\BC.png" />
<Resource Include="Resources\ReferencePanel\BL.png" />
<Resource Include="Resources\ReferencePanel\BR.png" />
<Resource Include="Resources\ReferencePanel\MC.png" />
<Resource Include="Resources\ReferencePanel\ML.png" />
<Resource Include="Resources\ReferencePanel\MR.png" />
<Resource Include="Resources\ReferencePanel\TC.png" />
<Resource Include="Resources\ReferencePanel\TL.png" />
<Resource Include="Resources\ReferencePanel\TR.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ReferencePanel\White_BC.png" />
<Resource Include="Resources\ReferencePanel\White_BL.png" />
<Resource Include="Resources\ReferencePanel\White_BR.png" />
<Resource Include="Resources\ReferencePanel\White_MC.png" />
<Resource Include="Resources\ReferencePanel\White_ML.png" />
<Resource Include="Resources\ReferencePanel\White_MR.png" />
<Resource Include="Resources\ReferencePanel\White_TC.png" />
<Resource Include="Resources\ReferencePanel\White_TL.png" />
<Resource Include="Resources\ReferencePanel\White_TR.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SliceManager\Mass.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\SliceManager\Time.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\RibParamPanel\CopyFrom.png" />
</ItemGroup>
<ItemGroup>
<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
@@ -1,20 +1,21 @@
<EgtWPFLib5:EgtCustomWindow x:Class="ImportExportMachiningPanelV"
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 OkMsg}"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
Width="400" Height="500">
<EgtWPFLib5:EgtMainWindow x:Class="ImportExportMachiningPanelV"
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 OkMsg}"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
Style="{StaticResource Dialog_Window}">
<Grid>
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions>
<RowDefinition Height="7*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding MachiningList}">
<ListBox ItemsSource="{Binding MachiningList}"
Height="400"
Width="250">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type EgtWPFLib5:ImpExpMachiningItem}">
<Grid Height="20">
@@ -32,7 +33,7 @@
Margin="0,0,5,0"
VerticalContentAlignment="Center"
Visibility="{Binding Path=DataContext.Active_Visibility,
RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtCustomWindow}}}"/>
RelativeSource={RelativeSource AncestorType={x:Type EgtWPFLib5:EgtMainWindow}}}"/>
<TextBlock Grid.Column="1"
Text="{Binding sName}"
FontSize="15"
@@ -46,17 +47,26 @@
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Button Command="{Binding OkCommand}"
Content="{Binding OkMsg}"
IsEnabled="{Binding IsEnabledOkBtn, Mode=OneWay}"
Grid.Row="1"
Height="30" Width="100"
Margin="10" />
<UniformGrid Grid.Row="2"
Rows="1"
Margin="0,20,0,0">
<Button Command="{Binding OkCommand}"
IsEnabled="{Binding IsEnabledOkBtn, Mode=OneWay}"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button IsCancel="True"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Cancel.png"
Style="{StaticResource Button_Image}"/>
</Button>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
</EgtWPFLib5:EgtMainWindow>
@@ -157,7 +157,8 @@ Public Class ImportExportMachiningPanelVM
nIndex += 1
End While
If bIsOriginal AndAlso bIsCustom Then
MessageBox.Show("Corrupted file! Impossible to import it!")
'MessageBox.Show("Corrupted file! Impossible to import it!")
EgtMessageBoxV.Show(Application.Current.MainWindow, "Corrupted file! Impossible to import it!")
ElseIf bIsOriginal Then
LoadOriginalMaterial()
End If
@@ -264,7 +265,7 @@ Public Class ImportExportMachiningPanelVM
Select Case m_WindowType
Case WindowTypeEnum.MATERIAL
Return Map.refMaterialDbVM.MaterialList.Any(Function(x) x.sName = MachiningName)
Case WindowTypeEnum.MACHINING
Case Else ' WindowTypeEnum.MACHINING
Return Map.refMachiningDbVM.MachiningList.Any(Function(x) x.sName = MachiningName)
End Select
End Function
@@ -301,9 +302,12 @@ Public Class ImportExportMachiningPanelVM
sDuplicatedMaterialList &= " - " & m_MachiningList(Index).sName & Environment.NewLine
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.")
'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.")
EgtMessageBoxV.Show(Application.Current.MainWindow, "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.")
Return
End If
' aggiorno/aggiungo materiali
@@ -353,9 +357,12 @@ Public Class ImportExportMachiningPanelVM
For Index = 0 To ImportedMaterialList.Count - 1
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.")
'MessageBox.Show("List of the materials:" & Environment.NewLine &
' sMaterialList & Environment.NewLine &
' "Import successfully completed.")
EgtMessageBoxV.Show(Application.Current.MainWindow, "List of the materials:" & Environment.NewLine &
sMaterialList & Environment.NewLine &
"Import successfully completed.")
Return
End Sub
@@ -471,7 +478,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
@@ -580,7 +587,8 @@ Public Class ImpExpMachiningItem
If m_AlreadyExist Then
Select Case m_WindowType
Case WindowTypeEnum.MATERIAL
Select Case System.Windows.MessageBox.Show("Material already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
'System.Windows.MessageBox.Show("Material already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
Case MessageBoxResult.Yes
m_ChangeName = False
m_Active = True
@@ -594,7 +602,8 @@ Public Class ImpExpMachiningItem
End While
End If
m_sName = m_sOrigName & IMPEXPNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "")
System.Windows.MessageBox.Show("Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
'System.Windows.MessageBox.Show("Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Material will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
NotifyPropertyChanged(NameOf(sName))
m_ChangeName = True
m_Active = True
@@ -602,7 +611,8 @@ Public Class ImpExpMachiningItem
m_Active = False
End Select
Case WindowTypeEnum.MACHINING
Select Case System.Windows.MessageBox.Show("Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
'System.Windows.MessageBox.Show("Machining already existing in Db. Overwrite it?", "", MessageBoxButton.YesNoCancel)
Case MessageBoxResult.Yes
m_ChangeName = False
m_Active = True
@@ -616,7 +626,8 @@ Public Class ImpExpMachiningItem
End While
End If
m_sName = m_sOrigName & IMPEXPNAME & If(nImpNameIndex > 0, "_" & nImpNameIndex, "")
System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
'System.Windows.MessageBox.Show("Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Machining will be imported with the name: " & m_sName, "", MessageBoxButton.OK)
NotifyPropertyChanged(NameOf(sName))
m_ChangeName = True
m_Active = True
@@ -0,0 +1,38 @@
<EgtWPFLib5:EgtMainWindow x:Class="ImportLoadingWndV"
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="New Project"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
Style="{StaticResource Dialog_Window}">
<Grid Margin="2.5,2.5,2.5,2.5">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Loading_Msg}"
Margin="20,20,20,2.5"
Style="{StaticResource DialogWindow_TextBlock}"/>
<Grid Grid.Row="1"
Margin="2.5,2.5,2.5,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ProgressBar Value="{Binding Loading_Value}"
Width="200"
Margin="0,0,2.5,20"
Style="{StaticResource Icarus_ProgressBar}"/>
<!--<Button Grid.Column="1"
Grid.RowSpan="2"
Command="{Binding Stop_Command}"
Margin="2.5,0,0,0"
Style="{StaticResource TopPanel_Button}">
<Image Source="\Resources\SliceManager\StopCalculation.png"
Style="{StaticResource Button_Image}"/>
</Button>-->
</Grid>
</Grid>
</EgtWPFLib5:EgtMainWindow>
@@ -0,0 +1,14 @@
Public Class ImportLoadingWndV
Private WithEvents m_ImportLoadingWndVM As ImportLoadingWndVM
Sub New(Owner As Window, ImportLoadingWndVM As ImportLoadingWndVM)
MyBase.New(Owner)
' This call is required by the designer.
InitializeComponent()
Me.DataContext = ImportLoadingWndVM
' Assegno al riferimento locale al VM il VM preso dal DataContext
m_ImportLoadingWndVM = ImportLoadingWndVM
End Sub
End Class
@@ -0,0 +1,91 @@
Imports System.Collections.ObjectModel
Imports EgtUILib.EgtInterface
Imports EgtWPFLib5
Public Class ImportLoadingWndVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
' Funzioni di callback per output in interfaccia da LUA
Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
Private m_bStopLoading As Boolean = False
Private m_Loading_Value As Double
Public Property Loading_Value As Double
Get
Return m_Loading_Value
End Get
Set(value As Double)
m_Loading_Value = value
End Set
End Property
' Definizione comandi
Private m_cmdStop As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "MESSAGES"
Public ReadOnly Property Loading_Msg As String
Get
Return "Importing file..."
End Get
End Property
#End Region ' MESSAGES
#Region "CONSTRUCTORS"
Sub New()
' Creo riferimento a questa classe in Map
Map.SetRefImportLoadingWndVM(Me)
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Friend Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
m_Loading_Value = nProg
NotifyPropertyChanged(NameOf(Loading_Value))
' Costringo ad aggiornare
UpdateUI()
' Eventuale attesa
Threading.Thread.Sleep(nPause)
' Ritorno eventuale stop
If m_bStopLoading Then
m_bStopLoading = False
Return 1
Else
Return 0
End If
Return 0
End Function
#End Region ' METHODS
#Region "COMMANDS"
#Region "Stop"
Public ReadOnly Property Stop_Command As ICommand
Get
If m_cmdStop Is Nothing Then
m_cmdStop = New Command(AddressOf StopLoading)
End If
Return m_cmdStop
End Get
End Property
Public Sub StopLoading()
m_bStopLoading = True
End Sub
#End Region ' Stop
#End Region ' COMMANDS
End Class
+29 -13
View File
@@ -1,14 +1,30 @@
<EgtFloating:EgtFloatingPanel x:Class="InstrumentPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
<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">
<ToggleButton ToolTip="{Binding GetDistToolTip}"
Style="{StaticResource ToolBar_ToggleButton}"
IsChecked="{Binding GetDistIsChecked}">
<Image Source="/Resources/InstrumentPanel/GetDist.png" Stretch="Uniform"/>
</ToggleButton>
</EgtFloating:EgtFloatingPanel>
<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>
+19 -2
View File
@@ -96,8 +96,9 @@ Public Class MyInstrumentPanelVM
EgtDraw()
' Ripristino stato segnalazione modifica
DisableMgr.ReEnable()
MessageBox.Show(sResult)
Else
'MessageBox.Show(sResult)
EgtMessageBoxV.Show(Application.Current.MainWindow, sResult)
Else
' Disabilito segnalazione modificato
Dim DisableMgr As New DisableModifiedMgr
' cancello tutti i gruppi con i chunk
@@ -139,6 +140,22 @@ Public Class MyInstrumentPanelVM
NotifyPropertyChanged(NameOf(bEdgeAnalysis_IsEnabled))
End Sub
#Region "Tooltip"
Public ReadOnly Property GetDist_ToolTip As String
Get
Return "Distance"
End Get
End Property
Public ReadOnly Property EdgeAnalysis_ToolTip As String
Get
Return "Edge Analysis"
End Get
End Property
#End Region ' Tooltip
#Region "CONSTRUCTORS"
Sub New()
+9 -7
View File
@@ -1,12 +1,14 @@
<UserControl x:Class="LeftPanelV"
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:PrintApp="clr-namespace:Icarus"
Margin="5">
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:PrintApp="clr-namespace:Icarus"
Margin="5,0,5,0">
<TabControl SelectedIndex="{Binding SelPanel}"
Background="Transparent"
BorderThickness="0">
BorderThickness="0"
Margin="0"
Padding="0">
<TabControl.ItemContainerStyle>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Visibility" Value="Collapsed"/>
@@ -34,7 +36,7 @@
<PrintApp:ShellNumberPanelV DataContext="{StaticResource ShellNumberPanelVM}"/>
</TabItem>
<TabItem Header="AUXSOLIDS">
<Button Height="100"/>
<PrintApp:FilledSolidPanelV DataContext="{StaticResource FilledSolidPanelVM}"/>
</TabItem>
<TabItem Header="MODIFYPART">
<!--<PrintApp:ModifyPartPanelV DataContext="{StaticResource ModifyPartPanelVM}"/>-->
+5 -2
View File
@@ -39,6 +39,8 @@ Public Class LeftPanelVM
Map.refRibPanelVM.Dispose()
Case Panels.SHELLNUMBER
Map.refShellNumberPanelVM.Dispose()
Case Panels.AUXSOLIDS
Map.refFilledSolidPanelVM.Dispose()
End Select
m_SelPanel = Panel
Select Case Panel
@@ -54,11 +56,12 @@ Public Class LeftPanelVM
Map.refRibPanelVM.Init()
Case Panels.SHELLNUMBER
Map.refShellNumberPanelVM.Init()
Case Panels.AUXSOLIDS
Map.refFilledSolidPanelVM.Init()
Case Panels.MODIFYPART
''Map.refModifyPartPanelVM.Init()
Map.refManagePartPanelVM.Init(ManagePartPanelVM.ManagePartType.MODIFY)
End Select
Map.refViewLayerManagerVM.UpdateForced()
If Not IsNothing(Map.refViewLayerManagerVM) Then Map.refViewLayerManagerVM.UpdateForced()
NotifyPropertyChanged(NameOf(SelPanel))
End Sub
+35 -43
View File
@@ -1,50 +1,42 @@
<EgtWPFLib5:EgtCustomWindow x:Class="MachSaveInDbWndV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
Title="Machining Param Name"
Height="150" Width="300"
WindowStartupLocation="CenterOwner"
Icon="/Resources/Icarus.ico"
WindowStyle="None" ResizeMode="NoResize"
ShowInTaskbar="False"
IsMinimizable="False">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<EgtWPFLib5:EgtMainWindow x:Class="MachSaveInDbWndV"
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="Save in Database"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterOwner"
Style="{StaticResource Dialog_Window}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Column="1"
Grid.Row="1"
Text="Name"
Margin="0,0,10,0"
Style="{Binding OptionTextBlock}"/>
<EgtWPFLib5:EgtTextBox Grid.Column="2"
Grid.Row="1"
Width="180"
Text="{Binding sName}"
Style="{StaticResource LeftPanel_TextBox}"/>
<UniformGrid Grid.Column="1"
Grid.ColumnSpan="2"
Grid.Row="3"
Rows="1">
<Button Content="Ok"
Command="{Binding Ok_Command}"
<TextBlock Text="Write the new Database machining name"
Margin="20,20,20,2.5"
Style="{StaticResource DialogWindow_TextBlock}"/>
<EgtWPFLib5:EgtTextBox2 Grid.Row="1"
Text="{Binding sName}"
IsExplicitFocused="True"
Width="160"
Margin="20,10,20,2.5"
Style="{StaticResource LeftPanel_TextBox2}"/>
<UniformGrid Grid.Row="3"
Rows="1"
Margin="0,20,0,0">
<Button Command="{Binding Ok_Command}"
IsDefault="True"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Cancel"
Command="{Binding Cancel_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding Cancel_Command}"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Cancel.png"
Style="{StaticResource Button_Image}"/>
</Button>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
</EgtWPFLib5:EgtMainWindow>
+2 -1
View File
@@ -48,7 +48,8 @@ Public Class MachSaveInDbWndVM
Public Sub Ok()
If Map.refTopPanelVM.MachiningList.Any(Function(x As MachiningIndex) x.sName = m_sName) Then
MessageBox.Show("Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
'MessageBox.Show("Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Name already used in Db! Please insert a different name.", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
Return
End If
RaiseEvent m_CloseWindow(True)
+3 -46
View File
@@ -4,52 +4,9 @@
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsEnabled="{Binding MachPanel_IsEnabled}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Margin="0,0,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!--<TextBlock Grid.Row="0" Grid.Column="0" Text="Macchina corrente" VerticalAlignment="Center" Margin="0,0,5,0"/>-->
<!--Combobox per selezionare la macchina corrente-->
<!--<ComboBox ItemsSource="{Binding Path=MachineList}"
SelectedItem="{Binding Path=SelectedMachine}"
DisplayMemberPath="Name"
SelectedValuePath="Name"
Height="22" Width="150"
Grid.Row="0" Grid.Column="1"/>-->
<!--<Rectangle HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Fill="LightGray"/>-->
<TextBlock Text="{Binding SelectedMachine.Name}"
Style="{StaticResource OptionTextBlock}"/>
</Grid>
<!--<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Command="{Binding ToolDbCommand}" ToolTip="{Binding ToolDBToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding ToolDBMsg}"/>
<Button Command="{Binding MachDbCommand}" ToolTip="{Binding MachiningDbToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding MachiningDbMsg}"/>
--><!--<Button Command="{Binding SetUpCommand}" ToolTip="{Binding SetUpToolTip}"
Style="{StaticResource ToolBar_TextButton}" Content="{Binding SetUpMsg}"
Background="{Binding SetUp_Background}"/>--><!--
<Button ToolTip="{Binding BeamTable_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding BeamTable_Command}"
Visibility="{Binding BeamTable_Visibility}">
<Image Source="/Resources/Configuration/MachiningsTable.png" Stretch="Uniform"/>
</Button>
<Button ToolTip="{Binding WallTable_ToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding WallTable_Command}"
Visibility="{Binding WallTable_Visibility}">
<Image Source="/Resources/Configuration/MachiningsTable.png" Stretch="Uniform"/>
</Button>
--><!--<Button Command="{Binding MachOptionsCommand}" ToolTip="{Binding OptionsToolTip}">
<Image Source="/Resources/ProjectManager/Options.png" Height="22" />
</Button>--><!--
</StackPanel>-->
FontSize="18"
HorizontalAlignment="Center"
Style="{StaticResource BaseTextBlock}"/>
</Grid>
@@ -0,0 +1,22 @@
<UserControl x:Class="MachineViewPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
VerticalContentAlignment="Top">
<ComboBox SelectedIndex="{Binding ghSelMachView}"
Height="40"
Width="40"
Style="{StaticResource SelViewSlider_ComboBox}">
<ComboBoxItem>
<Image Source="\Resources\SimulationPanel\ToolMode.png"
Style="{StaticResource ComboBox.Image}"/>
</ComboBoxItem>
<ComboBoxItem>
<Image Source="\Resources\SimulationPanel\HeadMode.png"
Style="{StaticResource ComboBox.Image}"/>
</ComboBoxItem>
<ComboBoxItem>
<Image Source="\Resources\SimulationPanel\MachMode.png"
Style="{StaticResource ComboBox.Image}"/>
</ComboBoxItem>
</ComboBox>
</UserControl>
@@ -0,0 +1,3 @@
Public Class MachineViewPanelV
End Class
@@ -0,0 +1,30 @@
Imports EgtUILib
Imports EgtWPFLib5
Public Class MachineViewPanelVM
Inherits VMBase
Public Property ghSelMachView As Integer
Get
Return If(Not IsNothing(Map.refSimulationPanelVM) AndAlso Not IsNothing(Map.refSimulationPanelVM.MySimul), Map.refSimulationPanelVM.MySimul.GetMachLook() - 1, Nothing)
End Get
Set(value As Integer)
If Not IsNothing(Map.refSimulationPanelVM) AndAlso Not IsNothing(Map.refSimulationPanelVM.MySimul) Then
Map.refSimulationPanelVM.MySimul.SetMachLook(value + 1)
' aggiorno lo stato della macchina e la sua visualizzazione
EgtSetMachineLook(Map.refSimulationPanelVM.MySimul.GetMachLook())
WriteMainPrivateProfileString(S_SIMUL, K_MACHVIEWMODE, value + 1)
End If
EgtDraw()
End Set
End Property
Friend Sub RefreshSelViewSlider()
NotifyPropertyChanged(NameOf(ghSelMachView))
End Sub
Sub New()
' Creo riferimento a questa classe in OmagOFFICEMap
Map.SetRefMachineViewPanelVM(Me)
End Sub
End Class
File diff suppressed because it is too large Load Diff
+152 -107
View File
@@ -1,19 +1,32 @@
<UserControl x:Class="MachiningDbV"
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:PrintApp="clr-namespace:Icarus"
Width="300">
<Border VerticalAlignment="Center"
Style="{StaticResource RightPanel_Border}">
<Grid>
<Grid x:Class="MachiningDbV"
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:PrintApp="clr-namespace:Icarus"
Width="310"
VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Margin="0,0,0,2.5"
Style="{StaticResource Title_Border}">
<TextBlock Text="MACHINING DATABASE"
Style="{StaticResource Title_TextBlock}"/>
</Border>
<Border Grid.Row="1"
VerticalAlignment="Center"
Margin="0,2.5,0,0"
Style="{StaticResource BottomGrayRow_Border}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid HorizontalAlignment="Center"
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@@ -24,33 +37,41 @@
<Button Content="New"
Command="{Binding New_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_Button}"/>
<Button Content="Save"
Grid.Column="1"
Command="{Binding Save_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_Button}"/>
<Button Content="Delete"
Grid.Column="2"
Command="{Binding Delete_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_Button}"/>
<Button Grid.Column="3"
Command="{Binding Import_Command}"
ToolTip="{Binding ImportToolTip}"
ToolTip="{Binding Import_ToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/Import.png" Stretch="Uniform"/>
<Image Source="/Resources/MachiningDB/MachiningImport.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="4"
Command="{Binding Export_Command}"
ToolTip="{Binding ImportToolTip}"
ToolTip="{Binding Export_ToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/Export.png" Stretch="Uniform"/>
<Image Source="/Resources/MachiningDB/MachiningExport.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
<Grid Grid.Row="1">
<Grid Grid.Row="1"
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
@@ -60,27 +81,40 @@
SelectedItem="{Binding SelMachining}"
DisplayMemberPath="ghName"
Visibility="{Binding Combo_Visibility}"
Style="{StaticResource FeatureComboBox}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SelectedItem.sName, ElementName=MachiningCombo, UpdateSourceTrigger=Explicit}"
ExplicitUpdateSource="EnterKeyPressOrLostFocus"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding Name_Visibility}"
Style="{StaticResource OptionTextBox}"/>
HorizontalAlignment="Stretch"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_ComboBox}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding SelectedItem.sName, ElementName=MachiningCombo, UpdateSourceTrigger=Explicit}"
ExplicitUpdateSource="EnterKeyPressOrLostFocus"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding Name_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource OptionTextBox2}"/>
<Button Grid.Column="1"
Command="{Binding EditName_Command}"
ToolTip="{Binding EditName_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/TopPanel/Edit.png"/>
<Image Source="/Resources/MachiningDB/Edit.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
<ScrollViewer Grid.Row="2"
IsEnabled="{Binding IsEnabled}"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl Grid.Row="1"
ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MachiningCombo}"
IsEnabled="{Binding IsEnabled}">
HorizontalScrollBarVisibility="Disabled"
Margin="1,0,0,2.5"
Padding="0"
BorderThickness="0"
Style="{StaticResource RightPanel_ScrollViewer}">
<ItemsControl ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MachiningCombo}"
BorderThickness="0"
Margin="0"
Padding="0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
<StackPanel Orientation="Vertical"
Margin="0"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
@@ -88,130 +122,139 @@
<Expander Header="{Binding sName}"
IsExpanded="{Binding Cathegory_IsExpanded}"
VerticalContentAlignment="Top">
<ItemsControl ItemsSource="{Binding MachiningParamList}">
<ItemsControl ItemsSource="{Binding MachiningParamList}"
BorderThickness="0"
Margin="0"
Padding="0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
<StackPanel Orientation="Vertical"
Margin="0"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type PrintApp:NumericMachiningParam}">
<Grid>
<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}"/>
<TextBox Grid.Column="1"
Text="{Binding sValue}"/>
<!--<Button Grid.Column="2"
Content="R"
Command="{Binding ResetParam_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
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"
Style="{StaticResource ParameterList_TextBox2}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:ComboMachiningParam}">
<Grid>
<Grid Margin="0,1,2.5,1"
IsEnabled="{Binding bIsActive}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<!--<ColumnDefinition Width="Auto"/>-->
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
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}"
HorizontalAlignment="Stretch"/>
<!--<Button Grid.Column="1"
Content="R"
Command="{Binding ResetParam_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
HorizontalAlignment="Stretch"
Margin="2.5,0,0,0"
Style="{StaticResource RightPanel_ComboBox}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:CheckMachiningParam}">
<Grid>
<Grid Height="22"
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}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding sName, Mode=OneWay}"
Margin="0,0,2.5,0"
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"
VerticalAlignment="Center"/>
<!--<Button Grid.Column="1"
Content="R"
Command="{Binding ResetParam_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
VerticalAlignment="Center"
Margin="2.5,0,0,0"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:MaterialMachiningParam}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<!--<ColumnDefinition Width="Auto"/>-->
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"/>
<CheckBox Grid.Column="1"
IsChecked="{Binding bValue}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<!--<Button Grid.Column="1"
Content="R"
Command="{Binding ResetParam_Command}"
CommandParameter="dCurrStrandH"
IsEnabled="{Binding bCurrStrandH_IsModified}"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Margin="5,0,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>-->
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}">
<Grid>
<Grid Height="22"
Margin="0,1,2.5,1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
VerticalAlignment="Center"/>
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"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:OrderedMachiningParam}">
<Grid Margin="0,1,2.5,1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ListBox ItemsSource="{Binding ValueList}"
SelectedItem="{Binding SelValue}"/>
SelectedItem="{Binding SelValue}"
Margin="2.5,0,2.5,0"/>
<StackPanel Grid.Column="1"
Orientation="Vertical"
VerticalAlignment="Center"
Margin="5,0,0,0">
Margin="2.5,0,0,0">
<Button Content="˄"
Command="{Binding MoveUpOrder_Command}"
Margin="0,0,0,2.5"
Style="{StaticResource ToolBar_SmallButton}"/>
<Button Content="˅"
Command="{Binding MoveDownOrder_Command}"
Margin="0,2.5,0,2.5"
Style="{StaticResource ToolBar_SmallButton}"/>
<Button Content="&lt;>"
Command="{Binding ResetOrder_Command}"
Margin="0,2.5,0,0"
Style="{StaticResource ToolBar_SmallButton}"/>
</StackPanel>
</Grid>
@@ -224,12 +267,14 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<UniformGrid Grid.Row="3" Rows="1">
<Button Content="Ok"
Command="{Binding Ok_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
</UniformGrid>
<Button Grid.Row="3"
Command="{Binding Ok_Command}"
IsEnabled="{Binding IsEnabled}"
Margin="0,2.5,0,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</Border>
</UserControl>
</Grid>
+28 -3
View File
@@ -26,7 +26,8 @@ Public Class MachiningDbVM
' verifico se modificato
If m_SelMachining.bIsModified Then
' chiedo se salvare
Select Case MessageBox.Show("Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
'MessageBox.Show("Do you want to save the modification done on the selected machining?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes
m_SelMachining.Save()
Case MessageBoxResult.No
@@ -112,6 +113,28 @@ 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
@@ -176,7 +199,8 @@ Public Class MachiningDbVM
Public Sub Ok()
If Not IsNothing(m_SelMachining) AndAlso m_SelMachining.bIsModified Then
' chiedo se salvare
Select Case MessageBox.Show("Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
'MessageBox.Show("Do you want to save modified parameters?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
Case MessageBoxResult.Yes
m_SelMachining.Save()
Case MessageBoxResult.No
@@ -287,7 +311,8 @@ Public Class MachiningDbVM
Public Sub Delete()
If IsNothing(m_SelMachining) Then Return
' chiedo conferma
Select Case MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
'MessageBox.Show("Are you sure you want to delete the selected machining?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Case MessageBoxResult.Yes
m_MachiningList.Remove(m_SelMachining)
SetIsModified(True)
+10 -14
View File
@@ -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, 2502, 1, m_nKeyLevel) And
EgtGetKeyOptions(5583, 2502, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(5583, 2510, 1, m_nKeyLevel) And
EgtGetKeyOptions(5583, 2510, 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())
+17 -28
View File
@@ -1,32 +1,21 @@
<EgtWPFLib5:EgtCustomWindow x:Class="MainWindowV"
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:PrintApp="clr-namespace:Icarus"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
Title="{Binding sTitle}" Icon="/Resources/Icarus.ico"
MinHeight="600" MinWidth="800" WindowStyle="None" ResizeMode="NoResize"
AllowDrop="True" Drop="MainWindowV_Drop"
ShowInTaskbar="True"
Topmost="False"
CloseCommand="{Binding CloseApplicationCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<!--<EgtWPFLib5:EgtCustomWindow.TitlePanel>
<PrintApp:ProjManagerV DataContext="{StaticResource ProjManagerVM}"/>
</EgtWPFLib5:EgtCustomWindow.TitlePanel>-->
<EgtWPFLib5:EgtMainWindow x:Class="MainWindowV"
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:PrintApp="clr-namespace:Icarus"
MinHeight="600" MinWidth="800"
AllowDrop="True"
Drop="MainWindowV_Drop"
ShowInTaskbar="True"
Topmost="False"
Style="{StaticResource NoStyle_Window}">
<Grid>
<PrintApp:SceneHostV/>
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<PrintApp:SceneHostV Grid.Row="1"/>
</Grid>
<!--Pannello principale --><!--
<DockPanel>
--><!--StatusBar --><!--
<PrintApp:StatusBarV DataContext="{StaticResource StatusBarVM}"
DockPanel.Dock="Bottom"/>
<PrintApp:ProjectV DataContext="{StaticResource ProjectVM}"/>
</DockPanel>-->
</EgtWPFLib5:EgtCustomWindow>
</EgtWPFLib5:EgtMainWindow>
+16 -3
View File
@@ -5,7 +5,6 @@ Imports System.Windows.Interop
Class MainWindowV
Private m_MainWindowVM As MainWindowVM
Private m_SceneHostWnd As SecondaryWindowV
#Region "CONSTRUCTOR"
@@ -20,6 +19,8 @@ Class MainWindowV
AddHandler Me.Closing, AddressOf MainWindowV_Closing
AddHandler Me.KeyDown, AddressOf MainWindowV_KeyDown
AddHandler Me.StateChanged, AddressOf MainWindowV_StateChanged
'AddHandler Me.LocationChanged, AddressOf MainWindowV_LocationChanged
'AddHandler Me.SizeChanged, AddressOf MainWindowV_SizeChanged
End Sub
#End Region ' CONSTRUCTOR
@@ -60,15 +61,27 @@ 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())
End If
End Sub
Private Sub MainWindowV_LocationChanged(sender As Object, e As EventArgs)
If Not IsNothing(Map.refSecondaryWindowV) Then
Map.refSecondaryWindowV.Top = Me.Top
Map.refSecondaryWindowV.Left = Me.Left
End If
End Sub
Private Sub MainWindowV_SizeChanged(sender As Object, e As SizeChangedEventArgs)
If Not IsNothing(Map.refSecondaryWindowV) Then
If e.WidthChanged Then Map.refSecondaryWindowV.Width = e.NewSize.Width
If e.HeightChanged Then Map.refSecondaryWindowV.Height = e.NewSize.Height
Map.refSecondaryWindowV.InvalidateVisual()
End If
End Sub
Private Sub MainWindowV_StateChanged(sender As Object, e As EventArgs)
If Not IsNothing(Map.refSecondaryWindowV) AndAlso Not Map.refSecondaryWindowV.WindowChangingState Then
Map.refSecondaryWindowV.WindowState = Me.WindowState
'Application.Current.MainWindow.Topmost = True
'Application.Current.MainWindow.Topmost = False
End If
End Sub
+91 -161
View File
@@ -7,9 +7,6 @@ Imports System.Windows.Threading
Public Class MainWindowVM
Inherits VMBase
Private m_SupervisorCommThread As Thread
Private m_Supervisor_Timer As New DispatcherTimer
' Riferimento al Model della MainWindow
Private m_MainWindowM As MainWindowM
Friend ReadOnly Property MainWindowM As MainWindowM
@@ -18,6 +15,9 @@ Public Class MainWindowVM
End Get
End Property
' Funzioni di callback per output in interfaccia da LUA
Private m_ProcEventsCallback As New ProcessEventsCallback(AddressOf ProcessEvents)
' Variabile che indica che il programma è stato avviato correttamente (sia la mappa che l'ambiente Egt)
Private m_bInitStatus As Boolean
Friend ReadOnly Property bInitStatus As Boolean
@@ -27,25 +27,34 @@ Public Class MainWindowVM
End Property
' Titolo
Private m_sTitle As String
Public Property sTitle As String
Public ReadOnly Property sTitle As String
Get
Return m_sTitle
Return "Icarus"
End Get
Set(value As String)
m_sTitle = value
NotifyPropertyChanged(NameOf(sTitle))
End Set
End Property
' proprietà che seleziona la giusta pagina del TabControl
Public Property nSelTabPage As Integer
Public ReadOnly Property sProjectName As String
Get
' Return If(IsNothing(Map.refMainMenuVM.SelPage) OrElse Map.refMainMenuVM.SelPage = -1 OrElse Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.MACHINING, 0, 1)
Return -1
Dim sFilePath As String = ""
EgtGetCurrFilePath(sFilePath)
If String.IsNullOrEmpty(sFilePath) Then
sFilePath = EgtMsg(MSG_TOPCOMMANDBAR + 1) & Map.refMainWindowVM.MainWindowM.nInstance.ToString()
Return sFilePath
Else
Return Path.GetFileNameWithoutExtension(sFilePath) & If(EgtGetModified(), "*", "")
End If
End Get
End Property
Public ReadOnly Property sProjectPath As String
Get
Dim sFilePath As String = ""
EgtGetCurrFilePath(sFilePath)
If String.IsNullOrEmpty(sFilePath) Then
sFilePath = EgtMsg(MSG_TOPCOMMANDBAR + 1) & Map.refMainWindowVM.MainWindowM.nInstance.ToString()
End If
Return sFilePath
End Get
Set(value As Integer)
End Set
End Property
Private m_MachinePanelVM As MachinePanelVM
@@ -55,9 +64,6 @@ Public Class MainWindowVM
End Get
End Property
'Friend m_SupervisorStop As Boolean = False
'Private BlockedWnd As BlockedWndV
' definizione comandi
Private m_cmdAboutBox As ICommand
Private m_cmdCloseApplication As ICommand
@@ -71,117 +77,18 @@ Public Class MainWindowVM
m_MainWindowM = New MainWindowM
' inizializzo machine panel
m_MachinePanelVM = New MachinePanelVM
' inizializzo contatore per blocco da supervisore
m_Supervisor_Timer.Interval = TimeSpan.FromMilliseconds(500)
' AddHandler m_Supervisor_Timer.Tick, AddressOf SupervisorTimer_Tick
m_Supervisor_Timer.Start()
' Installo funzione gestione eventi per lua
EgtSetProcessEvents(m_ProcEventsCallback)
End Sub
#End Region ' CONSTRUCTOR
'#Region "METHODS"
Friend Sub SetTitle(sTitle As String)
m_sTitle = sTitle
NotifyPropertyChanged(NameOf(sTitle))
' aggiorno titolo nella secondaryPage che e' quello che si vede nella barra in alto
Map.refSecondaryWindowVM.SetTitle(sTitle)
End Sub
'Public Sub UpdateTitle()
' m_Title = ""
' Select Case Map.refMainMenuVM.SelPage
' Case Pages.VIEW
' If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
' If Map.refProjManagerVM.CurrProj.bIsNew Then m_Title = "New - "
' m_Title &= Map.refProjManagerVM.CurrProj.nProjId.ToString("0000") & " - " & Map.refProjManagerVM.CurrProj.sBTLFileName
' End If
' Case Pages.MACHINING
' If Not IsNothing(Map.refProdManagerVM.CurrProd) Then
' If Map.refProdManagerVM.CurrProd.bIsNew Then m_Title = "New - "
' m_Title &= Map.refProdManagerVM.CurrProd.nProdId.ToString("0000") & " - " & Map.refProdManagerVM.CurrProd.sBTLFileName
' End If
' Case Pages.CONFIG
' m_Title = "Configuration Page"
' End Select
' m_Title &= " - EgtBEAMWALL"
' NotifyPropertyChanged(NameOf(Title))
'End Sub
Friend Sub ContentRendered()
'DbControllers.Init()
'' chiamata a caso su Db per inizializzarlo
'DbControllers.m_ProjController.FindByProjDbId(0)
'' Verifico che l'inizializzazione di tutte le parti del programma sia andata a buon fine
'If Map.EndInit() Then
' m_bInitStatus = True
' ' altrimenti chiudo il programma
'Else
' m_bInitStatus = False
'End If
'' Aggiorno visualizzazione unità di misura
''Map.refStatusBarVM.SetMeasureUnit(If(EgtUiUnitsAreMM(), MeasureUnitOpt.MM, MeasureUnitOpt.INCH))
'' imposto MainWindow per finestra di Loading
'LoadingWndHelper.SetMainWindow(Application.Current.MainWindow)
'' leggo riga di comando
'Dim nCommandType As Integer = 0
'Dim nPage As Pages = Pages.VIEW
'Dim nProdId As Integer = 0
'If ProcessCommandLine(nCommandType, nPage, nProdId) Then
' Select Case nCommandType
' Case 1
' Map.refProdManagerVM.SetCurrProd(nProdId)
' Case 2
' ' pagina gia' impostata nella variabile
' End Select
'Else
' ' setto il primo file dalla lista degli MRU come progetto corrente da aprire
' Dim sLastProjectPath As String = String.Empty
' GetMainPrivateProfileString(S_MRUPROJFILES, K_FILE & "1", String.Empty, sLastProjectPath)
' If Not String.IsNullOrWhiteSpace(sLastProjectPath) AndAlso File.Exists(sLastProjectPath) Then
' ' ricavo l'Id e il progetto associato per l'apertura di quest'ultimo
' Dim PjId As Integer = 0
' Dim sPjId As String = Path.GetFileNameWithoutExtension(sLastProjectPath)
' Integer.TryParse(sPjId, PjId)
' Map.refProjManagerVM.SetCurrProj(PjId)
' End If
'End If
'' seleziono pagina da aprire
'Map.refMainMenuVM.SelPage = nPage
'' inizializzo thread di aggiornamento e comunicazione con DB
'' creo thread gestione macchina
'm_SupervisorCommThread = New Thread(Sub()
' SupervisorCommThread.SupervisorCommThreadFunction()
' End Sub)
'm_SupervisorCommThread.SetApartmentState(ApartmentState.STA)
'' avvio thread di gestione della macchina che avvia la connessione
'm_SupervisorCommThread.Start()
End Sub
' Friend Function ProcessCommandLine(ByRef nCommandType As Integer, ByRef nPage As Pages, ByRef nProdId As Integer) As Boolean
' ' Se non ci sono veri parametri su linea di comando, esco (il primo è sempre il nome del programma)
' If Environment.GetCommandLineArgs.Count() <= 1 Then Return False
' ' Recupero primo parametro che dovrebbe essere il tipo di modalita' riga di comando
' Dim sFile As String = Environment.GetCommandLineArgs(1)
' If String.IsNullOrWhiteSpace(sFile) OrElse Not Integer.TryParse(sFile, nCommandType) OrElse nCommandType <= 0 Then Return False
' Select Case nCommandType
' Case 1 ' apri progetto in ottimizzatore
' ' recupero secondo parametro
' Dim sProdId As String = Environment.GetCommandLineArgs(2)
' If Not Integer.TryParse(sProdId, nProdId) OrElse nProdId <= 0 Then Return False
' nPage = Pages.MACHINING
' Return True
' Case 2 ' apri pagina specifica senza progetto specifico
' ' recupero secondo parametro
' Dim sPage As String = Environment.GetCommandLineArgs(2)
' If Not Integer.TryParse(sPage, nPage) OrElse (nPage <> Pages.VIEW AndAlso nPage <> Pages.MACHINING) Then Return False
' Return True
' End Select
' Return False
' End Function
Friend Sub KeyDown(PressedKey As Key)
' Con ESC esco dall'azione corrente
If PressedKey = Key.Escape Then
@@ -209,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
@@ -225,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
@@ -240,48 +147,26 @@ Public Class MainWindowVM
End If
End Sub
' Friend m_ManagingSupervisorStop As Boolean = False
Private Function ProcessEvents(ByVal nProg As Integer, ByVal nPause As Integer) As Integer
If Map.refSliceManagerVM.bCalculating OrElse Map.refSliceManagerVM.bCalcSolid Then
Map.refSliceManagerVM.ProcessEvents(nProg, nPause)
End If
If Not IsNothing(Map.refImportLoadingWndVM) Then
Map.refImportLoadingWndVM.ProcessEvents(nProg, nPause)
End If
Map.refMyStatusBarVM.ProcessEvents(nProg, nPause)
Return 0
End Function
' Private Sub SupervisorTimer_Tick()
' If SupervisorCommThread.bViewerOptimizerBlocked And Not m_ManagingSupervisorStop Then
' m_ManagingSupervisorStop = True
' BlockedWnd = New BlockedWndV(Application.Current.MainWindow, New BlockedWndVM)
' BlockedWnd.ShowDialog()
' ElseIf Not SupervisorCommThread.bViewerOptimizerBlocked And m_ManagingSupervisorStop Then
' m_ManagingSupervisorStop = False
' BlockedWnd.Close()
' End If
' End Sub
'#End Region ' METHODS
'#Region "COMMANDS"
'#Region "CloseApplicationCommand"
' ' Returns a command that manage the MainWindow_Unloaded command
' Public ReadOnly Property CloseApplicationCommand() As ICommand
' Get
' If m_cmdCloseApplication Is Nothing Then
' m_cmdCloseApplication = New Command(AddressOf CloseApplication)
' End If
' Return m_cmdCloseApplication
' End Get
' End Property
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Friend Sub CloseApplication()
If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
Return
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()
' gestisco la chiusura della simulazione
If Map.refRightPanelVM.SelPanel = RightPanelVM.Panels.SIMULATION AndAlso Not IsNothing(Map.refSimulationPanelVM) Then
Map.refSimulationPanelVM.MySimul.ResetSimulation()
End If
Dim bAllowClose As Boolean = Map.refSceneHostVM.ManageModified()
' Se non confermata chiusura, esco
If Not bAllowClose Then Return
' salvo modo di visualizzazione
@@ -296,8 +181,53 @@ Public Class MainWindowVM
Application.Current.Shutdown()
End Sub
'#End Region ' CloseApplicationCommand
#Region "COMMANDS"
'#End Region ' COMMANDS
#Region "AboutBoxCommand"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property AboutBoxCommand() As ICommand
Get
If m_cmdAboutBox Is Nothing Then
m_cmdAboutBox = New Command(AddressOf AboutBox)
End If
Return m_cmdAboutBox
End Get
End Property
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Sub AboutBox(ByVal param As Object)
Dim AboutBoxWindow As New AboutBoxV
AboutBoxWindow.Owner = Application.Current.MainWindow
AboutBoxWindow.ShowDialog()
End Sub
#End Region ' AboutBoxCommand
#Region "CloseApplicationCommand"
' Returns a command that manage the MainWindow_Unloaded command
Public ReadOnly Property CloseApplicationCommand() As ICommand
Get
If m_cmdCloseApplication Is Nothing Then
m_cmdCloseApplication = New Command(AddressOf CloseApplication)
End If
Return m_cmdCloseApplication
End Get
End Property
' Manage the MainWindow_Unloaded event. This method is invoked by the cmdMainWindow_Unloaded.
Public Sub CloseApplication(ByVal param As Object)
If Map.refSliceManagerVM.bCalculating Then
'MessageBox.Show("Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, "Impossible closing software! Wait end of calculation!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
CloseApplication()
End Sub
#End Region ' CloseApplicationCommand
#End Region ' COMMANDS
End Class
+151 -133
View File
@@ -1,147 +1,165 @@
<UserControl x:Class="ManagePartPanelV"
<Grid x:Class="ManagePartPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Icarus"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Width="150"
Margin="5,0,0,0"
VerticalAlignment="Stretch">
<Grid DockPanel.Dock="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Style="{StaticResource LeftPanelTitle_Border}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Margin="0,0,0,2.5"
Style="{StaticResource Title_Border}">
<TextBlock Text="PART MANAGER"
Style="{StaticResource Title_TextBlock}"/>
</Border>
<Border Grid.Row="1"
Padding="0,2.5,0,0"
Margin="0,2.5,0,0"
Style="{StaticResource BottomGrayRow_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="Part Entity List"
FontWeight="DemiBold"
FontSize="14"/>
</Border>
<!--<UniformGrid Grid.Row="1" Rows="1"
IsEnabled="{Binding IsEnabled}">
<Button DockPanel.Dock="Left"
Content="+"
FontSize="20"
Command="{Binding AddPart_Command}"
Style="{StaticResource LeftPanel_Button}"/>
<Button DockPanel.Dock="Left"
Content="-"
FontSize="20"
Command="{Binding RemovePart_Command}"
Style="{StaticResource LeftPanel_Button}"/>
</UniformGrid>-->
<TreeView Grid.Row="2"
ItemsSource="{Binding ManagerPartList}"
MinHeight="200"
IsEnabled="{Binding IsEnabled}">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Part}"
ItemsSource="{Binding LayerList}">
<StackPanel Orientation="Horizontal">
<Image Source="/Resources/TreeView/Folder.png"
Height="15"/>
Margin="0,2.5,0,2.5"
Style="{StaticResource Title_TextBlock}"/>
<TreeView x:Name="ManagerPartTreeView"
Grid.Row="1"
ItemsSource="{Binding ManagerPartList}"
MinHeight="200"
IsEnabled="{Binding IsEnabled}"
Margin="0,2.5,0,2.5"
FontSize="12"
Foreground="{StaticResource Icarus_Gray}">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Part}"
ItemsSource="{Binding LayerList}">
<StackPanel Orientation="Horizontal">
<!--<Image Source="/Resources/TreeView/Folder.png"
Height="15"/>-->
<Grid>
<TextBlock Text="{Binding sName}"
Visibility="{Binding TextBlock_Visibility}"
Style="{StaticResource BaseTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding TextBox_Visibility}"
Style="{StaticResource OptionTextBox}"/>
</Grid>
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Layer}"
ItemsSource="{Binding EntityList, UpdateSourceTrigger=PropertyChanged}">
<StackPanel Orientation="Horizontal">
<!--<Image Source="/Resources/TreeView/Folder.png"
Height="15"/>-->
<TextBlock Text="{Binding sName}"
Style="{StaticResource BaseTextBlock}"/>
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:PartManager_GeomEntity}">
<Grid>
<TextBlock Text="{Binding sName}"
Visibility="{Binding TextBlock_Visibility}"/>
Style="{StaticResource BaseTextBlock}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding TextBox_Visibility}"
Style="{StaticResource OptionTextBox}"/>
</Grid>
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Layer}"
ItemsSource="{Binding EntityList, UpdateSourceTrigger=PropertyChanged}">
<StackPanel Orientation="Horizontal">
<Image Source="/Resources/TreeView/Folder.png"
Height="15"/>
<TextBlock Text="{Binding sName}" />
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:PartManager_GeomEntity}">
<Grid>
<TextBlock Text="{Binding sName}" />
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding TextBox_Visibility}"
Style="{StaticResource OptionTextBox}"/>
</Grid>
</HierarchicalDataTemplate>
<!-- Menu' tasto destro -->
<ContextMenu x:Key="RowMenu" ItemsSource="{Binding MenuList}" >
<ContextMenu.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="Command" Value="{Binding MenuItem_Command}"/>
<Setter Property="Header" Value="{Binding sMsg}"/>
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</TreeView.Resources>
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding bIsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<Setter Property="IsExpanded" Value="True"/>
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}"/>
<EventSetter Event="ContextMenuOpening" Handler="Item_ContextMenuOpening"/>
</Style>
</TreeView.ItemContainerStyle>
</TreeView>
<Border Grid.Row="3"
Visibility="{Binding IsImport_Visibility}"
Style="{StaticResource LeftPanelTitle_Border}">
<TextBlock Text="Imported Entity List"
FontWeight="DemiBold"
FontSize="14"/>
</Border>
<ListBox Grid.Row="4"
ItemsSource="{Binding ImportedEntityList, UpdateSourceTrigger=PropertyChanged}"
SelectedItem="{Binding SelImportedEntity}"
MinHeight="100"
IsEnabled="{Binding IsEnabled}"
Visibility="{Binding IsImport_Visibility}">
<ListBox.Resources>
<!-- Menu' tasto destro -->
<ContextMenu x:Key="RowMenu" ItemsSource="{Binding MenuList}" >
<ContextMenu.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="Command" Value="{Binding MenuItem_Command}"/>
<Setter Property="Header" Value="{Binding sMsg}"/>
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch">
<Grid.InputBindings>
<MouseBinding Gesture="LeftDoubleClick"
Command="{Binding GeomEntityDoubleClick_Command}"/>
</Grid.InputBindings>
<TextBlock Text="{Binding ghName}">
</TextBlock>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<UniformGrid Grid.Row="5"
Rows="1"
IsEnabled="{Binding IsEnabled}">
<Button Content="Ok"
Command="{Binding Ok_Command}"
Style="{StaticResource ToolBar_TextButton}"/>
<Button Content="Cancel"
Command="{Binding Cancel_Command}"
Visibility="{Binding IsImport_Visibility}"
Style="{StaticResource ToolBar_TextButton}"/>
</UniformGrid>
</Grid>
</UserControl>
</HierarchicalDataTemplate>
<!-- Menu' tasto destro -->
<ContextMenu x:Key="RowMenu"
ItemsSource="{Binding MenuList}"
Style="{StaticResource Icarus_ContextMenu}">
<ContextMenu.ItemContainerStyle>
<Style TargetType="MenuItem" BasedOn="{StaticResource Icarus_MenuItem}">
<Setter Property="Command" Value="{Binding MenuItem_Command}"/>
<Setter Property="Header" Value="{Binding sMsg}"/>
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</TreeView.Resources>
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource {x:Type TreeViewItem}}">
<Setter Property="IsSelected" Value="{Binding bIsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<Setter Property="IsExpanded" Value="True"/>
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}"/>
<Setter Property="ContextMenuService.Placement" Value="Right"/>
<EventSetter Event="ContextMenuOpening" Handler="Item_ContextMenuOpening"/>
</Style>
</TreeView.ItemContainerStyle>
</TreeView>
<TextBlock Grid.Row="2"
Text="Imported Entity List"
Visibility="{Binding IsImport_Visibility}"
Margin="0,2.5,0,2.5"
Style="{StaticResource Title_TextBlock}"/>
<ListBox Grid.Row="3"
ItemsSource="{Binding ImportedEntityList, UpdateSourceTrigger=PropertyChanged}"
SelectedItem="{Binding SelImportedEntity}"
MinHeight="100"
IsEnabled="{Binding IsEnabled}"
Visibility="{Binding IsImport_Visibility}"
Margin="0,2.5,0,2.5">
<ListBox.Resources>
<!-- Menu' tasto destro -->
<ContextMenu x:Key="RowMenu"
ItemsSource="{Binding MenuList}"
Style="{StaticResource Icarus_ContextMenu}">
<ContextMenu.ItemContainerStyle>
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource Icarus_MenuItem}">
<Setter Property="Command" Value="{Binding MenuItem_Command}"/>
<Setter Property="Header" Value="{Binding sMsg}"/>
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}" />
<Setter Property="ContextMenuService.Placement" Value="Right" />
<Setter Property="ContextMenuService.VerticalOffset" Value="-3" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch">
<Grid.InputBindings>
<MouseBinding Gesture="LeftDoubleClick"
Command="{Binding GeomEntityDoubleClick_Command}"/>
</Grid.InputBindings>
<TextBlock Text="{Binding ghName}">
</TextBlock>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<UniformGrid Grid.Row="4"
Rows="1"
IsEnabled="{Binding IsEnabled}"
Margin="0,2.5,0,0">
<Button Command="{Binding Ok_Command}"
IsDefault="True"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding Cancel_Command}"
Visibility="{Binding IsImport_Visibility}"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Cancel.png"
Style="{StaticResource Button_Image}"/>
</Button>
</UniformGrid>
</Grid>
</Border>
</Grid>
+30 -11
View File
@@ -286,7 +286,8 @@ Public Class ManagePartPanelVM
Next
Next
If sErr.Count > 0 Then
MessageBox.Show(String.Concat(sErr), "Error")
'MessageBox.Show(String.Concat(sErr), "Error")
EgtMessageBoxV.Show(Application.Current.MainWindow, String.Concat(sErr), "Error")
Return
Else
' Creo pezzi e layer necessari
@@ -316,8 +317,9 @@ Public Class ManagePartPanelVM
EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
' calcolo box superficie per creazione riferimento
EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
' elimino colore entita'
' elimino colore entita' e rendo visibile
EgtResetColor(PrintSolidEntity.nId)
EgtSetStatus(PrintSolidEntity.nId, GDB_ST.ON_)
If PrintSolidEntity.sName <> PrintSolidEntity.nId.ToString() Then
EgtSetInfo(PrintSolidEntity.nId, ENTITY_NAME, PrintSolidEntity.sName)
End If
@@ -341,8 +343,9 @@ Public Class ManagePartPanelVM
nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, PartManager_GeomEntity.nId, True)
End Select
EgtSetName(nMachStartId, START_GEOM)
' elimino colore entita'
' elimino colore entita' e rendo visibile
EgtResetColor(nMachStartId)
EgtSetStatus(nMachStartId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
@@ -352,8 +355,9 @@ Public Class ManagePartPanelVM
Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX()
nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB)
EgtSetName(nMachStartId, START_GEOM)
' elimino colore entita'
' elimino colore entita' e rendo visibile
EgtResetColor(nMachStartId)
EgtSetStatus(nMachStartId, GDB_ST.ON_)
End If
Case ManagePart_Layer.LayerType.RIBS
nRibsLayerId = EgtCreateGroup(nPartId)
@@ -364,8 +368,9 @@ Public Class ManagePartPanelVM
EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetInfo(PartManager_GeomEntity.nId, RIB_ID, nRibsIndex)
EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
' elimino colore entita'
' elimino colore entita' e rendo visibile
EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
@@ -375,27 +380,35 @@ Public Class ManagePartPanelVM
nShellNumberLayerId = EgtCreateGroup(nPartId)
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
EgtSetColor(nShellNumberLayerId, GeomEntityColors.c3ShellNumber)
Dim nShellNumberIndex As Integer = 1
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
EgtSetInfo(PartManager_GeomEntity.nId, SHELLNUMBER_ID, nShellNumberIndex)
EgtRelocateGlob(PartManager_GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
' elimino colore entita'
' elimino colore entita' e rendo visibile
EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
nShellNumberIndex += 1
Next
Case ManagePart_Layer.LayerType.AUX_SOLIDS
nAuxSolidsLayerId = EgtCreateGroup(nPartId)
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
EgtSetColor(nAuxSolidsLayerId, GeomEntityColors.c3AuxSolids)
Dim nFilledSolidIndex As Integer = 1
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtSetInfo(PartManager_GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetInfo(PartManager_GeomEntity.nId, FILLEDSOLID_ID, nFilledSolidIndex)
EgtRelocateGlob(PartManager_GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
' elimino colore entita'
' elimino colore entita' e rendo visibile
EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
nFilledSolidIndex += 1
Next
Case ManagePart_Layer.LayerType.OTHERS
nOthersLayerId = EgtCreateGroup(nPartId)
@@ -403,8 +416,9 @@ Public Class ManagePartPanelVM
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
' elimino colore entita'
' elimino colore entita' e rendo visibile
EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
@@ -417,16 +431,18 @@ Public Class ManagePartPanelVM
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
' la trasformo in curva compo
Dim nOtherId As Integer = EgtCreateCurveCompo(nOthersLayerId, PartManager_GeomEntity.nId, True)
' elimino colore entita'
' elimino colore entita' e rendo visibile
EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(nOtherId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
Case Else
' altrimenti la sposto solamente
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
' elimino colore entita'
' elimino colore entita' e rendo visibile
EgtResetColor(PartManager_GeomEntity.nId)
EgtSetStatus(PartManager_GeomEntity.nId, GDB_ST.ON_)
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
End If
@@ -436,6 +452,8 @@ Public Class ManagePartPanelVM
End Select
Next
' aggiungo layer riferimento
Dim nPartReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nPartReferenceLayerId, LAY_PARTREFERENCE)
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
@@ -447,10 +465,11 @@ Public Class ManagePartPanelVM
EgtSetInfo(nPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName)
EgtSetInfo(nPartId, "PartOnTable", 1)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPartReferenceLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
' aggiorno riferimento
Map.refReferencePanelVM.UpdateFramePosition(NewPart)
Map.refSliceManagerVM.UpdateDimensions()
Next
End If
'EgtAddMachGroup("3dPrint")
+25 -20
View File
@@ -512,11 +512,11 @@ Public Class ManagePart_Layer
m_nLayerId = PrintPart.nAuxSolidsLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
While nEntityId <> GDB_ID.NULL
'Dim ShellType As Integer = ShellNumberEntity.ShellNumberTypes.FROMDRAW
'EgtGetInfo(nEntityId, KEY_SHELLNBR_TYPE, ShellType)
'If ShellType = ShellNumberEntity.ShellNumberTypes.FROMIMPORT Then
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
'End If
Dim FIlledSolidType As Integer = FilledSolidEntity.FilledSolidTypes.FROMDRAW
EgtGetInfo(nEntityId, KEY_AUXSOLID_TYPE, FIlledSolidType)
If FIlledSolidType = FilledSolidEntity.FilledSolidTypes.FROMIMPORT Then
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
End If
nEntityId = EgtGetNext(nEntityId)
End While
Case LayerType.OTHERS
@@ -629,7 +629,8 @@ Public Class GeomEntity_MenuItem
Map.refManagePartPanelVM.SetIsEnabled(True)
Return
ElseIf m_Type = ManagePart_Layer.LayerType.DELETE Then
If MessageBox.Show("Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show("Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
EgtErase(m_OrigEntity.nId)
' se l'entita' e' gia' in lista pezzi
If Not IsNothing(m_OrigEntity.OrigLayer) Then
@@ -646,7 +647,9 @@ Public Class GeomEntity_MenuItem
' aggiorno riferimenti nel context menu item
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
' Imposto flag di ricalcolo slice
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
If Map.refManagePartPanelVM.Type = ManagePartPanelVM.ManagePartType.MODIFY Then
EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True)
End If
End If
Return
ElseIf m_Type = ManagePart_Layer.LayerType.NEWPART Then
@@ -718,6 +721,8 @@ Public Class GeomEntity_MenuItem
EgtSetName(nOthersLayerId, LAY_OTHERS)
EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others)
' aggiungo riferimento
Dim nPartReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nPartReferenceLayerId, LAY_PARTREFERENCE)
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL)
@@ -726,7 +731,7 @@ Public Class GeomEntity_MenuItem
' lo aggiungo a lista pezzi
EgtSetInfo(nPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, "PartOnTable", 1)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPartReferenceLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
' aggiorno riferimento
Map.refReferencePanelVM.UpdateFramePosition(NewPart)
@@ -773,9 +778,9 @@ Public Class GeomEntity_MenuItem
End If
End If
' aggiorno riferimenti nel context menu item
m_OrigEntity.UpdateContextMenu()
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
Case ManagePartPanelVM.ManagePartType.MODIFY
Dim bIsMovedRib As Boolean = False
Dim bIsMovedPartOrRib As Boolean = False
' recupero layer da pezzo
Dim nLayerId As Integer = GDB_ID.NULL
Select Case m_Type
@@ -806,11 +811,12 @@ Public Class GeomEntity_MenuItem
EgtMove(m_OrigEntity.nId, -vtMoved, GDB_RT.GLOB)
EgtRemoveInfo(nPartId, KEY_MOVEDPART)
End If
bIsMovedPartOrRib = True
Case ManagePart_Layer.LayerType.MACH_START
Case ManagePart_Layer.LayerType.RIBS
EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE)
EgtRemoveInfo(m_OrigEntity.nId, RIB_ID)
bIsMovedRib = True
bIsMovedPartOrRib = True
Case ManagePart_Layer.LayerType.SHELL_NUMBER
EgtRemoveInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE)
Case ManagePart_Layer.LayerType.AUX_SOLIDS
@@ -834,34 +840,32 @@ Public Class GeomEntity_MenuItem
Select Case m_Type
Case ManagePart_Layer.LayerType.PRINT_SOLID
EgtSetName(m_OrigEntity.nId, PRINT_SOLID)
EgtSetColor(m_OrigEntity.nId, c3Print)
' rimuovo eventuale nota spostamento per 45 gradi
EgtRemoveInfo(m_OrigEntity.OrigLayer.OrigPart.nId, KEY_MOVEDPART)
bIsMovedPartOrRib = True
Case ManagePart_Layer.LayerType.MACH_START
EgtSetName(m_OrigEntity.nId, LAY_MACH_START)
EgtSetColor(m_OrigEntity.nId, c3MachStart)
Case ManagePart_Layer.LayerType.RIBS
EgtSetName(m_OrigEntity.nId, LAY_RIBS)
EgtSetInfo(m_OrigEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetInfo(m_OrigEntity.nId, RIB_ID, RibPanelVM.GetNextRibIndex())
EgtSetColor(m_OrigEntity.nId, c3Rib)
bIsMovedRib = True
bIsMovedPartOrRib = True
Case ManagePart_Layer.LayerType.SHELL_NUMBER
EgtSetName(m_OrigEntity.nId, LAY_SHELL_NBR)
EgtSetInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
EgtSetColor(m_OrigEntity.nId, c3ShellNumber)
Case ManagePart_Layer.LayerType.AUX_SOLIDS
EgtSetName(m_OrigEntity.nId, LAY_AUX_SOLIDS)
EgtSetInfo(m_OrigEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetColor(m_OrigEntity.nId, c3AuxSolids)
Case ManagePart_Layer.LayerType.OTHERS
EgtSetName(m_OrigEntity.nId, LAY_OTHERS)
EgtSetColor(m_OrigEntity.nId, c3Others)
End Select
' resetto colore entita'
EgtResetColor(m_OrigEntity.nId)
' se spostato un Rib, aggiorno posizione riferimento e pezzo
If bIsMovedRib Then
If bIsMovedPartOrRib Then
Map.refReferencePanelVM.UpdateFramePosition(NewPart.PrintPart)
Map.refDispositionPanelVM.UpdateZPos()
Map.refSliceManagerVM.UpdateDimensions()
End If
EgtDraw()
' aggiorno riferimenti nel context menu item
@@ -1034,7 +1038,8 @@ Public Class ManagerLayer_MenuItem
Case Else ' PartMenuCmd.IMPORTPRINT
Dim bDeleteOldPrint As Boolean = False
If m_OrigLayer.EntityList.Count > 0 Then
If MessageBox.Show("Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
'If MessageBox.Show("Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Importing a new print solid the current one will be deleted. Are you sure you want to proced?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
Return
Else
bDeleteOldPrint = True
+2 -1
View File
@@ -769,7 +769,8 @@ Public Class StringMaterialParam
End Property
Public Sub Original()
If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show("Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Are you sure you want to set this material as original?", "Original material confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
m_sGUID = ORIG_MATERIAL
m_sValue = ORIG_MATERIAL
NotifyPropertyChanged(NameOf(sValue))
+106 -53
View File
@@ -1,19 +1,32 @@
<UserControl x:Class="MaterialDbV"
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:PrintApp="clr-namespace:Icarus">
<Border VerticalAlignment="Center"
Style="{StaticResource RightPanel_Border}">
<Grid>
<Grid x:Class="MaterialDbV"
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:PrintApp="clr-namespace:Icarus"
Width="310"
VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Margin="0,0,0,2.5"
Style="{StaticResource Title_Border}">
<TextBlock Text="MATERIAL DATABASE"
Style="{StaticResource Title_TextBlock}"/>
</Border>
<Border Grid.Row="1"
VerticalAlignment="Center"
Margin="0,2.5,0,0"
Style="{StaticResource BottomGrayRow_Border}">
<Grid Margin="2.5,2.5,2.5,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid>
<Grid HorizontalAlignment="Center"
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@@ -24,62 +37,82 @@
<Button Content="Copy"
Command="{Binding Copy_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_Button}"/>
<Button Grid.Column="1"
Content="Save"
Command="{Binding Save_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_Button}"/>
<Button Grid.Column="2" Content="Delete"
Command="{Binding Delete_Command}"
IsEnabled="{Binding Delete_IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_Button}"/>
<Button Grid.Column="3"
Command="{Binding Import_Command}"
ToolTip="{Binding ImportToolTip}"
ToolTip="{Binding Import_ToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/Import.png" Stretch="Uniform"/>
<Image Source="/Resources/MaterialDB/MaterialImport.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Grid.Column="4"
Command="{Binding Export_Command}"
ToolTip="{Binding ImportToolTip}"
ToolTip="{Binding Export_ToolTip}"
IsEnabled="{Binding ImpExp_IsEnabled}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/MachiningDB/Export.png" Stretch="Uniform"/>
<Image Source="/Resources/MaterialDB/MaterialExport.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
<Grid Grid.Row="1">
<Grid Grid.Row="1"
Margin="0,2.5,0,2.5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ComboBox Grid.Row="1"
Name="MaterialCombo"
<ComboBox Name="MaterialCombo"
ItemsSource="{Binding MaterialList}"
SelectedItem="{Binding SelMaterial}"
DisplayMemberPath="ghName"
Visibility="{Binding Combo_Visibility}"
Style="{StaticResource FeatureComboBox}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding SelectedItem.sName, ElementName=MaterialCombo, UpdateSourceTrigger=Explicit}"
ExplicitUpdateSource="EnterKeyPressOrLostFocus"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding Name_Visibility}"/>
HorizontalAlignment="Stretch"
Margin="2.5,0,2.5,0"
Style="{StaticResource RightPanel_ComboBox}"/>
<EgtWPFLib5:EgtTextBox2 Text="{Binding SelectedItem.sName, ElementName=MaterialCombo, UpdateSourceTrigger=Explicit}"
ExplicitUpdateSource="EnterKeyPressOrLostFocus"
IsExplicitFocused="{Binding UserShouldEditValueNow}"
Visibility="{Binding Name_Visibility}"
Margin="2.5,0,2.5,0"
Style="{StaticResource OptionTextBox2}"/>
<Button Grid.Column="1"
Command="{Binding EditName_Command}"
ToolTip="{Binding EditName_ToolTip}"
Margin="2.5,0,2.5,0"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/TopPanel/Edit.png"/>
<Image Source="/Resources/MaterialDB/Edit.png"/>
</Button>
</Grid>
<ScrollViewer Grid.Row="2"
IsEnabled="{Binding IsEnabled}"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl Grid.Row="1"
ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MaterialCombo}"
IsEnabled="{Binding IsEnabled}">
HorizontalScrollBarVisibility="Disabled"
Margin="1,0,0,2.5"
Padding="0"
BorderThickness="0"
Style="{StaticResource RightPanel_ScrollViewer}">
<ItemsControl ItemsSource="{Binding SelectedItem.CathegoryList, ElementName=MaterialCombo}"
BorderThickness="0"
Margin="0"
Padding="0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
<StackPanel Orientation="Vertical"
Margin="0"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
@@ -88,11 +121,14 @@
IsExpanded="{Binding Cathegory_IsExpanded}"
VerticalContentAlignment="Top"
Visibility="{Binding Cathegory_Visibility}">
<ItemsControl ItemsSource="{Binding MaterialParamList}">
<ItemsControl ItemsSource="{Binding MaterialParamList}"
BorderThickness="0"
Margin="0"
Padding="0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="1"
HorizontalAlignment="Stretch"/>
<StackPanel Orientation="Vertical"
Margin="0"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
@@ -102,25 +138,32 @@
</ItemsControl.ItemContainerStyle>
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type PrintApp:NumericMaterialParam}">
<Grid>
<Grid Margin="0,1,2.5,1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"/>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<TextBox Grid.Column="1"
Text="{Binding dValue}"/>
Text="{Binding dValue}"
Margin="2.5,0,0,0"
Style="{StaticResource ParameterList_TextBox}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:StringMaterialParam}">
<Grid Visibility="{Binding String_Visibility}">
<Grid Visibility="{Binding String_Visibility}"
Margin="0,1,2.5,1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"/>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<TextBox Grid.Column="1"
Text="{Binding sValue}"
IsReadOnly="True"/>
@@ -135,29 +178,37 @@
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:ComboMaterialParam}">
<Grid>
<Grid Margin="0,1,2.5,1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"/>
<TextBlock Text="{Binding sName}"
Margin="0,0,2.5,0"
Style="{StaticResource ParameterList_TextBlock}"/>
<ComboBox Grid.Column="1"
ItemsSource="{Binding ValueList}"
SelectedItem="{Binding SelValue}"
HorizontalAlignment="Stretch"/>
HorizontalAlignment="Stretch"
Margin="2.5,0,0,0"
Style="{StaticResource RightPanel_ComboBox}"/>
</Grid>
</DataTemplate>
<DataTemplate DataType="{x:Type PrintApp:CheckMaterialParam}">
<Grid>
<Grid Height="22"
Margin="0,1,2.5,1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding sName}"/>
<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"/>
VerticalAlignment="Center"
Margin="2.5,0,0,0"/>
</Grid>
</DataTemplate>
</ItemsControl.Resources>
@@ -167,12 +218,14 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<UniformGrid Grid.Row="3" Rows="1">
<Button Content="Ok"
Command="{Binding Ok_Command}"
IsEnabled="{Binding IsEnabled}"
Style="{StaticResource ToolBar_TextButton}"/>
</UniformGrid>
<Button Grid.Row="3"
Command="{Binding Ok_Command}"
IsEnabled="{Binding IsEnabled}"
Margin="0,2.5,0,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</Border>
</UserControl>
</Grid>
+32 -5
View File
@@ -24,7 +24,8 @@ Public Class MaterialDbVM
' verifico se modificato
If Not IsNothing(m_SelMaterial) AndAlso m_SelMaterial.bIsModified Then
' chiedo se salvare
Select Case MessageBox.Show("Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
'Select Case MessageBox.Show("Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save material modification?", "Info", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes
m_SelMaterial.Save()
Case MessageBoxResult.No
@@ -128,6 +129,28 @@ Public Class MaterialDbVM
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_cmdCopy As ICommand
@@ -214,7 +237,8 @@ Public Class MaterialDbVM
Public Sub Ok()
If Not IsNothing(m_SelMaterial) AndAlso m_SelMaterial.bIsModified Then
' chiedo se salvare
Select Case MessageBox.Show("Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
'Select Case MessageBox.Show("Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, "Do you want to save material modification?", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning)
Case MessageBoxResult.Yes
m_SelMaterial.Save()
Case MessageBoxResult.No
@@ -343,17 +367,20 @@ Public Class MaterialDbVM
' se materiale originale, esco
If SelMaterialIsOriginal() Then
If Map.refMainWindowVM.MainWindowM.nUserLevel >= 5 Then
If MessageBox.Show("Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
'If MessageBox.Show("Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, "Trying to delete an Original Material! Are you sure you want to delete it?", "", MessageBoxButton.YesNo, MessageBoxImage.Warning) <> MessageBoxResult.Yes Then
Return
End If
sCheckMessage = "Trying to delete an Original Material! Are you ABSOLUTELY sure you want to delete it?"
Else
MessageBox.Show("Original material impossible to delete!")
'MessageBox.Show("Original material impossible to delete!")
EgtMessageBoxV.Show(Application.Current.MainWindow, "Original material impossible to delete!")
Return
End If
End If
' chiedo conferma
Select Case MessageBox.Show(sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Select Case EgtMessageBoxV.Show(Application.Current.MainWindow, sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
'MessageBox.Show(sCheckMessage, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
Case MessageBoxResult.Yes
m_MaterialList.Remove(m_SelMaterial)
SetIsModified(True)
+2 -2
View File
@@ -70,5 +70,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.2.2")>
<Assembly: AssemblyFileVersion("2.5.2.2")>
<Assembly: AssemblyVersion("2.5.10.1")>
<Assembly: AssemblyFileVersion("2.5.10.1")>
-36
View File
@@ -1,36 +0,0 @@
<EgtWPFLib5:EgtCustomWindow x:Class="MachineBox"
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"
Height="160" Width="380" WindowStyle="None" ResizeMode="NoResize"
TitleBarHeight="30" IsResizable="False" IsMinimizable="False"
ShowInTaskbar="False" WindowStartupLocation="CenterOwner">
<Border BorderThickness="2" BorderBrush="LightBlue">
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="0.25*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="0.25*"/>
</Grid.RowDefinitions>
<TextBlock Name="MessageLbl" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Center"
VerticalAlignment="Center" />
<UniformGrid Grid.Column="1" Grid.Row="3" Columns="3">
<Button Name="ReplaceBtn" Height="26" Margin="0,0,5,0"/>
<Button Name="UpdateBtn" Height="26" Margin="5,0,5,0"/>
<Button Name="CancelBtn" IsDefault="True" Height="26" Margin="5,0,0,0"/>
</UniformGrid>
</Grid>
</Border>
</EgtWPFLib5:EgtCustomWindow>
-45
View File
@@ -1,45 +0,0 @@
Imports EgtUILib
Public Class MachineBox
Public Shadows DialogResult As MessageBoxResult = MessageBoxResult.Cancel
Public Sub New( Owner As Window, sMachName As String)
InitializeComponent()
Me.Owner = Owner
Title = EgtMsg( 6534) ' Avviso
MessageLbl.Text = String.Format( EgtMsg( 6528), sMachName) ' La macchina "{0}" esiste già,<br/> cosa vuoi fare ?
ReplaceBtn.Content = EgtMsg( 6531) ' Sostituisci
UpdateBtn.Content = EgtMsg( 6532) ' Aggiorna
CancelBtn.Content = EgtMsg( 6533) ' Annulla
End Sub
Private Sub ReplaceBtn_Click( sender As Object, e As RoutedEventArgs) Handles ReplaceBtn.Click
DialogResult = MessageBoxResult.Yes
Close()
End Sub
Private Sub UpdateBtn_Click( sender As Object, e As RoutedEventArgs) Handles UpdateBtn.Click
DialogResult = MessageBoxResult.No
Close()
End Sub
Private Sub CancelBtn_Click( sender As Object, e As RoutedEventArgs) Handles CancelBtn.Click
DialogResult = MessageBoxResult.Cancel
Close()
End Sub
Public Overloads Function ShowDialog() As MessageBoxResult
MyBase.ShowDialog()
Return DialogResult
End Function
End Class
@@ -0,0 +1,223 @@
<EgtWPFLib5:EgtCustomWindow x:Class="OptionWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Icarus="clr-namespace:Icarus"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
Title="{Binding Title}" Icon="/Resources/Icarus.ico"
Background="Transparent"
AllowsTransparency="True"
BorderThickness="0"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="0" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
MinWidth="400" MinHeight="382"
Width="400" Height="412">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Border Margin="0,0,0,2.5"
Style="{StaticResource Title_Border}">
<TextBlock Text="SETTINGS"
Style="{StaticResource Title_TextBlock}"/>
</Border>
<Border Grid.Row="1"
Margin="0,2.5,0,0"
CornerRadius="4"
Style="{StaticResource WhiteBottomBlueRow_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TabControl Margin="5,5,5,5">
<TabItem Header="{Binding GenericMsg}">
<StackPanel Margin="5,5,5,0">
<!--<GroupBox Header="{Binding CurrentLanguageMsg}"
Margin="0,0,0,5">
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvertMsg}" TextWrapping="Wrap"
TextAlignment="Center"/>
</UniformGrid>
</GroupBox>-->
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding TopSceneBackgroundMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding TopSceneBackground}"
Command="{Binding TopSceneBackground_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding BotSceneBackgroundMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding BotSceneBackground}"
Command="{Binding BotSceneBackground_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GridColorMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding GridColor}"
Command="{Binding GridColor_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ThickLineMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding ThickLine}"
Grid.Column="1" Grid.Row="0" Margin="22,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding SmoothTriMeshMsg}" VerticalAlignment="Center"
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"/>
</Grid>
<Grid Margin="5,5,5,5">
<Button Content="{Binding UpdateLicenceMsg}" Command="{Binding UpdateLicence_Command}" Height="26" Margin="100,1"/>
</Grid>
</StackPanel>
</TabItem>
<TabItem Header="{Binding CADMsg}">
<StackPanel Margin="5,5,5,0">
<UniformGrid Grid.ColumnSpan="2" Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding GeometryTolerance}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,0"/>
</UniformGrid>
<ItemsControl ItemsSource="{Binding LayerColorList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding Color_Msg}" VerticalAlignment="Center"/>
<Grid Margin="10,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="35"/>
</Grid.ColumnDefinitions>
<Button Background="{Binding Background}"
Command="{Binding Color_Command}"
Margin="0,0,5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Slider Grid.Column="1"
Value="{Binding dAlpha}"
Minimum="10"
Maximum="100"
TickPlacement="BottomRight"
TickFrequency="10"
IsSnapToTickEnabled="True"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="2"
Text="{Binding sAlpha}"
TextAlignment="Right"/>
</Grid>
</UniformGrid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</TabItem>
<TabItem Header="{Binding ImportMsg}">
<StackPanel Margin="5,5,5,0">
<Grid Margin="0,5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="1"
VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding UnitScaleMsg}" />
<TextBlock Grid.Row="0" Grid.Column="2"
VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding FactorScaleMsg}"/>
<TextBlock Grid.Row="1" Grid.Column="0"
Text="{Binding DxfScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="1" Grid.Column="1"
ItemsSource="{Binding ScaleDXFList, Mode=OneWay}"
SelectedItem="{Binding SelectedDXFScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="1" Grid.Column="2"
Text="{Binding DxfScaleFactor}" Height="25"
IsEnabled="{Binding DXFScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<TextBlock Grid.Row="2" Grid.Column="0"
Text="{Binding StlScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="2" Grid.Column="1"
ItemsSource="{Binding ScaleSTLList, Mode=OneWay}"
SelectedItem="{Binding SelectedSTLScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="2" Grid.Column="2"
Text="{Binding StlScaleFactor}" Height="25"
IsEnabled="{Binding STLScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
</Grid>
</StackPanel>
</TabItem>
<!--<TabItem Header="{Binding ExportMsg}">
<StackPanel>
<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding ImageMsg}"
Margin="5,5,5,0">
<UniformGrid Grid.ColumnSpan="2" Columns="2">
<TextBlock Text="{Binding ImageWidthMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ImageWidth}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<TextBlock Text="{Binding ImageHeightMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ImageHeight}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
</UniformGrid>
</GroupBox>
</StackPanel>
</TabItem>-->
<TabItem Header="{Binding CAMMsg}">
<StackPanel>
<Grid Margin="5,5,5,0">
<Button Content="{Binding AddMachineMsg}" Command="{Binding AddMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
<Grid Margin="5,5,5,0">
<Button Content="{Binding ExportMachineMsg}" Command="{Binding ExportMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
</StackPanel>
</TabItem>
</TabControl>
<Button Grid.Row="1"
IsCancel="True"
HorizontalAlignment="Center"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</Border>
</Grid>
</EgtWPFLib5:EgtCustomWindow>
+330 -316
View File
@@ -1,328 +1,342 @@
<EgtWPFLib5:EgtCustomWindow x:Class="OptionWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Icarus="clr-namespace:Icarus"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
Title="{Binding Title}" Icon="/Resources/Icarus.ico"
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
MinWidth="400" MinHeight="382"
Width="400" Height="412">
<EgtWPFLib5:EgtMainWindow x:Class="OptionWindowV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Icarus="clr-namespace:Icarus"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Style="{StaticResource Dialog_Window}"
Title="{Binding Title}" Icon="/Resources/Icarus.ico"
WindowStyle="None" ResizeMode="NoResize"
WindowStartupLocation="CenterOwner" ShowInTaskbar="False"
MinWidth="400" MinHeight="382"
Width="400" Height="412">
<!--<EgtWPFLib5:EgtCustomWindow.Resources>
<local:GeomTypeConverter x:Key="GeomTypeConverter"/>
</EgtWPFLib5:EgtCustomWindow.Resources>-->
<TabControl Margin="5,5,5,5">
<TabItem Header="{Binding GenericMsg}">
<StackPanel Margin="5,5,5,0">
<!--<GroupBox Header="{Binding CurrentLanguageMsg}"
Margin="0,0,0,5">
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvertMsg}" TextWrapping="Wrap"
TextAlignment="Center"/>
</UniformGrid>
</GroupBox>-->
<UniformGrid Columns="2"
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TabControl Margin="5,5,5,5">
<TabItem Header="{Binding GenericMsg}">
<StackPanel Margin="5,5,5,0">
<!--<GroupBox Header="{Binding CurrentLanguageMsg}"
Margin="0,0,0,5">
<TextBlock Text="{Binding TopSceneBackgroundMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding TopSceneBackground}"
Command="{Binding TopSceneBackground_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding BotSceneBackgroundMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding BotSceneBackground}"
Command="{Binding BotSceneBackground_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GridColorMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding GridColor}"
Command="{Binding GridColor_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ThickLineMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding ThickLine}"
Grid.Column="1" Grid.Row="0" Margin="22,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding SmoothTriMeshMsg}" VerticalAlignment="Center"
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"/>
</Grid>
<!--<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding FontMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding FontList, Mode=OneWay}"
SelectedItem="{Binding SelectedTextFont}" Height="25"
Margin="10,5,0,0"/>
</UniformGrid>-->
<Grid Margin="5,5,5,5">
<Button Content="{Binding UpdateLicenceMsg}" Command="{Binding UpdateLicence_Command}" Height="26" Margin="100,1"/>
</Grid>
</StackPanel>
</TabItem>
<TabItem Header="{Binding CADMsg}">
<StackPanel Margin="5,5,5,0">
<UniformGrid Grid.ColumnSpan="2" Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding GeometryTolerance}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,0"/>
</UniformGrid>
<ItemsControl ItemsSource="{Binding LayerColorList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding Color_Msg}" VerticalAlignment="Center"/>
<Grid Margin="10,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="35"/>
</Grid.ColumnDefinitions>
<Button Background="{Binding Background}"
Command="{Binding Color_Command}"
Margin="0,0,5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Slider Grid.Column="1"
Value="{Binding dAlpha}"
Minimum="10"
Maximum="100"
TickPlacement="BottomRight"
TickFrequency="10"
IsSnapToTickEnabled="True"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="2"
Text="{Binding sAlpha}"
TextAlignment="Right"/>
</Grid>
</UniformGrid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding DimensionMsg}"
Margin="0,0,0,5">
<UniformGrid Grid.ColumnSpan="2" Columns="2">
<TextBlock Text="{Binding ExtLineLenMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ExtLineLen}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding ArrowLenMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ArrowLen}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding TextDistMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding TextDist}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding LenIsMMMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
SelectedItem="{Binding SelectedUnitMeasure}" Height="25"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding DecDigitMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding DecDigit}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding FontMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding FontList, Mode=OneWay}"
SelectedItem="{Binding SelectedFont}" Height="25"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding TextHeightMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding TextHeight}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
</UniformGrid>
</GroupBox>-->
</StackPanel>
</TabItem>
<TabItem Header="{Binding ImportMsg}">
<StackPanel Margin="5,5,5,0">
<Grid Margin="0,5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="1"
VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding UnitScaleMsg}" />
<TextBlock Grid.Row="0" Grid.Column="2"
VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding FactorScaleMsg}"/>
<TextBlock Grid.Row="1" Grid.Column="0"
Text="{Binding DxfScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="1" Grid.Column="1"
ItemsSource="{Binding ScaleDXFList, Mode=OneWay}"
SelectedItem="{Binding SelectedDXFScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="1" Grid.Column="2"
Text="{Binding DxfScaleFactor}" Height="25"
IsEnabled="{Binding DXFScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<TextBlock Grid.Row="2" Grid.Column="0"
Text="{Binding StlScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="2" Grid.Column="1"
ItemsSource="{Binding ScaleSTLList, Mode=OneWay}"
SelectedItem="{Binding SelectedSTLScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="2" Grid.Column="2"
Text="{Binding StlScaleFactor}" Height="25"
IsEnabled="{Binding STLScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<!--<TextBlock Grid.Row="3" Grid.Column="0"
Text="{Binding ImageScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="3" Grid.Column="1"
ItemsSource="{Binding ScaleImageList, Mode=OneWay}"
SelectedItem="{Binding SelectedImageScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="3" Grid.Column="2"
Text="{Binding ImageScaleFactor}" Height="25"
IsEnabled="{Binding ImageScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>-->
</Grid>
</StackPanel>
</TabItem>
<!--<TabItem Header="{Binding ExportMsg}">
<StackPanel>
<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding ImageMsg}"
Margin="5,5,5,0">
<UniformGrid Grid.ColumnSpan="2" Columns="2">
<TextBlock Text="{Binding ImageWidthMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ImageWidth}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<TextBlock Text="{Binding ImageHeightMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ImageHeight}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
</UniformGrid>
</GroupBox>
</StackPanel>
</TabItem>-->
<TabItem Header="{Binding CAMMsg}">
<StackPanel>
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding MachiningSelGeomMsg}"
Margin="5,5,5,0">
<UniformGrid Columns="2">
<TextBlock Text="{Binding GeomTypeDrillingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedDrillingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypeSawingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedSawingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypeMillingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedMillingGeomType}" Height="25"
<UniformGrid Rows="2" Margin="3,3,3,3">
<ComboBox ItemsSource="{Binding LanguageList, Mode=OneWay}" Height="25"
DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage}"
Margin="0,0,0,5"/>
<TextBlock Text="{Binding LanguageAdvertMsg}" TextWrapping="Wrap"
TextAlignment="Center"/>
</UniformGrid>
</GroupBox>-->
<UniformGrid Columns="2"
Margin="0,0,0,5">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypePocketingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedPocketingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypeMortisingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedMortisingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypeChiselingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedChiselingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding TopSceneBackgroundMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding TopSceneBackground}"
Command="{Binding TopSceneBackground_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
</GroupBox>-->
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding BotSceneBackgroundMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding BotSceneBackground}"
Command="{Binding BotSceneBackground_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GridColorMsg}" VerticalAlignment="Center"/>
<Button Background="{Binding GridColor}"
Command="{Binding GridColor_Command}"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
</UniformGrid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding ThickLineMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,5,0,5"/>
<CheckBox IsChecked="{Binding ThickLine}"
Grid.Column="1" Grid.Row="0" Margin="22,5,0,5" VerticalAlignment="Center"/>
<TextBlock Text="{Binding SmoothTriMeshMsg}" VerticalAlignment="Center"
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"/>
</Grid>
<!--<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding FontMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding FontList, Mode=OneWay}"
SelectedItem="{Binding SelectedTextFont}" Height="25"
Margin="10,5,0,0"/>
</UniformGrid>-->
<Grid Margin="5,5,5,5">
<Button Content="{Binding UpdateLicenceMsg}" Command="{Binding UpdateLicence_Command}" Height="26" Margin="100,1"/>
</Grid>
</StackPanel>
</TabItem>
<TabItem Header="{Binding CADMsg}">
<StackPanel Margin="5,5,5,0">
<UniformGrid Grid.ColumnSpan="2" Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding GeometryToleranceMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding GeometryTolerance}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,0"/>
</UniformGrid>
<ItemsControl ItemsSource="{Binding LayerColorList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<UniformGrid Columns="2"
Margin="0,0,0,5">
<TextBlock Text="{Binding Color_Msg}" VerticalAlignment="Center"/>
<Grid Margin="10,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="35"/>
</Grid.ColumnDefinitions>
<Button Background="{Binding Background}"
Command="{Binding Color_Command}"
Margin="0,0,5,0"
Style="{StaticResource EgtWPFLib5_InputButton}"/>
<Slider Grid.Column="1"
Value="{Binding dAlpha}"
Minimum="10"
Maximum="100"
TickPlacement="BottomRight"
TickFrequency="10"
IsSnapToTickEnabled="True"
Margin="0,0,5,0"/>
<TextBlock Grid.Column="2"
Text="{Binding sAlpha}"
TextAlignment="Right"/>
</Grid>
</UniformGrid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding DimensionMsg}"
Margin="0,0,0,5">
<UniformGrid Grid.ColumnSpan="2" Columns="2">
<TextBlock Text="{Binding ExtLineLenMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ExtLineLen}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding ArrowLenMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ArrowLen}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding TextDistMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding TextDist}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding LenIsMMMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding UnitMeasureList, Mode=OneWay}"
SelectedItem="{Binding SelectedUnitMeasure}" Height="25"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding DecDigitMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding DecDigit}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding FontMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding FontList, Mode=OneWay}"
SelectedItem="{Binding SelectedFont}" Height="25"
Margin="10,5,0,0"/>
<TextBlock Text="{Binding TextHeightMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding TextHeight}" Height="25"
VerticalContentAlignment="Center"
Margin="10,5,0,0"/>
</UniformGrid>
</GroupBox>-->
</StackPanel>
<!--<Grid Margin="5,5,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding NewMachiningPosMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,0,0,5"/>
<CheckBox IsChecked="{Binding NewMachiningIsLastOne}"
Grid.Column="1" Grid.Row="0" Margin="4,0,0,0" VerticalAlignment="Center"/>
<TextBlock Text="{Binding UseDispositionScriptMsg}" VerticalAlignment="Center"
Grid.Row="1" Margin="0,0,0,5"/>
<CheckBox IsChecked="{Binding UseDispositionScript}"
Grid.Column="1" Grid.Row="1" Margin="4,0,0,0" VerticalAlignment="Center"/>
</Grid>-->
</TabItem>
<TabItem Header="{Binding ImportMsg}">
<StackPanel Margin="5,5,5,0">
<Grid Margin="0,5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="1"
VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding UnitScaleMsg}" />
<TextBlock Grid.Row="0" Grid.Column="2"
VerticalAlignment="Center" HorizontalAlignment="Center"
Text="{Binding FactorScaleMsg}"/>
<Grid Margin="5,5,5,0">
<Button Content="{Binding AddMachineMsg}" Command="{Binding AddMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
<TextBlock Grid.Row="1" Grid.Column="0"
Text="{Binding DxfScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="1" Grid.Column="1"
ItemsSource="{Binding ScaleDXFList, Mode=OneWay}"
SelectedItem="{Binding SelectedDXFScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="1" Grid.Column="2"
Text="{Binding DxfScaleFactor}" Height="25"
IsEnabled="{Binding DXFScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<TextBlock Grid.Row="2" Grid.Column="0"
Text="{Binding StlScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="2" Grid.Column="1"
ItemsSource="{Binding ScaleSTLList, Mode=OneWay}"
SelectedItem="{Binding SelectedSTLScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="2" Grid.Column="2"
Text="{Binding StlScaleFactor}" Height="25"
IsEnabled="{Binding STLScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<!--<TextBlock Grid.Row="3" Grid.Column="0"
Text="{Binding ImageScaleFactorMsg}" VerticalAlignment="Center"/>
<ComboBox Grid.Row="3" Grid.Column="1"
ItemsSource="{Binding ScaleImageList, Mode=OneWay}"
SelectedItem="{Binding SelectedImageScale, UpdateSourceTrigger=PropertyChanged}" Height="25"
Margin="10,0,0,5"/>
<TextBox Grid.Row="3" Grid.Column="2"
Text="{Binding ImageScaleFactor}" Height="25"
IsEnabled="{Binding ImageScaleEnable, UpdateSourceTrigger=LostFocus}"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>-->
</Grid>
</StackPanel>
</TabItem>
<!--<TabItem Header="{Binding ExportMsg}">
<StackPanel>
<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding ImageMsg}"
Margin="5,5,5,0">
<UniformGrid Grid.ColumnSpan="2" Columns="2">
<TextBlock Text="{Binding ImageWidthMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ImageWidth}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
<TextBlock Text="{Binding ImageHeightMsg}" VerticalAlignment="Center"/>
<TextBox Text="{Binding ImageHeight}" Height="25"
VerticalContentAlignment="Center"
Margin="10,0,0,5"/>
</UniformGrid>
</GroupBox>
</StackPanel>
</TabItem>-->
<TabItem Header="{Binding CAMMsg}">
<StackPanel>
<!--<GroupBox Grid.Column="1" Grid.RowSpan="2"
Header="{Binding MachiningSelGeomMsg}"
Margin="5,5,5,0">
<UniformGrid Columns="2">
<TextBlock Text="{Binding GeomTypeDrillingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedDrillingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypeSawingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedSawingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypeMillingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedMillingGeomType}" Height="25"
Margin="0,0,0,5">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypePocketingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedPocketingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypeMortisingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedMortisingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Text="{Binding GeomTypeChiselingMsg}" VerticalAlignment="Center"/>
<ComboBox ItemsSource="{Binding GeomTypeList, Mode=OneWay}"
SelectedItem="{Binding SelectedChiselingGeomType}" Height="25">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource GeomTypeConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</UniformGrid>
</GroupBox>-->
<Grid Margin="5,5,5,0">
<Button Content="{Binding ExportMachineMsg}" Command="{Binding ExportMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
</StackPanel>
</TabItem>
</TabControl>
<!--<Grid Margin="5,5,5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding NewMachiningPosMsg}" VerticalAlignment="Center"
Grid.Row="0" Margin="0,0,0,5"/>
<CheckBox IsChecked="{Binding NewMachiningIsLastOne}"
Grid.Column="1" Grid.Row="0" Margin="4,0,0,0" VerticalAlignment="Center"/>
<TextBlock Text="{Binding UseDispositionScriptMsg}" VerticalAlignment="Center"
Grid.Row="1" Margin="0,0,0,5"/>
<CheckBox IsChecked="{Binding UseDispositionScript}"
Grid.Column="1" Grid.Row="1" Margin="4,0,0,0" VerticalAlignment="Center"/>
</Grid>-->
</EgtWPFLib5:EgtCustomWindow>
<Grid Margin="5,5,5,0">
<Button Content="{Binding AddMachineMsg}" Command="{Binding AddMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
<Grid Margin="5,5,5,0">
<Button Content="{Binding ExportMachineMsg}" Command="{Binding ExportMachine_Command}" Height="26" Margin="100,1"/>
</Grid>
</StackPanel>
</TabItem>
</TabControl>
<Button Grid.Row="1"
Command="{Binding Ok_Command}"
IsCancel="True"
Margin="0,0,2.5,0"
Style="{StaticResource RightPanel_HalfRound_Button}">
<Image Source="\Resources\Common\Ok.png"
Style="{StaticResource Button_Image}"/>
</Button>
</Grid>
</EgtWPFLib5:EgtMainWindow>
+74 -94
View File
@@ -563,17 +563,17 @@ 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 UpdateLicenceMsg As String
Get
Return EgtMsg( 6553) ' Aggiorna licenza
Return EgtMsg(6553) ' Aggiorna licenza
End Get
End Property
@@ -759,15 +759,19 @@ Public Class OptionWindowVM
End If
Next
' Creo dialogo colori
Dim ColorDlg As New System.Windows.Forms.ColorDialog
ColorDlg.FullOpen = True
ColorDlg.CustomColors = nCustomColors.ToArray()
ColorDlg.Color = Col.ToColor()
'Dim ColorDlg As New System.Windows.Forms.ColorDialog
'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 +801,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,71 +960,74 @@ 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)
'MessageBox.Show(sOut, EgtMsg(MSG_MESSAGEBOX + 2), MessageBoxButton.OK, MessageBoxImage.Warning)
EgtMessageBoxV.Show(Application.Current.MainWindow, 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 MachineBox( Application.Current.MainWindow, sMachName)
Select MachBox.ShowDialog()
Case MessageBoxResult.Yes
bUpdate = False
Case MessageBoxResult.No
bUpdate = True
Case MessageBoxResult.Cancel
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory( sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
Dim MachBox As New UpdateMachineV(Application.Current.MainWindow, New UpdateMachineVM(sMachName))
MachBox.ShowDialog()
Select Case MachBox.DialogResult
Case MessageBoxResult.Yes
bUpdate = False
Case MessageBoxResult.No
bUpdate = True
Case MessageBoxResult.Cancel
' Rimuovo il direttorio temporaneo ed esco
My.Computer.FileSystem.DeleteDirectory(sTempDir, FileIO.DeleteDirectoryOption.DeleteAllContents)
Return
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)
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
EgtOutLog(sKo)
'MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
Return
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"
If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Tools") Then
If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Tools") Then
My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Tools", FileIO.DeleteDirectoryOption.DeleteAllContents)
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\Tools") Then
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\Tools") Then
My.Computer.FileSystem.DeleteDirectory(sMachDir & "\Tools", FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Tools", sMachDir & "\Tools", True)
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\Tools", sMachDir & "\Tools", True)
End If
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\Machinings") Then
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\Machinings") Then
@@ -1037,57 +1047,20 @@ Public Class OptionWindowVM
End If
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\SetUp", sMachDir & "\SetUp", True)
End If
'If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Beam") Then
' ' Flag per sovrascrivere vecchio file BeamData.lua con nuovo
' Dim bBeamDataExists As Boolean = False
' Const sBeamData As String = "\BeamData.lua"
' ' Flag per sovrascrivere vecchio file MachiningTypes.ini
' Dim bMchgTypesExists As Boolean = False
' Const sMchgTypes As String = "\MachiningTypes.ini"
' If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Beam") Then
' If My.Computer.FileSystem.FileExists( sMachDir & "\Beam" & sBeamData) Then
' bBeamDataExists = True
' My.Computer.FileSystem.MoveFile( sMachDir & "\Beam" & sBeamData, sMachDir & sBeamData, True)
' End If
' If My.Computer.FileSystem.FileExists( sMachDir & "\Beam" & sMchgTypes) Then
' bMchgTypesExists = True
' My.Computer.FileSystem.MoveFile( sMachDir & "\Beam" & sMchgTypes, sMachDir & sMchgTypes, True)
' End If
' My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Beam", FileIO.DeleteDirectoryOption.DeleteAllContents)
' End If
' My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Beam", sMachDir & "\Beam", True)
' If bBeamDataExists Then My.Computer.FileSystem.MoveFile( sMachDir & sBeamData, sMachDir & "\Beam" & sBeamData, True)
' If bMchgTypesExists Then My.Computer.FileSystem.MoveFile( sMachDir & sMchgTypes, sMachDir & "\Beam" & sMchgTypes, True)
'End If
'If My.Computer.FileSystem.DirectoryExists( sBackupDir & "\Wall") Then
' ' Flag per sovrascrittura vecchio file WallData.lua con nuovo
' Dim bWallDataExists As Boolean = False
' Const sWallData As String = "\WallData.lua"
' ' Flag per sovrascrivere vecchio file MachiningTypes.ini
' Dim bMchgTypesExists As Boolean = False
' Const sMchgTypes As String = "\MachiningTypes.ini"
' If My.Computer.FileSystem.DirectoryExists( sMachDir & "\Wall") Then
' If My.Computer.FileSystem.FileExists( sMachDir & "\Wall" & sWallData) Then
' bWallDataExists = True
' My.Computer.FileSystem.MoveFile( sMachDir & "\Wall" & sWallData, sMachDir & sWallData, True)
' End If
' If My.Computer.FileSystem.FileExists( sMachDir & "\Wall" & sMchgTypes) Then
' bMchgTypesExists = True
' My.Computer.FileSystem.MoveFile( sMachDir & "\Wall" & sMchgTypes, sMachDir & sMchgTypes, True)
' End If
' My.Computer.FileSystem.DeleteDirectory( sMachDir & "\Wall", FileIO.DeleteDirectoryOption.DeleteAllContents)
' End If
' My.Computer.FileSystem.CopyDirectory( sBackupDir & "\Wall", sMachDir & "\Wall", True)
' If bWallDataExists Then My.Computer.FileSystem.MoveFile( sMachDir & sWallData, sMachDir & "\Wall" & sWallData, True)
' If bMchgTypesExists Then My.Computer.FileSystem.MoveFile( sMachDir & sMchgTypes, sMachDir & "\Wall" & sMchgTypes, True)
'End If
If My.Computer.FileSystem.DirectoryExists(sBackupDir & "\CustomData") Then
If My.Computer.FileSystem.DirectoryExists(sMachDir & "\CustomData") Then
My.Computer.FileSystem.DeleteDirectory(sMachDir & "\CustomData", FileIO.DeleteDirectoryOption.DeleteAllContents)
End If
My.Computer.FileSystem.CopyDirectory(sBackupDir & "\CustomData", sMachDir & "\CustomData", True)
End If
End If
'La macchina "{0}" è stata aggiornata con successo.
Dim sOk As String = String.Format(EgtMsg(6530), sMachName)
EgtOutLog( sOk)
MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
EgtOutLog(sOk)
'MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, 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
@@ -1133,7 +1106,7 @@ Public Class OptionWindowVM
' aggiungo i file della Macchina
Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sCurrMachineName
If Directory.Exists(sMachineDir) Then
zip.AddItem(sMachineDir, sCurrMachineName)
zip.AddSelectedFiles("name != *\.git\*.* and name != *.git*", sMachineDir, sCurrMachineName, True)
End If
' salvo lo zip
zip.Save()
@@ -1143,12 +1116,14 @@ Public Class OptionWindowVM
' L'esportazione della macchina "{0}" non è riuscita.
Dim sKo As String = String.Format(EgtMsg(6551), sCurrMachineName)
EgtOutLog(sKo)
MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
'MessageBox.Show(sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sKo, EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK)
End Try
'La macchina "{0}" è stata esportata con successo.
Dim sOk As String = String.Format(EgtMsg(6552), sCurrMachineName)
EgtOutLog(sOk)
MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
'MessageBox.Show(sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
EgtMessageBoxV.Show(Application.Current.MainWindow, sOk, EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK)
End Sub
#End Region ' ExportMachine
@@ -1255,10 +1230,15 @@ Public Class LayerColor
End If
Next
' Creo dialogo colori
Dim ColorDlg As New System.Windows.Forms.ColorDialog
ColorDlg.FullOpen = True
ColorDlg.CustomColors = nCustomColors.ToArray()
ColorDlg.Color = Col.ToColor()
'Dim ColorDlg As New System.Windows.Forms.ColorDialog
'ColorDlg.FullOpen = True
'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
+35 -20
View File
@@ -9,19 +9,23 @@
<Button Command="{Binding New_Command}"
ToolTip="{Binding NewToolTip}"
IsEnabled="{Binding ProjCmd_IsEnabled}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/New.png" Stretch="Uniform"/>
Margin="0,0,2.5,0"
Style="{StaticResource ProjManager_Button}">
<Image Source="/Resources/ProjectManager/New.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding OpenCommand}"
ToolTip="{Binding OpenToolTip}"
ContextMenuService.Placement="Bottom"
Tag="{Binding}"
IsEnabled="{Binding ProjCmd_IsEnabled}"
Style="{StaticResource ToolBar_Button}">
Margin="2.5,0,2.5,0"
Style="{StaticResource ProjManager_Button}">
<Button.ContextMenu>
<ContextMenu ItemsSource="{Binding MruFileNames}">
<ContextMenu ItemsSource="{Binding MruFileNames}"
Style="{StaticResource Icarus_ContextMenu}">
<ContextMenu.Resources>
<Style TargetType="{x:Type MenuItem}">
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource Icarus_MenuItem}">
<Setter Property="Command"
Value="{Binding PlacementTarget.Tag.OpenMruFileCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}" />
<Setter Property="CommandParameter" Value="{Binding}" />
@@ -29,47 +33,58 @@
</ContextMenu.Resources>
</ContextMenu>
</Button.ContextMenu>
<Image Source="/Resources/ProjectManager/Open.png" Stretch="Uniform"/>
<Image Source="/Resources/ProjectManager/Open.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}"
IsEnabled="{Binding ProjCmd_IsEnabled}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource ProjManager_Button}">
<Image Source="/Resources/ProjectManager/Save.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding SaveAsCommand}"
ToolTip="{Binding SaveAsToolTip}"
IsEnabled="{Binding ProjCmd_IsEnabled}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/SaveAs.png" Stretch="Uniform"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource ProjManager_Button}">
<Image Source="/Resources/ProjectManager/SaveAs.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding ImportCommand}"
ToolTip="{Binding ImportToolTip}"
IsEnabled="{Binding ProjCmd_IsEnabled}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/Import.png" Stretch="Uniform"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource ProjManager_Button}">
<Image Source="/Resources/ProjectManager/Import.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding ExportCommand}"
ToolTip="{Binding ExportToolTip}"
IsEnabled="{Binding ProjCmd_IsEnabled}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/Export.png" Stretch="Uniform"/>
Margin="2.5,0,2.5,0"
Style="{StaticResource ProjManager_Button}">
<Image Source="/Resources/ProjectManager/Export.png"
Style="{StaticResource Button_Image}"/>
</Button>
<!--<Button Command="{Binding ExportCommand}" ToolTip="{Binding ExportToolTip}"
IsEnabled="{Binding DrawIsChecked}">
<Image Source="/Resources/ProjectManager/Export.png" Stretch="Uniform"/>
</Button>-->
<Button Command="{Binding OptionsCommand}"
Width="30"
ToolTip="{Binding OptionsToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/Options.png" Height="22" />
Margin="2.5,0,2.5,0"
Style="{StaticResource ProjManager_Button}">
<Image Source="/Resources/ProjectManager/Options.png"
Style="{StaticResource Button_Image}"/>
</Button>
<Button Command="{Binding SendFeedbackCommand}"
Width="30"
ToolTip="{Binding SendFeedbackToolTip}"
Style="{StaticResource ToolBar_Button}">
<Image Source="/Resources/ProjectManager/Send.png" Height="22" />
Margin="2.5,0,0,0"
Style="{StaticResource ProjManager_Button}">
<Image Source="/Resources/ProjectManager/Send.png"
Style="{StaticResource Button_Image}"/>
</Button>
</StackPanel>
+33 -37
View File
@@ -88,34 +88,24 @@ Public Class ProjManagerVM
Return EgtMsg(MSG_TOPCOMMANDBAR + 4)
End Get
End Property
Public ReadOnly Property InsertToolTip As String
Public ReadOnly Property ImportToolTip As String
Get
Return EgtMsg(MSG_TOPCOMMANDBAR + 5)
Return "Import"
End Get
End Property
Public ReadOnly Property ImportBTL_ToolTip As String
Public ReadOnly Property ExportToolTip As String
Get
Return EgtMsg(61840)
Return "Export"
End Get
End Property
Public ReadOnly Property UpdateBTL_ToolTip As String
Public ReadOnly Property OptionsToolTip As String
Get
Return EgtMsg(61834)
Return "Options"
End Get
End Property
Public ReadOnly Property ExportProject_ToolTip As String
Public ReadOnly Property SendFeedbackToolTip As String
Get
Return EgtMsg(61838)
End Get
End Property
Public ReadOnly Property ImportProject_ToolTip As String
Get
Return EgtMsg(61839)
End Get
End Property
Public ReadOnly Property GoToProd_ToolTip As String
Get
Return EgtMsg(61835)
Return "Send Feedback"
End Get
End Property
@@ -160,6 +150,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)
@@ -203,23 +207,11 @@ Public Class ProjManagerVM
''' Execute the Open. This method is invoked by the OpenCommand.
''' </summary>
Friend Sub Open()
OpenProject(Nothing)
OpenProject("")
End Sub
Friend Function OpenProject(sFilePath As String) As Boolean
If String.IsNullOrEmpty(sFilePath) Then
' Recupero cartella dell'ultimo progetto aperto
Dim sDir As String = Map.refSceneHostVM.MainController.GetCurrFile()
If String.IsNullOrWhiteSpace(sDir) Then
GetMainPrivateProfileString(S_MRUFILES, K_FILE & 1, "", sDir)
End If
If Not String.IsNullOrWhiteSpace(sDir) Then
sDir = Path.GetDirectoryName(sDir)
End If
Return Map.refSceneHostVM.MainController.OpenProject(sDir)
Else
Return Map.refSceneHostVM.MainController.OpenProject(sFilePath, False)
End If
Return Map.refSceneHostVM.OpenProject(sFilePath)
End Function
#End Region ' OpenCommand
@@ -392,7 +384,8 @@ Public Class ProjManagerVM
GetMainPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress)
' se vuoto do messaggio di errore ed esco
If String.IsNullOrWhiteSpace(sSupportAddress) Then
MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
'MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 10), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
Return
End If
' Recupero numero chiave
@@ -403,14 +396,16 @@ Public Class ProjManagerVM
EgtGetCurrFilePath(sCurrProject)
' se nome file vuoto o con estensione non valida, chiedo se si vuole salvare
If String.IsNullOrWhiteSpace(sCurrProject) Or EgtGetFileType(sCurrProject) <> FT.NGE Then
If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
'If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
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
'If MessageBox.Show(EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
If EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(MSG_TOPCOMMANDBAR + 11), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
Map.refSceneHostVM.SaveProject()
End If
End If
@@ -497,7 +492,8 @@ Public Class ProjManagerVM
bEx = True
End Try
If bEx OrElse EgtWPFLib5.MapiMailMessage.m_ErrorCode <> 0 Then
MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
'MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
EgtMessageBoxV.Show(Application.Current.MainWindow, String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
Else
Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(MSG_TOPCOMMANDBAR + 14), 5)
End If
+104 -34
View File
@@ -1,66 +1,136 @@
<EgtFloating:EgtFloatingManager x:Class="ProjectV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:PrintApp="clr-namespace:Icarus">
<Grid DockPanel.Dock="Top" Margin="0,20,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<DockPanel x:Class="ProjectV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:PrintApp="clr-namespace:Icarus">
<DockPanel.Resources>
<PrintApp:VisibilityToRowConverter x:Key="VisibilityToRowConverter"/>
</DockPanel.Resources>
<Grid DockPanel.Dock="Top">
<PrintApp:TopPanelV Grid.Column="1"
DataContext="{StaticResource TopPanelVM }"/>
</Grid>
<Grid DockPanel.Dock="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="315"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="315"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="67"/>
</Grid.RowDefinitions>
<PrintApp:LayerAdvancementSliderV Grid.Column="2"
Grid.ColumnSpan="3"
DockPanel.Dock="Bottom"
DataContext="{StaticResource SliderManagerVM}"
HorizontalAlignment="Stretch"/>
<!--StatusBar -->
<PrintApp:StatusBarV DataContext="{StaticResource StatusBarVM}"/>
<PrintApp:MachinePanelV Grid.Column="1"
DataContext="{StaticResource MachinePanelVM}"/>
<Grid Grid.RowSpan="2"
Grid.ColumnSpan="2">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="67"/>
</Grid.RowDefinitions>
<PrintApp:MessagePanelV Grid.Row="{Binding DataContext.Message_Visibility, ElementName=ControllerInputPanelV, Converter={StaticResource VisibilityToRowConverter}}"
Grid.ColumnSpan="2"
DataContext="{StaticResource StatusBarVM}"/>
<PrintApp:ControllerInputPanelV x:Name="ControllerInputPanelV" Grid.Row="2"
Grid.ColumnSpan="2"
DataContext="{StaticResource ControllerInputPanelVM}"/>
</Grid>
<!--<PrintApp:ControllerInputPanelV Grid.Row="1"
Grid.ColumnSpan="2"
DataContext="{StaticResource ControllerInputPanelVM}"/>
<PrintApp:MessagePanelV Grid.Row="1"
Grid.ColumnSpan="2"
DataContext="{StaticResource StatusBarVM}"/>-->
<PrintApp:ShowPanelV Grid.Column="2"
Grid.Row="1"
DataContext="{StaticResource ShowPanelVM}"/>
<PrintApp:ViewPanelV Grid.Column="3"
Grid.Row="1"
DataContext="{StaticResource ViewPanelVM}"/>
<PrintApp:InstrumentPanelV Grid.Column="4"
Grid.Row="1"
DataContext="{StaticResource InstrumentPanelVM}"/>
<PrintApp:StatusBarV Grid.Column="6"
Grid.Row="1"
DataContext="{StaticResource StatusBarVM}"/>
</Grid>
<DockPanel DockPanel.Dock="Bottom"
<!--<DockPanel DockPanel.Dock="Bottom"
LastChildFill="False">
<PrintApp:SliceManagerV DockPanel.Dock="Right"
DataContext="{StaticResource SliceManagerVM}"
Margin="5"/>
<PrintApp:LayerAdvancementSliderV DockPanel.Dock="Bottom"
DataContext="{StaticResource SliderManagerVM}"
HorizontalAlignment="Center"/>
<Grid DockPanel.Dock="Bottom"
--><!--<Grid DockPanel.Dock="Bottom"
HorizontalAlignment="Stretch">
<PrintApp:ControllerInputPanelV Grid.Column="3"
DataContext="{StaticResource ControllerInputPanelVM}"
HorizontalAlignment="Center"/>
</Grid>
</DockPanel>
</Grid>--><!--
</DockPanel>-->
<PrintApp:ViewLayerManagerV DockPanel.Dock="Bottom"
HorizontalAlignment="Left"
DataContext="{StaticResource ViewLayerManagerVM}"/>
<Grid DockPanel.Dock="Left">
<PrintApp:LeftPanelV Grid.Row="1"
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<PrintApp:LeftPanelV Grid.ColumnSpan="2"
DataContext="{StaticResource LeftPanelVM}"
VerticalAlignment="Center"
Visibility="{Binding DataContext.LeftPanel_Visibility,
RelativeSource={RelativeSource AncestorType={x:Type PrintApp:ProjectV}}}"/>
<PrintApp:ViewLayerManagerV Grid.Row="1"
VerticalAlignment="Bottom"
HorizontalAlignment="Left"
DataContext="{StaticResource ViewLayerManagerVM}"/>
</Grid>
<Grid DockPanel.Dock="Right">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="20*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.ColumnSpan="2"
Grid.Row="1"
HorizontalAlignment="Right">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!--<PrintApp:MachineViewPanelV DataContext="{StaticResource MachineViewPanelVM}"/>-->
<PrintApp:LayerIndexSliderV DataContext="{StaticResource SliderManagerVM}"
VerticalAlignment="Stretch"
HorizontalAlignment="Right"/>
<PrintApp:RightPanelV Grid.Column="1"
DataContext="{StaticResource RightPanelVM}"/>
</Grid>
<PrintApp:SliceManagerV Grid.Column="1"
Grid.Row="3"
DataContext="{StaticResource SliceManagerVM}"
HorizontalAlignment="Right"/>
</Grid>
<PrintApp:RightPanelV DockPanel.Dock="Right"
DataContext="{StaticResource RightPanelVM}"/>
<PrintApp:LayerIndexSliderV DockPanel.Dock="Right"
DataContext="{StaticResource SliderManagerVM}"
VerticalAlignment="Stretch"/>
<!-- Grid che occupa lo spazio della scena -->
<Grid Background="Transparent"/>
</EgtFloating:EgtFloatingManager>
</DockPanel>
+13
View File
@@ -3,6 +3,7 @@ Imports EgtWPFLib5
Imports EgtUILib
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Globalization
Public Class ProjectVM
Inherits VMBase
@@ -28,3 +29,15 @@ Public Class ProjectVM
End Class
Public Class VisibilityToRowConverter
Implements IValueConverter
Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.Convert
If IsNothing(value) Then Return 2
Return If(value = Visibility.Visible, 1, 2)
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New System.NotImplementedException()
End Function
End Class
+36 -9
View File
@@ -1,7 +1,9 @@
<UserControl x:Class="ReferencePanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Border Style="{StaticResource LeftPanelPopup_Border}">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:PrintApp="clr-namespace:Icarus">
<Border Padding="2.5"
Style="{StaticResource LeftPanel_PopupButton_Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@@ -14,11 +16,13 @@
Padding="0">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="3"/>
<UniformGrid Rows="3"
Margin="0"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Margin" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
@@ -30,11 +34,33 @@
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<RadioButton Content="{Binding sText}"
IsChecked="{Binding IsSelected,RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
FontSize="40"
GroupName="ReferenceRadio"
Style="{StaticResource OptionPanel_NestingToggleButton}"/>
<PrintApp:CheckedImageRadioButton IsChecked="{Binding IsSelected,RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
ImageSource="{Binding sText}"
CheckedImageSource="{Binding sSelText}"
FontSize="40"
GroupName="ReferenceRadio"
Margin="2.5,2.5,2.5,2.5">
<!--<RadioButton.Resources>
<DataTemplate x:Key="Normal">
<Image Source="{Binding sText}"
Style="{StaticResource Button_Image}"/>
</DataTemplate>
<DataTemplate x:Key="Selected">
<Image Source="{Binding sSelText}"
Style="{StaticResource Button_Image}"/>
</DataTemplate>
</RadioButton.Resources>
<RadioButton.Style>
<Style TargetType="{x:Type RadioButton}" BasedOn="{StaticResource OptionPanel_NestingToggleButton}">
<Setter Property="ContentTemplate" Value="{StaticResource Normal}"/>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="ContentTemplate" Value="{StaticResource Selected}"/>
</Trigger>
</Style.Triggers>
</Style>
</RadioButton.Style>-->
</PrintApp:CheckedImageRadioButton>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
@@ -42,7 +68,8 @@
Content="From Import"
IsChecked="{Binding FromImport_IsChecked}"
GroupName="ReferenceRadio"
Margin="2.5"
Style="{StaticResource OptionPanel_ToggleButton}"/>
</Grid>
</Border>
</Border>
</UserControl>
+41 -10
View File
@@ -115,6 +115,10 @@ Public Class ReferencePanelVM
ElseIf EgtGetInfo(SelPart.nPartId, KEY_MOVEDPART2, vtMovedPart) Then
ptOrig = ptOrig - vtMovedPart
End If
Dim nPartFrameId As Integer = EgtCreateGeoFrame(SelPart.nPartReferenceLayerId, New Frame3d(ptOrig), GDB_RT.GLOB)
EgtSetStatus(nPartFrameId, GDB_ST.OFF)
' elimino componente Z
ptOrig = ptOrig + New Vector3d(0, 0, -ptOrig.z)
frPrintSolid = New Frame3d(ptOrig)
End If
Dim nFrameId As Integer = EgtCreateGeoFrame(SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
@@ -186,25 +190,52 @@ Public Class ReferenceBtn
Get
Select Case Type
Case References.TL
Return ""
Return "/Resources/ReferencePanel/TL.png" '""
Case References.TR
Return ""
Return "/Resources/ReferencePanel/TR.png" '""
Case References.BL
Return ""
Return "/Resources/ReferencePanel/BL.png" '""
Case References.BR
Return ""
Return "/Resources/ReferencePanel/BR.png" '""
Case References.TC
Return ""
Return "/Resources/ReferencePanel/TC.png" '""
Case References.ML
Return ""
Return "/Resources/ReferencePanel/ML.png" '""
Case References.MR
Return ""
Return "/Resources/ReferencePanel/MR.png" '""
Case References.BC
Return ""
Return "/Resources/ReferencePanel/BC.png" '""
Case References.MC
Return ""
Return "/Resources/ReferencePanel/MC.png" '""
Case Else
Return "X"
Return "" '"X"
End Select
End Get
End Property
Public ReadOnly Property sSelText As String
Get
Select Case Type
Case References.TL
Return "/Resources/ReferencePanel/White_TL.png" '""
Case References.TR
Return "/Resources/ReferencePanel/White_TR.png" '""
Case References.BL
Return "/Resources/ReferencePanel/White_BL.png" '""
Case References.BR
Return "/Resources/ReferencePanel/White_BR.png" '""
Case References.TC
Return "/Resources/ReferencePanel/White_TC.png" '""
Case References.ML
Return "/Resources/ReferencePanel/White_ML.png" '""
Case References.MR
Return "/Resources/ReferencePanel/White_MR.png" '""
Case References.BC
Return "/Resources/ReferencePanel/White_BC.png" '""
Case References.MC
Return "/Resources/ReferencePanel/White_MC.png" '""
Case Else
Return "" '"X"
End Select
End Get
End Property
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 901 B

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 707 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

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