Compare commits

...

6 Commits

9 changed files with 95 additions and 53 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
+4
View File
@@ -755,6 +755,10 @@ Public Class SideAngleUC
vJoint.Add(False)
End If
Next
' se non riesco a generare un elenco allora esco
If vJoint.Count < 1 Then Return
If vJoint(0) And vJoint(vJoint.Count - 1) Then
bJointStart = True
End If
+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
+39 -33
View File
@@ -552,12 +552,15 @@ Public Class MachiningDbPageUC
HeadSideCmBx.SelectedIndex = ToolInt - 1
EgtMdbGetCurrMachiningParam(MCH_MP.LEADINTYPE, ToolInt)
If LeadInTypeCmBx.Items.Count > 0 Then
LeadInTypeCmBx.SelectedItem = LeadInTypeCmBx.Items(0)
LeadInTypeCmBx.SelectedItem = LeadInTypeCmBx.Items(0)
Else
LeadInTypeCmBx.SelectedItem = Nothing
End If
For Each LInType As IdNameStruct In LeadInTypeCmBx.Items
If ToolInt = LInType.Id Then LeadInTypeCmBx.SelectedItem = LInType
If ToolInt = LInType.Id Then
LeadInTypeCmBx.SelectedItem = LInType
Exit For
End If
Next
EgtMdbGetCurrMachiningParam(MCH_MP.EXTLINKTYPE, ToolInt)
ExtLinkTypeCmBx.SelectedIndex = ToolInt
@@ -705,7 +708,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 +723,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
@@ -819,13 +822,13 @@ Public Class MachiningDbPageUC
' Parmetri nascosti di svuotatura
If nMachiningType = MCH_MY.POCKETING Then
EgtMdbSetCurrMachiningParam(MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALOUT)
EgtMdbSetCurrMachiningParam( MCH_MP.LEADINTYPE, MCH_POCK_LI.HELIX)
' EgtMdbSetCurrMachiningParam( MCH_MP.LEADINTYPE, MCH_POCK_LI.HELIX)
Dim dToolDiam As Double = 100
If Not IsNothing(ToolCmBx.SelectedItem) Then
EgtTdbSetCurrTool( ToolCmBx.SelectedItem.ToString())
EgtTdbGetCurrToolParam( MCH_TP.DIAM, dToolDiam)
End If
EgtMdbSetCurrMachiningParam( MCH_MP.LITANG, 0.495 * dToolDiam)
EgtMdbSetCurrMachiningParam(MCH_MP.LITANG, 0.99 * dToolDiam)
EgtMdbSetCurrMachiningParam( MCH_MP.LIELEV, 2.0)
End If
' Parametri WaterJetting
@@ -894,7 +897,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
@@ -1138,30 +1141,26 @@ Public Class MachiningDbPageUC
' Definizione della grid TypeGrd con la giusta altezza e numero di righe
Dim RowNum As Integer = TypeGrd.RowDefinitions.Count
If RowNum > 2 Then
' elimino eventuali righe in eccesso
For Index As Integer = RowNum - 1 To 2 Step -1
TypeGrd.RowDefinitions.RemoveAt(Index)
Next
LeadInTypeTxBl.SetValue(Grid.ColumnProperty, 2)
LeadInTypeCmBx.SetValue(Grid.ColumnProperty, 3)
LeadOutTypeTxBl.SetValue(Grid.RowProperty, 1)
LeadOutTypeTxBl.SetValue(Grid.ColumnProperty, 2)
LeadOutTypeCmBx.SetValue(Grid.RowProperty, 1)
LeadOutTypeCmBx.SetValue(Grid.ColumnProperty, 3)
TypeBrd.SetValue(Grid.RowProperty, 12)
TypeBrd.SetValue(Grid.RowSpanProperty, 6)
ElseIf RowNum < 2 Then
' costruiso una riga in più da inserire
Dim Row As New RowDefinition
TypeGrd.RowDefinitions.Add(Row)
LeadInTypeTxBl.SetValue(Grid.ColumnProperty, 2)
LeadInTypeCmBx.SetValue(Grid.ColumnProperty, 3)
LeadOutTypeTxBl.SetValue(Grid.RowProperty, 1)
LeadOutTypeTxBl.SetValue(Grid.ColumnProperty, 2)
LeadOutTypeCmBx.SetValue(Grid.RowProperty, 1)
LeadOutTypeCmBx.SetValue(Grid.ColumnProperty, 3)
TypeBrd.SetValue(Grid.RowProperty, 12)
TypeBrd.SetValue(Grid.RowSpanProperty, 6)
End If
LeadInTypeTxBl.SetValue(Grid.RowProperty, 1)
LeadInTypeTxBl.SetValue(Grid.ColumnProperty, 0)
LeadInTypeCmBx.SetValue(Grid.RowProperty, 1)
LeadInTypeCmBx.SetValue(Grid.ColumnProperty, 1)
LeadOutTypeTxBl.SetValue(Grid.RowProperty, 1)
LeadOutTypeTxBl.SetValue(Grid.ColumnProperty, 2)
LeadOutTypeCmBx.SetValue(Grid.RowProperty, 1)
LeadOutTypeCmBx.SetValue(Grid.ColumnProperty, 3)
TypeBrd.SetValue(Grid.RowProperty, 12)
TypeBrd.SetValue(Grid.RowSpanProperty, 6)
LeadInTypeTxBl.Visibility = Windows.Visibility.Visible
LeadInTypeCmBx.Visibility = Windows.Visibility.Visible
ExtLinkTypeTxBl.Visibility = Windows.Visibility.Hidden
@@ -1779,7 +1778,7 @@ Public Class MachiningDbPageUC
StepTypeTxBl.Visibility = Windows.Visibility.Hidden
StepTypeCmBx.Visibility = Windows.Visibility.Hidden
SideBrd.SetValue(Grid.RowProperty, 9)
SideBrd.Visibility = Windows.Visibility.Visible
SideBrd.Visibility = Windows.Visibility.Hidden
WorkSideTxBl.Visibility = Windows.Visibility.Hidden
WorkSideCmBx.Visibility = Windows.Visibility.Hidden
HeadSideTxBl.Visibility = Windows.Visibility.Hidden
@@ -1791,15 +1790,22 @@ Public Class MachiningDbPageUC
For Index As Integer = RowNum - 1 To 2 Step -1
TypeGrd.RowDefinitions.RemoveAt(Index)
Next
LeadInTypeTxBl.SetValue(Grid.ColumnProperty, 2)
LeadInTypeCmBx.SetValue(Grid.ColumnProperty, 3)
LeadOutTypeTxBl.SetValue(Grid.RowProperty, 1)
LeadOutTypeTxBl.SetValue(Grid.ColumnProperty, 2)
LeadOutTypeCmBx.SetValue(Grid.RowProperty, 1)
LeadOutTypeCmBx.SetValue(Grid.ColumnProperty, 3)
TypeBrd.SetValue(Grid.RowProperty, 12)
TypeBrd.SetValue(Grid.RowSpanProperty, 6)
ElseIf RowNum < 2 Then
' costruiso una riga in più da inserire
Dim Row As New RowDefinition
TypeGrd.RowDefinitions.Add(Row)
End If
LeadInTypeTxBl.SetValue(Grid.RowProperty, 1)
LeadInTypeTxBl.SetValue(Grid.ColumnProperty, 0)
LeadInTypeCmBx.SetValue(Grid.RowProperty, 1)
LeadInTypeCmBx.SetValue(Grid.ColumnProperty, 1)
LeadOutTypeTxBl.SetValue(Grid.RowProperty, 1)
LeadOutTypeTxBl.SetValue(Grid.ColumnProperty, 2)
LeadOutTypeCmBx.SetValue(Grid.RowProperty, 1)
LeadOutTypeCmBx.SetValue(Grid.ColumnProperty, 3)
TypeBrd.SetValue(Grid.RowProperty, 12)
TypeBrd.SetValue(Grid.RowSpanProperty, 6)
LeadInTypeTxBl.Visibility = Windows.Visibility.Visible
LeadInTypeCmBx.Visibility = Windows.Visibility.Visible
ExtLinkTypeTxBl.Visibility = Windows.Visibility.Hidden
@@ -2285,7 +2291,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
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.1.1")>
<Assembly: AssemblyFileVersion("2.4.1.1")>
<Assembly: AssemblyVersion("2.4.1.2")>
<Assembly: AssemblyFileVersion("2.4.1.2")>
+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