c99654dbf0
- Milgiorie lavorazioni.
171 lines
5.5 KiB
VB.net
171 lines
5.5 KiB
VB.net
Imports System.ComponentModel
|
|
Imports System.Collections.ObjectModel
|
|
Imports EgtUILib
|
|
|
|
Public Class OperationListBoxItem
|
|
Implements INotifyPropertyChanged
|
|
|
|
Private m_Type As Integer
|
|
Public ReadOnly Property Type As Integer
|
|
Get
|
|
Return m_Type
|
|
End Get
|
|
End Property
|
|
|
|
Private m_Id As Integer
|
|
Public Property Id As Integer
|
|
Get
|
|
Return m_Id
|
|
End Get
|
|
Set(value As Integer)
|
|
m_Id = value
|
|
End Set
|
|
End Property
|
|
|
|
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_Image As String
|
|
Public Property Image As String
|
|
Get
|
|
Return m_Image
|
|
End Get
|
|
Set(value As String)
|
|
m_Image = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_Tool As String
|
|
Public Property Tool As String
|
|
Get
|
|
Return m_Tool
|
|
End Get
|
|
Set(value As String)
|
|
m_Tool = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Invert As Boolean
|
|
Get
|
|
Dim bInvert As Boolean = False
|
|
Dim x = EgtGetMachiningParam(MCH_MP.INVERT, bInvert)
|
|
Return bInvert
|
|
End Get
|
|
Set(value As Boolean)
|
|
EgtSetMachiningParam(MCH_MP.INVERT, value)
|
|
End Set
|
|
End Property
|
|
|
|
Public Property Depth As String
|
|
Get
|
|
Dim sDepth As String = String.Empty
|
|
EgtGetMachiningParam(MCH_MP.DEPTH_STR, sDepth)
|
|
Return sDepth
|
|
End Get
|
|
Set(value As String)
|
|
EgtSetMachiningParam(MCH_MP.DEPTH, value)
|
|
End Set
|
|
End Property
|
|
|
|
'ObservableCollection che contiene le variabili per il combobox WorkSide
|
|
Private m_WorkSideList As New ObservableCollection(Of IdNameStruct)({New IdNameStruct(MCH_SAW_WS.CENTER, EgtMsg(MSG_MACHININGSDBPAGE + 120)), New IdNameStruct(MCH_SAW_WS.LEFT, EgtMsg(MSG_MACHININGSDBPAGE + 121)), New IdNameStruct(MCH_SAW_WS.RIGHT, EgtMsg(MSG_MACHININGSDBPAGE + 122))})
|
|
Public ReadOnly Property WorkSideList As ObservableCollection(Of IdNameStruct)
|
|
Get
|
|
Return m_WorkSideList
|
|
End Get
|
|
End Property
|
|
' Proprietà che indica il WorkSide (MCH_SAW_WS)
|
|
Public Property SelectedWorkSide As Integer
|
|
Get
|
|
Dim nWorkSide As Integer = 0
|
|
EgtMdbGetCurrMachiningParam(MCH_MP.WORKSIDE, nWorkSide)
|
|
Return IdNameStruct.SearchToId(nWorkSide, WorkSideList)
|
|
End Get
|
|
Set(value As Integer)
|
|
EgtMdbSetCurrMachiningParam(MCH_MP.WORKSIDE, IdNameStruct.SearchFromId(value, WorkSideList))
|
|
End Set
|
|
End Property
|
|
|
|
|
|
Sub New(Id As Integer, Name As String, Type As Integer, Tool As String)
|
|
Me.Id = Id
|
|
Me.Name = Name
|
|
Me.m_Type = Type
|
|
Me.Image = ConvertTypeToImage(Type)
|
|
Me.Tool = If(Not String.IsNullOrEmpty(Tool), "(" & Tool & ")", String.Empty)
|
|
End Sub
|
|
|
|
Private Function ConvertTypeToImage(Type As Integer) As String
|
|
Select Case Type
|
|
Case MCH_OY.DISP
|
|
Return ""
|
|
Case MCH_OY.DRILLING
|
|
Return ""
|
|
Case MCH_OY.SAWING
|
|
Return ""
|
|
Case MCH_OY.MILLING
|
|
Return ""
|
|
Case MCH_OY.POCKETING
|
|
Return ""
|
|
Case MCH_OY.MORTISING
|
|
Return ""
|
|
Case MCH_OY.SAWROUGHING
|
|
Return ""
|
|
Case MCH_OY.SAWFINISHING
|
|
Return ""
|
|
Case Else
|
|
Return String.Empty
|
|
End Select
|
|
End Function
|
|
|
|
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
|
|
|
Public Sub NotifyPropertyChanged(propName As String)
|
|
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
''' <summary>
|
|
''' Class that represent a Converter that use machining type and param type, to set the visibility state of the param type.
|
|
''' </summary>
|
|
Public Class OperationParamVisibilityConverter
|
|
Implements IValueConverter
|
|
|
|
Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
|
|
Select Case CInt(value)
|
|
Case MCH_OY.NONE
|
|
Return Visibility.Hidden
|
|
Case MCH_OY.DISP
|
|
Return SharedFieldsClass.OperationDisposition(CInt(parameter))
|
|
Case MCH_OY.DRILLING
|
|
Return SharedFieldsClass.OperationDrilling(CInt(parameter))
|
|
Case MCH_OY.SAWING
|
|
Return SharedFieldsClass.OperationSawing(CInt(parameter))
|
|
Case MCH_OY.MILLING
|
|
Return SharedFieldsClass.OperationMilling(CInt(parameter))
|
|
Case MCH_OY.POCKETING
|
|
Return SharedFieldsClass.OperationPocketing(CInt(parameter))
|
|
Case MCH_OY.MORTISING
|
|
Return SharedFieldsClass.OperationMortising(CInt(parameter))
|
|
Case MCH_OY.SAWROUGHING
|
|
Return SharedFieldsClass.OperationSawroughing(CInt(parameter))
|
|
Case MCH_OY.SAWFINISHING
|
|
Return SharedFieldsClass.OperationSawfinishing(CInt(parameter))
|
|
Case Else
|
|
Return Visibility.Hidden
|
|
End Select
|
|
End Function
|
|
|
|
Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
|
|
Throw New NotImplementedException
|
|
End Function
|
|
|
|
End Class |