Compare commits

..

23 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
NicolaP 565ba3c756 Gestione primo Engrave inclinato 2022-11-07 18:19:11 +01:00
NicolaP 7ab4e56594 Merge branch 'Features/StartEnd_Modify_On_Internal_Corner' into develop 2022-11-07 17:16:11 +01:00
NicolaP 697fb4c730 Gestioena modifica tagli su angoli interni 2022-11-07 17:09:47 +01:00
29 changed files with 677 additions and 1053 deletions
+2
View File
@@ -104,6 +104,7 @@ Module ConstIni
Public Const K_ENGRAVENUMBER2 As String = "EngraveNumber2"
Public Const K_ENGRAVEDEPTH As String = "EngraveDepth"
Public Const K_ENGRAVESHORT As String = "EngraveShort"
Public Const K_ENGRAVEANGLE As String = "EngraveAngle"
Public Const K_ENGRAVEDEPTH2 As String = "EngraveDepth2"
Public Const K_DRIPOFFSET As String = "DripOffset"
Public Const K_DRIPOFFSET2 As String = "DripOffset2"
@@ -125,6 +126,7 @@ Module ConstIni
Public Const K_AUTOMATICOPTIMIZE As String = "AutomaticOptimize"
Public Const K_AUTOMATICMAXTIME As String = "AutomaticMaxTime"
Public Const K_DRAGRECTANGLE As String = "DragRectangle"
Public Const K_STARTENDMODIFYONINTCORNER As String = "StartEndModifyOnIntCorner"
Public Const S_SPLIT As String = "Split"
Public Const K_MOVE_LEV As String = "MoveLevel"
+3
View File
@@ -326,6 +326,9 @@ Module ConstMach
Public Function COL_MCH_DRIPCUT() As Color3d
Return New Color3d(255, 0, 165)
End Function
Public Function COL_MCH_ONENGRAVE_ANG() As Color3d
Return New Color3d(255, 255, 100)
End Function
Public Function COL_MCH_DRIPFREE() As Color3d
Return New Color3d(192, 0, 128)
End Function
+6 -5
View File
@@ -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)
+10 -3
View File
@@ -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
+7
View File
@@ -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
+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
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
+4 -4
View File
@@ -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")>
+9 -18
View File
@@ -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">
@@ -235,10 +239,6 @@
<DependentUpon>MyToolDbWindowV.xaml</DependentUpon>
</Compile>
<Compile Include="MyToolDbWindow\MyToolDbWindowVM.vb" />
<Compile Include="OptionPanel\MachiningTab\FinalMoveRawModeV.xaml.vb">
<DependentUpon>FinalMoveRawModeV.xaml</DependentUpon>
</Compile>
<Compile Include="OptionPanel\MachiningTab\FinalMoveRawModeVM.vb" />
<Compile Include="OptionPanel\MachiningTab\MachiningTabV.xaml.vb">
<DependentUpon>MachiningTabV.xaml</DependentUpon>
</Compile>
@@ -393,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>
@@ -425,10 +429,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="OptionPanel\MachiningTab\FinalMoveRawModeV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OptionPanel\MachiningTab\MachiningTabV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -700,16 +700,7 @@
<Resource Include="Resources\TopCommandBar\DxfOut.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NestingTab\BottomLeft.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NestingTab\BottomRight.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NestingTab\TopLeft.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NestingTab\TopRight.png" />
<Resource Include="Resources\InstrumentPanel\Print.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
@@ -1,72 +0,0 @@
<UserControl x:Class="FinalMoveRawModeV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">
<StackPanel IsEnabled="{Binding SplitModeIsEnabled}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Button Name="TopLBtn" Grid.Column="0" Grid.Row="0"
Style="{StaticResource OptionPanel_NestingButton}"
Command="{Binding TopLeftCommand}">
<Image Source="/Resources/NestingTab/TopLeft.png" Stretch="Uniform"/>
</Button>
<Button Name="TopRBtn" Grid.Column="2" Grid.Row="0"
Style="{StaticResource OptionPanel_NestingButton}"
Command="{Binding TopRightCommand}">
<Image Source="/Resources/NestingTab/TopRight.png" Stretch="Uniform"/>
</Button>
<Button Name="ResetBtn" Grid.Column="1" Grid.Row="1"
Content="Reset"
Style="{StaticResource OptionPanel_NestingButton}"
Command="{Binding ResetCommand}">
</Button>
<Button Name="BottomLBtn" Grid.Column="0" Grid.Row="2"
Style="{StaticResource OptionPanel_NestingButton}"
Command="{Binding BottomLeftCommand}">
<Image Source="/Resources/NestingTab/BottomLeft.png" Stretch="Uniform"/>
</Button>
<Button Name="BottomRBtn" Grid.Column="2" Grid.Row="2"
Style="{StaticResource OptionPanel_NestingButton}"
Command="{Binding BottomRightCommand}">
<Image Source="/Resources/NestingTab/BottomRight.png" Stretch="Uniform"/>
</Button>
</Grid>
<Border Margin="0,0,0,5" Style="{StaticResource Border}">
<StackPanel>
<UniformGrid Columns="3" Margin="0,0,0,5">
<Button Visibility="Hidden"
Margin="0,0,2.5,0" Padding="0"/>
<Button Content="{Binding PauseMsg}"
Style="{StaticResource OptionPanel_TextWrapButton}"
Command="{Binding PauseCommand}"
IsEnabled="{Binding PauseBtnIsEnable}"
Margin="2.5,2.5,2.5,0"/>
<Button Visibility="Hidden"
Margin="2.5,0,0,0"/>
</UniformGrid>
</StackPanel>
</Border>
</StackPanel>
</UserControl>
@@ -1,3 +0,0 @@
Public Class FinalMoveRawModeV
End Class
@@ -1,186 +0,0 @@
Imports EgtUILib
Imports EgtWPFLib5
Public Class FinalMoveRawModeVM
#Region "FIELDS and PROPERTIES"
Public ReadOnly Property PauseMsg As String
Get
Return "Pause"
End Get
End Property
Private m_PauseBtnIsEnable As Boolean = True
Public Property PauseBtnIsEnable As Boolean
Get
Return m_PauseBtnIsEnable
End Get
Set(value As Boolean)
m_PauseBtnIsEnable = value
End Set
End Property
#End Region ' FIELDS and PROPERTIES
#Region "CONSTRUCTOR"
Private m_nAuxTabId As Integer = GDB_ID.NULL
Public ReadOnly Property nAuxTabId As Integer
Get
Return m_nAuxTabId
End Get
End Property
Sub New()
' Creo riferimento a questa classe in OmagOFFICEMap
OmagOFFICEMap.SetRefFinalMoveRawModeVM(Me)
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
' inizializzo i dati della tavola ausiliaria all'interno della fase corrente
Public Function SetAuxTabInCurrDisposition() As Boolean
Dim bOk As Boolean = False
' OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
m_nAuxTabId = EgtGetTableId(AUX_TAB)
' Visualizzo tavolo ausiliario
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If bOldEnMod Then EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.ON_)
If bOldEnMod Then EgtEnableModified()
' Area tavolo ausiliario
Dim b3AuxTab As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
' Area tavolo principale
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
' Imposto offset su tavolo principale per includere anche il secondario
Dim dOffsXP As Double = Math.Max(b3AuxTab.Max().x - b3Tab.Max().x, 0)
Dim dOffsYP As Double = Math.Max(b3AuxTab.Max().y - b3Tab.Max().y, 0)
Dim dOffsXM As Double = Math.Max(b3Tab.Min().x - b3AuxTab.Min().x, 0)
Dim dOffsYM As Double = Math.Max(b3Tab.Min().y - b3AuxTab.Min().y, 0)
bOk = EgtSetTableAreaOffset(dOffsXP, dOffsYP, dOffsXM, dOffsYM)
EgtZoom(ZM.ALL)
Return bOk
End Function
#End Region ' METHODS
' Definizione comandi
Private m_cmdTopLeft As ICommand
Private m_cmdTopRight As ICommand
Private m_cmdBottomLeft As ICommand
Private m_cmdBottomRight As ICommand
Private m_cmdReset As ICommand
Private m_cmdPause As ICommand
Public Function Init() As Boolean
Return SetAuxTabInCurrDisposition()
End Function
#Region "TopLeft"
Public ReadOnly Property TopLeftCommand As ICommand
Get
If m_cmdTopLeft Is Nothing Then
m_cmdTopLeft = New Command(AddressOf TopLeft)
End If
Return m_cmdTopLeft
End Get
End Property
Public Sub TopLeft(ByVal param As Object)
OmagOFFICEMap.refMoveRawModeVM.MoveOnRef("REF4", MCH_CR.TL)
End Sub
#End Region ' TopLeft
#Region "TopRight"
Public ReadOnly Property TopRightCommand As ICommand
Get
If m_cmdTopRight Is Nothing Then
m_cmdTopRight = New Command(AddressOf TopRight)
End If
Return m_cmdTopRight
End Get
End Property
Public Sub TopRight(ByVal param As Object)
OmagOFFICEMap.refMoveRawModeVM.MoveOnRef("REF3", MCH_CR.TR)
'' salvo il file per verifica che siano stati salvati i dati di movimentazione del pezzo
'EgtSaveFile("c:\EgtData\OmagOFFICE\Temp\FINALRAWMOVE_02.nge", NGE.TEXT)
End Sub
#End Region ' TopRight
#Region "BottomLeft"
Public ReadOnly Property BottomLeftCommand As ICommand
Get
If m_cmdBottomLeft Is Nothing Then
m_cmdBottomLeft = New Command(AddressOf BottomLeft)
End If
Return m_cmdBottomLeft
End Get
End Property
Public Sub BottomLeft(ByVal param As Object)
OmagOFFICEMap.refMoveRawModeVM.MoveOnRef("REF1", MCH_CR.BL)
End Sub
#End Region ' Bottomleft
#Region "BottomRight"
Public ReadOnly Property BottomRightCommand As ICommand
Get
If m_cmdBottomRight Is Nothing Then
m_cmdBottomRight = New Command(AddressOf BottomRight)
End If
Return m_cmdBottomRight
End Get
End Property
Public Sub BottomRight(ByVal param As Object)
OmagOFFICEMap.refMoveRawModeVM.MoveOnRef("REF2", MCH_CR.BR)
End Sub
#End Region ' BottomRight
#Region "Reset"
Public ReadOnly Property ResetCommand As ICommand
Get
If m_cmdReset Is Nothing Then
m_cmdReset = New Command(AddressOf Reset)
End If
Return m_cmdReset
End Get
End Property
Public Sub Reset(ByVal param As Object)
OmagOFFICEMap.refMoveRawModeVM.ResetFinaleMove()
End Sub
#End Region ' Reset
#Region "Pause"
Public ReadOnly Property PauseCommand As ICommand
Get
If m_cmdPause Is Nothing Then
m_cmdPause = New Command(AddressOf Pause)
End If
Return m_cmdPause
End Get
End Property
Public Sub Pause(ByVal param As Object)
' inserire il libreria questa nuova funzionalità per l'inserimento di una nuova fase
OmagOFFICEMap.refMoveRawModeVM.InsertPause()
End Sub
#End Region ' Pause
End Class
+5 -222
View File
@@ -6,50 +6,6 @@ Public Class MachiningTabVM
#Region "FIELDS & PROPERTIES"
' Fase corrente
Private m_nCurrPhase As Integer = 0
Public Property nCurrPhase As Integer
Get
Return m_nCurrPhase
End Get
Set(value As Integer)
m_nCurrPhase = value
End Set
End Property
' Disposizione corrente
Private m_nCurrDisposition As Integer = GDB_ID.NULL
Public Property nCurrDisposition As Integer
Get
Return m_nCurrDisposition
End Get
Set(value As Integer)
m_nCurrDisposition = value
End Set
End Property
' Premuto Prev
Private m_bPrev As Boolean = False
Public Property bPrev As Boolean
Get
Return m_bPrev
End Get
Set(value As Boolean)
m_bPrev = value
End Set
End Property
' Pemuto Next
Private m_bToNext As Boolean = False
Public Property bToNext As Boolean
Get
Return m_bToNext
End Get
Set(value As Boolean)
m_bToNext = value
End Set
End Property
Enum MachiningModeOpt As Integer
SPLIT
MOVERAWPART
@@ -74,13 +30,6 @@ Public Class MachiningTabVM
End Get
End Property
Private m_bEnableOnAuxTab As Boolean = False
Public ReadOnly Property bEnableOnAuxTab As Boolean
Get
Return m_bEnableOnAuxTab
End Get
End Property
' Flag di sola visualizzazione/modifica
Private m_bIsShow As Boolean = False
Public Property IsShow As Boolean
@@ -94,23 +43,12 @@ Public Class MachiningTabVM
Private m_SplitModeV As SplitModeV
Private m_MoveRawModeV As MoveRawModeV
Private m_FinalMoveRawModeV As FinalMoveRawModeV
Public ReadOnly Property MachiningModeControl As ContentControl
Get
'' nascondo eventuale tavola di scarico
'EgtDisableModified()
'EgtSetStatus(OmagOFFICEMap.refFinalMoveRawModeVM.nAuxTabId, GDB_ST.OFF)
'EgtEnableModified()
If m_MachiningMode = MachiningModeOpt.SPLIT Then
Return m_SplitModeV
Else
If OmagOFFICEMap.refSplitModeVM.bOnAuxTab Then
Return m_FinalMoveRawModeV
Else
Return m_MoveRawModeV
End If
Return m_MoveRawModeV
End If
End Get
End Property
@@ -159,7 +97,7 @@ Public Class MachiningTabVM
End Set
End Property
Private m_AutoVisibility As Visibility = Visibility.Visible
Private m_AutoVisibility As Visibility
Public Property AutoVisibility As Visibility
Get
Return m_AutoVisibility
@@ -205,9 +143,6 @@ Public Class MachiningTabVM
' Creo pagina per modo MoveRaw
m_MoveRawModeV = New MoveRawModeV
m_MoveRawModeV.DataContext = New MoveRawModeVM
' Creo la pagina per il modo FinalMoveRaw
m_FinalMoveRawModeV = New FinalMoveRawModeV
m_FinalMoveRawModeV.DataContext = New FinalMoveRawModeVM
End Sub
#End Region ' CONSTRUCTOR
@@ -230,10 +165,6 @@ Public Class MachiningTabVM
' Lama troppo grande per utilizzo ventosa
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_SPLITPAGEUC + 11), MSG_TYPE.WARNING)
End If
' Verifico se abilitato spostamento finale pezzi e se macchina lo consente
m_bEnableOnAuxTab = Not m_bByHand AndAlso
OmagOFFICEMap.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.MOVE_PARTS) AndAlso
EgtGetTableId(AUX_TAB) <> GDB_ID.NULL
' Carico eventuale manipolatore pezzi
EgtDisableModified()
LoadVacuumCups()
@@ -242,7 +173,7 @@ Public Class MachiningTabVM
If EstCalc.GetOrderMachiningFlag() Then
' Imposto flag di visualizzazione
m_bIsShow = True
' altrimenti riparto da capo
' altrimenti riparto da capo
Else
' Cancello tutto
EraseMachinings(GDB_ID.NULL)
@@ -251,9 +182,6 @@ Public Class MachiningTabVM
' Imposto flag di modifica
m_bIsShow = False
End If
' imposto la prima disposizione
EgtSetCurrPhase(1)
nCurrPhase = 1
' Inizializzo pagina Split
OmagOFFICEMap.refSplitModeVM.InitSplitRaw()
' Aggiorno possibilità di uscire
@@ -261,37 +189,7 @@ Public Class MachiningTabVM
Return True
End Function
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
Public Function IsDispUnloadOnAuxTab(nCurrDispId As Integer) As Integer
' verifico se la fase precedente è uno scarico su tavola ausiliaria
Dim bVal As Integer = 0
EgtGetInfo(nCurrDispId, "Pat", bVal)
Return bVal
End Function
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
Public Function GetNextDisposition(nCurrDisposId As Integer) As Integer
Dim nDispId As Integer = nCurrDisposId
While nDispId <> GDB_ID.NULL
If EgtGetOperationType(nDispId) = MCH_OY.DISP Then
Return nDispId
End If
nDispId = EgtGetNextOperation(nDispId)
End While
Return GDB_ID.NULL
End Function
Friend Function ExitMachining() As Boolean
' salvo movimenti di deposito
If MachiningMode = MachiningModeOpt.MOVERAWPART And OmagOFFICEMap.refSplitModeVM.bOnAuxTab Then
' Nascondo eventuale tavola di scarico
EgtDisableModified()
EgtSetStatus(OmagOFFICEMap.refFinalMoveRawModeVM.nAuxTabId, GDB_ST.OFF)
EgtEnableModified()
OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
OmagOFFICEMap.refSplitModeVM.InitSplitRaw()
End If
' Cancello eventuale manipolatore pezzi
EgtDisableModified()
RemoveVacuumCups()
@@ -304,13 +202,10 @@ Public Class MachiningTabVM
End Function
Private Sub ManageExit()
' gestione abilitazione dei pulsanti TAB: "Grezzo"RAW,"Disponi"NEST,"Lavora"(Attuale tab attivo),"Simula"SIMUL
Dim bEnab As Boolean = (m_MachiningMode = MachiningModeOpt.SPLIT) Or OmagOFFICEMap.refSplitModeVM.bOnAuxTab
Dim bEnab As Boolean = (m_MachiningMode = MachiningModeOpt.SPLIT)
OmagOFFICEMap.refOptionPanelVM.RawTabIsEnabled = bEnab
OmagOFFICEMap.refOptionPanelVM.NestTabIsEnabled = bEnab
OmagOFFICEMap.refOptionPanelVM.SimulTabIsEnabled = bEnab
bPrev = False
bToNext = False
End Sub
#End Region ' METHODS
@@ -332,7 +227,6 @@ Public Class MachiningTabVM
Dim bOk As Boolean = True
' Dichiaro solo visualizzazione
m_bIsShow = True
m_bPrev = True
If m_MachiningMode = MachiningModeOpt.SPLIT Then
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
Else
@@ -341,69 +235,6 @@ Public Class MachiningTabVM
End If
' se trovata interferenza tra grezzi (dopo movimentazione) esco
If Not bOk Then Return
' recupero l'ID della disposizione corrente dalla fase
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
' se non esiste significa che è stata eliminata, quindi recupero la fase precedente
If m_nCurrDisposition = GDB_ID.NULL Then
m_nCurrPhase = m_nCurrPhase - 1
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
If IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 Then
EgtSetCurrPhase(m_nCurrPhase)
m_bPrev = False
m_bIsShow = True
OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
EgtDraw()
Return
End If
Else
' Passo alla pagina delle spezzature solo se non esiste prima una fased di deposito sulla tavola di scarico
Dim nPrevDispId As Integer = EgtGetPrevOperation(m_nCurrDisposition)
' verifico se la fasa precedente è di tipo scarico
If IsDispUnloadOnAuxTab(nPrevDispId) <> 0 Then
EgtSetCurrPhase(m_nCurrPhase - 1)
m_nCurrDisposition = nPrevDispId
m_nCurrPhase -= 1
m_bPrev = False
m_bIsShow = True
OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
EgtDraw()
Return
End If
End If
'' Passo alla pagina delle spezzature solo se non esiste prima una fased di deposito sulla tavola di scarico
'Dim nPrevDispId As Integer = EgtGetPrevOperation(m_nCurrDisposition)
'' verifico se la fasa precedente è di tipo scarico
'If IsDispUnloadOnAuxTab(nPrevDispId) <> 0 Then
' EgtSetCurrPhase(m_nCurrPhase - 1)
' m_nCurrDisposition = nPrevDispId
' m_nCurrPhase -= 1
' m_bPrev = False
' m_bIsShow = True
' EgtDraw()
' Return
'End If
' Nascondo eventuale tavola ausiliaria
If OmagOFFICEMap.refSplitModeVM.bOnAuxTab Then
EgtDisableModified()
EgtSetStatus(OmagOFFICEMap.refFinalMoveRawModeVM.nAuxTabId, GDB_ST.OFF)
EgtEnableModified()
EgtZoom(ZM.ALL, False)
If Not m_bPrev Then
' Cancello eventuale manipolatore pezzi
EgtDisableModified()
RemoveVacuumCups()
EgtEnableModified()
' ritorno a fase 1
EgtSetCurrPhase(1)
OmagOFFICEMap.refMachiningTabVM.nCurrPhase = 1
' Ripristino visualizzazione preview lavorazioni
ShowAllPhasesMachiningPreview()
End If
End If
' Torno alla fase precedente
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
' Si va sempre in Split
@@ -429,63 +260,15 @@ Public Class MachiningTabVM
Public Sub NextCmd(ByVal param As Object)
Dim bOk As Boolean = True
' se sono nella pagina split allora devo passare alla pagina MoveRawPart
If m_MachiningMode = MachiningModeOpt.SPLIT Then
' esco dalla pagina split
OmagOFFICEMap.refSplitModeVM.ExitSplitRaw(False)
' inizializzo la pagina dei movimenti e assegno la nuova fase
bOk = OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
Dim EnableNextBtn As Boolean = True
' in modalità di sola visualizzazione
If m_bIsShow Then
' recupero la fase corrente
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' recupero l'operazione successiva
Dim NextDisposition As Integer = GetNextDisposition(CurrDisposition)
' verifico che esista una
If NextDisposition <> GDB_ID.NULL Then
' abilito il flag di tavola ausiliari se attiva
OmagOFFICEMap.refSplitModeVM.bOnAuxTab = IsDispUnloadOnAuxTab(NextDisposition) <> 0
EnableNextBtn = True
End If
End If
' verifico se è abilitata la tavola ausiliaria
If OmagOFFICEMap.refSplitModeVM.bOnAuxTab Then
' se sono all'ultima fase inizializzo i comandi per il parcheggio dei pezzi sulla tavola ausiliaria
OmagOFFICEMap.refFinalMoveRawModeVM.Init()
If m_bIsShow Then
EnableNextBtn = True
Else
EnableNextBtn = False
End If
End If
' disabilito il pulsante per procedere (sono abilitati i TAB)
NextIsEnabled = EnableNextBtn
' notifivo la modifica del ContentControl
MachiningMode = MachiningModeOpt.MOVERAWPART
AutoVisibility = Visibility.Hidden
bOk = OmagOFFICEMap.refMoveRawModeVM.InitMoveRaw()
Else
' se verificata una interferenza allora esco
bOk = OmagOFFICEMap.refMoveRawModeVM.ExitMoveRaw()
If Not bOk Then Return
' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
If IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 Then
EgtSetCurrPhase(m_nCurrPhase + 1)
m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
m_nCurrPhase += 1
m_bToNext = False
m_bIsShow = True
EgtDraw()
' abilitazione dei bottoni per la modifica...
Return
End If
MachiningMode = MachiningModeOpt.SPLIT
AutoVisibility = Visibility.Visible
OmagOFFICEMap.refSplitModeVM.InitSplitRaw()
+14 -317
View File
@@ -8,8 +8,6 @@ Public Class MoveRawModeVM
' Fase corrente
Private m_nCurrPhase As Integer = 0
Private m_bToNext As Boolean = False
' Gestione movimento manuale perpendicolare
Private m_vtDir As New Vector3d ' direzione di movimento
Private m_ptMid As New Point3d ' punto medio del taglio
@@ -111,6 +109,15 @@ Public Class MoveRawModeVM
#Region "METHODS"
Friend Function InitMoveRaw() As Boolean
'' verifico che il pezzo sia depositabile
'If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
' ' mantengo la selezione del pezzo
' EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
' OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Collisione pezzi", 3, MSG_TYPE.ERROR_)
' EgtDraw()
' ' non cambio pagina
' Return False
'End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
@@ -120,20 +127,15 @@ Public Class MoveRawModeVM
OmagOFFICEMap.refSplitModeVM.GetEnabledCuts(Cuts)
' Fase precedente
Dim nPrevPhase As Integer = EgtGetCurrPhase()
' se in definizione di spostamento creo una nuova fase
If Not OmagOFFICEMap.refMachiningTabVM.IsShow Then
' Creo nuova fase, eseguo spezzatura grezzi e vi sposto le lavorazioni
Dim vNewRaws As New List(Of Integer)
' genero una nuova fase
SplitRawParts(nPrevPhase, Cuts, vNewRaws)
Else
' altrimenti passo alla fase successiva
EgtSetCurrPhase(nPrevPhase + 1)
HideAllMachinings()
End If
' salvo la fase corrente del progetto
m_nCurrPhase = EgtGetCurrPhase()
OmagOFFICEMap.refMachiningTabVM.nCurrPhase = m_nCurrPhase
' Aggiorno visualizzazione
EgtDraw()
' Carico i parametri di movimento
@@ -182,8 +184,8 @@ Public Class MoveRawModeVM
' Pulisco lista info per grezzi
m_RawMoveDataList.Clear()
m_RawMoveDataList.Capacity() = 10
' Se solo visualizzazione carico i movimenti già fatti nella fase (ho eliminato il Not davanti a IsShow
If OmagOFFICEMap.refMachiningTabVM.IsShow Or EgtGetPhaseCount() = m_nCurrPhase Then
' Se solo visualizzazione carico i movimenti già fatti nella fase
If Not OmagOFFICEMap.refMachiningTabVM.IsShow Then
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
GetMoveInfoInDisposition(nDispId, m_RawMoveDataList)
End If
@@ -214,15 +216,6 @@ Public Class MoveRawModeVM
' non cambio pagina
Return False
End If
' recupero disposizione fase corrente
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' se la fase corrente è vuota allora esco senza salvare
If EgtIsOperationEmpty(nDispId) And OmagOFFICEMap.refSplitModeVM.bOnAuxTab And m_RawMoveDataList.Count = 0 Then
EgtErase(nDispId)
Return True
End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
@@ -235,6 +228,8 @@ Public Class MoveRawModeVM
EgtEnableModified()
' se non solo visualizzazione
If Not OmagOFFICEMap.refMachiningTabVM.IsShow Then
' recupero disposizione fase corrente
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
' imposto presenza operazioni manuali
@@ -243,48 +238,6 @@ Public Class MoveRawModeVM
SpecialApplyDisposition(nDispId, True)
End If
End If
' se la fase precedente è una disposizione allora restituisco false
Dim nPrevDispId As Integer = EgtGetPrevOperation(OmagOFFICEMap.refMachiningTabVM.nCurrDisposition)
' verifico se la fasa precedente è di tipo scarico
If OmagOFFICEMap.refMachiningTabVM.IsDispUnloadOnAuxTab(nPrevDispId) <> 0 And OmagOFFICEMap.refMachiningTabVM.bPrev Then
EgtSetCurrPhase(OmagOFFICEMap.refMachiningTabVM.nCurrPhase - 1)
OmagOFFICEMap.refMachiningTabVM.nCurrDisposition = nPrevDispId
OmagOFFICEMap.refMachiningTabVM.nCurrPhase -= 1
OmagOFFICEMap.refMachiningTabVM.bPrev = False
OmagOFFICEMap.refMachiningTabVM.IsShow = True
InitMoveRaw()
EgtDraw()
Return False
End If
' Nascondo eventuale tavola ausiliaria
If OmagOFFICEMap.refSplitModeVM.bOnAuxTab Then
EgtDisableModified()
EgtSetStatus(OmagOFFICEMap.refFinalMoveRawModeVM.nAuxTabId, GDB_ST.OFF)
EgtEnableModified()
EgtZoom(ZM.ALL, False)
' se sto uscendo dalla pagina (non ho selezionato il comando per tornare indietro) allora ripristino la prima fase
If Not OmagOFFICEMap.refMachiningTabVM.bPrev Then
' Cancello eventuale manipolatore pezzi
EgtDisableModified()
RemoveVacuumCups()
EgtEnableModified()
' ritorno a fase 1
EgtSetCurrPhase(1)
OmagOFFICEMap.refMachiningTabVM.nCurrPhase = 1
' Ripristino visualizzazione preview lavorazioni
ShowAllPhasesMachiningPreview()
End If
End If
' Se torno indietro
If OmagOFFICEMap.refMachiningTabVM.bPrev Then
EgtSetCurrPhase(m_nCurrPhase - 1)
OmagOFFICEMap.refMachiningTabVM.bPrev = False
OmagOFFICEMap.refMachiningTabVM.IsShow = True
End If
Return True
End Function
@@ -320,7 +273,7 @@ Public Class MoveRawModeVM
End Sub
' verifica che la posizione di rialascio sia corretta, altrimenti coreggo il vettore di posizione
Friend Function VerifyReleasdPositionIsValid(ByRef vtMove As Vector3d) As Boolean
Private Function VerifyReleasdPositionIsValid(ByRef vtMove As Vector3d) As Boolean
Dim bOk As Boolean = True
' determino il punto finale dello spostamento
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
@@ -385,7 +338,6 @@ Public Class MoveRawModeVM
VacuumCups.ptStartPointLift = ptEndPointLift
Return bOk
End Function
' verifica che la posizione di rialascio sia corretta, altrimenti coreggo l'angolo di posizione
Private Function VerifyReleasdAngleIsValid(ByRef dAngDeg As Double, ByVal ptCenter As Point3d) As Boolean
Dim bOk As Boolean = True
@@ -455,65 +407,6 @@ Public Class MoveRawModeVM
Return False
End Function
Public Sub InsertPause()
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
If m_RawMoveDataList.Count = 0 Then Return
' verifico che sia stato inseito almeno uno spostamento, altrimenti lo rimuovo
Dim Index As Integer = 0
For Index = m_RawMoveDataList.Count - 1 To 0 Step -1
If Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.x) < EPS_SMALL AndAlso Math.Abs(m_RawMoveDataList(Index).m_vtRawMove.y) < EPS_SMALL Then
m_RawMoveDataList.RemoveAt(Index)
End If
Next
' verifico che la lista non sia vuota
If m_RawMoveDataList.Count = 0 Then Return
' recupero disposizione fase corrente
Dim nDispId As Integer = EgtGetPhaseDisposition(OmagOFFICEMap.refMachiningTabVM.nCurrPhase)
' imposto la pausa nella disposizione corrente
SetPause(nDispId)
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable(nDispId, OmagOFFICEMap.refSplitModeVM.bOnAuxTab)
'' Eseguo calcolo speciale dei movimenti: per tavola multicut
'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
' Creo nuova fase
Dim nNewPhase As Integer = EgtAddPhase()
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
Dim bKeepRawPart As Boolean = True
For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
If nRawId = RawOnAuxTabData.m_nId Then
bKeepRawPart = False
Exit For
End If
Next
If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
End If
' passo al successivo grezzo
nRawId = EgtGetNextRawPart(nRawId)
End While
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
' salvo la disposizione corrente
OmagOFFICEMap.refMachiningTabVM.nCurrDisposition = nCurrDisposition
' EgtSetStatus(nRawIdSlected, GDB_ST.OFF)
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
EgtSetCurrPhase(nNewPhase)
OmagOFFICEMap.refFinalMoveRawModeVM.SetAuxTabInCurrDisposition()
' ripulisco la lista degli spostamenti
m_RawMoveDataList.Clear()
' aggiorno la fase corrente
m_nCurrPhase = EgtGetCurrPhase()
OmagOFFICEMap.refMachiningTabVM.nCurrPhase = m_nCurrPhase
End Sub
#End Region ' METHODS
#Region "COMMANDS"
@@ -824,202 +717,6 @@ Public Class MoveRawModeVM
#End Region ' RemovePartCommand
#Region "MoveOnRef"
' comandi per parcheggio in su tavola di scarico
Public Sub MoveOnRef(sRef As String, nCorn As Integer)
' Recupero il primo grezzo selezionato
Dim nRawId As Integer = EgtGetFirstSelectedObj()
If nRawId = GDB_ID.NULL Then Return
' Recupero la posizione e il tipo corner del riferimento TL (4)
Dim nRefId As Integer = EgtGetFirstNameInGroup(EgtGetFirstNameInGroup(OmagOFFICEMap.refFinalMoveRawModeVM.nAuxTabId, "SOLID"), sRef)
If nRefId = GDB_ID.NULL Then Return
Dim ptRef As Point3d
If Not EgtGetInfo(nRefId, "Pos", ptRef) Then Return
Dim sCorn As String = ""
EgtGetInfo(nRefId, "COR", sCorn)
Select Case sCorn
Case "TL"
nCorn = MCH_CR.TL
Case "TR"
nCorn = MCH_CR.TR
Case "BL"
nCorn = MCH_CR.BL
Case "BR"
nCorn = MCH_CR.BR
End Select
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
' Sposto il grezzo in battuta sul corner
Dim dAngRaw As Double = 0
Dim AngRotList As New List(Of Double)
' ricavo l'angolo di posizionamento del grezzo/pezzo sulla tavola
If Not DispositionRawOnTable(nRawId, dAngRaw, AngRotList) Then Return
Dim bb3dRaw As New BBox3d
EgtGetRawPartBBox(nRawId, bb3dRaw)
Dim ForceToRotate As Boolean = bb3dRaw.DimX < bb3dRaw.DimY
' ricavo l'angolo di posizionamento del grezzo/pezzo sulla tavola
If Not DispositionRawOnTable(nRawId, dAngRaw, AngRotList) Then Return
' provo a verificare di poter depositare il pezzo (senza applicare delle rotazioni)
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Or ForceToRotate Then
' se sono impostati degli step di rotazione
If AngRotList.Count > 0 Then
Dim bOkRotate As Boolean = False
' allora provo a ruotare il pezzo nel verso di rotazione della ventosa
For Each AngStep As Double In AngRotList
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -AngStep) Then
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then
' riposiziono il pezzo come era prima
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), AngStep)
Else
bOkRotate = True
' salvo l'angolo di deposito utilizzato
dAngRaw = -AngStep
Exit For
End If
End If
Next
If Not bOkRotate Then Return
Else
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), -dAngRaw) Then
If Not EgtMoveToCornerRawPart(nRawId, ptRef, nCorn) Then
' riposiziono il pezzo come era prima
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngRaw)
Return
End If
Else
Return
End If
End If
Else
' significa che già il primo posizionamento è andato bene, quindi non devo impostare nessuna rotazione
dAngRaw = 0
End If
' Verifico non interferisca con altri grezzi
Dim bRawOk As Boolean = True
Dim b3Raw As New BBox3d
EgtGetRawPartBBox(nRawId, b3Raw)
Dim nOtherRaw As Integer = EgtGetFirstRawPart()
While nOtherRaw <> GDB_ID.NULL
If nOtherRaw <> nRawId AndAlso EgtVerifyRawPartCurrPhase(nOtherRaw) Then
Dim b3OtherRaw As New BBox3d
EgtGetRawPartBBox(nOtherRaw, b3OtherRaw)
If b3Raw.OverlapsXY(b3OtherRaw) Then
bRawOk = False
Exit While
End If
End If
nOtherRaw = EgtGetNextRawPart(nOtherRaw)
End While
' Determino il movimento effettuato
Dim ptNewRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptNewRawCen)
' Se tutto bene, aggiorno lista movimenti
If bRawOk Then
AddRawMoveData(nRawId, ptNewRawCen - ptRawCen, m_RawMoveDataList)
If dAngRaw <> 0 Then AddRawMoveData(nRawId, -dAngRaw, m_RawMoveDataList)
' altrimenti annullo il movimento
Else
EgtMoveRawPart(nRawId, ptRawCen - ptNewRawCen)
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngRaw)
' Posizione scelta già occupata
OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 3), 3, MSG_TYPE.WARNING)
End If
' Disabilito pezzo e nascondo le ventose
EgtSetStatus(nRawId, GDB_ST.ON_)
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
EgtDraw()
End Sub
Private Function DispositionRawOnTable(nRawId As Integer, ByRef dMyAngH As Double, ByRef AngVacList As List(Of Double)) As Boolean
Dim nPartId As Integer
If EgtVerifyRawPartCurrPhase(nRawId) Then
nPartId = EgtGetFirstPartInRawPart(nRawId)
Dim nTempPart As Integer = nPartId
While nTempPart <> GDB_ID.NULL
nTempPart = EgtGetNextPartInRawPart(nPartId)
' significa che il grezzo contiene più di un pezzo
If nTempPart <> GDB_ID.NULL Then Return False
End While
End If
' Verifico sia veramente un pezzo
If EgtGetRawPartFromPart(nPartId) = GDB_ID.NULL Then Return False
' Recupero la regione del pezzo
Dim nGrpRegId As Integer = EgtGetFirstNameInGroup(nPartId, "Region")
Dim nRegId As Integer = EgtGetFirstInGroup(nGrpRegId)
While nRegId <> GDB_ID.NULL
If EgtGetType(nRegId) = GDB_TY.SRF_FRGN Then Exit While
nRegId = EgtGetNext(nRegId)
End While
If nRegId = GDB_ID.NULL Then Return False
' recupero il contorno del pezzo
Dim nIdCurve As Integer = GetRegionOutLoop(nRegId, nGrpRegId)
If nIdCurve = GDB_ID.NULL Then Return False
' recupero il versore
Dim frFrame As New Frame3d
' recupero le dimensioni del minimo rettangolo
Dim dLengthX As Double = 0
Dim dLengthY As Double = 0
EgtCurveMinAreaRectangleXY(nIdCurve, GDB_ID.ROOT, frFrame, dLengthX, dLengthY)
' recupero la direzione del lato più lungo (versore X)
Dim vtDir As Vector3d = frFrame.VersX()
' recupero le coordinate sferiche
Dim dMyLen, dMyAngV As Double
vtDir.ToSpherical(dMyLen, dMyAngV, dMyAngH)
' mi riconduco sempre agli angoli
If dMyAngH >= 180 Then
dMyAngH = dMyAngH - 180
End If
If Math.Abs(dMyAngH - 180) < EPS_ANG_SMALL Then
dMyAngH = 0
End If
' Recupero l'asse rotante della testa ventosa
Dim nRotAxId As Integer = EgtGetParent(EgtGetHeadId(VACUUM_HEAD))
' Verifico se contiene info con STEPS
Dim sSteps As String = ""
If Not EgtGetInfo(nRotAxId, KEY_ROTVAC_STEPS, sSteps) Then Return True
' Leggo gli step previsti
Dim vStep() As String = sSteps.Split(",".ToCharArray)
For Each sStep As String In vStep
Dim dStep As Double = 0
If StringToDouble(sStep, dStep) Then
AngVacList.Add(dStep)
End If
Next
Return True
End Function
Public Sub ResetFinaleMove()
' Recupero il primo grezzo selezionato
Dim nRawId As Integer = EgtGetFirstSelectedObj()
If nRawId = GDB_ID.NULL Then Return
' Lo riporto nella posizione originale
Dim nInd As Integer = FindRawMoveData(nRawId, m_RawMoveDataList)
If nInd = -1 Then Return
Dim vtMove As Vector3d = -m_RawMoveDataList(nInd).m_vtRawMove
Dim dAngRaw As Double = -m_RawMoveDataList(nInd).m_dRawAngRotDeg
EgtMoveRawPart(nRawId, vtMove)
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngRaw)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
RemoveRawMoveData(nRawId, m_RawMoveDataList)
' Disabilito pezzo e nascondo le ventose
EgtSetStatus(nRawId, GDB_ST.ON_)
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
EgtDraw()
End Sub
#End Region ' MoveOnRef
#End Region ' COMMANDS
#Region "EVENTS"
+42 -35
View File
@@ -48,6 +48,8 @@ Public Class SplitModeVM
Private m_bDragging As Boolean = False
' Selected cut
Private m_nSelected As Integer = GDB_ID.NULL
' Abilita la mofica Inizio fine per i tagli interni sugli angoli
Private m_StartEndModifyOnIntCorner As Boolean = False
Private m_ItemList As New ObservableCollection(Of NameIdLsBxItem)
Public ReadOnly Property ItemList As ObservableCollection(Of NameIdLsBxItem)
@@ -67,21 +69,6 @@ Public Class SplitModeVM
End Set
End Property
Private m_bOnAuxTab As Boolean = False
Public Property bOnAuxTab As Boolean
Get
Return m_bOnAuxTab
'Dim nCoutPhase As Integer = EgtGetPhaseCount()
'Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
'Return (m_nCurrPhase = nCoutPhase And bStdTab And Not bStdTab And
' OmagOFFICEMap.refMachiningTabVM.bEnableOnAuxTab And
' EgtGetOperationType(EgtGetLastOperation()) = MCH_OY.DISP)
End Get
Set(value As Boolean)
m_bOnAuxTab = value
End Set
End Property
Private m_SplitModeIsEnabled As Boolean
Public Property SplitModeIsEnabled As Boolean
Get
@@ -462,6 +449,8 @@ Public Class SplitModeVM
'm_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
m_nDragInd = -1
m_nDragType = 0
' verifico se è abilitata la possibiltà di allungare i lati interni
m_StartEndModifyOnIntCorner = (GetPrivateProfileInt(S_NEST, K_STARTENDMODIFYONINTCORNER, 0, sMachIniFile) <> 0)
' Nascondo eventuali pezzi in parcheggio
EstCalc.HideParkedParts()
' Nascondo eventuale contorno da foto
@@ -472,8 +461,6 @@ Public Class SplitModeVM
EgtZoom(ZM.ALL)
' Elimino eventuali pretagli su uscite
CamAuto.RemoveAllExitPreCuts()
' Fase precedente
Dim nPrevPhase As Integer = EgtGetCurrPhase()
' Se non sono in sola visualizzazione, faccio ordine automatico delle lavorazioni
If Not OmagOFFICEMap.refMachiningTabVM.IsShow Then
If CurrentMachine.WaterJettingActive Then ResetAllMachinings()
@@ -492,7 +479,6 @@ Public Class SplitModeVM
EgtSetLevel(m_nNbrGrpId, GDB_LV.TEMP)
' Recupero l'indice della fase corrente
m_nCurrPhase = EgtGetCurrPhase()
OmagOFFICEMap.refMachiningTabVM.nCurrPhase = m_nCurrPhase
' Visualizzo solo anteprime di lavorazioni della fase
ShowOnePhaseMachiningPreview(m_nCurrPhase)
' Preparo la lista delle lavorazioni
@@ -574,7 +560,6 @@ Public Class SplitModeVM
If bTrueExit Then
' ritorno a fase 1
EgtSetCurrPhase(1)
OmagOFFICEMap.refMachiningTabVM.nCurrPhase = 1
' Ripristino visualizzazione preview lavorazioni
ShowAllPhasesMachiningPreview()
End If
@@ -773,22 +758,15 @@ Public Class SplitModeVM
If OmagOFFICEMap.refMachiningTabVM.ByHand Then
' Ci deve essere almeno 1 taglio disabilitato e 1 e 1 solo passante
OmagOFFICEMap.refMachiningTabVM.NextIsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
' Altrimenti
' Altrimenti
Else
' movimento standard sulla tavola (almeno un taglio disabilitato)
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
' movimento su tavola di scarico
m_bOnAuxTab = Not bStdTab AndAlso (m_nCurrPhase = EgtGetPhaseCount() And OmagOFFICEMap.refMachiningTabVM.bEnableOnAuxTab)
' movimento finale sulla tavola
Dim bFinalMoveTab As Boolean = CurrentMachine.bRawFinalMove
' Ci deve essere almeno 1 taglio disabilitato e almeno 1 passante oppure fase successiva alla prima
OmagOFFICEMap.refMachiningTabVM.NextIsEnabled = Not bStdTab Or m_bOnAuxTab Or bFinalMoveTab
OmagOFFICEMap.refMachiningTabVM.NextIsEnabled = (GetDisabledCutsCount() > 0 And
(GetSplitCutsCount() > 0 Or m_nCurrPhase > 1)) Or
CurrentMachine.bRawFinalMove
End If
' altrimenti sto solo visualizzando
' altrimenti sto solo visualizzando
Else
' movimento su tavola di scarico
m_bOnAuxTab = (m_nCurrPhase = EgtGetPhaseCount() - 1 And OmagOFFICEMap.refMachiningTabVM.bEnableOnAuxTab And EgtGetOperationType(EgtGetLastOperation()) = MCH_OY.DISP)
' Non deve essere l'ultima fase
OmagOFFICEMap.refMachiningTabVM.NextIsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
End If
Else
@@ -1318,8 +1296,6 @@ Public Class SplitModeVM
' If Item.bIsActive Then ItemList.Add(Item)
'Next
VerifyHomogenousMachining(ItemList)
' Abilitazione bottone Next
EnableButtons()
End Sub
#End Region ' OnOffCommand
@@ -1995,10 +1971,27 @@ Public Class SplitModeVM
Dim bRepeat As Boolean = False
Do
' Se c'è limite alla lunghezza libera
If m_MachiningList(nI).m_dStartFreeLen < FREELEN_INF Then
' se abilitati i controlli sugli allungamenti dei lati interni
If Not m_StartEndModifyOnIntCorner Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, CurrentMachine.sMachIniFile), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUsal = Math.Min(dUsal, m_MachiningList(nI).m_dStartFreeLen - dDT - dCornerSafety)
End If
End If
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.STARTADDLEN, dAddLen)
If dAddLen - dOrigUsal < -10 * EPS_SMALL Then Return
' verifico che non sia sull'angolo interno (altrimenti vieto la modifica)
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUsal < -10 * EPS_SMALL) Then
Return
End If
EgtSetMachiningParam(MCH_MP.STARTADDLEN, dAddLen + dUsal - dOrigUsal)
EgtSetInfo(nOperId, INFO_MCH_USER_SAL, dUsal)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
@@ -2158,10 +2151,24 @@ Public Class SplitModeVM
End If
Dim bRepeat As Boolean = False
Do
' Se c'è limite alla lunghezza libera
If m_MachiningList(nI).m_dEndFreeLen < FREELEN_INF Then
' se abilitati i controlli sugli allungamenti dei lati interni
If Not m_StartEndModifyOnIntCorner Then
' Recupero sicurezza in corner interno
Dim dCornerSafety As Double = Math.Max(GetPrivateProfileDouble(S_MACH_NEST, K_MACH_SAFE_LEN_INTCORNER, 1, CurrentMachine.sMachIniFile), 10 * EPS_SMALL)
' Recupero lunghezza baffo del taglio
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Dim dDT As Double = 0
EgtGetInfo(EgtGetFirstGroupInGroup(nPvId), "DT", dDT)
dUeal = Math.Min(dUeal, m_MachiningList(nI).m_dEndFreeLen - dDT - dCornerSafety)
End If
End If
EgtSetCurrMachining(nOperId)
Dim dAddLen As Double = 0
EgtGetMachiningParam(MCH_MP.ENDADDLEN, dAddLen)
If dAddLen - dOrigUeal < -10 * EPS_SMALL Then
If Not m_StartEndModifyOnIntCorner And (dAddLen - dOrigUeal < -10 * EPS_SMALL) Then
Return
End If
EgtSetMachiningParam(MCH_MP.ENDADDLEN, dAddLen + dUeal - dOrigUeal)
+291 -171
View File
@@ -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
@@ -1922,8 +1998,6 @@ Public Class NestingTabVM
CamAuto.EraseMachinings(GDB_ID.NULL)
' Reinserisco tutte le lavorazioni piane
CamAuto.AddMachinings(GDB_ID.NULL)
' riattivo la visualizzazione del comando "Auto"
OmagOFFICEMap.refMachiningTabVM.AutoVisibility = Visibility.Visible
' Aggiorno visualizzazione
EgtDraw()
End Sub
@@ -1951,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)
@@ -2083,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
@@ -2091,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
@@ -2117,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 ----------------------
@@ -2138,7 +2213,7 @@ Public Class NestingTabVM
'---------------------- COUNTER PART ----------------------
' Gestione VeinMatching
VeinMatching.OnInsertPartInRaw( nMoveId)
VeinMatching.OnInsertPartInRaw(nMoveId)
' Imposto stato
m_bVerify = True
m_bFromParking = True
@@ -2148,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
@@ -2227,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
@@ -2322,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)
+1
View File
@@ -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>
+4
View File
@@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

+15 -1
View File
@@ -11,7 +11,8 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!--Titolo delle colonne-->
<Grid Visibility="{Binding Legenda_Visibility}"
@@ -185,6 +186,19 @@
Grid.Column="1"/>
</Grid>
<Grid Visibility="{Binding Parameter6_Visibility}"
Grid.Row="6"
Margin="0,0,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.8*"/>
<ColumnDefinition Width="1.2*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Parameter6Msg}" Grid.Row="2"/>
<EgtWPFLib5:EgtTextBox Text="{Binding Parameter6}"
Grid.Column="1"/>
</Grid>
</Grid>
</UserControl>
+121 -1
View File
@@ -404,6 +404,40 @@ Public Class SideEntityControlVM
#End Region 'Parameter 5
#Region "Parameter 6"
Private m_Parameter6_Visibility As Visibility
Public Property Parameter6_Visibility As Visibility
Get
Return m_Parameter6_Visibility
End Get
Set(value As Visibility)
m_Parameter6_Visibility = value
NotifyPropertyChanged(NameOf(Parameter6_Visibility))
End Set
End Property
Private m_Parameter6 As Double
Public Property Parameter6 As String
Get
Return LenToString(m_Parameter6, 2)
End Get
Set(value As String)
If m_Mode = ModeOpt.ENGRAVE Then
StringToLen(value, m_Parameter6)
m_dEngraveAngle = m_Parameter6
' Creo le geometrie dei gocciolatoi
RefreshSideAngleText()
End If
End Set
End Property
Private Sub SetParameter6(value As Double)
m_Parameter6 = value
NotifyPropertyChanged("Parameter6")
End Sub
#End Region
Private m_dSideAngle As Double = 0
Private m_HeightA As Double = 0
@@ -422,6 +456,7 @@ Public Class SideEntityControlVM
Private m_dDripDepth As Double = 10
Private m_dEngraveDepth2 As Double = 5
Private m_dDripShort As Double = 0
Private m_dEngraveAngle As Double = 0
Private m_CallingWndScene As Scene
Private m_CallingWindow As CallingWindowOpt
@@ -480,6 +515,16 @@ Public Class SideEntityControlVM
End Set
End Property
Private m_Parameter6Msg As String = "Angle"
Public Property Parameter6Msg As String
Get
Return m_Parameter6Msg ' Angolo
End Get
Set(value As String)
m_Parameter6Msg = value
End Set
End Property
#End Region ' Messages
#Region "CONSTRUCTOR"
@@ -526,18 +571,29 @@ Public Class SideEntityControlVM
Parameter2ab_Visibility = Visibility.Hidden
Parameter4_Visibility = Visibility.Hidden
Parameter5_Visibility = Visibility.Hidden
Parameter6_Visibility = Visibility.Hidden
ElseIf m_Mode = ModeOpt.FILOTOP Then
Parameter23_Visibility = Windows.Visibility.Hidden
Parameter2_Visibility = Visibility.Visible
Parameter2ab_Visibility = Visibility.Hidden
Parameter4_Visibility = Visibility.Hidden
Parameter5_Visibility = Visibility.Visible
Parameter6_Visibility = Visibility.Hidden
ElseIf m_Mode = ModeOpt.ALZANDFRONT Then
Parameter2_Visibility = Visibility.Hidden
Parameter23_Visibility = Windows.Visibility.Visible
Parameter2ab_Visibility = Visibility.Visible
Parameter4_Visibility = Visibility.Hidden
Parameter5_Visibility = Visibility.Hidden
Parameter6_Visibility = Visibility.Hidden
ElseIf m_Mode = ModeOpt.ENGRAVE Then
' Temporaneamente lo disabilito
Parameter23_Visibility = Windows.Visibility.Visible
Parameter4_Visibility = Visibility.Visible
Parameter2ab_Visibility = Visibility.Visible
Parameter2_Visibility = Visibility.Hidden
Parameter5_Visibility = Visibility.Hidden
Parameter6_Visibility = Visibility.Visible
Else
' Temporaneamente lo disabilito
Parameter23_Visibility = Windows.Visibility.Visible
@@ -545,6 +601,7 @@ Public Class SideEntityControlVM
Parameter2ab_Visibility = Visibility.Visible
Parameter2_Visibility = Visibility.Hidden
Parameter5_Visibility = Visibility.Hidden
Parameter6_Visibility = Visibility.Hidden
End If
'------------------ VALORI E TITOLI PARAMETRI
@@ -576,12 +633,14 @@ Public Class SideEntityControlVM
m_dDripDepth = GetMainPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10)
m_dDripShort = GetMainPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0)
m_dEngraveDepth2 = GetMainPrivateProfileDouble(S_SIDES, K_ENGRAVEDEPTH2, 0)
m_dEngraveAngle = GetMainPrivateProfileDouble(S_SIDES, K_ENGRAVEANGLE, 0)
SetParameter1(m_dDripOffset)
SetParameter2(m_dDripOffset2)
SetParameter2a(m_nEngrNbr2)
SetParameter2b(m_dDripOffset2)
SetParameter3(m_dDripDepth)
SetParameter4(m_dEngraveDepth2)
SetParameter6(m_dEngraveAngle)
ElseIf m_Mode = ModeOpt.ALZANDFRONT Then
' definisco i nomi dei campi
@@ -1195,7 +1254,11 @@ Public Class SideEntityControlVM
End While
End If
Dim ListEngraveSideAng As New List(Of Integer)
If m_Mode = ModeOpt.DRIP Then
' Assegno colore e attributi
Dim nInd As Integer = 0
' Esplodo nelle curve componenti
nCrvId = EgtGetFirstInGroup(DripLayer)
While nCrvId <> GDB_ID.NULL
@@ -1214,14 +1277,70 @@ Public Class SideEntityControlVM
End While
Else
' Assegno colore e attributi
Dim nInd As Integer = 0
nCrvId = EgtGetFirstInGroup(DripLayer)
While nCrvId <> GDB_ID.NULL
EgtSetColor(nCrvId, COL_MCH_DRIPCUT())
' EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
'EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
EgtSetInfo(nCrvId, INFO_STRICT, If(m_dDripShort > EPS_SMALL, "3", "0"))
If nInd = 0 Then
' solo se m_dEngraveAngle > 0
If Math.Abs(m_dEngraveAngle) > EPS_ANG_SMALL Then
' salvo l'Id della curva che deve essere manipolato separatamente
ListEngraveSideAng.Add(nCrvId)
Else
EgtRemoveInfo(nCrvId, INFO_SIDE_ANGLE)
EgtModifyCurveThickness(nCrvId, -m_dEngraveDepth2)
End If
Else
If nInd = m_nEngrNbr2 Then
nInd = -1
End If
EgtModifyCurveThickness(nCrvId, -m_dEngraveDepth2)
End If
nInd = nInd + 1
If nInd > m_nEngrNbr2 Then nInd = 0
nCrvId = EgtGetNext(nCrvId)
End While
End If
SplitJointedSideEngrave(ListEngraveSideAng)
End Sub
Private Sub SplitJointedSideEngrave(ListEngraveSideAngId As List(Of Integer))
For Each nCrvId As Integer In ListEngraveSideAngId
' eventualmente separo il taglio inclinato
Dim dUs, dUe As Double
EgtCurveDomain(nCrvId, dUs, dUe)
Dim dU As Double = dUs
While dU < dUe ' + EPS_ZERO
Dim ptCurr As Point3d
EgtAtParamPoint(nCrvId, dU + 1, nCrvId, ptCurr)
' separa la curva in questo punto
Dim nNewCurvId As Integer = GDB_ID.NULL
If dUe > 1 Then
nNewCurvId = EgtSplitCurveAtPoint(nCrvId, ptCurr, GDB_RT.LOC)
Else
nNewCurvId = nCrvId
End If
EgtSetColor(nCrvId, COL_MCH_ONENGRAVE_ANG())
EgtSetInfo(nCrvId, INFO_SIDE_ANGLE, m_dEngraveAngle)
' recupero il vettore di estrusione della curva e la direzione della curva
Dim vtAux As Vector3d
EgtStartVector(nCrvId, vtAux)
Dim vtExtrusion As Vector3d
EgtCurveExtrusion(nCrvId, vtExtrusion)
' ruoto il vetottore nella nuova direzione
vtExtrusion.Rotate(vtAux, -m_dEngraveAngle)
' assegno il vettore di estrusione nella nuova direzione indicata (segno negativo perchè dentro il pezzo)
EgtModifyCurveExtrusion(nCrvId, vtExtrusion)
Dim ExtendFactor As Double = New Vector3d(0, 0, 1) * vtExtrusion
EgtModifyCurveThickness(nCrvId, -m_dDripDepth / ExtendFactor)
If dUe = 1 Then Exit While
nCrvId = nNewCurvId
' aggiorno i valori del dominio della curva che rimane
EgtCurveDomain(nCrvId, dUs, dUe)
End While
Next
End Sub
' Funzione che modifica l'inclinazione di un lato
@@ -1382,6 +1501,7 @@ Public Class SideEntityControlVM
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVEDEPTH, LenToString(m_dDripDepth, 3))
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVESHORT, LenToString(m_dDripShort, 3))
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVEDEPTH2, LenToString(m_dEngraveDepth2, 3))
WriteMainPrivateProfileString(S_SIDES, K_ENGRAVEANGLE, LenToString(m_dEngraveAngle, 3))
For Each objEntity In m_SideEntityList
If TypeOf objEntity Is DripEntity Then
Dim CurrEntity As DripEntity = DirectCast(objEntity, DripEntity)
+1
View File
@@ -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"/>
+39 -13
View File
@@ -1,5 +1,6 @@
Imports EgtWPFLib5
Imports EgtPHOTOLib
Imports EgtUILib
Module OmagOFFICEMap
@@ -14,7 +15,6 @@ Module OmagOFFICEMap
Private m_refMachiningTabVM As MachiningTabVM
Private m_refSplitModeVM As SplitModeVM
Private m_refMoveRawModeVM As MoveRawModeVM
Private m_refFinalMoveRawModeVM As FinalMoveRawModeVM
Private m_refSimulTabVM As SimulTabVM
Private m_refSceneHostVM As SceneHostVM
@@ -115,12 +115,6 @@ Module OmagOFFICEMap
End Get
End Property
Public ReadOnly Property refFinalMoveRawModeVM As FinalMoveRawModeVM
Get
Return m_refFinalMoveRawModeVM
End Get
End Property
Public ReadOnly Property refSimulTabVM As SimulTabVM
Get
Return m_refSimulTabVM
@@ -197,7 +191,7 @@ Module OmagOFFICEMap
End Function
Friend Function SetRefMachGroupPanelVM(MachGroupPanelVM As MyMachGroupPanelVM) As Boolean
LibMap.SetRefMachGroupPanelVM(MachGroupPanelVM)
LibMap.setrefMachGroupPanelVM(MachGroupPanelVM)
Return Not IsNothing(LibMap.refMachGroupPanelVM)
End Function
@@ -231,16 +225,48 @@ Module OmagOFFICEMap
Return Not IsNothing(m_refMoveRawModeVM)
End Function
Friend Function SetRefFinalMoveRawModeVM(FinalMoveRawModeVM As FinalMoveRawModeVM) As Boolean
m_refFinalMoveRawModeVM = FinalMoveRawModeVM
Return Not IsNothing(m_refFinalMoveRawModeVM)
End Function
Friend Function SetRefSimulTabVM(SimulTabVM As SimulTabVM) As Boolean
m_refSimulTabVM = SimulTabVM
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"