From c4a9533a171fa5b1baf229812257adb5c2e10bb2 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Tue, 5 Jun 2018 09:49:22 +0000 Subject: [PATCH] EgtCAM5 1.9f1 : - Aggiunta finestra di expander per stime tempi e lunghezze di lavorazione. --- Application.xaml.vb | 2 + Constants/ConstIni.vb | 1 + Constants/ConstMachIni.vb | 2 + EgtCAM5.vbproj | 8 ++ .../EstimationsDetailsWndV.xaml | 14 +++ .../EstimationsDetailsWndV.xaml.vb | 42 ++++++++ .../EstimationsDetailsWndVM.vb | 43 ++++++++ My Project/AssemblyInfo.vb | 4 +- .../OperationExpander/OperationExpanderVM.vb | 24 +++++ .../SimulationExpanderView.xaml | 32 ++++++ .../SimulationExpanderViewModel.vb | 99 +++++++++++++++++++ OptionPanel/OptionPanelVM.vb | 1 + OptionsWindow/OptionWindowVM.vb | 67 +++++++++++-- 13 files changed, 331 insertions(+), 8 deletions(-) create mode 100644 EstimationsDetailsWnd/EstimationsDetailsWndV.xaml create mode 100644 EstimationsDetailsWnd/EstimationsDetailsWndV.xaml.vb create mode 100644 EstimationsDetailsWnd/EstimationsDetailsWndVM.vb diff --git a/Application.xaml.vb b/Application.xaml.vb index e17fbd5..e556d2e 100644 --- a/Application.xaml.vb +++ b/Application.xaml.vb @@ -167,7 +167,9 @@ Class Application Friend Const MACHININGTREEVIEWEXPANDERISENABLED As String = "MachiningTreeViewExpanderIsEnabled" Friend Const NEWMACHININGMODEISACTIVE As String = "NewMachiningModeIsActive" Friend Const SIMULATIONEXPANDER_GET_ISEXPANDED As String = "Get_SimulationExpander_IsExpanded" + Friend Const ESTIMATIONEXPANDER_GET_ISEXPANDED As String = "Get_EstimationExpander_IsExpanded" Friend Const SIMULATIONEXPANDER_SET_ISEXPANDED As String = "Set_SimulationExpander_IsExpanded" + Friend Const ESTIMATIONSEXPANDER_SET_ISEXPANDED As String = "Set_EstimationsExpander_IsExpanded" Friend Const SIMULATIONEXPANDER_UPDATE_CNCDATA As String = "SimulationExpander_Update_CncData" Friend Const CANCELOPERATIONCOMMAND As String = "CancelOperationCommand" Friend Const UPDATEOPERATIONMACHININGLIST As String = "UpdateOperationMachiningList" diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 2aa5519..060d7cf 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -71,6 +71,7 @@ Module ConstIni Public Const K_ZOOMWIN As String = "ZoomWin" Public Const K_DISTLINE As String = "DistLine" Public Const K_MMUNITS As String = "MmUnits" + Public Const K_CUSTOMCOLORS As String = "CustomColors" Public Const S_GRID As String = "Grid" Public Const K_DRAWSHOWGRID As String = "DrawShowGrid" diff --git a/Constants/ConstMachIni.vb b/Constants/ConstMachIni.vb index b2c7144..1ef8ad4 100644 --- a/Constants/ConstMachIni.vb +++ b/Constants/ConstMachIni.vb @@ -57,4 +57,6 @@ Public Const S_VMILL As String = "VMill" Public Const K_VM_ENABLE As String = "Enable" + Public Const S_ESTIMATIONS As String = "Estimations" + End Module diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj index 910699e..a1e20bb 100644 --- a/EgtCAM5.vbproj +++ b/EgtCAM5.vbproj @@ -151,6 +151,10 @@ + + EstimationsDetailsWndV.xaml + + SelMachGroupWndV.xaml @@ -326,6 +330,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml b/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml new file mode 100644 index 0000000..833abd1 --- /dev/null +++ b/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml @@ -0,0 +1,14 @@ + + + + + diff --git a/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml.vb b/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml.vb new file mode 100644 index 0000000..61cd0fc --- /dev/null +++ b/EstimationsDetailsWnd/EstimationsDetailsWndV.xaml.vb @@ -0,0 +1,42 @@ +Imports EgtWPFLib5 + +Public Class EstimationsDetailsWndV + + Private m_EstimationsDetailsWndVM As EstimationsDetailsWndVM + +#Region "CONSTRUCTOR" + + Sub New(Owner As Window, EstimationsDetailsWndVM As EstimationsDetailsWndVM) + ' Funzione che interpreta l'xaml + InitializeComponent() + Me.Owner = Owner + Me.DataContext = EstimationsDetailsWndVM + ' Assegno al riferimento locale al VM il VM preso dal DataContext + m_EstimationsDetailsWndVM = EstimationsDetailsWndVM + EstimationsWebBrowser.Navigate(New Uri(m_EstimationsDetailsWndVM.FileName)) + End Sub + +#End Region ' CONSTRUCTOR + +#Region "EVENTS" + + Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded + ' Carico e imposto posizione finestra + WinPosFromIniToWindow(S_ESTIMATIONS, K_WINPLACE, Me, IniFile.m_sCurrMachIniFilePath) + End Sub + + Private Sub MainWindowV_Unloaded(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing + ' Salvo posizione finestra + If WindowState <> WindowState.Minimized Then + WinPosFromWindowToIni(Me, S_ESTIMATIONS, K_WINPLACE, IniFile.m_sCurrMachIniFilePath) + End If + End Sub + + + Private Sub Me_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing + EstimationsWebBrowser.Dispose() + End Sub + +#End Region ' EVENTS + +End Class diff --git a/EstimationsDetailsWnd/EstimationsDetailsWndVM.vb b/EstimationsDetailsWnd/EstimationsDetailsWndVM.vb new file mode 100644 index 0000000..33c927b --- /dev/null +++ b/EstimationsDetailsWnd/EstimationsDetailsWndVM.vb @@ -0,0 +1,43 @@ +Imports EgtUILib + +Public Class EstimationsDetailsWndVM + Inherits VMBase + +#Region "FIELDS & PROPERTIES" + + Private m_FileName As String + Public ReadOnly Property FileName As String + Get + Return m_FileName + End Get + End Property + +#Region "Messages" + + Public ReadOnly Property TitleMsg As String + Get + Return EgtMsg(MSG_SIMULATION + 42) + End Get + End Property + +#End Region ' Messages + + ' Definizione comandi + Private m_cmdOk As ICommand + Private m_cmdCancel As ICommand + +#End Region 'FIELDS & PROPERTIES + +#Region "CONSTRUCTOR" + + Sub New(FileName As String) + m_FileName = FileName + End Sub + +#End Region ' CONSTRUCTOR + +#Region "METHODS" + +#End Region ' METHODS + +End Class diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 12363e4..db585fd 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderVM.vb b/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderVM.vb index 5d1ad27..b1bd187 100644 --- a/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderVM.vb +++ b/OptionPanel/MachiningOptionPanel/OperationExpander/OperationExpanderVM.vb @@ -60,6 +60,7 @@ Public Class OperationExpanderVM OPERATIONLIST OPERATIONPARAMETERS SIMULATION + ESTIMATIONS End Enum Private m_OperViewIsEnabled As Boolean = True @@ -86,6 +87,8 @@ Public Class OperationExpanderVM ParametersIsExpanded = False ElseIf m_CurrExpandedExpander = MachiningOptionPanelExpander.SIMULATION Then Application.Msn.NotifyColleagues(Application.SIMULATIONEXPANDER_SET_ISEXPANDED, False) + ElseIf m_CurrExpandedExpander = MachiningOptionPanelExpander.ESTIMATIONS Then + Application.Msn.NotifyColleagues(Application.ESTIMATIONSEXPANDER_SET_ISEXPANDED, False) End If m_CurrExpandedExpander = MachiningOptionPanelExpander.OPERATIONLIST End If @@ -108,6 +111,9 @@ Public Class OperationExpanderVM ElseIf m_CurrExpandedExpander = MachiningOptionPanelExpander.SIMULATION Then m_CurrExpandedExpander = MachiningOptionPanelExpander.OPERATIONPARAMETERS Application.Msn.NotifyColleagues(Application.SIMULATIONEXPANDER_SET_ISEXPANDED, False) + ElseIf m_CurrExpandedExpander = MachiningOptionPanelExpander.ESTIMATIONS Then + m_CurrExpandedExpander = MachiningOptionPanelExpander.OPERATIONPARAMETERS + Application.Msn.NotifyColleagues(Application.ESTIMATIONSEXPANDER_SET_ISEXPANDED, False) End If m_CurrExpandedExpander = MachiningOptionPanelExpander.OPERATIONPARAMETERS If IsValidDispositionType(SelectedOperation.m_Type) Then @@ -428,6 +434,24 @@ Public Class OperationExpanderVM SelectedOperation = CurrSelectedOperation End If End Sub) + Application.Msn.Register(Application.ESTIMATIONEXPANDER_GET_ISEXPANDED, Sub(bValue As Boolean) + If m_CurrExpandedExpander = MachiningOptionPanelExpander.ESTIMATIONS Then + ListIsExpanded = True + End If + If bValue Then + If m_NewMachining Then EndNewMachining(GDB_ID.NULL) + ListIsExpanded = False + ParametersIsExpanded = False + m_CurrExpandedExpander = MachiningOptionPanelExpander.ESTIMATIONS + Else + ' Deseleziono e riseleziono la lavorazione corrente per fargli riselezionare la geometria + ' di lavorazione che è stata deselezionata dalla simulazione + Dim CurrSelectedOperation As OperationListBoxItem + CurrSelectedOperation = SelectedOperation + SelectedOperation = Nothing + SelectedOperation = CurrSelectedOperation + End If + End Sub) Application.Msn.Register(Application.DRAWMODE_ISCHECKED, Sub() ' Annullo creazione nuova lavorazione If m_NewMachining Then EndNewMachining(GDB_ID.NULL) diff --git a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml index 6ee513d..06aed4e 100644 --- a/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml +++ b/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderView.xaml @@ -101,6 +101,38 @@ + + + + + + + + + + + + + + + + + + +