diff --git a/Machine/AlarmsPageUC.xaml.vb b/Machine/AlarmsPageUC.xaml.vb index 469a73a..53e0280 100644 --- a/Machine/AlarmsPageUC.xaml.vb +++ b/Machine/AlarmsPageUC.xaml.vb @@ -1266,7 +1266,8 @@ Public Class AlarmsPageUC Select Case m_CurrentMachine.MountedToolConfig Case CurrentMachine.MountedToolConfigs.SAW Return New ToolPos(m_CurrentMachine.sCurrSaw, "T100", True) - Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW + Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, + CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Dim ChooseTool As New ChooseToolWD(m_MainWindow) If ChooseTool.ShowDialog Then Return ChooseTool.GetSelectedTool diff --git a/Machine/ChooseToolWD.xaml.vb b/Machine/ChooseToolWD.xaml.vb index 27c20cf..42d2054 100644 --- a/Machine/ChooseToolWD.xaml.vb +++ b/Machine/ChooseToolWD.xaml.vb @@ -1,4 +1,5 @@ Imports System.Collections.ObjectModel +Imports System.Security.Cryptography.X509Certificates Imports EgtUILib Public Class ChooseToolWD @@ -78,12 +79,14 @@ Public Class ChooseToolWD Case CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then - m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False)) + Dim bIsSaw As Boolean = ToolIsSaw( ToolChangerPos.sTool) + m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, bIsSaw)) End If Next For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then - m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False)) + Dim bIsSaw As Boolean = ToolIsSaw( ToolChangerPos.sTool) + m_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, bIsSaw)) End If Next Return True @@ -92,6 +95,13 @@ Public Class ChooseToolWD End Select End Function + Private Function ToolIsSaw( sToolName As String) As Boolean + If Not EgtTdbSetCurrTool( sToolName) Then Return False + Dim nType As Integer = MCH_TY.NONE + EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType) + Return ((nType And MCH_TF.SAWBLADE) <> 0) + End Function + Private Sub SetUpToolListBox_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles SetUpToolListBox.PreviewMouseUp ' Disabilito Ok OkBtn.IsEnabled = False diff --git a/Machine/CurrentMachine.vb b/Machine/CurrentMachine.vb index 43055fd..6158453 100644 --- a/Machine/CurrentMachine.vb +++ b/Machine/CurrentMachine.vb @@ -991,8 +991,6 @@ Public Class CurrentMachine Set(value As Double) If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVLEN, DoubleToString(value, 3), sMachIniFile) Then m_dFsevLength = value - ' salvo il dato nelle UserNote della lavorazione - 'MdbSetCurrMachiningUserNote("FsevLength", m_dFsevLength.ToString, sCurrSawing, false) ' salvo il dato nelle UserNote dell'utensile TdbSetCurrToolUserNote("FsevLength", m_dFsevLength.ToString, sCurrSaw) End If @@ -1011,8 +1009,6 @@ Public Class CurrentMachine Set(value As Double) If WritePrivateProfileString(S_NEST, K_MACH_CUTFSEVPERC, DoubleToString(value, 3), sMachIniFile) Then m_dFsevPerc = value - '' salvo il dato nelle UserNote della lavorazione - 'MdbSetCurrMachiningUserNote("FsevPerc", m_dFsevPerc.ToString, sCurrSawing) ' salvo il dato nelle UserNote dell'utensile TdbSetCurrToolUserNote("FsevPerc", m_dFsevPerc.ToString, sCurrSaw) End If diff --git a/MainWindow.xaml.vb b/MainWindow.xaml.vb index b8f07f4..4ae1ddf 100644 --- a/MainWindow.xaml.vb +++ b/MainWindow.xaml.vb @@ -362,8 +362,8 @@ Class MainWindow ' Verifico abilitazione nesting automatico m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey) ' Recupero opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(9423, 2710, 1, m_nKeyLevel) And - EgtGetKeyOptions(9423, 2710, 1, m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(9423, 2711, 1, m_nKeyLevel) And + EgtGetKeyOptions(9423, 2711, 1, m_nKeyOptions) ' Verifico abilitazione prodotto Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE) ' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo @@ -651,12 +651,14 @@ Class MainWindow Dim sVal As String = String.Empty If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSaw) Then - StringToDouble(sVal, m_CurrentMachine.dFsevLength) - m_CurrentMachine.SetFsevLength(m_CurrentMachine.dFsevLength) + Dim dFsevLength As Double + StringToDouble(sVal, dFsevLength) + m_CurrentMachine.SetFsevLength(dFsevLength) End If If m_CurrentMachine.GetUserNote("FsevPerc", sVal, m_CurrentMachine.sCurrSaw) Then - StringToDouble(sVal, m_CurrentMachine.dFsevPerc) - m_CurrentMachine.SetFsevPerc(m_CurrentMachine.dFsevPerc) + Dim dFsevPerc As Double + StringToDouble(sVal, dFsevPerc) + m_CurrentMachine.SetFsevPerc(dFsevPerc) End If ' Se macchina fotografica abilitata, ne inizializzo il gestore diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 9352f2f..fb0c9d3 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -62,5 +62,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/NcComm/M_Fanuc.vb b/NcComm/M_Fanuc.vb index 344409d..a984fd9 100644 --- a/NcComm/M_Fanuc.vb +++ b/NcComm/M_Fanuc.vb @@ -1361,8 +1361,6 @@ Module M_Fanuc nLen = InStrRev(szFileName, "\") - 'NomeOk = Mid(szFileName, nLen + 1) ' filename ( senza "\" - szFileProgramma = Mid(szFileName, 1, nLen) ' path ( fino a "\" inclusa ) szFileProgramma = szFileProgramma & "Temp.txt" @@ -1375,32 +1373,28 @@ Module M_Fanuc nFilew = FreeFile() FileOpen(nFilew, szFileProgramma, OpenMode.Output) - ' PrintLine(nFilew, "%" & vbLf & "<" & NomeSend & ">") ' !!!!!!!! da spostare + ' scrittura nome programma preceduta da linea vuota If NomeSend.StartsWith( "O") Then - PrintLine(nFilew, vbLf & NomeSend) ' !! + PrintLine(nFilew, vbLf & NomeSend) Else - PrintLine(nFilew, vbLf & "<" & NomeSend & ">") ' !! + PrintLine(nFilew, vbLf & "<" & NomeSend & ">") End If - 'trascrivo file tranne prima linea - While (Not EOF(nFiler)) + ' Trascrivo file tranne prima linea + While Not EOF(nFiler) ' leggo linea szLine = LineInput(nFiler) - ' leva linee con % e 0)) Then 'leva % - ' PrintLine(nFilew, szLine) - ElseIf ((InStr(szLine, "<") > 0)) Then 'leva <.... - 'PrintLine(nFilew, "<" & NomeSend & ">") - ' qq - ElseIf (Mid(szLine, 1, 1) = "O") Then ' leva le righe Oxxxxx - 'qq - 'ElseIf ((InStr(szLine, "M30") > 0)) Then ' cambia M30 in M99 - ' PrintLine(nFilew, "M99") + ' leva linee con % + If InStr(szLine, "%") > 0 Then + ' Nothing + ' leva linee con < (se non preceduto da M98) + ElseIf InStr(szLine, "<") > 0 AndAlso InStr(szLine, "M98") = 0 Then + ' Nothing + ' leva le righe Oxxxxx + ElseIf Mid(szLine, 1, 1) = "O" Then + ' Nothing Else PrintLine(nFilew, szLine) End If @@ -1413,9 +1407,7 @@ Module M_Fanuc FileClose(nFiler) FileClose(nFilew) - Return szFileProgramma - End Function Private Function Get_null_terminated_string(cha As Char()) As String