From a8dc3d2642bee2d83e343fbc24aaaeedab025d77 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 5 Aug 2016 18:48:41 +0000 Subject: [PATCH] =?UTF-8?q?OmagCUT=201.6t1=20:=20-=20aggiunto=20log=20dei?= =?UTF-8?q?=20comandi=20diretti=203assi=20e=205assi=20-=20aggiunta=20rimoz?= =?UTF-8?q?ione=20manuale=20sfridi=20anche=20con=20movimento=20pezzi=20con?= =?UTF-8?q?=20ventose=20-=20aggiunta=20possibilit=C3=A0=20di=20eliminare?= =?UTF-8?q?=20home=20finale=20nei=20tagli=20diretti=20-=20con=20NUOVO=20pr?= =?UTF-8?q?ogetto=20e=20pezzi=20parcheggiati=20si=20chiede=20se=20conserva?= =?UTF-8?q?rli=20-=20spessore=20pezzo=20con=203=20decimali=20(per=20inches?= =?UTF-8?q?)=20-=20migliorata=20visualizzazione=20coordinate=20assi=20in?= =?UTF-8?q?=20simulazione=20-=20in=20lista=20lavorazioni=20aggiunto=20flag?= =?UTF-8?q?=20sui=20tagli=20inclinati=20-=20corretta=20visualizzazione=20f?= =?UTF-8?q?amiglie=20utensili=20da=20Ini.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AlarmsPageUC.xaml | 12 ++++ AlarmsPageUC.xaml.vb | 8 +++ CamAuto.vb | 5 ++ ConstMachIni.vb | 3 + CurrentMachine.vb | 52 +++++++++++++++--- CurrentProjectPageUC.xaml.vb | 35 ++++++++++-- FlatteningCut.xaml.vb | 8 +++ GridCut.xaml.vb | 8 +++ MachineButtonsUC.xaml.vb | 2 + MachiningDbPageUC.xaml.vb | 18 +++--- ManualAxesMoveUC.xaml.vb | 3 + MoveRawPartPage.xaml.vb | 104 +++++++++++++++++++++++++++-------- MultipleCut.xaml.vb | 8 +++ My Project/AssemblyInfo.vb | 6 +- My Project/app.manifest | 58 +++++++++++++++++++ OmagCUT.vbproj | 10 ++++ ProjectMgrUC.xaml.vb | 30 +++++++--- RawPartPageUC.xaml.vb | 8 +-- Resources/OmagCUT.ico | Bin 0 -> 9158 bytes SawTestUC.xaml.vb | 4 ++ SimulationPageUC.xaml | 14 ++--- SingleCutUC.xaml.vb | 4 ++ SplitAuto.vb | 89 ++++++++++++++++-------------- SplitPageUC.xaml.vb | 13 ++++- ToolsDbPageUC.xaml.vb | 49 ++++++++--------- Utility.vb | 2 + VacuumCups.vb | 16 ++++-- WorkInProgressPageUC.xaml.vb | 6 +- 28 files changed, 432 insertions(+), 143 deletions(-) create mode 100644 My Project/app.manifest create mode 100644 Resources/OmagCUT.ico diff --git a/AlarmsPageUC.xaml b/AlarmsPageUC.xaml index 85561c3..128112e 100644 --- a/AlarmsPageUC.xaml +++ b/AlarmsPageUC.xaml @@ -234,6 +234,18 @@ + + + + + + + + + + diff --git a/AlarmsPageUC.xaml.vb b/AlarmsPageUC.xaml.vb index 7d03370..9766a17 100644 --- a/AlarmsPageUC.xaml.vb +++ b/AlarmsPageUC.xaml.vb @@ -57,6 +57,8 @@ Public Class AlarmsPageUC ExtArcMinRadTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 18) MachineParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 19) SawGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 25) + DirectCutsParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 27) ' Tagli diretti + FinalHomeTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 28) ' Home finale End Sub Private Sub AlarmsPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded @@ -179,6 +181,8 @@ Public Class AlarmsPageUC ExtArcMinRadTxBx.Text = LenToString(dVal, 2) ' Salvo DB lavorazioni con aggiornamenti parametri generali EgtMdbSave() + ' Flag per movimento in home alla fine dei tagli diretti + FinalHomeChBx.IsChecked = m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome End Sub Private Sub AuxiliaryToolCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles AuxiliaryToolCmBx.SelectionChanged @@ -398,6 +402,10 @@ Public Class AlarmsPageUC End If End Sub + Private Sub FinalHomeChBx_Click(sender As Object, e As RoutedEventArgs) Handles FinalHomeChBx.Click + m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome = FinalHomeChBx.IsChecked() + End Sub + Friend Sub NcError() If m_CN.sz_NC_error_messages.Count > 0 Then 'NCErrorMessages.Text = m_CN.sz_NC_error_messages(0) diff --git a/CamAuto.vb b/CamAuto.vb index 97799b8..23ac4ea 100644 --- a/CamAuto.vb +++ b/CamAuto.vb @@ -106,6 +106,11 @@ Public Module CamAuto Return True End Function + Friend Function RemoveFinalHome() As Boolean + Dim nId As Integer = EgtGetLastActiveOperation() + Return EgtRemoveOperationHome(nId) + End Function + Friend Function VerifySetup(ByRef sMissingTools As String) As Boolean Dim bOk As Boolean = True Dim bIsMultiCut = (EgtGetHeadId("H101") <> GDB_ID.NULL) diff --git a/ConstMachIni.vb b/ConstMachIni.vb index ca827ca..7263a1c 100644 --- a/ConstMachIni.vb +++ b/ConstMachIni.vb @@ -89,6 +89,9 @@ Public Const K_MANUALPOS As String = "ManualPos" Public Const K_MANUALNAME As String = "ManualName" + Public Const S_MACH_DIRECTCUTS As String = "DirectCuts" + Public Const K_FINALHOME As String = "FinalHome" + Public Const S_MACHBUTTONS As String = "MachButtons" Public Const K_BUTTON As String = "Button" diff --git a/CurrentMachine.vb b/CurrentMachine.vb index 9890c37..d6dd16a 100644 --- a/CurrentMachine.vb +++ b/CurrentMachine.vb @@ -34,16 +34,20 @@ Public Class CurrentMachine Private m_dSafeZ As Double = 0 ' Massimo diametro lama per utilizzo ventose movimento pezzi - Private m_dMaxSawDiamForVac As Double = 650 + Private m_dMaxSawDiamForVac As Double = 630 ' Massimo diametro lama per tastatura grezzo - Private m_dMaxSawDiamForProbe As Double = 650 + Private m_dMaxSawDiamForProbe As Double = 630 ' 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 @@ -51,8 +55,6 @@ Public Class CurrentMachine Private m_bSawRoughing As Boolean = False Private m_bSawFinishing As Boolean = False - ' 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 @@ -69,6 +71,9 @@ Public Class CurrentMachine ' Spessore sottopezzo Private m_dAdditionalTable As Double = 0 + ' Flag home finale per tagli diretti + Private m_bDirectCutsFinalHome As Boolean = True + ' Numero portautensili presenti Private m_ToolChangerNum As Double = 0 @@ -217,6 +222,18 @@ Public Class CurrentMachine End Get End Property + Friend ReadOnly Property bShowToolChanger As Boolean + Get + Return m_bShowToolChanger + End Get + End Property + + Friend ReadOnly Property bShowHeadExit As Boolean + Get + Return m_bShowHeadExit + End Get + End Property + Friend ReadOnly Property bSawing As Boolean Get Return m_bSawing @@ -358,6 +375,17 @@ Public Class CurrentMachine End Set End Property + Friend 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 + Friend ReadOnly Property dToolChangerNum As Double Get Return m_ToolChangerNum @@ -544,17 +572,22 @@ Public Class CurrentMachine ' foretto m_bDrill = (GetPrivateProfileInt(S_TOOLS, K_DRILLBIT, 0, sMachIniFile) > 0) ' fresa - m_bMill = (GetPrivateProfileInt(S_TOOLS, K_MILL, 0, sMachIniFile) > 0) + m_bMill = (GetPrivateProfileInt(S_TOOLS, K_MILL, 0, sMachIniFile) > 0) And + m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.ENABLE_MILL) + ' 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, 650, sMachIniFile) - m_dMaxSawDiamForProbe = GetPrivateProfileDouble(S_TOOLS, K_MAXSAWDIAMFORPROBE, 650, sMachIniFile) + m_dMaxSawDiamForVac = GetPrivateProfileDouble(S_TOOLS, K_MAXSAWDIAMFORVAC, 630, sMachIniFile) + m_dMaxSawDiamForProbe = GetPrivateProfileDouble(S_TOOLS, K_MAXSAWDIAMFORPROBE, 630, sMachIniFile) ' 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) + m_bMilling = (GetPrivateProfileInt(S_MACHININGS, K_MILLING, 0, sMachIniFile) > 0) And + m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.ENABLE_MILL) ' sgrossatura con lama m_bSawRoughing = (GetPrivateProfileInt(S_MACHININGS, K_SAWROUGHING, 0, sMachIniFile) > 0) ' finitura con lama @@ -608,6 +641,9 @@ Public Class CurrentMachine ' Leggo altezza sopratavola m_dAdditionalTable = GetPrivateProfileDouble(S_TABLE, K_ADDITIONALTABLE, 0, sMachIniFile) + ' Leggo flag per posizione home alla fine dei tagli diretti + m_bDirectCutsFinalHome = (GetPrivateProfileInt(S_MACH_DIRECTCUTS, K_FINALHOME, 1, sMachIniFile) <> 0) + ' Creo materiale di default e lo aggiungo alla lista ' m_Materials.Add(New Material(0, "Generico")) ' Leggo la lista dei materiali diff --git a/CurrentProjectPageUC.xaml.vb b/CurrentProjectPageUC.xaml.vb index 0900a47..a1b5287 100644 --- a/CurrentProjectPageUC.xaml.vb +++ b/CurrentProjectPageUC.xaml.vb @@ -181,7 +181,21 @@ Public Class CurrentProjectPageUC End If End Sub - Friend Function NewProject(Optional sTabName As String = MAIN_TAB) As Boolean + Friend Function NewProject(Optional sTabName As String = MAIN_TAB, + Optional bRetainParkedParts As Boolean = False) As Boolean + ' Se richiesto, conservo eventuali pezzi parcheggiati del progetto corrente + Dim sTmpFiles As New ArrayList() + Dim nId As Integer = If(bRetainParkedParts, EgtGetFirstPart(), GDB_ID.NULL) + While nId <> GDB_ID.NULL + ' Esporto il pezzo in un file temporaneo + Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\FlatPart" & nId & ".Nge" + sTmpFiles.Add(sTmpFile) + If Not EgtSaveObjToFile(nId, sTmpFile, NGE.BIN) Then + Return False + End If + ' Passo al pezzo successivo + nId = EgtGetNextPart(nId) + End While ' Imposto nuovo indice di progetto SetNextProjectIndex() ' Imposto il nuovo progetto @@ -204,7 +218,20 @@ Public Class CurrentProjectPageUC m_nRawId = GDB_ID.NULL m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart() m_dRawHeight = 0 - HeightTxBx.Text = LenToString(m_dRawHeight, 2) + UpdateHeightTxBx() + ' Recupero i pezzi parcheggiati precedentemente salvati + For Each sTmpfile As String In sTmpFiles + If My.Computer.FileSystem.FileExists(sTmpfile) Then + ' Inserisco il pezzo + EgtInsertFile(sTmpfile) + ' Ne recupero l'Id + Dim nId2 As Integer = EgtGetLastPart() + ' Inserisco in parcheggio + m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId2, True) + ' Cancello il file + My.Computer.FileSystem.DeleteFile(sTmpfile) + End If + Next ' Dichiaro progetto non modificato EgtResetModified() Return True @@ -251,7 +278,7 @@ Public Class CurrentProjectPageUC m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart() ' aggiorno spessore grezzo m_dRawHeight = GetRawHeight() - HeightTxBx.Text = LenToString(m_dRawHeight, 2) + UpdateHeightTxBx() ' Dichiaro progetto non modificato EgtResetModified() Return True @@ -530,7 +557,7 @@ Public Class CurrentProjectPageUC End Function Friend Sub UpdateHeightTxBx() - HeightTxBx.Text = LenToString(m_dRawHeight, 2) + HeightTxBx.Text = LenToString(m_dRawHeight, 3) End Sub Friend Sub UpdateMachiningTxBx() diff --git a/FlatteningCut.xaml.vb b/FlatteningCut.xaml.vb index e6d105e..37320f9 100644 --- a/FlatteningCut.xaml.vb +++ b/FlatteningCut.xaml.vb @@ -580,6 +580,10 @@ Public Class FlatteningCut EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId) ' Inserisco la lavorazione m_bCutOk = AddMachinings(nPartId, True, True) + ' Eventuale eliminazione Home finale + If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then + RemoveFinalHome() + End If UpdateOkBtn() Return m_bCutOk End Function @@ -627,6 +631,10 @@ Public Class FlatteningCut EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId) ' Inserisco la lavorazione m_bCutOk = AddMachinings(nPartId, True, True) + ' Eventuale eliminazione Home finale + If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then + RemoveFinalHome() + End If UpdateOkBtn() Return m_bCutOk End Function diff --git a/GridCut.xaml.vb b/GridCut.xaml.vb index 2f45862..8ea248c 100644 --- a/GridCut.xaml.vb +++ b/GridCut.xaml.vb @@ -529,6 +529,10 @@ Public Class GridCut EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId) ' Inserisco la lavorazione m_bCutOk = AddMachinings(nPartId, True, True) + ' Eventuale eliminazione Home finale + If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then + RemoveFinalHome() + End If UpdateOkBtn() Return m_bCutOk End Function @@ -572,6 +576,10 @@ Public Class GridCut EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId) ' Inserisco la lavorazione m_bCutOk = AddMachinings(nPartId, True, True) + ' Eventuale eliminazione Home finale + If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then + RemoveFinalHome() + End If UpdateOkBtn() Return m_bCutOk End Function diff --git a/MachineButtonsUC.xaml.vb b/MachineButtonsUC.xaml.vb index d8222c7..3ca0ac3 100644 --- a/MachineButtonsUC.xaml.vb +++ b/MachineButtonsUC.xaml.vb @@ -185,6 +185,8 @@ Public Class MachineButtonsUC ' Reset lua EgtLuaResetGlobVar("CmdString") EgtLuaResetGlobVar("CMD") + ' Log del comando + EgtOutLog("CmdString=" & CmdString & " b2Start=" & b2Start.ToString()) Dim nResult As Short Select Case m_MainWindow.m_CNCommunication.m_nNCType diff --git a/MachiningDbPageUC.xaml.vb b/MachiningDbPageUC.xaml.vb index 86be40c..84e475f 100644 --- a/MachiningDbPageUC.xaml.vb +++ b/MachiningDbPageUC.xaml.vb @@ -283,17 +283,17 @@ Public Class MachiningDbPageUC End Sub Private Sub InitializeMachiningFamily(bEnabled As Boolean, nFType As Integer, sFName As String) - If bEnabled Then - Dim MachiningCathegory As New CathegoryItem(sFName, nFType) - Dim MachiningName As String = String.Empty - If EgtMdbGetFirstMachining(nFType, MachiningName) Then + If Not bEnabled Then Return + ' Inserisco categoria ed eventuali elementi + Dim MachiningCathegory As New CathegoryItem(sFName, nFType) + Dim MachiningName As String = String.Empty + If EgtMdbGetFirstMachining(nFType, MachiningName) Then + MachiningCathegory.Items.Add(New CustomItem(MachiningName, nFType)) + While EgtMdbGetNextMachining(nFType, MachiningName) MachiningCathegory.Items.Add(New CustomItem(MachiningName, nFType)) - While EgtMdbGetNextMachining(nFType, MachiningName) - MachiningCathegory.Items.Add(New CustomItem(MachiningName, nFType)) - End While - End If - MachiningsList.Add(MachiningCathegory) + End While End If + MachiningsList.Add(MachiningCathegory) End Sub Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click diff --git a/ManualAxesMoveUC.xaml.vb b/ManualAxesMoveUC.xaml.vb index 4012917..d0c607a 100644 --- a/ManualAxesMoveUC.xaml.vb +++ b/ManualAxesMoveUC.xaml.vb @@ -117,8 +117,11 @@ Public Class ManualAxesMoveUC ' Calcolo stringa di comando risultante EgtLuaExecLine("CmdString()") EgtLuaGetGlobStringVar("CMD.CMDSTRING", CmdString) + ' Reset lua EgtLuaResetGlobVar("CmdString") EgtLuaResetGlobVar("CMD") + ' Log del comando + EgtOutLog("CmdString=" & CmdString) ' Eseguo in MDI m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI System.Threading.Thread.Sleep(150) diff --git a/MoveRawPartPage.xaml.vb b/MoveRawPartPage.xaml.vb index 72c4cb9..b33c5a0 100644 --- a/MoveRawPartPage.xaml.vb +++ b/MoveRawPartPage.xaml.vb @@ -18,10 +18,9 @@ Public Class MoveRawPartPage Private m_dOrigDist As Double = 0 ' distanza iniziale (spessore taglio) Private m_dCurrDist As Double = 0 ' distanza corrente ' Gestione movimento con ventose - 'Private m_nTempId As Integer = GDB_ID.NULL - 'Private m_nVacId As Integer = GDB_ID.NULL - 'Private m_nRefId As Integer = GDB_ID.NULL - Private m_RawMoveDataList As New List(Of RawMoveData) + Private m_bRemovedRaw As Boolean = False ' flag per rimozione manuale pezzi + Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento + Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized PrevBtn.IsEnabled = False @@ -39,7 +38,7 @@ Public Class MoveRawPartPage ' Se movimento con ventosa, verifico se lama troppo grande If Not m_bByHand And Not m_MainWindow.m_CurrentMachine.IsVacuumMovePossible() Then m_bByHand = True - m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa + m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa End If ' Deseleziono tutto EgtDeselectAll() @@ -93,6 +92,8 @@ Public Class MoveRawPartPage End If ' Altrimenti movimento con ventose Else + m_bRemovedRaw = False + m_bRawWithCups = False ' Pulisco lista info per grezzi m_RawMoveDataList.Clear() m_RawMoveDataList.Capacity() = 10 @@ -101,13 +102,12 @@ Public Class MoveRawPartPage If m_bByHand Then LeftBtn.Visibility = Windows.Visibility.Hidden RightBtn.Visibility = Windows.Visibility.Hidden - RemovePartBtn.Visibility = Windows.Visibility.Visible ' Altrimeni per movimento con ventose Else LeftBtn.Visibility = Windows.Visibility.Visible RightBtn.Visibility = Windows.Visibility.Visible - RemovePartBtn.Visibility = Windows.Visibility.Hidden End If + RemovePartBtn.Visibility = Windows.Visibility.Visible End Sub @@ -154,6 +154,14 @@ Public Class MoveRawPartPage EgtSetStatus(GetVacuumId(), GDB_ST.ON_) ' Aggiorno i dati AddRawMoveData(rmData) + m_bRawWithCups = True + ' Reset eventuale messaggio + m_CurrProjPage.ClearMessage() + Else + ' Aggiorno i dati + m_bRawWithCups = False + ' Messaggio di avvertimento + m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere End If End If End If @@ -184,10 +192,14 @@ Public Class MoveRawPartPage End If ' Altrimenti movimento Y + Else - Dim vtMove As New Vector3d(0, m_dStep, 0) - If EgtMoveRawPart(nRawId, vtMove) Then - EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB) - AddRawMoveData(nRawId, vtMove) + If m_bRawWithCups Then + Dim vtMove As New Vector3d(0, m_dStep, 0) + If EgtMoveRawPart(nRawId, vtMove) Then + EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB) + AddRawMoveData(nRawId, vtMove) + End If + Else + m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere End If End If nRawId = EgtGetNextSelectedObj() @@ -217,10 +229,14 @@ Public Class MoveRawPartPage End If ' Altrimenti movimento Y - Else - Dim vtMove As New Vector3d(0, -m_dStep, 0) - If EgtMoveRawPart(nRawId, vtMove) Then - EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB) - AddRawMoveData(nRawId, vtMove) + If m_bRawWithCups Then + Dim vtMove As New Vector3d(0, -m_dStep, 0) + If EgtMoveRawPart(nRawId, vtMove) Then + EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB) + AddRawMoveData(nRawId, vtMove) + End If + Else + m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere End If End If nRawId = EgtGetNextSelectedObj() @@ -229,12 +245,18 @@ Public Class MoveRawPartPage End Sub Private Sub RightBtn_Click(sender As Object, e As RoutedEventArgs) Handles RightBtn.Click + ' Solo movimento con ventose + If m_bByHand Then Return Dim nRawId As Integer = EgtGetFirstSelectedObj() While nRawId <> GDB_ID.NULL - Dim vtMove As New Vector3d(m_dStep, 0, 0) - If EgtMoveRawPart(nRawId, vtMove) Then - EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB) - AddRawMoveData(nRawId, vtMove) + If m_bRawWithCups Then + Dim vtMove As New Vector3d(m_dStep, 0, 0) + If EgtMoveRawPart(nRawId, vtMove) Then + EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB) + AddRawMoveData(nRawId, vtMove) + End If + Else + m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere End If nRawId = EgtGetNextSelectedObj() End While @@ -242,12 +264,18 @@ Public Class MoveRawPartPage End Sub Private Sub LeftBtn_Click(sender As Object, e As RoutedEventArgs) Handles LeftBtn.Click + ' Solo movimento con ventose + If m_bByHand Then Return Dim nRawId As Integer = EgtGetFirstSelectedObj() While nRawId <> GDB_ID.NULL - Dim vtMove As New Vector3d(-m_dStep, 0, 0) - If EgtMoveRawPart(nRawId, vtMove) Then - EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB) - AddRawMoveData(nRawId, vtMove) + If m_bRawWithCups Then + Dim vtMove As New Vector3d(-m_dStep, 0, 0) + If EgtMoveRawPart(nRawId, vtMove) Then + EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB) + AddRawMoveData(nRawId, vtMove) + End If + Else + m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere End If nRawId = EgtGetNextSelectedObj() End While @@ -258,6 +286,16 @@ Public Class MoveRawPartPage Dim nRawId As Integer = EgtGetFirstSelectedObj() While nRawId <> GDB_ID.NULL EgtRemoveRawPartFromCurrPhase(nRawId) + ' Se con ventose + If Not m_bByHand Then + m_bRemovedRaw = True + ' rimuovo eventuali indicazioni di movimento + RemoveRawMoveData(nRawId) + ' nascondo le ventose + EgtSetStatus(GetVacuumId(), GDB_ST.OFF) + ' Reset eventuale messaggio + m_CurrProjPage.ClearMessage() + End If nRawId = EgtGetFirstSelectedObj() End While EgtDraw() @@ -285,8 +323,9 @@ Public Class MoveRawPartPage If Not m_bByHand Then ' nascondo le ventose EgtSetStatus(GetVacuumId(), GDB_ST.OFF) - ' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati + ' recupero disposizione fase corrente Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase) + ' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati For Each rmData As RawMoveData In m_RawMoveDataList ' Se movimento significativo If Not rmData.m_vtMove.IsSmall() Then @@ -294,6 +333,8 @@ Public Class MoveRawPartPage SaveMoveInfoInDisposition(nDispId, rmData) End If Next + ' imposto presenza operazioni manuali + SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw) ' Eseguo calcolo speciale dei movimenti EgtSpecialApplyDisposition(nDispId, True) End If @@ -336,6 +377,21 @@ Public Class MoveRawPartPage Return nInd End Function + Private Sub RemoveRawMoveData(nRawId As Integer) + ' Cerco in lista record con dati del grezzo indicato + Dim nInd As Integer = -1 + For i As Integer = 0 To m_RawMoveDataList.Count() - 1 + If m_RawMoveDataList(i).m_nId = nRawId Then + nInd = i + Exit For + End If + Next + ' Se trovato, lo elimino + If nInd >= 0 Then + m_RawMoveDataList.RemoveAt(nInd) + End If + End Sub + End Class diff --git a/MultipleCut.xaml.vb b/MultipleCut.xaml.vb index e94e8d8..55a86d6 100644 --- a/MultipleCut.xaml.vb +++ b/MultipleCut.xaml.vb @@ -552,6 +552,10 @@ Public Class MultipleCut EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId) ' Inserisco la lavorazione m_bCutOk = AddMachinings(nPartId, True, True) + ' Eventuale eliminazione Home finale + If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then + RemoveFinalHome() + End If UpdateOkBtn() Return m_bCutOk End Function @@ -599,6 +603,10 @@ Public Class MultipleCut EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId) ' Inserisco la lavorazione m_bCutOk = AddMachinings(nPartId, True, True) + ' Eventuale eliminazione Home finale + If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then + RemoveFinalHome() + End If UpdateOkBtn() Return m_bCutOk End Function diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 3dff5fa..fa21ab9 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -18,7 +18,7 @@ Imports System.Windows #End If - + @@ -60,5 +60,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/My Project/app.manifest b/My Project/app.manifest new file mode 100644 index 0000000..684187d --- /dev/null +++ b/My Project/app.manifest @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OmagCUT.vbproj b/OmagCUT.vbproj index 3340ae5..202da60 100644 --- a/OmagCUT.vbproj +++ b/OmagCUT.vbproj @@ -76,6 +76,12 @@ OnOutputUpdated + + My Project\app.manifest + + + Resources\OmagCUT.ico + ..\..\EgtProg\OmagCUT\AxInterop.FXLib.dll @@ -508,6 +514,7 @@ My.Resources + SettingsSingleFileGenerator Settings.Designer.vb @@ -609,6 +616,9 @@ + + + IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe diff --git a/ProjectMgrUC.xaml.vb b/ProjectMgrUC.xaml.vb index 99620ed..b1e86fc 100644 --- a/ProjectMgrUC.xaml.vb +++ b/ProjectMgrUC.xaml.vb @@ -36,17 +36,31 @@ Public Class ProjectMgrUC If EgtGetModified() Then Dim SaveCurrProj As New EgtMsgBox(m_MainWindow, "", EgtMsg(MSG_EGTMSGBOX + 1), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL) Select Case SaveCurrProj.DialogResult - Case 0 ' Annulla - Return - Case 1 ' Si - m_CurrProjPage.SaveNamedProject() - m_CurrProjPage.SaveProject() - Case 2 ' No - ' Non devo fare alcunchè + Case 0 ' Annulla + Return + Case 1 ' Si + m_CurrProjPage.SaveNamedProject() + m_CurrProjPage.SaveProject() + Case 2 ' No + ' Non devo fare alcunchè End Select End If ' Cancello progetto salvato con nome da file ini WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", m_MainWindow.GetIniFile()) + ' Se ci sono pezzi in parcheggio, chiedo se conservarli + Dim bRetainParkedParts As Boolean = False + If EgtGetFirstPart() <> GDB_ID.NULL Then + ' Conservare i pezzi in parcheggio ? + Dim RetainParkedParts As New EgtMsgBox(m_MainWindow, "", EgtMsg(91118), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL) + Select Case RetainParkedParts.DialogResult + Case 0 ' Annulla + Return + Case 1 ' Si + bRetainParkedParts = True + Case 2 ' No + ' Non devo fare alcunchè + End Select + End If ' Se macchina con due tavole, chiedo su quale si vuole operare Dim sTabName As String = MAIN_TAB If EgtGetTableId(SECOND_TAB) <> GDB_ID.NULL Then @@ -60,7 +74,7 @@ Public Class ProjectMgrUC End Select End If ' Creo nuovo progetto - m_CurrProjPage.NewProject(sTabName) + m_CurrProjPage.NewProject(sTabName, bRetainParkedParts) EgtZoom(ZM.ALL) End Sub diff --git a/RawPartPageUC.xaml.vb b/RawPartPageUC.xaml.vb index 38f8ab8..9dc3dcc 100644 --- a/RawPartPageUC.xaml.vb +++ b/RawPartPageUC.xaml.vb @@ -178,7 +178,7 @@ Public Class RawPartPageUC ' Assegno dati grezzo rettangolare ai textbox LengthTxBx.Text = LenToString(m_RawLength, 2) WidthTxBx.Text = LenToString(m_RawWidth, 2) - HeightTxBx.Text = LenToString(m_RawHeight, 2) + HeightTxBx.Text = LenToString(m_RawHeight, 3) OffsetXTxBx.Text = LenToString(m_RawOffsX, 2) OffsetYTxBx.Text = LenToString(m_RawOffsY, 2) KerfTxBx.Text = LenToString(m_RawKerf, 2) @@ -1007,7 +1007,7 @@ Public Class RawPartPageUC EgtDraw() End If Else - HeightTxBx.Text = LenToString(m_RawHeight, 2) + HeightTxBx.Text = LenToString(m_RawHeight, 3) m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 18)) 'Non sono ammessi spessori negativi End If End Sub @@ -1180,14 +1180,14 @@ Public Class RawPartPageUC If RawThickness > -EPS_ZERO Then m_CurrProjPage.ClearMessage() If Math.Abs(RawThickness - m_RawHeight) > EPS_SMALL Then - HeightTxBx.Text = LenToString(RawThickness, 2) + HeightTxBx.Text = LenToString(RawThickness, 3) m_RawHeight = RawThickness UpdateRawPartHeight() ' Ridisegno EgtDraw() End If Else - HeightTxBx.Text = LenToString(m_RawHeight, 2) + HeightTxBx.Text = LenToString(m_RawHeight, 3) m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 18)) 'Non sono ammessi spessori negativi End If ' Chiudo msgbox diff --git a/Resources/OmagCUT.ico b/Resources/OmagCUT.ico new file mode 100644 index 0000000000000000000000000000000000000000..02e2036dd0f33a0f45df709e365e4906ca5ee505 GIT binary patch literal 9158 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 + Width="120" Style="{StaticResource OmagCut_FixedTextBox}" TextAlignment="Right"/> + Width="120" Style="{StaticResource OmagCut_FixedTextBox}" TextAlignment="Right"/> + Width="120" Style="{StaticResource OmagCut_FixedTextBox}" TextAlignment="Right"/> + Width="120" Style="{StaticResource OmagCut_FixedTextBox}" TextAlignment="Right"/> + Width="120" Style="{StaticResource OmagCut_FixedTextBox}" TextAlignment="Right"/> - + -EPS_SMALL And dEndAddLen > -EPS_SMALL And + Mach.m_sLay = NAME_OUTLOOP And Mach.m_nInterf = FMI_TYPE.NONE Then + Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId) + Mach.m_bCanStartAll = (nRes And CAR_RES.LI_OK) <> 0 + Mach.m_bCanEndAll = (nRes And CAR_RES.LO_OK) <> 0 + Else + Mach.m_bCanStartAll = False + Mach.m_bCanEndAll = False + End If + ' se trasformabile in taglio di separazione, verifico se lo è + If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then + EgtSetCurrMachining(nOperId) + Dim nLiType As Integer + EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiType) + Dim nLoType As Integer + EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoType) + Mach.m_bStartAll = (nLiType = MCH_SAW_LI.EXT_CENT Or nLiType = MCH_SAW_LI.EXT_OUT) + Mach.m_bEndAll = (nLoType = MCH_SAW_LO.EXT) + Else + Mach.m_bStartAll = False + Mach.m_bEndAll = False + End If + ' Forature e fresature Else Mach.m_nInterf = FMI_TYPE.NONE - End If - ' la imposto come lavorazione corrente e ne ricavo il tipo - EgtSetCurrMachining(nOperId) - Dim nMchType As Integer = MCH_MY.NONE - EgtGetMachiningParam(MCH_MP.TYPE, nMchType) - ' se taglio con lama, recupero l'angolo di fianco - Dim dSideAng As Double = 90 - EgtGetMachiningParam(MCH_MP.SIDEANGLE, dSideAng) - ' se taglio con lama, recupero allungamento iniziale e finale (negativi vicino ad angoli interni) - Dim dStartAddLen As Double = -10 - EgtGetMachiningParam(MCH_MP.STARTADDLEN, dStartAddLen) - Dim dEndAddLen As Double = -10 - EgtGetMachiningParam(MCH_MP.ENDADDLEN, dEndAddLen) - ' verifico se trasformabile in un taglio di separazione - If Math.Abs(dSideAng) < EPS_ANG_SMALL And - dStartAddLen > -EPS_SMALL And dEndAddLen > -EPS_SMALL And - Mach.m_sLay = NAME_OUTLOOP And Mach.m_nInterf = FMI_TYPE.NONE Then - Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId) - Mach.m_bCanStartAll = (nRes And CAR_RES.LI_OK) <> 0 - Mach.m_bCanEndAll = (nRes And CAR_RES.LO_OK) <> 0 - Else + Mach.m_dSideAng = 0 Mach.m_bCanStartAll = False Mach.m_bCanEndAll = False - End If - ' se trasformabile in taglio di separazione, verifico se lo è - If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then - EgtSetCurrMachining(nOperId) - Dim nLiType As Integer - EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiType) - Dim nLoType As Integer - EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoType) - Mach.m_bStartAll = (nLiType = MCH_SAW_LI.EXT_CENT Or nLiType = MCH_SAW_LI.EXT_OUT) - Mach.m_bEndAll = (nLoType = MCH_SAW_LO.EXT) - Else Mach.m_bStartAll = False Mach.m_bEndAll = False End If diff --git a/SplitPageUC.xaml.vb b/SplitPageUC.xaml.vb index 28afcd8..524fa56 100644 --- a/SplitPageUC.xaml.vb +++ b/SplitPageUC.xaml.vb @@ -75,13 +75,20 @@ Public Class SplitPageUC For i As Integer = 1 To m_MachiningList.Count() Dim Mach As SplitMach = m_MachiningList(i - 1) If Mach.m_nType = MCH_OY.SAWING Then ' Taglio - Dim sText As String = EgtMsg(90791) & i.ToString() + Dim sText As String = String.Empty + If Math.Abs(Mach.m_dSideAng) < EPS_ANG_SMALL Then + sText = EgtMsg(90791) & " " & i.ToString() + ElseIf Mach.m_dSideAng > 0 Then + sText = EgtMsg(90791) & " _\ " & i.ToString() + Else + sText = EgtMsg(90791) & " _/ " & i.ToString() + End If m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled)) ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura - Dim sText As String = EgtMsg(90792) & i.ToString() + Dim sText As String = EgtMsg(90792) & " " & i.ToString() m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled)) ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura - Dim sText As String = EgtMsg(90793) & i.ToString() + Dim sText As String = EgtMsg(90793) & " " & i.ToString() m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled)) End If Next diff --git a/ToolsDbPageUC.xaml.vb b/ToolsDbPageUC.xaml.vb index ece63e5..9544654 100644 --- a/ToolsDbPageUC.xaml.vb +++ b/ToolsDbPageUC.xaml.vb @@ -9,15 +9,15 @@ Public Class ToolsDbPageUC ' Riferimento alla MainWindow Private m_MainWindow As MainWindow = Application.Current.MainWindow + ' Riferimento alla macchina corrente + Private m_CurrMachine As CurrentMachine = m_MainWindow.m_CurrentMachine + ' Lista degli utensili Dim ToolsList As New ObservableCollection(Of CathegoryItem) ' Proprietà Private m_bFirst As Boolean = True ' Direttorio costruttori geometria utensili Private m_sToolMakersDir As String = String.Empty - ' Abilitazioni visualizzazioni speciali - Private m_bShowToolChanger As Boolean = True - Private m_bShowHeadExit As Boolean = True ' Stringa identificativa variabile geometrica in modifica Private m_sCurrVar As String = String.Empty ' Parametri geometrici dell'utensile corrente @@ -162,16 +162,13 @@ Public Class ToolsDbPageUC ToolScene.SetStatusNull() ' leggo direttorio toolmakers GetPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", m_sToolMakersDir, m_MainWindow.GetIniFile()) - ' leggo abilitazioni visualizzazione campi utensili - m_bShowToolChanger = GetPrivateProfileInt(S_TOOLS, K_SHOWTOOLCHANGER, 1, m_MainWindow.GetMachIniFile()) <> 0 - m_bShowHeadExit = GetPrivateProfileInt(S_TOOLS, K_SHOWHEADEXIT, 1, m_MainWindow.GetMachIniFile()) <> 0 ' Inizializzo le famiglie di utensili nell'albero EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()) - InitializeToolFamily(K_SAWBLADE, MCH_TF.SAWBLADE, EgtMsg(MSG_TOOLSDBPAGEUC + 31)) - InitializeToolFamily(K_DRILLBIT, MCH_TF.DRILLBIT, EgtMsg(MSG_TOOLSDBPAGEUC + 32)) - InitializeToolFamily(K_MILL, MCH_TF.MILL, EgtMsg(MSG_TOOLSDBPAGEUC + 33)) - 'Sposto tutti i parametri in su di una riga se testa e uscita sono disattivati - If Not m_bShowHeadExit Then + InitializeToolFamily(m_CurrMachine.bSaw, MCH_TF.SAWBLADE, EgtMsg(MSG_TOOLSDBPAGEUC + 31)) + InitializeToolFamily(m_CurrMachine.bDrill, MCH_TF.DRILLBIT, EgtMsg(MSG_TOOLSDBPAGEUC + 32)) + InitializeToolFamily(m_CurrMachine.bMill, MCH_TF.MILL, EgtMsg(MSG_TOOLSDBPAGEUC + 33)) + ' Sposto tutti i parametri in su di una riga se testa e uscita sono disattivati + If Not m_CurrMachine.bShowHeadExit Then MoveParam() End If m_bFirst = False @@ -239,7 +236,7 @@ Public Class ToolsDbPageUC EgtTdbGetCurrToolParam(MCH_TP.TYPE, nTemp) Dim bSaw As Boolean = ((nTemp And MCH_TF.SAWBLADE) <> 0) ' Per macchine con ToolChanger lame su H1.1 e altri utensili su H2.1 - If m_bShowToolChanger Then + If m_CurrMachine.bShowToolChanger Then EgtTdbSetCurrToolParam(MCH_TP.HEAD, If(bSaw, "H1", "H2")) EgtTdbSetCurrToolParam(MCH_TP.EXIT_, 1) ' Altrimenti lame su H1.1 e altri utensili su H1.2 @@ -248,7 +245,7 @@ Public Class ToolsDbPageUC EgtTdbSetCurrToolParam(MCH_TP.EXIT_, If(bSaw, 1, 2)) End If ' Per macchine senza ToolChanger, resetto la posizione su questo - If Not m_bShowToolChanger Then + If Not m_CurrMachine.bShowToolChanger Then EgtTdbSetCurrToolParam(MCH_TP.TCPOS, "") End If EgtTdbSaveCurrTool() @@ -332,19 +329,19 @@ Public Class ToolsDbPageUC m_MainWindow.m_MachinePageUC.AlarmsBtn.IsChecked = True End Sub - Friend Sub InitializeToolFamily(sFIniConst As String, nFType As Integer, sFName As String) - If GetPrivateProfileInt(S_TOOLS, sFIniConst, 0, m_MainWindow.GetMachIniFile()) = 1 Then - Dim ToolCathegory As New CathegoryItem(sFName, nFType) - Dim nType As Integer = 0 - Dim ToolName As String = String.Empty - If EgtTdbGetFirstTool(nFType, ToolName, nType) Then + Friend Sub InitializeToolFamily(bEnabled As Boolean, nFType As Integer, sFName As String) + If Not bEnabled Then Return + ' Inserisco categoria ed eventuali elementi + Dim ToolCathegory As New CathegoryItem(sFName, nFType) + Dim nType As Integer = 0 + Dim ToolName As String = String.Empty + If EgtTdbGetFirstTool(nFType, ToolName, nType) Then + ToolCathegory.Items.Add(New CustomItem(ToolName, nType)) + While EgtTdbGetNextTool(nFType, ToolName, nType) ToolCathegory.Items.Add(New CustomItem(ToolName, nType)) - While EgtTdbGetNextTool(nFType, ToolName, nType) - ToolCathegory.Items.Add(New CustomItem(ToolName, nType)) - End While - End If - ToolsList.Add(ToolCathegory) + End While End If + ToolsList.Add(ToolCathegory) End Sub Private Sub GetToolParams() @@ -453,8 +450,8 @@ Public Class ToolsDbPageUC Private Sub ViewToolParams() NameTxBl.Visibility = Windows.Visibility.Visible NameTxBx.Visibility = Windows.Visibility.Visible - TCPosBrd.Visibility = If(m_bShowToolChanger, Windows.Visibility.Visible, Windows.Visibility.Hidden) - HeadExitBrd.Visibility = If(m_bShowHeadExit, Windows.Visibility.Visible, Windows.Visibility.Hidden) + TCPosBrd.Visibility = If(m_CurrMachine.bShowToolChanger, Windows.Visibility.Visible, Windows.Visibility.Hidden) + HeadExitBrd.Visibility = If(m_CurrMachine.bShowHeadExit, Windows.Visibility.Visible, Windows.Visibility.Hidden) SpeedGpBx.Visibility = Windows.Visibility.Visible FeedGpBx.Visibility = Windows.Visibility.Visible CoolantTxBl.Visibility = Windows.Visibility.Visible diff --git a/Utility.vb b/Utility.vb index 046a713..37f7b6e 100644 --- a/Utility.vb +++ b/Utility.vb @@ -23,6 +23,7 @@ Module Utility End Function Friend Function StringToDouble(ByVal sVal As String, ByRef dVal As Double) As Boolean + If String.IsNullOrEmpty(sVal) Then Return False Return EgtLuaEvalNumExpr(sVal, dVal) End Function @@ -31,6 +32,7 @@ Module Utility End Function Friend Function StringToLen(ByVal sVal As String, ByRef dVal As Double) As Boolean + If String.IsNullOrEmpty(sVal) Then Return False If EgtLuaEvalNumExpr(sVal, dVal) Then dVal = EgtFromUiUnits(dVal) Return True diff --git a/VacuumCups.vb b/VacuumCups.vb index e396ea7..0015a7c 100644 --- a/VacuumCups.vb +++ b/VacuumCups.vb @@ -307,12 +307,12 @@ Module VacuumCups sInfo = rmData.m_nId.ToString() EgtSetInfo(nRpmId, "Id", sInfo) sInfo = DoubleToString(rmData.m_vtMove.x, 4) & "," & - DoubleToString(rmData.m_vtMove.y, 4) & "," & - DoubleToString(rmData.m_vtMove.z, 4) + DoubleToString(rmData.m_vtMove.y, 4) & "," & + DoubleToString(rmData.m_vtMove.z, 4) EgtSetInfo(nRpmId, "Mv", sInfo) sInfo = DoubleToString(rmData.m_vtDelta.x, 4) & "," & - DoubleToString(rmData.m_vtDelta.y, 4) & "," & - DoubleToString(rmData.m_vtDelta.z, 4) + DoubleToString(rmData.m_vtDelta.y, 4) & "," & + DoubleToString(rmData.m_vtDelta.z, 4) EgtSetInfo(nRpmId, "Dt", sInfo) sInfo = DoubleToString(rmData.m_dAngRotDeg, 4) EgtSetInfo(nRpmId, "Ad", sInfo) @@ -323,4 +323,12 @@ Module VacuumCups Return True End Function + Friend Function SaveRemoveByHandInDisposition(nDispId As Integer, bRemoveByHand As Boolean) As Boolean + ' Verifico DispId + If EgtGetOperationType(nDispId) <> MCH_OY.DISP Then Return False + ' Imposto flag + EgtSetInfo(nDispId, "Rbh", If(bRemoveByHand, "1", "0")) + Return True + End Function + End Module diff --git a/WorkInProgressPageUC.xaml.vb b/WorkInProgressPageUC.xaml.vb index 907063d..28f0e12 100644 --- a/WorkInProgressPageUC.xaml.vb +++ b/WorkInProgressPageUC.xaml.vb @@ -95,7 +95,7 @@ Public Class WorkInProgressPageUC m_bContinue = False End Sub - Private Function NewProject() As Boolean + Private Function WipNewProject() As Boolean ' Imposto il nuovo progetto EgtNewFile() ' Creo un gruppo di lavoro e carico la macchina corrente @@ -147,7 +147,7 @@ Public Class WorkInProgressPageUC End If End If If Not My.Computer.FileSystem.FileExists(sPath) Then - Return NewProject() + Return WipNewProject() End If ' Carico il progetto EgtOpenFile(sPath) @@ -318,7 +318,7 @@ Public Class WorkInProgressPageUC ' Inizializzo gestore lavorazioni EgtInitMachMgr(m_MainWindow.GetMachinesRootDir()) ' Carico macchina - If Not NewProject() Then + If Not WipNewProject() Then EgtOutLog("WorkInProgress : error loading machine") End If ' Recupero origine tavola