From b95dd8f41d213b54639fdd17e4e10e3f043a2bc3 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Thu, 13 Jul 2023 10:42:42 +0200 Subject: [PATCH] Gestione estensione file inviato al CN --- Constants/ConstMachIni.vb | 1 + Machine/CurrentMachine.vb | 10 ++++++++++ NcComm/CNCommunication.vb | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Constants/ConstMachIni.vb b/Constants/ConstMachIni.vb index 6784fe3..8ecdfe1 100644 --- a/Constants/ConstMachIni.vb +++ b/Constants/ConstMachIni.vb @@ -5,6 +5,7 @@ Public Const S_PARTPROGRAM As String = "PartProgram" Public Const K_EXTENSION As String = "Extension" + Public Const K_EXTFILECN As String = "ExtFileCN" Public Const S_AXES As String = "Axes" Public Const K_AXESNUM As String = "AxesNum" diff --git a/Machine/CurrentMachine.vb b/Machine/CurrentMachine.vb index c2949b5..56b0d42 100644 --- a/Machine/CurrentMachine.vb +++ b/Machine/CurrentMachine.vb @@ -54,6 +54,8 @@ Public Class CurrentMachine Private m_sProdLiSawDiameter2Var As String = "" Private m_sClickState As String = "E80028" Private m_sClickDir As String = "" + ' Gestione speciale per canali CN + Private m_sExtFileCN As String = ".0" ' Numero e tipo di utensili correntemente disponibili sulla macchina Private m_MountedToolConfig As MountedToolConfigs = MountedToolConfigs.SAW @@ -339,6 +341,12 @@ Public Class CurrentMachine End Get End Property + Friend ReadOnly Property sExtFileCN As String + Get + Return m_sExtFileCN + End Get + End Property + Friend Function sProdLiProbingStateVar(nI As Integer) As String If nI = 1 Then Return m_sProdLiProbingStateVar If nI = 2 Then Return m_sProdLiProbingState2Var @@ -1135,6 +1143,8 @@ Public Class CurrentMachine m_sMachIniFile = m_MainWindow.GetMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini" ' Leggo estensione del file programma pezzo GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "xpi", m_sIsoFileExt, sMachIniFile) + ' per gestione canali separati (macchina NUM con più di 5 Assi) ver. 2.5g1 + GetPrivateProfileString(S_PARTPROGRAM, K_EXTFILECN, ".0", m_sExtFileCN, 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) diff --git a/NcComm/CNCommunication.vb b/NcComm/CNCommunication.vb index 52bd0dd..ee9cec4 100644 --- a/NcComm/CNCommunication.vb +++ b/NcComm/CNCommunication.vb @@ -1165,7 +1165,8 @@ Public Class CNCommunication bOk = (m_nNCType > 0) Dim sNumProg As String = String.Empty If m_nNCType = 1 Or m_nNCType = 2 Then - sNumProg = "%" & nNumProg.ToString() & ".0" + Dim sExtFileCN As String = m_MainWindow.m_CurrentMachine.sExtFileCN + sNumProg = "%" & nNumProg.ToString() & sExtFileCN Else sNumProg = nNumProg.ToString() End If