Compare commits

...

8 Commits

Author SHA1 Message Date
Nicola Pievani a18cba5261 Correzione zona di lettura FlattSawTick 2025-04-09 12:04:27 +02:00
Nicola Pievani 0e08cc7d0d Merge commit 'a2bb9e250c3e2714fede966545d6089080a023f2' into Features/Manage_Side_Machining_In_Flattening 2025-04-08 16:48:01 +02:00
Nicola Pievani a2bb9e250c Correzione uscita dalla seconda pagina dei tagli diretti 2025-04-08 14:50:30 +02:00
Nicola Pievani 7565e2e0ed Aggiunto parametro per gestire offset spianatura 2025-04-07 14:23:51 +02:00
Nicola Pievani 2673d51008 Merge commit '1d5cce387f5490da659622b259ebba41287839a0' 2025-04-04 12:44:34 +02:00
Nicola Pievani 1d5cce387f Ottiimizzata disposizione pezzi DXF in parcheggio 2025-04-04 12:44:10 +02:00
Nicola Pievani 07e5756793 Merge branch 'master' into develop 2025-04-04 11:34:23 +02:00
Nicola Pievani cd0388b970 Merge commit '135be5f104c891b92201b98e3855117851ed42d5' into develop 2025-03-26 11:26:41 +01:00
10 changed files with 60 additions and 46 deletions
+8 -6
View File
@@ -2854,20 +2854,22 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Return False
End Function
Friend Function StoreOnePartDXF(nId As Integer, X As Double, Y As Double) As Boolean
Const STORE_LARGH As Double = 6000
Friend Function StoreOnePartDXF(nId As Integer, DimX As Double, DimY As Double, MaxPt As Point3d) As Boolean
'Const STORE_LARGH As Double = 6000
Const STORE_DIST As Double = 200
Const STORE_OFFS As Double = 20 + 40 + 20
Dim dStoreLarg As Double = GetPrivateProfileDouble("Store", "StoreLargh", STORE_LARGH, m_MainWindow.GetMachIniFile())
'Const STORE_OFFS As Double = 20 + 40 + 20
'Dim dStoreLarg As Double = GetPrivateProfileDouble("Store", "StoreLargh", STORE_LARGH, m_MainWindow.GetMachIniFile())
Dim dStoreDist As Double = GetPrivateProfileDouble("Store", "StoreDist", STORE_DIST, m_MainWindow.GetMachIniFile())
Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
'Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
' Recupero box tavola
Dim b3Tab As New BBox3d
If Not EgtGetTableArea(1, b3Tab) Then
b3Tab.Add(New Point3d(0, 0, 0))
b3Tab.Add(New Point3d(-3600, -2600, 0))
End If
Dim vt As New Vector3d(b3Tab.Min.x, b3Tab.Min.y - Y - STORE_DIST, b3Tab.Min.z)
Dim Offs_y As Double = b3Tab.Min.y - MaxPt.y - STORE_DIST
Dim Offs_x As Double = b3Tab.Min.x - (MaxPt.x - DimX) + (b3Tab.DimX - DimX) / 2
Dim vt As New Vector3d(Offs_x, Offs_y, b3Tab.Min.z)
EgtMove(nId, vt, GDB_RT.GLOB)
' Recupero il centro del pezzo in parcheggio e lo salvo
Dim ptCenter As Point3d
+16 -7
View File
@@ -273,7 +273,7 @@ Public Class SelParkIndWD
Next
End Sub
' Restituisce il primo parcheggio attivo (
' Restituisce il primo parcheggio attivo
Public Shared Function GetCurrentParkIndSelected() As ParkInd
Dim ListParkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListParkInd)
@@ -286,7 +286,7 @@ Public Class SelParkIndWD
Return Nothing
End Function
' Restitusice il nome del file immagine del parcheggio (manance solo dell'Indice di parcheggio e dell'esetensione png)
' Restitusice il nome del file immagine del parcheggio (manca solo dell'Indice di parcheggio e dell'esetensione png)
Public Shared Function GetPathCurrProj() As String
Dim nProj As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProject()
Dim sParkPath As String = m_MainWindow.GetSaveDir() & "\" & Math.Abs(nProj).ToString("D4") & "_ParkInd_"
@@ -298,15 +298,20 @@ Public Class SelParkIndWD
Return sParkPath
End Function
Public Shared Sub CopyImgSvg(sNewFileName As String, Optional nCtx As Integer = -1)
' Dato il nome del progetto crea le immagini dei parcheggi
Public Shared Sub CopyImgSvg(sNewFileName As String, refListParkInd As List(Of ParkInd), Optional nCtx As Integer = -1)
If sNewFileName.EndsWith(".nge") Then
sNewFileName = sNewFileName.Remove(sNewFileName.Length - 4, 4) & "_ParkInd_"
End If
Dim Extension As String = ".svg"
If Not MainWindow.m_bShowSVGParkInd Then Extension = ".png"
Dim ListParkInd As New List(Of ParkInd)
' ricarico la lista
SelParkIndWD.LoadParkInd(ListParkInd, nCtx)
If Not IsNothing(refListParkInd) Then
ListParkInd = refListParkInd
Else
' ricarico la lista
SelParkIndWD.LoadParkInd(ListParkInd, nCtx)
End If
'SelParkIndWD.sActualProj = Path.GetFileNameWithoutExtension(sPath)
For Each ItemParkInd As ParkInd In ListParkInd
If ItemParkInd.Ind <> 0 And ItemParkInd.Ind <> 999 And ItemParkInd.nPartInPark > 0 Then
@@ -816,8 +821,12 @@ Public Module XMLReader
Canv.ViewBoxDim = ViewBoxDim
' Elaboro i dati per avere la scalatura del disegno
Dim DimViewBox As String() = ViewBoxDim.ToString.Split(" ")
Dim DimX As Integer = Math.Abs(CInt(DimViewBox(2))) + Math.Abs(CInt(DimViewBox(0)))
Dim DimY As Integer = Math.Abs(CInt(DimViewBox(3))) + Math.Abs(CInt(DimViewBox(1)))
Dim DimX As Integer = 10
Dim DimY As Integer = 10
If DimViewBox.Count = 4 Then
DimX = Math.Abs(CInt(DimViewBox(2))) + Math.Abs(CInt(DimViewBox(0)))
DimY = Math.Abs(CInt(DimViewBox(3))) + Math.Abs(CInt(DimViewBox(1)))
End If
' Leggo in loop i tag: 'path'
While Not m_xmlr.EOF
+1
View File
@@ -343,6 +343,7 @@ Module ConstIni
Public Const K_DC_FLATT_HEADSIDE As String = "FlattHeadSide"
Public Const K_DC_FLATT_MACHTYPE As String = "FlattMachType"
Public Const K_DC_FLATT_ROTLOCK As String = "FlattRotLock"
Public Const K_DC_FLATT_SAWTH As String = "FlattSawThick"
Public Const K_DC_FLAT_CHAINEDPATH As String = "ChainedPath"
Public Const K_DC_FLATT_POSX As String = "FlattPosX"
Public Const K_DC_FLATT_POSY As String = "FlattPosY"
-1
View File
@@ -53,7 +53,6 @@ Public Class ControlsDirectCutUC
FlatteningCut
Polishing
CopyTemplate
SawTest
SingleCutAuto
SingleDrill
Squaring
+16
View File
@@ -407,6 +407,7 @@ Public Class FlatteningCut
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
' Trasformo in posizione punta utensile in basso
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
End If
' Calcolo direzione asse lama
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP2) Then Return
@@ -725,6 +726,21 @@ Public Class FlatteningCut
Dim ptStart As Point3d = m_ptTipP1
ptStart.z = 0
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
' -- APPLICO OFFSET AI TAGLI -- And PointModeCmBx.SelectedIndex = PT_MODE.SAW
If m_nTool = TOOL.SAW And PointModeCmBx.SelectedIndex = PT_MODE.SAW Then
' Applico un offset al taglio:
Dim vtOffs As New Vector3d
EgtStartVector(nCutId, GDB_RT.GLOB, vtOffs)
vtOffs.Rotate(Vector3d.Z_AX, 90)
Dim SawThick As Double = GetFootPrintTool()
Dim DirOffs As Double = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_SAWTH, 0, m_MainWindow.GetIniFile)
Dim vtNormTool As Vector3d = m_vtToolP1
vtNormTool.Normalize()
EgtOutLog("Offset flattening: " & DirOffs.ToString & "*" & SawThick.ToString)
If DirOffs <> 0 Then EgtMove(nCutId, vtOffs * DirOffs * SawThick, GDB_RT.GLOB)
End If
EgtSetInfo(nCutId, INFO_DIRECTCUT, 1)
' Imposto affondamento e angolo di fianco sul taglio
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
+4 -3
View File
@@ -1074,8 +1074,9 @@ Public Class ImportPageUC
' Passo al pezzo successivo
nId = EgtGetNextPart(nId)
End While
Dim x As Double = GlobBBox.DimX
Dim Y As Double = GlobBBox.DimY
Dim DimX As Double = GlobBBox.DimX
Dim DimY As Double = GlobBBox.DimY
Dim BBoxMaxPt As Point3d = GlobBBox.Max
' Ciclo sui pezzi inseriti
nId = nFirstId
@@ -1114,7 +1115,7 @@ Public Class ImportPageUC
' Inserisco in parcheggio
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
' Mantengo la posizione relativa tra i pezzi
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePartDXF(nId, x, Y)
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePartDXF(nId, DimX, DimY, BBoxMaxPt)
Else
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId, True)
End If
+6 -2
View File
@@ -26,7 +26,7 @@ Class MainWindow
' Variabile che definisce l'avvio forzato in modalità FRAME
Friend m_OnlyFrame As Boolean = False
Public Shared m_bShowSVGParkInd As Boolean = False
Public Shared m_bShowSVGParkInd As Boolean = True
' Dichiarazione delle Page UserControl
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
@@ -1218,13 +1218,17 @@ Class MainWindow
m_DirectCutPageUC.m_ControlsDirectCutUC.m_GridCut.GridCut_Unloaded(sender, e)
Case ControlsDirectCutUC.DirectCutPages.FlatteningCut
m_DirectCutPageUC.m_ControlsDirectCutUC.m_FlatteningCut.FlatteningCut_Unloaded(sender, e)
End Select
Select Case m_DirectCutPageUC.m_ControlsDirectCutUC1.m_ActiveDirectCutPage
Case ControlsDirectCutUC.DirectCutPages.CopyTemplate
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_CopyTemplate.CopyTemplate_Unloaded(sender, e)
Case ControlsDirectCutUC.DirectCutPages.Polishing
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_Polishing.Polishing_Unloaded(sender, e)
Case ControlsDirectCutUC.DirectCutPages.SawTest
Case ControlsDirectCutUC1.DirectCutPages.SawTest
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_SawTest.SawTest_Unloaded(sender, e)
End Select
Return True
End Function
+4 -2
View File
@@ -782,9 +782,9 @@ Public Class CurrentProjectPageUC
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
' Gestione visulizzazione lista pezzi in parcheggio
Dim sNewFileName As String = SelParkIndWD.GetPathCurrProj()
SelParkIndWD.CopyImgSvg(sPath)
SelParkIndWD.CopyImgSvg(sPath, Nothing)
SelParkIndWD.sActualProj = String.Empty
SelParkIndWD.CopyImgSvg(sNewFileName)
SelParkIndWD.CopyImgSvg(sNewFileName, Nothing)
End If
'--------------------------------------------------------------------------------
@@ -798,6 +798,8 @@ Public Class CurrentProjectPageUC
m_MruFiles.Add(sPath)
' Dichiaro progetto non modificato
EgtResetModified()
EgtOutLog("PROJECT " & CurrProjName & " SAVED")
Return True
End Function
+1 -1
View File
@@ -514,7 +514,7 @@ Public Class OpenPageUC
' Gestione visulizzazione lista pezzi in parcheggio
Dim nProj As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProject()
Dim sNewFileName As String = m_MainWindow.GetSaveDir() & "\" & Math.Abs(nProj).ToString("D4") & "_ParkInd_"
SelParkIndWD.CopyImgSvg(sNewFileName, OpenScene.GetCtx)
SelParkIndWD.CopyImgSvg(sNewFileName, Nothing, OpenScene.GetCtx)
SelParkIndWD.sActualProj = String.Empty
'--------------------------------------------------------------------------------
+4 -24
View File
@@ -100,38 +100,18 @@ Public Class ProjectMgrUC
' Scelta tavola della macchina
Dim nTabInd As Integer = ChooseTable()
' Creo una copia di tutte le immagini usata nella lista dei parcheggi
' Ricarico la lista dei parcheggi del progetto precedente a quello nuovo
Dim ListParkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListParkInd)
' Creo nuovo progetto
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
' Gestione visulizzazione lista pezzi in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.ReloadListParkInd()
Dim sNewFileName As String = SelParkIndWD.GetPathCurrProj()
SelParkIndWD.CopyImgSvg(sNewFileName)
'Dim Extension As String = ".svg"
'If Not MainWindow.m_bShowSVGParkInd Then Extension = ".png"
'For Each ItemParkInd As ParkInd In ListParkInd
' If ItemParkInd.Ind <> 0 And ItemParkInd.Ind <> 999 And ItemParkInd.nPartInPark > 0 Then
' Try
' Dim sNewFile As String = sNewFileName & ItemParkInd.Ind.ToString & Extension
' If MainWindow.m_bShowSVGParkInd Then
' WriteMyXML(sNewFile, ItemParkInd.LocalMyCanvas)
' Else
' If File.Exists(sNewFile) Then
' File.Delete(sNewFile)
' End If
' File.Copy(If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img), sNewFile)
' End If
' Catch ex As Exception
' EgtOutLog("Copia immagine " & If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img) & " di ParkInd non roiscita")
' End Try
' End If
'Next
m_MainWindow.m_CadCutPageUC.m_NestPage.ReloadListParkInd()
SelParkIndWD.CopyImgSvg(sNewFileName, ListParkInd)
m_MainWindow.m_CadCutPageUC.m_NestPage.ReloadListParkInd()
' Gestione stato FastGrid
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()