From 7d010be835a388bbc55cade0dc18f726a1a884c9 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Tue, 4 Mar 2025 09:44:18 +0100 Subject: [PATCH 01/27] Prima gestione cambio lavorazione in Splitting --- CAM/CamAuto.vb | 19 ++ CadCuts/ChangeToolWD.xaml | 88 ++++++ CadCuts/ChangeToolWD.xaml.vb | 378 +++++++++++++++++++++++++ CadCuts/ChooseTestToolWD.xaml.vb | 24 ++ CadCuts/SplitAuto.vb | 421 +++++++++++++++++++--------- CadCuts/SplitPageUC.xaml.vb | 85 ++++++ Machine/AlarmsPageUC.xaml.vb | 45 ++- Machine/ChooseToolWD.xaml.vb | 12 + Machine/CurrentMachine.vb | 1 + Machine/SetUpPage.xaml.vb | 91 +++--- Machine/ToolChangerPosUC.xaml | 2 +- OmagCUT.vbproj | 7 + RawPhoto/ChooseMachining.xaml.vb | 10 +- RawPhoto/RawPartPageUC.xaml.vb | 4 +- Simulation/SimulationPageUC.xaml.vb | 3 +- 15 files changed, 1006 insertions(+), 184 deletions(-) create mode 100644 CadCuts/ChangeToolWD.xaml create mode 100644 CadCuts/ChangeToolWD.xaml.vb diff --git a/CAM/CamAuto.vb b/CAM/CamAuto.vb index e2b567e..1f24851 100644 --- a/CAM/CamAuto.vb +++ b/CAM/CamAuto.vb @@ -33,6 +33,25 @@ Friend Module CamAuto Return bOk End Function + Friend Function AddSawMachining(nOperId As Integer, ByRef nNewOperation As Integer) As Boolean + EgtLuaCreateGlobTable("CAM") + SetLuaStandardCamParams() + EgtLuaSetGlobIntVar("CAM.OPERID", nOperId) + Dim nErr As Integer = 999 + Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua") + bOk = bOk AndAlso EgtLuaGetGlobIntVar("CAM.ERR", nErr) AndAlso nErr = 0 + bOk = bOk AndAlso EgtLuaCallFunction("CAM.UpdateSawing") + EgtLuaGetGlobIntVar("CAM.ERR", nErr) + EgtLuaGetGlobIntVar("CAM.NEW_OPERATION", nNewOperation) + EgtLuaResetGlobVar("CAM") + If nErr <> 0 Then + bOk = False + EgtOutLog("Error in CamAuto : " & nErr.ToString()) + m_MainWindow.m_CurrentProjectPageUC.ClearMessage() + End If + Return bOk + End Function + Friend Function AddWaterJetMachining(nOperId As Integer, ByRef nWarn As Integer) As Boolean EgtLuaCreateGlobTable("CAM") SetLuaStandardCamParams() diff --git a/CadCuts/ChangeToolWD.xaml b/CadCuts/ChangeToolWD.xaml new file mode 100644 index 0000000..9918cbd --- /dev/null +++ b/CadCuts/ChangeToolWD.xaml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CadCuts/ChangeToolWD.xaml.vb b/CadCuts/ChangeToolWD.xaml.vb new file mode 100644 index 0000000..114ccfc --- /dev/null +++ b/CadCuts/ChangeToolWD.xaml.vb @@ -0,0 +1,378 @@ +Imports System.Collections.ObjectModel +Imports System.Security.Cryptography.X509Certificates +Imports System.Windows.Forms +Imports EgtUILib + +Public Class ChangeToolWD + Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) + + Private m_SetUpMachiningList As New ObservableCollection(Of ItemMachining) + + Sub New(Owner As Window) + Me.Owner = Owner + InitializeComponent() + End Sub + + ' Il nome della lavorazione restituito dalla selezione + Private m_NewSawing As String = String.Empty + Public ReadOnly Property NewSawing As String + Get + Return m_NewSawing + End Get + End Property + + Private m_CurrSawing As String = String.Empty + Public Property CurrSawing As String + Get + Return m_CurrSawing + End Get + Set(value As String) + m_CurrSawing = value + End Set + End Property + + Private Sub OpenFile_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized + ' Posizione finestra + Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2 + Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2 + ' Definizione del collegamento tra ItemList e ListBox1 + SetUpToolListBox.ItemsSource = m_SetUpMachiningList + FilePathTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 45) ' Selezionare l'utensile da tastare + End Sub + + Private Sub OpenFile_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded + If String.IsNullOrEmpty(m_CurrSawing) Then + m_CurrSawing = m_MainWindow.m_CurrentMachine.sCurrSawing + End If + ' carico elenco degli utensili impostati attualmente in macchina (anche il laser!) + LoadSetUpMachining() + ' ricerco la lavorazione corrente + Dim Item As ItemMachining = m_SetUpMachiningList.FirstOrDefault(Function(x) x.Machining = m_CurrSawing) + Dim Index As Integer = m_SetUpMachiningList.IndexOf(Item) + If Index < 0 Then + Index = 0 + End If + ' se presente seleziono il primo elemento + If m_SetUpMachiningList.Count > 0 Then + SetUpToolListBox.SelectedItem = m_SetUpMachiningList(Index) + OkBtn.IsEnabled = True + Else + OkBtn.IsEnabled = False + End If + End Sub + +#Region "SET UP MACHINING" + + ' Creo le liste da mostrare nella lista + Private Function LoadSetUpMachining() As Boolean + Dim sNameTool As String = String.Empty + Dim nType As Integer = 0 + Dim sHeadTool As String = String.Empty + Dim nExitTool As Integer = 0 + ' Imposto il contesto corrente + EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()) + ' Recupero la lista di tutte le lavorazioni di lama + Dim local_Sawing As TreeViewItem.CathegoryItem = GetAllSwaing() + ' Se non ci sono lavorazioni di lama allora esco + If IsNothing(local_Sawing) Then Return False + + ' Ripulisco la lista degli utensili + m_SetUpMachiningList.Clear() + CreateSawingList(local_Sawing) + + 'sNameTool = m_MainWindow.m_CurrentMachine.sCurrWaterJet + 'If Not String.IsNullOrEmpty(sNameTool) Then + ' ' Imposto WJ + ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) + 'End If + + 'Select Case m_MainWindow.m_CurrentMachine.MountedToolConfig + ' Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL + ' sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw + ' If Not String.IsNullOrEmpty(sNameTool) Then + ' ' Imposto la lama + ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) + ' End If + ' sNameTool = m_MainWindow.m_CurrentMachine.sCurrMill + ' If Not String.IsNullOrEmpty(sNameTool) Then + ' ' Imposto la fresa + ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) + ' End If + ' sNameTool = m_MainWindow.m_CurrentMachine.sCurrDrill + ' If Not String.IsNullOrEmpty(sNameTool) Then + ' ' Imposto il foretto + ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) + ' End If + + ' Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER + ' sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw + ' If Not String.IsNullOrEmpty(sNameTool) Then + ' ' Imposto la lama + ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) + ' End If + ' ' Recupero tutti gli utensili attrezzati (nel ToolChanger e nel ManualToolChanger) + ' For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger + ' 'm_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False)) + ' sNameTool = ToolChangerPos.sTool + ' If Not String.IsNullOrEmpty(sNameTool) Then + ' ' Imposto la lama + ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) + ' End If + ' Next + ' Return True + + ' Case CurrentMachine.MountedToolConfigs.TOOLCHANGER + ' ' Recupero tutti gli utensili attrezzati (nel ToolChanger e nel ManualToolChanger) + ' sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw + ' If Not String.IsNullOrEmpty(sNameTool) Then + ' ' Imposto la lama + ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) + ' End If + ' 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)) + ' sNameTool = ToolChangerPos.sTool + ' If Not String.IsNullOrEmpty(sNameTool) Then + ' ' Imposto la lama + ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) + ' End If + ' 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)) + ' sNameTool = ToolChangerPos.sTool + ' If Not String.IsNullOrEmpty(sNameTool) Then + ' ' Imposto la lama + ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) + ' End If + ' End If + ' Next + ' Return True + ' Case Else + ' Return False + 'End Select + + Return True + End Function + + ' Creo la lista delle delle lavorazioni di lama da proporre + Private Sub CreateSawingList(SawingFam As TreeViewItem.CathegoryItem) + ' recupero la prima lavorazione + For Each Item As TreeViewItem.CustomItem In SawingFam.Items + Dim sNameTool As String = String.Empty + ' Imposto la lavorazione corrente + EgtMdbSetCurrMachining(Item.Name) + ' Recupero il nome dell'utensile della lavorazione + EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sNameTool) + If Not String.IsNullOrEmpty(sNameTool) Then + ' Verifico che sia montata su un portautensile + EgtTdbSetCurrTool(sNameTool) + Dim sTCPos As String = String.Empty + EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos) + If Not String.IsNullOrEmpty(sTCPos) Then + ' Cerco nel porta utensili automaitico + For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger + If ToolPosition.sTool <> String.Empty Then + If sNameTool = ToolPosition.sTool Then + ' Verifico che il materiale e lo spessore + If VerifyCurrMachiningMaterial() Then + Dim local_ItemMachining = New ItemMachining(Item.Name, sNameTool, sTCPos) + local_ItemMachining.ColorSawing = GetColorPV() + m_SetUpMachiningList.Add(local_ItemMachining) + End If + + Exit For + End If + End If + Next + End If + End If + Next + ' reimposto la lavorazione di lama e la lama impostate in macchina + EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw) + EgtMdbSetCurrMachining(m_MainWindow.m_CurrentMachine.sCurrSawing) + End Sub + + Private Function GetColorPV() As Color3d + Dim ToolString As String = String.Empty + Dim ToolColor As String = String.Empty + 'EgtTdbGetCurrToolParam(MCH_MP.SYSNOTES, ToolString) + EgtTdbGetCurrToolParam(MCH_TP.SYSNOTES, ToolString) + EgtTdbGetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", ToolColor) + Dim sItems As String() = ToolColor.Split(","c) + Return New Color3d(CInt(sItems(0)), CInt(sItems(1)), CInt(sItems(2))) + End Function + + ' verifico l'utensile corrente (impostato nella funzione chiamante) se puù lavorare il grezzo corrente + Private Function VerifyCurrMachiningMaterial() As Boolean + Dim m_MaterialsList As New ObservableCollection(Of MachiningMaterial) + For Each Material As Material In m_MainWindow.m_CurrentMachine.Materials + If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then + m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName, Material.SubId)) + Else + m_MaterialsList.Add(New MachiningMaterial(Material.nId, Material.sName)) + End If + Next + + Dim ToolString As String = String.Empty + EgtMdbGetCurrMachiningParam(MCH_MP.SYSNOTES, ToolString) + If ToolString <> String.Empty Then + Dim sItems() = ToolString.Split(";".ToCharArray) + Dim Index As Integer = 0 + For Each Material As MachiningMaterial In m_MaterialsList + Dim Param() As String = sItems(Index).Split(",".ToCharArray) + Dim SubParam() As String = Param(0).Split(".".ToCharArray) + Dim nParId As Integer = 0 + Dim nSubParId As Integer = 0 + If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then + If StringToInt(SubParam(0), nParId) AndAlso nParId = m_MainWindow.m_CurrentMachine.CurrMat.nId AndAlso SubParam.Count > 1 AndAlso + StringToInt(SubParam(1), nSubParId) AndAlso nSubParId = Material.nSubId Then + + StringToDouble(Param(1), Material.dMinThickness) + StringToDouble(Param(2), Material.dMaxThickness) + Material.VerifyIfActive() + Index += 1 + Else + Material.VerifyIfActive() + End If + Else + If StringToInt(Param(0), nParId) AndAlso nParId = m_MainWindow.m_CurrentMachine.CurrMat.nId Then + StringToDouble(Param(1), Material.dMinThickness) + StringToDouble(Param(2), Material.dMaxThickness) + Material.VerifyIfActive() + If m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight > Material.dMinThickness And m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight < Material.dMaxThickness Then + Return True + End If + Index += 1 + Else + Material.VerifyIfActive() + End If + End If + Next + End If + Return False + End Function + + ' Restituisce tutto l'elenco delle lavorazioni disponibili in macchina + Private Function GetAllSwaing() As TreeViewItem.CathegoryItem + Dim sFName As String = EgtMsg(MSG_MACHININGSDBPAGEUC + 31) + Dim nFType As Integer = MCH_MY.SAWING + If Not m_MainWindow.m_CurrentMachine.bSawing Then Return Nothing + ' Inserisco categoria ed eventuali elementi + Dim MachiningCathegory As New TreeViewItem.CathegoryItem(sFName, nFType) + Dim MachiningName As String = String.Empty + If EgtMdbGetFirstMachining(nFType, MachiningName) Then + MachiningCathegory.Items.Add(New TreeViewItem.CustomItem(MachiningName, nFType)) + While EgtMdbGetNextMachining(nFType, MachiningName) + MachiningCathegory.Items.Add(New TreeViewItem.CustomItem(MachiningName, nFType)) + End While + End If + Return MachiningCathegory + End Function + +#End Region ' Set up machinining + + Private Sub SetUpToolListBox_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles SetUpToolListBox.PreviewMouseUp + ' Disabilito Ok + OkBtn.IsEnabled = False + ' Recupero item selezionato + If SetUpToolListBox.SelectedItems.Count() = 0 Then + Return + End If + m_NewSawing = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).Machining + ' A seconda del tipo + OkBtn.IsEnabled = True + End Sub + + Private Sub SetUpToolListBox_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SetUpToolListBox.SelectionChanged + ' Disabilito Ok + OkBtn.IsEnabled = False + ' Recupero item selezionato + If SetUpToolListBox.SelectedItems.Count() = 0 Then + Return + Else + m_NewSawing = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).Machining + OkBtn.IsEnabled = True + End If + End Sub + + Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click + DialogResult = True + End Sub + +End Class + +Public Class ItemMachining + + Private m_ToolPos As String = String.Empty + Private m_ToolName As String = String.Empty + Private m_Machining As String = String.Empty + Private m_ToolExit As Integer = 1 + Private m_ToolType As Integer = -1 + + ' Posizione porta utensile + Public Property ToolPos As String + Get + Return m_ToolPos + End Get + Set(value As String) + m_ToolPos = value + End Set + End Property + + ' Nome utensile + Public Property ToolName As String + Get + Return m_ToolName + End Get + Set(value As String) + m_ToolName = value + End Set + End Property + + ' Nome della lavorazione + Public Property Machining As String + Get + Return m_Machining + End Get + Set(value As String) + m_Machining = value + End Set + End Property + + Public Property ToolExit As Integer + Get + Return m_ToolExit + End Get + Set(value As Integer) + m_ToolExit = value + End Set + End Property + + Public Property ToolType As Integer + Get + Return m_ToolType + End Get + Set(value As Integer) + m_ToolType = value + End Set + End Property + + Private m_ColorSawing As New Color3d + Public Property ColorSawing As Color3d + Get + Return m_ColorSawing + End Get + Set(value As Color3d) + m_ColorSawing = value + End Set + End Property + + Sub New(sMachining As String, sToolName As String, sToolPos As String) + m_Machining = sMachining + m_ToolPos = sToolPos + m_ToolName = sToolName + End Sub + +End Class diff --git a/CadCuts/ChooseTestToolWD.xaml.vb b/CadCuts/ChooseTestToolWD.xaml.vb index 452348d..de1ebef 100644 --- a/CadCuts/ChooseTestToolWD.xaml.vb +++ b/CadCuts/ChooseTestToolWD.xaml.vb @@ -136,6 +136,30 @@ Public Class ChooseTestToolWD End If Next Return True + + 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)) + sNameTool = ToolChangerPos.sTool + If Not String.IsNullOrEmpty(sNameTool) Then + ' Imposto la lama + m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) + End If + 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)) + sNameTool = ToolChangerPos.sTool + If Not String.IsNullOrEmpty(sNameTool) Then + ' Imposto la lama + m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) + End If + End If + Next + Return True + Case Else Return False End Select diff --git a/CadCuts/SplitAuto.vb b/CadCuts/SplitAuto.vb index c3fdd40..60ee6aa 100644 --- a/CadCuts/SplitAuto.vb +++ b/CadCuts/SplitAuto.vb @@ -51,151 +51,296 @@ Public Module SplitAuto While nOperId <> GDB_ID.NULL ' verifico sia una lavorazione valida della fase corrente If IsValidMachining(nOperId) And EgtGetOperationPhase(nOperId) = nCurrPhase Then - ' se appartiene ad un grezzo attivo la inserisco in lista - If IsMachiningInActiveRaw(nOperId) Then - Dim Mach As New SplitMach - Mach.m_nEntId = GDB_ID.NULL - ' identificativo - Mach.m_nId = nOperId - ' eventuali lavorazioni inglobate - Dim sInfo As String = String.Empty - If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then - Dim sItems() As String = sInfo.Split(",".ToCharArray) - For Each sId As String In sItems - Dim nId As Integer = 0 - StringToInt(sId, nId) - If nId > 0 Then Mach.m_vOthId.Add(nId) - Next - End If - ' tipo - Mach.m_nType = EgtGetOperationType(nOperId) - ' layer di origine - EgtGetInfo(nOperId, INFO_MCH_LAYER, Mach.m_sLay) - ' se taglio con lama - If Mach.m_nType = MCH_OY.SAWING Then - ' verifica interferenza - If Mach.m_sLay = NAME_OUTLOOP Then - EgtVerifyMachining(nOperId, Mach.m_nInterf) - For Each nId As Integer In Mach.m_vOthId - Dim nRes As Integer = FMI_TYPE.LI Or FMI_TYPE.RM Or FMI_TYPE.LO - EgtVerifyMachining(nId, nRes) - Mach.m_nInterf = Mach.m_nInterf Or nRes - Next - Else - Mach.m_nInterf = FMI_TYPE.NONE - End If - ' la imposto come lavorazione corrente - EgtSetCurrMachining(nOperId) - ' inversione - EgtGetMachiningParam(MCH_MP.INVERT, Mach.m_bInvert) - ' recupero l'angolo di fianco - EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng) - ' 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) - ' recupero tipo entità, angolo con entità precedente e successiva, lunghezze libere iniziale e finale - Mach.m_bIsLine = True - Mach.m_dPrevAng = 0 - Mach.m_dNextAng = 0 - Mach.m_dStartFreeLen = FREELEN_INF + 1 - Mach.m_dEndFreeLen = FREELEN_INF + 1 - Dim nEntId, nSub As Integer - If EgtGetMachiningGeometry(0, nEntId, nSub) Then - ' EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse - If EgtGetType(nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False - EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng) - EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng) - EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen) - EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen) - Mach.m_bEnableInvert = GetEnableInvert(nEntId) - EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir) - If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir - Mach.m_nEntId = nEntId - EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner) - End If - ' verifico se trasformabile in un taglio di separazione (almeno da un lato) - If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And - Mach.m_sLay = NAME_OUTLOOP And ( Mach.m_nInterf And FMI_TYPE.RM) = 0 Then - Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId) - Dim bIn As Boolean = False - Dim bOut As Boolean = False - CanExtendSides(Mach, bIn, bOut) - Mach.m_bCanStartAll = ((dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LI_OK) <> 0) And - Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn - Mach.m_bCanEndAll = ((dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LO_OK) <> 0) And - Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut - If nRes = 0 Then - EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.") - End If + Dim Mach As New SplitMach + If CreateMach(Mach, nOperId) Then MachSplitList.Add(Mach) + '' se appartiene ad un grezzo attivo la inserisco in lista + 'If IsMachiningInActiveRaw(nOperId) Then + ' Dim Mach As New SplitMach + ' Mach.m_nEntId = GDB_ID.NULL + ' ' identificativo + ' Mach.m_nId = nOperId + ' ' eventuali lavorazioni inglobate + ' Dim sInfo As String = String.Empty + ' If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then + ' Dim sItems() As String = sInfo.Split(",".ToCharArray) + ' For Each sId As String In sItems + ' Dim nId As Integer = 0 + ' StringToInt(sId, nId) + ' If nId > 0 Then Mach.m_vOthId.Add(nId) + ' Next + ' End If + ' ' tipo + ' Mach.m_nType = EgtGetOperationType(nOperId) + ' ' layer di origine + ' EgtGetInfo(nOperId, INFO_MCH_LAYER, Mach.m_sLay) + ' ' se taglio con lama + ' If Mach.m_nType = MCH_OY.SAWING Then + ' ' verifica interferenza + ' If Mach.m_sLay = NAME_OUTLOOP Then + ' EgtVerifyMachining(nOperId, Mach.m_nInterf) + ' For Each nId As Integer In Mach.m_vOthId + ' Dim nRes As Integer = FMI_TYPE.LI Or FMI_TYPE.RM Or FMI_TYPE.LO + ' EgtVerifyMachining(nId, nRes) + ' Mach.m_nInterf = Mach.m_nInterf Or nRes + ' Next + ' Else + ' Mach.m_nInterf = FMI_TYPE.NONE + ' End If + ' ' la imposto come lavorazione corrente + ' EgtSetCurrMachining(nOperId) + ' ' inversione + ' EgtGetMachiningParam(MCH_MP.INVERT, Mach.m_bInvert) + ' ' recupero l'angolo di fianco + ' EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng) + ' ' 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) + ' ' recupero tipo entità, angolo con entità precedente e successiva, lunghezze libere iniziale e finale + ' Mach.m_bIsLine = True + ' Mach.m_dPrevAng = 0 + ' Mach.m_dNextAng = 0 + ' Mach.m_dStartFreeLen = FREELEN_INF + 1 + ' Mach.m_dEndFreeLen = FREELEN_INF + 1 + ' Dim nEntId, nSub As Integer + ' If EgtGetMachiningGeometry(0, nEntId, nSub) Then + ' ' EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse + ' If EgtGetType(nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False + ' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng) + ' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng) + ' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen) + ' EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen) + ' Mach.m_bEnableInvert = GetEnableInvert(nEntId) + ' EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir) + ' If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir + ' Mach.m_nEntId = nEntId + ' EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner) + ' End If + ' ' verifico se trasformabile in un taglio di separazione (almeno da un lato) + ' If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And + ' Mach.m_sLay = NAME_OUTLOOP And ( Mach.m_nInterf And FMI_TYPE.RM) = 0 Then + ' Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId) + ' Dim bIn As Boolean = False + ' Dim bOut As Boolean = False + ' CanExtendSides(Mach, bIn, bOut) + ' Mach.m_bCanStartAll = ((dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LI_OK) <> 0) And + ' Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn + ' Mach.m_bCanEndAll = ((dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LO_OK) <> 0) And + ' Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut + ' If nRes = 0 Then + ' EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.") + ' End If + + ' ElseIf (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And + ' Mach.m_sLay = NAME_OUTLOOP And + ' (Mach.m_nInterf = FMI_TYPE.LI Or Mach.m_nInterf = FMI_TYPE.LO Or Mach.m_nInterf = FMI_TYPE.RM) Then + ' Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId) + ' Dim bIn As Boolean = False + ' Dim bOut As Boolean = False + ' CanExtendSides(Mach, bIn, bOut) + ' ' And (nRes And CAR_RES.LI_OK) <> 0 : da aggiungere + ' Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And + ' Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn And + ' Mach.m_nInterf <> FMI_TYPE.LI + ' ' And (nRes And CAR_RES.LO_OK) <> 0 : da aggiungere come sopra + ' Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And + ' Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut And + ' Mach.m_nInterf <> FMI_TYPE.LO + ' If nRes = 0 Then + ' EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.") + ' End If + ' 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_CENT Or nLoType = MCH_SAW_LO.EXT_OUT) + ' Else + ' Mach.m_bStartAll = False + ' Mach.m_bEndAll = False + ' End If + ' ' Waterjet + ' ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then + ' Mach.m_nInterf = FMI_TYPE.NONE + ' ' recupero l'angolo di fianco + ' EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng) + ' Mach.m_bCanStartAll = False + ' Mach.m_bCanEndAll = False + ' Mach.m_bStartAll = False + ' Mach.m_bEndAll = False + ' ' Forature e fresature + ' Else + ' Mach.m_nInterf = FMI_TYPE.NONE + ' Mach.m_dSideAng = 0 + ' Mach.m_bCanStartAll = False + ' Mach.m_bCanEndAll = False + ' Mach.m_bStartAll = False + ' Mach.m_bEndAll = False + ' End If + ' ' abilitazione + ' Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF) + ' ' pausa + ' Mach.m_bPause = GetPause(nOperId) + ' ' inserisco in lista + ' MachSplitList.Add(Mach) + ' ' altrimenti la disattivo + 'Else + ' EgtSetOperationMode(nOperId, False) + 'End If - ElseIf (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And - Mach.m_sLay = NAME_OUTLOOP And - (Mach.m_nInterf = FMI_TYPE.LI Or Mach.m_nInterf = FMI_TYPE.LO Or Mach.m_nInterf = FMI_TYPE.RM) Then - Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId) - Dim bIn As Boolean = False - Dim bOut As Boolean = False - CanExtendSides(Mach, bIn, bOut) - ' And (nRes And CAR_RES.LI_OK) <> 0 : da aggiungere - Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And - Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn And - Mach.m_nInterf <> FMI_TYPE.LI - ' And (nRes And CAR_RES.LO_OK) <> 0 : da aggiungere come sopra - Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And - Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut And - Mach.m_nInterf <> FMI_TYPE.LO - If nRes = 0 Then - EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.") - End If - 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_CENT Or nLoType = MCH_SAW_LO.EXT_OUT) - Else - Mach.m_bStartAll = False - Mach.m_bEndAll = False - End If - ' Waterjet - ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then - Mach.m_nInterf = FMI_TYPE.NONE - ' recupero l'angolo di fianco - EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng) - Mach.m_bCanStartAll = False - Mach.m_bCanEndAll = False - Mach.m_bStartAll = False - Mach.m_bEndAll = False - ' Forature e fresature - Else - Mach.m_nInterf = FMI_TYPE.NONE - Mach.m_dSideAng = 0 - Mach.m_bCanStartAll = False - Mach.m_bCanEndAll = False - Mach.m_bStartAll = False - Mach.m_bEndAll = False - End If - ' abilitazione - Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF) - ' pausa - Mach.m_bPause = GetPause(nOperId) - ' inserisco in lista - MachSplitList.Add(Mach) - ' altrimenti la disattivo - Else - EgtSetOperationMode(nOperId, False) - End If End If nOperId = EgtGetNextOperation(nOperId) End While Return True End Function + Friend Function CreateMach(ByRef Mach As SplitMach, nOperId As Integer) As Boolean + Dim bOk As Boolean = True + ' se appartiene ad un grezzo attivo la inserisco in lista + If IsMachiningInActiveRaw(nOperId) Then + Mach.m_nEntId = GDB_ID.NULL + ' identificativo + Mach.m_nId = nOperId + ' eventuali lavorazioni inglobate + Dim sInfo As String = String.Empty + If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then + Dim sItems() As String = sInfo.Split(",".ToCharArray) + For Each sId As String In sItems + Dim nId As Integer = 0 + StringToInt(sId, nId) + If nId > 0 Then Mach.m_vOthId.Add(nId) + Next + End If + ' tipo + Mach.m_nType = EgtGetOperationType(nOperId) + ' layer di origine + EgtGetInfo(nOperId, INFO_MCH_LAYER, Mach.m_sLay) + ' se taglio con lama + If Mach.m_nType = MCH_OY.SAWING Then + ' verifica interferenza + If Mach.m_sLay = NAME_OUTLOOP Then + EgtVerifyMachining(nOperId, Mach.m_nInterf) + For Each nId As Integer In Mach.m_vOthId + Dim nRes As Integer = FMI_TYPE.LI Or FMI_TYPE.RM Or FMI_TYPE.LO + EgtVerifyMachining(nId, nRes) + Mach.m_nInterf = Mach.m_nInterf Or nRes + Next + Else + Mach.m_nInterf = FMI_TYPE.NONE + End If + ' la imposto come lavorazione corrente + EgtSetCurrMachining(nOperId) + ' inversione + EgtGetMachiningParam(MCH_MP.INVERT, Mach.m_bInvert) + ' recupero l'angolo di fianco + EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng) + ' 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) + ' recupero tipo entità, angolo con entità precedente e successiva, lunghezze libere iniziale e finale + Mach.m_bIsLine = True + Mach.m_dPrevAng = 0 + Mach.m_dNextAng = 0 + Mach.m_dStartFreeLen = FREELEN_INF + 1 + Mach.m_dEndFreeLen = FREELEN_INF + 1 + Dim nEntId, nSub As Integer + If EgtGetMachiningGeometry(0, nEntId, nSub) Then + ' EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse + If EgtGetType(nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False + EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_PREVANG, INFO_NEXTANG), Mach.m_dPrevAng) + EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_NEXTANG, INFO_PREVANG), Mach.m_dNextAng) + EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen) + EgtGetInfo(nEntId, If(Not Mach.m_bInvert, INFO_END_FREELEN, INFO_START_FREELEN), Mach.m_dEndFreeLen) + Mach.m_bEnableInvert = GetEnableInvert(nEntId) + EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir) + If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir + Mach.m_nEntId = nEntId + EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner) + End If + ' verifico se trasformabile in un taglio di separazione (almeno da un lato) + If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And + Mach.m_sLay = NAME_OUTLOOP And (Mach.m_nInterf And FMI_TYPE.RM) = 0 Then + Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId) + Dim bIn As Boolean = False + Dim bOut As Boolean = False + CanExtendSides(Mach, bIn, bOut) + Mach.m_bCanStartAll = ((dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LI_OK) <> 0) And + Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn + Mach.m_bCanEndAll = ((dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LO_OK) <> 0) And + Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut + If nRes = 0 Then + EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.") + End If + + ElseIf (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And + Mach.m_sLay = NAME_OUTLOOP And + (Mach.m_nInterf = FMI_TYPE.LI Or Mach.m_nInterf = FMI_TYPE.LO Or Mach.m_nInterf = FMI_TYPE.RM) Then + Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId) + Dim bIn As Boolean = False + Dim bOut As Boolean = False + CanExtendSides(Mach, bIn, bOut) + ' And (nRes And CAR_RES.LI_OK) <> 0 : da aggiungere + Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And + Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn And + Mach.m_nInterf <> FMI_TYPE.LI + ' And (nRes And CAR_RES.LO_OK) <> 0 : da aggiungere come sopra + Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And + Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut And + Mach.m_nInterf <> FMI_TYPE.LO + If nRes = 0 Then + EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.") + End If + 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_CENT Or nLoType = MCH_SAW_LO.EXT_OUT) + Else + Mach.m_bStartAll = False + Mach.m_bEndAll = False + End If + ' Waterjet + ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then + Mach.m_nInterf = FMI_TYPE.NONE + ' recupero l'angolo di fianco + EgtGetMachiningParam(MCH_MP.SIDEANGLE, Mach.m_dSideAng) + Mach.m_bCanStartAll = False + Mach.m_bCanEndAll = False + Mach.m_bStartAll = False + Mach.m_bEndAll = False + ' Forature e fresature + Else + Mach.m_nInterf = FMI_TYPE.NONE + Mach.m_dSideAng = 0 + Mach.m_bCanStartAll = False + Mach.m_bCanEndAll = False + Mach.m_bStartAll = False + Mach.m_bEndAll = False + End If + ' abilitazione + Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF) + ' pausa + Mach.m_bPause = GetPause(nOperId) + Else + ' altrimenti la disattivo + EgtSetOperationMode(nOperId, False) + bOk = False + End If + Return bOk + End Function + Private Function CanExtendSides(CurrMach As SplitMach, ByRef bIn As Boolean, ByRef bOut As Boolean) As Boolean If CurrMach.m_dPrevAng < -EPS_ANG_SMALL And CurrMach.m_dNextAng > EPS_ANG_SMALL Then ' Posso estendere SOLO l'uscita diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index bb138f8..f0bf8d9 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -470,6 +470,73 @@ Public Class SplitPageUC Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene ' Verifico di essere il gestore attivo e non in modalità sola visualizzazione If Not m_bActive OrElse m_bShow Then Return + + If e.Button = Windows.Forms.MouseButtons.Right And m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then + Dim nCurrCtx As Integer = EgtGetCurrentContext() + Dim nSel1 As Integer + Dim nPvId As Integer + Dim nMchId As Integer + EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel1) + Dim nId1 As Integer = EgtGetFirstObjInSelWin() + While nId1 <> GDB_ID.NULL + ' Verifico sia un attacco o uscita di taglio con lama + Dim nType As Integer = 0 + Dim sName As String = "" + EgtGetName(nId1, sName) + nPvId = EgtGetParent(EgtGetParent(nId1)) + nMchId = GDB_ID.NULL + If String.Compare(sName, NAME_PV_PRECUT) = 0 Or String.Compare(sName, NAME_PV_POSTCUT) = 0 Or String.Compare(sName, NAME_PV_CUT) = 0 Then + If EgtGetInfo(nPvId, "MId", nMchId) Then + Exit While + End If + If m_nSelected >= 0 Then Exit While + End If + nId1 = EgtGetNextObjInSelWin() + End While + + ' eventualmente recupero il nome della lavorazione + EgtGetInfo(nPvId, "MId", nMchId) + Dim sSawing As String = String.Empty + Dim EntId As Integer = GDB_ID.NULL + Dim SubEntId As Integer = GDB_ID.NULL + EgtSetCurrMachining(nMchId) + If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return + ' Eventualmente recupero il nome della lavorazione + EgtGetInfo(EntId, "Def_Machining", sSawing) + + ' Apro pagina di selezione della lavorazione prima di chiudere il grezzo + Dim m_ChangeToolPage = New ChangeToolWD(m_MainWindow) + ' Imposto la lavorazione corrente selezionata + m_ChangeToolPage.CurrSawing = sSawing + + ' apro la finestra per la selezione delle lavorazioni + m_ChangeToolPage.ShowDialog() + ' se seleziono "Ok" allora resetto tutte le lavorazioni del progetto + If m_ChangeToolPage.DialogResult Then + EgtSetInfo(EntId, "Def_Machining", m_ChangeToolPage.NewSawing) + Dim Index As Integer = 0 + For Index = 0 To m_MachiningList.Count() - 1 + If m_MachiningList(Index).m_nId = nMchId Then + Exit For + End If + Next + Dim nNewMchId As Integer = -1 + AddSawMachining(nMchId, nNewMchId) + Dim Mach As New SplitMach + If SplitAuto.CreateMach(Mach, nNewMchId) Then + ' ricalcolo la lavorazione + m_MachiningList(Index) = Mach + ' Recupero il colore della lavorazione + '... + ' Assegno un colore alla lavorazione + ColorsCut(nNewMchId, New Color3d(255, 0, 0)) + EgtDraw() + + End If + End If + Return + End If + ' Si può selezionare solo con il tasto sinistro e se stato NULL If e.Button <> Windows.Forms.MouseButtons.Left Or Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then @@ -586,6 +653,24 @@ Public Class SplitPageUC End If End Sub + ' Dato l'id della lavorazione nel grezzo colora il taglio del colore assegnato + Public Sub ColorsCut(nOperId As Integer, EgtCol As Color3d) + ' Recupero la lavorazione + Dim nPVRawId As Integer = EgtGetFirstNameInGroup(nOperId, "PV") + Dim nPVPartId As Integer = GDB_ID.NULL + EgtGetInfo(nPVRawId, "PvId", nPVPartId) + Dim nId2 As Integer = EgtGetFirstInGroup(EgtGetFirstInGroup(nPVPartId)) + Dim sName As String = "" + EgtGetName(nId2, sName) + While nId2 <> GDB_ID.NULL + If String.Compare(sName, NAME_PV_CUT) = 0 Then + EgtSetColor(nId2, EgtCol) + Exit While + End If + nId2 = EgtGetNext(nId2) + End While + End Sub + Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene ' Verifico di essere il gestore attivo e non in modalità sola visualizzazione If Not m_bActive OrElse m_bShow Then Return diff --git a/Machine/AlarmsPageUC.xaml.vb b/Machine/AlarmsPageUC.xaml.vb index 23f781e..ad5650c 100644 --- a/Machine/AlarmsPageUC.xaml.vb +++ b/Machine/AlarmsPageUC.xaml.vb @@ -159,7 +159,7 @@ Public Class AlarmsPageUC HolesGpBx.Visibility = Windows.Visibility.Hidden Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL 'Non faccio alcunchè - Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER + Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW 'Da implementare End Select @@ -292,6 +292,47 @@ Public Class AlarmsPageUC ' attivo il bottone per l'apertura della pagina che mostra la configurazione degli utensili in parcheggio SetUpBtn.Visibility = Windows.Visibility.Visible + Case CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW + ' Aggiorno la lista delle lame con quelle montate sul portautensile automatico + Dim m_SawOnHolderList As New ObservableCollection(Of String) + Dim bOnHolder As Boolean = False + For Each sNameTool As String In m_SawList + If Not String.IsNullOrEmpty(sNameTool) Then + ' Verifico che sia montata su un portautensile + EgtTdbSetCurrTool(sNameTool) + Dim sTCPos As String = String.Empty + EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos) + If Not String.IsNullOrEmpty(sTCPos) Then + ' Cerco nel porta utensili automaitico + For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger + If ToolPosition.sTool <> String.Empty Then + If sNameTool = ToolPosition.sTool Then + m_SawOnHolderList.Add(sNameTool) + ' Se il nome dell'utensile è lo stesso di quello impostato nella combo allora lo setto + If sNameTool = m_CurrentMachine.sCurrSaw Then + bOnHolder = True + End If + Exit For + End If + End If + Next + End If + End If + Next + m_SawList = m_SawOnHolderList + CurrSawCmBx.ItemsSource = m_SawList + If bOnHolder Then + ' reimposto la lavorazione di lama e la lama impostate in macchina + EgtTdbSetCurrTool(m_CurrentMachine.sCurrSaw) + ' Seleziono lama corrente + CurrSawCmBx.SelectedItem = m_CurrentMachine.sCurrSaw + Else + m_CurrentMachine.sCurrSawing = "" + End If + + ' attivo il bottone per l'apertura della pagina che mostra la configurazione degli utensili in parcheggio + SetUpBtn.Visibility = Windows.Visibility.Visible + End Select ' aggiorno le TextBlock con le lavorazioni correnti @@ -1375,7 +1416,7 @@ 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 + 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 1918cea..b3569c0 100644 --- a/Machine/ChooseToolWD.xaml.vb +++ b/Machine/ChooseToolWD.xaml.vb @@ -76,6 +76,18 @@ Public Class ChooseToolWD End If Next Return True + 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)) + 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)) + End If + Next + Return True Case Else Return False End Select diff --git a/Machine/CurrentMachine.vb b/Machine/CurrentMachine.vb index e4d9c5b..67902d2 100644 --- a/Machine/CurrentMachine.vb +++ b/Machine/CurrentMachine.vb @@ -193,6 +193,7 @@ Public Class CurrentMachine SAWANDAUXTOOL = 1 MANUALTOOLCHANGER = 2 TOOLCHANGER = 3 + TOOLCHANGERWITHSAW = 4 End Enum ' Massimo numero di utensili su Tc diff --git a/Machine/SetUpPage.xaml.vb b/Machine/SetUpPage.xaml.vb index e53aa6c..a671d9e 100644 --- a/Machine/SetUpPage.xaml.vb +++ b/Machine/SetUpPage.xaml.vb @@ -3,6 +3,7 @@ Imports System.ComponentModel Imports OmagCUT.TreeViewItem Imports EgtUILib Imports EgtWPFLib +Imports EgtWPFLib5 Public Class SetUpPage @@ -13,6 +14,7 @@ Public Class SetUpPage Private m_CurrMachine As CurrentMachine = m_MainWindow.m_CurrentMachine Private m_ToolTreeList As New ObservableCollection(Of CathegoryItem) + Private m_SawsList As CathegoryItem Private m_DrillbitsList As CathegoryItem Private m_MillsList As CathegoryItem Private m_CupsList As CathegoryItem @@ -26,10 +28,10 @@ Public Class SetUpPage ' Assegno la lista utensili come sorgente dell'albero ToolTree.ItemsSource = m_ToolTreeList - If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then + If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then '' Cambio utensile macchina ' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina - Dim ColNum As Integer = CInt( Math.Ceiling( m_CurrMachine.ToolChangerNbr / 5.0)) + Dim ColNum As Integer = CInt(Math.Ceiling(m_CurrMachine.ToolChangerNbr / 5.0)) If ColNum > 12 Then EgtOutLog("TC warning : too many tools (max 12 * 5)") ColNum = 12 @@ -59,11 +61,11 @@ Public Class SetUpPage '' Cambio utensile manuale ' Modifico numero colonne della griglia in base al numero di porta utensili disponibili sulla macchina - Dim ManColNum As Integer = CInt( Math.Ceiling( m_CurrMachine.ManualToolChangerNbr / 5.0)) - If ManColNum > 12 Then - EgtOutLog("ManTC warning : too many tools (max 12 * 5)") - ManColNum = 12 - End If + Dim ManColNum As Integer = CInt(Math.Ceiling(m_CurrMachine.ManualToolChangerNbr / 5.0)) + If ManColNum > 12 Then + EgtOutLog("ManTC warning : too many tools (max 12 * 5)") + ManColNum = 12 + End If For Index As Integer = 12 To ManColNum + 1 Step -1 For Index2 As Integer = Index * 5 To (Index - 1) * 5 + 1 Step -1 ManTlChGrid.Children.Remove(GetManTlChPosFromIndex(Index2)) @@ -85,7 +87,7 @@ Public Class SetUpPage Next ' Se portautensili della macchina presente - If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then + If m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or m_CurrMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then ' Apro quello TlChScVw.Visibility = Windows.Visibility.Visible ToolChangerBtn.IsChecked = True @@ -106,15 +108,25 @@ Public Class SetUpPage Private Sub SetUpPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded ' Inizializzo le famiglie di utensili nell'albero EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()) - InitializeToolGroup( m_CurrMachine.bDrill, MCH_TY.DRILL_STD, EgtMsg( 90752), m_DrillbitsList) - InitializeToolGroup( m_CurrMachine.bMill, MCH_TY.MILL_STD, EgtMsg( 90753), m_MillsList) - InitializeToolGroup( m_CurrMachine.bCupWheel, MCH_TY.MILL_NOTIP, EgtMsg( 90754), m_CupsList) - InitializeToolGroup( m_CurrMachine.bPolishingWheel, MCH_TY.MILL_POLISHING, EgtMsg( 90756), m_PolishingsList) + If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then InitializeToolGroup(m_CurrMachine.bSaw, MCH_TY.SAW_STD, EgtMsg(90751), m_SawsList) + InitializeToolGroup(m_CurrMachine.bDrill, MCH_TY.DRILL_STD, EgtMsg(90752), m_DrillbitsList) + InitializeToolGroup(m_CurrMachine.bMill, MCH_TY.MILL_STD, EgtMsg(90753), m_MillsList) + InitializeToolGroup(m_CurrMachine.bCupWheel, MCH_TY.MILL_NOTIP, EgtMsg(90754), m_CupsList) + InitializeToolGroup(m_CurrMachine.bPolishingWheel, MCH_TY.MILL_POLISHING, EgtMsg(90756), m_PolishingsList) ' Posiziono utensili già posizionati sul portautensili For Each ToolPosition As ToolChangerPos In m_CurrMachine.ToolChanger If ToolPosition.sTool <> String.Empty Then - If Not IsNothing( m_DrillbitsList) Then + If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW AndAlso Not IsNothing(m_SawsList) Then + For Each Item As CustomItem In m_SawsList.Items + If Item.Name = ToolPosition.sTool Then + m_SetUpToolsList.Items.Add(Item) + m_SawsList.Items.Remove(Item) + Exit For + End If + Next + End If + If Not IsNothing(m_DrillbitsList) Then For Each Item As CustomItem In m_DrillbitsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) @@ -123,7 +135,7 @@ Public Class SetUpPage End If Next End If - If Not IsNothing( m_MillsList) Then + If Not IsNothing(m_MillsList) Then For Each Item As CustomItem In m_MillsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) @@ -132,7 +144,7 @@ Public Class SetUpPage End If Next End If - If Not IsNothing( m_CupsList) Then + If Not IsNothing(m_CupsList) Then For Each Item As CustomItem In m_CupsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) @@ -141,7 +153,7 @@ Public Class SetUpPage End If Next End If - If Not IsNothing( m_PolishingsList) Then + If Not IsNothing(m_PolishingsList) Then For Each Item As CustomItem In m_PolishingsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) @@ -158,7 +170,7 @@ Public Class SetUpPage ' Posiziono utensili già posizionati sul portautensili manuale For Each ToolPosition As ToolChangerPos In m_CurrMachine.ManualToolChanger If ToolPosition.sTool <> String.Empty Then - If Not IsNothing( m_DrillbitsList) Then + If Not IsNothing(m_DrillbitsList) Then For Each Item As CustomItem In m_DrillbitsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) @@ -167,7 +179,7 @@ Public Class SetUpPage End If Next End If - If Not IsNothing( m_MillsList) Then + If Not IsNothing(m_MillsList) Then For Each Item As CustomItem In m_MillsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) @@ -176,7 +188,7 @@ Public Class SetUpPage End If Next End If - If Not IsNothing( m_CupsList) Then + If Not IsNothing(m_CupsList) Then For Each Item As CustomItem In m_CupsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) @@ -185,7 +197,7 @@ Public Class SetUpPage End If Next End If - If Not IsNothing( m_PolishingsList) Then + If Not IsNothing(m_PolishingsList) Then For Each Item As CustomItem In m_PolishingsList.Items If Item.Name = ToolPosition.sTool Then m_SetUpToolsList.Items.Add(Item) @@ -710,16 +722,16 @@ Public Class SetUpPage End Function ' Funzione che carica gli utensili del Db nell'albero - Friend Sub InitializeToolGroup( bEnabled As Boolean, nTType As Integer, sFName As String, ByRef ToolCathegory As CathegoryItem) + Friend Sub InitializeToolGroup(bEnabled As Boolean, nTType As Integer, sFName As String, ByRef ToolCathegory As CathegoryItem) If Not bEnabled Then Return ' Inserisco categoria ed eventuali elementi - ToolCathegory = New CathegoryItem( sFName, nTType) + ToolCathegory = New CathegoryItem(sFName, nTType) Dim nType As Integer = 0 Dim ToolName As String = String.Empty - Dim bFound As Boolean = EgtTdbGetFirstTool( nTType, ToolName, nType) + Dim bFound As Boolean = EgtTdbGetFirstTool(nTType, ToolName, nType) While bFound - If nType = nTType Then ToolCathegory.Items.Add( New CustomItem( ToolName, nType)) - bFound = EgtTdbGetNextTool( nTType, ToolName, nType) + If nType = nTType Then ToolCathegory.Items.Add(New CustomItem(ToolName, nType)) + bFound = EgtTdbGetNextTool(nTType, ToolName, nType) End While m_ToolTreeList.Add(ToolCathegory) End Sub @@ -761,7 +773,7 @@ Public Class SetUpPage ToolHolderClicked.Tool.IsChecked = False GetTxBxFromTlChPos(ToolHolderClicked.Name).Text = String.Empty End If - ' altrimenti da levare + ' altrimenti da levare Else RestoreToolInList(GetTxBxFromTlChPos(ToolHolderClicked.Name).Text) GetTxBxFromTlChPos(ToolHolderClicked.Name).Text = String.Empty @@ -771,14 +783,17 @@ Public Class SetUpPage ' Funzione che rimuove l'utensile selezionato dall'albero Private Sub RemoveToolFromList() - If Not IsNothing( m_DrillbitsList) AndAlso m_DrillbitsList.Items.Contains( ToolTree.SelectedItem) Then - m_DrillbitsList.Items.Remove( ToolTree.SelectedItem) - ElseIf Not IsNothing( m_MillsList) AndAlso m_MillsList.Items.Contains( ToolTree.SelectedItem) Then - m_MillsList.Items.Remove( ToolTree.SelectedItem) - ElseIf Not IsNothing( m_CupsList) AndAlso m_CupsList.Items.Contains( ToolTree.SelectedItem) Then - m_CupsList.Items.Remove( ToolTree.SelectedItem) - ElseIf Not IsNothing( m_PolishingsList) AndAlso m_PolishingsList.Items.Contains( ToolTree.SelectedItem) Then - m_PolishingsList.Items.Remove( ToolTree.SelectedItem) + If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW AndAlso + Not IsNothing(m_SawsList) AndAlso m_SawsList.Items.Contains(ToolTree.SelectedItem) Then + m_SawsList.Items.Remove(ToolTree.SelectedItem) + ElseIf Not IsNothing(m_DrillbitsList) AndAlso m_DrillbitsList.Items.Contains(ToolTree.SelectedItem) Then + m_DrillbitsList.Items.Remove(ToolTree.SelectedItem) + ElseIf Not IsNothing(m_MillsList) AndAlso m_MillsList.Items.Contains(ToolTree.SelectedItem) Then + m_MillsList.Items.Remove(ToolTree.SelectedItem) + ElseIf Not IsNothing(m_CupsList) AndAlso m_CupsList.Items.Contains(ToolTree.SelectedItem) Then + m_CupsList.Items.Remove(ToolTree.SelectedItem) + ElseIf Not IsNothing(m_PolishingsList) AndAlso m_PolishingsList.Items.Contains(ToolTree.SelectedItem) Then + m_PolishingsList.Items.Remove(ToolTree.SelectedItem) End If End Sub @@ -786,7 +801,9 @@ Public Class SetUpPage Private Sub RestoreToolInList(sToolName As String) For Each Tool As CustomItem In m_SetUpToolsList.Items If Tool.Name = sToolName Then - If Tool.nType = MCH_TY.DRILL_STD Then + If Tool.nType = MCH_TY.SAW_STD Then + m_SawsList.Items.Add(Tool) + ElseIf Tool.nType = MCH_TY.DRILL_STD Then m_DrillbitsList.Items.Add(Tool) ElseIf Tool.nType = MCH_TY.MILL_STD Then m_MillsList.Items.Add(Tool) @@ -1131,7 +1148,7 @@ Public Class SetUpPage RemoveToolFromList() Else ' Altrimenti segnalo che la posizione è già occupata - Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg( 90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION) + Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg(90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION) End If Return End If @@ -1149,7 +1166,7 @@ Public Class SetUpPage RemoveToolFromList() Else ' Altrimenti segnalo che la posizione è già occupata - Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg( 90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION) + Dim InfoMsgBox As New EgtMsgBox(m_MainWindow, "", EgtMsg(90759), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.ESCLAMATION) End If Return End If diff --git a/Machine/ToolChangerPosUC.xaml b/Machine/ToolChangerPosUC.xaml index adcab91..f524630 100644 --- a/Machine/ToolChangerPosUC.xaml +++ b/Machine/ToolChangerPosUC.xaml @@ -18,7 +18,7 @@ - + diff --git a/OmagCUT.vbproj b/OmagCUT.vbproj index e8ac517..374489b 100644 --- a/OmagCUT.vbproj +++ b/OmagCUT.vbproj @@ -177,6 +177,9 @@ ChooseTestToolWD.xaml + + ChangeToolWD.xaml + SelectPartFromFamilyWD.xaml @@ -454,6 +457,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/RawPhoto/ChooseMachining.xaml.vb b/RawPhoto/ChooseMachining.xaml.vb index 453a482..7a828b1 100644 --- a/RawPhoto/ChooseMachining.xaml.vb +++ b/RawPhoto/ChooseMachining.xaml.vb @@ -78,7 +78,7 @@ Public Class ChooseMachining ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningTxBl) ChooseMachiningGrid.Children.Remove(AuxiliaryMachiningCmBx) - Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER + Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW ' Creo lista lavorazioni foretto e fresa If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then CreateMachiningList(MCH_MY.DRILLING, m_CurrentMachine.sCurrDrill, m_DrillingList) @@ -114,7 +114,10 @@ Public Class ChooseMachining ' ---- MACCHINA CON CAMBIO UTENSILE ---- ElseIf m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or - m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then + m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or + m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then + ' -- TAGLIO -- + ' Il taglio è aggiunto sempre (all'inizio di questo metodo) ' -- FORATURA -- CreateMachiningList(MCH_MY.DRILLING, m_DrillingList) ' Se la lista è vuota cancello la lavorazione corrente di questo tipo @@ -206,7 +209,8 @@ Public Class ChooseMachining m_AuxMachTypeList.Add(New StringIdCmBx(4, EgtMsg(91069))) End If If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER Or - m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Then + m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGER Or + m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then m_AuxMachTypeList.Add(New StringIdCmBx(3, EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 8))) End If End If diff --git a/RawPhoto/RawPartPageUC.xaml.vb b/RawPhoto/RawPartPageUC.xaml.vb index 739a521..2ed251b 100644 --- a/RawPhoto/RawPartPageUC.xaml.vb +++ b/RawPhoto/RawPartPageUC.xaml.vb @@ -8,7 +8,7 @@ Imports Microsoft.VisualBasic.Devices Public Class RawPartPageUC ' Dati generali CN - Friend m_CN As CN_generico + ' Friend m_CN As CN_generico ' Riferimento alla MainWindow Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) @@ -2305,7 +2305,7 @@ Public Class RawPartPageUC Private Sub ManualModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualModeBtn.Click ' Imposto modalità manuale della macchina - Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale + Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale End Sub diff --git a/Simulation/SimulationPageUC.xaml.vb b/Simulation/SimulationPageUC.xaml.vb index fe9a92c..cef48f2 100644 --- a/Simulation/SimulationPageUC.xaml.vb +++ b/Simulation/SimulationPageUC.xaml.vb @@ -477,7 +477,8 @@ Public Class SimulationPageUC Private Function LoadCurrTools() As Boolean ' Se macchina senza cambio utensile automatico devo caricare gli utensili - If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGER Then + If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGER Or + m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then ' Imposto la lama corrente Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw If Not EgtLoadTool("H1", 1, sSaw) Then Return False From 61b16af7469f0e32b46b0badca2d5c55c596d4ae Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Tue, 4 Mar 2025 11:19:42 +0100 Subject: [PATCH 02/27] Lettura colore lavorazione da SystemNotes --- CadCuts/ChangeToolWD.xaml.vb | 36 +++++++++++++++++++++--------------- CadCuts/SplitPageUC.xaml.vb | 4 ++-- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/CadCuts/ChangeToolWD.xaml.vb b/CadCuts/ChangeToolWD.xaml.vb index 114ccfc..0d0af69 100644 --- a/CadCuts/ChangeToolWD.xaml.vb +++ b/CadCuts/ChangeToolWD.xaml.vb @@ -21,6 +21,14 @@ Public Class ChangeToolWD End Get End Property + ' Il colore della lavorazione + Private m_EgtColor As New Color3d + Public ReadOnly Property EgtColor As Color3d + Get + Return m_EgtColor + End Get + End Property + Private m_CurrSawing As String = String.Empty Public Property CurrSawing As String Get @@ -177,11 +185,9 @@ Public Class ChangeToolWD If sNameTool = ToolPosition.sTool Then ' Verifico che il materiale e lo spessore If VerifyCurrMachiningMaterial() Then - Dim local_ItemMachining = New ItemMachining(Item.Name, sNameTool, sTCPos) - local_ItemMachining.ColorSawing = GetColorPV() - m_SetUpMachiningList.Add(local_ItemMachining) + m_EgtColor = GetColorPV() + m_SetUpMachiningList.Add(New ItemMachining(Item.Name, sNameTool, sTCPos)) End If - Exit For End If End If @@ -201,7 +207,17 @@ Public Class ChangeToolWD EgtTdbGetCurrToolParam(MCH_TP.SYSNOTES, ToolString) EgtTdbGetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", ToolColor) Dim sItems As String() = ToolColor.Split(","c) - Return New Color3d(CInt(sItems(0)), CInt(sItems(1)), CInt(sItems(2))) + ' Verifico che siano almeno 3 campi + If sItems.Count < 3 Then + Return New Color3d(0, 255, 0) + Else + ' Verifico che tutti i campi siano numerici + If IsNumeric(sItems(0)) And IsNumeric(sItems(1)) And IsNumeric(sItems(2)) Then + Return New Color3d(CInt(sItems(0)), CInt(sItems(1)), CInt(sItems(2))) + Else + Return New Color3d(0, 255, 0) + End If + End If End Function ' verifico l'utensile corrente (impostato nella funzione chiamante) se puù lavorare il grezzo corrente @@ -359,16 +375,6 @@ Public Class ItemMachining End Set End Property - Private m_ColorSawing As New Color3d - Public Property ColorSawing As Color3d - Get - Return m_ColorSawing - End Get - Set(value As Color3d) - m_ColorSawing = value - End Set - End Property - Sub New(sMachining As String, sToolName As String, sToolPos As String) m_Machining = sMachining m_ToolPos = sToolPos diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index f0bf8d9..40eec69 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -527,9 +527,9 @@ Public Class SplitPageUC ' ricalcolo la lavorazione m_MachiningList(Index) = Mach ' Recupero il colore della lavorazione - '... + Dim EgtCol As Color3d = m_ChangeToolPage.EgtColor ' Assegno un colore alla lavorazione - ColorsCut(nNewMchId, New Color3d(255, 0, 0)) + ColorsCut(nNewMchId, EgtCol) EgtDraw() End If From 9616e211e558954ffe74dd0c5a37c7385f438a55 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 4 Mar 2025 11:20:46 +0100 Subject: [PATCH 03/27] -aggiunto seleziona colore lavorazione --- Machine/ToolsDbPageUC.xaml | 6 +++++ Machine/ToolsDbPageUC.xaml.vb | 51 ++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/Machine/ToolsDbPageUC.xaml b/Machine/ToolsDbPageUC.xaml index af2ef00..632f9b2 100644 --- a/Machine/ToolsDbPageUC.xaml +++ b/Machine/ToolsDbPageUC.xaml @@ -395,6 +395,12 @@ + + + - - + + - + @@ -138,7 +159,7 @@ - + @@ -152,17 +173,17 @@ - + - + - + diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index 40eec69..3b87445 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -206,24 +206,34 @@ Public Class SplitPageUC sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°" End If If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING)) + Dim sSawing As String = String.Empty, sSaw As String = String.Empty + GetCurrSawingandSaw(Mach.m_nId, sSawing, sSaw) + ' Verifico che sia montata su un portautensile + EgtTdbSetCurrTool(sSaw) + Dim sTCPos As String = String.Empty + EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos) + If String.IsNullOrEmpty(sTCPos) Then + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING)) + Else + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING, sTCPos)) + End If ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura Dim sText As String = EgtMsg(90792) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING)) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING, "Pippo")) ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura Dim sText As String = EgtMsg(90793) & " " & i.ToString() If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText) If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING)) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING, "Pippo")) ElseIf Mach.m_nType = MCH_OY.POCKETING Then ' Svuotatura Dim sText As String = EgtMsg(90796) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING)) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING, "Pippo")) ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then ' Waterjet Dim sText As String = EgtMsg(90797) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING)) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING, "Pippo")) End If Next End Sub @@ -653,6 +663,20 @@ Public Class SplitPageUC End If End Sub + Public Sub GetCurrSawingandSaw(ByVal nMchId As Integer, ByRef sSawing As String, ByRef sNameTool As String) + Dim EntId As Integer = GDB_ID.NULL + Dim SubEntId As Integer = GDB_ID.NULL + EgtSetCurrMachining(nMchId) + If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return + ' Eventualmente recupero il nome della lavorazione + EgtGetInfo(EntId, "Def_Machining", sSawing) + If String.IsNullOrEmpty(sSawing) Then sSawing = m_MainWindow.m_CurrentMachine.sCurrSawing + ' Imposto la lavorazione corrente + EgtMdbSetCurrMachining(sSawing) + ' Recupero il nome dell'utensile della lavorazione + EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sNameTool) + End Sub + ' Dato l'id della lavorazione nel grezzo colora il taglio del colore assegnato Public Sub ColorsCut(nOperId As Integer, EgtCol As Color3d) ' Recupero la lavorazione @@ -2751,6 +2775,8 @@ Public Class SplitPageUC Private m_sName As String Private m_bIsActive As Boolean Private m_nType As Integer + ' Posizione porta utensile (parametro non obbligatorio) + Private m_sTCPos As String = "" Private m_IsSelected As Boolean @@ -2775,6 +2801,19 @@ Public Class SplitPageUC End Set End Property + '!!!!!!!!!!!!!!!!!!!! + Public Property TCPos As String + Get + Return m_sTCPos + End Get + Set(value As String) + If value <> m_sTCPos Then + m_sTCPos = value + NotifyPropertyChanged("TCPos") + End If + End Set + End Property + Public Property bIsActive As Boolean Get Return m_bIsActive @@ -2812,6 +2851,14 @@ Public Class SplitPageUC Me.m_nType = nType End Sub + Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer, sTCPos As String) + Me.m_sName = Name + Me.m_nInd = Ind + Me.m_bIsActive = bIsActive + Me.m_nType = nType + Me.m_sTCPos = sTCPos + End Sub + Public Sub NotifyPropertyChanged(propName As String) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) End Sub From e54c5f006e1fc0d955dac06acdd611062caa6e57 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Tue, 4 Mar 2025 15:47:07 +0100 Subject: [PATCH 06/27] Migliorate alcune funzioni --- CadCuts/ChangeToolWD.xaml.vb | 6 +++--- CadCuts/SplitAuto.vb | 6 ++++++ Machine/ToolsDbPageUC.xaml | 6 +++--- Machine/ToolsDbPageUC.xaml.vb | 18 ++++++------------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CadCuts/ChangeToolWD.xaml.vb b/CadCuts/ChangeToolWD.xaml.vb index 93a6884..29a20b3 100644 --- a/CadCuts/ChangeToolWD.xaml.vb +++ b/CadCuts/ChangeToolWD.xaml.vb @@ -208,13 +208,13 @@ Public Class ChangeToolWD Dim sItems As String() = ToolColor.Split(","c) ' Verifico che siano almeno 3 campi If sItems.Count < 3 Then - Return New Color3d(0, 255, 0) + Return New Color3d(0, 255, 0, 100) Else ' Verifico che tutti i campi siano numerici If IsNumeric(sItems(0)) And IsNumeric(sItems(1)) And IsNumeric(sItems(2)) Then - Return New Color3d(CInt(sItems(0)), CInt(sItems(1)), CInt(sItems(2))) + Return New Color3d(CInt(sItems(0)), CInt(sItems(1)), CInt(sItems(2)), 100) Else - Return New Color3d(0, 255, 0) + Return New Color3d(0, 255, 0, 100) End If End If End Function diff --git a/CadCuts/SplitAuto.vb b/CadCuts/SplitAuto.vb index 60ee6aa..1da1cdb 100644 --- a/CadCuts/SplitAuto.vb +++ b/CadCuts/SplitAuto.vb @@ -430,6 +430,12 @@ Public Module SplitAuto Else colCut = COL_MCH_CUT() End If + ' Se macchina con cambio utensile anche per lama + If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then + ' recupero il colore della lavorazione direttamente dall'utensile + ChangeToolWD.GetColorPV() + End If + For Each nId In vCutId EgtSetColor(nId, colCut) Next diff --git a/Machine/ToolsDbPageUC.xaml b/Machine/ToolsDbPageUC.xaml index 4979518..6b11c46 100644 --- a/Machine/ToolsDbPageUC.xaml +++ b/Machine/ToolsDbPageUC.xaml @@ -420,7 +420,7 @@ - + @@ -428,14 +428,14 @@ - + - + diff --git a/Machine/ToolsDbPageUC.xaml.vb b/Machine/ToolsDbPageUC.xaml.vb index c10596e..8cf92cd 100644 --- a/Machine/ToolsDbPageUC.xaml.vb +++ b/Machine/ToolsDbPageUC.xaml.vb @@ -83,7 +83,7 @@ Public Class ToolsDbPageUC CodeTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 27) ' Code SupplierTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 28) ' Supplier EndLifeTxBl.Text = EgtMsg(MSG_TOOLSDBPAGEUC + 29) ' End Life - ColorTxBl.Text = EgtMsg(507) ' Colore + ColorTxBl.Text = EgtMsg(91018) ' Colore lavorazione ' Associo TextBox e Label Dim TempLabel1 As New Label @@ -775,7 +775,7 @@ Public Class ToolsDbPageUC UserNotesTxBx.Text = ToolString End If ' Inizializzo colore di default - ColorBtn.Background = New SolidColorBrush(Color.FromArgb(ChangeToolWD.GetColorPV().A, ChangeToolWD.GetColorPV().R, ChangeToolWD.GetColorPV().G, ChangeToolWD.GetColorPV().B)) + ColorBtn.Background = New SolidColorBrush(Color.FromRgb(ChangeToolWD.GetColorPV().R, ChangeToolWD.GetColorPV().G, ChangeToolWD.GetColorPV().B)) End Sub Private Sub SetToolParams() @@ -831,33 +831,28 @@ Public Class ToolsDbPageUC If Not SetSpecials() Then EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, UserNotesTxBx.Text) End If - ColorToString(ColorBtn.Background.ToString()) + EgtTdbSetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", ColorToString(ColorBtn.Background.ToString())) End Sub - Private Sub ColorToString(color As String) + Private Function ColorToString(color As String) As String Dim colorCut As Color = HexToRbgNew(color) - Dim colStr As String = colorCut.R & "," & colorCut.G & "," & colorCut.B - EgtTdbSetCurrToolValInNotes(MCH_TP.SYSNOTES, "COLOR", colStr) - End Sub + Return colorCut.R & "," & colorCut.G & "," & colorCut.B + End Function Public Function HexToRbgNew(ByVal Hex As String) As Color If Hex.StartsWith("#") Then Hex = Hex.Remove(0, 3) End If - Dim red As Byte = CByte(HexadecimalToDecimal(Hex.Substring(0, 2))) Dim green As Byte = CByte(HexadecimalToDecimal(Hex.Substring(2, 2))) Dim blue As Byte = CByte(HexadecimalToDecimal(Hex.Substring(4, 2))) - Return Color.FromArgb(255, red, green, blue) End Function Private Shared Function HexadecimalToDecimal(hex As String) As Integer hex = hex.ToUpper() - Dim hexLength As Integer = hex.Length Dim dec As Double = 0 - For i As Integer = 0 To hexLength - 1 Dim b As Byte = CByte(AscW(hex(i))) If b >= 48 AndAlso b <= 57 Then @@ -867,7 +862,6 @@ Public Class ToolsDbPageUC End If dec += b * Math.Pow(16, ((hexLength - i) - 1)) Next - Return CInt(Math.Truncate(dec)) End Function From 794c5da9e66164eaffda6d5e0e16e4ad9ad5063e Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 4 Mar 2025 15:52:54 +0100 Subject: [PATCH 07/27] -sistemata grafica grid machining --- CadCuts/SplitPageUC.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CadCuts/SplitPageUC.xaml b/CadCuts/SplitPageUC.xaml index ec51f41..15082b6 100644 --- a/CadCuts/SplitPageUC.xaml +++ b/CadCuts/SplitPageUC.xaml @@ -67,9 +67,9 @@ SelectionMode="Extended"> - + - + From c8614fe52d58ee55af42c56f0fb086e64dd1f866 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 4 Mar 2025 16:54:25 +0100 Subject: [PATCH 08/27] -aggiunto label colore lavorazione --- CadCuts/ChangeToolWD.xaml.vb | 8 +++++++ CadCuts/SplitPageUC.xaml | 2 ++ CadCuts/SplitPageUC.xaml.vb | 46 ++++++++++++++++++++++++++---------- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/CadCuts/ChangeToolWD.xaml.vb b/CadCuts/ChangeToolWD.xaml.vb index 29a20b3..aa3c1f9 100644 --- a/CadCuts/ChangeToolWD.xaml.vb +++ b/CadCuts/ChangeToolWD.xaml.vb @@ -29,6 +29,13 @@ Public Class ChangeToolWD End Get End Property + Private m_TCPos As String = String.Empty + Public ReadOnly Property TCPos As String + Get + Return m_TCPos + End Get + End Property + Private m_CurrSawing As String = String.Empty Public Property CurrSawing As String Get @@ -297,6 +304,7 @@ Public Class ChangeToolWD End If m_NewSawing = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).Machining m_EgtColor = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).PrintFootToolColor + m_TCPos = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).ToolPos ' A seconda del tipo OkBtn.IsEnabled = True End Sub diff --git a/CadCuts/SplitPageUC.xaml b/CadCuts/SplitPageUC.xaml index 15082b6..2eb36c5 100644 --- a/CadCuts/SplitPageUC.xaml +++ b/CadCuts/SplitPageUC.xaml @@ -71,6 +71,7 @@ + @@ -102,6 +103,7 @@ + diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index 3b87445..1a45f16 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -206,34 +206,40 @@ Public Class SplitPageUC sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°" End If If Mach.m_bPause Then AddPauseText(sText) - Dim sSawing As String = String.Empty, sSaw As String = String.Empty - GetCurrSawingandSaw(Mach.m_nId, sSawing, sSaw) - ' Verifico che sia montata su un portautensile - EgtTdbSetCurrTool(sSaw) Dim sTCPos As String = String.Empty - EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos) + ' Visualizzo la posizione utensile solo se configurata + If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then + Dim sSawing As String = String.Empty, sSaw As String = String.Empty + GetCurrSawingandSaw(Mach.m_nId, sSawing, sSaw) + ' Verifico che sia montata su un portautensile + EgtTdbSetCurrTool(sSaw) + EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos) + End If If String.IsNullOrEmpty(sTCPos) Then m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING)) Else - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING, sTCPos)) + ' se esiste una lama impostata nell'if sopra + Dim sawColor As Color3d = ChangeToolWD.GetColorPV() + Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(sawColor.R, sawColor.G, sawColor.B) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING, sTCPos, New SolidColorBrush(tmpSawColor))) End If ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura Dim sText As String = EgtMsg(90792) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING, "Pippo")) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING)) ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura Dim sText As String = EgtMsg(90793) & " " & i.ToString() If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText) If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING, "Pippo")) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING)) ElseIf Mach.m_nType = MCH_OY.POCKETING Then ' Svuotatura Dim sText As String = EgtMsg(90796) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING, "Pippo")) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING)) ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then ' Waterjet Dim sText As String = EgtMsg(90797) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING, "Pippo")) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING)) End If Next End Sub @@ -536,12 +542,14 @@ Public Class SplitPageUC If SplitAuto.CreateMach(Mach, nNewMchId) Then ' ricalcolo la lavorazione m_MachiningList(Index) = Mach + m_ItemList(Index).TCPos = m_ChangeToolPage.TCPos ' Recupero il colore della lavorazione Dim EgtCol As Color3d = m_ChangeToolPage.EgtColor + Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(EgtCol.R, EgtCol.G, EgtCol.B) + m_ItemList(Index).SawColor = New SolidColorBrush(tmpSawColor) ' Assegno un colore alla lavorazione ColorsCut(nNewMchId, EgtCol) EgtDraw() - End If End If Return @@ -2777,6 +2785,7 @@ Public Class SplitPageUC Private m_nType As Integer ' Posizione porta utensile (parametro non obbligatorio) Private m_sTCPos As String = "" + Private m_cSawColor As SolidColorBrush Private m_IsSelected As Boolean @@ -2814,6 +2823,18 @@ Public Class SplitPageUC End Set End Property + '!!!!!!!!!!!!!!!!!!!! + Public Property SawColor As SolidColorBrush + Get + Return m_cSawColor + End Get + Set(value As SolidColorBrush) + m_cSawColor = value + NotifyPropertyChanged("SawColor") + End Set + End Property + + Public Property bIsActive As Boolean Get Return m_bIsActive @@ -2851,12 +2872,13 @@ Public Class SplitPageUC Me.m_nType = nType End Sub - Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer, sTCPos As String) + Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer, sTCPos As String, cSawColor As SolidColorBrush) Me.m_sName = Name Me.m_nInd = Ind Me.m_bIsActive = bIsActive Me.m_nType = nType Me.m_sTCPos = sTCPos + Me.m_cSawColor = cSawColor End Sub Public Sub NotifyPropertyChanged(propName As String) From 6e8154d29a92143a1122526c42a3c3cc4fddb15a Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Tue, 4 Mar 2025 17:10:22 +0100 Subject: [PATCH 09/27] -piccola modifica a MachiningLsBx --- CadCuts/SplitPageUC.xaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CadCuts/SplitPageUC.xaml b/CadCuts/SplitPageUC.xaml index 2eb36c5..cad1e26 100644 --- a/CadCuts/SplitPageUC.xaml +++ b/CadCuts/SplitPageUC.xaml @@ -69,9 +69,9 @@ - - - + + + @@ -103,7 +103,7 @@ - From 5bdc4c46bc0310cda361f232dfabdeeb04fa9a12 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Tue, 4 Mar 2025 17:18:00 +0100 Subject: [PATCH 10/27] Gestione colore da lama lavorazioni --- CadCuts/SplitAuto.vb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CadCuts/SplitAuto.vb b/CadCuts/SplitAuto.vb index 1da1cdb..c8f4aca 100644 --- a/CadCuts/SplitAuto.vb +++ b/CadCuts/SplitAuto.vb @@ -1,6 +1,4 @@ -Imports System.Net -Imports System.Windows.Forms.Integration -Imports EgtUILib +Imports EgtUILib Public Module SplitAuto @@ -430,10 +428,14 @@ Public Module SplitAuto Else colCut = COL_MCH_CUT() End If - ' Se macchina con cambio utensile anche per lama + ' Se macchina con cambio utensile di lama If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then + Dim sSawing As String = String.Empty, sSaw As String = String.Empty + m_MainWindow.m_CadCutPageUC.m_SplitPage.GetCurrSawingandSaw(nOperId, sSawing, sSaw) + ' Setto l'utensile corrente + EgtTdbSetCurrTool(sSaw) ' recupero il colore della lavorazione direttamente dall'utensile - ChangeToolWD.GetColorPV() + colCut = ChangeToolWD.GetColorPV() End If For Each nId In vCutId From 0086345f648b34b9eaa2fd8fd7b53f12a9c3c5ad Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 5 Mar 2025 09:38:22 +0100 Subject: [PATCH 11/27] -cambio label con rettangolo per lavorazioni --- CadCuts/SplitPageUC.xaml | 3 ++- CadCuts/SplitPageUC.xaml.vb | 50 +++++++++++++++++++++---------------- OmagCUTDictionary.xaml | 11 ++++++++ 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/CadCuts/SplitPageUC.xaml b/CadCuts/SplitPageUC.xaml index cad1e26..4b6414e 100644 --- a/CadCuts/SplitPageUC.xaml +++ b/CadCuts/SplitPageUC.xaml @@ -103,7 +103,8 @@ - diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index 1a45f16..fb3fa95 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -206,44 +206,52 @@ Public Class SplitPageUC sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°" End If If Mach.m_bPause Then AddPauseText(sText) - Dim sTCPos As String = String.Empty - ' Visualizzo la posizione utensile solo se configurata - If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then - Dim sSawing As String = String.Empty, sSaw As String = String.Empty - GetCurrSawingandSaw(Mach.m_nId, sSawing, sSaw) - ' Verifico che sia montata su un portautensile - EgtTdbSetCurrTool(sSaw) - EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos) - End If - If String.IsNullOrEmpty(sTCPos) Then - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING)) - Else - ' se esiste una lama impostata nell'if sopra - Dim sawColor As Color3d = ChangeToolWD.GetColorPV() - Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(sawColor.R, sawColor.G, sawColor.B) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.SAWING, sTCPos, New SolidColorBrush(tmpSawColor))) - End If + SetSawColor(i, Mach, sText, MCH_OY.SAWING) ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura Dim sText As String = EgtMsg(90792) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING)) + 'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING)) + SetSawColor(i, Mach, sText, MCH_OY.DRILLING) ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura Dim sText As String = EgtMsg(90793) & " " & i.ToString() If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText) If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING)) + 'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING)) + SetSawColor(i, Mach, sText, MCH_OY.MILLING) ElseIf Mach.m_nType = MCH_OY.POCKETING Then ' Svuotatura Dim sText As String = EgtMsg(90796) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING)) + 'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING)) + SetSawColor(i, Mach, sText, MCH_OY.POCKETING) ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then ' Waterjet Dim sText As String = EgtMsg(90797) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) - m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING)) + 'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING)) + SetSawColor(i, Mach, sText, MCH_OY.WATERJETTING) End If Next End Sub + Private Sub SetSawColor(i As Integer, Mach As SplitMach, sText As String, nMach As Integer) + Dim sTCPos As String = String.Empty + ' Visualizzo la posizione utensile solo se configurata + If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then + Dim sSawing As String = String.Empty, sSaw As String = String.Empty + GetCurrSawingandSaw(Mach.m_nId, sSawing, sSaw) + ' Verifico che sia montata su un portautensile + EgtTdbSetCurrTool(sSaw) + EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos) + End If + If String.IsNullOrEmpty(sTCPos) Then + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, nMach)) + Else + ' se esiste una lama impostata nell'if sopra + Dim sawColor As Color3d = ChangeToolWD.GetColorPV() + Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(sawColor.R, sawColor.G, sawColor.B) + m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, nMach, sTCPos, New SolidColorBrush(tmpSawColor))) + End If + End Sub + #Region "BRIDGE" Private Sub OnMyMouseDownSceneBridges(sender As Object, e As System.Windows.Forms.MouseEventArgs, diff --git a/OmagCUTDictionary.xaml b/OmagCUTDictionary.xaml index 5bdb3d3..4067ff3 100644 --- a/OmagCUTDictionary.xaml +++ b/OmagCUTDictionary.xaml @@ -2775,5 +2775,16 @@ + + + From 7e5b813df120ed41889f1dc01a015a42c60073e9 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 5 Mar 2025 10:01:11 +0100 Subject: [PATCH 12/27] =?UTF-8?q?-gestione=20pulsante=20color=20visibilit?= =?UTF-8?q?=C3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CadCuts/SplitPageUC.xaml.vb | 16 +++++++++------- Machine/ToolsDbPageUC.xaml.vb | 6 ++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index fb3fa95..a4d71f1 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -206,33 +206,33 @@ Public Class SplitPageUC sText = EgtMsg(90791) & " " & i.ToString() & " " & DoubleToString(Mach.m_dSideAng, 2) & "°" End If If Mach.m_bPause Then AddPauseText(sText) - SetSawColor(i, Mach, sText, MCH_OY.SAWING) + AddItemToList(i, Mach, sText, MCH_OY.SAWING) ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura Dim sText As String = EgtMsg(90792) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) 'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.DRILLING)) - SetSawColor(i, Mach, sText, MCH_OY.DRILLING) + AddItemToList(i, Mach, sText, MCH_OY.DRILLING) ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura Dim sText As String = EgtMsg(90793) & " " & i.ToString() If Mach.m_sLay = NAME_ONPATH Then AddTopText(sText) If Mach.m_bPause Then AddPauseText(sText) 'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.MILLING)) - SetSawColor(i, Mach, sText, MCH_OY.MILLING) + AddItemToList(i, Mach, sText, MCH_OY.MILLING) ElseIf Mach.m_nType = MCH_OY.POCKETING Then ' Svuotatura Dim sText As String = EgtMsg(90796) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) 'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.POCKETING)) - SetSawColor(i, Mach, sText, MCH_OY.POCKETING) + AddItemToList(i, Mach, sText, MCH_OY.POCKETING) ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then ' Waterjet Dim sText As String = EgtMsg(90797) & " " & i.ToString() If Mach.m_bPause Then AddPauseText(sText) 'm_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, MCH_OY.WATERJETTING)) - SetSawColor(i, Mach, sText, MCH_OY.WATERJETTING) + AddItemToList(i, Mach, sText, MCH_OY.WATERJETTING) End If Next End Sub - Private Sub SetSawColor(i As Integer, Mach As SplitMach, sText As String, nMach As Integer) + Private Sub AddItemToList(i As Integer, Mach As SplitMach, sText As String, nMach As Integer) Dim sTCPos As String = String.Empty ' Visualizzo la posizione utensile solo se configurata If m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then @@ -242,10 +242,12 @@ Public Class SplitPageUC EgtTdbSetCurrTool(sSaw) EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos) End If + ' Se TCPos non trovato If String.IsNullOrEmpty(sTCPos) Then + ' Inserisco solo nome lavorazione m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, nMach)) Else - ' se esiste una lama impostata nell'if sopra + ' altrimenti se esiste una lama impostata nell'if sopra Dim sawColor As Color3d = ChangeToolWD.GetColorPV() Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(sawColor.R, sawColor.G, sawColor.B) m_ItemList.Add(New NameIdLsBxItem(sText, i - 1, Mach.m_bEnabled, nMach, sTCPos, New SolidColorBrush(tmpSawColor))) diff --git a/Machine/ToolsDbPageUC.xaml.vb b/Machine/ToolsDbPageUC.xaml.vb index 8cf92cd..b8d1c9e 100644 --- a/Machine/ToolsDbPageUC.xaml.vb +++ b/Machine/ToolsDbPageUC.xaml.vb @@ -905,6 +905,9 @@ Public Class ToolsDbPageUC SupplierTxBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden) EndLifeTxBl.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden) EndLifeChBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden) + + ColorTxBl.Visibility = Visibility.Visible + ColorBtn.Visibility = Visibility.Visible End Sub Private Sub HideToolParams() @@ -932,6 +935,9 @@ Public Class ToolsDbPageUC SupplierTxBx.Visibility = Windows.Visibility.Hidden EndLifeTxBl.Visibility = Windows.Visibility.Hidden EndLifeChBx.Visibility = Windows.Visibility.Hidden + + ColorTxBl.Visibility = Visibility.Hidden + ColorBtn.Visibility = Visibility.Hidden End Sub Private Sub ToolTreeView_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ToolTreeView.PreviewMouseUp From ecacf89e93369bff7c978a8eb2b864be43b23c42 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 5 Mar 2025 10:07:08 +0100 Subject: [PATCH 13/27] =?UTF-8?q?-gestione=20visibilit=C3=A0=20pulsante=20?= =?UTF-8?q?colore=20lavorazioni?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Machine/ToolsDbPageUC.xaml.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Machine/ToolsDbPageUC.xaml.vb b/Machine/ToolsDbPageUC.xaml.vb index b8d1c9e..d87b2a2 100644 --- a/Machine/ToolsDbPageUC.xaml.vb +++ b/Machine/ToolsDbPageUC.xaml.vb @@ -906,8 +906,8 @@ Public Class ToolsDbPageUC EndLifeTxBl.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden) EndLifeChBx.Visibility = If(bShowSpecials, Windows.Visibility.Visible, Windows.Visibility.Hidden) - ColorTxBl.Visibility = Visibility.Visible - ColorBtn.Visibility = Visibility.Visible + ColorTxBl.Visibility = If(m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW, Visibility.Visible, Visibility.Hidden) + ColorBtn.Visibility = If(m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW, Visibility.Visible, Visibility.Hidden) End Sub Private Sub HideToolParams() From e103aa753f3e7842b86e266384f677cd30da823e Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Wed, 5 Mar 2025 10:27:50 +0100 Subject: [PATCH 14/27] Aggiorno il valore di numerazione del taglio --- CadCuts/SplitPageUC.xaml.vb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index 1a45f16..155f53b 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -538,10 +538,15 @@ Public Class SplitPageUC Next Dim nNewMchId As Integer = -1 AddSawMachining(nMchId, nNewMchId) + ' Elimino la numerazione e la freccia + EgtErase(m_MachiningList(Index).m_nArrId) + EgtErase(m_MachiningList(Index).m_nNbrId) Dim Mach As New SplitMach If SplitAuto.CreateMach(Mach, nNewMchId) Then ' ricalcolo la lavorazione m_MachiningList(Index) = Mach + ' assegno numerazione + NumberDirectionMachining(Index) m_ItemList(Index).TCPos = m_ChangeToolPage.TCPos ' Recupero il colore della lavorazione Dim EgtCol As Color3d = m_ChangeToolPage.EgtColor From 10655893e4ba3a6a2c7c74e094f7f696ed2c321b Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Wed, 5 Mar 2025 11:38:09 +0100 Subject: [PATCH 15/27] =?UTF-8?q?-introdotto=20gestione=20visibilit=C3=A0?= =?UTF-8?q?=20rettangolo=20colore=20lavorazione?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CadCuts/SplitPageUC.xaml | 3 ++- CadCuts/SplitPageUC.xaml.vb | 9 +++++++++ OmagCUTDictionary.xaml | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CadCuts/SplitPageUC.xaml b/CadCuts/SplitPageUC.xaml index 4b6414e..238ad4c 100644 --- a/CadCuts/SplitPageUC.xaml +++ b/CadCuts/SplitPageUC.xaml @@ -103,7 +103,8 @@ - diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index a4d71f1..f90dd99 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -2796,6 +2796,7 @@ Public Class SplitPageUC ' Posizione porta utensile (parametro non obbligatorio) Private m_sTCPos As String = "" Private m_cSawColor As SolidColorBrush + Private m_bMachiningTCPosVisibility As Visibility = Visibility.Hidden Private m_IsSelected As Boolean @@ -2875,11 +2876,18 @@ Public Class SplitPageUC End Set End Property + Public ReadOnly Property MachiningTCPosVisibility As Visibility + Get + Return m_bMachiningTCPosVisibility + End Get + End Property + Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer) Me.m_sName = Name Me.m_nInd = Ind Me.m_bIsActive = bIsActive Me.m_nType = nType + Me.m_bMachiningTCPosVisibility = Visibility.Hidden End Sub Sub New(Name As String, Ind As Integer, bIsActive As Boolean, nType As Integer, sTCPos As String, cSawColor As SolidColorBrush) @@ -2889,6 +2897,7 @@ Public Class SplitPageUC Me.m_nType = nType Me.m_sTCPos = sTCPos Me.m_cSawColor = cSawColor + Me.m_bMachiningTCPosVisibility = Visibility.Visible End Sub Public Sub NotifyPropertyChanged(propName As String) diff --git a/OmagCUTDictionary.xaml b/OmagCUTDictionary.xaml index 4067ff3..fc0ab64 100644 --- a/OmagCUTDictionary.xaml +++ b/OmagCUTDictionary.xaml @@ -2780,8 +2780,8 @@ + + diff --git a/Machine/ToolsDbPageUC.xaml.vb b/Machine/ToolsDbPageUC.xaml.vb index c348672..730bdb4 100644 --- a/Machine/ToolsDbPageUC.xaml.vb +++ b/Machine/ToolsDbPageUC.xaml.vb @@ -777,6 +777,47 @@ Public Class ToolsDbPageUC ' Inizializzo colore di default Dim EgtCol As Color3d = Utility.GetColorPV() ColorBtn.Background = New SolidColorBrush(Color.FromRgb(EgtCol.R, EgtCol.G, EgtCol.B)) + ' Eventualmente verifico se inserito nel setup + VerifyToolInSetUp(m_sToolName, TCPosTxBx.Text) + End Sub + + Private Sub VerifyToolInSetUp(sNameTool As String, sTCPos As String) + ' Se configurato cambio utensile lama + If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then Return + Dim bFound As Boolean = False + Dim sCurrTCPos As String = String.Empty + For Each ToolPosition As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger + If ToolPosition.sTool <> String.Empty Then + If sNameTool = ToolPosition.sTool Then + sCurrTCPos = ToolPosition.sName + bFound = True + Exit For + End If + End If + Next + + If Not bFound Then + TCPosTxBl.Foreground = Brushes.Red + If String.IsNullOrEmpty(sTCPos) Then + TCPosTxBl.ToolTip = "Utensile non attrezzato" + Else + TCPosTxBl.ToolTip = "Utensile non attrezzato ma posizione di default indicata" + End If + Else + If String.IsNullOrEmpty(sTCPos) Then + TCPosTxBl.Foreground = Brushes.Gold + TCPosTxBl.ToolTip = "Posizione di default non indicata ma attrezzato nella posizione " & sCurrTCPos + Else + If sTCPos <> sCurrTCPos Then + TCPosTxBl.Foreground = Brushes.Gold + TCPosTxBl.ToolTip = "Posizione di default diversa dalla posizione di attrezzaggio " & sCurrTCPos + Else + TCPosTxBl.Foreground = Brushes.White + TCPosTxBl.ToolTip = "" + End If + End If + End If + End Sub Private Sub SetToolParams() @@ -1387,4 +1428,8 @@ Public Class ToolsDbPageUC End If End Sub + Private Sub TCPosTxBx_EgtClosed(sender As Object, e As EventArgs) Handles TCPosTxBx.EgtClosed + VerifyToolInSetUp(m_sToolName, TCPosTxBx.Text) + End Sub + End Class \ No newline at end of file diff --git a/OmagCUTDictionary.xaml b/OmagCUTDictionary.xaml index fc0ab64..9a00cea 100644 --- a/OmagCUTDictionary.xaml +++ b/OmagCUTDictionary.xaml @@ -1227,7 +1227,14 @@ - + + + From 2236eb12c7855e0ecf955d72adc84a8f03697114 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 6 Mar 2025 12:38:51 +0100 Subject: [PATCH 20/27] -aggiunto tasto destro su lista apertura ChangeWD --- CadCuts/ChangeToolWD.xaml.vb | 2 + CadCuts/SplitPageUC.xaml.vb | 120 ++++++++++++++++++++--------------- 2 files changed, 72 insertions(+), 50 deletions(-) diff --git a/CadCuts/ChangeToolWD.xaml.vb b/CadCuts/ChangeToolWD.xaml.vb index 7c7aab0..97af89b 100644 --- a/CadCuts/ChangeToolWD.xaml.vb +++ b/CadCuts/ChangeToolWD.xaml.vb @@ -300,6 +300,8 @@ Public Class ChangeToolWD Return Else m_NewSawing = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).Machining + m_EgtColor = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).PrintFootToolColor + m_TCPos = m_SetUpMachiningList(SetUpToolListBox.SelectedIndex).ToolPos OkBtn.IsEnabled = True End If End Sub diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index aa389c3..a6ea2d2 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -498,9 +498,9 @@ Public Class SplitPageUC If e.Button = Windows.Forms.MouseButtons.Right And m_MainWindow.m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then Dim nCurrCtx As Integer = EgtGetCurrentContext() - Dim nSel1 As Integer - Dim nPvId As Integer - Dim nMchId As Integer + Dim nSel1 As Integer = GDB_ID.NULL + Dim nPvId As Integer = GDB_ID.NULL + Dim nMchId As Integer = GDB_ID.NULL EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel1) Dim nId1 As Integer = EgtGetFirstObjInSelWin() While nId1 <> GDB_ID.NULL @@ -514,58 +514,17 @@ Public Class SplitPageUC If EgtGetInfo(nPvId, "MId", nMchId) Then Exit While End If - If m_nSelected >= 0 Then Exit While End If nId1 = EgtGetNextObjInSelWin() End While - ' eventualmente recupero il nome della lavorazione - EgtGetInfo(nPvId, "MId", nMchId) - Dim sSawing As String = String.Empty - Dim EntId As Integer = GDB_ID.NULL - Dim SubEntId As Integer = GDB_ID.NULL - EgtSetCurrMachining(nMchId) - If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return - ' Eventualmente recupero il nome della lavorazione - EgtGetInfo(EntId, "Def_Machining", sSawing) - - ' Apro pagina di selezione della lavorazione prima di chiudere il grezzo - Dim m_ChangeToolPage = New ChangeToolWD(m_MainWindow) - ' Imposto la lavorazione corrente selezionata - m_ChangeToolPage.CurrSawing = sSawing - - ' apro la finestra per la selezione delle lavorazioni - m_ChangeToolPage.ShowDialog() - ' se seleziono "Ok" allora resetto tutte le lavorazioni del progetto - If m_ChangeToolPage.DialogResult Then - EgtSetInfo(EntId, "Def_Machining", m_ChangeToolPage.NewSawing) - Dim Index As Integer = 0 - For Index = 0 To m_MachiningList.Count() - 1 - If m_MachiningList(Index).m_nId = nMchId Then - Exit For - End If - Next - Dim nNewMchId As Integer = -1 - CamAuto.AddSawMachining(nMchId, nNewMchId) - ' Elimino la numerazione e la freccia - EgtErase(m_MachiningList(Index).m_nArrId) - EgtErase(m_MachiningList(Index).m_nNbrId) - Dim Mach As New SplitMach - ' Sostituisco la vecchia lavorazione con la nuova - If SplitAuto.CreateMach(Mach, nNewMchId) Then - ' Assegno la lavorazione alla lista - m_MachiningList(Index) = Mach - ' Riassegno la numerazione - NumberDirectionMachining(Index) - m_ItemList(Index).TCPos = m_ChangeToolPage.TCPos - ' Recupero il colore della lavorazione - Dim EgtCol As Color3d = m_ChangeToolPage.EgtColor - Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(EgtCol.R, EgtCol.G, EgtCol.B) - m_ItemList(Index).SawColor = New SolidColorBrush(tmpSawColor) - m_ItemList(Index).MachiningTCPosVisibility = Visibility.Visible - EgtDraw() - End If + If nMchId = GDB_ID.NULL Then + GetCurrSelection() + Return End If + + ChangeMachinig(nMchId) + GetCurrSelection() Return End If @@ -588,6 +547,7 @@ Public Class SplitPageUC If m_nIdSelectedPartWJ_Srt <> GDB_ID.NULL And m_nIdSelectedPartWJ_End <> GDB_ID.NULL Then DeselectWJBridgesPart() End If + GetCurrSelection() Return End If @@ -596,6 +556,7 @@ Public Class SplitPageUC OnMyMouseDownSceneBridgesDelete(sender, e) ' aggiorno la visualizzazione delle lavorazioni e la lista RefreshMachList() + GetCurrSelection() Return End If @@ -683,6 +644,56 @@ Public Class SplitPageUC End If MachiningLsBx.SelectedIndex = -1 End If + GetCurrSelection() + End Sub + + Private Sub ChangeMachinig(nMchId As Integer) + ' Imposto la lavorazione corrente + Dim sSawing As String = String.Empty + Dim EntId As Integer = GDB_ID.NULL + Dim SubEntId As Integer = GDB_ID.NULL + EgtSetCurrMachining(nMchId) + If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return + ' Recupero il nome della lavorazione + EgtGetInfo(EntId, "Def_Machining", sSawing) + + ' Apro pagina di selezione della lavorazione prima di chiudere il grezzo + Dim m_ChangeToolPage = New ChangeToolWD(m_MainWindow) + ' Imposto nome lavorazione corrente + m_ChangeToolPage.CurrSawing = sSawing + + ' apro la finestra per la selezione delle lavorazioni + m_ChangeToolPage.ShowDialog() + ' se seleziono "Ok" allora resetto tutte le lavorazioni del progetto + If m_ChangeToolPage.DialogResult Then + EgtSetInfo(EntId, "Def_Machining", m_ChangeToolPage.NewSawing) + Dim Index As Integer = 0 + For Index = 0 To m_MachiningList.Count() - 1 + If m_MachiningList(Index).m_nId = nMchId Then + Exit For + End If + Next + Dim nNewMchId As Integer = -1 + CamAuto.AddSawMachining(nMchId, nNewMchId) + ' Elimino la numerazione e la freccia + EgtErase(m_MachiningList(Index).m_nArrId) + EgtErase(m_MachiningList(Index).m_nNbrId) + Dim Mach As New SplitMach + ' Sostituisco la vecchia lavorazione con la nuova + If SplitAuto.CreateMach(Mach, nNewMchId) Then + ' Assegno la lavorazione alla lista + m_MachiningList(Index) = Mach + ' Riassegno la numerazione + NumberDirectionMachining(Index) + m_ItemList(Index).TCPos = m_ChangeToolPage.TCPos + ' Recupero il colore della lavorazione + Dim EgtCol As Color3d = m_ChangeToolPage.EgtColor + Dim tmpSawColor As System.Windows.Media.Color = System.Windows.Media.Color.FromRgb(EgtCol.R, EgtCol.G, EgtCol.B) + m_ItemList(Index).SawColor = New SolidColorBrush(tmpSawColor) + m_ItemList(Index).MachiningTCPosVisibility = Visibility.Visible + EgtDraw() + End If + End If End Sub Public Sub GetCurrSawingandSaw(ByVal nMchId As Integer, ByRef sSawing As String, ByRef sNameTool As String) @@ -895,6 +906,15 @@ Public Class SplitPageUC OnOffCut() End Sub + Private Sub MachiningLsBx_MouseRightButtonDown(sender As Object, e As MouseEventArgs) Handles MachiningLsBx.PreviewMouseRightButtonDown + ' se disabilitata la modifica allora esco + If m_bShow Then Return + If m_IsCtrlKeyDown Or m_IsShiftKeyDown Then Return + Dim Index As Integer = MachiningLsBx.SelectedIndex + If Index = -1 Then Return + ChangeMachinig(m_MachiningList(Index).m_nId) + End Sub + Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click MoveItem(-1) End Sub From 65652f468c5d745bcba823c68ff48f35341184f2 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Thu, 6 Mar 2025 16:16:11 +0100 Subject: [PATCH 21/27] -aggiunto colore lavorazione in ChangeWD --- CadCuts/ChangeToolWD.xaml | 4 +++- CadCuts/ChangeToolWD.xaml.vb | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CadCuts/ChangeToolWD.xaml b/CadCuts/ChangeToolWD.xaml index 93d6a46..1d619f9 100644 --- a/CadCuts/ChangeToolWD.xaml +++ b/CadCuts/ChangeToolWD.xaml @@ -49,10 +49,12 @@ + + @@ -66,7 +68,7 @@ + Style="{DynamicResource OmagCut_ErrorTextBlock}"/> diff --git a/CadCuts/ChangeToolWD.xaml.vb b/CadCuts/ChangeToolWD.xaml.vb index 97af89b..d36e9ba 100644 --- a/CadCuts/ChangeToolWD.xaml.vb +++ b/CadCuts/ChangeToolWD.xaml.vb @@ -320,6 +320,7 @@ Public Class ItemMachining Private m_ToolExit As Integer = 1 Private m_ToolType As Integer = -1 Private m_PrintFootToolColor As New Color3d(0, 255, 0, 100) + Private m_cSawColor As SolidColorBrush ' Posizione porta utensile Public Property ToolPos As String @@ -378,11 +379,21 @@ Public Class ItemMachining End Set End Property + Public Property SawColor As SolidColorBrush + Get + Return m_cSawColor + End Get + Set(value As SolidColorBrush) + m_cSawColor = value + End Set + End Property + Sub New(sMachining As String, sToolName As String, sToolPos As String, cColor As Color3d) m_Machining = sMachining m_ToolPos = sToolPos m_ToolName = sToolName m_PrintFootToolColor = cColor + m_cSawColor = New SolidColorBrush(Color.FromRgb(m_PrintFootToolColor.R, m_PrintFootToolColor.G, m_PrintFootToolColor.B)) End Sub End Class From bee2c44ba7c02c9bad59d0477dc5c1f768d00fe9 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Fri, 7 Mar 2025 16:01:51 +0100 Subject: [PATCH 22/27] Aggiunto un commento all'avvio della simulazione --- Simulation/SimulationPageUC.xaml.vb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Simulation/SimulationPageUC.xaml.vb b/Simulation/SimulationPageUC.xaml.vb index cef48f2..26e07b5 100644 --- a/Simulation/SimulationPageUC.xaml.vb +++ b/Simulation/SimulationPageUC.xaml.vb @@ -86,6 +86,7 @@ Public Class SimulationPageUC End Sub Private Sub SimulationPage_Loaded(sender As Object, e As RoutedEventArgs) + EgtOutLog(" -- PREPARE SIMUL --") m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC Dim bOk As Boolean = True ' Elimino eventuale attrezzaggio da OmagOFFICE @@ -110,9 +111,9 @@ Public Class SimulationPageUC If bOk Then m_CurrProjPage.SetOrderMachiningFlag() Dim bModif As Boolean = TestAllMachiningsForStrict() If bModif Then - m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze + m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze Else - m_CurrProjPage.SetInfoMessage(EgtMsg(90399)) 'Aggiornate tutte le lavorazioni + m_CurrProjPage.SetInfoMessage(EgtMsg(90399)) 'Aggiornate tutte le lavorazioni End If End If ' Costringo ad aggiornare UI @@ -130,7 +131,7 @@ Public Class SimulationPageUC ' Se errore in setup, lo segnalo If Not bSetup Then m_CurrProjPage.SetErrorMessage(EgtMsg(90322) & " " & sMissingTools) 'Mancano gli utensili : ... - ' Se errore in generazione, segnalo l'errore + ' Se errore in generazione, segnalo l'errore ElseIf Not bOk Then m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN End If @@ -170,7 +171,7 @@ Public Class SimulationPageUC ' Nascondo eventuale contorno da foto m_CurrProjPage.ShowContour(False) ' Nascondo eventuali testi con dati su aree - m_CurrProjPage.SetAreasStatus( false) + m_CurrProjPage.SetAreasStatus(False) ' Recupero eventuale fase di ripartenza m_nRestart = m_MainWindow.m_CurrentProjectPageUC.GetProjectNcRestart() ' Imposto prima fase From 31264a20a0e43e52bb3213f898bd79fa6298530e Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Fri, 7 Mar 2025 16:28:30 +0100 Subject: [PATCH 23/27] -recuperati messagi da file messages --- CadCuts/ChangeToolWD.xaml.vb | 3 ++- Machine/ToolsDbPageUC.xaml.vb | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CadCuts/ChangeToolWD.xaml.vb b/CadCuts/ChangeToolWD.xaml.vb index d36e9ba..d56ec42 100644 --- a/CadCuts/ChangeToolWD.xaml.vb +++ b/CadCuts/ChangeToolWD.xaml.vb @@ -67,7 +67,8 @@ Public Class ChangeToolWD EgtMdbSetCurrMachining(m_CurrSawing) Dim sTool As String = String.Empty EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sTool) - ErrorTxBl.Text = "⚠️ Utensile " & sTool & " non attrezzato" + ' ⚠️ Utensile {0} non attrezzato + ErrorTxBl.Text = String.Format(EgtMsg(90377), sTool) Index = 0 End If ' se presente seleziono il primo elemento diff --git a/Machine/ToolsDbPageUC.xaml.vb b/Machine/ToolsDbPageUC.xaml.vb index 730bdb4..52475b4 100644 --- a/Machine/ToolsDbPageUC.xaml.vb +++ b/Machine/ToolsDbPageUC.xaml.vb @@ -799,18 +799,18 @@ Public Class ToolsDbPageUC If Not bFound Then TCPosTxBl.Foreground = Brushes.Red If String.IsNullOrEmpty(sTCPos) Then - TCPosTxBl.ToolTip = "Utensile non attrezzato" + TCPosTxBl.ToolTip = EgtMsg(91019) Else - TCPosTxBl.ToolTip = "Utensile non attrezzato ma posizione di default indicata" + TCPosTxBl.ToolTip = EgtMsg(91020) End If Else If String.IsNullOrEmpty(sTCPos) Then TCPosTxBl.Foreground = Brushes.Gold - TCPosTxBl.ToolTip = "Posizione di default non indicata ma attrezzato nella posizione " & sCurrTCPos + TCPosTxBl.ToolTip = EgtMsg(91021) & " " & sCurrTCPos Else If sTCPos <> sCurrTCPos Then TCPosTxBl.Foreground = Brushes.Gold - TCPosTxBl.ToolTip = "Posizione di default diversa dalla posizione di attrezzaggio " & sCurrTCPos + TCPosTxBl.ToolTip = EgtMsg(91022) & " " & sCurrTCPos Else TCPosTxBl.Foreground = Brushes.White TCPosTxBl.ToolTip = "" From fd28e2f971f18c6c9d619d4837f2494f40038cde Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Mon, 10 Mar 2025 14:46:54 +0100 Subject: [PATCH 24/27] Creazione file setup per programmi OFFICE e CAM5 della macchina corrente --- Machine/SetUpPage.xaml.vb | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Machine/SetUpPage.xaml.vb b/Machine/SetUpPage.xaml.vb index a671d9e..f043e82 100644 --- a/Machine/SetUpPage.xaml.vb +++ b/Machine/SetUpPage.xaml.vb @@ -4,6 +4,7 @@ Imports OmagCUT.TreeViewItem Imports EgtUILib Imports EgtWPFLib Imports EgtWPFLib5 +Imports FXServer Public Class SetUpPage @@ -1101,6 +1102,39 @@ Public Class SetUpPage EgtTdbSave() End Sub + ' Funzione che genera il file di setup corrente (per Cam5 e Office) + Private Sub SaveSetUpFile() + If m_CurrMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then Return + Dim sContentFile As String = "; this file has been created by program OmagCUT by current setup" & vbCrLf + sContentFile &= "[General]" & vbCrLf + For Each ToolPosition As ToolChangerPos In m_CurrMachine.ToolChanger + Dim sToolName As String = ToolPosition.sTool + Dim sPositionName As String = ToolPosition.sName + Dim sPosition As Integer = ToolPosition.nPosition + If Not String.IsNullOrEmpty(sToolName) Then + EgtTdbSetCurrTool(sToolName) + ' Recupero l'uscita + Dim nExit As Integer = 1 + EgtTdbGetCurrToolParam(MCH_TP.EXIT_, nExit) + ' Recupero la testa + Dim sHead As String = "" + EgtTdbGetCurrToolParam(MCH_TP.HEAD, sHead) + ' Recupero nome file nge dell'utensile + Dim sUUID As String = "" + EgtTdbGetCurrToolParam(MCH_TP.UUID, sUUID) + 'local sRaw='Pos'..tostring(Index)..'='..TcPos..';'..EgtTdbGetCurrToolParam( MCH_TP.HEAD)..';'..EgtTdbGetCurrToolParam( MCH_TP.EXIT)..'/'..EgtTdbGetCurrToolParam( MCH_TP.UUID)..'/'..ToolName + sContentFile &= "Pos" & sPosition.ToString & "=" & sPositionName & ";" & sHead & ";" & nExit.ToString & "/" & sUUID & "/" & sToolName & vbCrLf + End If + Next + ' Apro il file e lo sovrascrivo + Dim sFileOmagCutSetUp As String = m_CurrMachine.sMachDir & "\SetUp\CurrOmagCUT.stu" + Try + My.Computer.FileSystem.WriteAllText(sFileOmagCutSetUp, sContentFile, False) + Catch ex As Exception + EgtOutLog("Error in creatinf file CurrOmagCUT.stu: " & ex.ToString) + End Try + End Sub + ' Evento che permette di aprire le cartelle degli utensili con un click singolo Private Sub ToolTree_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles ToolTree.PreviewMouseUp If TypeOf ToolTree.SelectedItem Is CathegoryItem Then @@ -1112,6 +1146,8 @@ Public Class SetUpPage Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click ' Eseguo salvataggio (DB utensili + attrezzaggio) SaveToolChangerStatus() + ' Salvo nel file di setup l'attuale configurazione + SaveSetUpFile() ' Esco m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Add(m_MainWindow.m_MachinePageUC.m_AlarmsPageUC) m_MainWindow.m_MachinePageUC.MachinePageGrid.Children.Remove(Me) From 233a63b95bf81ad84823835f5f359064144347af Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Wed, 2 Apr 2025 14:49:36 +0200 Subject: [PATCH 25/27] Correzione avvio gestione simulazione --- Simulation/SimulationPageUC.xaml.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Simulation/SimulationPageUC.xaml.vb b/Simulation/SimulationPageUC.xaml.vb index 2fbafc9..86e9778 100644 --- a/Simulation/SimulationPageUC.xaml.vb +++ b/Simulation/SimulationPageUC.xaml.vb @@ -484,7 +484,7 @@ Public Class SimulationPageUC Private Function LoadCurrTools() As Boolean ' Se macchina senza cambio utensile automatico devo caricare gli utensili - If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGER Or + If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGER And m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then ' Imposto la lama corrente Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw From 471ba49732209ea86b2e45d9a64efccf3358930d Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Tue, 6 May 2025 16:02:38 +0200 Subject: [PATCH 26/27] Gestione speciale tagli inclinati e cambio lama --- CAM/CamAuto.vb | 59 ++ CadCuts/ChangeToolWD.xaml.vb | 140 ++-- CadCuts/SplitPageUC.xaml.vb | 10 +- Constants/ConstGen.vb | 2 + Constants/ConstMachIni.vb | 3 + DrawImport/SideAngle.vb | 4 + DrawImport/SideAngleUc.xaml.vb | 7 +- Machine/AlarmsPageUC.xaml | 1054 +++++++++++++++--------------- Machine/AlarmsPageUC.xaml.vb | 65 ++ Machine/CurrentMachine.vb | 65 +- Project/ProjectMgrUC.xaml | 25 +- Project/ProjectMgrUC.xaml.vb | 60 +- RawPhoto/ChooseMachining.xaml | 37 +- RawPhoto/ChooseMachining.xaml.vb | 54 +- 14 files changed, 958 insertions(+), 627 deletions(-) diff --git a/CAM/CamAuto.vb b/CAM/CamAuto.vb index 3d2d4a4..2676876 100644 --- a/CAM/CamAuto.vb +++ b/CAM/CamAuto.vb @@ -172,6 +172,63 @@ Friend Module CamAuto Return True End Function + Friend Function RestoreDef_Machinig(Optional bOnlySideAng As Boolean = True) + Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted + Dim bApplySawingTilted As Boolean = m_MainWindow.m_CurrentMachine.bApplySawingTilted + Dim bOk As Boolean = True + Dim nIdPart As Integer = EgtGetFirstPart() + While nIdPart <> GDB_ID.NULL + ' accedo al Layer OutLoop dei pezzi nel grezzo + Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP) + Dim nEntId As Integer = EgtGetFirstInGroup(nIdLayerOutLoop) + SetResetDef_Machining(nEntId, sSawingTilted, bApplySawingTilted, bOnlySideAng) + nIdPart = EgtGetNextPart(nIdPart) + End While + Dim nRawId As Integer = CamAuto.GetCurrentRaw() + nIdPart = EgtGetFirstPartInRawPart(nRawId) + While nIdPart <> GDB_ID.NULL + ' accedo al Layer OutLoop dei pezzi in parcheggio + Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP) + Dim nEntId As Integer = EgtGetFirstInGroup(nIdLayerOutLoop) + SetResetDef_Machining(nEntId, sSawingTilted, bApplySawingTilted, bOnlySideAng) + nIdPart = EgtGetNextPartInRawPart(nIdPart) + End While + Return bOk + End Function + + ' ripristina la lavorazone indicata di default per i tagli inclinati + Private Sub SetResetDef_Machining(nEntId As Integer, sSawingTilted As String, bApplySawingTilted As Boolean, bOnlySideAng As Boolean) + While nEntId <> GDB_ID.NULL + Dim sInfoSIdeAng As String = String.Empty + EgtGetInfo(nEntId, INFO_SIDE_ANGLE, sInfoSIdeAng) + ' Se è un'entità associata ad una lavorazione inclinata + If Not String.IsNullOrEmpty(sInfoSIdeAng) Then + If bApplySawingTilted Then + ' forzo la lavorazione inclinata + If String.IsNullOrEmpty(sSawingTilted) Then + ' ma se non esiste nessuna lavorezione specifica applico qualla standard + EgtRemoveInfo(nEntId, DEF_MACHINING) + Else + ' Applico quella specificata + EgtSetInfo(nEntId, DEF_MACHINING, sSawingTilted) + End If + Else + ' Rimuovo la lavorazione e applico quella standard + EgtRemoveInfo(nEntId, DEF_MACHINING) + End If + + ElseIf Not bOnlySideAng Then + Dim sInfo As String = String.Empty + EgtGetInfo(nEntId, DEF_MACHINING, sInfo) + If Not String.IsNullOrEmpty(sInfo) Then + ' se esiste una lavorazione specificata allora la rimuovo + EgtRemoveInfo(nEntId, DEF_MACHINING) + End If + End If + nEntId = EgtGetNext(nEntId) + End While + End Sub + Friend Function ResetAllSplitCurv() As Boolean Dim bOk As Boolean = True Dim nIdPart As Integer = EgtGetFirstPart() @@ -954,6 +1011,7 @@ Friend Module CamAuto Private Function SetLuaStandardCamParams(Optional bDripOk As Boolean = True) As Boolean Dim sMaterial As String = m_MainWindow.m_CurrentMachine.CurrMat.sName Dim sSawMch As String = m_MainWindow.m_CurrentMachine.sCurrSawing + Dim sSawTiltedMch As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted Dim sMillMch As String = m_MainWindow.m_CurrentMachine.sCurrMilling Dim sDrillMch As String = m_MainWindow.m_CurrentMachine.sCurrDrilling Dim sWaterJetMch As String = m_MainWindow.m_CurrentMachine.sCurrWaterJetting @@ -972,6 +1030,7 @@ Friend Module CamAuto Dim dMillingShort As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile()) EgtLuaSetGlobStringVar("CAM.MATERIAL", sMaterial) EgtLuaSetGlobStringVar("CAM.SAWMCH", sSawMch) + EgtLuaSetGlobStringVar("CAM.SAWTILTEDMCH", sSawTiltedMch) EgtLuaSetGlobStringVar("CAM.MILLMCH", sMillMch) EgtLuaSetGlobStringVar("CAM.DRILLMCH", sDrillMch) EgtLuaSetGlobStringVar("CAM.POCKETMCH", sPocketMch) diff --git a/CadCuts/ChangeToolWD.xaml.vb b/CadCuts/ChangeToolWD.xaml.vb index d56ec42..1d09cbe 100644 --- a/CadCuts/ChangeToolWD.xaml.vb +++ b/CadCuts/ChangeToolWD.xaml.vb @@ -11,6 +11,12 @@ Public Class ChangeToolWD InitializeComponent() End Sub + ' Parametri della lama impostata correntemente in macchina + Private m_DefaultSaw_Name As String = String.Empty + Private m_DefaultSaw_Diam As Double = 0 + Private m_DefaultSaw_Thick As Double = 0 + Private m_DefaultSaw_Exists As Boolean = False + ' Il nome della lavorazione restituito dalla selezione Private m_NewSawing As String = String.Empty Public ReadOnly Property NewSawing As String @@ -27,6 +33,7 @@ Public Class ChangeToolWD End Get End Property + ' Il nome della posizione sulla rulliera Private m_TCPos As String = String.Empty Public ReadOnly Property TCPos As String Get @@ -34,6 +41,7 @@ Public Class ChangeToolWD End Get End Property + ' Nome della lavorazione corrente Private m_CurrSawing As String = String.Empty Public Property CurrSawing As String Get @@ -44,13 +52,25 @@ Public Class ChangeToolWD End Set End Property + Private Sub GetDiamAndThickDefaultSaw() + m_DefaultSaw_Name = m_MainWindow.m_CurrentMachine.sCurrSaw + If EgtTdbSetCurrTool(m_DefaultSaw_Name) Then + ' Diametro lama lavorazione + EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_DefaultSaw_Diam) + ' Spessore lama corrente + EgtTdbGetCurrToolParam(MCH_TP.THICK, m_DefaultSaw_Thick) + m_DefaultSaw_Exists = True + End If + End Sub + Private Sub OpenFile_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized ' Posizione finestra Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2 Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2 ' Definizione del collegamento tra ItemList e ListBox1 SetUpToolListBox.ItemsSource = m_SetUpMachiningList - FilePathTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 45) ' Selezionare l'utensile da tastare + ' 90378=Seleziona lavorazione + FilePathTxBl.Text = EgtMsg(90378) End Sub Private Sub OpenFile_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded @@ -63,7 +83,7 @@ Public Class ChangeToolWD Dim Item As ItemMachining = m_SetUpMachiningList.FirstOrDefault(Function(x) x.Machining = m_CurrSawing) Dim Index As Integer = m_SetUpMachiningList.IndexOf(Item) If Index < 0 Then - ' Notifico: Utensile sTool non attrezzato + ' Imposto lavorazione di default EgtMdbSetCurrMachining(m_CurrSawing) Dim sTool As String = String.Empty EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sTool) @@ -99,84 +119,13 @@ Public Class ChangeToolWD m_SetUpMachiningList.Clear() CreateSawingList(local_Sawing) - 'sNameTool = m_MainWindow.m_CurrentMachine.sCurrWaterJet - 'If Not String.IsNullOrEmpty(sNameTool) Then - ' ' Imposto WJ - ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) - 'End If - - 'Select Case m_MainWindow.m_CurrentMachine.MountedToolConfig - ' Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL - ' sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw - ' If Not String.IsNullOrEmpty(sNameTool) Then - ' ' Imposto la lama - ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) - ' End If - ' sNameTool = m_MainWindow.m_CurrentMachine.sCurrMill - ' If Not String.IsNullOrEmpty(sNameTool) Then - ' ' Imposto la fresa - ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) - ' End If - ' sNameTool = m_MainWindow.m_CurrentMachine.sCurrDrill - ' If Not String.IsNullOrEmpty(sNameTool) Then - ' ' Imposto il foretto - ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) - ' End If - - ' Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER - ' sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw - ' If Not String.IsNullOrEmpty(sNameTool) Then - ' ' Imposto la lama - ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) - ' End If - ' ' Recupero tutti gli utensili attrezzati (nel ToolChanger e nel ManualToolChanger) - ' For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger - ' 'm_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False)) - ' sNameTool = ToolChangerPos.sTool - ' If Not String.IsNullOrEmpty(sNameTool) Then - ' ' Imposto la lama - ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) - ' End If - ' Next - ' Return True - - ' Case CurrentMachine.MountedToolConfigs.TOOLCHANGER - ' ' Recupero tutti gli utensili attrezzati (nel ToolChanger e nel ManualToolChanger) - ' sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw - ' If Not String.IsNullOrEmpty(sNameTool) Then - ' ' Imposto la lama - ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) - ' End If - ' 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)) - ' sNameTool = ToolChangerPos.sTool - ' If Not String.IsNullOrEmpty(sNameTool) Then - ' ' Imposto la lama - ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) - ' End If - ' 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)) - ' sNameTool = ToolChangerPos.sTool - ' If Not String.IsNullOrEmpty(sNameTool) Then - ' ' Imposto la lama - ' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool)) - ' End If - ' End If - ' Next - ' Return True - ' Case Else - ' Return False - 'End Select - Return True End Function ' Creo la lista delle delle lavorazioni di lama da proporre Private Sub CreateSawingList(SawingFam As TreeViewItem.CathegoryItem) + ' Recupero le info della lama montata di default + GetDiamAndThickDefaultSaw() ' recupero la prima lavorazione For Each Item As TreeViewItem.CustomItem In SawingFam.Items Dim sNameTool As String = String.Empty @@ -184,7 +133,7 @@ Public Class ChangeToolWD EgtMdbSetCurrMachining(Item.Name) ' Recupero il nome dell'utensile della lavorazione EgtMdbGetCurrMachiningParam(MCH_MP.TOOL, sNameTool) - If Not String.IsNullOrEmpty(sNameTool) Then + If Not String.IsNullOrEmpty(sNameTool) And VerifyCurrSawTollerance(sNameTool) Then ' Verifico che sia montata su un portautensile EgtTdbSetCurrTool(sNameTool) Dim sTCPos As String = String.Empty @@ -210,7 +159,7 @@ Public Class ChangeToolWD EgtMdbSetCurrMachining(m_MainWindow.m_CurrentMachine.sCurrSawing) End Sub - ' verifico l'utensile corrente (impostato nella funzione chiamante) se puù lavorare il grezzo corrente + ' verifico l'utensile corrente (impostato nella funzione chiamante) se può lavorare il grezzo corrente Private Function VerifyCurrMachiningMaterial() As Boolean Dim m_MaterialsList As New ObservableCollection(Of MachiningMaterial) For Each Material As Material In m_MainWindow.m_CurrentMachine.Materials @@ -234,11 +183,9 @@ Public Class ChangeToolWD If m_MainWindow.m_CurrentMachine.bWaterJet And m_MainWindow.m_CurrentMachine.bFromDBWaterJet Then If StringToInt(SubParam(0), nParId) AndAlso nParId = m_MainWindow.m_CurrentMachine.CurrMat.nId AndAlso SubParam.Count > 1 AndAlso StringToInt(SubParam(1), nSubParId) AndAlso nSubParId = Material.nSubId Then - StringToDouble(Param(1), Material.dMinThickness) StringToDouble(Param(2), Material.dMaxThickness) Material.VerifyIfActive() - Index += 1 Else Material.VerifyIfActive() End If @@ -250,16 +197,45 @@ Public Class ChangeToolWD If m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight > Material.dMinThickness And m_MainWindow.m_CurrentProjectPageUC.m_dRawHeight < Material.dMaxThickness Then Return True End If - Index += 1 - Else - Material.VerifyIfActive() End If End If + Index += 1 Next End If Return False End Function + ' verifico l'utensile corrente (impostato nella funzione chiamante) se ha le stesse dimensioni della lama di default + Private Function VerifyCurrSawTollerance(sNameTool As String) As Boolean + If m_DefaultSaw_Exists Then + If EgtTdbSetCurrTool(sNameTool) Then + ' Diametro nuova lama + Dim NewDiam As Double = 0 + EgtTdbGetCurrToolParam(MCH_TP.DIAM, NewDiam) + ' Spessore lama + Dim NewThick As Double = 0 + EgtTdbGetCurrToolParam(MCH_TP.THICK, NewThick) + ' Verifico che la nuova lama possa essere applicata: diametro minore, uguale spessore + Dim Delta_Diam As Double = NewDiam - m_DefaultSaw_Diam + Dim Delta_Thick As Double = Math.Abs(NewThick - m_DefaultSaw_Thick) + If Delta_Diam < EPS_SMALL And Delta_Thick < EPS_SMALL Then + Return True + Else + EgtOutLog(String.Format("New saw {0} can not repalce the current {1}; Delta_Diam={2}, |Delta_Thick|={3} ", sNameTool, m_DefaultSaw_Name, Delta_Diam, Delta_Thick)) + End If + Else + EgtOutLog("Impossible to find in tooldb SAW: " & sNameTool) + End If + Else + If String.IsNullOrEmpty(m_DefaultSaw_Name) Then + EgtOutLog("There is no currsaw setted in machine!") + Else + EgtOutLog("Impossible to find in tooldb currsaw setted in machine: " & m_DefaultSaw_Name) + End If + End If + Return False + End Function + ' Restituisce tutto l'elenco delle lavorazioni disponibili in macchina Private Function GetAllSwaing() As TreeViewItem.CathegoryItem Dim sFName As String = EgtMsg(MSG_MACHININGSDBPAGEUC + 31) diff --git a/CadCuts/SplitPageUC.xaml.vb b/CadCuts/SplitPageUC.xaml.vb index a6ea2d2..c422ce6 100644 --- a/CadCuts/SplitPageUC.xaml.vb +++ b/CadCuts/SplitPageUC.xaml.vb @@ -655,18 +655,18 @@ Public Class SplitPageUC EgtSetCurrMachining(nMchId) If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return ' Recupero il nome della lavorazione - EgtGetInfo(EntId, "Def_Machining", sSawing) + EgtGetInfo(EntId, DEF_MACHINING, sSawing) - ' Apro pagina di selezione della lavorazione prima di chiudere il grezzo + ' Apro pagina di selezione della lavorazione Dim m_ChangeToolPage = New ChangeToolWD(m_MainWindow) ' Imposto nome lavorazione corrente m_ChangeToolPage.CurrSawing = sSawing - ' apro la finestra per la selezione delle lavorazioni m_ChangeToolPage.ShowDialog() + ' se seleziono "Ok" allora resetto tutte le lavorazioni del progetto If m_ChangeToolPage.DialogResult Then - EgtSetInfo(EntId, "Def_Machining", m_ChangeToolPage.NewSawing) + EgtSetInfo(EntId, DEF_MACHINING, m_ChangeToolPage.NewSawing) Dim Index As Integer = 0 For Index = 0 To m_MachiningList.Count() - 1 If m_MachiningList(Index).m_nId = nMchId Then @@ -702,7 +702,7 @@ Public Class SplitPageUC EgtSetCurrMachining(nMchId) If Not EgtGetMachiningGeometry(0, EntId, SubEntId) Then Return ' Eventualmente recupero il nome della lavorazione - EgtGetInfo(EntId, "Def_Machining", sSawing) + EgtGetInfo(EntId, DEF_MACHINING, sSawing) If String.IsNullOrEmpty(sSawing) Then sSawing = m_MainWindow.m_CurrentMachine.sCurrSawing ' Imposto la lavorazione corrente EgtMdbSetCurrMachining(sSawing) diff --git a/Constants/ConstGen.vb b/Constants/ConstGen.vb index e161d84..727ada9 100644 --- a/Constants/ConstGen.vb +++ b/Constants/ConstGen.vb @@ -324,6 +324,8 @@ Module ConstGen Public Const INFO_START As String = "Start" ' Nome dei tagli diretti inseriti in fase di Splitting Public Const SPLIT_CUT As String = "SplitCut" + ' Forzo specifica lavorazione + Public Const DEF_MACHINING As String = "Def_Machining" ' Nome di pezzo che è una cornice Public Const NAME_FRAME As String = "Frame" diff --git a/Constants/ConstMachIni.vb b/Constants/ConstMachIni.vb index 2c04c08..2dbb399 100644 --- a/Constants/ConstMachIni.vb +++ b/Constants/ConstMachIni.vb @@ -313,6 +313,7 @@ Public Const S_MACH_MACH As String = "Mach" Public Const K_CURRSAW As String = "CurrSaw" + Public Const K_CURRSAWTILTED As String = "CurrSawTilted" Public Const K_CURRDRILL As String = "CurrDrill" Public Const K_CURRMILL As String = "CurrMill" Public Const K_CURRMILLNOTIP As String = "CurrMillNoTip" @@ -320,6 +321,8 @@ Public Const K_CURRDRIPDRILL As String = "CurrDripDrill" Public Const K_CURRWATERJET As String = "CurrWaterJet" Public Const K_CURRSAWING As String = "CurrSawing" + Public Const K_CURRSAWINGTILTED As String = "CurrSawingTilted" + Public Const K_APPLYSAWINGTILTED As String = "ApplySawingTilted" Public Const K_CURRDRILLING As String = "CurrDrilling" Public Const K_CURRMILLING As String = "CurrMilling" Public Const K_CURRPOCKETING As String = "CurrPocketing" diff --git a/DrawImport/SideAngle.vb b/DrawImport/SideAngle.vb index 4dee7f0..3240254 100644 --- a/DrawImport/SideAngle.vb +++ b/DrawImport/SideAngle.vb @@ -226,6 +226,10 @@ Module SideAngle EgtSetInfo(EntId, INFO_SIDE_ANGLE, dAng) EgtSetInfo(EntId, INFO_ORIG_SIDE_ANGLE, dAng) EgtSetInfo(EntId, INFO_HEEL, dHeel) + Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted + If Not String.IsNullOrEmpty(sSawingTilted) Then + EgtSetInfo(EntId, DEF_MACHINING, sSawingTilted) + End If End If End If End If diff --git a/DrawImport/SideAngleUc.xaml.vb b/DrawImport/SideAngleUc.xaml.vb index c3b8321..7481817 100644 --- a/DrawImport/SideAngleUc.xaml.vb +++ b/DrawImport/SideAngleUc.xaml.vb @@ -1303,10 +1303,15 @@ Public Class SideAngleUC If dSideAngle <> 0 Then EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle) EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle) - ' Cancello inclinazione nell'apposito campo info + Dim sSawingTilted As String = m_MainWindow.m_CurrentMachine.sCurrSawingTilted + If Not String.IsNullOrEmpty(sSawingTilted) Then + EgtSetInfo(CurrEntity.nGeomId, DEF_MACHINING, sSawingTilted) + End If + ' Cancello inclinazione nell'apposito campo info Else EgtRemoveInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE) EgtRemoveInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE) + EgtRemoveInfo(CurrEntity.nGeomId, DEF_MACHINING) End If ' Aggiorno lista entità con nuova inclinazione CurrEntity.dSideAngle = dSideAngle diff --git a/Machine/AlarmsPageUC.xaml b/Machine/AlarmsPageUC.xaml index 3488b44..e7529e5 100644 --- a/Machine/AlarmsPageUC.xaml +++ b/Machine/AlarmsPageUC.xaml @@ -7,371 +7,381 @@ mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="1280"> - - + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - - - - - - - - - - + - + - - - - - - - - - - - - + + + + + + + + + + + + - - + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - + - + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - + - + - - - - - - - - - - + + + + + + + + + + - - - - + - + - - + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + - + + + + - - - - - - - - - - - - - - - - - - + + diff --git a/Machine/AlarmsPageUC.xaml.vb b/Machine/AlarmsPageUC.xaml.vb index ad5650c..27eaa0e 100644 --- a/Machine/AlarmsPageUC.xaml.vb +++ b/Machine/AlarmsPageUC.xaml.vb @@ -57,6 +57,7 @@ Public Class AlarmsPageUC ' Imposto i messaggi letti dal file dei messaggi CurrSawTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 1) + CurrSawTiltedTxBl.Text = EgtMsg(91049) ' Current saw tilted AuxiliaryToolTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 2) CurrDrillTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 3) CurrCupWheelTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 20) @@ -120,6 +121,7 @@ Public Class AlarmsPageUC CfrPercTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 48) ' Riduzione % MachiningsGpBx.Header = EgtMsg(MSG_ALARMS2PAGEUC + 1) ' Lavorazioni CurrSawingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 2) ' Taglio lama + CurrSawingTiltedTxBl.Text = EgtMsg(91050) ' Taglio inclinato CurrDrillingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 3) ' Foratura CurrMillingTxBl.Text = EgtMsg(MSG_ALARMS2PAGEUC + 4) ' Fresatura CurrPocketingTxBl.Text = EgtMsg(91069) ' Svuotatura @@ -330,6 +332,18 @@ Public Class AlarmsPageUC m_CurrentMachine.sCurrSawing = "" End If + CurrSawTiltedCmBx.ItemsSource = m_SawList + If m_SawList.IndexOf(m_CurrentMachine.sCurrSawTilted) > -1 Then + ' Seleziono lama corrente + CurrSawTiltedCmBx.SelectedItem = m_CurrentMachine.sCurrSawTilted + Else + m_CurrentMachine.sCurrSawingTilted = "" + End If + + ' attivo la selezione della lama per il taglio in inlinato + CurrSawTiltedTxBl.Visibility = Visibility.Visible + CurrSawTiltedCmBx.Visibility = Visibility.Visible + ' attivo il bottone per l'apertura della pagina che mostra la configurazione degli utensili in parcheggio SetUpBtn.Visibility = Windows.Visibility.Visible @@ -482,6 +496,21 @@ Public Class AlarmsPageUC CurrSawingTxBl.Visibility = Windows.Visibility.Hidden CurrSawingTxBx.Visibility = Windows.Visibility.Hidden End If + If m_CurrentMachine.sCurrSawingTilted <> String.Empty Then + If Not m_CurrentMachine.bApplySawingTilted Then + CurrSawingTiltedTxBx.Foreground = Brushes.Gray + CurrSawingTiltedTxBx.TextDecorations = TextDecorations.Strikethrough + Else + CurrSawingTiltedTxBx.Foreground = Brushes.White + CurrSawingTiltedTxBx.TextDecorations = Nothing + End If + CurrSawingTiltedTxBx.Text = m_CurrentMachine.sCurrSawingTilted + CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Visible + CurrSawingTiltedTxBx.Visibility = Windows.Visibility.Visible + Else + CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Hidden + CurrSawingTiltedTxBx.Visibility = Windows.Visibility.Hidden + End If If m_CurrentMachine.sCurrDrilling <> String.Empty Then CurrDrillingTxBx.Text = m_CurrentMachine.sCurrDrilling CurrDrillingTxBl.Visibility = Windows.Visibility.Visible @@ -682,6 +711,42 @@ Public Class AlarmsPageUC RefreschMachining() End Sub + ' -- SAW TILTED -- + Private Sub CurrSawTiltedCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrSawTiltedCmBx.SelectionChanged + If IsNothing(CurrSawTiltedCmBx.SelectedItem) Then Return + ' Assegno + m_CurrentMachine.sCurrSawTilted = CurrSawTiltedCmBx.SelectedItem.ToString() + ' Se nuova lama incompatibile con lavorazione di taglio corrente, resetto quest'ultima + Dim sMchTuuid As String = String.Empty + Dim sMchTool As String = String.Empty + If Not EgtMdbSetCurrMachining(m_CurrentMachine.sCurrSawingTilted) Or + Not EgtMdbGetCurrMachiningParam(MCH_MP.TUUID, sMchTuuid) Or + Not EgtTdbGetToolFromUUID(sMchTuuid, sMchTool) Or + String.Compare(sMchTool, m_CurrentMachine.sCurrSawTilted, True) <> 0 Then + m_CurrentMachine.sCurrSawingTilted = String.Empty + End If + + ' Dim sVal As String = String.Empty + ' Dim dVal As Double = 0 + ' If m_CurrentMachine.GetUserNote("FsevLength", sVal, m_CurrentMachine.sCurrSaw) Then + ' StringToDouble(sVal, dVal) + ' m_CurrentMachine.SetFsevLength(dVal) + ' End If + ' If m_CurrentMachine.GetUserNote("FsevPerc", sVal, m_CurrentMachine.sCurrSaw) Then + ' StringToDouble(sVal, dVal) + ' m_CurrentMachine.SetFsevPerc(dVal) + ' End If + ' + ' ' Leggo parametri per variazione feed in tagli aggiornati in funzione della lama + ' CfrLenTxBx.Text = LenToString(m_CurrentMachine.dFsevLength, 3) + ' CfrPercTxBx.Text = DoubleToString(m_CurrentMachine.dFsevPerc, 0) + + ' Aggiorno utensili per lavoro in corso + m_MainWindow.m_WorkInProgressPageUC.UpdateTools() + ' aggiorno la lista delle lavorazioni + RefreschMachining() + End Sub + ' -- DRILL -- Private Sub CurrDrillCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrDrillCmBx.SelectionChanged If IsNothing(CurrDrillCmBx.SelectedItem) Then Return diff --git a/Machine/CurrentMachine.vb b/Machine/CurrentMachine.vb index 67902d2..ab4f657 100644 --- a/Machine/CurrentMachine.vb +++ b/Machine/CurrentMachine.vb @@ -107,6 +107,7 @@ Public Class CurrentMachine ' Variabili che contengono il nome degli utensili disponibili per tipo Private m_sCurrSaw As String = String.Empty + Private m_sCurrSawTilted As String = String.Empty Private m_sCurrDrill As String = String.Empty Private m_sCurrMill As String = String.Empty Private m_sCurrMillNoTip As String = String.Empty @@ -116,6 +117,8 @@ Public Class CurrentMachine ' Variabili che contengono le lavorazioni correntemente attive (utilizzate per definire lavorazioni nel programma) Private m_sCurrSawing As String = String.Empty + Private m_sCurrSawingTilted As String = String.Empty + Private m_bApplySawingTilted As Boolean = False Private m_sCurrDrilling As String = String.Empty Private m_sCurrMilling As String = String.Empty Private m_sCurrPocketing As String = String.Empty @@ -574,6 +577,18 @@ Public Class CurrentMachine End Set End Property + Friend Property sCurrSawTilted As String + Get + Return m_sCurrSawTilted + End Get + Set(value As String) + If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWTILTED, value, sMachIniFile) Then + m_sCurrSawTilted = value + ' m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text = value + End If + End Set + End Property + Friend Property sCurrDrill As String Get Return m_sCurrDrill @@ -648,18 +663,32 @@ Public Class CurrentMachine If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWING, value, sMachIniFile) Then m_sCurrSawing = value m_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value - '' aggiorno il file ini della macchina con i valori correnti della lavorazione - 'Dim sVal As String = String.Empty - 'Dim dVal As Double = m_dFsevLength - 'If GetUserNote("FsevLength", sVal, m_sCurrSawing, False) Then - ' StringToDouble(sVal, dVal) - ' SetFsevLength(dVal) - 'End If - 'dVal = m_dFsevPerc - 'If GetUserNote("FsevPerc", sVal, m_sCurrSawing, False) Then - ' StringToDouble(sVal, m_dFsevPerc) - ' SetFsevPerc(dVal) - 'End If + End If + End Set + End Property + + Friend Property sCurrSawingTilted As String + Get + Return m_sCurrSawingTilted + End Get + Set(value As String) + If WritePrivateProfileString(S_MACH_MACH, K_CURRSAWINGTILTED, value, sMachIniFile) Then + m_sCurrSawingTilted = value + 'm_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value + End If + End Set + End Property + + Friend Property bApplySawingTilted As Boolean + Get + Return m_bApplySawingTilted + End Get + Set(value As Boolean) + m_bApplySawingTilted = value + If m_bApplySawingTilted Then + WritePrivateProfileString(S_MACH_MACH, K_APPLYSAWINGTILTED, "1", sMachIniFile) + Else + WritePrivateProfileString(S_MACH_MACH, K_APPLYSAWINGTILTED, "0", sMachIniFile) End If End Set End Property @@ -1274,6 +1303,14 @@ Public Class CurrentMachine ' Leggo utensili correnti ' lama GetPrivateProfileString(S_MACH_MACH, K_CURRSAW, Nothing, m_sCurrSaw, sMachIniFile) + ' lama inclinata + If m_nShowToolChanger = 4 Then + GetPrivateProfileString(S_MACH_MACH, K_CURRSAWTILTED, Nothing, m_sCurrSawTilted, sMachIniFile) + Else + ' se non è configurato il cambio utensile e allora imposto l'unica lama disponibile per i tagli inclinati + m_sCurrSawTilted = m_sCurrSaw + End If + ' foretto GetPrivateProfileString(S_MACH_MACH, K_CURRDRILL, Nothing, m_sCurrDrill, sMachIniFile) ' fresa @@ -1290,6 +1327,10 @@ Public Class CurrentMachine ' Leggo lavorazioni correnti ' lama GetPrivateProfileString(S_MACH_MACH, K_CURRSAWING, Nothing, m_sCurrSawing, sMachIniFile) + ' lama inlicnata + GetPrivateProfileString(S_MACH_MACH, K_CURRSAWINGTILTED, Nothing, m_sCurrSawingTilted, sMachIniFile) + ' applica lavorazione di lama inclinata + m_bApplySawingTilted = (GetPrivateProfileInt(S_MACH_MACH, K_APPLYSAWINGTILTED, 0, sMachIniFile) <> 0) ' foretto GetPrivateProfileString(S_MACH_MACH, K_CURRDRILLING, Nothing, m_sCurrDrilling, sMachIniFile) ' fresa diff --git a/Project/ProjectMgrUC.xaml b/Project/ProjectMgrUC.xaml index 9059029..de9b3a0 100644 --- a/Project/ProjectMgrUC.xaml +++ b/Project/ProjectMgrUC.xaml @@ -43,9 +43,30 @@ - - + + + + + + + + + + diff --git a/Project/ProjectMgrUC.xaml.vb b/Project/ProjectMgrUC.xaml.vb index 7d65eae..2e0d359 100644 --- a/Project/ProjectMgrUC.xaml.vb +++ b/Project/ProjectMgrUC.xaml.vb @@ -26,6 +26,8 @@ Public Class ProjectMgrUC RegisterBtn.Content = "REG" 'Shape Registration ResetCutBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset + ResetCut2Btn.Content = EgtMsg(91024) 'Reset lavorazioni + ResetCut1Btn.Content = EgtMsg(91025) 'Aggiorna feed/speed SimulateBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1) 'Simulate - Simula If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 10) 'Export - Esporta @@ -33,7 +35,7 @@ Public Class ProjectMgrUC WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 2) 'Work - Lavora End If TestBtn.ToolTip = EgtMsg(90255) 'Test - ResetCutBtn.ToolTip = "Reset Cuts" & vbCrLf & "Reset Feed (Shift)" + ResetCutBtn.ToolTip = "Reset Cuts" & vbCrLf & "Other Reset (Shift)" End Sub Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded @@ -287,11 +289,58 @@ Public Class ProjectMgrUC End Sub Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click - If (Keyboard.Modifiers And ModifierKeys.Shift) Then - ' eseguo il ricalcolo delle sole FEED di lavorazione - UpdateFeedAllMachining() - Return + If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then + If ResetCutPopUp.IsOpen Then + ResetCutPopUp.IsOpen = False + Else + ResetCutPopUp.IsOpen = True + End If + Else + ResetCut3Btn_Click() End If + End Sub + + ' Reimposto le feed di tutte le lavorazioni + Private Sub ResetCut1Btn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCut1Btn.Click + ' eseguo il ricalcolo delle sole FEED di lavorazione + UpdateFeedAllMachining() + End Sub + + ' Reimposto le lavorazioni di default e ripristino i parametri + Private Sub ResetCut2Btn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCut2Btn.Click + EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx()) + ' Cancello eventuali messaggi + m_CurrProjPage.ClearMessage() + ' cancello tutti i tagli di separazione (Waterjet) + ResetAllSplitCurv() + ' cancello tutti i punti di inizio (Waterjet) + ResetAllStartCurv() + ' cancello tutti i ponticelli disegnati + ResetAllBRidges() + ' cancella tutti i tagli di separazione inseriti in OFFICE + ResetAllSplitCut() + + ' assegno la lavorazione corrente per i tagli di lama inclinati (solo se specificato nella ComboBox della ChooseMachinig) + RestoreDef_Machinig(True) + ' assegno la lavorazione corrente per i tagli verticali + RestoreDef_Machinig(False) + + ' Ricalcolo tutte le lavorazioni + Dim nWarn As Integer = 0 + ResetAllMachinings(nWarn) + If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa + ' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni + ResetAllRawPart() + ' Aggiorno Info C Home + Dim dCHome As Double + EgtGetAxisHomePos("C", dCHome) + EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHome, 0)) + ' Aggiorno visualizzazione + EgtDraw() + End Sub + + ' Resetta i valori dei parametri (ma non le lavorazioni) + Private Sub ResetCut3Btn_Click() EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx()) ' Cancello eventuali messaggi m_CurrProjPage.ClearMessage() @@ -305,7 +354,6 @@ Public Class ProjectMgrUC ResetAllSplitCut() ' Ricalcolo tutte le lavorazioni Dim nWarn As Integer = 0 - EgtOutLog(" -- RESET MACHININIG --") ResetAllMachinings(nWarn) If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa ' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni diff --git a/RawPhoto/ChooseMachining.xaml b/RawPhoto/ChooseMachining.xaml index 0810827..17f28b9 100644 --- a/RawPhoto/ChooseMachining.xaml +++ b/RawPhoto/ChooseMachining.xaml @@ -35,7 +35,42 @@ - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RawPhoto/ChooseMachining.xaml.vb b/RawPhoto/ChooseMachining.xaml.vb index 7a828b1..9a1ac80 100644 --- a/RawPhoto/ChooseMachining.xaml.vb +++ b/RawPhoto/ChooseMachining.xaml.vb @@ -8,6 +8,7 @@ Public Class ChooseMachining Private m_CurrentMachine As CurrentMachine = m_MainWindow.m_CurrentMachine ' Liste che contengono gli elementi appartenenti alle ComboBox Private m_SawingList As New List(Of String) + Private m_SawingTiltedList As New List(Of String) Private m_AuxMachTypeList As New List(Of StringIdCmBx) Private m_DrillingList As New List(Of String) Private m_MillingList As New List(Of String) @@ -36,6 +37,7 @@ Public Class ChooseMachining Me.Top = Owner.Top + Owner.Height / 2 - Me.Height Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2 CurrSawingCmBx.ItemsSource = m_SawingList + CurrSawingTiltedCmBx.ItemsSource = m_SawingTiltedList AuxiliaryMachiningCmBx.ItemsSource = m_AuxMachTypeList CurrDrillingCmBx.ItemsSource = m_DrillingList CurrMillingCmBx.ItemsSource = m_MillingList @@ -44,6 +46,7 @@ Public Class ChooseMachining CurrWJettingQualityCmBx.ItemsSource = m_CurrentMachine.Qualities CurrSawingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 1) + CurrSawingTiltedTxBl.Text = EgtMsg(91023) ' Lavorazione inclinata AuxiliaryMachiningTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 2) CurrDrillingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 3) CurrMillingTxBl.Text = EgtMsg(MSG_CHOOSEMACHININGPAGEUC + 4) @@ -69,7 +72,13 @@ Public Class ChooseMachining ' -- TAGLIO -- CreateMachiningList(MCH_MY.SAWING, m_CurrentMachine.sCurrSaw, m_SawingList) ' aggiungo un campo vuoto - m_SawingList.Add( "") + m_SawingList.Add("") + ' -- TAGLIO TILTED -- + CurrSawingTiltedCmBx.IsEnabled = m_MainWindow.m_CurrentMachine.bApplySawingTilted + ApplySawingTiltedChBx.IsChecked = m_MainWindow.m_CurrentMachine.bApplySawingTilted + CreateMachiningList(MCH_MY.SAWING, m_CurrentMachine.sCurrSawTilted, m_SawingTiltedList) + ' aggiungo un campo vuoto + m_SawingTiltedList.Add("") ' Verifico la configurazione della macchina per creare i combobox Select Case m_CurrentMachine.MountedToolConfig @@ -494,6 +503,8 @@ Public Class ChooseMachining Dim nDeltaRow As Integer = 4 Dim nNewRow As Integer = 2 ' nascondo tutte le CmBx e TxBl + CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Hidden + CurrSawingTiltedCmBx.Visibility = Windows.Visibility.Hidden CurrDrillingTxBl.Visibility = Windows.Visibility.Hidden CurrDrillingCmBx.Visibility = Windows.Visibility.Hidden CurrMillingTxBl.Visibility = Windows.Visibility.Hidden @@ -503,6 +514,33 @@ Public Class ChooseMachining CurrWJettingTxBl.Visibility = Windows.Visibility.Hidden CurrWJettingCmBx.Visibility = Windows.Visibility.Hidden + ' -- LAMA TILTED -- se definito il cambio utensile con lama + 'If m_CurrentMachine.MountedToolConfig = CurrentMachine.MountedToolConfigs.TOOLCHANGERWITHSAW Then + If Not String.IsNullOrEmpty(m_CurrentMachine.sCurrSawTilted) Then + ' Definizione di due righe della tabella con la giusta altezza + For Index As Integer = 1 To nNewRow + Dim Row As New RowDefinition + Row.Height = New GridLength(0.5, GridUnitType.Star) + ChooseMachiningGrid.RowDefinitions.Add(Row) + Next + m_RowNumber = m_RowNumber + nNewRow + ' titolo della ComboBox + CurrSawingTiltedTxBl.SetValue(Grid.RowProperty, m_RowNumber - nDeltaRow - nNewRow) + ' ComboBox (nella riga successiva al titolo) + CurrSawingTiltedCmBx.SetValue(Grid.RowProperty, m_RowNumber - nDeltaRow - nNewRow + 1) + 'ButtonsGrid.SetValue(Grid.RowProperty, 5) + If m_CurrentMachine.sCurrSawingTilted <> String.Empty Then + CurrSawingTiltedCmBx.SelectedItem = m_CurrentMachine.sCurrSawingTilted + End If + ' verifico che la selezione sia andata a buon fine, altrimenti comunico l'avvenuta modifica + If String.IsNullOrEmpty(CurrSawingTiltedCmBx.SelectedItem) Then + ' verifico che sia stato inserito veramente una lavorazione prima di comunicare una modifica + If CurrSawingTiltedCmBx.SelectedItem <> m_CurrentMachine.sCurrSawingTilted Then m_MachIsModified = True + End If + CurrSawingTiltedTxBl.Visibility = Windows.Visibility.Visible + CurrSawingTiltedCmBx.Visibility = Windows.Visibility.Visible + End If + ' -- FORATURA -- se foretto presente If m_CurrentMachine.bDrill And m_DrillingList.Count() > 0 Then ' Definizione di due righe della tabella con la giusta altezza @@ -625,6 +663,20 @@ Public Class ChooseMachining m_MainWindow.m_CurrentMachine.sCurrSawing = CurrSawingCmBx.SelectedItem.ToString() End Sub + Private Sub ApplySawingTiltedChBx_Checked() Handles ApplySawingTiltedChBx.Click + If ApplySawingTiltedChBx.IsChecked Then + CurrSawingTiltedCmBx.IsEnabled = True + m_MainWindow.m_CurrentMachine.bApplySawingTilted = True + Else + CurrSawingTiltedCmBx.IsEnabled = False + m_MainWindow.m_CurrentMachine.bApplySawingTilted = False + End If + End Sub + + Private Sub CurrSawingTiltedCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrSawingTiltedCmBx.SelectionChanged + m_MainWindow.m_CurrentMachine.sCurrSawingTilted = CurrSawingTiltedCmBx.SelectedItem.ToString() + End Sub + Private Sub CurrDrillingCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles CurrDrillingCmBx.SelectionChanged m_MainWindow.m_CurrentMachine.sCurrDrilling = CurrDrillingCmBx.SelectedItem.ToString() End Sub From ab8051275bc2b49299b10458121a4f7e3143a7c7 Mon Sep 17 00:00:00 2001 From: Nicola Pievani Date: Tue, 6 May 2025 16:08:30 +0200 Subject: [PATCH 27/27] Aggiornamento versione --- MainWindow.xaml.vb | 4 ++-- My Project/AssemblyInfo.vb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MainWindow.xaml.vb b/MainWindow.xaml.vb index c3a10d8..d5bf7a4 100644 --- a/MainWindow.xaml.vb +++ b/MainWindow.xaml.vb @@ -345,8 +345,8 @@ Class MainWindow ' Verifico abilitazione nesting automatico m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey) ' Recupero opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(9423, 2704, 1, m_nKeyLevel) And - EgtGetKeyOptions(9423, 2704, 1, m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(9423, 2705, 1, m_nKeyLevel) And + EgtGetKeyOptions(9423, 2705, 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 diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 6398450..7229eab 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -62,5 +62,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + +