Merge commit 'efd2d5d8c9c7ab390efb62a4a7fd4bb575b3ecdf'
This commit is contained in:
@@ -77,5 +77,7 @@ Module ConstGen
|
||||
Public Const SETUP_LUA As String = "SetUp.lua"
|
||||
' Sottodirettorio per BackUp
|
||||
Public Const BACKUP_DIR As String = "BackUp"
|
||||
' Info per rotazione in registrazione grezzo
|
||||
Public Const INFO_REGROT As String = "RegRot"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -1444,4 +1444,14 @@ Friend Module CamAuto
|
||||
Return EgtApplyMachining(False)
|
||||
End Function
|
||||
|
||||
Friend Function GetRegistrationRotation() As Double
|
||||
Dim dRegRot As Double = 0
|
||||
EgtGetInfo(GetCurrentRaw(), INFO_REGROT, dRegRot)
|
||||
Return dRegRot
|
||||
End Function
|
||||
|
||||
Friend Function SetRegistrationRotation(dRegRot As Double) As Boolean
|
||||
Return EgtSetInfo(GetCurrentRaw(), INFO_REGROT, dRegRot)
|
||||
End Function
|
||||
|
||||
End Module
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
Public Const K_TAB2_ADDITIONALTABLE As String = "Tab2AdditionalTable"
|
||||
Public Const K_TAB3_ADDITIONALTABLE As String = "Tab3AdditionalTable"
|
||||
Public Const K_CENTER_RAW_ONX As String = "CenterRawOnX"
|
||||
Public Const K_CHANGETABWD As String = "ChangeTabWD"
|
||||
|
||||
Public Const S_PHOTO As String = "Photo"
|
||||
Public Const K_PHOTO_OFFSETX As String = "OffsetX"
|
||||
|
||||
+20
-11
@@ -340,7 +340,7 @@ Module EstCalc
|
||||
Return (nFlag <> 0)
|
||||
End Function
|
||||
|
||||
Public Function AdjustAdditionalTable() As Boolean
|
||||
Public Function AdjustAdditionalTable(Optional bForced As Boolean = False) As Boolean
|
||||
' Recupero altezza sottotavola corrente
|
||||
Dim nFixtId As Integer = EgtGetFirstNameInGroup(EgtGetCurrMachGroup(), MACH_FIXT_GROUP)
|
||||
Dim nAddTabId As Integer = EgtGetFirstNameInGroup(nFixtId, MACH_ADD_TABLE)
|
||||
@@ -351,18 +351,27 @@ Module EstCalc
|
||||
dCurrAddTab = b3AddTab.DimZ()
|
||||
End If
|
||||
' Se valore cambiato, aggiorno...
|
||||
Dim dDeltaZ As Double = dAdditionalTable - dCurrAddTab
|
||||
If Math.Abs(dDeltaZ) > EPS_SMALL Then
|
||||
Dim dDeltaZ As Double = CurrentMachine.dAdditionalTable - dCurrAddTab
|
||||
Dim bChanged As Boolean = (Math.Abs(dDeltaZ) > EPS_SMALL)
|
||||
If bChanged Or bForced Then
|
||||
Dim bOldEnMod As Boolean = EgtGetEnableModified()
|
||||
If Not bChanged AndAlso bOldEnMod Then EgtDisableModified()
|
||||
AddAdditionalTable()
|
||||
UpdateAllRawsZ(dDeltaZ)
|
||||
' !!! FOTO DA GESTIRE !!!
|
||||
'If GetPhoto() <> GDB_ID.NULL Then
|
||||
' UpdatePhoto()
|
||||
' UpdateContour()
|
||||
' If EgtGetRawPartCount() > 0 Then
|
||||
' ShowPhoto(False)
|
||||
' End If
|
||||
'End If
|
||||
If GetPhoto() <> GDB_ID.NULL Then
|
||||
UpdatePhoto()
|
||||
UpdateContour()
|
||||
If EgtGetRawPartCount() > 0 Then
|
||||
ShowPhoto(False)
|
||||
Dim nRawGrpId As Integer = EgtGetFirstRawPart()
|
||||
While nRawGrpId <> GDB_ID.NULL
|
||||
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup(nRawGrpId, NAME_RAW_SOLID)
|
||||
If nRawSolidId <> GDB_ID.NULL Then EgtSetTextureName(nRawSolidId, PHOTO_NAME)
|
||||
nRawGrpId = EgtGetNextRawPart(nRawGrpId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
If Not bChanged AndAlso bOldEnMod Then EgtEnableModified()
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -993,6 +993,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\table.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\tableS.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagOFFICE\OmagOFFICER32.exe
|
||||
|
||||
@@ -1,59 +1,63 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="ChangeTableV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterOwner"
|
||||
CloseCommand="{Binding CloseCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
Title="{Binding sTitle}" Height="150" Width="320">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ItemsControl ItemsSource="{Binding CurrTableList}">
|
||||
<!--Definisco l'organizzazione dei comandi-->
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<!--Definisco il contenuto del comando-->
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<RadioButton GroupName="TabGrp"
|
||||
IsChecked="{Binding IsActive}"
|
||||
Width="60" Height="60">
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
|
||||
IsMinimizable="False" WindowStartupLocation="CenterScreen"
|
||||
CloseCommand="{Binding CloseCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
Title="{Binding sTitle}" Height="150" Width="320">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ItemsControl ItemsSource="{Binding CurrTableList}">
|
||||
<!--Definisco l'organizzazione dei comandi-->
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<!--Definisco il contenuto del comando-->
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<RadioButton GroupName="TabGrp"
|
||||
IsChecked="{Binding IsActive}"
|
||||
Width="60" Height="60"
|
||||
Style="{DynamicResource ChangeTable_ToggleButton}">
|
||||
<Grid>
|
||||
<!--Nome della tavole: Tab #-->
|
||||
<TextBlock Text="{Binding sName}"
|
||||
HorizontalAlignment="Center"
|
||||
Background="Transparent">
|
||||
<TextBlock.Style>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Foreground" Value="{StaticResource Omag_LightGray}"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource AncestorType=RadioButton}}" Value="True">
|
||||
<Setter Property="Foreground" Value="{StaticResource Omag_White}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</TextBlock.Style>
|
||||
</TextBlock>
|
||||
<!--Rappresentazione di una tavola di lavoro-->
|
||||
<Image Source="{Binding ImgTab}" Margin="0,20,0,0"/>
|
||||
</Grid>
|
||||
|
||||
<RadioButton.Style>
|
||||
<Style TargetType="ToggleButton" BasedOn="{StaticResource ChangeTable_ToggleButton}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="Foreground" Value="white"/>
|
||||
<Setter Property="Background" Value="BlueViolet"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</RadioButton.Style>
|
||||
<Grid>
|
||||
<!--Nome della tavole: Tab #-->
|
||||
<TextBlock Text="{Binding sName}" HorizontalAlignment="Center"
|
||||
Background="Transparent"/>
|
||||
<!--Rappresentazione di una tavola di lavoro-->
|
||||
<Image Source="{Binding ImgTab}" Margin="0,20,0,0"/>
|
||||
</Grid>
|
||||
|
||||
</RadioButton>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Button Content="Ok" Margin="5" Command="{Binding OkCommand}"/>
|
||||
<Button Content="Cancel" Margin="5" Command="{Binding CancelCommand}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</RadioButton>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<UniformGrid Grid.Row="1" Columns="2">
|
||||
<Button Content="Ok" Margin="5" Command="{Binding OkCommand}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"/>
|
||||
<Button Content="Cancel" Margin="5" Command="{Binding CancelCommand}"
|
||||
Style="{StaticResource OptionPanel_TextButton}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Windows.Forms
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ChangeTableVM
|
||||
Public Class ChangeTableVM
|
||||
Inherits VMBase
|
||||
Private m_refChanTableV As ChangeTableV
|
||||
|
||||
@@ -106,9 +102,10 @@ Public Class TableToChange
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sImgTab As String = "\Resources\NewIcons\table.png"
|
||||
Public ReadOnly Property ImgTab As String
|
||||
Get
|
||||
Return "\Resources\NewIcons\table.png"
|
||||
Return If(m_bIsActive, "\Resources\NewIcons\table.png", "\Resources\NewIcons\tableS.png")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -126,7 +123,13 @@ Public Class TableToChange
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bIsActive = value
|
||||
NotifyPropertyChanged("IsActive")
|
||||
If m_bIsActive Then
|
||||
m_sImgTab = "\Resources\NewIcons\table.png"
|
||||
Else
|
||||
m_sImgTab = "\Resources\NewIcons\tableS.png"
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(IsActive))
|
||||
NotifyPropertyChanged(NameOf(ImgTab))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
@@ -585,6 +585,208 @@ Public Class NestingTabVM
|
||||
m_bStartRot = False
|
||||
End Sub
|
||||
|
||||
Friend Function RotateAllRawParts(dAngDeg As Double, Optional bIsReg As Boolean = True) As Boolean
|
||||
' Recupero rotazione totale
|
||||
Dim dRegRot As Double = CamAuto.GetRegistrationRotation()
|
||||
' Recupero il centro del grezzo iniziale per usarlo come centro della rotazione
|
||||
Dim ptCen As New Point3d
|
||||
GetRawCenter(ptCen)
|
||||
' Provo la rotazione
|
||||
Dim bMoveOk As Boolean = True
|
||||
Dim nPhase As Integer = 1
|
||||
Dim nRawId As Integer = GDB_ID.NULL
|
||||
While nPhase <= EgtGetPhaseCount()
|
||||
EgtSetCurrPhase(nPhase)
|
||||
nRawId = EgtGetFirstRawPart()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
If EgtVerifyRawPartPhase(nRawId, nPhase) Then
|
||||
' Rotazione del centro come spostamento grezzo più rotazione grezzo attorno al suo centro
|
||||
Dim ptRawCen As New Point3d
|
||||
EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||
Dim ptMovCen As New Point3d(ptRawCen)
|
||||
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), dAngDeg)
|
||||
If Not EgtMoveRawPart(nRawId, ptMovCen - ptRawCen) Then
|
||||
bMoveOk = False
|
||||
Exit While
|
||||
End If
|
||||
If Not EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngDeg) Then
|
||||
EgtMoveRawPart(nRawId, -(ptMovCen - ptRawCen))
|
||||
bMoveOk = False
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
nRawId = EgtGetNextRawPart(nRawId)
|
||||
End While
|
||||
If Not bMoveOk Then Exit While
|
||||
nPhase += 1
|
||||
End While
|
||||
' Se rotazione impossibile, ripristino posizione dei grezzi già spostati
|
||||
If Not bMoveOk Then
|
||||
Dim nRevPhase As Integer = 1
|
||||
Dim nRevRawId As Integer = GDB_ID.NULL
|
||||
While nRevPhase <= nPhase
|
||||
EgtSetCurrPhase(nRevPhase)
|
||||
nRevRawId = EgtGetFirstRawPart()
|
||||
While nRevRawId <> GDB_ID.NULL And (nRevPhase < nPhase Or nRevRawId <> nRawId)
|
||||
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
|
||||
' Eseguo al contrario
|
||||
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
|
||||
Dim ptRawCen As New Point3d
|
||||
EgtGetRawPartCenter(nRevRawId, ptRawCen)
|
||||
Dim ptMovCen As New Point3d(ptRawCen)
|
||||
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
|
||||
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
|
||||
End If
|
||||
nRevRawId = EgtGetNextRawPart(nRevRawId)
|
||||
End While
|
||||
nRevPhase += 1
|
||||
End While
|
||||
' Altrimenti eseguo sistemazioni
|
||||
Else
|
||||
' Origine della tavola
|
||||
Dim ptOri As Point3d
|
||||
EgtGetTableRef(1, ptOri)
|
||||
' Annullo rotazioni dei grezzi e le rifaccio sulle parti componenti
|
||||
Dim nRevPhase As Integer = 1
|
||||
Dim nRevRawId As Integer = GDB_ID.NULL
|
||||
While nRevPhase <= EgtGetPhaseCount()
|
||||
EgtSetCurrPhase(nRevPhase)
|
||||
nRevRawId = EgtGetFirstRawPart()
|
||||
While nRevRawId <> GDB_ID.NULL
|
||||
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
|
||||
' Eseguo al contrario
|
||||
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
|
||||
Dim ptRawCen As New Point3d
|
||||
EgtGetRawPartCenter(nRevRawId, ptRawCen)
|
||||
Dim ptMovCen As New Point3d(ptRawCen)
|
||||
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
|
||||
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
|
||||
' Rifaccio sugli oggetti contenuti nel grezzo
|
||||
Dim nId As Integer = EgtGetFirstInGroup(nRevRawId)
|
||||
While nId <> GDB_ID.NULL
|
||||
EgtRotate(nId, ptCen, Vector3d.Z_AX(), dAngDeg, GDB_RT.GLOB)
|
||||
nId = EgtGetNext(nId)
|
||||
End While
|
||||
' Imposto posizione esatta del grezzo dopo rotazione
|
||||
Dim b3Raw As New BBox3d
|
||||
EgtGetRawPartBBox(nRevRawId, b3Raw)
|
||||
EgtMoveToCornerRawPart(nRevRawId, (b3Raw.Min() - ptOri) + Point3d.ORIG(), MCH_CR.BL)
|
||||
End If
|
||||
nRevRawId = EgtGetNextRawPart(nRevRawId)
|
||||
End While
|
||||
nRevPhase += 1
|
||||
End While
|
||||
' Ruoto opportunamente anche i dati di movimento
|
||||
Dim nOpeId As Integer = EgtGetFirstActiveOperation()
|
||||
While nOpeId <> GDB_ID.NULL
|
||||
If EgtGetOperationType(nOpeId) = MCH_OY.DISP Then
|
||||
' Recupero i gruppi con i dati
|
||||
Dim nRpmId As Integer = EgtGetFirstNameInGroup(nOpeId, "Rpm*")
|
||||
While nRpmId <> GDB_ID.NULL
|
||||
' Recupero le informazioni
|
||||
Dim vtRawMove As New Vector3d
|
||||
If EgtGetInfo(nRpmId, "Mv", vtRawMove) Then
|
||||
vtRawMove.Rotate(Vector3d.Z_AX(), dAngDeg)
|
||||
EgtSetInfo(nRpmId, "Mv", vtRawMove)
|
||||
End If
|
||||
Dim vtDelta As New Vector3d
|
||||
If EgtGetInfo(nRpmId, "Dt", vtDelta) Then
|
||||
vtDelta.Rotate(Vector3d.Z_AX(), dAngDeg)
|
||||
EgtSetInfo(nRpmId, "Dt", vtDelta)
|
||||
End If
|
||||
Dim dAngRotDeg As Double = 0
|
||||
If EgtGetInfo(nRpmId, "Ad", dAngRotDeg) Then
|
||||
EgtSetInfo(nRpmId, "Ad", dAngRotDeg + dAngDeg)
|
||||
End If
|
||||
' Cerco un altro gruppo
|
||||
nRpmId = EgtGetNextName(nRpmId, "Rpm*")
|
||||
End While
|
||||
End If
|
||||
nOpeId = EgtGetNextActiveOperation(nOpeId)
|
||||
End While
|
||||
' Se non è registrazione, ruoto anche l'eventuale foto della lastra
|
||||
'If Not bIsReg Then
|
||||
' Dim nPhotoId = m_CurrProjPage.GetPhoto()
|
||||
' If nPhotoId <> GDB_ID.NULL then EgtRotatePhoto(nPhotoId, ptCen, Vector3d.Z_AX(), dAngDeg)
|
||||
'End If
|
||||
' Aggiorno rotazione totale
|
||||
If bIsReg Then
|
||||
CamAuto.SetRegistrationRotation(dRegRot + dAngDeg)
|
||||
Else
|
||||
CamAuto.SetRegistrationRotation(0)
|
||||
End If
|
||||
' Dichiaro grezzo per punti
|
||||
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
|
||||
End If
|
||||
' Ruoto i punti SpotReg disegnati in Office
|
||||
If bMoveOk Then
|
||||
RotateAllSpotRegistration(dAngDeg, ptCen)
|
||||
End If
|
||||
' Ripristino lo stato iniziale
|
||||
EgtSetCurrPhase(1)
|
||||
HideAllMachinings()
|
||||
Return bMoveOk
|
||||
End Function
|
||||
|
||||
' Ruoto solo gli elementi SpotReg creati nel programma OFFICE
|
||||
Private Sub RotateAllSpotRegistration(dAngRot As Double, ptCen As Point3d)
|
||||
Dim nId As Integer = EgtGetFirstInGroup(OmagOFFICEMap.refRawPartTabVM.m_nRegGroupId)
|
||||
While nId <> GDB_ID.NULL
|
||||
Dim sName As String = String.Empty
|
||||
EgtGetName(nId, sName)
|
||||
If Not sName.Contains("CUT") Then
|
||||
EgtRotate(nId, ptCen, Vector3d.Z_AX, dAngRot)
|
||||
End If
|
||||
nId = EgtGetNext(nId)
|
||||
End While
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub MoveAllRawParts(vtMove As Vector3d)
|
||||
' Provo il movimento
|
||||
Dim bMoveOk As Boolean = True
|
||||
Dim nPhase As Integer = 1
|
||||
Dim nRawId As Integer = GDB_ID.NULL
|
||||
While nPhase <= EgtGetPhaseCount()
|
||||
EgtSetCurrPhase(nPhase)
|
||||
nRawId = EgtGetFirstRawPart()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
If EgtVerifyRawPartPhase(nRawId, nPhase) Then
|
||||
If Not EgtMoveRawPart(nRawId, vtMove) Then
|
||||
bMoveOk = False
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
nRawId = EgtGetNextRawPart(nRawId)
|
||||
End While
|
||||
If Not bMoveOk Then Exit While
|
||||
nPhase += 1
|
||||
End While
|
||||
' Se movimento impossibile, ripristino posizione dei grezzi già spostati
|
||||
If Not bMoveOk Then
|
||||
Dim nRevPhase As Integer = 1
|
||||
Dim nRevRawId As Integer = GDB_ID.NULL
|
||||
While nRevPhase <= nPhase
|
||||
EgtSetCurrPhase(nRevPhase)
|
||||
nRevRawId = EgtGetFirstRawPart()
|
||||
While nRevRawId <> GDB_ID.NULL And (nRevPhase < nPhase Or nRevRawId <> nRawId)
|
||||
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
|
||||
EgtMoveRawPart(nRevRawId, -vtMove)
|
||||
End If
|
||||
nRevRawId = EgtGetNextRawPart(nRevRawId)
|
||||
End While
|
||||
nRevPhase += 1
|
||||
End While
|
||||
End If
|
||||
' Muovo i punti SpotReg generati nel programma OFFICE
|
||||
If bMoveOk Then
|
||||
OmagOFFICEMap.refRawPartTabVM.MoveAllSpotRegistration(vtMove)
|
||||
End If
|
||||
' Ripristino lo stato iniziale
|
||||
EgtSetCurrPhase(1)
|
||||
HideAllMachinings()
|
||||
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
|
||||
@@ -2265,7 +2467,7 @@ Public Class NestingTabVM
|
||||
Dim sOtherTab As String = GetTableName(ChgTbVM.nSelectedTable)
|
||||
|
||||
EgtChangeTable(sOtherTab, True)
|
||||
'm_CurrProjPage.AdjustAdditionalTable(True)
|
||||
EstCalc.AdjustAdditionalTable(True)
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
' aggiorno le lavorazioni
|
||||
UpdateAllMachiningsToolpaths()
|
||||
@@ -2277,8 +2479,8 @@ Public Class NestingTabVM
|
||||
Next
|
||||
' aggiorno posizionamento ventose per lavorazioni da sotto
|
||||
UpdateVacuumsForDrip()
|
||||
'' dichiaro tutto aggiornato
|
||||
'm_CurrProjPage.SetOrderMachiningFlag()
|
||||
' dichiaro tutto aggiornato
|
||||
EstCalc.SetOrderMachiningFlag()
|
||||
EgtSetCurrPhase(1)
|
||||
' aggiorno posizione pezzi in parcheggio
|
||||
Dim nPPId As Integer = EgtGetFirstPart()
|
||||
@@ -2286,63 +2488,61 @@ Public Class NestingTabVM
|
||||
PackPartInStore(nPPId)
|
||||
nPPId = EgtGetNextPart(nPPId)
|
||||
End While
|
||||
'' se prevista rotazione
|
||||
'If GetPrivateProfileInt(S_TABLE, K_CHANGETABWD, 0, m_MainWindow.GetMachIniFile()) = 2 Then
|
||||
' ' Dati tavola
|
||||
' Dim b3Tab As New BBox3d
|
||||
' EgtGetTableArea(1, b3Tab)
|
||||
' ' Box lastra
|
||||
' Dim b3OrigRaw As New BBox3d
|
||||
' GetRawBox(b3OrigRaw)
|
||||
' ' Allargo i limiti della tavola in tutte le fasi
|
||||
' Const TAB_OFFS As Double = 3000
|
||||
' For nI As Integer = 1 To EgtGetPhaseCount()
|
||||
' EgtSetCurrPhase(nI)
|
||||
' EgtSetTableAreaOffset(TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
|
||||
' Next
|
||||
' ' aggiorno posizionamento ventose per lavorazioni da sotto
|
||||
' UpdateVacuumsForDrip()
|
||||
' ' dichiaro tutto aggiornato
|
||||
' m_CurrProjPage.SetOrderMachiningFlag()
|
||||
' EgtSetCurrPhase(1)
|
||||
' ' Rotazione
|
||||
' Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
|
||||
' If Not RotateAllRawParts(dAngRot, False) Then
|
||||
' m_CurrProjPage.SetWarningMessage(EgtMsg(90339)) 'Rotazione impossibile
|
||||
' End If
|
||||
' ' Traslazione per riportare la lastra nella stessa posizione rispetto all'angolo BL che diveta TR e viceversa
|
||||
' Dim b3Raw As New BBox3d
|
||||
' GetRawBox(b3Raw)
|
||||
' Dim vtMove As Vector3d
|
||||
' If sOtherTab = SECOND_TAB Then
|
||||
' Dim vtDiffIni As Vector3d = b3OrigRaw.Min() - b3Tab.Min()
|
||||
' Dim vtDiffFin As Vector3d = b3Tab.Max() - b3Raw.Max()
|
||||
' vtMove = vtDiffFin - vtDiffIni
|
||||
' Else
|
||||
' Dim vtDiffIni As Vector3d = b3Tab.Max() - b3OrigRaw.Max()
|
||||
' Dim vtDiffFin As Vector3d = b3Raw.Min() - b3Tab.Min()
|
||||
' vtMove = -(vtDiffFin - vtDiffIni)
|
||||
' End If
|
||||
' vtMove.z = 0
|
||||
' MoveAllRawParts(vtMove)
|
||||
' ' Ripristino i limiti della tavola in tutte le fasi
|
||||
' For nI As Integer = 1 To EgtGetPhaseCount()
|
||||
' EgtSetCurrPhase(nI)
|
||||
' EgtSetTableAreaOffset(0, 0, 0, 0)
|
||||
' Next
|
||||
' EgtSetCurrPhase(1)
|
||||
' HideAllMachinings()
|
||||
'End If
|
||||
' se prevista rotazione
|
||||
If GetPrivateProfileInt(S_TABLE, K_CHANGETABWD, 0, CurrentMachine.sMachIniFile) = 2 Then
|
||||
' Dati tavola
|
||||
Dim b3Tab As New BBox3d
|
||||
EgtGetTableArea(1, b3Tab)
|
||||
' Box lastra
|
||||
Dim b3OrigRaw As New BBox3d
|
||||
GetRawBox(b3OrigRaw)
|
||||
' Allargo i limiti della tavola in tutte le fasi
|
||||
Const TAB_OFFS As Double = 3000
|
||||
For nI As Integer = 1 To EgtGetPhaseCount()
|
||||
EgtSetCurrPhase(nI)
|
||||
EgtSetTableAreaOffset(TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
|
||||
Next
|
||||
' aggiorno posizionamento ventose per lavorazioni da sotto
|
||||
UpdateVacuumsForDrip()
|
||||
' dichiaro tutto aggiornato
|
||||
EstCalc.SetOrderMachiningFlag()
|
||||
EgtSetCurrPhase(1)
|
||||
' Rotazione
|
||||
Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
|
||||
If Not RotateAllRawParts(dAngRot, False) Then
|
||||
'm_CurrProjPage.SetWarningMessage(EgtMsg(90339)) 'Rotazione impossibile
|
||||
End If
|
||||
' Traslazione per riportare la lastra nella stessa posizione rispetto all'angolo BL che diveta TR e viceversa
|
||||
Dim b3Raw As New BBox3d
|
||||
GetRawBox(b3Raw)
|
||||
Dim vtMove As Vector3d
|
||||
If sOtherTab = SECOND_TAB Then
|
||||
Dim vtDiffIni As Vector3d = b3OrigRaw.Min() - b3Tab.Min()
|
||||
Dim vtDiffFin As Vector3d = b3Tab.Max() - b3Raw.Max()
|
||||
vtMove = vtDiffFin - vtDiffIni
|
||||
Else
|
||||
Dim vtDiffIni As Vector3d = b3Tab.Max() - b3OrigRaw.Max()
|
||||
Dim vtDiffFin As Vector3d = b3Raw.Min() - b3Tab.Min()
|
||||
vtMove = -(vtDiffFin - vtDiffIni)
|
||||
End If
|
||||
vtMove.z = 0
|
||||
MoveAllRawParts(vtMove)
|
||||
' Ripristino i limiti della tavola in tutte le fasi
|
||||
For nI As Integer = 1 To EgtGetPhaseCount()
|
||||
EgtSetCurrPhase(nI)
|
||||
EgtSetTableAreaOffset(0, 0, 0, 0)
|
||||
Next
|
||||
EgtSetCurrPhase(1)
|
||||
HideAllMachinings()
|
||||
End If
|
||||
|
||||
' visualizzazione
|
||||
EgtZoom(ZM.ALL)
|
||||
' Elimino il datacontext della finsetra per la selezione della tavola
|
||||
ChgTbVM = Nothing
|
||||
Exit While
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
nId = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
' Dati per drag
|
||||
|
||||
@@ -43,7 +43,7 @@ Public Class RawPartTabVM
|
||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||
|
||||
' Layer per crocette dei punti REG
|
||||
Private m_nRegGroupId As Integer = GDB_ID.NULL
|
||||
Friend m_nRegGroupId As Integer = GDB_ID.NULL
|
||||
' Numero di spot inseriti nel grezzo corrente
|
||||
Private m_nCountSpot As Integer = 0
|
||||
' Gruppo Spot attualmente selezionato
|
||||
@@ -1978,10 +1978,14 @@ Public Class RawPartTabVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub MoveAllSpotRegistration(vtMove As Vector3d)
|
||||
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||
Friend Sub MoveAllSpotRegistration(vtMove As Vector3d, Optional bOnlyOfficeSpot As Boolean = True)
|
||||
Dim nId As Integer = EgtGetFirstInGroup(OmagOFFICEMap.refRawPartTabVM.m_nRegGroupId)
|
||||
While nId <> GDB_ID.NULL
|
||||
EgtMove(nId, vtMove)
|
||||
Dim sName As String = String.Empty
|
||||
EgtGetName(nId, sName)
|
||||
If Not sName.Contains("CUT") Or Not bOnlyOfficeSpot Then
|
||||
EgtMove(nId, vtMove)
|
||||
End If
|
||||
nId = EgtGetNext(nId)
|
||||
End While
|
||||
EgtDraw()
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Reference in New Issue
Block a user