OmagCUT :
- Aggiunta classe con parametri macchina corrente e lavorazioni e utensili correnti. - Aggiunta gestione utensili correntemente disponibili sulla macchina e conseguenti lavorazioni disponibili. - Aggiunte icone di stato macchina. - Aggiunti tagli multipli e a griglia.
This commit is contained in:
@@ -0,0 +1,269 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class CurrentMachine
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
|
||||
' Nome macchina corrente
|
||||
Private m_sMachineName As String
|
||||
|
||||
' File ini della macchina
|
||||
Private m_sMachIniFile As String
|
||||
|
||||
' Numero e tipo di utensili correntemente disponibili sulla macchina
|
||||
Private m_MountedToolConfig As MountedToolConfigs
|
||||
|
||||
' Distanza di sicurezza
|
||||
Private m_dSafeZ As Double
|
||||
|
||||
' Flag che indicano stato tipologia utensili (attivo/non attivo)
|
||||
Private m_bSaw As Boolean
|
||||
Private m_bDrill As Boolean
|
||||
Private m_bMill As Boolean
|
||||
|
||||
'Flag che indicano presenza tipologia lavorazioni (attivo/non attivo)
|
||||
Private m_bSawing As Boolean
|
||||
Private m_bDrilling As Boolean
|
||||
Private m_bMilling As Boolean
|
||||
|
||||
' Variabili che nel caso di porta utensili indicano quanti utensili possono essere ospitati per tipo
|
||||
|
||||
' Variabili che contengono il nome degli utensili disponibili per tipo
|
||||
Private m_sCurrSaw(0) As String
|
||||
Private m_sCurrDrill(0) As String
|
||||
Private m_sCurrMill(0) As String
|
||||
|
||||
' Variabili che contengono le lavorazioni correntemente attive (utilizzate per definire lavorazioni nel programma)
|
||||
Private m_sCurrSawing As String
|
||||
Private m_sCurrDrilling As String
|
||||
Private m_sCurrMilling As String
|
||||
|
||||
' Spessore sottopezzo
|
||||
Private m_dAdditionalTable As Double
|
||||
|
||||
Friend Enum MountedToolConfigs As Integer
|
||||
SAW = 0
|
||||
SAWANDAUXTOOL = 1
|
||||
SAWAND2AUXTOOLS = 2
|
||||
TOOLCHANGER = 3
|
||||
End Enum
|
||||
|
||||
#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
|
||||
|
||||
Friend ReadOnly Property sMachineName As String
|
||||
Get
|
||||
Return m_sMachineName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property sMachIniFile As String
|
||||
Get
|
||||
Return m_sMachIniFile
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property MountedToolConfig As MountedToolConfigs
|
||||
Get
|
||||
Return m_MountedToolConfig
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Property dSafeZ As Double
|
||||
Get
|
||||
If EgtMdbGetSafeZ(m_dSafeZ) Then
|
||||
Return m_dSafeZ
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
End Get
|
||||
Set(value As Double)
|
||||
If EgtMdbSetSafeZ(value) And
|
||||
EgtMdbSave() Then
|
||||
m_dSafeZ = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property bSaw As Boolean
|
||||
Get
|
||||
Return m_bSaw
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property bDrill As Boolean
|
||||
Get
|
||||
Return m_bDrill
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property bMill As Boolean
|
||||
Get
|
||||
Return m_bMill
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property bSawing As Boolean
|
||||
Get
|
||||
Return m_bSawing
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property bDrilling As Boolean
|
||||
Get
|
||||
Return m_bDrilling
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property bMilling As Boolean
|
||||
Get
|
||||
Return m_bMilling
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend Property sCurrSaw As String
|
||||
Get
|
||||
Return m_sCurrSaw(0)
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRSAW, value, m_MainWindow.GetIniFile()) Then
|
||||
m_sCurrSaw(0) = value
|
||||
m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend Property sCurrDrill As String
|
||||
Get
|
||||
Return m_sCurrDrill(0)
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRDRILL, value, m_MainWindow.GetIniFile()) Then
|
||||
m_sCurrDrill(0) = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend Property sCurrMill As String
|
||||
Get
|
||||
Return m_sCurrMill(0)
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRMILL, value, m_MainWindow.GetIniFile()) Then
|
||||
m_sCurrMill(0) = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend Property sCurrSawing As String
|
||||
Get
|
||||
Return m_sCurrSawing
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRSAWING, value, m_MainWindow.GetIniFile()) Then
|
||||
m_sCurrSawing = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend Property sCurrDrilling As String
|
||||
Get
|
||||
Return m_sCurrDrilling
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRDRILLING, value, m_MainWindow.GetIniFile()) Then
|
||||
m_sCurrDrilling = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend Property sCurrMilling As String
|
||||
Get
|
||||
Return m_sCurrMilling
|
||||
End Get
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH, K_CURRMILLING, value, m_MainWindow.GetIniFile()) Then
|
||||
m_sCurrMilling = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend Property dAdditionalTable As Double
|
||||
Get
|
||||
Return m_dAdditionalTable
|
||||
End Get
|
||||
Set(value As Double)
|
||||
If WritePrivateProfileString(S_TABLE, K_ADDITIONALTABLE, value, sMachIniFile) Then
|
||||
m_sCurrMilling = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Sub New()
|
||||
|
||||
' Leggo da file ini nome macchina corrente
|
||||
GetPrivateProfileString(S_MACH, K_CURRMACH, "", m_sMachineName, m_MainWindow.GetIniFile())
|
||||
' Impostazione path MachIni file
|
||||
m_sMachIniFile = m_MainWindow.GetMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
|
||||
' Leggo configurazione degli utensili in macchina
|
||||
m_MountedToolConfig = GetPrivateProfileInt(S_TOOLS, K_MOUNTEDTOOLCONFIG, 0, sMachIniFile)
|
||||
' Leggo flag presenza tipologie utensili
|
||||
' lama
|
||||
If GetPrivateProfileInt(S_TOOLS, K_SAWBLADE, Nothing, sMachIniFile) > 0 Then
|
||||
m_bSaw = True
|
||||
Else
|
||||
m_bSaw = False
|
||||
End If
|
||||
' foretto
|
||||
If GetPrivateProfileInt(S_TOOLS, K_DRILLBIT, Nothing, sMachIniFile) > 0 Then
|
||||
m_bDrill = True
|
||||
Else
|
||||
m_bDrill = False
|
||||
End If
|
||||
' fresa
|
||||
If GetPrivateProfileInt(S_TOOLS, K_MILL, Nothing, sMachIniFile) > 0 Then
|
||||
m_bMill = True
|
||||
Else
|
||||
m_bMill = False
|
||||
End If
|
||||
' Leggo flag presenza tipologie lavorazioni
|
||||
' lama
|
||||
If GetPrivateProfileInt(S_MACHININGS, K_SAWING, Nothing, sMachIniFile) > 0 Then
|
||||
m_bSawing = True
|
||||
Else
|
||||
m_bSawing = False
|
||||
End If
|
||||
' foretto
|
||||
If GetPrivateProfileInt(S_MACHININGS, K_DRILLING, Nothing, sMachIniFile) > 0 Then
|
||||
m_bDrilling = True
|
||||
Else
|
||||
m_bDrilling = False
|
||||
End If
|
||||
' fresa
|
||||
If GetPrivateProfileInt(S_MACHININGS, K_MILLING, Nothing, sMachIniFile) > 0 Then
|
||||
m_bMilling = True
|
||||
Else
|
||||
m_bMilling = False
|
||||
End If
|
||||
|
||||
' Leggo utensili correnti
|
||||
' lama
|
||||
GetPrivateProfileString(S_MACH, K_CURRSAW, Nothing, m_sCurrSaw(0), m_MainWindow.GetIniFile())
|
||||
' foretto
|
||||
GetPrivateProfileString(S_MACH, K_CURRDRILL, Nothing, m_sCurrDrill(0), m_MainWindow.GetIniFile())
|
||||
' fresa
|
||||
GetPrivateProfileString(S_MACH, K_CURRMILL, Nothing, m_sCurrMill(0), m_MainWindow.GetIniFile())
|
||||
|
||||
' Leggo lavorazioni correnti
|
||||
' lama
|
||||
GetPrivateProfileString(S_MACH, K_CURRSAWING, Nothing, m_sCurrSawing, m_MainWindow.GetIniFile())
|
||||
' foretto
|
||||
GetPrivateProfileString(S_MACH, K_CURRDRILLING, Nothing, m_sCurrDrilling, m_MainWindow.GetIniFile())
|
||||
' fresa
|
||||
GetPrivateProfileString(S_MACH, K_CURRMILLING, Nothing, m_sCurrMilling, m_MainWindow.GetIniFile())
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user