diff --git a/Panel/PanelVM.vb b/Panel/PanelVM.vb index 6d0f8dc..5096ca0 100644 --- a/Panel/PanelVM.vb +++ b/Panel/PanelVM.vb @@ -95,11 +95,11 @@ Public Class PanelVM For i As Integer = 1 To lEdgeList.Count EgtLuaSetGlobIntVar("TOOL.tbIdEdges." & i.ToString, lEdgeList(i - 1).ToString()) Next - Dim dTh As Double = GetValue(ParamList(3)) + Dim dTh As Double = DirectCast(ParamList(3), _TextBoxParam).GetValue() EgtLuaSetGlobNumVar("TOOL.dTh", dTh) - Dim dDiam As Double = GetValue(ParamList(5)) + Dim dDiam As Double = DirectCast(ParamList(5), _TextBoxParam).GetValue() EgtLuaSetGlobNumVar("TOOL.dDiamBore", dDiam) - Dim dAng As Double = GetValue(ParamList(4)) + Dim dAng As Double = DirectCast(ParamList(4), _TextBoxParam).GetValue() EgtLuaSetGlobNumVar("TOOL.dSlopeAng", dAng) EgtLuaCallFunction("TOOL.CreateSplitBottom") End If @@ -137,14 +137,6 @@ Public Class PanelVM Return DirectCast(ParamList(1), _ComboBoxParam).SelParamCmBx.Name End Function - Private Function GetValue(textBox As _TextBoxParam) - Dim sValue As String = textBox.sValue - If String.IsNullOrEmpty(sValue) Then Return 0 - If Not IsNumeric(sValue) Then Return 0 - Dim dAng As Double = CDbl(sValue) - Return dAng - End Function - Private Sub AddSplashTop(nId As Integer) Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId)) ' setto l'indice del lato e il parent @@ -160,9 +152,9 @@ Public Class PanelVM Dim bInsideLoop As Boolean = True If EgtLuaSetGlobBoolVar("TOOL.bInsideLoop", bInsideLoop) Then AssLog("TOOL.bInsideLoop = true") ' setto le varibili generiche per il pezzo - Dim dTh As Double = GetValue(ParamList(3)) + Dim dTh As Double = DirectCast(ParamList(3), _TextBoxParam).GetValue() If EgtLuaSetGlobNumVar("TOOL.dTh", dTh) Then AssLog("TOOL.dTh = " & dTh.ToString()) - Dim dH As Double = GetValue(ParamList(2)) + Dim dH As Double = DirectCast(ParamList(2), _TextBoxParam).GetValue() If EgtLuaSetGlobNumVar("TOOL.dH", dH) Then AssLog("TOOL.dH = " & dH.ToString()) If EgtLuaSetGlobBoolVar("TOOL.bPrev", True) Then AssLog("TOOL.bPrev = true") If EgtLuaSetGlobBoolVar("TOOL.bNext", True) Then AssLog("TOOL.bNext = true") @@ -184,9 +176,9 @@ Public Class PanelVM Dim bInsideLoop As Boolean = True If EgtLuaSetGlobBoolVar("TOOL.bInsideLoop", bInsideLoop) Then AssLog("TOOL.bInsideLoop = true") ' setto le varibili generiche per il pezzo - Dim dTh As Double = GetValue(ParamList(3)) + Dim dTh As Double = DirectCast(ParamList(3), _TextBoxParam).GetValue() If EgtLuaSetGlobNumVar("TOOL.dTh", dTh) Then AssLog("TOOL.dTh = " & dTh.ToString()) - Dim dH As Double = GetValue(ParamList(2)) + Dim dH As Double = DirectCast(ParamList(2), _TextBoxParam).GetValue() If EgtLuaSetGlobNumVar("TOOL.dH", dH) Then AssLog("TOOL.dH = " & dH.ToString()) If EgtLuaSetGlobBoolVar("TOOL.bPrev", True) Then AssLog("TOOL.bPrev = true") If EgtLuaSetGlobBoolVar("TOOL.bNext", True) Then AssLog("TOOL.bNext = true") diff --git a/SceneUserControl/SceneUserControlVM.vb b/SceneUserControl/SceneUserControlVM.vb index e0fb4a5..a7f5b6a 100644 --- a/SceneUserControl/SceneUserControlVM.vb +++ b/SceneUserControl/SceneUserControlVM.vb @@ -275,6 +275,15 @@ Public Class _TextBoxParam #End Region ' Constructor +#Region "METHODS" + Public Function GetValue() + If String.IsNullOrEmpty(sValue) Then Return 0 + If Not IsNumeric(sValue) Then Return 0 + Dim dValue As Double = CDbl(sValue) + Return dValue + End Function +#End Region + End Class Public Class _TextBlockParam