Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 753ff7b4f1 | |||
| 1edfe486cb | |||
| 7190993f11 | |||
| 249289144f | |||
| 36ee5e4352 | |||
| 147099b702 | |||
| dd81384bb8 | |||
| 9cf61d691d | |||
| 358c5df390 | |||
| ccaec9af5a | |||
| 1dbecd0083 | |||
| 11c6f95378 | |||
| 3604a85cc1 | |||
| 3aaaa0fcb6 | |||
| 52da2bc2c9 | |||
| 4de476907f | |||
| 07bcb7479b | |||
| 92818aafd4 | |||
| f4326b27b7 | |||
| 1f4a0afd75 |
@@ -92,11 +92,12 @@ Public Module SplitAuto
|
||||
Mach.m_dStartFreeLen = FREELEN_INF + 1
|
||||
Mach.m_dEndFreeLen = FREELEN_INF + 1
|
||||
Dim nEntId, nSub As Integer
|
||||
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
|
||||
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)
|
||||
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)
|
||||
|
||||
@@ -444,15 +444,14 @@ Module VacuumCups
|
||||
Dim dLen, dAngVertDeg, dAngOrizzDeg As Double
|
||||
frMinRect.VersX().ToSpherical(dLen, dAngVertDeg, dAngOrizzDeg)
|
||||
dRotAngDeg = dAngOrizzDeg
|
||||
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
|
||||
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
|
||||
dPreferredRot = m_dPrefVertRotXMinus
|
||||
Else
|
||||
dPreferredRot = m_dPrefVertRotXPlus
|
||||
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
|
||||
If frMinRect.Orig().y < b3Tab.Center().y Then
|
||||
dPreferredRot = m_dPrefVertRotYPlus
|
||||
@@ -460,6 +459,7 @@ Module VacuumCups
|
||||
dPreferredRot = m_dPrefVertRotYMinus
|
||||
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)
|
||||
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
|
||||
dRotAngDeg -= dAngDelta
|
||||
@@ -530,6 +530,13 @@ Module VacuumCups
|
||||
Return dDist
|
||||
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
|
||||
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
|
||||
Dim dX, dY, dZ As Double
|
||||
|
||||
@@ -29,6 +29,13 @@ Public Class VeinMatchingWindow
|
||||
Private m_locPrev As System.Drawing.Point
|
||||
Private m_ptPrev 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)
|
||||
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
||||
|
||||
@@ -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>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class PrintPanelV
|
||||
|
||||
End Class
|
||||
@@ -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
|
||||
@@ -223,8 +223,8 @@ Public Class MainWindowM
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNestOption = Not String.IsNullOrWhiteSpace( sNestKey)
|
||||
' Recupero livello e opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2410, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2410, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2502, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2502, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
|
||||
@@ -29,8 +29,8 @@ Imports System.Windows
|
||||
#End If
|
||||
#End If
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("OmagOFFICE")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2017-2022 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("OmagOFFICE")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2017-2023 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(false)>
|
||||
'In order to begin building localizable applications, set
|
||||
@@ -69,6 +69,6 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.10.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.10.1")>
|
||||
<Assembly: AssemblyVersion("2.5.2.1")>
|
||||
<Assembly: AssemblyFileVersion("2.5.2.1")>
|
||||
|
||||
|
||||
@@ -213,7 +213,11 @@
|
||||
<Compile Include="EgtStoneLib\VeinMatchingWindow.xaml.vb">
|
||||
<DependentUpon>VeinMatchingWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="InstrumentPanel\PrintPanelV.xaml.vb">
|
||||
<DependentUpon>PrintPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="InstrumentPanel\MyInstrumentPanelVM.vb" />
|
||||
<Compile Include="InstrumentPanel\PrintPanelVM.vb" />
|
||||
<Compile Include="MachinePanel\MyMachinePanelVM.vb" />
|
||||
<Compile Include="MyMachGroupPanel\MyMachGroupPanelVM.vb" />
|
||||
<Compile Include="MachinePanel\MachinePanelV.xaml.vb">
|
||||
@@ -389,6 +393,10 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="InstrumentPanel\PrintPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MachinePanel\MachinePanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -691,6 +699,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\TopCommandBar\DxfOut.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\InstrumentPanel\Print.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagOFFICE\OmagOFFICER32.exe
|
||||
|
||||
@@ -450,7 +450,7 @@ Public Class SplitModeVM
|
||||
m_nDragInd = -1
|
||||
m_nDragType = 0
|
||||
' 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
|
||||
EstCalc.HideParkedParts()
|
||||
' Nascondo eventuale contorno da foto
|
||||
|
||||
@@ -31,6 +31,13 @@ Public Class NestingTabVM
|
||||
Private m_ptPrev As Point3d
|
||||
Private m_vtTotMove As Vector3d
|
||||
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
|
||||
Private m_bTrfData As Boolean = False
|
||||
Private m_bCsvData As Boolean = False
|
||||
@@ -151,7 +158,7 @@ Public Class NestingTabVM
|
||||
End Get
|
||||
Set(value As Visibility)
|
||||
m_CsvData_Visibility = value
|
||||
NotifyPropertyChanged( "CsvData_Visibility")
|
||||
NotifyPropertyChanged("CsvData_Visibility")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -270,7 +277,7 @@ Public Class NestingTabVM
|
||||
|
||||
Friend Function InitNesting() As Boolean
|
||||
' Se previsto, abilito bottone VeinMatching
|
||||
If Not IsNothing( OmagOFFICEMap.refMainWindowVM.VeinMatchingWnd) Then
|
||||
If Not IsNothing(OmagOFFICEMap.refMainWindowVM.VeinMatchingWnd) Then
|
||||
OmagOFFICEMap.refVeinMatchPanelVM.VeinMatchIsEnabled = True
|
||||
End If
|
||||
' Abilitazione TrfData
|
||||
@@ -280,7 +287,7 @@ Public Class NestingTabVM
|
||||
m_bCsvData = Not m_bTrfData And
|
||||
(GetMainPrivateProfileInt(S_COMPO, K_CSVDATA, 0) <> 0)
|
||||
' Se previsto, abilito bottone CsvData
|
||||
CsvData_Visibility = If( m_bCsvData, Visibility.Visible, Visibility.Collapsed)
|
||||
CsvData_Visibility = If(m_bCsvData, Visibility.Visible, Visibility.Collapsed)
|
||||
' Imposto il corretto contesto
|
||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||
' aggiorno dati del grezzo
|
||||
@@ -358,7 +365,7 @@ Public Class NestingTabVM
|
||||
|
||||
Private Sub AutomaticInsert()
|
||||
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage( EgtMsg( 90340)) ' Nesting Automatico in corso
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(90340)) ' Nesting Automatico in corso
|
||||
Dim bWrongTrf As Boolean = False
|
||||
Dim vParts As New List(Of Integer)
|
||||
' Ciclo di pre-inserimento in tavola dei pezzi selezionati
|
||||
@@ -376,7 +383,7 @@ Public Class NestingTabVM
|
||||
End If
|
||||
' Lo preparo in tavola, se possibile
|
||||
If PreInsertOnePart(nId) Then
|
||||
vParts.Add( nId)
|
||||
vParts.Add(nId)
|
||||
Else
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
VeinMatching.OnDeselectPart(nId)
|
||||
@@ -391,12 +398,12 @@ Public Class NestingTabVM
|
||||
Dim bAligned As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_NEST_ALIGNED, 0, CurrentMachine.sMachIniFile) <> 0)
|
||||
EnableReferenceRegion(bAligned)
|
||||
' Eseguo nesting automatico
|
||||
Dim bOpimizeOnX As Boolean = ( GetMainPrivateProfileInt( S_NEST, K_AUTOMATICOPTIMIZE, 2) = 1)
|
||||
Dim bOpimizeOnX As Boolean = (GetMainPrivateProfileInt(S_NEST, K_AUTOMATICOPTIMIZE, 2) = 1)
|
||||
Dim bGuillotineMode As Boolean = bAligned
|
||||
Dim nAutomaticMaxTime As Integer = GetMainPrivateProfileInt( S_NEST, K_AUTOMATICMAXTIME, 20)
|
||||
Dim dPartTime As Double = If( bGuillotineMode, 1.0, 0.5)
|
||||
Dim nMaxTime As Integer = Math.Min( CInt( 2 + dPartTime * vParts.Count()), nAutomaticMaxTime)
|
||||
EgtAutomaticPackParts( vParts, bOpimizeOnX, CurrentMachine.bReducedCut, bGuillotineMode, nMaxTime)
|
||||
Dim nAutomaticMaxTime As Integer = GetMainPrivateProfileInt(S_NEST, K_AUTOMATICMAXTIME, 20)
|
||||
Dim dPartTime As Double = If(bGuillotineMode, 1.0, 0.5)
|
||||
Dim nMaxTime As Integer = Math.Min(CInt(2 + dPartTime * vParts.Count()), nAutomaticMaxTime)
|
||||
EgtAutomaticPackParts(vParts, bOpimizeOnX, CurrentMachine.bReducedCut, bGuillotineMode, nMaxTime)
|
||||
' Sistemo i pezzi
|
||||
For Each nPartId As Integer In vParts
|
||||
' se pezzo inserito
|
||||
@@ -404,11 +411,11 @@ Public Class NestingTabVM
|
||||
VeinMatching.OnInsertPartInRaw(nPartId)
|
||||
' Eventuale aggiunta solido per taglio da sotto
|
||||
UpdateSolidForDrip(nPartId)
|
||||
' altrimenti rifiutato
|
||||
else
|
||||
' altrimenti rifiutato
|
||||
Else
|
||||
' Ripristino lo stato originale
|
||||
PreRemoveOnePart( Math.Abs( nPartId))
|
||||
VeinMatching.OnDeselectPart( Math.Abs( nPartId))
|
||||
PreRemoveOnePart(Math.Abs(nPartId))
|
||||
VeinMatching.OnDeselectPart(Math.Abs(nPartId))
|
||||
End If
|
||||
Next
|
||||
' Aggiorno flag selezionati
|
||||
@@ -423,6 +430,93 @@ Public Class NestingTabVM
|
||||
End If
|
||||
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
|
||||
' Se non ci sono pezzi selezionati, esco
|
||||
If EgtGetSelectedObjCount() = 0 Then Return True
|
||||
@@ -432,7 +526,7 @@ Public Class NestingTabVM
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Se pezzo con rotazione libera
|
||||
If Not EgtExistsInfo( nId, INFO_PARTROT) Then
|
||||
If Not EgtExistsInfo(nId, INFO_PARTROT) Then
|
||||
' Calcolo il centro di rotazione come centro del pezzo
|
||||
Dim ptCen As Point3d
|
||||
If Not EgtGetPartPartClusterCenterGlob(nId, ptCen) Then Return False
|
||||
@@ -466,40 +560,22 @@ Public Class NestingTabVM
|
||||
nId = EgtGetNextSelectedObj()
|
||||
End While
|
||||
Return True
|
||||
' Altrimenti li ruoto tenendo conto delle collisioni
|
||||
' Altrimenti li ruoto tenendo conto delle collisioni
|
||||
Else
|
||||
' Verifico se ci sono dei pezzi bloccati in rotazione
|
||||
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
|
||||
Return RotatePartInsideBond(dAngRotDeg, GDB_ID.SEL)
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Function GetLockOnRotation( nPartId As Integer) As Boolean
|
||||
Private Function GetLockOnRotation(nPartId As Integer) As Boolean
|
||||
' Se singolo pezzo
|
||||
If nPartId <> GDB_ID.SEL Then
|
||||
Return EgtExistsInfo( nPartId, INFO_PARTROT)
|
||||
' Altrimenti tutti i selezionati
|
||||
Return EgtExistsInfo(nPartId, INFO_PARTROT)
|
||||
' Altrimenti tutti i selezionati
|
||||
Else
|
||||
Dim bLockedRot As Boolean = False
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
If EgtExistsInfo( nId, INFO_PARTROT) Then
|
||||
If EgtExistsInfo(nId, INFO_PARTROT) Then
|
||||
bLockedRot = True
|
||||
Exit While
|
||||
End If
|
||||
@@ -564,13 +640,13 @@ Public Class NestingTabVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function ExitNesting( bChange As Boolean) As Boolean
|
||||
Friend Function ExitNesting(bChange As Boolean) As Boolean
|
||||
If m_CsvImport_IsChecked Then
|
||||
m_CsvImportWindow.Close()
|
||||
m_CsvImportWindow = Nothing
|
||||
End If
|
||||
If bChange Then
|
||||
OmagOFFICEMap.refVeinMatchPanelVM.SetVeinMatchIsChecked( False)
|
||||
OmagOFFICEMap.refVeinMatchPanelVM.SetVeinMatchIsChecked(False)
|
||||
OmagOFFICEMap.refVeinMatchPanelVM.VeinMatchIsEnabled = False
|
||||
End If
|
||||
Return True
|
||||
@@ -1341,22 +1417,22 @@ Public Class NestingTabVM
|
||||
If EgtGetSelectedObjCount() = 0 OrElse m_nPartPos <> PART_POS.OUT_TABLE Then Return
|
||||
' Tolgo blocco rotazione sui pezzi selezionati
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
While nId <> GDB_ID.NULL
|
||||
' Se rotazione bloccata, tolgo blocco e aggiorno info
|
||||
If EgtExistsInfo( nId, INFO_PARTROT) Then
|
||||
If EgtExistsInfo(nId, INFO_PARTROT) Then
|
||||
' Rimuovo flag di rotazione bloccata
|
||||
EgtRemoveInfo( nId, INFO_PARTROT)
|
||||
EgtRemoveInfo(nId, INFO_PARTROT)
|
||||
' Tolgo da info sul pezzo Codice
|
||||
Dim nTextId As Integer = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nId, NAME_REGION))
|
||||
Dim nTextId As Integer = EgtGetFirstInGroup(EgtGetFirstNameInGroup(nId, NAME_REGION))
|
||||
While nTextId <> GDB_ID.NULL
|
||||
If EgtGetType( nTextId) = GDB_TY.EXT_TEXT Then
|
||||
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
|
||||
Dim sText As String = ""
|
||||
EgtTextGetContent( nTextId, sText)
|
||||
sText = sText.Replace( "<br/>(X)", "")
|
||||
EgtModifyText( nTextId, sText)
|
||||
EgtTextGetContent(nTextId, sText)
|
||||
sText = sText.Replace("<br/>(X)", "")
|
||||
EgtModifyText(nTextId, sText)
|
||||
Exit While
|
||||
End If
|
||||
nTextId = EgtGetNext( nTextId)
|
||||
nTextId = EgtGetNext(nTextId)
|
||||
End While
|
||||
End If
|
||||
' Passo al successivo selezionato
|
||||
@@ -1385,22 +1461,22 @@ Public Class NestingTabVM
|
||||
If EgtGetSelectedObjCount() = 0 OrElse m_nPartPos <> PART_POS.OUT_TABLE Then Return
|
||||
' Metto blocco rotazione sui pezzi selezionati
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
While nId <> GDB_ID.NULL
|
||||
' Se rotazione libera, applico blocco e aggiorno info
|
||||
If Not EgtExistsInfo( nId, INFO_PARTROT) Then
|
||||
If Not EgtExistsInfo(nId, INFO_PARTROT) Then
|
||||
' Imposto flag di rotazione bloccata
|
||||
EgtSetInfo( nId, INFO_PARTROT, 0)
|
||||
EgtSetInfo(nId, INFO_PARTROT, 0)
|
||||
' Inserisco in info sul pezzo Codice
|
||||
Dim nTextId As Integer = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nId, NAME_REGION))
|
||||
Dim nTextId As Integer = EgtGetFirstInGroup(EgtGetFirstNameInGroup(nId, NAME_REGION))
|
||||
While nTextId <> GDB_ID.NULL
|
||||
If EgtGetType( nTextId) = GDB_TY.EXT_TEXT Then
|
||||
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
|
||||
Dim sText As String = ""
|
||||
EgtTextGetContent( nTextId, sText)
|
||||
EgtTextGetContent(nTextId, sText)
|
||||
sText &= "<br/>(X)"
|
||||
EgtModifyText( nTextId, sText)
|
||||
EgtModifyText(nTextId, sText)
|
||||
Exit While
|
||||
End If
|
||||
nTextId = EgtGetNext( nTextId)
|
||||
nTextId = EgtGetNext(nTextId)
|
||||
End While
|
||||
End If
|
||||
' Passo al successivo selezionato
|
||||
@@ -1436,7 +1512,7 @@ Public Class NestingTabVM
|
||||
Dim bAlignMoved As Boolean = False
|
||||
Dim bSnapMoved As Boolean = False
|
||||
If m_bMagnetic Then
|
||||
If Not GetLockOnRotation( GDB_ID.SEL) Then
|
||||
If Not GetLockOnRotation(GDB_ID.SEL) Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
End If
|
||||
If m_dSnapDist > EPS_SMALL Then
|
||||
@@ -1480,7 +1556,7 @@ Public Class NestingTabVM
|
||||
Dim bAlignMoved As Boolean = False
|
||||
Dim bSnapMoved As Boolean = False
|
||||
If m_bMagnetic Then
|
||||
If Not GetLockOnRotation( GDB_ID.SEL) Then
|
||||
If Not GetLockOnRotation(GDB_ID.SEL) Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
End If
|
||||
If m_dSnapDist > EPS_SMALL Then
|
||||
@@ -1524,7 +1600,7 @@ Public Class NestingTabVM
|
||||
Dim bAlignMoved As Boolean = False
|
||||
Dim bSnapMoved As Boolean = False
|
||||
If m_bMagnetic Then
|
||||
If Not GetLockOnRotation( GDB_ID.SEL) Then
|
||||
If Not GetLockOnRotation(GDB_ID.SEL) Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
End If
|
||||
If m_dSnapDist > EPS_SMALL Then
|
||||
@@ -1568,7 +1644,7 @@ Public Class NestingTabVM
|
||||
Dim bAlignMoved As Boolean = False
|
||||
Dim bSnapMoved As Boolean = False
|
||||
If m_bMagnetic Then
|
||||
If Not GetLockOnRotation( GDB_ID.SEL) Then
|
||||
If Not GetLockOnRotation(GDB_ID.SEL) Then
|
||||
EgtAlignPartOnCollision(GDB_ID.SEL, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
End If
|
||||
If m_dSnapDist > EPS_SMALL Then
|
||||
@@ -1656,7 +1732,7 @@ Public Class NestingTabVM
|
||||
If CurrentMachine.bAutomatic And
|
||||
OmagOFFICEMap.refMainWindowVM.MainWindowM.AutoNestOption() Then
|
||||
AutomaticInsert()
|
||||
' altrimenti inserimento standard
|
||||
' altrimenti inserimento standard
|
||||
Else
|
||||
StandardInsert()
|
||||
End If
|
||||
@@ -1949,44 +2025,44 @@ Public Class NestingTabVM
|
||||
' Deseleziono eventuali altri
|
||||
If EgtGetNextSelectedObj() <> GDB_ID.NULL Then
|
||||
EgtDeselectAll()
|
||||
EgtSelectObj( nPartId)
|
||||
EgtSelectObj(nPartId)
|
||||
EgtDraw()
|
||||
End If
|
||||
' Recupero dati del pezzo
|
||||
Dim sCsvOrder As String = "" : EgtGetInfo( nPartId, INFO_CSV_ORD, sCsvOrder)
|
||||
Dim sCsvList As String = "" : EgtGetInfo( nPartId, INFO_CSV_DIST, sCsvList)
|
||||
Dim sCsvName As String = "" : EgtGetInfo( nPartId, INFO_CSV_PART, sCsvName)
|
||||
Dim sCsvOrder As String = "" : EgtGetInfo(nPartId, INFO_CSV_ORD, sCsvOrder)
|
||||
Dim sCsvList As String = "" : EgtGetInfo(nPartId, INFO_CSV_DIST, sCsvList)
|
||||
Dim sCsvName As String = "" : EgtGetInfo(nPartId, INFO_CSV_PART, sCsvName)
|
||||
' Avvio dialogo modifica
|
||||
Dim DlgCsvDataVM As New CompoCsvDataWindowVM()
|
||||
Dim DlgCsvDataV As New CompoCsvDataWindowV(Application.Current.MainWindow, DlgCsvDataVM)
|
||||
DlgCsvDataVM.SetData( sCsvOrder, sCsvList, sCsvName)
|
||||
DlgCsvDataVM.SetData(sCsvOrder, sCsvList, sCsvName)
|
||||
If DlgCsvDataV.ShowDialog() Then
|
||||
' Recupero i nuovi dati
|
||||
Dim sNewOrder As String = ""
|
||||
Dim sNewList As String = ""
|
||||
Dim sNewName As String = ""
|
||||
DlgCsvDataVM.GetData( sNewOrder, sNewList, sNewName)
|
||||
DlgCsvDataVM.GetData(sNewOrder, sNewList, sNewName)
|
||||
' Assegno i nuovi dati
|
||||
EgtSetInfo( nPartId, INFO_CSV_ORD, sNewOrder)
|
||||
EgtSetInfo( nPartId, INFO_CSV_DIST, sNewList)
|
||||
EgtSetInfo( nPartId, INFO_CSV_PART, sNewName)
|
||||
EgtSetInfo(nPartId, INFO_CSV_ORD, sNewOrder)
|
||||
EgtSetInfo(nPartId, INFO_CSV_DIST, sNewList)
|
||||
EgtSetInfo(nPartId, INFO_CSV_PART, sNewName)
|
||||
' Se necessario, modifico la scritta
|
||||
If sNewName <> sCsvName Then
|
||||
Dim nRegLayId As Integer = EgtGetFirstNameInGroup( nPartId, NAME_REGION)
|
||||
Dim nRegLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_REGION)
|
||||
Dim nTextId = EgtGetFirstInGroup(nRegLayId)
|
||||
While nTextId <> GDB_ID.NULL
|
||||
If EgtGetType( nTextId) = GDB_TY.EXT_TEXT Then
|
||||
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
|
||||
Dim sText As String = String.Empty
|
||||
EgtTextGetContent( nTextId, sText)
|
||||
Dim nPos As Integer = sText.IndexOf( sCsvName)
|
||||
EgtTextGetContent(nTextId, sText)
|
||||
Dim nPos As Integer = sText.IndexOf(sCsvName)
|
||||
Dim sNewText As String
|
||||
If nPos <0 Then
|
||||
sNewText= sNewName & "<br/>" & sText
|
||||
If nPos < 0 Then
|
||||
sNewText = sNewName & "<br/>" & sText
|
||||
Else
|
||||
sNewText = sText.Remove( nPos, sCsvName.Length()).Insert( nPos, sNewName)
|
||||
sNewText = sText.Remove(nPos, sCsvName.Length()).Insert(nPos, sNewName)
|
||||
End If
|
||||
EgtModifyText( nTextId, sNewText)
|
||||
VeinMatching.ModifyPartText( nPartId, sNewText)
|
||||
EgtModifyText(nTextId, sNewText)
|
||||
VeinMatching.ModifyPartText(nPartId, sNewText)
|
||||
Exit While
|
||||
End If
|
||||
nTextId = EgtGetNext(nTextId)
|
||||
@@ -2081,6 +2157,7 @@ Public Class NestingTabVM
|
||||
m_bDrag = m_bDrag AndAlso EgtUnProjectPoint(e.Location, m_ptPrev)
|
||||
m_bDragToStart = m_bDrag
|
||||
m_bVerify = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) > 0
|
||||
m_bKeyLeftShiftPressed = m_bVerify
|
||||
m_vtTotMove = Vector3d.NULL()
|
||||
End Sub
|
||||
|
||||
@@ -2089,7 +2166,7 @@ Public Class NestingTabVM
|
||||
If Not m_bDrag Or m_bDragging Then Return
|
||||
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
|
||||
If m_bDragToStart Then
|
||||
If Math.Abs(e.Location.X - m_locPrev.X) <m_nRestRadius And
|
||||
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
|
||||
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Return
|
||||
End If
|
||||
@@ -2115,12 +2192,12 @@ Public Class NestingTabVM
|
||||
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_NESTPAGEUC + 7), MSG_TYPE.WARNING)
|
||||
End If
|
||||
' Applico le lavorazioni al pezzo
|
||||
Dim b3Curr As new BBox3d
|
||||
EgtGetBBoxGlob( EgtGetFirstNameInGroup(nTestId, NAME_REGION), BBFLAG, b3Curr)
|
||||
if Not EstCalc.PreInsertOnePart( nTestId) Then Return
|
||||
Dim b3Ins As new BBox3d
|
||||
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 b3Curr As New BBox3d
|
||||
EgtGetBBoxGlob(EgtGetFirstNameInGroup(nTestId, NAME_REGION), BBFLAG, b3Curr)
|
||||
If Not EstCalc.PreInsertOnePart(nTestId) Then Return
|
||||
Dim b3Ins As New BBox3d
|
||||
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)
|
||||
EgtMove(nMoveId, vtDiff)
|
||||
|
||||
'---------------------- COUNTER PART ----------------------
|
||||
@@ -2136,7 +2213,7 @@ Public Class NestingTabVM
|
||||
'---------------------- COUNTER PART ----------------------
|
||||
|
||||
' Gestione VeinMatching
|
||||
VeinMatching.OnInsertPartInRaw( nMoveId)
|
||||
VeinMatching.OnInsertPartInRaw(nMoveId)
|
||||
' Imposto stato
|
||||
m_bVerify = True
|
||||
m_bFromParking = True
|
||||
@@ -2146,46 +2223,108 @@ Public Class NestingTabVM
|
||||
' Ricavo il punto corrente in coordinate mondo
|
||||
Dim ptCurr As Point3d
|
||||
EgtUnProjectPoint(e.Location, ptCurr)
|
||||
' Ricavo il vettore di movimento
|
||||
Dim vtMove As Vector3d = ptCurr - m_ptPrev
|
||||
' Muovo i pezzi selezionati di quanto possibile
|
||||
If vtMove.SqLen() > EPS_SMALL * EPS_SMALL Then
|
||||
' Se movimento con sola verifica finale
|
||||
If m_bVerify Then
|
||||
EgtMove(nMoveId, vtMove)
|
||||
m_vtTotMove += vtMove
|
||||
' altrimenti caso con verifica durante il movimento
|
||||
Else
|
||||
' Aggiorno regioni per nesting
|
||||
UpdateNestRegions()
|
||||
EnableReferenceRegion(False)
|
||||
' muovo il pezzo
|
||||
EgtMovePart(nMoveId, CurrentMachine.bReducedCut, vtMove)
|
||||
EgtSaveCollInfo()
|
||||
' se movimento risultante nullo, provo con movimento tangente
|
||||
Dim bTgMoved As Boolean = False
|
||||
If vtMove.IsSmall() Then
|
||||
' riprovo con movimento tangente
|
||||
Dim vtTgMove As Vector3d = ptCurr - m_ptPrev
|
||||
EgtTgMovePartOnCollision(nMoveId, CurrentMachine.bReducedCut, vtTgMove)
|
||||
bTgMoved = (Not vtTgMove.IsSmall())
|
||||
End If
|
||||
' se abilitato magnetico (allineamento + snap), lo provo
|
||||
Dim bAlignMoved As Boolean = False
|
||||
Dim bSnapMoved As Boolean = False
|
||||
If m_bMagnetic Then
|
||||
If Not GetLockOnRotation( nMoveId) Then
|
||||
EgtAlignPartOnCollision(nMoveId, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
End If
|
||||
If m_dSnapDist > EPS_SMALL Then
|
||||
EgtRestoreCollInfo()
|
||||
EgtMovePartToSnapPointOnCollision(nMoveId, CurrentMachine.bReducedCut, m_dSnapDist, bSnapMoved)
|
||||
End If
|
||||
End If
|
||||
EstCalc.ResetOrderMachiningFlag()
|
||||
|
||||
' 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
|
||||
EgtDraw()
|
||||
' Eventuale notifica al VeinMatching
|
||||
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
|
||||
Dim vtMove As Vector3d = ptCurr - m_ptPrev
|
||||
' Muovo i pezzi selezionati di quanto possibile
|
||||
If vtMove.SqLen() > EPS_SMALL * EPS_SMALL Then
|
||||
' 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
|
||||
EgtMove(nMoveId, vtMove)
|
||||
m_vtTotMove += vtMove
|
||||
' altrimenti caso con verifica durante il movimento
|
||||
Else
|
||||
' Aggiorno regioni per nesting
|
||||
UpdateNestRegions()
|
||||
EnableReferenceRegion(False)
|
||||
' muovo il pezzo
|
||||
EgtMovePart(nMoveId, CurrentMachine.bReducedCut, vtMove)
|
||||
EgtSaveCollInfo()
|
||||
' se movimento risultante nullo, provo con movimento tangente
|
||||
Dim bTgMoved As Boolean = False
|
||||
If vtMove.IsSmall() Then
|
||||
' riprovo con movimento tangente
|
||||
Dim vtTgMove As Vector3d = ptCurr - m_ptPrev
|
||||
EgtTgMovePartOnCollision(nMoveId, CurrentMachine.bReducedCut, vtTgMove)
|
||||
bTgMoved = (Not vtTgMove.IsSmall())
|
||||
End If
|
||||
' se abilitato magnetico (allineamento + snap), lo provo
|
||||
Dim bAlignMoved As Boolean = False
|
||||
Dim bSnapMoved As Boolean = False
|
||||
If m_bMagnetic Then
|
||||
If Not GetLockOnRotation(nMoveId) Then
|
||||
EgtAlignPartOnCollision(nMoveId, CurrentMachine.bReducedCut, bAlignMoved)
|
||||
End If
|
||||
If m_dSnapDist > EPS_SMALL Then
|
||||
EgtRestoreCollInfo()
|
||||
EgtMovePartToSnapPointOnCollision(nMoveId, CurrentMachine.bReducedCut, m_dSnapDist, bSnapMoved)
|
||||
End If
|
||||
End If
|
||||
EstCalc.ResetOrderMachiningFlag()
|
||||
End If
|
||||
' -------------Fine TRASLAZIONE ---------------
|
||||
End If
|
||||
End If
|
||||
|
||||
EgtDraw()
|
||||
' Eventuale notifica al VeinMatching
|
||||
If m_bStartMove OrElse m_bStartRot Then
|
||||
If nMoveId = GDB_ID.SEL Then
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
@@ -2225,48 +2364,31 @@ Public Class NestingTabVM
|
||||
|
||||
' Se eseguito drag
|
||||
If Not m_bDragToStart Then
|
||||
' Se movimento con sola verifica finale
|
||||
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
|
||||
' Se movimento con sola verifica finale ----- TRASLAZIONE
|
||||
If Not m_bStartRot And m_bStartMove Then
|
||||
VerifyMove()
|
||||
' Se movimento con sola verifica finale ----- TRASLAZIONE + ROTAZIONE
|
||||
ElseIf m_bStartRot And m_bStartMove Then
|
||||
If Not m_bFromParking Then
|
||||
VerifyRot()
|
||||
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 ----------------------
|
||||
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 ----------------------
|
||||
' 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
|
||||
VerifyMove()
|
||||
' forzo il reset delle info di rotazione
|
||||
m_dStartAng = 0
|
||||
m_dAngTotal = 0
|
||||
m_bStartRot = False
|
||||
Else
|
||||
VerifyRot()
|
||||
End If
|
||||
m_bFromParking = False
|
||||
' altrimenti caso con verifica durante il movimento
|
||||
Else
|
||||
' Basta reset alla fine
|
||||
End If
|
||||
@@ -2320,7 +2442,7 @@ Public Class NestingTabVM
|
||||
' Con CANC cancello i pezzi selezionati
|
||||
If e.KeyData = System.Windows.Forms.Keys.Delete Then
|
||||
RemovePart()
|
||||
' Con INS eseguo inserimento dei pezzi selezionati in VeinMatching
|
||||
' Con INS eseguo inserimento dei pezzi selezionati in VeinMatching
|
||||
ElseIf e.KeyData = System.Windows.Forms.Keys.Insert Then
|
||||
' Vettore dei pezzi selezionati (l'inserimento di un pezzo in VM cancella la selezione)
|
||||
Dim vSel As New List(Of Integer)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<OmagOFFICE:ShowPanelV DataContext="{StaticResource ShowPanelVM}"/>
|
||||
<OmagOFFICE:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
|
||||
<OmagOFFICE:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
|
||||
<OmagOFFICE:PrintPanelV DataContext="{StaticResource PrintPanelVM}"/>
|
||||
<OmagOFFICE:VeinMatchPanelV DataContext="{StaticResource VeinMatchPanelVM}"/>
|
||||
<OmagOFFICE:MachinePanelV DataContext="{StaticResource MachinePanelVM}"/>
|
||||
</EgtFloating:EgtFloatingTray>
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
Public Class ProjectV
|
||||
|
||||
Private Sub LoadPage() Handles Me.Loaded
|
||||
OmagOFFICEMap.SetRefProjectV(Me)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 637 B |
@@ -18,6 +18,7 @@
|
||||
<EgtWPFLib5:ShowPanelVM x:Key="ShowPanelVM"/>
|
||||
<EgtWPFLib5:ViewPanelVM x:Key="ViewPanelVM"/>
|
||||
<EgtWPFLib5:InstrumentPanelVM x:Key="InstrumentPanelVM"/>
|
||||
<OmagOFFICE:PrintPanelVM x:Key="PrintPanelVM"/>
|
||||
<OmagOFFICE:MyMachinePanelVM x:Key="MachinePanelVM"/>
|
||||
<OmagOFFICE:VeinMatchPanelVM x:Key="VeinMatchPanelVM"/>
|
||||
<OmagOFFICE:OptionPanelVM x:Key="OptionPanelVM"/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtPHOTOLib
|
||||
Imports EgtUILib
|
||||
|
||||
Module OmagOFFICEMap
|
||||
|
||||
@@ -229,6 +230,43 @@ Module OmagOFFICEMap
|
||||
Return Not IsNothing(m_refSimulTabVM)
|
||||
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
|
||||
|
||||
#Region "Init"
|
||||
|
||||
Reference in New Issue
Block a user