diff --git a/CompoLib/ParametricCompoVM.vb b/CompoLib/ParametricCompoVM.vb index fc06c79..6102013 100644 --- a/CompoLib/ParametricCompoVM.vb +++ b/CompoLib/ParametricCompoVM.vb @@ -7,19 +7,28 @@ Public Class ParametricCompoVM #Region "FIELDS & PROPERTIES" - Private ReadOnly sLuaPath As String = String.Empty + Private m_sLuaPath As String = String.Empty + Friend ReadOnly bFileExsist As Boolean = False + Private m_nVeinCtx As Integer #End Region ' Fields & Properties #Region "CONSTRUCTOR" - Sub New(sFile As String) + Sub New(sFile As String, nVeinCtx As Integer) MyBase.New() + m_nVeinCtx = nVeinCtx Title = EGT_PARAMETRIC.ToUpper() ' Recupero path cartella che contiene i componenti - GetMainPrivateProfileString(K_COMPO, COMPO_DIR, "", sLuaPath) - sLuaPath &= sFile - LoadParamList() + GetMainPrivateProfileString(K_COMPO, COMPO_DIR, "", m_sLuaPath) + ' Controllo se il file esiste + m_sLuaPath &= sFile + If File.Exists(m_sLuaPath) Then + LoadParamList() + bFileExsist = True + Else + EgtOutLog("File " & m_sLuaPath & " non esiste nella cartella dei componenti") + End If ' aggiorno visualizzazione EgtSetView(VT.TOP, False) EgtZoom(ZM.ALL) @@ -32,7 +41,7 @@ Public Class ParametricCompoVM Public Overrides Sub LoadParamList() ' Pulisco lista variabili ParamList.Clear() - EgtLuaExecFile(sLuaPath) + EgtLuaExecFile(m_sLuaPath) Dim sPar As String = "0" EgtLuaGetGlobStringVar("CMP.Npar", sPar) Dim sName As String = String.Empty @@ -49,14 +58,13 @@ Public Class ParametricCompoVM End Sub Private Sub ExecLua() - Dim nVeinCtx As Integer = Map.refSceneHostVM.MainScene.GetCtx() - If Not File.Exists(sLuaPath) Then - EgtOutLog("Matching error: missing file (" & sLuaPath & ")") + If Not File.Exists(m_sLuaPath) Then + EgtOutLog("Matching error: missing file (" & m_sLuaPath & ")") Return End If ' Parsing - EgtLuaExecFile(sLuaPath) - EgtSetCurrentContext(nVeinCtx) + EgtLuaExecFile(m_sLuaPath) + EgtSetCurrentContext(m_nVeinCtx) For Index As Integer = 0 To ParamList.Count - 1 If TypeOf ParamList(Index) Is _TextBoxParam Then Dim _TextBox As _TextBoxParam = DirectCast(ParamList(Index), _TextBoxParam) diff --git a/EgtStone3D.vbproj b/EgtStone3D.vbproj index d304f28..eb7e9fd 100644 --- a/EgtStone3D.vbproj +++ b/EgtStone3D.vbproj @@ -118,9 +118,15 @@ EgtMessageBoxV.xaml + + GridDimensionPanelV.xaml + - - GridPaneV.xaml + + GridPanelV.xaml + + + GridViewPanelV.xaml MainWindowV.xaml @@ -240,7 +246,15 @@ Designer MSBuild:Compile - + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + Designer MSBuild:Compile diff --git a/GridPanel/GridDimensionPanelV.xaml b/GridPanel/GridDimensionPanelV.xaml new file mode 100644 index 0000000..35e28e8 --- /dev/null +++ b/GridPanel/GridDimensionPanelV.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/GridPanel/GridDimensionPanelV.xaml.vb b/GridPanel/GridDimensionPanelV.xaml.vb new file mode 100644 index 0000000..d91744b --- /dev/null +++ b/GridPanel/GridDimensionPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class GridDimensionPanelV + +End Class diff --git a/GridPanel/GridPaneV.xaml b/GridPanel/GridPaneV.xaml deleted file mode 100644 index 5306ade..0000000 --- a/GridPanel/GridPaneV.xaml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - + + + diff --git a/GridPanel/GridViewPanelV.xaml.vb b/GridPanel/GridViewPanelV.xaml.vb new file mode 100644 index 0000000..4a7d22c --- /dev/null +++ b/GridPanel/GridViewPanelV.xaml.vb @@ -0,0 +1,3 @@ +Public Class GridViewPanelV + +End Class diff --git a/Panel/EditPanelVM.vb b/Panel/EditPanelVM.vb index d7665b8..3bfe358 100644 --- a/Panel/EditPanelVM.vb +++ b/Panel/EditPanelVM.vb @@ -2,6 +2,7 @@ Public Class EditPanelVM Inherits SceneUserControlVM + #Region "FIELDS & PROPERTIES" Private ReadOnly m_MsgList As New List(Of String)({TopBar_Msg_Stg0, TopBar_Msg_Stg1, TopBar_Msg_Stg2}) diff --git a/SceneButton/SceneButtonVM.vb b/SceneButton/SceneButtonVM.vb index b8670c8..40493a3 100644 --- a/SceneButton/SceneButtonVM.vb +++ b/SceneButton/SceneButtonVM.vb @@ -79,6 +79,16 @@ Public Class SceneButtonVM End Set End Property + Private m_ParametricListGroupBtn As New List(Of GroupSceneBtn) + Public Property ParametricListGroupBtn As List(Of GroupSceneBtn) + Get + Return m_ParametricListGroupBtn + End Get + Set(value As List(Of GroupSceneBtn)) + m_ParametricListGroupBtn = value + End Set + End Property + Friend Enum TopPanel As Integer TOP_PANEL = 0 TOP_PANEL_1 = 1 @@ -105,7 +115,8 @@ Public Class SceneButtonVM Sub New() Map.SetRefSceneButtonVM(Me) LoadButtons() - LoadGroupButtons() + LoadGroupButtons(TOPPANELLIST_BTN, m_TopPanelListGroupBtn) + LoadGroupButtons("ParametricListBtn", m_ParametricListGroupBtn) End Sub #End Region ' Constructor @@ -123,14 +134,14 @@ Public Class SceneButtonVM SetButtonsLocation(BOTTOMCENTERLIST_BTN, m_BottomCenterListBtn) End Sub - Private Sub LoadGroupButtons() + Private Sub LoadGroupButtons(NameList As String, GroupSceneBtnList As List(Of GroupSceneBtn)) Dim Index As Integer = 1 Dim SubTitle As String = String.Empty - Dim sKeyTitle As String = TOPPANELLIST_BTN & "_" & Index.ToString() + Dim sKeyTitle As String = NameList & "_" & Index.ToString() While GetMainPrivateProfileString(sKeyTitle, ConstEgtStone3D.SUBTITLE, "", SubTitle) > 0 - SetGroupButtonsLocation(sKeyTitle, m_TopPanelListGroupBtn) + SetGroupButtonsLocation(sKeyTitle, GroupSceneBtnList) Index += 1 - sKeyTitle = TOPPANELLIST_BTN & "_" & Index.ToString() + sKeyTitle = NameList & "_" & Index.ToString() End While End Sub @@ -446,8 +457,22 @@ Module SceneCmd #Region "METHODS" - Public Sub Exec(Flag) - Dim nVeinCtx As Integer = Map.refSceneHostVM.MainScene.GetCtx() + Public Function ExecFile(Flag As String, nVeinCtx As Integer) As Boolean + Dim bNewParametricExsists As Boolean = False + If Flag.Contains(".lua") Then + If IsNothing(Map.refSceneButtonVM.m_ParametricCompoUC) Then Map.refSceneButtonVM.m_ParametricCompoUC = New SceneUserControlV + Dim LocalParametricCompo As New ParametricCompoVM(Flag, nVeinCtx) + If LocalParametricCompo.bFileExsist Then + Map.refSceneButtonVM.m_ParametricCompoUC.DataContext = LocalParametricCompo + Map.refSceneButtonVM.LoadUC(Map.refSceneButtonVM.m_ParametricCompoUC) + bNewParametricExsists = True + End If + End If + Return bNewParametricExsists + End Function + + Public Function ExecMethod(Flag As String, nVeinCtx As Integer) As Boolean + Dim bNewMethodsExsists As Boolean = True Select Case Flag Case EGT_AUTOPAIR EgtSetCurrentContext(nVeinCtx) @@ -490,23 +515,23 @@ Module SceneCmd Case EGT_DELETE SolidManagerM.Delete(Map.refSceneHostVM.m_nIdPart) Map.refSceneHostVM.m_nIdPart = GDB_ID.NULL - Case EGT_RECTANGE - If IsNothing(Map.refSceneButtonVM.m_ParametricCompoUC) Then Map.refSceneButtonVM.m_ParametricCompoUC = New SceneUserControlV - Map.refSceneButtonVM.m_ParametricCompoUC.DataContext = New ParametricCompoVM(EGT_RECTANGE & ".lua") - Map.refSceneButtonVM.LoadUC(Map.refSceneButtonVM.m_ParametricCompoUC) - Case EGT_POLIGON - If IsNothing(Map.refSceneButtonVM.m_ParametricCompoUC) Then Map.refSceneButtonVM.m_ParametricCompoUC = New SceneUserControlV - Map.refSceneButtonVM.m_ParametricCompoUC.DataContext = New ParametricCompoVM(EGT_POLIGON & ".lua") - Map.refSceneButtonVM.LoadUC(Map.refSceneButtonVM.m_ParametricCompoUC) - Case EGT_ELLIPSE - If IsNothing(Map.refSceneButtonVM.m_ParametricCompoUC) Then Map.refSceneButtonVM.m_ParametricCompoUC = New SceneUserControlV - Map.refSceneButtonVM.m_ParametricCompoUC.DataContext = New ParametricCompoVM(EGT_ELLIPSE & ".lua") - Map.refSceneButtonVM.LoadUC(Map.refSceneButtonVM.m_ParametricCompoUC) Case EGT_EDIT_PANEL If IsNothing(Map.refSceneButtonVM.m_EditPanelUC) Then Map.refSceneButtonVM.m_EditPanelUC = New SceneUserControlV Map.refSceneButtonVM.m_EditPanelUC.DataContext = New EditPanelVM() Map.refSceneButtonVM.LoadUC(Map.refSceneButtonVM.m_EditPanelUC) + Case Else + EgtOutLog("La chiamata del metodo '" & Flag & "' non è andata a buon fine") + bNewMethodsExsists = False End Select + Return bNewMethodsExsists + End Function + + Public Sub Exec(Flag As String) + Dim nVeinCtx As Integer = Map.refSceneHostVM.MainScene.GetCtx() + + If Not ExecFile(Flag, nVeinCtx) Then + ExecMethod(Flag, nVeinCtx) + End If End Sub Friend Sub Undo() diff --git a/TopPanel/TopPanelListButton_1V.xaml b/TopPanel/TopPanelListButton_1V.xaml index b3e8272..04f8bda 100644 --- a/TopPanel/TopPanelListButton_1V.xaml +++ b/TopPanel/TopPanelListButton_1V.xaml @@ -3,7 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:EgtStone3D="clr-namespace:EgtStone3D"> - @@ -19,7 +18,7 @@