Imports System.ComponentModel Imports EgtUILib Imports EgtWPFLib5 Public Class MachineAxis Inherits VMBase Private m_IsReadOnlyAxesValue As Boolean Public Property IsReadOnlyAxesValue As Boolean Get Return m_IsReadOnlyAxesValue End Get Set(value As Boolean) If value <> m_IsReadOnlyAxesValue Then m_IsReadOnlyAxesValue = value NotifyPropertyChanged("IsReadOnlyAxesValue") NotifyPropertyChanged("IsEnabledAxesValue") End If End Set End Property Public ReadOnly Property IsEnabledAxesValue As Boolean Get Return Not m_IsReadOnlyAxesValue End Get End Property ' Definizione comandi Private m_cmdManualAxisModify As ICommand Private m_Name As String Public Property Name As String Get Return m_Name End Get Set(value As String) m_Name = value End Set End Property Private m_Token As String Public Property Token As String Get Return m_Token End Get Set(value As String) If value <> m_Token Then m_Token = value NotifyPropertyChanged("Token") End If End Set End Property Private m_Linear As Boolean Public WriteOnly Property Linear As Boolean Set(value As Boolean) m_Linear = value End Set End Property Private m_Value As String Public Property Value As String Get Return m_Value End Get Set(value As String) m_Value = value NotifyPropertyChanged("Value") End Set End Property Sub New() IsReadOnlyAxesValue = True End Sub #Region "COMMANDS" #Region "ManualAxisModifyCommand" ''' ''' Returns a command that create a new tool. ''' Public ReadOnly Property ManualAxisModifyCommand As ICommand Get If m_cmdManualAxisModify Is Nothing Then m_cmdManualAxisModify = New Command(AddressOf ManualAxisModify) End If Return m_cmdManualAxisModify End Get End Property ''' ''' Creata the new tool. This method is invoked by the NewCommand. ''' Public Sub ManualAxisModify(ByVal param As Object) Dim dVal As Double If m_Linear Then StringToLen(m_Value, dVal) Else StringToDouble(m_Value, dVal) End If EgtSetAxisPos(m_Name, dVal) EgtGetAxisPos(m_Name, dVal) If m_Linear Then Value = LenToString(dVal, 3) Else Value = DoubleToString(dVal, 3) End If EgtDraw() End Sub #End Region ' ManualAxisModifyCommand #End Region End Class