922 lines
25 KiB
VB.net
922 lines
25 KiB
VB.net
'Imports System.Collections.ObjectModel
|
|
'Imports System.ComponentModel
|
|
'Imports EgtUILib
|
|
'Imports EgtWPFLib
|
|
|
|
'Public Class WaterJetPageVM
|
|
' Private m_refWaterPageV As WaterJetPageUC
|
|
|
|
' ' lista dei materiali
|
|
' Private m_ListMaterial As New ObservableCollection(Of MaterialWJ)
|
|
' Public ReadOnly Property ListMaterial As ObservableCollection(Of MaterialWJ)
|
|
' Get
|
|
' Return m_ListMaterial
|
|
' End Get
|
|
' End Property
|
|
' ' materiale selezionato
|
|
' Private m_SelectedMaterial As MaterialWJ
|
|
' Public Property SelectedMaterial As MaterialWJ
|
|
' Get
|
|
' Return m_SelectedMaterial
|
|
' End Get
|
|
' Set(value As MaterialWJ)
|
|
' m_SelectedMaterial = value
|
|
' End Set
|
|
' End Property
|
|
' ' submateriale selezionato
|
|
' Private m_SelectedSubMaterial As SubMaterialWJ
|
|
' Public Property SelectedSubMaterial As SubMaterialWJ
|
|
' Get
|
|
' Return m_SelectedSubMaterial
|
|
' End Get
|
|
' Set(value As SubMaterialWJ)
|
|
' m_SelectedSubMaterial = value
|
|
' End Set
|
|
' End Property
|
|
' ' lista parametri selezionata
|
|
' Private m_SelectedParam As ParamWJ
|
|
' Public Property SelectedParam As ParamWJ
|
|
' Get
|
|
' Return m_SelectedParam
|
|
' End Get
|
|
' Set(value As ParamWJ)
|
|
' m_SelectedParam = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Private m_sNewMaterial As MaterialWJ
|
|
' Public Property sNewMaterial As String
|
|
' Get
|
|
' Return m_sNewMaterial.sMaterial
|
|
' End Get
|
|
' Set(value As String)
|
|
' m_sNewMaterial = New MaterialWJ(value)
|
|
' End Set
|
|
' End Property
|
|
|
|
' Private m_NewMaterialVisibility As Visibility = Visibility.Hidden
|
|
' Public Property NewMaterialVisibility As Visibility
|
|
' Get
|
|
' Return m_NewMaterialVisibility
|
|
' End Get
|
|
' Set(value As Visibility)
|
|
' m_NewMaterialVisibility = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Sub New(WaterJetPageV As WaterJetPageUC)
|
|
' m_refWaterPageV = WaterJetPageV
|
|
' ' Creo una lista di materiali come esempio
|
|
' ListMaterial.Add(New MaterialWJ("Marmo"))
|
|
' ListMaterial.Last.ListOfSubMaterial.Add(New SubMaterialWJ("Binaco"))
|
|
' ListMaterial.Last.ListOfSubMaterial.Last.ListOfParam.Add(New ParamWJ("10", "Bq1", "Bq2", "Bq3", "Bq4", "Bq5"))
|
|
' ListMaterial.Last.ListOfSubMaterial.Add(New SubMaterialWJ("Nero"))
|
|
' ListMaterial.Last.ListOfSubMaterial.Last.ListOfParam.Add(New ParamWJ("20", "Nq1", "Nq2", "Nq3", "Nq4", "Nq5"))
|
|
' ListMaterial.Add(New MaterialWJ("Granito"))
|
|
' ListMaterial.Last.ListOfSubMaterial.Add(New SubMaterialWJ("GR_Binaco"))
|
|
' ListMaterial.Last.ListOfSubMaterial.Last.ListOfParam.Add(New ParamWJ("15", "gBq1", "gBq2", "Bq3", "gBq4", "gBq5"))
|
|
' ListMaterial.Last.ListOfSubMaterial.Last.ListOfParam.Add(New ParamWJ("15.5", "g_Bq1", "g_Bq2", "g_Bq3", "g_Bq4", "g_Bq5"))
|
|
' ListMaterial.Last.ListOfSubMaterial.Last.ListOfParam.Add(New ParamWJ("15.8", "G_Bq1", "G_Bq2", "G_Bq3", "G_Bq4", "G_Bq5"))
|
|
' ListMaterial.Last.ListOfSubMaterial.Add(New SubMaterialWJ("GR_Nero"))
|
|
' ListMaterial.Last.ListOfSubMaterial.Last.ListOfParam.Add(New ParamWJ("18", "gNq1", "gNq2", "gNq3", "gNq4", "gNq5"))
|
|
|
|
' SelectedMaterial = m_ListMaterial(0)
|
|
' SelectedSubMaterial = m_SelectedMaterial.ListOfSubMaterial(0)
|
|
' SelectedParam = SelectedSubMaterial.ListOfParam(0)
|
|
' End Sub
|
|
|
|
' Private m_cmdOk As ICommand
|
|
' Public ReadOnly Property OkCommand() As ICommand
|
|
' Get
|
|
' If m_cmdOk Is Nothing Then
|
|
' m_cmdOk = New Command(AddressOf Ok)
|
|
' End If
|
|
' Return m_cmdOk
|
|
' End Get
|
|
' End Property
|
|
|
|
' Private Sub Ok()
|
|
' ' Mostro textbox per il nome
|
|
' m_refWaterPageV.KitNameTxBx.Text = String.Empty
|
|
' m_refWaterPageV.KitNameTxBx.Visibility = Windows.Visibility.Visible
|
|
' m_refWaterPageV.KitsLstBx.SetValue(Grid.RowSpanProperty, 1)
|
|
' MessageBox.Show("Prova di Binding", "Prova di Binding", MessageBoxButton.OK, MessageBoxImage.Asterisk, MessageBoxResult.OK)
|
|
' m_refWaterPageV.KitNameTxBx.Visibility = Windows.Visibility.Hidden
|
|
' m_refWaterPageV.KitsLstBx.SetValue(Grid.RowSpanProperty, 2)
|
|
' End Sub
|
|
|
|
'End Class
|
|
|
|
|
|
'Public Class MaterialWJ
|
|
|
|
' Private m_sMaterial As String = String.Empty
|
|
' Public ReadOnly Property sMaterial As String
|
|
' Get
|
|
' Return m_sMaterial
|
|
' End Get
|
|
' End Property
|
|
|
|
' Private m_ListOfSubMaterial As New ObservableCollection(Of SubMaterialWJ)
|
|
' Public Property ListOfSubMaterial As ObservableCollection(Of SubMaterialWJ)
|
|
' Get
|
|
' Return m_ListOfSubMaterial
|
|
' End Get
|
|
' Set(value As ObservableCollection(Of SubMaterialWJ))
|
|
' m_ListOfSubMaterial = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Sub New(sMat As String)
|
|
' m_sMaterial = sMat
|
|
' End Sub
|
|
|
|
'End Class
|
|
|
|
'Public Class SubMaterialWJ
|
|
|
|
' Dim m_sSubMaterial As String
|
|
' Public Property sSubMaterial As String
|
|
' Get
|
|
' Return m_sSubMaterial
|
|
' End Get
|
|
' Set(value As String)
|
|
' m_sSubMaterial = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Private m_ListOfParam As New ObservableCollection(Of ParamWJ)
|
|
' Public Property ListOfParam As ObservableCollection(Of ParamWJ)
|
|
' Get
|
|
' Return m_ListOfParam
|
|
' End Get
|
|
' Set(value As ObservableCollection(Of ParamWJ))
|
|
' m_ListOfParam = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Sub New(sName As String)
|
|
' m_sSubMaterial = sName
|
|
' End Sub
|
|
'End Class
|
|
|
|
'Public Class ParamWJ
|
|
|
|
' Private m_Thickness As String
|
|
' Private m_Q1 As String
|
|
' Private m_Q2 As String
|
|
' Private m_Q3 As String
|
|
' Private m_Q4 As String
|
|
' Private m_Q5 As String
|
|
|
|
' Public Property Q1 As String
|
|
' Get
|
|
' Return m_Q1
|
|
' End Get
|
|
' Set(value As String)
|
|
' m_Q1 = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Public Property Thickness As String
|
|
' Get
|
|
' Return m_Thickness
|
|
' End Get
|
|
' Set(value As String)
|
|
' m_Thickness = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Public Property Q2 As String
|
|
' Get
|
|
' Return m_Q2
|
|
' End Get
|
|
' Set(value As String)
|
|
' m_Q2 = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Public Property Q3 As String
|
|
' Get
|
|
' Return m_Q3
|
|
' End Get
|
|
' Set(value As String)
|
|
' m_Q3 = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Public Property Q4 As String
|
|
' Get
|
|
' Return m_Q4
|
|
' End Get
|
|
' Set(value As String)
|
|
' m_Q4 = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Public Property Q5 As String
|
|
' Get
|
|
' Return m_Q5
|
|
' End Get
|
|
' Set(value As String)
|
|
' m_Q5 = value
|
|
' End Set
|
|
' End Property
|
|
|
|
' Sub New(sT As String, sQ1 As String, sQ2 As String, sQ3 As String, sQ4 As String, sQ5 As String)
|
|
' m_Thickness = sT
|
|
' m_Q1 = sQ1
|
|
' m_Q2 = sQ2
|
|
' m_Q3 = sQ3
|
|
' m_Q4 = sQ4
|
|
' m_Q5 = sQ5
|
|
' End Sub
|
|
|
|
'End Class
|
|
|
|
Imports System.Collections.ObjectModel
|
|
Imports System.IO
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Public Class WaterjetDbWindowVM
|
|
Inherits VMBase
|
|
' Riferimento alla MainWindow
|
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
|
Private m_refWaterPageV As WaterJetPageUC
|
|
|
|
#Region "FIELDS & PROPERTIES"
|
|
|
|
|
|
#Region "Materiali"
|
|
Private Property m_MaterialList As ObservableCollection(Of WjMaterial)
|
|
Public Property MaterialList As ObservableCollection(Of WjMaterial)
|
|
Get
|
|
Return m_MaterialList
|
|
End Get
|
|
Set(value As ObservableCollection(Of WjMaterial))
|
|
m_MaterialList = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property m_SelMaterial As WjMaterial
|
|
Public Property SelMaterial As WjMaterial
|
|
Get
|
|
Return m_SelMaterial
|
|
End Get
|
|
Set(value As WjMaterial)
|
|
m_SelMaterial = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property m_sNewMaterial As String
|
|
Public Property sNewMaterial As String
|
|
Get
|
|
Return m_sNewMaterial
|
|
End Get
|
|
Set(value As String)
|
|
m_sNewMaterial = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property m_NewMaterial_Visibility As Visibility = Visibility.Collapsed
|
|
Public Property NewMaterial_Visibility As Visibility
|
|
Get
|
|
Return m_NewMaterial_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_NewMaterial_Visibility = value
|
|
NotifyPropertyChanged(NameOf(NewMaterial_Visibility))
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
#Region "SubMateriali"
|
|
Private Property m_SubMaterialList As New ObservableCollection(Of WjSubMaterial)
|
|
Public Property SubMaterialList As ObservableCollection(Of WjSubMaterial)
|
|
Get
|
|
Return m_SubMaterialList
|
|
End Get
|
|
Set(value As ObservableCollection(Of WjSubMaterial))
|
|
m_SubMaterialList = value
|
|
End Set
|
|
End Property
|
|
|
|
'Private Property m_SelSubMaterial As WjSubMaterial
|
|
'Public Property SelSubMaterial As WjSubMaterial
|
|
' Get
|
|
' Return m_SelSubMaterial
|
|
' End Get
|
|
' Set(value As WjSubMaterial)
|
|
' m_SelSubMaterial = value
|
|
' End Set
|
|
'End Property
|
|
|
|
Private Property m_sNewSubMaterial As String
|
|
Public Property sNewSubMaterial As String
|
|
Get
|
|
Return m_sNewSubMaterial
|
|
End Get
|
|
Set(value As String)
|
|
m_sNewSubMaterial = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property m_NewSubMaterial_Visibility As Visibility = Visibility.Collapsed
|
|
Public Property NewSubMaterial_Visibility As Visibility
|
|
Get
|
|
Return m_NewSubMaterial_Visibility
|
|
End Get
|
|
Set(value As Visibility)
|
|
m_NewSubMaterial_Visibility = value
|
|
NotifyPropertyChanged(NameOf(NewSubMaterial_Visibility))
|
|
End Set
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
#Region "Parametri"
|
|
Private Property m_ParamList As ObservableCollection(Of WjParam)
|
|
Public Property ParamList As ObservableCollection(Of WjParam)
|
|
Get
|
|
Return m_ParamList
|
|
End Get
|
|
Set(value As ObservableCollection(Of WjParam))
|
|
m_ParamList = value
|
|
End Set
|
|
End Property
|
|
|
|
'Private Property m_SelParam As WjParam
|
|
'Public Property SelParam As WjParam
|
|
' Get
|
|
' Return m_SelParam
|
|
' End Get
|
|
' Set(value As WjParam)
|
|
' m_SelParam = value
|
|
' End Set
|
|
'End Property
|
|
|
|
Private m_HeadParamLstBx_Width As Double
|
|
Public ReadOnly Property HeadParamLstBx_Width As Double
|
|
Get
|
|
If m_HeadParamLstBx_Width < 10 Then
|
|
Return 700
|
|
End If
|
|
Return m_HeadParamLstBx_Width
|
|
End Get
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
Const S_MATERIALS As String = "Materials"
|
|
|
|
' Definizione comandi
|
|
Private m_cmdNewMaterial As ICommand
|
|
Private m_cmdDeleteMaterial As ICommand
|
|
Private m_cmdNewSubMaterial As ICommand
|
|
Private m_cmdDeleteSubMaterial As ICommand
|
|
Private m_cmdNewWjParam As ICommand
|
|
Private m_cmdDeleteWjParam As ICommand
|
|
Private m_cmdSave As ICommand
|
|
Private m_cmdDone As ICommand
|
|
|
|
#End Region
|
|
|
|
#Region "MESSAGES"
|
|
|
|
Public ReadOnly Property Material_Msg As String
|
|
Get
|
|
Return "Materiale"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property SubMaterial_Msg As String
|
|
Get
|
|
Return "SubMateriale"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Id_Msg As String
|
|
Get
|
|
Return "Id"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Thickness_Msg As String
|
|
Get
|
|
Return "Spess."
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Flux_Msg As String
|
|
Get
|
|
Return "mg/min"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Q1_Msg As String
|
|
Get
|
|
Return "Q1"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Q2_Msg As String
|
|
Get
|
|
Return "Q2"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Q3_Msg As String
|
|
Get
|
|
Return "Q3"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Q4_Msg As String
|
|
Get
|
|
Return "Q4"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Q5_Msg As String
|
|
Get
|
|
Return "Q5"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property QExtra_Msg As String
|
|
Get
|
|
Return "QExtra"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property AngComp_Msg As String
|
|
Get
|
|
Return "Ang"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property New_Msg As String
|
|
Get
|
|
Return "Nuovo"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Delete_Msg As String
|
|
Get
|
|
Return "Elimina"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Save_Msg As String
|
|
Get
|
|
Return "Salva"
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property Modify_Msg As String
|
|
Get
|
|
Return "Modifica"
|
|
End Get
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
Sub New(refContext As WaterJetPageUC)
|
|
' definisco il riferiento con la pagina xaml
|
|
m_refWaterPageV = refContext
|
|
' Leggo valori da file Data e li carico nelle proprietà
|
|
Dim sFilePath As String = m_MainWindow.m_CurrentMachine.sMachDir & "\" & MACHININGS_DIR & "\" & WATERJETDB_FILE
|
|
MaterialList = New ObservableCollection(Of WjMaterial)
|
|
|
|
If File.Exists(sFilePath) Then
|
|
Dim sMaterial As String = String.Empty
|
|
|
|
If EgtUILib.GetPrivateProfileString(S_MATERIALS, "1", "", sMaterial, sFilePath) > 0 Then
|
|
Dim sMaterials() As String = sMaterial.Split(","c)
|
|
Dim ind As Integer = 0
|
|
For ind = 0 To sMaterials.Length() - 1
|
|
|
|
'recupero i sottomateriali
|
|
Dim Index As Integer = 1
|
|
Dim sSubMat As String = String.Empty
|
|
Dim SubMatList As New ObservableCollection(Of WjSubMaterial)
|
|
While EgtUILib.GetPrivateProfileString(sMaterials(ind), Index.ToString(), "", sSubMat, sFilePath) > 0
|
|
|
|
|
|
' recupero la lista dei Q
|
|
Dim QInd As Integer = 1
|
|
Dim sParam As String = String.Empty
|
|
Dim QParamList As New ObservableCollection(Of WjParam)
|
|
While EgtUILib.GetPrivateProfileString(sMaterials(ind) & "." & sSubMat, QInd.ToString(), "", sParam, sFilePath) > 0
|
|
Dim sParams() As String = sParam.Split(","c)
|
|
If sParams.Length() >= 7 Then
|
|
Dim dThickness As Double
|
|
Dim dQ1 As Double
|
|
Dim dQ2 As Double
|
|
Dim dQ3 As Double
|
|
Dim dQ4 As Double
|
|
Dim dQ5 As Double
|
|
Dim dQExtra As Double
|
|
StringToDouble(sParams(0), dThickness)
|
|
StringToDouble(sParams(1), dQ1)
|
|
StringToDouble(sParams(2), dQ2)
|
|
StringToDouble(sParams(3), dQ3)
|
|
StringToDouble(sParams(4), dQ4)
|
|
StringToDouble(sParams(5), dQ5)
|
|
StringToDouble(sParams(6), dQExtra)
|
|
Dim LocalWjParam As New WjParam(QInd, dThickness, dQ1, dQ2, dQ3, dQ4, dQ5, dQExtra, m_refWaterPageV)
|
|
QParamList.Add(LocalWjParam)
|
|
' leggo il nuovo parametro di correzione conicità (di default il parametro è 0)
|
|
If sParams.Length() >= 8 Then
|
|
Dim dAngCompo As Double
|
|
StringToDouble(sParams(7), dAngCompo)
|
|
LocalWjParam.dAngComp = dAngCompo
|
|
End If
|
|
End If
|
|
QInd += 1
|
|
End While
|
|
|
|
SubMatList.Add(New WjSubMaterial(sSubMat, QParamList))
|
|
Index += 1
|
|
End While
|
|
|
|
MaterialList.Add(New WjMaterial(sMaterials(ind), SubMatList))
|
|
Next
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Public Sub RefreshDImensionPage()
|
|
m_HeadParamLstBx_Width = m_refWaterPageV.ParamsGpBx.ActualWidth - 20
|
|
NotifyPropertyChanged(NameOf(HeadParamLstBx_Width))
|
|
End Sub
|
|
|
|
#End Region ' Constructor
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "NewMaterialCommand"
|
|
|
|
Public ReadOnly Property NewMaterialCommand As ICommand
|
|
Get
|
|
If m_cmdNewMaterial Is Nothing Then
|
|
m_cmdNewMaterial = New Command(AddressOf NewMaterial)
|
|
End If
|
|
Return m_cmdNewMaterial
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub NewMaterial(ByVal param As Object)
|
|
NewSubMaterial_Visibility = Visibility.Collapsed
|
|
NewMaterial_Visibility = Visibility.Visible
|
|
End Sub
|
|
|
|
#End Region ' NewMaterial
|
|
|
|
#Region "DeleteMaterialCommand"
|
|
|
|
Public ReadOnly Property DeleteMaterialCommand As ICommand
|
|
Get
|
|
If m_cmdDeleteMaterial Is Nothing Then
|
|
m_cmdDeleteMaterial = New Command(AddressOf DeleteMaterial)
|
|
End If
|
|
Return m_cmdDeleteMaterial
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub DeleteMaterial(ByVal param As Object)
|
|
If Not IsNothing(SelMaterial) Then
|
|
MaterialList.Remove(SelMaterial)
|
|
'SelMaterial.NotifyPropertyChanged(NameOf(MaterialList))
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' DeleteMaterial
|
|
|
|
#Region "NewSubMaterialCommand"
|
|
|
|
Public ReadOnly Property NewSubMaterialCommand As ICommand
|
|
Get
|
|
If m_cmdNewSubMaterial Is Nothing Then
|
|
m_cmdNewSubMaterial = New Command(AddressOf NewSubMaterial)
|
|
End If
|
|
Return m_cmdNewSubMaterial
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub NewSubMaterial(ByVal param As Object)
|
|
If Not IsNothing(SelMaterial) Then
|
|
NewMaterial_Visibility = Visibility.Collapsed
|
|
NewSubMaterial_Visibility = Visibility.Visible
|
|
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' NewSubMaterial
|
|
|
|
#Region "DeleteSubMaterialCommand"
|
|
|
|
Public ReadOnly Property DeleteSubMaterialCommand As ICommand
|
|
Get
|
|
If m_cmdDeleteSubMaterial Is Nothing Then
|
|
m_cmdDeleteSubMaterial = New Command(AddressOf DeleteSubMaterial)
|
|
End If
|
|
Return m_cmdDeleteSubMaterial
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub DeleteSubMaterial(ByVal param As Object)
|
|
If Not IsNothing(SelMaterial.SelSubMaterial) Then
|
|
SelMaterial.SubMaterialList.Remove(SelMaterial.SelSubMaterial)
|
|
SelMaterial.NotifyPropertyChanged(NameOf(SubMaterialList))
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' DeleteSubMaterial
|
|
|
|
#Region "NewWjParamCommand"
|
|
|
|
Public ReadOnly Property NewWjParamCommand As ICommand
|
|
Get
|
|
If m_cmdNewWjParam Is Nothing Then
|
|
m_cmdNewWjParam = New Command(AddressOf NewWjParam)
|
|
End If
|
|
Return m_cmdNewWjParam
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub NewWjParam(ByVal param As Object)
|
|
If Not IsNothing(SelMaterial.SelSubMaterial) Then
|
|
Dim nId As Integer = 0
|
|
If IsNothing(SelMaterial.SelSubMaterial.ParamList) Then
|
|
nId = 1
|
|
SelMaterial.SelSubMaterial.ParamList = New ObservableCollection(Of WjParam)
|
|
Else
|
|
nId = SelMaterial.SelSubMaterial.ParamList.Count + 1
|
|
End If
|
|
SelMaterial.SelSubMaterial.ParamList.Add(New WjParam(nId, 0, 0, 0, 0, 0, 0, 0, m_refWaterPageV))
|
|
SelMaterial.SelSubMaterial.NotifyPropertyChanged(NameOf(ParamList))
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' NewWjParam
|
|
|
|
#Region "DeleteWjParamCommand"
|
|
|
|
Public ReadOnly Property DeleteWjParamCommand As ICommand
|
|
Get
|
|
If m_cmdDeleteWjParam Is Nothing Then
|
|
m_cmdDeleteWjParam = New Command(AddressOf DeleteWjParam)
|
|
End If
|
|
Return m_cmdDeleteWjParam
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub DeleteWjParam(ByVal param As Object)
|
|
If Not IsNothing(SelMaterial.SelSubMaterial.SelWjParam) Then
|
|
SelMaterial.SelSubMaterial.ParamList.Remove(SelMaterial.SelSubMaterial.SelWjParam)
|
|
SelMaterial.SelSubMaterial.NotifyPropertyChanged(NameOf(ParamList))
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' DeleteWjParam
|
|
|
|
#Region "DoneCommand"
|
|
|
|
Public ReadOnly Property DoneCommand As ICommand
|
|
Get
|
|
If m_cmdDone Is Nothing Then
|
|
m_cmdDone = New Command(AddressOf Done)
|
|
End If
|
|
Return m_cmdDone
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub Done(ByVal param As Object)
|
|
If NewMaterial_Visibility = Visibility.Visible Then
|
|
MaterialList.Add(New WjMaterial(sNewMaterial))
|
|
NotifyPropertyChanged(NameOf(MaterialList))
|
|
NewMaterial_Visibility = Visibility.Collapsed
|
|
ElseIf NewSubMaterial_Visibility = Visibility.Visible Then
|
|
SelMaterial.SubMaterialList.Add(New WjSubMaterial(sNewSubMaterial))
|
|
NotifyPropertyChanged(NameOf(SubMaterialList))
|
|
NewSubMaterial_Visibility = Visibility.Collapsed
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' Done
|
|
|
|
#End Region ' Commands
|
|
|
|
End Class
|
|
|
|
Public Class WjMaterial
|
|
Inherits VMBase
|
|
|
|
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_SubMaterialList As ObservableCollection(Of WjSubMaterial)
|
|
Public Property SubMaterialList As ObservableCollection(Of WjSubMaterial)
|
|
Get
|
|
Return m_SubMaterialList
|
|
End Get
|
|
Set(value As ObservableCollection(Of WjSubMaterial))
|
|
m_SubMaterialList = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property m_SelSubMaterial As WjSubMaterial
|
|
Public Property SelSubMaterial As WjSubMaterial
|
|
Get
|
|
Return m_SelSubMaterial
|
|
End Get
|
|
Set(value As WjSubMaterial)
|
|
m_SelSubMaterial = value
|
|
End Set
|
|
End Property
|
|
|
|
Sub New(sName As String, SubMatList As ObservableCollection(Of WjSubMaterial))
|
|
m_Name = sName
|
|
m_SubMaterialList = SubMatList
|
|
End Sub
|
|
|
|
Sub New(sName As String)
|
|
m_Name = sName
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
Public Class WjSubMaterial
|
|
Inherits VMBase
|
|
|
|
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_ParamList As ObservableCollection(Of WjParam)
|
|
Public Property ParamList As ObservableCollection(Of WjParam)
|
|
Get
|
|
Return m_ParamList
|
|
End Get
|
|
Set(value As ObservableCollection(Of WjParam))
|
|
m_ParamList = value
|
|
End Set
|
|
End Property
|
|
|
|
Private Property m_SelWjParam As WjParam
|
|
Public Property SelWjParam As WjParam
|
|
Get
|
|
Return m_SelWjParam
|
|
End Get
|
|
Set(value As WjParam)
|
|
m_SelWjParam = value
|
|
End Set
|
|
End Property
|
|
|
|
Sub New(sName As String, ParamList As ObservableCollection(Of WjParam))
|
|
m_Name = sName
|
|
m_ParamList = ParamList
|
|
End Sub
|
|
|
|
Sub New(sName As String)
|
|
m_Name = sName
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
Public Class WjParam
|
|
|
|
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_Thickness As Double
|
|
Public Property Thickness As Double
|
|
Get
|
|
Return m_Thickness
|
|
End Get
|
|
Set(value As Double)
|
|
m_Thickness = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_Q1 As Double
|
|
Public Property Q1 As Double
|
|
Get
|
|
Return m_Q1
|
|
End Get
|
|
Set(value As Double)
|
|
m_Q1 = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_Q2 As Double
|
|
Public Property Q2 As Double
|
|
Get
|
|
Return m_Q2
|
|
End Get
|
|
Set(value As Double)
|
|
m_Q2 = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_Q3 As Double
|
|
Public Property Q3 As Double
|
|
Get
|
|
Return m_Q3
|
|
End Get
|
|
Set(value As Double)
|
|
m_Q3 = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_Q4 As Double
|
|
Public Property Q4 As Double
|
|
Get
|
|
Return m_Q4
|
|
End Get
|
|
Set(value As Double)
|
|
m_Q4 = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_Q5 As Double
|
|
Public Property Q5 As Double
|
|
Get
|
|
Return m_Q5
|
|
End Get
|
|
Set(value As Double)
|
|
m_Q5 = value
|
|
End Set
|
|
End Property
|
|
|
|
Private m_QExtra As Double
|
|
Public Property QExtra As Double
|
|
Get
|
|
Return m_QExtra
|
|
End Get
|
|
Set(value As Double)
|
|
m_QExtra = value
|
|
End Set
|
|
End Property
|
|
|
|
' angolo di compensazione conicità getto: 01/02/2023 ver 2.5b1
|
|
Private m_dAngComp As Double = 0
|
|
Public Property dAngComp As Double
|
|
Get
|
|
Return m_dAngComp
|
|
End Get
|
|
Set(value As Double)
|
|
m_dAngComp = value
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property ParamLstBx_Width As Double
|
|
Get
|
|
Return m_refWaterPageV.ParamsGpBx.ActualWidth - 20
|
|
End Get
|
|
End Property
|
|
|
|
Private m_refWaterPageV As WaterJetPageUC
|
|
|
|
Sub New(nId As Integer, dThickness As Double, dQ1 As Double, dQ2 As Double, dQ3 As Double, dQ4 As Double, dQ5 As Double, dQExtra As Double, ByRef refWJPage As WaterJetPageUC)
|
|
m_Id = nId
|
|
m_Thickness = dThickness
|
|
m_Q1 = dQ1
|
|
m_Q2 = dQ2
|
|
m_Q3 = dQ3
|
|
m_Q4 = dQ4
|
|
m_Q5 = dQ5
|
|
m_QExtra = dQExtra
|
|
m_refWaterPageV = refWJPage
|
|
End Sub
|
|
|
|
End Class
|