9c4a4734de
- corretti problemi di compilazione 64 bit - controllo versione chiave portato a 19 - aggiunto reset stime se macchina non le prevede.
1198 lines
41 KiB
VB.net
1198 lines
41 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports EgtUILib
|
|
|
|
Public Module CurrentMachine
|
|
|
|
' Flag modalità Office
|
|
Private m_bOffice As Boolean = False
|
|
|
|
' Nome macchina corrente
|
|
Private m_sMachineName As String = String.Empty
|
|
' Direttorio macchina corrente
|
|
Private m_sMachDir As String = String.Empty
|
|
' File ini della macchina
|
|
Private m_sMachIniFile As String = String.Empty
|
|
|
|
' Estensione dei file programma pezzo (detti anche file Iso)
|
|
Private m_sIsoFileExt As String = String.Empty
|
|
|
|
' Incremento da dare all'asse C per far coincidere la linea della lama con l'asse X
|
|
Private m_dDeltaC As Double = 0
|
|
|
|
' Ritardo tra reset e invio programma per NUM
|
|
Private m_nResetSendDelay As Integer = 1000
|
|
|
|
' Dati su linea di produzione
|
|
Private m_bProdLine As Boolean = False
|
|
Private m_sVarProg1 As String = "E80021"
|
|
Private m_nProg1 As Integer = 901
|
|
Private m_sVarProg2 As String = "E80022"
|
|
Private m_nProg2 As Integer = 902
|
|
Private m_sLineDataDir As String = ""
|
|
Private m_sVarProjCopy As String = "E80025"
|
|
|
|
' Numero e tipo di utensili correntemente disponibili sulla macchina
|
|
Private m_MountedToolConfig As MountedToolConfigs = MountedToolConfigs.SAW
|
|
|
|
' Distanza di sicurezza
|
|
Private m_dSafeZ As Double = 0
|
|
|
|
' Dati per nesting
|
|
Private m_bReducedCut As Boolean = True
|
|
Private m_bAligned As Boolean = True
|
|
|
|
' Dati per forature
|
|
Private m_dHolesOffset As Double = 0
|
|
Private m_dHolesOverlap As Double = 0
|
|
Private m_dHolesTolerance As Double = 0
|
|
Private m_bOneHoleInCorner As Boolean = False
|
|
|
|
' Dati per tagli di lama
|
|
Private m_dCutExtraLen As Double = 0
|
|
Private m_dAngleCutExtraLen As Double = 0
|
|
Private m_dExtArcMinRad As Double = 0
|
|
Private m_dIntArcMaxSideAng As Double = 0
|
|
|
|
' Dati per fresatura
|
|
Private m_bCornerCuts As Boolean = False
|
|
Private m_bInternalCuts As Boolean = False
|
|
|
|
' Abilitazione lavaggio lastra
|
|
Private m_bWashing As Boolean
|
|
|
|
' Massimo diametro lama per utilizzo ventose movimento pezzi
|
|
Private m_dMaxSawDiamForVac As Double = 630
|
|
' Massimo diametro lama per tastatura grezzo
|
|
Private m_dMaxSawDiamForProbe As Double = 630
|
|
|
|
' Possibilità di ruotare i grezzi durante separa e muovi
|
|
Private m_bRawSplMovRotate As Boolean = False
|
|
|
|
' Flag che indicano stato tipologia utensili (attivo/non attivo)
|
|
Private m_bSaw As Boolean = False
|
|
Private m_bDrill As Boolean = False
|
|
Private m_bMill As Boolean = False
|
|
|
|
' Flag per visualizzazione TcPos e Testa/uscita
|
|
Private m_bShowToolChanger As Boolean = False
|
|
Private m_bShowHeadExit As Boolean = False
|
|
|
|
' Flag che indicano presenza tipologia lavorazioni (attivo/non attivo)
|
|
Private m_bSawing As Boolean = False
|
|
Private m_bDrilling As Boolean = False
|
|
Private m_bMilling As Boolean = False
|
|
Private m_bSawRoughing As Boolean = False
|
|
Private m_bSawFinishing As Boolean = False
|
|
|
|
' Variabili che contengono il nome degli utensili disponibili per tipo
|
|
Private m_sCurrSaw As String = String.Empty
|
|
Private m_sCurrDrill As String = String.Empty
|
|
Private m_sCurrMill As String = String.Empty
|
|
Private m_sCurrDripSaw As String = String.Empty
|
|
Private m_sCurrDripDrill As String = String.Empty
|
|
|
|
' Variabili che contengono le lavorazioni correntemente attive (utilizzate per definire lavorazioni nel programma)
|
|
Private m_sCurrSawing As String = String.Empty
|
|
Private m_sCurrDrilling As String = String.Empty
|
|
Private m_sCurrMilling As String = String.Empty
|
|
Private m_sCurrSawRoughing As String = String.Empty
|
|
Private m_sCurrSawFinishing As String = String.Empty
|
|
Private m_sCurrSawSideFinishing As String = String.Empty
|
|
Private m_sCurrSawSingle As String = String.Empty
|
|
Private m_sCurrDripSawing As String = String.Empty
|
|
Private m_sCurrDripDrilling As String = String.Empty
|
|
|
|
' Spessore sottopezzo
|
|
Private m_dAdditionalTable As Double = 0
|
|
Private m_dTab2AdditionalTable As Double = 0
|
|
Private m_dTab3AdditionalTable As Double = 0
|
|
|
|
' Offset aggiuntivi per fotografia
|
|
Private m_dPhotoOffsetX As Double = 0
|
|
Private m_dPhotoOffsetY As Double = 0
|
|
Private m_dTab2PhotoOffsetX As Double = 0
|
|
Private m_dTab2PhotoOffsetY As Double = 0
|
|
|
|
' Flag home finale per tagli diretti
|
|
Private m_bDirectCutsFinalHome As Boolean = True
|
|
|
|
' Numero portautensili presenti
|
|
Private m_ToolChangerNbr As Integer = 0
|
|
|
|
' Lista portautensili
|
|
Private m_ToolChanger As New List(Of ToolChangerPos)
|
|
|
|
' Numero portautensili manuali
|
|
Private m_ManualToolChangerNbr As Integer = 0
|
|
|
|
' Lista portautensili
|
|
Private m_ManualToolChanger As New List(Of ToolChangerPos)
|
|
|
|
' Lista dei materiali
|
|
Private m_Materials As New ObservableCollection(Of Material)
|
|
|
|
' Massimo id della lista materiali nel file ini
|
|
Private m_MaxIdMat As Integer = 0
|
|
|
|
' Materiale correntemente attivo (dell'ultimo grezzo impostato)
|
|
Private m_CurrMat As Material = Nothing
|
|
|
|
' Indica se la macchina ha il tastatore della lastra
|
|
Private m_HasRawProbe As Boolean = True
|
|
|
|
' Tipi di attrezzaggio
|
|
Public Enum MountedToolConfigs As Integer
|
|
SAW = 0
|
|
SAWANDAUXTOOL = 1
|
|
MANUALTOOLCHANGER = 2
|
|
TOOLCHANGER = 3
|
|
End Enum
|
|
|
|
' Massimo numero di utensili su Tc automatico
|
|
Public MAX_TC_TOOLS As Integer = 60
|
|
|
|
' Massimo numero di utensili su Tc manuale
|
|
Public MAX_TCMAN_TOOLS As Integer = 60
|
|
|
|
#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
|
|
|
|
Public ReadOnly Property sMachineName As String
|
|
Get
|
|
Return m_sMachineName
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sMachDir As String
|
|
Get
|
|
Return m_sMachDir
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sMachIniFile As String
|
|
Get
|
|
Return m_sMachIniFile
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sIsoFileExt As String
|
|
Get
|
|
Return m_sIsoFileExt
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property dDeltaC As Double
|
|
Get
|
|
Return m_dDeltaC
|
|
End Get
|
|
End Property
|
|
|
|
Friend ReadOnly Property nResetSendDelay As Integer
|
|
Get
|
|
Return m_nResetSendDelay
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property bProdLine As Boolean
|
|
Get
|
|
Return m_bProdLine
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sVarProg1 As String
|
|
Get
|
|
Return m_sVarProg1
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property nProg1 As Integer
|
|
Get
|
|
Return m_nProg1
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sVarProg2 As String
|
|
Get
|
|
Return m_sVarProg2
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property nProg2 As Integer
|
|
Get
|
|
Return m_nProg2
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sLineDataDir As String
|
|
Get
|
|
Return m_sLineDataDir
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sVarProjCopy As String
|
|
Get
|
|
Return m_sVarProjCopy
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property MountedToolConfig As MountedToolConfigs
|
|
Get
|
|
Return m_MountedToolConfig
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property dMaxSawDiamForVac As Double
|
|
Get
|
|
Return m_dMaxSawDiamForVac
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property dMaxSawDiamForProbe As Double
|
|
Get
|
|
Return m_dMaxSawDiamForProbe
|
|
End Get
|
|
End Property
|
|
|
|
Friend ReadOnly Property bRawSplMovRotate As Boolean
|
|
Get
|
|
Return m_bRawSplMovRotate
|
|
End Get
|
|
End Property
|
|
|
|
Public Property dSafeZ As Double
|
|
Get
|
|
If EgtMdbGetGeneralParam(MCH_GP.SAFEZ, m_dSafeZ) Then
|
|
Return m_dSafeZ
|
|
Else
|
|
Return Nothing
|
|
End If
|
|
End Get
|
|
Set(value As Double)
|
|
If EgtMdbSetGeneralParam(MCH_GP.SAFEZ, m_dSafeZ) And
|
|
EgtMdbSave() Then
|
|
m_dSafeZ = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property bReducedCut As Boolean
|
|
Get
|
|
Return m_bReducedCut
|
|
End Get
|
|
Set(value As Boolean)
|
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_REDUCEDCUT, If(value, "1", "0"), sMachIniFile)
|
|
m_bReducedCut = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dHolesOffset As Double
|
|
Get
|
|
Return m_dHolesOffset
|
|
End Get
|
|
Set(value As Double)
|
|
If EgtMdbSetGeneralParam(MCH_GP.EXTRARONDRIREG, dHolesOffset) Then
|
|
EgtMdbSave()
|
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_HOLES_OFFSET, DoubleToString(value, 2), sMachIniFile)
|
|
m_dHolesOffset = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dHolesOverlap As Double
|
|
Get
|
|
Return m_dHolesOverlap
|
|
End Get
|
|
Set(value As Double)
|
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_HOLES_OVERLAP, DoubleToString(value, 2), sMachIniFile)
|
|
m_dHolesOverlap = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dHolesTolerance As Double
|
|
Get
|
|
Return m_dHolesTolerance
|
|
End Get
|
|
Set(value As Double)
|
|
If EgtMdbSetGeneralParam(MCH_GP.HOLEDIAMTOLER, value) Then
|
|
EgtMdbSave()
|
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_HOLES_DIAMTOLER, DoubleToString(value, 2), sMachIniFile)
|
|
m_dHolesTolerance = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property bOneHoleInCorner As Double
|
|
Get
|
|
Return m_bOneHoleInCorner
|
|
End Get
|
|
Set(value As Double)
|
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, If(value, "1", "0"), sMachIniFile)
|
|
m_bOneHoleInCorner = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dCutExtraLen As Double
|
|
Get
|
|
Return m_dCutExtraLen
|
|
End Get
|
|
Set(value As Double)
|
|
If EgtMdbSetGeneralParam(MCH_GP.EXTRALONCUTREG, value) Then
|
|
EgtMdbSave()
|
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_SAFE_LEN_CUT, DoubleToString(value, 2), sMachIniFile)
|
|
m_dCutExtraLen = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dAngleCutExtraLen As Double
|
|
Get
|
|
Return m_dAngleCutExtraLen
|
|
End Get
|
|
Set(value As Double)
|
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, DoubleToString(value, 2), sMachIniFile)
|
|
m_dAngleCutExtraLen = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dExtArcMinRad As Double
|
|
Get
|
|
Return m_dExtArcMinRad
|
|
End Get
|
|
Set(value As Double)
|
|
If EgtMdbSetGeneralParam(MCH_GP.EXTSAWARCMINRAD, value) Then
|
|
EgtMdbSave()
|
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_EXTARCMINRAD, DoubleToString(value, 2), sMachIniFile)
|
|
m_dExtArcMinRad = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dIntArcMaxSideAng As Double
|
|
Get
|
|
Return m_dIntArcMaxSideAng
|
|
End Get
|
|
Set(value As Double)
|
|
If EgtMdbSetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, value) Then
|
|
EgtMdbSave()
|
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_INTARCMAXSIDEANG, DoubleToString(value, 2), sMachIniFile)
|
|
m_dIntArcMaxSideAng = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property bCornerCuts As Boolean
|
|
Get
|
|
Return m_bCornerCuts
|
|
End Get
|
|
Set(value As Boolean)
|
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, If(value, "1", "0"), sMachIniFile)
|
|
m_bCornerCuts = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property bInternalCuts As Boolean
|
|
Get
|
|
Return m_bInternalCuts
|
|
End Get
|
|
Set(value As Boolean)
|
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, If(value, "1", "0"), sMachIniFile)
|
|
m_bInternalCuts = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property bAligned As Boolean
|
|
Get
|
|
Return m_bAligned
|
|
End Get
|
|
Set(value As Boolean)
|
|
If WritePrivateProfileString(S_MACH_NEST, K_MACH_NEST_ALIGNED, If(value, "1", "0"), sMachIniFile) Then
|
|
m_bAligned = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property bWashing As Boolean
|
|
Get
|
|
Return m_bWashing
|
|
End Get
|
|
Set(value As Boolean)
|
|
If WritePrivateProfileString(S_MACH_NEST, K_MACH_WASHING, If(value, "1", "0"), sMachIniFile) Then
|
|
m_bWashing = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property bSaw As Boolean
|
|
Get
|
|
Return m_bSaw
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property bDrill As Boolean
|
|
Get
|
|
Return m_bDrill
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property bMill As Boolean
|
|
Get
|
|
Return m_bMill
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property bShowToolChanger As Boolean
|
|
Get
|
|
Return m_bShowToolChanger
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property bShowHeadExit As Boolean
|
|
Get
|
|
Return m_bShowHeadExit
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property bSawing As Boolean
|
|
Get
|
|
Return m_bSawing
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property bDrilling As Boolean
|
|
Get
|
|
Return m_bDrilling
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property bMilling As Boolean
|
|
Get
|
|
Return m_bMilling
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property bSawRoughing As Boolean
|
|
Get
|
|
Return m_bSawRoughing
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property bSawFinishing As Boolean
|
|
Get
|
|
Return m_bSawFinishing
|
|
End Get
|
|
End Property
|
|
|
|
Public Property sCurrSaw As String
|
|
Get
|
|
Return m_sCurrSaw
|
|
End Get
|
|
Set(value As String)
|
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAW, value, sMachIniFile) Then
|
|
m_sCurrSaw = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sCurrDrill As String
|
|
Get
|
|
Return m_sCurrDrill
|
|
End Get
|
|
Set(value As String)
|
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRDRILL, value, sMachIniFile) Then
|
|
m_sCurrDrill = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sCurrMill As String
|
|
Get
|
|
Return m_sCurrMill
|
|
End Get
|
|
Set(value As String)
|
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRMILL, value, sMachIniFile) Then
|
|
m_sCurrMill = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sCurrDripSaw As String
|
|
Get
|
|
Return m_sCurrDripSaw
|
|
End Get
|
|
Set(value As String)
|
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRDRIPSAW, value, sMachIniFile) Then
|
|
m_sCurrDripSaw = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sCurrDripDrill As String
|
|
Get
|
|
Return m_sCurrDripDrill
|
|
End Get
|
|
Set(value As String)
|
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRDRIPDRILL, value, sMachIniFile) Then
|
|
m_sCurrDripSaw = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sCurrSawing As String
|
|
Get
|
|
Return m_sCurrSawing
|
|
End Get
|
|
Set(value As String)
|
|
If EstCalc.SetCurrSawing(value) Then
|
|
m_sCurrSawing = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sCurrDrilling As String
|
|
Get
|
|
Return m_sCurrDrilling
|
|
End Get
|
|
Set(value As String)
|
|
If EstCalc.SetCurrDrilling(value) Then
|
|
m_sCurrDrilling = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sCurrMilling As String
|
|
Get
|
|
Return m_sCurrMilling
|
|
End Get
|
|
Set(value As String)
|
|
If EstCalc.SetCurrMilling(value) Then
|
|
m_sCurrMilling = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sCurrSawRoughing As String
|
|
Get
|
|
Return m_sCurrSawRoughing
|
|
End Get
|
|
Set(value As String)
|
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWROUGHING, value, sMachIniFile) Then
|
|
m_sCurrSawRoughing = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sCurrSawFinishing As String
|
|
Get
|
|
Return m_sCurrSawFinishing
|
|
End Get
|
|
Set(value As String)
|
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWFINISHING, value, sMachIniFile) Then
|
|
m_sCurrSawFinishing = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sCurrSawSideFinishing As String
|
|
Get
|
|
Return m_sCurrSawSideFinishing
|
|
End Get
|
|
Set(value As String)
|
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWSIDEFINISHING, value, sMachIniFile) Then
|
|
m_sCurrSawSideFinishing = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Friend Property sCurrSawSingle As String
|
|
Get
|
|
Return m_sCurrSawSingle
|
|
End Get
|
|
Set(value As String)
|
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWSINGLE, value, sMachIniFile) Then
|
|
m_sCurrSawSingle = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property sCurrDripSawing As String
|
|
Get
|
|
Return m_sCurrDripSawing
|
|
End Get
|
|
Set(value As String)
|
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRDRIPSAWING, value, sMachIniFile) Then
|
|
m_sCurrDripSawing = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Friend Property sCurrDripDrilling As String
|
|
Get
|
|
Return m_sCurrDripDrilling
|
|
End Get
|
|
Set(value As String)
|
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRDRIPDRILLING, value, sMachIniFile) Then
|
|
m_sCurrDripDrilling = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dAdditionalTable As Double
|
|
Get
|
|
Select Case GetCurrentTable()
|
|
Case 3
|
|
Return m_dTab3AdditionalTable
|
|
Case 2
|
|
Return m_dTab2AdditionalTable
|
|
Case Else
|
|
Return m_dAdditionalTable
|
|
End Select
|
|
End Get
|
|
Set(value As Double)
|
|
Select Case GetCurrentTable()
|
|
Case 3
|
|
If Math.Abs(value - m_dTab3AdditionalTable) > EPS_SMALL And
|
|
WritePrivateProfileString(S_TABLE, K_TAB3_ADDITIONALTABLE, DoubleToString(value, 3), sMachIniFile) Then
|
|
' Aggiorno il valore corrente
|
|
m_dTab3AdditionalTable = value
|
|
' Aggiorno il progetto corrente
|
|
AdjustAdditionalTable()
|
|
End If
|
|
Case 2
|
|
If Math.Abs(value - m_dTab2AdditionalTable) > EPS_SMALL And
|
|
WritePrivateProfileString(S_TABLE, K_TAB2_ADDITIONALTABLE, DoubleToString(value, 3), sMachIniFile) Then
|
|
' Aggiorno il valore corrente
|
|
m_dTab2AdditionalTable = value
|
|
' Aggiorno il progetto corrente
|
|
AdjustAdditionalTable()
|
|
End If
|
|
Case Else
|
|
If Math.Abs(value - m_dAdditionalTable) > EPS_SMALL And
|
|
WritePrivateProfileString(S_TABLE, K_ADDITIONALTABLE, DoubleToString(value, 3), sMachIniFile) Then
|
|
' Aggiorno il valore corrente
|
|
m_dAdditionalTable = value
|
|
' Aggiorno il progetto corrente
|
|
AdjustAdditionalTable()
|
|
End If
|
|
End Select
|
|
End Set
|
|
End Property
|
|
|
|
Friend ReadOnly Property PhotoOffset As Vector3d
|
|
Get
|
|
Select Case GetCurrentTable()
|
|
Case 2
|
|
Return New Vector3d(m_dTab2PhotoOffsetX, m_dTab2PhotoOffsetY, 0)
|
|
Case Else
|
|
Return New Vector3d(m_dPhotoOffsetX, m_dPhotoOffsetY, 0)
|
|
End Select
|
|
End Get
|
|
End Property
|
|
|
|
Public Property bDirectCutsFinalHome As Boolean
|
|
Get
|
|
Return m_bDirectCutsFinalHome
|
|
End Get
|
|
Set(value As Boolean)
|
|
If WritePrivateProfileString(S_MACH_DIRECTCUTS, K_FINALHOME, If(value, "1", "0"), sMachIniFile) Then
|
|
m_bDirectCutsFinalHome = value
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property ToolChangerNbr As Integer
|
|
Get
|
|
Return m_ToolChangerNbr
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ToolChanger As List(Of ToolChangerPos)
|
|
Get
|
|
Return m_ToolChanger
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ToolChangerName(Index As Integer) As String
|
|
Get
|
|
If Index >= 0 And Index < m_ToolChanger.Count Then
|
|
Return m_ToolChanger(Index).sName
|
|
Else
|
|
Return String.Empty
|
|
End If
|
|
End Get
|
|
End Property
|
|
|
|
Public WriteOnly Property ToolPos(Index As Integer) As String
|
|
Set(value As String)
|
|
If value <> m_ToolChanger(Index).sTool Then
|
|
m_ToolChanger(Index).sTool = value
|
|
WritePrivateProfileString(S_TOOLCHANGER, K_POS & Index + 1, value, sMachIniFile)
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property ManualToolChangerNbr As Integer
|
|
Get
|
|
Return m_ManualToolChangerNbr
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ManualToolChanger As List(Of ToolChangerPos)
|
|
Get
|
|
Return m_ManualToolChanger
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property ManualToolChangerName(Index As Integer) As String
|
|
Get
|
|
If Index >= 0 And Index < m_ManualToolChanger.Count Then
|
|
Return m_ManualToolChanger(Index).sName
|
|
Else
|
|
Return String.Empty
|
|
End If
|
|
End Get
|
|
End Property
|
|
|
|
Public WriteOnly Property ManualToolPos(Index As Integer) As String
|
|
Set(value As String)
|
|
If value <> m_ManualToolChanger(Index).sTool Then
|
|
m_ManualToolChanger(Index).sTool = value
|
|
WritePrivateProfileString(S_TOOLCHANGER, K_MANUALPOS & Index + 1, value, sMachIniFile)
|
|
End If
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property Materials As ObservableCollection(Of Material)
|
|
Get
|
|
Return m_Materials
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub AddMaterial(value As Material)
|
|
For Each Material In Materials
|
|
If Material.nId = value.nId Then
|
|
Exit Sub
|
|
End If
|
|
Next
|
|
WritePrivateProfileMaterial(S_MATERIALS, K_MATERIAL & m_MaxIdMat + 1, value, sMachIniFile)
|
|
m_MaxIdMat += 1
|
|
m_Materials.Add(value)
|
|
End Sub
|
|
|
|
Public Sub RemoveMaterial(value As Material)
|
|
' Se è il materiale corrente lo tolgo
|
|
If Not IsNothing(CurrMat) AndAlso CurrMat.nId = value.nId Then
|
|
CurrMat = Nothing
|
|
End If
|
|
' Rimuovo il materiale dall'elenco
|
|
Dim Index As Integer
|
|
For Index = 0 To Materials.Count - 1
|
|
If Materials(Index).nId = value.nId Then
|
|
m_Materials.Remove(Materials(Index))
|
|
Exit For
|
|
End If
|
|
Next
|
|
Dim TempMat As Material = Nothing
|
|
For I = Index To m_MaxIdMat - 1
|
|
GetPrivateProfileMaterial(S_MATERIALS, K_MATERIAL & I + 2, TempMat, sMachIniFile)
|
|
WritePrivateProfileMaterial(S_MATERIALS, K_MATERIAL & I + 1, TempMat, sMachIniFile)
|
|
Next
|
|
WritePrivateProfileMaterial(S_MATERIALS, K_MATERIAL & m_MaxIdMat, Nothing, sMachIniFile)
|
|
m_MaxIdMat -= 1
|
|
' Rimuovo il materiale dall'elenco di tutte le lavorazioni
|
|
Dim MachiningName As String = String.Empty
|
|
Dim bFound As Boolean = EgtMdbGetFirstMachining(MCH_MY.SAWING, MachiningName)
|
|
While bFound
|
|
EgtMdbSetCurrMachining(MachiningName)
|
|
SearchAndRemoveMat(value.nId)
|
|
bFound = EgtMdbGetNextMachining(MCH_MY.SAWING, MachiningName)
|
|
End While
|
|
bFound = EgtMdbGetFirstMachining(MCH_MY.DRILLING, MachiningName)
|
|
While bFound
|
|
EgtMdbSetCurrMachining(MachiningName)
|
|
SearchAndRemoveMat(value.nId)
|
|
bFound = EgtMdbGetNextMachining(MCH_MY.DRILLING, MachiningName)
|
|
End While
|
|
bFound = EgtMdbGetFirstMachining(MCH_MY.MILLING, MachiningName)
|
|
While bFound
|
|
EgtMdbSetCurrMachining(MachiningName)
|
|
SearchAndRemoveMat(value.nId)
|
|
bFound = EgtMdbGetNextMachining(MCH_MY.DRILLING, MachiningName)
|
|
End While
|
|
|
|
End Sub
|
|
|
|
' Funzione che dato l'Id di un materiale lo rimuove dalla lavorazione corrente
|
|
Public Sub SearchAndRemoveMat(valueId As Integer)
|
|
Dim SysNotes As String = String.Empty
|
|
EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
|
|
If SysNotes <> String.Empty Then
|
|
Dim MachiningMaterials() = SysNotes.Split(";".ToCharArray)
|
|
SysNotes = String.Empty
|
|
For Each Material In MachiningMaterials
|
|
Dim Param() As String = Material.Split(",".ToCharArray)
|
|
If Param(0) <> valueId.ToString Then
|
|
SysNotes &= Material & ";"
|
|
End If
|
|
Next
|
|
If SysNotes(SysNotes.Length - 1) = ";" Then
|
|
SysNotes = SysNotes.Substring(0, SysNotes.Length - 1)
|
|
End If
|
|
EgtMdbSetCurrMachiningParam(MCH_MP.SYSNOTES, SysNotes)
|
|
End If
|
|
EgtMdbSaveCurrMachining()
|
|
End Sub
|
|
|
|
Public Property CurrMat As Material
|
|
Get
|
|
Return m_CurrMat
|
|
End Get
|
|
Set(value As Material)
|
|
If Not IsNothing(value) Then
|
|
Dim CurrMatId As String = value.nId.ToString
|
|
Dim sKey As String = If(m_bOffice, K_CURROFFICEMATERIAL, K_CURRMATERIAL)
|
|
WritePrivateProfileString(S_MATERIALS, sKey, CurrMatId, sMachIniFile)
|
|
End If
|
|
m_CurrMat = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Function SetCurrMatByName(sMatName As String) As Boolean
|
|
' Reset del materiale corrente
|
|
CurrMat = Nothing
|
|
' Verifico il nome
|
|
If String.IsNullOrWhiteSpace(sMatName) Then Return False
|
|
' Cerco il nome nella lista dei materiali
|
|
For Index = 0 To Materials.Count - 1
|
|
If String.Compare(Materials(Index).sName, sMatName, True) = 0 Then
|
|
CurrMat = Materials(Index)
|
|
Return True
|
|
End If
|
|
Next
|
|
Return False
|
|
End Function
|
|
|
|
Public ReadOnly Property bHasRawProbe As Boolean
|
|
Get
|
|
Return m_HasRawProbe
|
|
End Get
|
|
End Property
|
|
|
|
#End Region
|
|
|
|
Sub InitCurrentMachine(sMachinesRootDir As String, sMachineName As String,
|
|
bKeyProdLine As Boolean, bKeyMill As Boolean, Optional bOffice As Boolean = False)
|
|
' Modalità OFFICE
|
|
m_bOffice = bOffice
|
|
' Nome macchina corrente
|
|
m_sMachineName = sMachineName
|
|
' Impostazione direttorio macchina
|
|
m_sMachDir = sMachinesRootDir & "\" & sMachineName
|
|
' Impostazione path MachIni file
|
|
m_sMachIniFile = sMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
|
|
' Leggo estensione del file programma pezzo
|
|
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "xpi", m_sIsoFileExt, sMachIniFile)
|
|
If m_sIsoFileExt(0) <> "." Then m_sIsoFileExt = "." & m_sIsoFileExt
|
|
' Leggo flag incremento asse C
|
|
m_dDeltaC = GetPrivateProfileDouble(S_AXES, K_DELTA_C, 0.0, sMachIniFile)
|
|
' Leggo ritardo tra reset e send per NUM
|
|
m_nResetSendDelay = GetPrivateProfileInt(S_NCNUM, K_RESETSENDDELAY, 1000, sMachIniFile)
|
|
' Leggo se linea di produzione e parametri relativi
|
|
m_bProdLine = (GetPrivateProfileInt(S_PRODUCTIONLINE, K_ACTIVE, 0, sMachIniFile) <> 0)
|
|
If m_bProdLine And Not bKeyProdLine Then
|
|
m_bProdLine = False
|
|
EgtOutLog("Error - Production line requested but not key enabled")
|
|
End If
|
|
GetPrivateProfileString(S_PRODUCTIONLINE, K_VARPROG1, "", m_sVarProg1, sMachIniFile)
|
|
m_nProg1 = GetPrivateProfileInt(S_PRODUCTIONLINE, K_NAMEPROG1, 0, sMachIniFile)
|
|
GetPrivateProfileString(S_PRODUCTIONLINE, K_VARPROG2, "", m_sVarProg2, sMachIniFile)
|
|
m_nProg2 = GetPrivateProfileInt(S_PRODUCTIONLINE, K_NAMEPROG2, 0, sMachIniFile)
|
|
GetPrivateProfileString(S_PRODUCTIONLINE, K_LINEDATADIR, "", m_sLineDataDir, sMachIniFile)
|
|
GetPrivateProfileString(S_PRODUCTIONLINE, K_VARPROJCOPY, "", m_sVarProjCopy, sMachIniFile)
|
|
' Parametri per nesting dalla macchina
|
|
m_bReducedCut = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_REDUCEDCUT, 0, sMachIniFile) <> 0)
|
|
m_bAligned = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_ALIGNED, 0, sMachIniFile) <> 0)
|
|
' Leggo offset fori
|
|
m_dHolesOffset = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OFFSET, 0, sMachIniFile)
|
|
EgtMdbSetGeneralParam(MCH_GP.EXTRARONDRIREG, m_dHolesOffset)
|
|
' Leggo sovrapposizione fori
|
|
m_dHolesOverlap = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_OVERLAP, 0, sMachIniFile)
|
|
' Leggo tolleranza diametro fori
|
|
m_dHolesTolerance = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_HOLES_DIAMTOLER, 0, sMachIniFile)
|
|
EgtMdbSetGeneralParam(MCH_GP.HOLEDIAMTOLER, m_dHolesTolerance)
|
|
' Leggo un solo foro in corner
|
|
m_bOneHoleInCorner = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ONEHOLE_INTCORNER, 0, sMachIniFile) <> 0)
|
|
' Leggo sicurezza su tagli
|
|
m_dCutExtraLen = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_CUT, 0, sMachIniFile)
|
|
EgtMdbSetGeneralParam(MCH_GP.EXTRALONCUTREG, m_dCutExtraLen)
|
|
' Leggo sicurezza su tagli in angoli interni
|
|
m_dAngleCutExtraLen = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 0, sMachIniFile)
|
|
' Leggo raggio minimo arco esterno
|
|
m_dExtArcMinRad = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_EXTARCMINRAD, 200, sMachIniFile)
|
|
EgtMdbSetGeneralParam(MCH_GP.EXTSAWARCMINRAD, m_dExtArcMinRad)
|
|
' Leggo angolo di fianco massimo arco interno
|
|
m_dIntArcMaxSideAng = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_INTARCMAXSIDEANG, 45, sMachIniFile)
|
|
EgtMdbSetGeneralParam(MCH_GP.INTSAWARCMAXSIDEANG, m_dIntArcMaxSideAng)
|
|
' Leggo lavorazione angoli con fresa
|
|
m_bCornerCuts = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_CORNERS, 1, sMachIniFile) <> 0)
|
|
' Leggo lavorazione interni con fresa
|
|
m_bInternalCuts = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_MILLING_ON_SINKS, 0, sMachIniFile) <> 0)
|
|
' Leggo abilitazione lavaggio lastra
|
|
m_bWashing = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_WASHING, 1, sMachIniFile) <> 0)
|
|
' Leggo configurazione degli utensili in macchina
|
|
m_MountedToolConfig = DirectCast(GetPrivateProfileInt(S_TOOLS, K_MOUNTEDTOOLCONFIG, 0, sMachIniFile), MountedToolConfigs)
|
|
' Leggo flag presenza tipologie utensili
|
|
' lama
|
|
m_bSaw = (GetPrivateProfileInt(S_TOOLS, K_SAWBLADE, 0, sMachIniFile) > 0)
|
|
' foretto
|
|
m_bDrill = (GetPrivateProfileInt(S_TOOLS, K_DRILLBIT, 0, sMachIniFile) > 0)
|
|
' fresa
|
|
m_bMill = (GetPrivateProfileInt(S_TOOLS, K_MILL, 0, sMachIniFile) > 0) And bKeyMill
|
|
' Leggo abilitazione visualizzazione TcPos e Head/exit
|
|
m_bShowToolChanger = (GetPrivateProfileInt(S_TOOLS, K_SHOWTOOLCHANGER, 0, sMachIniFile) > 0)
|
|
m_bShowHeadExit = (GetPrivateProfileInt(S_TOOLS, K_SHOWHEADEXIT, 0, sMachIniFile) > 0)
|
|
' 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)
|
|
' Leggo flag abilitazione rotazione grezzi durante spezza e muovi
|
|
m_bRawSplMovRotate = (GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_RM_ROTATE, 0, sMachIniFile) <> 0)
|
|
' Leggo flag presenza tipologie lavorazioni
|
|
' lama
|
|
m_bSawing = (GetPrivateProfileInt(S_MACHININGS, K_SAWING, 0, sMachIniFile) > 0)
|
|
' foretto
|
|
m_bDrilling = (GetPrivateProfileInt(S_MACHININGS, K_DRILLING, 0, sMachIniFile) > 0)
|
|
' fresa
|
|
m_bMilling = (GetPrivateProfileInt(S_MACHININGS, K_MILLING, 0, sMachIniFile) > 0) And bKeyMill
|
|
' sgrossatura con lama
|
|
m_bSawRoughing = (GetPrivateProfileInt(S_MACHININGS, K_SAWROUGHING, 0, sMachIniFile) > 0)
|
|
' finitura con lama
|
|
m_bSawFinishing = (GetPrivateProfileInt(S_MACHININGS, K_SAWFINISHING, 0, sMachIniFile) > 0)
|
|
' Leggo utensili correnti
|
|
' lama
|
|
GetPrivateProfileString(S_MACH_MACH, K_CURRSAW, Nothing, m_sCurrSaw, sMachIniFile)
|
|
' foretto
|
|
GetPrivateProfileString(S_MACH_MACH, K_CURRDRILL, Nothing, m_sCurrDrill, sMachIniFile)
|
|
' fresa
|
|
GetPrivateProfileString(S_MACH_MACH, K_CURRMILL, Nothing, m_sCurrMill, sMachIniFile)
|
|
' lama da sotto
|
|
GetPrivateProfileString(S_MACH_MACH, K_CURRDRIPSAW, Nothing, m_sCurrDripSaw, sMachIniFile)
|
|
' Leggo lavorazioni correnti
|
|
' lama
|
|
m_sCurrSawing = EstCalc.GetCurrSawing()
|
|
' foretto
|
|
m_sCurrDrilling = EstCalc.GetCurrDrilling()
|
|
' fresa
|
|
m_sCurrMilling = EstCalc.GetCurrMilling()
|
|
' sgrossatura con lama
|
|
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWROUGHING, Nothing, m_sCurrSawRoughing, sMachIniFile)
|
|
' finitura con lama
|
|
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWFINISHING, Nothing, m_sCurrSawFinishing, sMachIniFile)
|
|
' spatolatura con lama
|
|
GetPrivateProfileString(S_MACH_MACH, K_CURRSAWSIDEFINISHING, Nothing, m_sCurrSawSideFinishing, sMachIniFile)
|
|
' lama da sotto
|
|
GetPrivateProfileString(S_MACH_MACH, K_CURRDRIPSAWING, Nothing, m_sCurrDripSawing, sMachIniFile)
|
|
|
|
' Leggo numero di portautensili
|
|
m_ToolChangerNbr = GetPrivateProfileInt(S_TOOLCHANGER, K_NUMBER, 0, sMachIniFile)
|
|
m_ToolChangerNbr = Math.Min(m_ToolChangerNbr, MAX_TC_TOOLS)
|
|
|
|
' Leggo da file ini nomi e utensili presenti in portautensili
|
|
For Index As Integer = 1 To m_ToolChangerNbr
|
|
Dim sName As String = String.Empty
|
|
Dim sTool As String = String.Empty
|
|
GetPrivateProfileString(S_TOOLCHANGER, K_NAME & Index, Nothing, sName, sMachIniFile)
|
|
GetPrivateProfileString(S_TOOLCHANGER, K_POS & Index, Nothing, sTool, sMachIniFile)
|
|
m_ToolChanger.Add(New ToolChangerPos(Index, sName, sTool))
|
|
Next
|
|
|
|
' Leggo numero portautensili manuali
|
|
m_ManualToolChangerNbr = GetPrivateProfileInt(S_TOOLCHANGER, K_MANUALNUMBER, 0, sMachIniFile)
|
|
m_ManualToolChangerNbr = Math.Min(m_ManualToolChangerNbr, MAX_TCMAN_TOOLS)
|
|
|
|
' Leggo da file ini nomi e utensili manuali presenti
|
|
For Index = 1 To m_ManualToolChangerNbr
|
|
Dim sName As String = String.Empty
|
|
Dim sTool As String = String.Empty
|
|
GetPrivateProfileString(S_TOOLCHANGER, K_MANUALNAME & Index, Nothing, sName, sMachIniFile)
|
|
GetPrivateProfileString(S_TOOLCHANGER, K_MANUALPOS & Index, Nothing, sTool, sMachIniFile)
|
|
m_ManualToolChanger.Add(New ToolChangerPos(Index, sName, sTool))
|
|
Next
|
|
|
|
' Leggo altezza sopratavola
|
|
m_dAdditionalTable = GetPrivateProfileDouble(S_TABLE, K_ADDITIONALTABLE, 0, sMachIniFile)
|
|
m_dTab2AdditionalTable = GetPrivateProfileDouble(S_TABLE, K_TAB2_ADDITIONALTABLE, 0, sMachIniFile)
|
|
m_dTab3AdditionalTable = GetPrivateProfileDouble(S_TABLE, K_TAB3_ADDITIONALTABLE, 0, sMachIniFile)
|
|
|
|
' Leggo offset aggiuntivo a fotografia
|
|
m_dPhotoOffsetX = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_OFFSETX, 0, sMachIniFile)
|
|
m_dPhotoOffsetY = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_OFFSETY, 0, sMachIniFile)
|
|
m_dTab2PhotoOffsetX = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_TAB2_OFFSETX, 0, sMachIniFile)
|
|
m_dTab2PhotoOffsetY = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_TAB2_OFFSETY, 0, sMachIniFile)
|
|
|
|
' Leggo flag per posizione home alla fine dei tagli diretti
|
|
m_bDirectCutsFinalHome = (GetPrivateProfileInt(S_MACH_DIRECTCUTS, K_FINALHOME, 1, sMachIniFile) <> 0)
|
|
|
|
' Pulisco la lista dei materiali
|
|
m_Materials.Clear()
|
|
m_MaxIdMat = 0
|
|
' Leggo la lista dei materiali
|
|
Dim Material As Material = Nothing
|
|
Dim nIndex As Integer = 1
|
|
While (GetPrivateProfileMaterial(S_MATERIALS, K_MATERIAL & nIndex, Material, sMachIniFile))
|
|
m_Materials.Add(Material)
|
|
nIndex += 1
|
|
End While
|
|
' Salvo massimo indice a cui sono arrivato per usarlo quando devo aggiungere nuovi elementi alla lista
|
|
m_MaxIdMat = nIndex - 1
|
|
|
|
' Leggo materiale correntemente attivo
|
|
Dim sKey As String = If(m_bOffice, K_CURROFFICEMATERIAL, K_CURRMATERIAL)
|
|
Dim CurrMatId As Integer = GetPrivateProfileInt(S_MATERIALS, sKey, 0, sMachIniFile)
|
|
For Each Material In Materials
|
|
If Material.nId = CurrMatId Then
|
|
m_CurrMat = Material
|
|
Exit For
|
|
End If
|
|
Next
|
|
' Leggo se la macchina ha il tastatore dello spessore lastra
|
|
m_HasRawProbe = (GetPrivateProfileInt(S_MACH_PROBING, K_ENABLERAWPROBE, 1, sMachIniFile) <> 0)
|
|
End Sub
|
|
|
|
Public Function IsVacuumMovePossible() As Boolean
|
|
' Recupero lama della lavorazione di lama corrente
|
|
EgtMdbSetCurrMachining(sCurrSawing)
|
|
Dim sTuuid As String = String.Empty
|
|
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
|
Dim sSaw As String = String.Empty
|
|
EgtTdbGetToolFromUUID(sTuuid, sSaw)
|
|
' Recupero diametro lama corrente
|
|
EgtTdbSetCurrTool(sSaw)
|
|
Dim dToolDiam As Double = 0
|
|
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam)
|
|
' Confronto con massimo ammesso
|
|
Return (dToolDiam <= dMaxSawDiamForVac)
|
|
End Function
|
|
|
|
Public Function IsRawProbingPossible() As Boolean
|
|
' Recupero lama della lavorazione di lama corrente
|
|
EgtMdbSetCurrMachining(sCurrSawing)
|
|
Dim sTuuid As String = String.Empty
|
|
EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sTuuid)
|
|
Dim sSaw As String = String.Empty
|
|
EgtTdbGetToolFromUUID(sTuuid, sSaw)
|
|
' Recupero diametro lama corrente
|
|
EgtTdbSetCurrTool(sSaw)
|
|
Dim dToolDiam As Double = 0
|
|
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam)
|
|
' Confronto con massimo ammesso
|
|
Return (dToolDiam <= dMaxSawDiamForProbe)
|
|
End Function
|
|
|
|
Public Function GetPrivateProfileMaterial(
|
|
ByVal lpAppName As String,
|
|
ByVal lpKeyName As String,
|
|
ByRef Material As Material,
|
|
ByVal lpFileName As String) As Boolean
|
|
|
|
Dim sVal As String = String.Empty
|
|
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
|
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
|
If sItems.Count() = 2 Then
|
|
Dim nId As Integer = 0
|
|
StringToInt(sItems(0), nId)
|
|
Material = New Material(nId, sItems(1))
|
|
Return True
|
|
End If
|
|
Return False
|
|
|
|
End Function
|
|
|
|
Public Function WritePrivateProfileMaterial(
|
|
ByVal lpAppName As String,
|
|
ByVal lpKeyName As String,
|
|
ByVal Material As Material,
|
|
ByVal lpFileName As String) As Boolean
|
|
|
|
Dim MatStr As String = Nothing
|
|
If Not IsNothing(Material) Then
|
|
MatStr = Material.nId.ToString & "," & Material.sName
|
|
End If
|
|
If WritePrivateProfileString(lpAppName, lpKeyName, MatStr, sMachIniFile) Then
|
|
Return True
|
|
End If
|
|
Return False
|
|
End Function
|
|
|
|
End Module
|
|
|
|
Public Class ToolChangerPos
|
|
|
|
Private m_nPosition As Integer
|
|
Private m_sName As String = String.Empty
|
|
Private m_sTool As String = String.Empty
|
|
|
|
Public ReadOnly Property nPosition As Integer
|
|
Get
|
|
Return m_nPosition
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property sName As String
|
|
Get
|
|
Return m_sName
|
|
End Get
|
|
End Property
|
|
|
|
Public Property sTool As String
|
|
Get
|
|
Return m_sTool
|
|
End Get
|
|
Set(value As String)
|
|
m_sTool = value
|
|
End Set
|
|
End Property
|
|
|
|
Sub New(sPosition As Integer, sName As String, sTool As String)
|
|
m_nPosition = sPosition
|
|
m_sName = sName
|
|
m_sTool = sTool
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
Public Class Material
|
|
|
|
Private m_nId As Integer
|
|
Private m_sName As String
|
|
|
|
Public ReadOnly Property nId As Integer
|
|
Get
|
|
Return m_nId
|
|
End Get
|
|
End Property
|
|
|
|
Public Property sName As String
|
|
Get
|
|
Return m_sName
|
|
End Get
|
|
Set(value As String)
|
|
m_sName = value
|
|
End Set
|
|
End Property
|
|
|
|
Sub New(sName As String, MaterialList As ObservableCollection(Of Material))
|
|
Dim nMaxId As Integer = 0
|
|
For Each Material In MaterialList
|
|
If Material.nId > nMaxId Then
|
|
nMaxId = Material.nId
|
|
End If
|
|
Next
|
|
m_nId = nMaxId + 1
|
|
m_sName = sName
|
|
End Sub
|
|
|
|
Sub New(nId As Integer, sName As String)
|
|
m_nId = nId
|
|
m_sName = sName
|
|
End Sub
|
|
|
|
End Class
|