OmagCUT :

- aggiunta gestione dati speciali lame per Hoffman in DB utensili.
This commit is contained in:
Dario Sassi
2019-05-26 19:00:07 +00:00
parent 9af856f50d
commit e04bdfb2d2
4 changed files with 140 additions and 14 deletions
+1
View File
@@ -112,6 +112,7 @@
Public Const K_SHOWTOOLCHANGER As String = "ShowToolChanger"
Public Const K_SHOWHEADEXIT As String = "ShowHeadExit"
Public Const K_SHOWUSERNOTES As String = "ShowUserNotes"
Public Const K_SHOWSPECIALS As String = "ShowSpecials"
Public Const K_DRILLHOLDER As String = "DrillHolder"
Public Const K_SAWBLADEHOLDER As String = "SawBladeHolder"
Public Const K_MILLHOLDER As String = "MillHolder"
+8
View File
@@ -67,6 +67,7 @@ Public Class CurrentMachine
Private m_nShowToolChanger As Integer = 0 ' 0=no, 1=tutti utensili, 2=solo lame
Private m_bShowHeadExit As Boolean = False
Private m_nShowUserNotes As Integer = 0 ' 0=no, 1=tutti utensili, 2=solo lame
Private m_nShowSpecials As Integer = 0 ' 0=no, 1=tutti utensili, 2=solo lame
' Flag che indicano presenza tipologia lavorazioni (attivo/non attivo)
Private m_bSawing As Boolean = False
@@ -376,6 +377,12 @@ Public Class CurrentMachine
End Get
End Property
Friend ReadOnly Property ShowSpecials As Integer
Get
Return m_nShowSpecials
End Get
End Property
Friend ReadOnly Property bSawing As Boolean
Get
Return m_bSawing
@@ -907,6 +914,7 @@ Public Class CurrentMachine
m_nShowToolChanger = GetPrivateProfileInt(S_TOOLS, K_SHOWTOOLCHANGER, 0, sMachIniFile)
m_bShowHeadExit = (GetPrivateProfileInt(S_TOOLS, K_SHOWHEADEXIT, 0, sMachIniFile) > 0)
m_nShowUserNotes = GetPrivateProfileInt(S_TOOLS, K_SHOWUSERNOTES, 0, sMachIniFile)
m_nShowSpecials = GetPrivateProfileInt(S_TOOLS, K_SHOWSPECIALS, 0, sMachIniFile)
' Leggo limiti diametro lama per altre operazioni
m_dMaxSawDiamForVac = GetPrivateProfileDouble(S_TOOLS, K_MAXSAWDIAMFORVAC, 630, sMachIniFile)
m_dMaxSawDiamForProbe = GetPrivateProfileDouble(S_TOOLS, K_MAXSAWDIAMFORPROBE, 630, sMachIniFile)
+22 -2
View File
@@ -396,9 +396,29 @@
<EgtWPFLib:EgtTextBox Name="MaxMatTxBx" Grid.Column="1" Grid.Row="27" Grid.RowSpan="3"
Style="{StaticResource OmagCut_LeftCalculatorTextBoxNoBorder}" />
<TextBlock Name="UserNotesTxBl" Grid.Column="0" Grid.Row="31" Grid.RowSpan="3"
<TextBlock Name="SerNbrTxBl" Grid.Column="0" Grid.Row="29" Grid.RowSpan="3"
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="UserNotesTxBx" Grid.Column="1" Grid.Row="31"
<EgtWPFLib:EgtTextBox Name="SerNbrTxBx" Grid.Column="1" Grid.Row="29" Grid.RowSpan="3"
Style="{StaticResource OmagCut_LeftCalculatorTextBoxNoBorder}" />
<TextBlock Name="CodeTxBl" Grid.Column="2" Grid.Row="29" Grid.RowSpan="3"
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="CodeTxBx" Grid.Column="3" Grid.Row="29" Grid.RowSpan="3"
Style="{StaticResource OmagCut_LeftCalculatorTextBoxNoBorder}" Margin="0,0,15,0"/>
<TextBlock Name="SupplierTxBl" Grid.Column="0" Grid.Row="31" Grid.RowSpan="3"
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="SupplierTxBx" Grid.Column="1" Grid.Row="31" Grid.RowSpan="3"
Style="{StaticResource OmagCut_LeftCalculatorTextBoxNoBorder}" />
<TextBlock Name="EndLifeTxBl" Grid.Column="2" Grid.Row="31" Grid.RowSpan="3"
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
<CheckBox Name="EndLifeChBx" Grid.Column="3" Grid.Row="31" Grid.RowSpan="3"
Style="{StaticResource OmagCut_CheckBox_Single}" Margin="0,8,0,0"/>
<TextBlock Name="UserNotesTxBl" Grid.Column="0" Grid.Row="33" Grid.RowSpan="3"
Style="{StaticResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="UserNotesTxBx" Grid.Column="1" Grid.Row="33"
Grid.RowSpan="3" Grid.ColumnSpan="3" Margin="0,0,15,0"
Style="{StaticResource OmagCut_KeyboardTextBox}"/>
+109 -12
View File
@@ -18,9 +18,10 @@ Public Class ToolsDbPageUC
Private m_bFirst As Boolean = True
' Stringa identificativa variabile geometrica in modifica
Private m_sCurrVar As String = String.Empty
' Parametri geometrici dell'utensile corrente
' Parametri dell'utensile corrente
Private m_nToolType As Integer = MCH_TY.NONE
Private m_sToolName As String = String.Empty
Private m_sEndLife As String = String.Empty
' Array che contengono i tipi di Coolant
Dim ToolCoolant() As String
@@ -74,6 +75,10 @@ Public Class ToolsDbPageUC
MinFeedTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 19)
MaxMatTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 20)
UserNotesTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 25)
SerNbrTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 26) ' Serial Number
CodeTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 27) ' Code
SupplierTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 28) ' Supplier
EndLifeTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 29) ' End Life
' Associo TextBox e Label
Dim TempLabel1 As New Label
@@ -206,7 +211,14 @@ Public Class ToolsDbPageUC
AbsorptionBrd.SetValue(Grid.RowProperty, 23)
MaxMatTxBl.SetValue(Grid.RowProperty, 20)
MaxMatTxBx.SetValue(Grid.RowProperty, 20)
SerNbrTxBl.SetValue(Grid.RowProperty, 27)
SerNbrTxBx.SetValue(Grid.RowProperty, 27)
CodeTxBl.SetValue(Grid.RowProperty, 27)
CodeTxBx.SetValue(Grid.RowProperty, 27)
SupplierTxBl.SetValue(Grid.RowProperty, 29)
SupplierTxBx.SetValue(Grid.RowProperty, 29)
EndLifeTxBl.SetValue(Grid.RowProperty, 29)
EndLifeChBx.SetValue(Grid.RowProperty, 29)
End Sub
Private Sub NewBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewBtn.Click
@@ -260,7 +272,7 @@ Public Class ToolsDbPageUC
EgtTdbSetCurrToolParam(MCH_TP.MAXMAT, 40.0)
End If
' Gestione speciale eventuali note tipo Hofmann
ManageSpecialSawNotes()
ManageSpecialNotes()
' Salvo e aggiorno interfaccia utente
EgtTdbSaveCurrTool()
GetToolParams()
@@ -273,7 +285,7 @@ Public Class ToolsDbPageUC
EgtTdbGetToolNewName(NewName)
If EgtTdbCopyTool(SelectedCathegory.Name, NewName) Then
' Gestione speciale eventuali note tipo Hofmann
ManageSpecialSawNotes()
ManageSpecialNotes()
' Annullo disegno
EgtTdbSetCurrToolParam(MCH_TP.DRAW, "")
EgtTdbSaveCurrTool()
@@ -295,13 +307,75 @@ Public Class ToolsDbPageUC
End Sub
Private Sub ManageSpecialSawNotes()
' Note utente devono essere visualizzate
If m_CurrMachine.ShowUserNotes = 0 Then Return
' Utensile deve essere lama
Private Function GetSpecials() As Boolean
' Note speciali devono essere visualizzate con l'utensile corrente
If m_CurrMachine.ShowSpecials = 0 Then Return False
Dim nType As Integer
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
If nType <> MCH_TY.SAW_STD Then Return
If nType <> MCH_TY.SAW_STD And m_CurrMachine.ShowSpecials = 2 Then Return False
' Imposto valori di default
CodeTxBx.Text = ""
SupplierTxBx.Text = ""
SerNbrTxBx.Text = ""
EndLifeChBx.IsChecked = False
m_sEndLife = ""
UserNotesTxBx.Text = ""
' Recupero le note utente
Dim sUserNotes As String = ""
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, sUserNotes)
' Se esistono
If Not String.IsNullOrWhiteSpace(sUserNotes) Then
' Stringa con note rimanenti
Dim sToShow As String = ""
' Le divido in parti
Dim sItems() As String = sUserNotes.Split(";".ToCharArray)
For i As Integer = 0 To sItems.Count() - 1
If sItems(i).Contains("CODE=") Then
CodeTxBx.Text = sItems(i).Substring( 5)
ElseIf sItems(i).Contains("SUPPL=") Then
SupplierTxBx.Text = sItems(i).Substring( 6)
ElseIf sItems(i).Contains("S/N=") Then
SerNbrTxBx.Text = sItems(i).Substring( 4)
ElseIf sItems(i).Contains("END=") Then
EndLifeChBx.IsChecked = True
m_sEndLife = sItems(i).Substring( 4)
ElseIf Not String.IsNullOrWhiteSpace(sItems(i))
sToShow &= sItems(i) & ";"
End If
Next
UserNotesTxBx.Text = sToShow
End If
Return True
End Function
Private Function SetSpecials() As Boolean
' Note speciali devono essere visualizzate con l'utensile corrente
If m_CurrMachine.ShowSpecials = 0 Then Return False
Dim nType As Integer
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
If nType <> MCH_TY.SAW_STD And m_CurrMachine.ShowSpecials = 2 Then Return False
' Ricreo la stringa
Dim sUserNotes As String = ""
sUserNotes &= "CODE=" & CodeTxBx.Text & ";"
sUserNotes &= "SUPPL=" & SupplierTxBx.Text & ";"
sUserNotes &= "S/N=" & SerNbrTxBx.Text & ";"
If EndLifeChBx.IsChecked Then
If String.IsNullOrWhiteSpace( m_sEndLife) Then
m_sEndLife = My.Computer.Clock.LocalTime.ToString("dd.MM.yyyy HH:mm:ss")
End If
sUserNotes &= "END=" & m_sEndLife & ";"
End If
sUserNotes &= UserNotesTxBx.Text
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, sUserNotes)
Return True
End Function
Private Sub ManageSpecialNotes()
' Note utente devono essere visualizzate con l'utensile corrente
If m_CurrMachine.ShowUserNotes = 0 Then Return
Dim nType As Integer
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
If nType <> MCH_TY.SAW_STD And m_CurrMachine.ShowUserNotes = 2 Then Return
' Recupero le note utente
Dim sUserNotes As String = ""
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, sUserNotes)
@@ -323,6 +397,8 @@ Public Class ToolsDbPageUC
sItems(i) = ""
ElseIf sItems(i).Contains("PROD=") Then
sItems(i) = ""
ElseIf sItems(i).Contains("END=") Then
sItems(i) = ""
End If
Next
sUserNotes = ""
@@ -460,8 +536,10 @@ Public Class ToolsDbPageUC
HeadTxBx.Text = ToolString
EgtTdbGetCurrToolParam(MCH_TP.EXIT_, ToolInt)
ExitTxBx.Text = ToolInt.ToString()
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, ToolString)
UserNotesTxBx.Text = ToolString
if Not GetSpecials() Then
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, ToolString)
UserNotesTxBx.Text = ToolString
End If
End Sub
Friend Sub SetToolParams()
@@ -511,7 +589,9 @@ Public Class ToolsDbPageUC
EgtTdbSetCurrToolParam(MCH_TP.HEAD, HeadTxBx.Text)
Int32.TryParse(ExitTxBx.Text, nTemp)
EgtTdbSetCurrToolParam(MCH_TP.EXIT_, nTemp)
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, UserNotesTxBx.Text)
if Not SetSpecials() Then
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, UserNotesTxBx.Text)
End If
End Sub
Private Sub ViewToolParams()
@@ -538,6 +618,15 @@ Public Class ToolsDbPageUC
Dim bShowUserNotes As Boolean = ((m_nToolType = MCH_TY.SAW_STD And m_CurrMachine.ShowUserNotes <> 0) Or m_CurrMachine.ShowUserNotes = 1)
UserNotesTxBl.Visibility = If(bShowUserNotes, Windows.Visibility.Visible, Windows.Visibility.Hidden)
UserNotesTxBx.Visibility = If(bShowUserNotes, Windows.Visibility.Visible, Windows.Visibility.Hidden)
Dim bShowSpecials As Boolean = ((m_nToolType = MCH_TY.SAW_STD And m_CurrMachine.ShowSpecials <> 0) Or m_CurrMachine.ShowSpecials = 1)
SerNbrTxBl.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
SerNbrTxBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
CodeTxBl.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
CodeTxBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
SupplierTxBl.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
SupplierTxBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
EndLifeTxBl.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
EndLifeChBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden)
End Sub
Private Sub HideToolParams()
@@ -557,6 +646,14 @@ Public Class ToolsDbPageUC
AbsorptionBrd.Visibility = Windows.Visibility.Hidden
UserNotesTxBl.Visibility = Windows.Visibility.Hidden
UserNotesTxBx.Visibility = Windows.Visibility.Hidden
SerNbrTxBl.Visibility = Windows.Visibility.Hidden
SerNbrTxBx.Visibility = Windows.Visibility.Hidden
CodeTxBl.Visibility = Windows.Visibility.Hidden
CodeTxBx.Visibility = Windows.Visibility.Hidden
SupplierTxBl.Visibility = Windows.Visibility.Hidden
SupplierTxBx.Visibility = Windows.Visibility.Hidden
EndLifeTxBl.Visibility = Windows.Visibility.Hidden
EndLifeChBx.Visibility = Windows.Visibility.Hidden
End Sub
Private Sub ToolTreeView_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ToolTreeView.PreviewMouseUp