diff --git a/MachinePanel/MyMachinePanelVM.vb b/MachinePanel/MyMachinePanelVM.vb
index 9137f7a..0a66202 100644
--- a/MachinePanel/MyMachinePanelVM.vb
+++ b/MachinePanel/MyMachinePanelVM.vb
@@ -335,7 +335,7 @@ Public Class MyMachinePanelVM
''' Execute the Exec. This method is invoked by the ExecCommand.
'''
Public Sub WaterjetDb(ByVal param As Object)
- Dim WaterjetDbWindow As New WaterjetDbWindowV(Application.Current.MainWindow, New WaterjetDbWindowVM)
+ Dim WaterjetDbWindow As New WaterjetDbWindowV(Application.Current.MainWindow, New WaterjetDbWindowVM(CurrentMachine.sMachDir))
WaterjetDbWindow.Height = 546
WaterjetDbWindow.Width = 846
WaterjetDbWindow.ShowDialog()
diff --git a/OmagOFFICE.vbproj b/OmagOFFICE.vbproj
index bb8fc7d..99e73a3 100644
--- a/OmagOFFICE.vbproj
+++ b/OmagOFFICE.vbproj
@@ -231,10 +231,6 @@
-
- WaterjetDbWindowV.xaml
-
- MyToolDbWindowV.xaml
@@ -417,10 +413,6 @@
MainWindowV.xamlCode
-
- MSBuild:Compile
- Designer
- MSBuild:CompileDesigner
diff --git a/WaterjetDbWindow/WaterjetDbWindowV.xaml b/WaterjetDbWindow/WaterjetDbWindowV.xaml
deleted file mode 100644
index e0257a0..0000000
--- a/WaterjetDbWindow/WaterjetDbWindowV.xaml
+++ /dev/null
@@ -1,183 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/WaterjetDbWindow/WaterjetDbWindowV.xaml.vb b/WaterjetDbWindow/WaterjetDbWindowV.xaml.vb
deleted file mode 100644
index 7e6c072..0000000
--- a/WaterjetDbWindow/WaterjetDbWindowV.xaml.vb
+++ /dev/null
@@ -1,18 +0,0 @@
-Public Class WaterjetDbWindowV
-
- Private WithEvents m_WaterjetDbWindowVM As WaterjetDbWindowVM
-
- Sub New(Owner As Window, WaterjetDbWindowVM As WaterjetDbWindowVM)
- MyBase.New(Owner)
- ' This call is required by the designer.
- InitializeComponent()
- Me.DataContext = WaterjetDbWindowVM
- ' Assegno al riferimento locale al VM il VM preso dal DataContext
- m_WaterjetDbWindowVM = WaterjetDbWindowVM
- End Sub
-
- Private Sub CloseWindow(bDialogResult As Boolean) Handles m_WaterjetDbWindowVM.m_CloseWindow
- Me.DialogResult = bDialogResult
- End Sub
-
-End Class
diff --git a/WaterjetDbWindow/WaterjetDbWindowVM.vb b/WaterjetDbWindow/WaterjetDbWindowVM.vb
deleted file mode 100644
index f6d7875..0000000
--- a/WaterjetDbWindow/WaterjetDbWindowVM.vb
+++ /dev/null
@@ -1,831 +0,0 @@
-Imports System.Collections.ObjectModel
-Imports System.IO
-Imports EgtUILib
-Imports EgtWPFLib5
-
-Public Class WaterjetDbWindowVM
- Inherits VMBase
-
-#Region "FIELDS & PROPERTIES"
-
- 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_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_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_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_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_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
-
- 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
-
- Public Const K_WATERJETDB = "WaterjetDb"
- Public Const S_MATERIALS = "Materials"
-
- Public Event m_CloseWindow(bDialogResult As Boolean)
-
- ' flag per differenziare Nuova e Modifica nella TextBox
- Public bModify As Boolean = False
- ' flag per aggiunte, modifiche, eliminazioni
- Public bIsModified As Boolean = False
-
- ' Definizione comandi
- Private m_cmdNewMaterial As ICommand
- Private m_cmdModifyMaterial As ICommand
- Private m_cmdDeleteMaterial As ICommand
- Private m_cmdNewSubMaterial As ICommand
- Private m_cmdModifySubMaterial 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
- Private m_cmdCancel As ICommand
- Private m_cmdCloseWaterjetDb As ICommand
-
-#End Region
-
-#Region "MESSAGES"
-
- Public ReadOnly Property Title_Msg As String
- Get
- Return EgtMsg(31751)
- End Get
- End Property
-
- Public ReadOnly Property Thickness_Msg As String
- Get
- Return EgtMsg(31752)
- End Get
- End Property
-
- Public ReadOnly Property Q1_Msg As String
- Get
- Return EgtMsg(31753)
- End Get
- End Property
-
- Public ReadOnly Property Q2_Msg As String
- Get
- Return EgtMsg(31754)
- End Get
- End Property
-
- Public ReadOnly Property Q3_Msg As String
- Get
- Return EgtMsg(31755)
- End Get
- End Property
-
- Public ReadOnly Property Q4_Msg As String
- Get
- Return EgtMsg(31756)
- End Get
- End Property
-
- Public ReadOnly Property Q5_Msg As String
- Get
- Return EgtMsg(31757)
- End Get
- End Property
-
- Public ReadOnly Property QExtra_Msg As String
- Get
- Return EgtMsg(31758)
- End Get
- End Property
-
- Public ReadOnly Property New_Msg As String
- Get
- Return EgtMsg(31701)
- End Get
- End Property
-
- Public ReadOnly Property Modify_Msg As String
- Get
- Return EgtMsg(31704)
- End Get
- End Property
-
- Public ReadOnly Property Delete_Msg As String
- Get
- Return EgtMsg(31703)
- End Get
- End Property
-
- Public ReadOnly Property Save_Msg As String
- Get
- Return EgtMsg(31702)
- End Get
- End Property
-
-#End Region
-
-#Region "CONSTRUCTOR"
-
- Sub New()
- ' Leggo valori da file INI e li carico nelle proprietà
- Dim sFilePath As String = CurrentMachine.sMachDir & "\" & K_WATERJETDB & ".ini"
- MaterialList = New ObservableCollection(Of WjMaterial)
- If File.Exists(sFilePath) Then
- Dim sMaterial As String = String.Empty
- 'recupero i Materiali
- If EgtUILib.GetPrivateProfileString(S_MATERIALS, "1", "", sMaterial, sFilePath) > 0 Then
- Dim sMaterials() As String = sMaterial.Split(","c)
- 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)
- QParamList.Add(New WjParam(QInd, dThickness, dQ1, dQ2, dQ3, dQ4, dQ5, dQExtra))
- 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
-
-#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 "ModifyMaterialCommand"
-
- Public ReadOnly Property ModifyMaterialCommand As ICommand
- Get
- If m_cmdModifyMaterial Is Nothing Then
- m_cmdModifyMaterial = New Command(AddressOf ModifyMaterial)
- End If
- Return m_cmdModifyMaterial
- End Get
- End Property
-
- Public Sub ModifyMaterial(ByVal param As Object)
- NewSubMaterial_Visibility = Visibility.Collapsed
- NewMaterial_Visibility = Visibility.Visible
- bModify = True
- End Sub
-
-#End Region ' ModifyMaterial
-
-#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)
- bIsModified = True
- 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 "ModifyMaterialCommand"
-
- Public ReadOnly Property ModifySubMaterialCommand As ICommand
- Get
- If m_cmdModifySubMaterial Is Nothing Then
- m_cmdModifySubMaterial = New Command(AddressOf ModifySubMaterial)
- End If
- Return m_cmdModifySubMaterial
- End Get
- End Property
-
- Public Sub ModifySubMaterial(ByVal param As Object)
- NewMaterial_Visibility = Visibility.Collapsed
- NewSubMaterial_Visibility = Visibility.Visible
- bModify = True
- End Sub
-
-#End Region ' ModifyMaterial
-
-#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)
- bIsModified = True
- 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))
- SelMaterial.SelSubMaterial.NotifyPropertyChanged(NameOf(ParamList))
- bIsModified = True
- 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))
- bIsModified = True
- 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
- If bModify Then
- Dim tempMat As WjMaterial = SelMaterial
- tempMat.Name = sNewMaterial
- Dim tempIndex As Integer = MaterialList.IndexOf(SelMaterial)
- MaterialList.RemoveAt(tempIndex)
- MaterialList.Insert(tempIndex, tempMat)
- NotifyPropertyChanged(NameOf(MaterialList))
- sNewMaterial = String.Empty
- NewMaterial_Visibility = Visibility.Collapsed
- bModify = False
- Else
- MaterialList.Add(New WjMaterial(sNewMaterial))
- MaterialList.Last.SubMaterialList = New ObservableCollection(Of WjSubMaterial)
- NotifyPropertyChanged(NameOf(MaterialList))
- sNewMaterial = String.Empty
- NewMaterial_Visibility = Visibility.Collapsed
- End If
- ElseIf NewSubMaterial_Visibility = Visibility.Visible Then
- If bModify Then
- Dim tempSubMat As WjSubMaterial = SelMaterial.SelSubMaterial
- tempSubMat.Name = sNewSubMaterial
- Dim tempIndex As Integer = SelMaterial.SubMaterialList.IndexOf(SelMaterial.SelSubMaterial)
- SelMaterial.SubMaterialList.RemoveAt(tempIndex)
- SelMaterial.SubMaterialList.Insert(tempIndex, tempSubMat)
- NotifyPropertyChanged(NameOf(SubMaterialList))
- sNewSubMaterial = String.Empty
- NewSubMaterial_Visibility = Visibility.Collapsed
- bModify = False
- Else
- SelMaterial.SubMaterialList.Add(New WjSubMaterial(sNewSubMaterial))
- NotifyPropertyChanged(NameOf(SubMaterialList))
- sNewSubMaterial = String.Empty
- NewSubMaterial_Visibility = Visibility.Collapsed
- End If
- End If
- bIsModified = True
- End Sub
-
-#End Region ' Done
-
-#Region "SaveCommand"
-
- Public ReadOnly Property SaveCommand As ICommand
- Get
- If m_cmdSave Is Nothing Then
- m_cmdSave = New Command(AddressOf Save)
- End If
- Return m_cmdSave
- End Get
- End Property
-
- Public Sub Save(ByVal param As Object)
- WriteWaterjetDb()
- bIsModified = False
- End Sub
-
-#End Region ' Save
-
-#Region "CancelCommand"
-
- Public ReadOnly Property CancelCommand As ICommand
- Get
- If m_cmdCancel Is Nothing Then
- m_cmdCancel = New Command(AddressOf Cancel)
- End If
- Return m_cmdCancel
- End Get
- End Property
-
- Public Sub Cancel(ByVal param As Object)
- NewMaterial_Visibility = Visibility.Collapsed
- NewSubMaterial_Visibility = Visibility.Collapsed
- End Sub
-
-#End Region ' Cancel
-
-#Region "CloseWaterjetDbCommand"
-
- Public ReadOnly Property CloseWaterjetDbCommand As ICommand
- Get
- If m_cmdCloseWaterjetDb Is Nothing Then
- m_cmdCloseWaterjetDb = New Command(AddressOf CloseWaterjetDb)
- End If
- Return m_cmdCloseWaterjetDb
- End Get
- End Property
-
- Public Sub CloseWaterjetDb(ByVal param As Object)
- If bIsModified Then
- Select Case MsgBox(EgtMsg(31759), MsgBoxStyle.YesNoCancel, EgtMsg(31402))
- Case MsgBoxResult.Cancel
- Return
- Case MsgBoxResult.Yes
- WriteWaterjetDb()
- Case MsgBoxResult.No
- RaiseEvent m_CloseWindow(True)
- End Select
- Else
- Dim bExitFor As Boolean = False
- For Each Material In MaterialList
- For Each SubMaterial In Material.SubMaterialList
- For Each QParam In SubMaterial.ParamList
- bExitFor = QParam.IsModified()
- If bExitFor Then Exit For
- Next
- If bExitFor Then Exit For
- Next
- If bExitFor Then Exit For
- Next
- If bExitFor Then
- Select Case MsgBox(EgtMsg(31759), MsgBoxStyle.YesNoCancel, EgtMsg(31402))
- Case MsgBoxResult.Cancel
- Return
- Case MsgBoxResult.Yes
- WriteWaterjetDb()
- Case MsgBoxResult.No
- RaiseEvent m_CloseWindow(True)
- End Select
- End If
- End If
- RaiseEvent m_CloseWindow(True)
- End Sub
-
-#End Region ' CloseWaterjetDb
-
-#End Region ' Commands
-
-#Region "METHODS"
-
- Public Sub WriteWaterjetDb()
- ' cambio il nome del file INI attuale e ne riscrivo uno completamente nuovo
- Dim sFilePath As String = CurrentMachine.sMachDir & "\" & K_WATERJETDB & ".ini"
- Dim sOldFilePath As String = CurrentMachine.sMachDir & "\" & K_WATERJETDB & ".OLD.ini"
- If File.Exists(sOldFilePath) Then
- File.Delete(sOldFilePath)
- End If
- FileSystem.Rename(sFilePath, sOldFilePath)
- ' scrivo la sezione dei Materiali
- Dim sMaterial As String = String.Empty
- For Each Material In MaterialList
- sMaterial &= Material.Name & ","
- Next
- EgtUILib.WritePrivateProfileString(S_MATERIALS, "1", sMaterial.TrimEnd(","c) & Environment.NewLine, sFilePath)
- For Each Material In MaterialList
- If Not IsNothing(Material.SubMaterialList) AndAlso Material.SubMaterialList.Count > 0 Then
- ' scrivo la sezione dei Sottomateriali
- Dim SubMatIndex As Integer = 1
- For Each SubMaterial In Material.SubMaterialList
- WritePrivateProfileString(Material.Name, SubMatIndex.ToString(), SubMaterial.Name &
- If(SubMatIndex < Material.SubMaterialList.Count, "", Environment.NewLine), sFilePath)
- SubMatIndex += 1
- If Not IsNothing(SubMaterial.ParamList) AndAlso SubMaterial.ParamList.Count > 0 Then
- ' Scrivo la sezione dei Parametri dei Sottomateriali
- Dim ParamIndex As Integer = 1
- For Each ParamItem In SubMaterial.ParamList
- WritePrivateProfileString(Material.Name & "." & SubMaterial.Name, ParamIndex.ToString(),
- DoubleToString(ParamItem.Thickness, 3) & "," &
- DoubleToString(ParamItem.Q1, 3) & "," &
- DoubleToString(ParamItem.Q2, 3) & "," &
- DoubleToString(ParamItem.Q3, 3) & "," &
- DoubleToString(ParamItem.Q4, 3) & "," &
- DoubleToString(ParamItem.Q5, 3) & "," &
- DoubleToString(ParamItem.QExtra, 3) & If(ParamIndex < SubMaterial.ParamList.Count, "", Environment.NewLine), sFilePath)
- ParamItem.IsModifiedReset()
- ParamIndex += 1
- Next
- End If
- Next
- End If
- Next
- End Sub
-
-#End Region ' Methods
-
-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_IsModifiedThickness As Boolean = False
- Private m_Thickness As Double
- Public Property Thickness As Double
- Get
- Return m_Thickness
- End Get
- Set(value As Double)
- m_IsModifiedThickness = Math.Abs(value - m_Thickness) > 10 * EPS_ANG_SMALL
- m_Thickness = value
- End Set
- End Property
-
- Private m_IsModifiedQ1 As Boolean = False
- Private m_Q1 As Double
- Public Property Q1 As Double
- Get
- Return m_Q1
- End Get
- Set(value As Double)
- m_IsModifiedQ1 = Math.Abs(value - m_Q1) > 10 * EPS_ANG_SMALL
- m_Q1 = value
- End Set
- End Property
-
- Private m_IsModifiedQ2 As Boolean = False
- Private m_Q2 As Double
- Public Property Q2 As Double
- Get
- Return m_Q2
- End Get
- Set(value As Double)
- m_IsModifiedQ2 = Math.Abs(value - m_Q2) > 10 * EPS_ANG_SMALL
- m_Q2 = value
- End Set
- End Property
-
- Private m_IsModifiedQ3 As Boolean = False
- Private m_Q3 As Double
- Public Property Q3 As Double
- Get
- Return m_Q3
- End Get
- Set(value As Double)
- m_IsModifiedQ3 = Math.Abs(value - m_Q3) > 10 * EPS_ANG_SMALL
- m_Q3 = value
- End Set
- End Property
-
- Private m_IsModifiedQ4 As Boolean = False
- Private m_Q4 As Double
- Public Property Q4 As Double
- Get
- Return m_Q4
- End Get
- Set(value As Double)
- m_IsModifiedQ4 = Math.Abs(value - m_Q4) > 10 * EPS_ANG_SMALL
- m_Q4 = value
- End Set
- End Property
-
- Private m_IsModifiedQ5 As Boolean = False
- Private m_Q5 As Double
- Public Property Q5 As Double
- Get
- Return m_Q5
- End Get
- Set(value As Double)
- m_IsModifiedQ5 = Math.Abs(value - m_Q5) > 10 * EPS_ANG_SMALL
- m_Q5 = value
- End Set
- End Property
-
- Private m_IsModifiedQExtra As Boolean = False
- Private m_QExtra As Double
- Public Property QExtra As Double
- Get
- Return m_QExtra
- End Get
- Set(value As Double)
- m_IsModifiedQExtra = Math.Abs(value - m_QExtra) > 10 * EPS_ANG_SMALL
- m_QExtra = value
- End Set
- End Property
-
- 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)
- m_Id = nId
- m_Thickness = dThickness
- m_Q1 = dQ1
- m_Q2 = dQ2
- m_Q3 = dQ3
- m_Q4 = dQ4
- m_Q5 = dQ5
- m_QExtra = dQExtra
- End Sub
-
- Public ReadOnly Property IsModified() As Boolean
- Get
- Return m_IsModifiedThickness OrElse
- m_IsModifiedQ1 OrElse
- m_IsModifiedQ2 OrElse
- m_IsModifiedQ3 OrElse
- m_IsModifiedQ4 OrElse
- m_IsModifiedQ5 OrElse
- m_IsModifiedQExtra
- End Get
- End Property
-
- Public Sub IsModifiedReset()
- m_IsModifiedThickness = False
- m_IsModifiedQ1 = False
- m_IsModifiedQ2 = False
- m_IsModifiedQ3 = False
- m_IsModifiedQ4 = False
- m_IsModifiedQ5 = False
- m_IsModifiedQExtra = False
- End Sub
-
-End Class