From dbb281988d77d1e1ec23957eb386bbbb2949b739 Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Mon, 26 Feb 2018 17:54:41 +0000 Subject: [PATCH] EgtDOORCreator : - Aggiunta scena per help hardware manager. - Disabilitato dimensioning panel in hardware manager. - Miliorie varie. --- CompoPanel/CompoPanelVM.vb | 2 + Doors.vb | 25 +---- EgtDOORCreator.vbproj | 7 ++ EgtDOORCreatorDictionary.xaml | 23 ++++- HardwareManager/Hardware.vb | 13 ++- HardwareManager/HardwareHelpSceneHostV.xaml | 8 ++ .../HardwareHelpSceneHostV.xaml.vb | 99 +++++++++++++++++++ HardwareManager/HardwarePageV.xaml | 20 ++-- HardwareManager/HardwarePageV.xaml.vb | 5 + Map.vb | 12 +++ Print/PrintWndV.xaml | 71 +++---------- ProjectManager/ProjectManagerHardwareVM.vb | 5 + ProjectManager/ProjectManagerVM.vb | 4 +- .../DimensioningPanel/DimensioningPanelV.xaml | 33 +++---- .../DimensioningPanel/DimensioningPanelVM.vb | 15 +++ SceneManager/SceneManagerV.xaml | 5 +- 16 files changed, 234 insertions(+), 113 deletions(-) create mode 100644 HardwareManager/HardwareHelpSceneHostV.xaml create mode 100644 HardwareManager/HardwareHelpSceneHostV.xaml.vb diff --git a/CompoPanel/CompoPanelVM.vb b/CompoPanel/CompoPanelVM.vb index 7493faf..566c23e 100644 --- a/CompoPanel/CompoPanelVM.vb +++ b/CompoPanel/CompoPanelVM.vb @@ -129,6 +129,8 @@ Public Class CompoPanelVM Map.refHardwarePageVM.CurrHardware = New Hardware Map.refHardwarePageVM.VisibilityGeneral = Visibility.Visible Map.refHardwarePageVM.CurrHardware.LoadTemplate(m_CurrCompoType) + ' Apro il progetto di esempio del tipo del bottone selezionato + Map.refHardwareHelpSceneHostV.LoadHelpProject() End If '------------------------------------------------------------------------------------------------------------------------------ Else ' se non sono nella configurazione Hardware diff --git a/Doors.vb b/Doors.vb index ea7a00a..165c036 100644 --- a/Doors.vb +++ b/Doors.vb @@ -35,25 +35,6 @@ Public Module Doors Return bOk End Function - Function ExecDoorsPrinter(ByRef scene As Scene, sFilePath As String, Optional bDraw As Boolean = True) As Boolean - ' Cursore attesa - scene.Cursor = System.Windows.Forms.Cursors.WaitCursor - ' Scrivo il nome del file aperto in una variabile globale per averlo in caso di errore - IniFile.m_DDFFilePath = sFilePath - ' Creazione porta - Dim bOk As Boolean = CreateDoors(sFilePath, False, False) - '' se attiva modalità assemblato, calcolo posizioni dei Part - 'If OptionModule.m_ConfigurationSoftware = ConfigType.Assembly Then - ' Map.refSceneManagerVM.ComposeAssembly(SceneManagerVM.nComposeAssembly) - 'End If - ' Aggiorno la visualizzazione - If bDraw Then EgtDraw() - EgtZoom(ZM.ALL) - ' Cursore standard - scene.Cursor = System.Windows.Forms.Cursors.Default - Return bOk - End Function - Function CreateDoors(ByRef sDdfFile As String, bNcGen As Boolean, bBatch As Boolean) As Boolean ' Carico il file Dim sExecPath As String = String.Empty @@ -63,7 +44,11 @@ Public Module Doors If Not EgtLuaExecFile(sExecPath) Then Return False ' Setto variabili per quotatura For Each HardwareDimension In Map.refDimensioningPanelVM.HardwareDimensionList - EgtLuaSetGlobBoolVar("DGD." & HardwareDimension.NameLayer(), HardwareDimension.SelectedLayer) + Dim IsHardwareDimActive As Boolean = False + If Not Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage Then + IsHardwareDimActive = HardwareDimension.SelectedLayer + End If + EgtLuaSetGlobBoolVar("DGD." & HardwareDimension.NameLayer(), IsHardwareDimActive) Next ' Lancio la creazione EgtLuaSetGlobStringVar("DGD.FILE", sDdfFile) diff --git a/EgtDOORCreator.vbproj b/EgtDOORCreator.vbproj index 8d341b0..4505838 100644 --- a/EgtDOORCreator.vbproj +++ b/EgtDOORCreator.vbproj @@ -154,6 +154,9 @@ HardwarePageV.xaml + + HardwareHelpSceneHostV.xaml + LauncherV.xaml @@ -255,6 +258,10 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + Designer MSBuild:Compile diff --git a/EgtDOORCreatorDictionary.xaml b/EgtDOORCreatorDictionary.xaml index c025bd8..f353521 100644 --- a/EgtDOORCreatorDictionary.xaml +++ b/EgtDOORCreatorDictionary.xaml @@ -2,7 +2,8 @@ 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:EgtDOORCreator="clr-namespace:EgtDOORCreator"> + xmlns:EgtDOORCreator="clr-namespace:EgtDOORCreator" + xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"> @@ -424,4 +425,24 @@ + + + + + + + + + + diff --git a/HardwareManager/Hardware.vb b/HardwareManager/Hardware.vb index dcac034..1ac0af2 100644 --- a/HardwareManager/Hardware.vb +++ b/HardwareManager/Hardware.vb @@ -156,7 +156,16 @@ Public Class Hardware Return m_SelType End Get Set(value As TypeHardware) + ' verifico se tipo è cambiato + Dim bChanged As Boolean = If(Not IsNothing(m_SelType), value.NameINI <> m_SelType.NameINI, True) m_SelType = value + ' se cambiato carico il suo progetto con quotature/suggerimenti + If bChanged Then Map.refHardwareHelpSceneHostV.LoadHelpProject() + ' se la text è visibile non passo mai dal SelTemplate quindi sposto qui il caricamento dei dati + If VisibilityTextTemplate = Visibility.Visible Then + ClearGroupChapters() + ReadChapterTemplate() + End If NotifyPropertyChanged("SelType") End Set End Property @@ -246,7 +255,7 @@ Public Class Hardware ' carico di Default il valore 1 For IndexListType As Integer = 0 To TypeList.Count - 1 If TypeList(IndexListType).NameINI = "1" Then - m_SelType = TypeList(IndexListType) + SelType = TypeList(IndexListType) NotifyPropertyChanged("SelType") Exit For End If @@ -289,7 +298,7 @@ Public Class Hardware Else For IndexListType As Integer = 0 To TypeList.Count - 1 If TypeList(IndexListType).NameINI = ConfigDefault Then - m_SelType = TypeList(IndexListType) + SelType = TypeList(IndexListType) NotifyPropertyChanged("SelType") Exit For End If diff --git a/HardwareManager/HardwareHelpSceneHostV.xaml b/HardwareManager/HardwareHelpSceneHostV.xaml new file mode 100644 index 0000000..9ccfb65 --- /dev/null +++ b/HardwareManager/HardwareHelpSceneHostV.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/HardwareManager/HardwareHelpSceneHostV.xaml.vb b/HardwareManager/HardwareHelpSceneHostV.xaml.vb new file mode 100644 index 0000000..b1d6bf9 --- /dev/null +++ b/HardwareManager/HardwareHelpSceneHostV.xaml.vb @@ -0,0 +1,99 @@ +Imports EgtUILib +Imports EgtWPFLib5 +Imports System.IO + +Public Class HardwareHelpSceneHostV + + Sub New() + ' This call is required by the designer. + InitializeComponent() + ' Creo riferimento a questa classe in CompoWindowMap + Map.SetRefHardwareHelpSceneHostV(Me) + ' Inizializzazione Scena + PreInitializeScene() + HardwareHelpScene.Init() + PostInitializeScene() + ' Imposto stato gestione mouse diretto della scena a nessuno + HardwareHelpScene.SetStatusNull() + EgtSetCurrentContext(HardwareHelpScene.GetCtx) + EgtNewFile() + End Sub + + Private Sub PreInitializeScene() + ' imposto colore di default + Dim DefColor As New Color3d(0, 0, 0) + GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor) + HardwareHelpScene.SetDefaultMaterial(DefColor) + ' imposto colori sfondo + Dim BackTopColor As New Color3d(192, 192, 192) + GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor) + Dim BackBotColor As New Color3d(BackTopColor) + GetMainPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor) + HardwareHelpScene.SetViewBackground(BackTopColor, BackBotColor) + ' imposto colore di evidenziazione + Dim MarkColor As New Color3d(255, 255, 0) + GetMainPrivateProfileColor(S_SCENE, K_MARK, MarkColor) + HardwareHelpScene.SetMarkMaterial(MarkColor) + ' imposto colore per superfici selezionate + Dim SelSurfColor As New Color3d(255, 255, 192) + GetMainPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor) + HardwareHelpScene.SetSelSurfMaterial(SelSurfColor) + ' imposto tipo e colore del rettangolo di zoom + Dim bOutline As Boolean = True + Dim ZwColor As New Color3d(0, 0, 0) + GetMainPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor) + HardwareHelpScene.SetZoomWinAttribs(bOutline, ZwColor) + ' imposto colore della linea di distanza + Dim DstLnColor As New Color3d(255, 0, 0) + GetMainPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor) + HardwareHelpScene.SetDistLineMaterial(DstLnColor) + ' imposto parametri OpenGL + Dim nDriver As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DRIVER, 3) + Dim b2Buff As Boolean = (GetMainPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0) + Dim nColorBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_COLORBITS, 32) + Dim nDepthBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32) + HardwareHelpScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits) + End Sub + + Private Sub PostInitializeScene() + ' imposto tipo coordinate + HardwareHelpScene.SetGridCursorPos(True) + ' modo di visualizzazione + Dim nShowMode As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.HIDDENLINE) + EgtSetShowMode(DirectCast(nShowMode, SM)) + End Sub + + Private Sub OnMouseDownScene() Handles HardwareHelpScene.OnMouseDownScene + EgtSetCurrentContext(Map.refSceneManagerVM.ProjectScene.GetCtx()) + End Sub + + Friend Sub LoadHelpProject() + EgtSetCurrentContext(HardwareHelpScene.GetCtx()) + Dim FileName As String = Map.refHardwarePageVM.CurrHardware.HardwareGeneral.Path & "\" & Map.refHardwarePageVM.CurrHardware.SelType.Name & ".nge" + If String.IsNullOrWhiteSpace(FileName) OrElse Not File.Exists(FileName) Then + EgtNewFile() + Else + EgtOpenFile(FileName) + EgtSetView(VT.ISO_NE, False) + EgtZoom(ZM.ALL, True) + End If + EgtSetCurrentContext(Map.refSceneManagerVM.ProjectScene.GetCtx()) + End Sub + + Friend Sub ShowHideParam(Param As CompoParam) + EgtSetCurrentContext(HardwareHelpScene.GetCtx()) + Dim FirstPart As Integer = EgtGetFirstPart() + If FirstPart = GDB_ID.NULL Then + EgtSetCurrentContext(Map.refSceneManagerVM.ProjectScene.GetCtx()) + Return + End If + For Each Compo In Map.refHardwarePageVM.CurrHardware.GroupChapters + For Each CurrParam In Compo.CompoParamList + EgtSetStatus(EgtGetFirstNameInGroup(FirstPart, CurrParam.DDFName), If(CurrParam.DDFName = Param.DDFName, GDB_ST.ON_, GDB_ST.OFF)) + Next + Next + EgtDraw() + EgtSetCurrentContext(Map.refSceneManagerVM.ProjectScene.GetCtx()) + End Sub + +End Class diff --git a/HardwareManager/HardwarePageV.xaml b/HardwareManager/HardwarePageV.xaml index a725c09..6061fb4 100644 --- a/HardwareManager/HardwarePageV.xaml +++ b/HardwareManager/HardwarePageV.xaml @@ -20,6 +20,7 @@ + @@ -123,7 +124,7 @@ - + @@ -135,7 +136,7 @@ - + @@ -162,7 +163,7 @@ - + - + @@ -218,7 +219,7 @@ - + - + @@ -274,7 +275,10 @@ - - + + + + + diff --git a/HardwareManager/HardwarePageV.xaml.vb b/HardwareManager/HardwarePageV.xaml.vb index 06bada3..dc095ec 100644 --- a/HardwareManager/HardwarePageV.xaml.vb +++ b/HardwareManager/HardwarePageV.xaml.vb @@ -1,3 +1,8 @@ Public Class HardwarePageV + Private Sub Param_MouseEnter(sender As Object, e As MouseEventArgs) + Dim Grid As Panel = DirectCast(sender, Panel) + Map.refHardwareHelpSceneHostV.ShowHideParam(DirectCast(Grid.DataContext, CompoParam)) + End Sub + End Class diff --git a/Map.vb b/Map.vb index 2229c86..3c062d1 100644 --- a/Map.vb +++ b/Map.vb @@ -22,6 +22,7 @@ Private m_refOrderVM As OrderVM Private m_refPrintSceneHostV As PrintSceneHostV + Private m_refHardwareHelpSceneHostV As HardwareHelpSceneHostV Private m_refOptionsVM As OptionsVM @@ -141,6 +142,12 @@ End Get End Property + Public ReadOnly Property refHardwareHelpSceneHostV As HardwareHelpSceneHostV + Get + Return m_refHardwareHelpSceneHostV + End Get + End Property + #End Region ' Get #Region "Set" @@ -240,6 +247,11 @@ Return Not IsNothing(m_refPrintSceneHostV) End Function + Friend Function SetRefHardwareHelpSceneHostV(HardwareHelpSceneHostV As HardwareHelpSceneHostV) As Boolean + m_refHardwareHelpSceneHostV = HardwareHelpSceneHostV + Return Not IsNothing(m_refHardwareHelpSceneHostV) + End Function + #End Region ' Set #Region "Init" diff --git a/Print/PrintWndV.xaml b/Print/PrintWndV.xaml index 0cc28ef..e6e8ce3 100644 --- a/Print/PrintWndV.xaml +++ b/Print/PrintWndV.xaml @@ -10,78 +10,29 @@ IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" CloseCommand="{Binding CancelCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}" SizeToContent="WidthAndHeight"> - - -