diff --git a/MachinePanel/MyMachinePanelVM.vb b/MachinePanel/MyMachinePanelVM.vb index 2d240c4..513ab45 100644 --- a/MachinePanel/MyMachinePanelVM.vb +++ b/MachinePanel/MyMachinePanelVM.vb @@ -211,9 +211,15 @@ Public Class MyMachinePanelVM MessageBox.Show(EgtMsg(MSG_MACHININGDBERRORS + 8), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error) Return End If + + EgtOutLog("Call function: Creazione oggetto MachDbWindowVM") + TimeSpanInit() Dim MachDbWindowVM As New EgtWPFLib5.MachiningDbWindowVM(CurrentMachine.sMachIniFile, OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx(), "Stone", OmagOFFICEMap.refMainWindowVM.MainWindowM.nUserLevel > 5) ' Dim MachDbWindowV As New EgtWPFLib5.MachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM) + EgtOutLog(TimeSpanEnd()) + EgtOutLog("Call function: Aggiorna oggetto MachDbWindowVM") + TimeSpanInit() MachDbWindowVM.bPersonalInterface = True ' Collegata allo stile della GroupBox @@ -251,30 +257,40 @@ Public Class MyMachinePanelVM MachDbWindowVM.OpacityIsChecked = 0.25 'Definisco lo stile della DataGrid - MachDbWindowVM.HeaderVisibility = DataGridHeadersVisibility.Column - MachDbWindowVM.BackgroundDataGrid = DirectCast(New System.Windows.Media.BrushConverter().ConvertFromString("#484D55"), Brush) - MachDbWindowVM.BackGroundHeader = DirectCast(New System.Windows.Media.BrushConverter().ConvertFromString("#484D55"), Brush) - MachDbWindowVM.ForegroundHeader = Brushes.White - MachDbWindowVM.BorderBrushHeader = DirectCast(New System.Windows.Media.BrushConverter().ConvertFromString("#1C1D22"), Brush) - MachDbWindowVM.BorderThicknessHeader = New Thickness(0) - MachDbWindowVM.FontWeightHeader = FontWeights.Bold - MachDbWindowVM.BorderBrushDataGrid = DirectCast(New System.Windows.Media.BrushConverter().ConvertFromString("#1C1D22"), Brush) - MachDbWindowVM.BackgroundDataGridRow = DirectCast(New System.Windows.Media.BrushConverter().ConvertFromString("#1C1D22"), Brush) - MachDbWindowVM.ForegroundDataGridRow = Brushes.White - MachDbWindowVM.BorderBrushDataGridRow = Brushes.DarkGray - MachDbWindowVM.BorderThicknessDataGridRow = New Thickness(0, 0, 0, 1) - MachDbWindowVM.BorderBrushDataGridCell = Brushes.DarkGray - MachDbWindowVM.BorderThicknessDataGridCell = New Thickness(0, 0, 1, 0) + 'MachDbWindowVM.HeaderVisibility = DataGridHeadersVisibility.Column + 'MachDbWindowVM.BackgroundDataGrid = DirectCast(New System.Windows.Media.BrushConverter().ConvertFromString("#484D55"), Brush) + 'MachDbWindowVM.BackGroundHeader = DirectCast(New System.Windows.Media.BrushConverter().ConvertFromString("#484D55"), Brush) + 'MachDbWindowVM.ForegroundHeader = Brushes.White + 'MachDbWindowVM.BorderBrushHeader = DirectCast(New System.Windows.Media.BrushConverter().ConvertFromString("#1C1D22"), Brush) + 'MachDbWindowVM.BorderThicknessHeader = 0.0 + 'MachDbWindowVM.FontWeightHeader = FontWeights.Bold + 'MachDbWindowVM.BorderBrushDataGrid = DirectCast(New System.Windows.Media.BrushConverter().ConvertFromString("#1C1D22"), Brush) + 'MachDbWindowVM.BackgroundDataGridRow = DirectCast(New System.Windows.Media.BrushConverter().ConvertFromString("#1C1D22"), Brush) + 'MachDbWindowVM.ForegroundDataGridRow = Brushes.White + 'MachDbWindowVM.BorderBrushDataGridRow = Brushes.DarkGray + 'MachDbWindowVM.BorderThicknessDataGridRow = "0 0 0 1" + 'MachDbWindowVM.BorderBrushDataGridCell = Brushes.DarkGray + 'MachDbWindowVM.BorderThicknessDataGridCell = "0 0 1 0" + EgtOutLog(TimeSpanEnd()) + + EgtOutLog("Call function: Creazione oggetto MachDbWindowV") + TimeSpanInit() Dim MachDbWindowV As New MyMachiningDbWindowV(Application.Current.MainWindow, MachDbWindowVM) + If EgtWPFLib5.MachiningTreeViewItem.m_MatType <> 0 Then + EgtOutLog("Call function: Visualizzazione oggetto MachDbWindowV") + TimeSpanInit() MachDbWindowV.Height = 768 MachDbWindowV.Width = 1024 MachDbWindowV.ShowDialog() + EgtOutLog(TimeSpanEnd()) Else Exit Sub End If + + ' Verifico che gli utensili delle lavorazioni correnti siano attrezzati (necessario perchè potrei aver cambiato gli utensili delle lavorazioni) ' e che le lavorazioni correnti siano compatibili con materiale e spessore ' Lama diff --git a/Utility/OmagOFFICEMap.vb b/Utility/OmagOFFICEMap.vb index 9b5b188..324239f 100644 --- a/Utility/OmagOFFICEMap.vb +++ b/Utility/OmagOFFICEMap.vb @@ -4,6 +4,23 @@ Imports EgtUILib Module OmagOFFICEMap + Friend StopWatch As Stopwatch + + Friend Sub TimeSpanInit() + StopWatch = New Stopwatch + StopWatch.Start() + End Sub + + Friend Function TimeSpanEnd() As String + Dim sTime As String = "" + If Not IsNothing(StopWatch) Then + StopWatch.Stop() + Dim ts As TimeSpan = StopWatch.Elapsed + sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds) + End If + Return sTime + End Function + Private m_refMainWindowVM As MainWindowVM Private m_refTopCommandBarVM As TopCommandBarVM Private m_refProjectVM As ProjectVM