Compare commits

...

1 Commits

Author SHA1 Message Date
RenzoL 367ac62fc8 Implementato flag FromDBWaterJet per utilizzo Materiali e Qualità WaterJet 2022-01-12 15:43:11 +01:00
7 changed files with 54 additions and 22 deletions
+1
View File
@@ -282,5 +282,6 @@
Public Const S_MATERIALS As String = "Materials"
Public Const K_CURRMATERIAL As String = "CurrMaterial"
Public Const K_MATERIAL As String = "Material"
Public Const K_FROMDBWATERJET As String = "FromDBWaterJet"
End Module
+16 -2
View File
@@ -437,10 +437,24 @@ Public Class AlarmsPageUC
End If
If m_CurrentMachine.sCurrWaterJetting <> String.Empty Then
CurrWaterJettingTxBx.Text = m_CurrentMachine.sCurrWaterJetting
CurrWaterJettingQualityTxBx.Text = m_CurrentMachine.sCurrWaterJettingQuality
CurrWaterJettingTxBl.Visibility = Windows.Visibility.Visible
CurrWaterJettingTxBx.Visibility = Windows.Visibility.Visible
CurrWaterJettingQualityTxBx.Visibility = Windows.Visibility.Visible
If m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
CurrWaterJettingTxBx.SetValue(Grid.ColumnSpanProperty, 1)
CurrWaterJettingTxBx.SetValue(MarginProperty, New Thickness(CurrWaterJettingTxBx.Margin.Left,
CurrWaterJettingTxBx.Margin.Top,
5,
CurrWaterJettingTxBx.Margin.Bottom))
CurrWaterJettingQualityTxBx.Text = m_CurrentMachine.sCurrWaterJettingQuality
CurrWaterJettingQualityTxBx.Visibility = Windows.Visibility.Visible
Else
CurrWaterJettingTxBx.SetValue(Grid.ColumnSpanProperty, 2)
CurrWaterJettingTxBx.SetValue(MarginProperty, New Thickness(CurrWaterJettingTxBx.Margin.Left,
CurrWaterJettingTxBx.Margin.Top,
10,
CurrWaterJettingTxBx.Margin.Bottom))
CurrWaterJettingQualityTxBx.Visibility = Windows.Visibility.Collapsed
End If
Else
CurrWaterJettingTxBl.Visibility = Windows.Visibility.Hidden
CurrWaterJettingTxBx.Visibility = Windows.Visibility.Hidden
+14 -3
View File
@@ -77,6 +77,9 @@ Public Class CurrentMachine
Private m_bPolishingWheel As Boolean = False
Private m_bWaterJet As Boolean = False
' Abilitazione DB WaterJet
Private m_bFromDBWaterJet As Boolean = False
' Flag per visualizzazione TcPos, Testa/uscita e Note utente
Private m_nShowToolChanger As Integer = 0 ' 0=no, 1=tutti utensili, 2=solo lame
Private m_bShowHeadExit As Boolean = False
@@ -436,6 +439,12 @@ Public Class CurrentMachine
End Get
End Property
Friend ReadOnly Property bFromDBWaterJet As Boolean
Get
Return m_bFromDBWaterJet
End Get
End Property
Friend ReadOnly Property ShowToolChanger As Integer
Get
Return m_nShowToolChanger
@@ -1006,7 +1015,7 @@ Public Class CurrentMachine
End Get
Set(value As Material)
Dim CurrMatId As String = If(Not IsNothing(value), value.nId.ToString, "")
If bWaterJet Then
If bWaterJet And bFromDBWaterJet Then
WritePrivateProfileString(S_MATERIALS, K_CURRMATERIAL, CurrMatId & If(Not IsNothing(value), "." & value.SubId, ""), sMachIniFile)
Else
WritePrivateProfileString(S_MATERIALS, K_CURRMATERIAL, CurrMatId, sMachIniFile)
@@ -1108,6 +1117,8 @@ Public Class CurrentMachine
' waterjet
m_bWaterJet = (GetPrivateProfileInt(S_TOOLS, K_WATERJET, 0, sMachIniFile) > 0) And
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.ENABLE_WJ)
' Leggo abilitazione DB WaterJet
m_bFromDBWaterJet = (GetPrivateProfileInt(S_MATERIALS, K_FROMDBWATERJET, 0, sMachIniFile) > 0)
' Leggo abilitazione visualizzazione TcPos, Head/exit e Note utente
m_nShowToolChanger = GetPrivateProfileInt(S_TOOLS, K_SHOWTOOLCHANGER, 0, sMachIniFile)
m_bShowHeadExit = (GetPrivateProfileInt(S_TOOLS, K_SHOWHEADEXIT, 0, sMachIniFile) > 0)
@@ -1247,7 +1258,7 @@ Public Class CurrentMachine
Dim Material As Material = Nothing
Dim nIndex As Integer = 1
If m_bWaterJet Then
If m_bWaterJet And m_bFromDBWaterJet Then
LoadWJMaterial(True)
Else
While (GetPrivateProfileMaterial(S_MATERIALS, K_MATERIAL & nIndex, Material, sMachIniFile))
@@ -1262,7 +1273,7 @@ Public Class CurrentMachine
' Leggo materiale correntemente attivo
Dim sCurrMatId As String = String.Empty
EgtUILib.GetPrivateProfileString(S_MATERIALS, K_CURRMATERIAL, "0", sCurrMatId, sMachIniFile)
If bWaterJet Then
If bWaterJet And bFromDBWaterJet Then
Dim sCurrMatIds As String()
sCurrMatIds = sCurrMatId.Split("."c)
If sCurrMatIds.Length > 1 Then
+1 -1
View File
@@ -64,7 +64,7 @@ Public Class MachinePageUC
PolishingsBtn.IsEnabled = False
End If
If Not m_MainWindow.m_CurrentMachine.bWaterJet Then
If Not m_MainWindow.m_CurrentMachine.bWaterJet Or Not m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
WaterJetBtn.IsEnabled = False
End If
+4 -4
View File
@@ -705,7 +705,7 @@ Public Class MachiningDbPageUC
' Lista materiali
m_MaterialsList.Clear()
For Each Material As Material In m_MainWindow.m_CurrentMachine.Materials
If m_MainWindow.m_CurrentMachine.bWaterJet Then
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName, Material.SubId))
Else
m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName))
@@ -720,7 +720,7 @@ Public Class MachiningDbPageUC
Dim SubParam() As String = Param(0).Split(".".ToCharArray)
Dim nParId As Integer = 0
Dim nSubParId As Integer = 0
If m_MainWindow.m_CurrentMachine.bWaterJet Then
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
If StringToInt(SubParam(0), nParId) AndAlso nParId = Material.nId AndAlso SubParam.Count > 1 AndAlso
StringToInt(SubParam(1), nSubParId) AndAlso nSubParId = Material.nSubId Then
@@ -894,7 +894,7 @@ Public Class MachiningDbPageUC
' Scrivo stringa materiali da lista
Dim sMaterialString As String = String.Empty
For Each Material As MachiningMaterial In m_MaterialsList
If m_MainWindow.m_CurrentMachine.bWaterJet Then
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
If Material.bIsActive Then
sMaterialString += Material.nId.ToString & "." & Material.nSubId.ToString & "," & DoubleToString(Material.dMinThickness, 0) & "," & DoubleToString(Material.dMaxThickness, 0) & ";"
End If
@@ -2285,7 +2285,7 @@ Public Class MachiningDbPageUC
Private Sub MaxThicknessTxBx_EgtClosed(sender As Object, e As EventArgs) Handles MaxThicknessTxBx.EgtClosed
Dim SelectedMaterial As MachiningMaterial = MaterialsList.SelectedItem
Dim dMaxThick As Double = 0
If m_MainWindow.m_CurrentMachine.bWaterJet Then
If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
' solo per water jet controllo lo spessore massimo ammissibile
dMaxThick = m_MainWindow.m_CurrentMachine.GetMaxThicknessCurrMaterial(SelectedMaterial.Name)
Dim dVal As Double
+17 -11
View File
@@ -263,7 +263,7 @@ Public Class ChooseMachining
If SysNotes <> String.Empty Then
Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
SysNotes = String.Empty
If m_CurrentMachine.bWaterJet Then
If m_CurrentMachine.bWaterJet And m_CurrentMachine.bFromDBWaterJet Then
For Each Material As Object In MachiningMaterials
Dim Param() As String = Material.Split(",".ToCharArray)
Dim SubParam() As String = Param(0).Split(".".ToCharArray)
@@ -589,18 +589,24 @@ Public Class ChooseMachining
' verifico che sia stato inserito veramente una lavorazione prima di comunicare una modifica
If CurrMillingCmBx.SelectedItem <> m_CurrentMachine.sCurrWaterJetting Then m_MachIsModified = True
End If
If String.IsNullOrEmpty(CurrWJettingQualityCmBx.SelectedItem) Then
CurrWJettingQualityCmBx.SelectedItem = m_CurrentMachine.sCurrWaterJettingQuality
End If
' verifico che la selezione sia andata a buon fine, altrimenti comunico l'avvenuta modifica
If String.IsNullOrEmpty(CurrWJettingQualityCmBx.SelectedItem) Then
' verifico che sia stato inserito veramente una lavorazione prima di comunicare una modifica
If CurrWJettingQualityCmBx.SelectedItem <> m_CurrentMachine.sCurrWaterJettingQuality Then m_MachIsModified = True
End If
CurrWJettingQualityCmBx.Visibility = Windows.Visibility.Visible
CurrWJettingTxBl.Visibility = Windows.Visibility.Visible
CurrWJettingCmBx.Visibility = Windows.Visibility.Visible
' se DB WaterJet abilitato avrò anche la CmBx della Quality altrimenti espando la CmBx del Waterjetting corrente su tutta la riga
If m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then
CurrWJettingCmBx.SetValue(Grid.ColumnSpanProperty, 1)
If String.IsNullOrEmpty(CurrWJettingQualityCmBx.SelectedItem) Then
CurrWJettingQualityCmBx.SelectedItem = m_CurrentMachine.sCurrWaterJettingQuality
End If
' verifico che la selezione sia andata a buon fine, altrimenti comunico l'avvenuta modifica
If String.IsNullOrEmpty(CurrWJettingQualityCmBx.SelectedItem) Then
' verifico che sia stato inserito veramente una lavorazione prima di comunicare una modifica
If CurrWJettingQualityCmBx.SelectedItem <> m_CurrentMachine.sCurrWaterJettingQuality Then m_MachIsModified = True
End If
CurrWJettingQualityCmBx.Visibility = Windows.Visibility.Visible
Else
CurrWJettingCmBx.SetValue(Grid.ColumnSpanProperty, 3)
CurrWJettingQualityCmBx.Visibility = Windows.Visibility.Collapsed
End If
End If
Me.Height = 42 * m_RowNumber
+1 -1
View File
@@ -167,7 +167,7 @@ Public Class RawPartPageUC
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
' aggiorno la lista dei materiali
Dim Index As Integer = 1
If m_CurrentMachine.bWaterJet Then
If m_CurrentMachine.bWaterJet And m_CurrentMachine.bFromDBWaterJet Then
m_CurrentMachine.LoadWJMaterial()
End If