- aggiunta possibilita' di impostare min e max per parametri di lavorazione

This commit is contained in:
Emmanuele Sassi
2023-03-29 16:26:48 +02:00
parent f4dea984be
commit f5206ce8bf
3 changed files with 39 additions and 4 deletions
+2
View File
@@ -122,6 +122,8 @@ Public Module ConstIni
Public Const K_CLR_MACHSTART As String = "MachStart"
Public Const K_CLR_OTHERS As String = "Others"
Public Const S_MINMAX As String = "MinMax"
Public Const S_MRUFILES As String = "MruFiles"
Public Const S_MRUIMPORTFILES As String = "MruImportFiles"
+10 -2
View File
@@ -292,10 +292,18 @@ Public Class CurrNumericMachiningParam
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
End Get
Set(value As String)
Dim dTempValue As Double = 0
If m_bIsLen Then
StringToLen(value, m_dValue)
StringToLen(value, dTempValue)
Else
StringToDouble(value, m_dValue)
StringToDouble(value, dTempValue)
End If
If m_bIsActiveMinMax Then
If dTempValue >= m_dMinValue AndAlso dTempValue <= m_dMaxValue Then
m_dValue = dTempValue
End If
Else
m_dValue = dTempValue
End If
NotifyPropertyChanged(NameOf(sValue))
NotifyPropertyChanged(NameOf(bIsModifiedFromDb))
+27 -2
View File
@@ -644,6 +644,10 @@ Public Class NumericMachiningParam
Protected m_bIsLen As Boolean = False
Protected m_bIsActiveMinMax As Boolean = False
Protected m_dMinValue As Double
Protected m_dMaxValue As Double
Protected m_dValue As Double
Public ReadOnly Property dValue As Double
Get
@@ -655,10 +659,18 @@ Public Class NumericMachiningParam
Return If(m_bIsLen, LenToString(m_dValue, 1), DoubleToString(m_dValue, 2))
End Get
Set(value As String)
Dim dTempValue As Double = 0
If m_bIsLen Then
StringToLen(value, m_dValue)
StringToLen(value, dTempValue)
Else
StringToDouble(value, m_dValue)
StringToDouble(value, dTempValue)
End If
If m_bIsActiveMinMax Then
If dTempValue >= m_dMinValue AndAlso dTempValue <= m_dMaxValue Then
m_dValue = dTempValue
End If
Else
m_dValue = dTempValue
End If
NotifyPropertyChanged(NameOf(sValue))
End Set
@@ -683,6 +695,19 @@ Public Class NumericMachiningParam
Sub New(Type As Params, nIndex As Integer)
MyBase.New(Type)
' leggo ed imposto eventuali min e max
Dim sMinMax As String = ""
If GetMainPrivateProfileString(S_MINMAX, Type, "", sMinMax) > 0 Then
Dim sMinMaxValues() As String = sMinMax.Split(","c)
Dim dMin As Double = 0
Dim dMax As Double = 0
If StringToDouble(sMinMaxValues(0), dMin) AndAlso StringToDouble(sMinMaxValues(1), dMax) Then
m_dMinValue = dMin
m_dMaxValue = dMax
m_bIsActiveMinMax = True
End If
End If
' leggo parametri da Db
If nIndex = 0 Then
m_dValue = 0
m_bIsLen = True