Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 073edfeba8 | |||
| 6be3eac0ca | |||
| d470d8723f | |||
| 4f5804206d | |||
| 58828cf846 | |||
| 36138ec459 | |||
| 7fc49b0d1d | |||
| cf9379272c | |||
| cd6714752e | |||
| 4c62410c20 | |||
| b017fef2b9 | |||
| 17785afc20 | |||
| d101e04813 | |||
| 936d747dae | |||
| bf1b8899a4 | |||
| 0de3b52239 | |||
| a36f1bb826 | |||
| d2b2a1b134 |
@@ -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, 2406, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2406, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2410, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2410, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.OFFICE_BASE)
|
||||
' Inizializzazione generale di EgtInterface
|
||||
|
||||
@@ -69,6 +69,6 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.9.4")>
|
||||
<Assembly: AssemblyFileVersion("2.4.9.4")>
|
||||
<Assembly: AssemblyVersion("2.4.10.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.10.1")>
|
||||
|
||||
|
||||
@@ -235,6 +235,10 @@
|
||||
<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>
|
||||
@@ -421,6 +425,10 @@
|
||||
<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>
|
||||
@@ -691,6 +699,18 @@
|
||||
<ItemGroup>
|
||||
<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" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagOFFICE\OmagOFFICER32.exe
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<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>
|
||||
@@ -0,0 +1,3 @@
|
||||
Public Class FinalMoveRawModeV
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,186 @@
|
||||
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
|
||||
@@ -6,6 +6,50 @@ 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
|
||||
@@ -30,6 +74,13 @@ 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
|
||||
@@ -43,12 +94,23 @@ 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
|
||||
Return m_MoveRawModeV
|
||||
If OmagOFFICEMap.refSplitModeVM.bOnAuxTab Then
|
||||
Return m_FinalMoveRawModeV
|
||||
Else
|
||||
Return m_MoveRawModeV
|
||||
End If
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
@@ -97,7 +159,7 @@ Public Class MachiningTabVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_AutoVisibility As Visibility
|
||||
Private m_AutoVisibility As Visibility = Visibility.Visible
|
||||
Public Property AutoVisibility As Visibility
|
||||
Get
|
||||
Return m_AutoVisibility
|
||||
@@ -143,6 +205,9 @@ 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
|
||||
@@ -165,6 +230,10 @@ 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()
|
||||
@@ -173,7 +242,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)
|
||||
@@ -182,6 +251,9 @@ 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
|
||||
@@ -189,7 +261,37 @@ 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()
|
||||
@@ -202,10 +304,13 @@ Public Class MachiningTabVM
|
||||
End Function
|
||||
|
||||
Private Sub ManageExit()
|
||||
Dim bEnab As Boolean = (m_MachiningMode = MachiningModeOpt.SPLIT)
|
||||
' 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
|
||||
OmagOFFICEMap.refOptionPanelVM.RawTabIsEnabled = bEnab
|
||||
OmagOFFICEMap.refOptionPanelVM.NestTabIsEnabled = bEnab
|
||||
OmagOFFICEMap.refOptionPanelVM.SimulTabIsEnabled = bEnab
|
||||
bPrev = False
|
||||
bToNext = False
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
@@ -227,6 +332,7 @@ 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
|
||||
@@ -235,6 +341,69 @@ 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
|
||||
@@ -260,15 +429,63 @@ 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()
|
||||
|
||||
@@ -8,6 +8,8 @@ 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
|
||||
@@ -109,15 +111,6 @@ 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
|
||||
@@ -127,15 +120,20 @@ 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
|
||||
@@ -184,8 +182,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
|
||||
If Not OmagOFFICEMap.refMachiningTabVM.IsShow Then
|
||||
' 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
|
||||
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||
GetMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
||||
End If
|
||||
@@ -216,6 +214,15 @@ 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
|
||||
@@ -228,8 +235,6 @@ 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
|
||||
@@ -238,6 +243,48 @@ 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
|
||||
|
||||
@@ -273,7 +320,7 @@ Public Class MoveRawModeVM
|
||||
End Sub
|
||||
|
||||
' verifica che la posizione di rialascio sia corretta, altrimenti coreggo il vettore di posizione
|
||||
Private Function VerifyReleasdPositionIsValid(ByRef vtMove As Vector3d) As Boolean
|
||||
Friend 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
|
||||
@@ -338,6 +385,7 @@ 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
|
||||
@@ -407,6 +455,65 @@ 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"
|
||||
@@ -717,6 +824,202 @@ 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"
|
||||
|
||||
@@ -67,6 +67,21 @@ 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
|
||||
@@ -457,6 +472,8 @@ 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()
|
||||
@@ -475,6 +492,7 @@ 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
|
||||
@@ -556,6 +574,7 @@ Public Class SplitModeVM
|
||||
If bTrueExit Then
|
||||
' ritorno a fase 1
|
||||
EgtSetCurrPhase(1)
|
||||
OmagOFFICEMap.refMachiningTabVM.nCurrPhase = 1
|
||||
' Ripristino visualizzazione preview lavorazioni
|
||||
ShowAllPhasesMachiningPreview()
|
||||
End If
|
||||
@@ -754,15 +773,22 @@ 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 = (GetDisabledCutsCount() > 0 And
|
||||
(GetSplitCutsCount() > 0 Or m_nCurrPhase > 1)) Or
|
||||
CurrentMachine.bRawFinalMove
|
||||
OmagOFFICEMap.refMachiningTabVM.NextIsEnabled = Not bStdTab Or m_bOnAuxTab Or bFinalMoveTab
|
||||
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
|
||||
@@ -1292,6 +1318,8 @@ Public Class SplitModeVM
|
||||
' If Item.bIsActive Then ItemList.Add(Item)
|
||||
'Next
|
||||
VerifyHomogenousMachining(ItemList)
|
||||
' Abilitazione bottone Next
|
||||
EnableButtons()
|
||||
End Sub
|
||||
|
||||
#End Region ' OnOffCommand
|
||||
|
||||
@@ -1922,6 +1922,8 @@ 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
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -14,6 +14,7 @@ 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
|
||||
@@ -114,6 +115,12 @@ 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
|
||||
@@ -190,7 +197,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
|
||||
|
||||
@@ -224,6 +231,11 @@ 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)
|
||||
|
||||
Reference in New Issue
Block a user