Compare commits

..

20 Commits

Author SHA1 Message Date
NicolaP 753ff7b4f1 Recupero dimensione corrente orgetto per stampa 2023-02-09 09:49:04 +01:00
NicolaP 1edfe486cb Migliorato rapporto di stsampa immagini 2023-02-08 19:36:09 +01:00
NicolaP 7190993f11 Aggiunto bottone per stampa layout corrente 2023-02-08 18:13:12 +01:00
NicolaP 249289144f Merge branch 'master' into develop 2023-02-08 14:51:06 +01:00
NicolaP 36ee5e4352 Cambio versione 2.5b1 2023-02-03 16:32:25 +01:00
NicolaP 147099b702 Merge branch 'develop' 2023-02-03 16:29:01 +01:00
NicolaP dd81384bb8 Migliorata gestione rotazione in park 2023-01-30 15:38:13 +01:00
NicolaP 9cf61d691d Gestione rotazione pezzi con Drag 2023-01-20 12:24:10 +01:00
NicolaP 358c5df390 Merge remote-tracking branch 'origin/HEAD' 2023-01-18 18:09:32 +01:00
NicolaP ccaec9af5a Merge branch 'develop' 2023-01-18 18:04:12 +01:00
NicolaP 1dbecd0083 Gestione allungamento tagli curvi 2023-01-18 18:03:57 +01:00
DarioS 11c6f95378 OmagOFFICE :
- aggiornamento info programma.
2023-01-18 09:17:16 +01:00
NicolaP 3604a85cc1 Merge branch 'develop' 2023-01-05 18:58:40 +01:00
NicolaP 3aaaa0fcb6 Lettura StarEndModifyOnIntCorner da file macchina, ver 2.5a1 2023-01-05 18:58:04 +01:00
NicolaP 52da2bc2c9 Merge branch 'develop' 2022-12-07 19:55:29 +01:00
NicolaP 4de476907f Migliorata gestione ventose 2022-12-07 19:55:06 +01:00
NicolaP 07bcb7479b Merge branch 'master' into develop 2022-11-09 10:32:11 +01:00
NicolaP 92818aafd4 Cambio versione 2.4k1 2022-11-09 10:31:37 +01:00
NicolaP f4326b27b7 Merge branch 'develop' 2022-11-09 10:29:46 +01:00
NicolaP 1f4a0afd75 Merge commit '565ba3c7564c5c4610b99ac1b6460b627f3a7708' into develop 2022-11-07 18:19:27 +01:00
16 changed files with 477 additions and 184 deletions
+2 -1
View File
@@ -93,7 +93,8 @@ Public Module SplitAuto
Mach.m_dEndFreeLen = FREELEN_INF + 1 Mach.m_dEndFreeLen = FREELEN_INF + 1
Dim nEntId, nSub As Integer Dim nEntId, nSub As Integer
If EgtGetMachiningGeometry(0, nEntId, nSub) Then If EgtGetMachiningGeometry(0, nEntId, nSub) Then
If EgtGetType( nEntId) = GDB_TY.CRV_ARC OrElse EgtGetType( nEntId) = GDB_TY.CRV_COMPO Then Mach.m_bIsLine = False ' 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_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_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_START_FREELEN, INFO_END_FREELEN), Mach.m_dStartFreeLen)
+10 -3
View File
@@ -444,15 +444,14 @@ Module VacuumCups
Dim dLen, dAngVertDeg, dAngOrizzDeg As Double Dim dLen, dAngVertDeg, dAngOrizzDeg As Double
frMinRect.VersX().ToSpherical(dLen, dAngVertDeg, dAngOrizzDeg) frMinRect.VersX().ToSpherical(dLen, dAngVertDeg, dAngOrizzDeg)
dRotAngDeg = dAngOrizzDeg dRotAngDeg = dAngOrizzDeg
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
Dim dPreferredRot As Double = m_dPreferredRot Dim dPreferredRot As Double = m_dPreferredRot
If bRotateVacuumNearExtraStrokeX And (Math.Abs(dRotAngDeg - 90) < 45 Or Math.Abs(dRotAngDeg - 270) < 45) Then If bRotateVacuumNearExtraStrokeX And Not IsHorizontal(dAngOrizzDeg) Then
If frMinRect.Orig().x < b3Tab.Center().x Then If frMinRect.Orig().x < b3Tab.Center().x Then
dPreferredRot = m_dPrefVertRotXMinus dPreferredRot = m_dPrefVertRotXMinus
Else Else
dPreferredRot = m_dPrefVertRotXPlus dPreferredRot = m_dPrefVertRotXPlus
End If End If
ElseIf bRotateVacuumNearExtraStrokeY And (Math.Abs(dRotAngDeg - 90) > 45 Or Math.Abs(dRotAngDeg - 270) > 45) Then ElseIf bRotateVacuumNearExtraStrokeY And IsHorizontal(dAngOrizzDeg) Then
' se l'orientemanto è orizzontale e la macchina è stata abilitata ' se l'orientemanto è orizzontale e la macchina è stata abilitata
If frMinRect.Orig().y < b3Tab.Center().y Then If frMinRect.Orig().y < b3Tab.Center().y Then
dPreferredRot = m_dPrefVertRotYPlus dPreferredRot = m_dPrefVertRotYPlus
@@ -460,6 +459,7 @@ Module VacuumCups
dPreferredRot = m_dPrefVertRotYMinus dPreferredRot = m_dPrefVertRotYMinus
End If End If
End If End If
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180) Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
While dRotAngDeg - dPreferredRot >= dAngDelta / 2 While dRotAngDeg - dPreferredRot >= dAngDelta / 2
dRotAngDeg -= dAngDelta dRotAngDeg -= dAngDelta
@@ -530,6 +530,13 @@ Module VacuumCups
Return dDist Return dDist
End Function End Function
Private Function IsHorizontal(dDegAng As Double) As Boolean
If (Math.Abs(dDegAng) > 45 And Math.Abs(dDegAng) < 135) Or (Math.Abs(dDegAng) > 225 And Math.Abs(dDegAng) < 315) Then
Return False
End If
Return True
End Function
' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile ' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
Dim dX, dY, dZ As Double Dim dX, dY, dZ As Double
+7
View File
@@ -29,6 +29,13 @@ Public Class VeinMatchingWindow
Private m_locPrev As System.Drawing.Point Private m_locPrev As System.Drawing.Point
Private m_ptPrev As Point3d Private m_ptPrev As Point3d
Private m_ptCen As Point3d Private m_ptCen As Point3d
' Gestione rotazione pezzi in fase di Drag
Private m_bKeyCtrlPressed As Boolean = False
Private m_bKeyLeftShiftPressed As Boolean = False
Private m_dAngTotal As Double = 0
Private m_dStartAng As Double = 0
Private m_bStartRot As Boolean = False
Private m_bStartMove As Boolean = False
Private Sub Window_Initialized(sender As Object, e As EventArgs) Private Sub Window_Initialized(sender As Object, e As EventArgs)
' Assegnazione scena all'host e posizionamento nella PlacePageGrid ' Assegnazione scena all'host e posizionamento nella PlacePageGrid
+14
View File
@@ -0,0 +1,14 @@
<EgtFloating:EgtFloatingPanel x:Class="PrintPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
IsTopDockable="True" IsBottomDockable="False" IsLeftDockable="False"
IsRightDockable="False" Style="{StaticResource ToolBar_EgtFloatingPanel}">
<Button ToolTip="{Binding PrintToolTip}"
Style="{StaticResource ToolBar_Button}"
Command="{Binding PrintCommand}">
<Image Source="/Resources/InstrumentPanel/Print.png" Stretch="Uniform"/>
</Button>
</EgtFloating:EgtFloatingPanel>
+3
View File
@@ -0,0 +1,3 @@
Public Class PrintPanelV
End Class
+84
View File
@@ -0,0 +1,84 @@
Imports EgtUILib
Imports EgtWPFLib5
Public Class PrintPanelVM
' Definizione comandi
Private m_cmdPrint As ICommand
Public ReadOnly Property PrintToolTip As String
Get
Return "Print shading" & vbCrLf & "Print hidden line (Shift)"
End Get
End Property
#Region "PrintCommand"
Public ReadOnly Property PrintCommand As ICommand
Get
If m_cmdPrint Is Nothing Then
m_cmdPrint = New Command(AddressOf Print)
End If
Return m_cmdPrint
End Get
End Property
Public Sub Print(ByVal param As Object)
Dim SM_Select As SM = SM.SHADING
If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then
SM_Select = SM.HIDDENLINE
EgtSetLineAttribs(3)
End If
Dim printDlg As New PrintDialog
Dim sPath = OmagOFFICEMap.refMainWindowVM.MainWindowM.sTempDir & "\Image.png"
If printDlg.ShowDialog() Then
' Recupero le dimensioni dell'area di stampa
Dim dW As Double = printDlg.PrintableAreaWidth
Dim dH As Double = printDlg.PrintableAreaHeight
Try
' Creo l'immagine da allegare
' EgtZoom(ZM.ALL, True)
' Prendo l'immagine per la stampa
Dim colWhite As New Color3d(255, 255, 255)
Dim nImgW As Integer = GetWidthDimProjectV()
Dim nImgH As Integer = GetHeightDimProjectV()
If Not EgtGetImage(SM_Select, colWhite, colWhite, nImgW, nImgH, sPath) Then
' Error in creating the print image
EgtOutLog(EgtMsg(50181))
EgtSetLineAttribs(1)
Return
End If
EgtSetLineAttribs(1)
'Metodo complesso di stampa che permette di rilasciare il file :
'carico la bitmap e la metto in uno stream in memoria
Dim stream As System.IO.Stream = New System.IO.MemoryStream()
Dim bitmap As System.Drawing.Bitmap = New System.Drawing.Bitmap(sPath)
bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png)
bitmap.Dispose()
' la sposto in una BitmapImage
Dim bitImage As New System.Windows.Media.Imaging.BitmapImage()
bitImage.BeginInit()
bitImage.StreamSource = stream
bitImage.EndInit()
' la sposto in un Visual Control
Dim tmpImg As New Image
tmpImg.BeginInit()
tmpImg.Source = bitImage
'tmpImg.Margin = New Thickness(-100)
tmpImg.Stretch = Stretch.Uniform
' ruoto a seconda dell'aspetto della pagina
'If (dH > dW And nImgH < nImgW) Or (dH < dW And nImgH > nImgW) Then
' tmpImg.LayoutTransform = New RotateTransform(-90)
'End If
tmpImg.EndInit()
' eseguo la stampa
printDlg.PrintVisual(tmpImg, "Parts Layout")
Catch
' Rrror in executing print
EgtOutLog(EgtMsg(50182))
End Try
End If
End Sub
#End Region ' PrintCommand
End Class
+2 -2
View File
@@ -223,8 +223,8 @@ Public Class MainWindowM
' Verifico abilitazione nesting automatico ' Verifico abilitazione nesting automatico
m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey) m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey)
' Recupero livello e opzioni della chiave ' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2410, 1, m_nKeyLevel) And Dim bKey As Boolean = EgtGetKeyLevel(9423, 2502, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2410, 1, m_nKeyOptions) EgtGetKeyOptions(9423, 2502, 1, m_nKeyOptions)
' Verifico abilitazione prodotto ' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE) Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
' Inizializzazione generale di EgtInterface ' Inizializzazione generale di EgtInterface
+3 -3
View File
@@ -30,7 +30,7 @@ Imports System.Windows
#End If #End If
<Assembly: AssemblyCompany("Egalware s.r.l.")> <Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("OmagOFFICE")> <Assembly: AssemblyProduct("OmagOFFICE")>
<Assembly: AssemblyCopyright("Copyright © 2017-2022 by Egalware s.r.l.")> <Assembly: AssemblyCopyright("Copyright © 2017-2023 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")> <Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(false)> <Assembly: ComVisible(false)>
'In order to begin building localizable applications, set 'In order to begin building localizable applications, set
@@ -69,6 +69,6 @@ Imports System.Windows
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.10.1")> <Assembly: AssemblyVersion("2.5.2.1")>
<Assembly: AssemblyFileVersion("2.4.10.1")> <Assembly: AssemblyFileVersion("2.5.2.1")>
+11
View File
@@ -213,7 +213,11 @@
<Compile Include="EgtStoneLib\VeinMatchingWindow.xaml.vb"> <Compile Include="EgtStoneLib\VeinMatchingWindow.xaml.vb">
<DependentUpon>VeinMatchingWindow.xaml</DependentUpon> <DependentUpon>VeinMatchingWindow.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="InstrumentPanel\PrintPanelV.xaml.vb">
<DependentUpon>PrintPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="InstrumentPanel\MyInstrumentPanelVM.vb" /> <Compile Include="InstrumentPanel\MyInstrumentPanelVM.vb" />
<Compile Include="InstrumentPanel\PrintPanelVM.vb" />
<Compile Include="MachinePanel\MyMachinePanelVM.vb" /> <Compile Include="MachinePanel\MyMachinePanelVM.vb" />
<Compile Include="MyMachGroupPanel\MyMachGroupPanelVM.vb" /> <Compile Include="MyMachGroupPanel\MyMachGroupPanelVM.vb" />
<Compile Include="MachinePanel\MachinePanelV.xaml.vb"> <Compile Include="MachinePanel\MachinePanelV.xaml.vb">
@@ -389,6 +393,10 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="InstrumentPanel\PrintPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MachinePanel\MachinePanelV.xaml"> <Page Include="MachinePanel\MachinePanelV.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -691,6 +699,9 @@
<ItemGroup> <ItemGroup>
<Resource Include="Resources\TopCommandBar\DxfOut.png" /> <Resource Include="Resources\TopCommandBar\DxfOut.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Resources\InstrumentPanel\Print.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagOFFICE\OmagOFFICER32.exe <PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagOFFICE\OmagOFFICER32.exe
+1 -1
View File
@@ -450,7 +450,7 @@ Public Class SplitModeVM
m_nDragInd = -1 m_nDragInd = -1
m_nDragType = 0 m_nDragType = 0
' verifico se è abilitata la possibiltà di allungare i lati interni ' verifico se è abilitata la possibiltà di allungare i lati interni
m_StartEndModifyOnIntCorner = (GetMainPrivateProfileInt(S_NEST, K_STARTENDMODIFYONINTCORNER, 0) <> 0) m_StartEndModifyOnIntCorner = (GetPrivateProfileInt(S_NEST, K_STARTENDMODIFYONINTCORNER, 0, sMachIniFile) <> 0)
' Nascondo eventuali pezzi in parcheggio ' Nascondo eventuali pezzi in parcheggio
EstCalc.HideParkedParts() EstCalc.HideParkedParts()
' Nascondo eventuale contorno da foto ' Nascondo eventuale contorno da foto
+185 -63
View File
@@ -31,6 +31,13 @@ Public Class NestingTabVM
Private m_ptPrev As Point3d Private m_ptPrev As Point3d
Private m_vtTotMove As Vector3d Private m_vtTotMove As Vector3d
Private m_dSnapDist As Double = 0 Private m_dSnapDist As Double = 0
' Gestione rotazione pezzi in fase di Drag
Private m_bKeyCtrlPressed As Boolean = False
Private m_bKeyLeftShiftPressed As Boolean = False
Private m_dAngTotal As Double = 0
Private m_dStartAng As Double = 0
Private m_bStartRot As Boolean = False
Private m_bStartMove As Boolean = False
' Abilitazioni TrfData e CsvData ' Abilitazioni TrfData e CsvData
Private m_bTrfData As Boolean = False Private m_bTrfData As Boolean = False
Private m_bCsvData As Boolean = False Private m_bCsvData As Boolean = False
@@ -405,7 +412,7 @@ Public Class NestingTabVM
' Eventuale aggiunta solido per taglio da sotto ' Eventuale aggiunta solido per taglio da sotto
UpdateSolidForDrip(nPartId) UpdateSolidForDrip(nPartId)
' altrimenti rifiutato ' altrimenti rifiutato
else Else
' Ripristino lo stato originale ' Ripristino lo stato originale
PreRemoveOnePart(Math.Abs(nPartId)) PreRemoveOnePart(Math.Abs(nPartId))
VeinMatching.OnDeselectPart(Math.Abs(nPartId)) VeinMatching.OnDeselectPart(Math.Abs(nPartId))
@@ -423,6 +430,93 @@ Public Class NestingTabVM
End If End If
End Sub End Sub
Private Sub VerifyMove()
If m_bVerify Then
' Determino cosa verificare
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
' Aggiorno regioni per nesting
UpdateNestRegions()
EnableReferenceRegion(False)
' Eseguo verifica
If VerifyTrfData(nMoveId) And EgtVerifyPart(nMoveId, CurrentMachine.bReducedCut) Then
EstCalc.ResetOrderMachiningFlag()
' Non superata riporto alla posizione iniziale
Else
If m_bFromParking Then
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
PreRemoveOnePart(nMoveId)
VeinMatching.OnRemovePartFromRaw(nMoveId)
Else
EgtMove(nMoveId, -m_vtTotMove)
' Eventuale notifica al VeinMatching
If nMoveId = GDB_ID.SEL Then
Dim nId As Integer = EgtGetFirstSelectedObj()
While nId <> GDB_ID.NULL
VeinMatching.OnMovePartInRaw(nId)
nId = EgtGetNextSelectedObj()
End While
Else
VeinMatching.OnMovePartInRaw(nMoveId)
End If
End If
'---------------------- COUNTER PART ----------------------
' solo se pezzo disposto in tavola
If m_bFromParking Then
Dim sRefGroup As String = String.Empty
If EgtGetInfo(nMoveId, INFO_REFGROUP, sRefGroup) Then
' accendo il layer che contiene il contatore (spento in fase di Drag)
Dim nCounterLayer As Integer = EgtGetFirstNameInGroup(nMoveId, INFO_COUNTERLY)
EgtSetStatus(nCounterLayer, GDB_ST.ON_)
' aggiorno il layer che indica il numero di pezzi in parcheggio
CountPartInFamily(sRefGroup)
End If
End If
'---------------------- COUNTER PART ----------------------
End If
m_bFromParking = False
End If
End Sub
Private Sub VerifyRot()
' se comando Shift è stato attivato
If m_bKeyLeftShiftPressed Then
' Determino cosa verificare
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
If Not EgtVerifyPart(nMoveId, CurrentMachine.bReducedCut) Then
Dim ptCen As Point3d
If Not EgtGetPartPartClusterCenterGlob(nMoveId, ptCen) Then Return
EgtRotate(nMoveId, ptCen, Vector3d.Z_AX(), -m_dAngTotal, GDB_RT.GLOB)
End If
End If
' resetto i valori
m_dStartAng = 0
m_dAngTotal = 0
m_bStartRot = False
End Sub
' verifica che la rotazione sia ammessa
Private Function RotatePartInsideBond(dAngRotDeg As Double, nIdMove As Integer) As Boolean
' Verifico se ci sono dei pezzi bloccati in rotazione
Dim bLockedRot As Boolean = GetLockOnRotation(nIdMove)
' Se tutti i pezzi possono ruotare
If Not bLockedRot Then
' Calcolo il centro di rotazione come centro del cluster
Dim ptCen As Point3d
If Not EgtGetPartPartClusterCenterGlob(nIdMove, ptCen) Then Return False
' Aggiorno regioni per nesting
UpdateNestRegions()
EnableReferenceRegion(False)
' Verifico rotazione complessiva
EgtRotate(nIdMove, ptCen, Vector3d.Z_AX(), dAngRotDeg, GDB_RT.GLOB)
If EgtVerifyPart(nIdMove, CurrentMachine.bReducedCut) Then Return True
' Provo rotazione parziale (dopo aver annullato la complessiva)
EgtRotate(nIdMove, ptCen, Vector3d.Z_AX(), -dAngRotDeg, GDB_RT.GLOB)
Return EgtRotatePart(nIdMove, CurrentMachine.bReducedCut, ptCen, dAngRotDeg)
Else
Return False
End If
End Function
Private Function RotateCluster(ByVal dAngRotDeg As Double) As Boolean Private Function RotateCluster(ByVal dAngRotDeg As Double) As Boolean
' Se non ci sono pezzi selezionati, esco ' Se non ci sono pezzi selezionati, esco
If EgtGetSelectedObjCount() = 0 Then Return True If EgtGetSelectedObjCount() = 0 Then Return True
@@ -468,25 +562,7 @@ Public Class NestingTabVM
Return True Return True
' Altrimenti li ruoto tenendo conto delle collisioni ' Altrimenti li ruoto tenendo conto delle collisioni
Else Else
' Verifico se ci sono dei pezzi bloccati in rotazione Return RotatePartInsideBond(dAngRotDeg, GDB_ID.SEL)
Dim bLockedRot As Boolean = GetLockOnRotation( GDB_ID.SEL)
' Se tutti i pezzi possono ruotare
If Not bLockedRot Then
' Calcolo il centro di rotazione come centro del cluster
Dim ptCen As Point3d
If Not EgtGetPartPartClusterCenterGlob(GDB_ID.SEL, ptCen) Then Return False
' Aggiorno regioni per nesting
UpdateNestRegions()
EnableReferenceRegion(False)
' Verifico rotazione complessiva
EgtRotate(GDB_ID.SEL, ptCen, Vector3d.Z_AX(), dAngRotDeg, GDB_RT.GLOB)
If EgtVerifyPart(GDB_ID.SEL, CurrentMachine.bReducedCut) Then Return True
' Provo rotazione parziale (dopo aver annullato la complessiva)
EgtRotate(GDB_ID.SEL, ptCen, Vector3d.Z_AX(), -dAngRotDeg, GDB_RT.GLOB)
Return EgtRotatePart(GDB_ID.SEL, CurrentMachine.bReducedCut, ptCen, dAngRotDeg)
Else
Return False
End If
End If End If
End Function End Function
@@ -2081,6 +2157,7 @@ Public Class NestingTabVM
m_bDrag = m_bDrag AndAlso EgtUnProjectPoint(e.Location, m_ptPrev) m_bDrag = m_bDrag AndAlso EgtUnProjectPoint(e.Location, m_ptPrev)
m_bDragToStart = m_bDrag m_bDragToStart = m_bDrag
m_bVerify = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) > 0 m_bVerify = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) > 0
m_bKeyLeftShiftPressed = m_bVerify
m_vtTotMove = Vector3d.NULL() m_vtTotMove = Vector3d.NULL()
End Sub End Sub
@@ -2115,12 +2192,12 @@ Public Class NestingTabVM
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_NESTPAGEUC + 7), MSG_TYPE.WARNING) OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_NESTPAGEUC + 7), MSG_TYPE.WARNING)
End If End If
' Applico le lavorazioni al pezzo ' Applico le lavorazioni al pezzo
Dim b3Curr As new BBox3d Dim b3Curr As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(nTestId, NAME_REGION), BBFLAG, b3Curr) EgtGetBBoxGlob(EgtGetFirstNameInGroup(nTestId, NAME_REGION), BBFLAG, b3Curr)
if Not EstCalc.PreInsertOnePart( nTestId) Then Return If Not EstCalc.PreInsertOnePart(nTestId) Then Return
Dim b3Ins As new BBox3d Dim b3Ins As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(nTestId, NAME_REGION), BBFLAG, b3Ins) EgtGetBBoxGlob(EgtGetFirstNameInGroup(nTestId, NAME_REGION), BBFLAG, b3Ins)
Dim vtDiff As new Vector3d( b3Curr.Min().x - b3Ins.Min().x, b3Curr.Min().y - b3Ins.Min().y, 0) Dim vtDiff As New Vector3d(b3Curr.Min().x - b3Ins.Min().x, b3Curr.Min().y - b3Ins.Min().y, 0)
EgtMove(nMoveId, vtDiff) EgtMove(nMoveId, vtDiff)
'---------------------- COUNTER PART ---------------------- '---------------------- COUNTER PART ----------------------
@@ -2146,11 +2223,68 @@ Public Class NestingTabVM
' Ricavo il punto corrente in coordinate mondo ' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr) EgtUnProjectPoint(e.Location, ptCurr)
' la rotazione è attivabile solo se premuto il tasto Ctrl (e non sono in parheggio)
m_bKeyCtrlPressed = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Control) > 0
'-------------Inizio ROTAZIONE ----------------
If m_bKeyCtrlPressed AndAlso (Not m_bFromParking OrElse m_bKeyLeftShiftPressed) Then
' Calcolo il centro di rotazione come centro del cluster
Dim ptCen As Point3d
If Not EgtGetPartPartClusterCenterGlob(nMoveId, ptCen) Then Return
' definisco il vettore dal centro del pezzo alla posizione del cursore
Dim vtCurr As Vector3d = ptCurr - ptCen
Dim dLen, dHAng, dVAng As Double
' recupero l'angolo orizzontale del vettore
vtCurr.ToSpherical(dLen, dHAng, dVAng)
If Not m_bStartRot Then
m_dAngTotal = 0
' notifico una rotazione
m_bStartRot = True
m_dStartAng = dVAng
End If
Dim dDeltaAng As Double = dVAng - m_dStartAng
' gestione del passaggio da 0° → 360° evitando mantenendo la visualizzazione fluida
If Math.Abs(dDeltaAng) > 90 Then
If m_dStartAng < 180 And dVAng > 180 Then
dDeltaAng = dVAng - 360 - m_dStartAng
ElseIf m_dStartAng > 180 And dVAng < 180 Then
dDeltaAng = dVAng - m_dStartAng + 360
End If
End If
' Rotazione del pezzo attorno al suo centro
If Math.Abs(dDeltaAng) > EPS_ANG_SMALL Then
' se il tasto Shift è premuto (disabilitato il controllo collisioni durante il Drag)
If m_bKeyLeftShiftPressed Then
EgtRotate(nMoveId, ptCen, Vector3d.Z_AX(), dDeltaAng, GDB_RT.GLOB)
m_dAngTotal += dDeltaAng
Else
' esegue la rotazione fino ad incontrare un altro pezzo
RotatePartInsideBond(dDeltaAng, nMoveId)
EstCalc.ResetOrderMachiningFlag()
' Eventuale notifica al VeinMatching
Dim nId As Integer = EgtGetFirstSelectedObj()
While nId <> GDB_ID.NULL
VeinMatching.OnMovePartInRaw(nId)
nId = EgtGetNextSelectedObj()
End While
End If
m_dStartAng = dVAng
End If
'-------------Fine ROTAZIONE ----------------
Else
' -------------Inizio TRASLAZIONE ---------------
' Ricavo il vettore di movimento ' Ricavo il vettore di movimento
Dim vtMove As Vector3d = ptCurr - m_ptPrev Dim vtMove As Vector3d = ptCurr - m_ptPrev
' Muovo i pezzi selezionati di quanto possibile ' Muovo i pezzi selezionati di quanto possibile
If vtMove.SqLen() > EPS_SMALL * EPS_SMALL Then If vtMove.SqLen() > EPS_SMALL * EPS_SMALL Then
' Se movimento con sola verifica finale ' notifico una traslazione
If Not m_bStartMove Then
m_bStartMove = True
End If
' Se movimento con sola verifica finale (disabilitato il controllo collisioni durante il Drag)
If m_bVerify Then If m_bVerify Then
EgtMove(nMoveId, vtMove) EgtMove(nMoveId, vtMove)
m_vtTotMove += vtMove m_vtTotMove += vtMove
@@ -2184,8 +2318,13 @@ Public Class NestingTabVM
End If End If
EstCalc.ResetOrderMachiningFlag() EstCalc.ResetOrderMachiningFlag()
End If End If
' -------------Fine TRASLAZIONE ---------------
End If
End If
EgtDraw() EgtDraw()
' Eventuale notifica al VeinMatching ' Eventuale notifica al VeinMatching
If m_bStartMove OrElse m_bStartRot Then
If nMoveId = GDB_ID.SEL Then If nMoveId = GDB_ID.SEL Then
Dim nId As Integer = EgtGetFirstSelectedObj() Dim nId As Integer = EgtGetFirstSelectedObj()
While nId <> GDB_ID.NULL While nId <> GDB_ID.NULL
@@ -2225,48 +2364,31 @@ Public Class NestingTabVM
' Se eseguito drag ' Se eseguito drag
If Not m_bDragToStart Then If Not m_bDragToStart Then
' Se movimento con sola verifica finale ' Se movimento con sola verifica finale ----- TRASLAZIONE
If m_bVerify Then If Not m_bStartRot And m_bStartMove Then
' Determino cosa verificare VerifyMove()
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL) ' Se movimento con sola verifica finale ----- TRASLAZIONE + ROTAZIONE
' Aggiorno regioni per nesting ElseIf m_bStartRot And m_bStartMove Then
UpdateNestRegions() If Not m_bFromParking Then
EnableReferenceRegion(False) VerifyRot()
' Eseguo verifica
If VerifyTrfData(nMoveId) And EgtVerifyPart(nMoveId, CurrentMachine.bReducedCut) Then
EstCalc.ResetOrderMachiningFlag()
' Non superata riporto alla posizione iniziale
Else Else
' forzo il reset delle info di rotazione
m_dStartAng = 0
m_dAngTotal = 0
m_bStartRot = False
End If
VerifyMove()
' verifico se la posizione finale della rotazione è corretta ----- ROTAZIONE
ElseIf m_bStartRot And Not m_bStartMove Then
If m_bFromParking Then If m_bFromParking Then
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage() VerifyMove()
PreRemoveOnePart(nMoveId) ' forzo il reset delle info di rotazione
VeinMatching.OnRemovePartFromRaw(nMoveId) m_dStartAng = 0
m_dAngTotal = 0
m_bStartRot = False
Else Else
EgtMove(nMoveId, -m_vtTotMove) VerifyRot()
' Eventuale notifica al VeinMatching
If nMoveId = GDB_ID.SEL Then
Dim nId As Integer = EgtGetFirstSelectedObj()
While nId <> GDB_ID.NULL
VeinMatching.OnMovePartInRaw(nId)
nId = EgtGetNextSelectedObj()
End While
Else
VeinMatching.OnMovePartInRaw(nMoveId)
End If End If
End If
'---------------------- COUNTER PART ----------------------
Dim sRefGroup As String = String.Empty
If EgtGetInfo(nMoveId, INFO_REFGROUP, sRefGroup) Then
' accendo il layer che contiene il contatore (spento in fase di Drag)
Dim nCounterLayer As Integer = EgtGetFirstNameInGroup(nMoveId, INFO_COUNTERLY)
EgtSetStatus(nCounterLayer, GDB_ST.ON_)
' aggiorno il layer che indica il numero di pezzi in parcheggio
CountPartInFamily(sRefGroup)
End If
'---------------------- COUNTER PART ----------------------
End If
m_bFromParking = False
' altrimenti caso con verifica durante il movimento
Else Else
' Basta reset alla fine ' Basta reset alla fine
End If End If
+1
View File
@@ -14,6 +14,7 @@
<OmagOFFICE:ShowPanelV DataContext="{StaticResource ShowPanelVM}"/> <OmagOFFICE:ShowPanelV DataContext="{StaticResource ShowPanelVM}"/>
<OmagOFFICE:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/> <OmagOFFICE:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
<OmagOFFICE:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/> <OmagOFFICE:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
<OmagOFFICE:PrintPanelV DataContext="{StaticResource PrintPanelVM}"/>
<OmagOFFICE:VeinMatchPanelV DataContext="{StaticResource VeinMatchPanelVM}"/> <OmagOFFICE:VeinMatchPanelV DataContext="{StaticResource VeinMatchPanelVM}"/>
<OmagOFFICE:MachinePanelV DataContext="{StaticResource MachinePanelVM}"/> <OmagOFFICE:MachinePanelV DataContext="{StaticResource MachinePanelVM}"/>
</EgtFloating:EgtFloatingTray> </EgtFloating:EgtFloatingTray>
+4
View File
@@ -1,3 +1,7 @@
Public Class ProjectV Public Class ProjectV
Private Sub LoadPage() Handles Me.Loaded
OmagOFFICEMap.SetRefProjectV(Me)
End Sub
End Class End Class
Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

+1
View File
@@ -18,6 +18,7 @@
<EgtWPFLib5:ShowPanelVM x:Key="ShowPanelVM"/> <EgtWPFLib5:ShowPanelVM x:Key="ShowPanelVM"/>
<EgtWPFLib5:ViewPanelVM x:Key="ViewPanelVM"/> <EgtWPFLib5:ViewPanelVM x:Key="ViewPanelVM"/>
<EgtWPFLib5:InstrumentPanelVM x:Key="InstrumentPanelVM"/> <EgtWPFLib5:InstrumentPanelVM x:Key="InstrumentPanelVM"/>
<OmagOFFICE:PrintPanelVM x:Key="PrintPanelVM"/>
<OmagOFFICE:MyMachinePanelVM x:Key="MachinePanelVM"/> <OmagOFFICE:MyMachinePanelVM x:Key="MachinePanelVM"/>
<OmagOFFICE:VeinMatchPanelVM x:Key="VeinMatchPanelVM"/> <OmagOFFICE:VeinMatchPanelVM x:Key="VeinMatchPanelVM"/>
<OmagOFFICE:OptionPanelVM x:Key="OptionPanelVM"/> <OmagOFFICE:OptionPanelVM x:Key="OptionPanelVM"/>
+38
View File
@@ -1,5 +1,6 @@
Imports EgtWPFLib5 Imports EgtWPFLib5
Imports EgtPHOTOLib Imports EgtPHOTOLib
Imports EgtUILib
Module OmagOFFICEMap Module OmagOFFICEMap
@@ -229,6 +230,43 @@ Module OmagOFFICEMap
Return Not IsNothing(m_refSimulTabVM) Return Not IsNothing(m_refSimulTabVM)
End Function End Function
Private m_refProjectV As ProjectV
Friend Sub SetRefProjectV(ProjectV As ProjectV)
m_refProjectV = ProjectV
End Sub
Private m_WidthProjectV As Integer = 2000
Friend Sub SetWidthDimProjectV(Width As Integer)
m_WidthProjectV = Width
End Sub
Friend Function GetWidthDimProjectV() As Integer
If Not IsNothing(m_refProjectV) Then
Try
m_WidthProjectV = CInt(m_refProjectV.ActualWidth)
Catch ex As Exception
EgtOutLog(ex.Message)
End Try
End If
Return m_WidthProjectV
End Function
Private m_HeightProjectV As Integer = 1000
Friend Sub SetHeightDimProjectV(Eight As Integer)
m_HeightProjectV = Eight
End Sub
Friend Function GetHeightDimProjectV() As Integer
If Not IsNothing(m_refProjectV) Then
Try
m_HeightProjectV = CInt(m_refProjectV.ActualHeight)
Catch ex As Exception
EgtOutLog(ex.Message)
End Try
End If
Return m_HeightProjectV
End Function
#End Region ' Set #End Region ' Set
#Region "Init" #Region "Init"