Compare commits

...

43 Commits

Author SHA1 Message Date
Nicola Pievani 2c0afccbe3 Avvio lo scatto automatico per OmagPHOTO 2023-07-10 14:58:14 +02:00
Nicola Pievani 27b13292cf Merge commit '7b9d99a9c66d353a869c189f7d348db75b489bf5' into develop 2023-06-26 18:30:43 +02:00
Nicola Pievani 7b9d99a9c6 Correzione gestione FeedSideAng, chiave di protezione CompoFrame 2023-06-26 18:30:16 +02:00
Nicola Pievani 1e2b4bed27 Aggiornamento Feed (Reset + Ctrl) 2023-06-15 17:33:25 +02:00
Nicola Pievani 4ecf7980ce Merge commit '82157d3b6e2e25c8257612d6b026a6b8ef10304c' into develop 2023-06-15 12:27:28 +02:00
Nicola Pievani 82157d3b6e Abilitato inversione tagli waterjet verticali 2023-06-14 20:03:37 +02:00
Nicola Pievani 6dbf4f5ccb Gestione multi inserimento e interasse Frame 2023-06-13 18:29:39 +02:00
Nicola Pievani a55ab4f83d Correzione importazione DXF 2023-06-07 12:53:57 +02:00
Nicola Pievani fd89a6cf3b Gestione interruzione simulazione in TagliDiretti 2023-05-31 12:32:48 +02:00
Nicola Pievani b505b79d9a Correzione gestione apertura CN per Tagli Diretti 2023-05-31 12:29:08 +02:00
Nicola Pievani b1313ddb55 Modificata disosizione pulsanti 2023-05-31 11:50:44 +02:00
Nicola Pievani f3889ede24 Cambio versione 2.5f1 2023-05-31 10:53:33 +02:00
Nicola Pievani 5ca010ae4a Merge branch 'Features/Rectification_SideAng_WJ' into develop 2023-05-31 10:51:09 +02:00
Nicola Pievani 391d25507e Inserita gestione Flag per Rettificata tagli inclinati 2023-05-30 19:27:14 +02:00
Nicola Pievani c954f364e3 Modifica gestione FEED per controllo FANUC 2023-05-26 17:35:18 +02:00
Nicola Pievani 1ab6d2746f Correzione disabilitazione NuovoRiferimento 2023-05-25 12:48:26 +02:00
Nicola Pievani 41de0516c8 Merge branch 'Features/New_Front_Unloading' into develop 2023-05-24 12:01:26 +02:00
Nicola Pievani dec4c0d312 Migliorata abilitazione comando Next in MoveRaw 2023-05-24 12:00:11 +02:00
Nicola Pievani 834f3afe1c Correzione pulsante bottone HOME in MachButtons 2023-05-23 18:40:38 +02:00
Nicola Pievani e6c95323fb Aggiunto controllo stato pulsante bottone HOME in MachButtons 2023-05-23 18:32:22 +02:00
Nicola Pievani fa6e5b520f Merge branch 'master' into develop 2023-05-23 16:18:53 +02:00
Nicola Pievani aefc037cd9 Correzione apertura programma da progetto 2023-05-23 16:18:13 +02:00
Nicola Pievani c475f7dc12 Miglioramento gestione scarico frontale 2023-05-23 15:13:41 +02:00
Nicola Pievani c5f3d4fcfb Merge branch 'develop' 2023-05-18 15:33:23 +02:00
Nicola Pievani a04e2cbe62 Gestione avanzata posizionamento pezzi VeinMatch 2023-05-18 14:43:03 +02:00
Nicola Pievani da980a649e Merge branch 'Features/Compo_Frames' into develop 2023-05-18 11:18:14 +02:00
Nicola Pievani 9c7d60d307 Aggiornati i messaggi 2023-05-15 14:57:25 +02:00
Nicola Pievani a7adcdcaca Correzione visualizzazione Pagine componenti 2023-05-15 12:14:54 +02:00
Nicola Pievani 0151cd8f9e Eliminazio grezzi non appartenetent alla fase 1 comando Reset 2023-05-03 10:02:17 +02:00
Nicola Pievani 75e3729216 Merge branch 'develop' into Features/New_Front_Unloading 2023-05-02 17:57:33 +02:00
Nicola Pievani ef1aef12ed Merge branch 'develop' 2023-04-28 13:24:04 +02:00
Nicola Pievani 59e3ae5841 Aggiornamento versione 2.5d3 2023-04-28 12:41:44 +02:00
Nicola Pievani 58de5d4077 Gestione scarico+movimento/movimento+scarico 2023-04-28 11:01:12 +02:00
Nicola Pievani b6beef668d Unificato fase di Moviment e Scarico (deve essere gestito l'inverso) 2023-04-27 17:42:08 +02:00
Nicola Pievani 3fae33404b Gestione navigazione Split Phase 2023-04-17 15:58:52 +02:00
Nicola Pievani efafacf6ca Merge branch 'develop' 2023-04-07 10:01:54 +02:00
Nicola Pievani 07d8145d57 Iniziata gestione navigazione all'interno delle fasi 2023-03-20 20:15:31 +01:00
Nicola Pievani 652c396933 Merge branch 'develop' 2023-03-20 15:37:52 +01:00
Nicola Pievani 8d363b8b06 Inizio creazione nuova fase scarico durante lavorazioni 2023-03-17 18:20:27 +01:00
Nicola Pievani 7ecad4c218 Merge branch 'develop' 2023-03-13 10:45:46 +01:00
Nicola Pievani 36a1ecb509 Merge branch 'develop' 2023-03-09 12:53:18 +01:00
Nicola Pievani 0eaebd5aad Inserito comando per passare alla pagina di scarico frontale 2023-03-08 11:49:52 +01:00
NicolaP b48d4900ea Merge branch 'develop' 2023-02-10 13:20:23 +01:00
32 changed files with 1039 additions and 331 deletions
+19 -2
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.Windows.Forms.Integration
Imports EgtUILib
Friend Module CamAuto
@@ -29,7 +30,7 @@ Friend Module CamAuto
Return bOk
End Function
Friend Function AddWaterJetMachining( nOperId As Integer, ByRef nWarn As Integer) As Boolean
Friend Function AddWaterJetMachining(nOperId As Integer, ByRef nWarn As Integer) As Boolean
EgtLuaCreateGlobTable("CAM")
SetLuaStandardCamParams()
EgtLuaSetGlobIntVar("CAM.OPERID", nOperId)
@@ -163,6 +164,22 @@ Friend Module CamAuto
Return bOk
End Function
Friend Function ResetAllRawPart() As Boolean
Dim nPhase As Integer = 1
Dim nOtherRaw As Integer = EgtGetFirstRawPart()
While nOtherRaw <> GDB_ID.NULL
' se il pezzo non appartiene alla prima fase allora viene eliminato
If Not EgtVerifyRawPartPhase(nOtherRaw, nPhase) Then
Dim NextRaw As Integer = EgtGetNextRawPart(nOtherRaw)
EgtRemoveRawPart(nOtherRaw)
nOtherRaw = NextRaw
Else
nOtherRaw = EgtGetNextRawPart(nOtherRaw)
End If
End While
Return True
End Function
' verifico che il contorno passato non sia stato separato
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer)
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
+123 -120
View File
@@ -7,164 +7,167 @@
mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280">
<!-- Definizione della SplitPage -->
<Grid Name="SplitPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!-- Definizione della SplitPage -->
<Grid Name="SplitPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!--Upper button grid-->
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="8*"/>
</Grid.ColumnDefinitions>
<!--Griglia per oscurare i bottoni della pagina sottostante-->
<Grid Background="{DynamicResource OmagCut_Gray}">
<!--Upper button grid-->
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="8*"/>
</Grid.ColumnDefinitions>
<Button Name="PrevBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource NumericKeyboardArrowImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
<!--Griglia per oscurare i bottoni della pagina sottostante-->
<Grid Background="{DynamicResource OmagCut_Gray}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="PrevBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource NumericKeyboardArrowImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="NextBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource NumericKeyboardArrowImg}" Style="{StaticResource OmagCut_ButtonIcon}" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<TransformGroup>
<RotateTransform Angle="180"/>
</TransformGroup>
</Image.RenderTransform>
</Image>
</Button>
<Button Name="ModifyBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
</Grid>
<!--Left Button Grid-->
<Grid Grid.RowSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Button Name="TopLBtn" Grid.Column="0" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="{DynamicResource TopLeftImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="NextBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource NumericKeyboardArrowImg}" Style="{StaticResource OmagCut_ButtonIcon}" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<TransformGroup>
<RotateTransform Angle="180"/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<Button Name="UpBtn" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="{DynamicResource UpArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="ModifyBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowTextButton}"/>
</Grid>
</Grid>
<!--Left Button Grid-->
<Grid Grid.RowSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Button Name="TopLBtn" Grid.Column="0" Grid.Row="1"
<Button Name="TopRBtn" Grid.Column="2" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="{DynamicResource TopLeftImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="UpBtn" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="{DynamicResource UpArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="TopRBtn" Grid.Column="2" Grid.Row="1"
Style="{DynamicResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="{DynamicResource TopRightImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="LeftBtn" Grid.Column="0" Grid.Row="2"
<Image Source="{DynamicResource TopRightImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="LeftBtn" Grid.Column="0" Grid.Row="2"
Style="{DynamicResource OmagCut_LeftGrayGradientYellowButton}">
<Image Source="{DynamicResource LeftArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<EgtWPFLib:EgtTextBox Name="StepMoveTxBx" Grid.Column="1" Grid.Row="2" Width="50"
<Image Source="{DynamicResource LeftArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<EgtWPFLib:EgtTextBox Name="StepMoveTxBx" Grid.Column="1" Grid.Row="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<Button Name="ResetBtn" Grid.Column="1" Grid.Row="2"
<Button Name="ResetBtn" Grid.Column="1" Grid.Row="2"
Style="{DynamicResource OmagCut_YellowTextButton}">
</Button>
<Button Name="RightBtn" Grid.Column="2" Grid.Row="2"
</Button>
<Button Name="RightBtn" Grid.Column="2" Grid.Row="2"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource RightArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="BottomLBtn" Grid.Column="0" Grid.Row="3"
<Image Source="{DynamicResource RightArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="BottomLBtn" Grid.Column="0" Grid.Row="3"
Style="{DynamicResource OmagCut_BottomGrayGradientYellowButton}">
<Image Source="{DynamicResource BottomLeftImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="DownBtn" Grid.Column="1" Grid.Row="3"
<Image Source="{DynamicResource BottomLeftImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="DownBtn" Grid.Column="1" Grid.Row="3"
Style="{DynamicResource OmagCut_BottomGrayGradientYellowButton}">
<Image Source="{DynamicResource DownArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="BottomRBtn" Grid.Column="2" Grid.Row="3"
<Image Source="{DynamicResource DownArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="BottomRBtn" Grid.Column="2" Grid.Row="3"
Style="{DynamicResource OmagCut_BottomGrayGradientYellowButton}">
<Image Source="{DynamicResource BottomRightImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Image Source="{DynamicResource BottomRightImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<Button Name="RotateCounterClockwiseBtn" Grid.Column="0" Grid.Row="4"
<Button Name="RotateCounterClockwiseBtn" Grid.Column="0" Grid.Row="4"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource CounterClockwiseRotateImg}" Width="64" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
</Button>
<Grid Name="RotationAngle" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="RotationAngleTxBx" Width="50" IsLength="False"
<Grid Name="RotationAngle" Grid.Column="1" Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="RotationAngleTxBx" Width="50" IsLength="False"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Grid.Column="1" FontSize="30" Margin="2,-5,0,0"
<TextBlock Grid.Column="1" FontSize="30" Margin="2,-5,0,0"
Text="°"/>
</Grid>
</Grid>
<Button Name="RotateClockwiseBtn" Grid.Column="2" Grid.Row="4"
<Button Name="RotateClockwiseBtn" Grid.Column="2" Grid.Row="4"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource ClockwiseRotateImg}" Width="65" Height="65" HorizontalAlignment="Center"
<Image Source="{DynamicResource ClockwiseRotateImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
</Button>
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
<!--Gestione sfridi-->
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
<Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<!--Gestione scarico pezzi-->
<Button Name="UnloadPartsBtn" Grid.ColumnSpan="2" Grid.Row="7"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Grid Grid.Row="7" Grid.ColumnSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
</Grid>
</Grid>
<!--Lower button grid, sfondo grigio per coprire i bottoni della pagina sottostante-->
<Grid Grid.Column="1" Grid.Row="2" Background="{DynamicResource OmagCut_Gray}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
</Grid>
</Grid>
<!--Lower button grid, sfondo grigio per coprire i bottoni della pagina sottostante-->
<Grid Grid.Column="1" Grid.Row="2" Background="{DynamicResource OmagCut_Gray}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<!-- Inserimento della pausa durante il movimento sulla tavola di scarico-->
<Button Name="PauseBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Pausa-ON_OFFImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Grid>
</UserControl>
+305 -72
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.Windows.Forms.Integration
Imports EgtUILib
Public Class MoveRawPartPage
' Riferimento alla MainWindow
@@ -35,12 +36,16 @@ Public Class MoveRawPartPage
Private m_ScrapsVisibility As Visibility = Visibility.Visible
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
' definisce se è stata inserito uno scarico
Private m_IsCurrPhaseUnloaded As Boolean = False
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Assegno testi
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) 'Modifica
ResetBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
ScrapsBtn.Content = "Add Scraps"
UnloadPartsBtn.Content = "Move part"
End Sub
Private Sub MoveRawPartPage_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
@@ -60,7 +65,12 @@ Public Class MoveRawPartPage
End If
' Deseleziono tutto
EgtDeselectAll()
' Recupero i tagli allungati prima definiti
' resetto variabili di navigazione nelle fasi
m_bPrev = False
m_bToNext = False
'---------------------------- CREATE NEW PHASE ----------------------------
' Recupero i tagli ABILITATI prima definiti
Dim Cuts(0) As Integer
m_SplitPage.GetEnabledCuts(Cuts)
' Fase precedente
@@ -69,11 +79,19 @@ Public Class MoveRawPartPage
Dim vNewRaws As New List(Of Integer)
If Not m_SplitPage.m_bShow Then
SplitRawParts(nPrevPhase, Cuts, vNewRaws)
m_IsCurrPhaseUnloaded = False
Else
EgtSetCurrPhase(nPrevPhase + 1)
nPrevPhase = nPrevPhase + 1
EgtSetCurrPhase(nPrevPhase)
HideAllMachinings()
' verifico se la fase corrente è di tipo scarico frontale
m_nCurrDisposition = EgtGetPhaseDisposition(nPrevPhase)
If IsDispUnloadOnAuxTab(m_nCurrDisposition) Then
m_SplitPage.m_bOnAuxTab = True
End If
End If
m_nCurrPhase = EgtGetCurrPhase()
'---------------------------- CREATE NEW PHASE ----------------------------
'---------------------------- SCRAPS ----------------------------
' gestione visualizzazione del comando "Scraps"
@@ -101,14 +119,19 @@ Public Class MoveRawPartPage
End If
'---------------------------- SCRAPS ----------------------------
'---------------------------- AUX TABLE ----------------------------
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
If m_SplitPage.m_bOnAuxTab Then
' assegnazione delle info tavola ausiliaria alla dispozione corrente
If m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
' assegnazione delle info tavola ausiliaria alla dispozione corrente (Spostato nella funzione Refresh)
SetAuxTabInCurrDisposition()
UnloadPartsBtn.Content = "Go to MOVE part"
' altrimenti, aggiorno visualizzazione
Else
ElseIf Not m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
EgtDraw()
UnloadPartsBtn.Content = "Go to UNLOAD part"
End If
'---------------------------- AUX TABLE ----------------------------
' Carico i parametri di movimento
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
' Ricavo la lunghezza del baffo di taglio
@@ -167,6 +190,30 @@ Public Class MoveRawPartPage
' aggiorno il messaggio del comando per gestire gli sfridi
VerifyIsNewScrap(m_CurrRawOnVacuum)
' aggiorno la visibilità dei comandi
RefreshVisibility()
' salvo l'idice della fase corrente
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
' Abilitazione bottone modifica
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
' gestione abilitazione altri bottoni
EnableButtons()
End Sub
' Gestione di visualizzazione dei comandi per il movimento dei pezzi
Private Sub RefreshVisibility()
' Aggiorno visulizzazione comando per passare alla pagina di scarico
If Not m_SplitPage.m_bEnableOnAuxTab Then
UnloadPartsBtn.Visibility = Visibility.Hidden
Else
UnloadPartsBtn.Visibility = Visibility.Visible
If m_SplitPage.m_bOnAuxTab Then
UnloadPartsBtn.Content = "Go to MOVE part"
' altrimenti, aggiorno visualizzazione
Else
UnloadPartsBtn.Content = "Go to UNLOAD part"
End If
End If
' Aggiorno interfaccia per taglio perpendicolare
If m_bByHand Then
UpBtn.Visibility = Windows.Visibility.Visible
@@ -222,12 +269,6 @@ Public Class MoveRawPartPage
ResetBtn.Visibility = Windows.Visibility.Visible
ScrapsBtn.Visibility = Windows.Visibility.Hidden
End If
' salvo l'idice della fase corrente
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
' Abilitazione bottone modifica
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
' gestione abilitazione altri bottoni
EnableButtons()
End Sub
Private Sub SetAuxTabInCurrDisposition()
@@ -292,12 +333,12 @@ Public Class MoveRawPartPage
EgtSetStatus(nId, GDB_ST.ON_)
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola (evito il controllo se ultima fase)
If VerifyCollisionWithOtherRawPart(nId) Then
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
Else
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' mantengo la selezione del pezzo
EgtSetStatus(nId, GDB_ST.SEL)
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
Else
' Se con ventose, le nascondo
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
End If
Else
@@ -445,7 +486,7 @@ Public Class MoveRawPartPage
If EgtMoveRawPart(nRawId, dMove * m_vtDir) Then
m_dCurrDist += Math.Abs(dMove)
End If
' Altrimenti movimento Y +
' Altrimenti movimento Y +
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, m_dStep, 0)
@@ -488,7 +529,7 @@ Public Class MoveRawPartPage
If EgtMoveRawPart(nRawId, dMove * m_vtDir) Then
m_dCurrDist -= Math.Abs(dMove)
End If
' Altrimenti movimento Y -
' Altrimenti movimento Y -
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, -m_dStep, 0)
@@ -780,6 +821,33 @@ Public Class MoveRawPartPage
End While
End Sub
' Passo dalla pagina di movimento dei pezzi alla pagina di scarico
Private Sub UnloadPartBtn_Click() Handles UnloadPartsBtn.Click
' forzo lo stato di scarico frontale oppure di movimento
m_SplitPage.m_bOnAuxTab = Not m_SplitPage.m_bOnAuxTab
' se rientro nella fase di spostamenti allora nascondo la tavola di scarico
If Not m_SplitPage.m_bOnAuxTab Then
' se ci sono pezzi sulla tavola di scarico non posso nasconderla
Dim LclLstOfUnldPart As New List(Of Integer)
If Not PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase) Then
EgtDisableModified()
' nascondo la tavola di scarico
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
' Nascondo eventuali pezzi in parcheggio
HideParkedParts()
EgtEnableModified()
End If
Else
' Assegnazione delle info tavola ausiliaria alla dispozione corrente
SetAuxTabInCurrDisposition()
End If
' Mantengo la fase che è stata creata e passo a gestire solo la visualizzazione dei bottoni
RefreshVisibility()
EgtZoom(ZM.ALL, True)
End Sub
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
Dim dStep As Double
If StringToLen(StepMoveTxBx.Text, dStep) Then
@@ -821,16 +889,16 @@ Public Class MoveRawPartPage
Dim ptRef As Point3d
If Not EgtGetInfo(nRefId, "Pos", ptRef) Then Return
Dim sCorn As String = ""
EgtGetInfo( nRefId, "COR", sCorn)
Select 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
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
@@ -1007,8 +1075,44 @@ Public Class MoveRawPartPage
End Function
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
' verifico la presenza di eventuali pezzi sulla tavola di scarico
Dim LclLstOfUnldPart As New List(Of Integer)
PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase)
If Not InsertPauseInCurrPhase() Then Return
AddNewPhase()
End Sub
' restituisce la lista dei pezzi che sono sulla tavola di scarico nella fase indicata
Private Function PartOnAuxTab(ByRef ListOfUnloadedPatr As List(Of Integer), nPhase As Integer) As Boolean
m_IsCurrPhaseUnloaded = False
' Area tavolo ausiliario
Dim b3AuxTab As New BBox3d
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
' Area pezzi
Dim nOtherRaw As Integer = EgtGetFirstRawPart()
While nOtherRaw <> GDB_ID.NULL
If EgtVerifyRawPartPhase(nOtherRaw, nPhase) Then
Dim b3OtherRaw As New BBox3d
' EgtGetRawPartBBox(nOtherRaw, b3OtherRaw)
EgtGetBBoxGlob(nOtherRaw, GDB_BB.STANDARD, b3OtherRaw)
' se il centro del pezzo è sulla tavola di scarico
If b3OtherRaw.Center.y < b3AuxTab.Max().y Then
m_IsCurrPhaseUnloaded = True
ListOfUnloadedPatr.Add(nOtherRaw)
' salvo l'info che indica che il pezzo deve essere scaricato
EgtSetInfo(nOtherRaw, "Unloaded", 1)
'Exit While
End If
End If
nOtherRaw = EgtGetNextRawPart(nOtherRaw)
End While
Return m_IsCurrPhaseUnloaded
End Function
' inserisce una pausa nella fase corrente
Private Function InsertPauseInCurrPhase() As Boolean
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
If m_RawMoveDataList.Count = 0 Then Return
If m_RawMoveDataList.Count = 0 Then Return False
' 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
@@ -1017,8 +1121,9 @@ Public Class MoveRawPartPage
End If
Next
' verifico che la lista non sia vuota
If m_RawMoveDataList.Count = 0 Then Return
If m_RawMoveDataList.Count = 0 Then
Return False
End If
' recupero disposizione fase corrente
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' imposto la pausa nella disposizione corrente
@@ -1026,30 +1131,22 @@ Public Class MoveRawPartPage
' 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, m_SplitPage.m_bOnAuxTab)
SaveMovePartsOnAuxTable(nDispId, m_IsCurrPhaseUnloaded)
' SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
'' Eseguo calcolo speciale dei movimenti: per tavola multicut
'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
SaveRemoveByHandInDisposition(nDispId, False)
Return True
End Function
' crea una nuvoa fase/disposizione, la rende corrente, ricalcolo i grezzi e le lavorazioni della nuova fase
Private Function AddNewPhase() As Boolean
' 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
' Carico i grezzi rimasti sulla tavola nella nuova fase
ChangePhaseRawPart(nNewPhase)
' Sposto le lavorazioni rimaste nella nuova fase
ChangeOperationPhase(nNewPhase)
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
'SetPause(nCurrDisposition)
@@ -1060,8 +1157,43 @@ Public Class MoveRawPartPage
SetAuxTabInCurrDisposition()
' ripulisco la lista degli spostamenti
m_RawMoveDataList.Clear()
m_IsCurrPhaseUnloaded = False
' aggiorno la fase corrente
m_nCurrPhase = EgtGetCurrPhase()
Return True
End Function
' Copio i grezzi rimasti sulla tavola nella fase successiva
Private Sub ChangePhaseRawPart(ByVal nNewPhase As Integer)
' recupero l'elenco dei pezzi che sono stati scaricati sulla tavola
Dim LocalLstOfUnldPart As New List(Of Integer)
PartOnAuxTab(LocalLstOfUnldPart, nNewPhase - 1)
' 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
' se il pezzo è stato scaricato allora non deve essere riportato nella fase successiva
For Each UnloadPart As Integer In LocalLstOfUnldPart
If nRawId = UnloadPart Then
' salvo l'info che indica che il pezzo deve essere scaricato
EgtSetInfo(nRawId, "Unloaded", 1)
bKeepRawPart = False
Exit For
End If
Next
'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
End Sub
Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click
@@ -1077,6 +1209,8 @@ Public Class MoveRawPartPage
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngRaw)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
RemoveRawMoveData(nRawId, m_RawMoveDataList)
' elimino l'info che indica che il pezzo è scaricato sulla tavola
EgtRemoveInfo(nRawId, "Unloaded")
' Disabilito pezzo e nascondo le ventose
EgtSetStatus(nRawId, GDB_ST.ON_)
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
@@ -1109,6 +1243,14 @@ Public Class MoveRawPartPage
m_nCurrPhase -= 1
m_bPrev = False
m_SplitPage.m_bShow = True
m_SplitPage.m_bOnAuxTab = True
' imposto la visibilità della tavola ausiliaria
SetAuxTabInCurrDisposition()
' carico le info di disposizione dei pezzi
m_RawMoveDataList.Clear()
m_bRemovedRaw = GetRemoveByHandInDisposition(m_nCurrDisposition)
GetMoveInfoInDisposition(m_nCurrDisposition, m_RawMoveDataList)
RefreshVisibility()
EgtDraw()
Return
End If
@@ -1139,18 +1281,53 @@ Public Class MoveRawPartPage
Return
End If
' 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_SplitPage.m_bShow = True
EgtDraw()
EnableButtons()
Return
' ------- VISUALIZZAZIONE -------
If m_SplitPage.m_bShow Then
' verifico se la fase successiva è uno scarico frontale
If NextOperationIsUnloading(m_nCurrDisposition) Then
' imposto la nuova fase (che è stata modificata all'interno della funzione di controllo)
EgtSetCurrPhase(m_nCurrPhase)
' carico i dati di movimento dei pezzi nella fase corrente
m_RawMoveDataList.Clear()
m_bRemovedRaw = GetRemoveByHandInDisposition(m_nCurrDisposition)
GetMoveInfoInDisposition(m_nCurrDisposition, m_RawMoveDataList)
EgtDraw()
EnableButtons()
Return
ElseIf IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 AndAlso Not NextOperationIsUnloading(m_nCurrDisposition) Then
' imposto la nuova fase, al termine della Sub verrà caricata la pagina Split nella fase indicata ora
m_bToNext = True
m_nCurrPhase += 1
EgtSetCurrPhase(m_nCurrPhase)
EgtDraw()
End If
End If
' ------- MODIFICA -------
If Not m_SplitPage.m_bShow Then
' se la tavola di scarico presente oppure ci sono pezzi sulla tavola di scarico
Dim LclLstOfUnldPart As New List(Of Integer)
If m_SplitPage.m_bOnAuxTab Or PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase) Then
' se ci sono pezzi sulla tavola di scarico prima di procedere inserisco una pausa e creo una nuoava fase
If m_IsCurrPhaseUnloaded AndAlso InsertPauseInCurrPhase() Then AddNewPhase()
' nascondo la tavola di scarico
EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
EgtEnableModified()
End If
m_bToNext = True
'' 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_SplitPage.m_bShow = True
' EgtDraw()
' EnableButtons()
' Return
'End If
End If
' resetto l'inidice del pezzo da mnovimentare
m_CurrRawOnVacuum = GDB_ID.NULL
' Deseleziono tutto
@@ -1193,7 +1370,7 @@ Public Class MoveRawPartPage
' disabilito bottone
ModifyBtn.IsEnabled = False
' gestione abilitazione altri bottoni
EnableButtons()
EnableButtons(MachiningList.Count > 0)
End Sub
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
@@ -1204,6 +1381,20 @@ Public Class MoveRawPartPage
Return bVal
End Function
' restituisce e attiva la successiva disposizione se è uno scarico frontale
Public Function NextOperationIsUnloading(nCurrDispId As Integer) As Boolean
' recupero la primo operazione successiva
Dim nNextIdOperation As Integer = EgtGetNextOperation(nCurrDispId)
' a partire da questa cerco la prima disposizione disponibile
Dim nNextIdDips As Integer = GetNextDisposition(nNextIdOperation)
If nNextIdDips = nNextIdOperation And IsDispUnloadOnAuxTab(nNextIdOperation) Then
m_nCurrPhase += 1
m_nCurrDisposition = nNextIdOperation
Return True
End If
Return False
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
@@ -1216,7 +1407,7 @@ Public Class MoveRawPartPage
Return GDB_ID.NULL
End Function
Private Sub EnableButtons()
Private Sub EnableButtons(Optional bExistsMachining As Boolean = False)
UpBtn.IsEnabled = Not m_SplitPage.m_bShow
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
RightBtn.IsEnabled = Not m_SplitPage.m_bShow
@@ -1232,19 +1423,35 @@ Public Class MoveRawPartPage
BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow
PauseBtn.IsEnabled = Not m_SplitPage.m_bShow
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
UnloadPartsBtn.IsEnabled = Not m_SplitPage.m_bShow
If m_SplitPage.m_bShow Then
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
Else
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
' Se esistono delle lavorazioni allora abilito il pulsante per procedere
If Not bExistsMachining Then
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
Else
NextBtn.IsEnabled = True
End If
End If
End Sub
' esco dalla pagina di scarico
Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
' verifico che la fase corrente non sia vuota
Dim nLastDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
If EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
EgtErase(nLastDispId)
End If
'' se sono in visualizzazione allora non elimino essuna operazione
'If Not m_SplitPage.m_bShow Then
' If EgtIsOperationEmpty(nLastDispId) And Not m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
' EgtErase(nLastDispId)
' ElseIf EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
' ' Dichiaro pagina non attiva
' m_bActive = False
' Return
' End If
'End If
' Se movimento con ventose
If Not m_bByHand Then
@@ -1260,8 +1467,9 @@ Public Class MoveRawPartPage
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
' imposto eventuale presenza rimozioni manuali
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
' imposto eventuale movimento pezzi su tavola ausiliaria
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
' imposto eventuale movimento pezzi su tavola ausiliaria (se è realmente avvenuto)
'SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
SaveMovePartsOnAuxTable(nDispId, m_IsCurrPhaseUnloaded)
' Eseguo calcolo speciale dei movimenti
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
End If
@@ -1277,13 +1485,18 @@ Public Class MoveRawPartPage
SpecialApplyDisposition(nDispId, True)
End If
End If
' Nascondo eventuale tavola ausiliaria
If m_SplitPage.m_bOnAuxTab Then
EgtDisableModified()
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
EgtEnableModified()
EgtZoom(ZM.ALL, False)
If Not m_bPrev Then
' se sto uscendo dalla pagina delle spezzature
If Not m_bPrev And Not m_bToNext Then
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' se sto uscendo dalla pagina split (senza passare dal comando next)
Dim lclLstUnlPart As New List(Of Integer)
SaveMovePartsOnAuxTable(nDispId, PartOnAuxTab(lclLstUnlPart, m_nCurrPhase))
' Cancello eventuale manipolatore pezzi
EgtDisableModified()
RemoveVacuumCups()
@@ -1300,10 +1513,30 @@ Public Class MoveRawPartPage
m_bPrev = False
m_SplitPage.m_bShow = True
End If
Dim Ph As Integer = EgtGetCurrPhase()
' aggiorno il disegno
EgtZoom(ZM.ALL, False)
' Dichiaro pagina non attiva
m_bActive = False
End Sub
' ----------------- TEST funzione per debug operazioni -----------------
Private Sub SaveMyFileTest(sFilename As String)
LoadCurrPhaseMachining()
' salvo il file corrente per poterlo studiare e capire cosa è successo nella rappresentazione dei grezzi
EgtSaveFile("C:\EgtData\OmagCUT\MyProjects\" & sFilename & ".nge", NGE.BIN)
End Sub
Private Sub LoadCurrPhaseMachining()
Dim m_MachiningList As New List(Of SplitMach)
'm_SplitPage.ShowMachiningList()
'm_SplitPage.SaveOrderMachinig(m_nCurrPhase)
' Preparo la lista delle lavorazioni
CalculateSplitMachList(m_nCurrPhase, m_MachiningList)
Dim b As Boolean = False
End Sub
End Class
+63 -11
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.Windows.Forms.Integration
Imports EgtUILib
Public Module SplitAuto
@@ -132,7 +133,7 @@ Public Module SplitAuto
Mach.m_bStartAll = False
Mach.m_bEndAll = False
End If
' Waterjet
' Waterjet
ElseIf Mach.m_nType = MCH_OY.WATERJETTING Then
Mach.m_nInterf = FMI_TYPE.NONE
' recupero l'angolo di fianco
@@ -141,7 +142,7 @@ Public Module SplitAuto
Mach.m_bCanEndAll = False
Mach.m_bStartAll = False
Mach.m_bEndAll = False
' Forature e fresature
' Forature e fresature
Else
Mach.m_nInterf = FMI_TYPE.NONE
Mach.m_dSideAng = 0
@@ -156,7 +157,7 @@ Public Module SplitAuto
Mach.m_bPause = GetPause(nOperId)
' inserisco in lista
MachSplitList.Add(Mach)
' altrimenti la disattivo
' altrimenti la disattivo
Else
EgtSetOperationMode(nOperId, False)
End If
@@ -194,7 +195,7 @@ Public Module SplitAuto
Private Sub ColorSingleMachining(nOperId As Integer, sLay As String, dSideAng As Double, bEnabled As Boolean, nInterf As Integer)
' Verifico se è un taglio da sopra o da sotto
Dim bOnMach As Boolean = (sLay = NAME_ONPATH Or ( sLay = NAME_INLOOP AndAlso EgtExistsInfo( nOperId, INFO_FILOTOP)))
Dim bOnMach As Boolean = (sLay = NAME_ONPATH Or (sLay = NAME_INLOOP AndAlso EgtExistsInfo(nOperId, INFO_FILOTOP)))
Dim bDrip As Boolean = (sLay = NAME_DRIPCUT Or sLay = NAME_UNDERDRILL)
' Recupero il preview della lavorazione
Dim nPvId As Integer = GDB_ID.NULL
@@ -219,11 +220,11 @@ Public Module SplitAuto
Next
EgtSetColor(nDwnCutId, COL_MCH_DISABLED)
Dim bFreeStart As Boolean = (nInterf And FMI_TYPE.LI) <> FMI_TYPE.LI
EgtSetColor(nPrcId, If(bFreeStart, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
EgtSetColor(nDwnPrcId, If(bFreeStart, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
EgtSetColor(nPrcId, If(bFreeStart, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
EgtSetColor(nDwnPrcId, If(bFreeStart, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
Dim bFreeEnd As Boolean = (nInterf And FMI_TYPE.LO) <> FMI_TYPE.LO
EgtSetColor(nPocId, If(bFreeEnd, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
EgtSetColor(nDwnPocId, If(bFreeEnd, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
EgtSetColor(nPocId, If(bFreeEnd, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
EgtSetColor(nDwnPocId, If(bFreeEnd, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
Else
Dim colCut As Color3d
If bOnMach Then
@@ -342,6 +343,7 @@ Public Module SplitAuto
Dim ptOri As Point3d
EgtGetTableRef(1, ptOri)
Dim vtOri As New Vector3d(ptOri.x, ptOri.y, ptOri.z)
' ---------------------------------- GREZZI ----------------------------------
' 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
@@ -393,10 +395,19 @@ Public Module SplitAuto
' passo al successivo grezzo
nRawId = EgtGetNextRawPart(nRawId)
End While
' ---------------------------------- GREZZI ----------------------------------
' Cancello preview dei tagli allungati dalla lavorazione
For Each nCut As Integer In vCuts
RemoveMachiningPreview(nCut)
Next
' ---------------------------------- LAVORAZIONI ----------------------------------
ChangeOperationPhase(nNewPhase)
' ---------------------------------- LAVORAZIONI ----------------------------------
Return True
End Function
' Sposta le lavorzioni della fase precedente a quella indicata
Friend Sub ChangeOperationPhase_ERR(nNewPhase As Integer)
' Sposto tutte le lavorazioni disabilitate e le eventuali inglobate nella nuova fase
Dim nId = EgtGetFirstOperation()
While nId <> GDB_ID.NULL
@@ -417,9 +428,50 @@ Public Module SplitAuto
End If
nId = nNextId
End While
Return True
End Function
End Sub
' Miglioramento della gestione delle lavorazioni
Friend Sub ChangeOperationPhase(nNewPhase As Integer)
' creo l'elenco delle lavorazioni che devono essere sposate
Dim MchList As New List(Of Integer)
' Recupero le lavorazioni disabilitate e le eventuali inglobate nella nuova fase
Dim nId = EgtGetFirstOperation()
While nId <> GDB_ID.NULL
Dim nNextId = EgtGetNextOperation(nId)
If IsValidMachining(nId) And EgtGetOperationPhase(nId) = nNewPhase - 1 And EgtExistsInfo(nId, INFO_MCH_USER_OFF) Then
' Provo ad inserire la lavorazione nell'elenco
AddMach(MchList, nId)
' sposto le inglobate
Dim sInfo As String = String.Empty
If EgtGetInfo(nId, INFO_MCH_OTHMID, sInfo) Then
Dim sItems() As String = sInfo.Split(",".ToCharArray)
For Each sId2 As String In sItems
Dim nId2 As Integer = 0
StringToInt(sId2, nId2)
If nId2 > 0 Then
' Provo ad inserire la lavorazione nell'elenco
AddMach(MchList, nId2)
End If
Next
End If
End If
nId = nNextId
End While
' Procedo ora a spostare le lavorazioni nella nuova disposizione
For Each ItemMchId As Integer In MchList
EgtChangeOperationPhase(ItemMchId, nNewPhase)
Next
End Sub
' Inserisce gli inidici delle lavorazioni evitando di inserire dei doppioni
Private Sub AddMach(MchList As List(Of Integer), IdMch As Integer)
For Each Item As Integer In MchList
If IdMch = Item Then
Return
End If
Next
MchList.Add(IdMch)
End Sub
'-----------------------------------------------------------------------------------------------
Friend Function CalculateSplitAuto() As Boolean
' Fase iniziale
+49 -48
View File
@@ -13,7 +13,7 @@ Public Class SplitPageUC
' Tipo movimento dei grezzi (manuale o con testa ventosa)
Private m_bByHand As Boolean = True
' Abilitazione movimento finale pezzi su tavola ausiliaria
Private m_bEnableOnAuxTab As Boolean = False
Friend m_bEnableOnAuxTab As Boolean = False
' Stato
Private m_nCurrPhase As Integer = 0
Private m_MachiningList As New List(Of SplitMach)
@@ -49,6 +49,7 @@ Public Class SplitPageUC
Private m_bModified As Boolean = False
Private m_nNbrGrpId As Integer = GDB_ID.NULL
Private m_bToNext As Boolean = False
Private m_bToPrev As Boolean = False
Friend m_bOnAuxTab As Boolean = False
' Drag
Private m_nDragInd As Integer = -1
@@ -167,6 +168,7 @@ Public Class SplitPageUC
m_bModified = False
' Reset flag tipo uscita
m_bToNext = False
m_bToPrev = False
' Abilitazione bottoni
EnableButtons()
' Se sola visualizzazione, segnalazione di eventuale fase di restart
@@ -180,7 +182,8 @@ Public Class SplitPageUC
End If
End Sub
Private Sub ShowMachiningList()
' preparo la lista delle lavorazioni da mostrare in interfaccia
Public Sub ShowMachiningList()
m_ItemList.Clear()
For i As Integer = 1 To m_MachiningList.Count()
Dim Mach As SplitMach = m_MachiningList(i - 1)
@@ -710,30 +713,8 @@ Public Class SplitPageUC
MoveUpBtn.IsEnabled = False
MoveDownBtn.IsEnabled = False
End If
' Recupero la selezione dei tagli correnti
GetCurrSelection()
'' verifico che siano contigui
'Dim bContigus As Boolean = False
'Dim OrdIndex = 0
'OrdIndex = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1).Ind
'' recupero l'indice dell'ultimo elemento selezionato
'Dim LastSel As NameIdLsBxItem = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1)
'If MachiningLsBx.SelectedItems.Count = 1 Then
' bContigus = True
'Else
' For Each Item As NameIdLsBxItem In ItemList
' If Item.Ind = LastSel.Ind + 1 Or Item.Ind = LastSel.Ind - 1 Then
' bContigus = True
' End If
' Next
'End If
'' se non contiguo, elimino dai selezionati il primo(che è l'ultimo ad essere stato selezionato)
'If Not bContigus Then
' ItemList.Remove(LastSel)
' MachiningLsBx.SelectedItems.RemoveAt(MachiningLsBx.SelectedItems.Count - 1)
'End If
' resetto marcatura lavorazioni
If m_CurrFirstInd > -1 Then
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
@@ -827,6 +808,8 @@ Public Class SplitPageUC
Next
VerifyHomogenousMachining(ItemList)
' Abilitazione bottone Next
EnableButtons()
End Sub
Private Sub AllOnBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOnBtn.Click
@@ -1717,7 +1700,7 @@ Public Class SplitPageUC
End If
Dim nI As Integer = m_ItemList(Index).Ind
' Si possono invertire solo i tagli di lama
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING Then Continue For
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING And m_MachiningList(nI).m_nType <> MCH_OY.WATERJETTING Then Continue For
' Non si possono invertire i tagli di lama inclinati
If Math.Abs(m_MachiningList(nI).m_dSideAng) > 0.1 Then Continue For
' Se abilitata inversione automatica e quindi non invertito
@@ -1731,6 +1714,7 @@ Public Class SplitPageUC
ResetEnableInvert(m_MachiningList(nI).m_nEntId)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
EgtDraw()
End If
' se altrimenti disabilitata inversione automatica e invertito
@@ -1742,6 +1726,7 @@ Public Class SplitPageUC
SwapStartEndData(nI)
EgtErase(m_MachiningList(nI).m_nArrId)
NumberDirectionMachining(nI, False)
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
EgtDraw()
End If
' altrimenti disabilitata inversione automatica e non invertito
@@ -1780,15 +1765,26 @@ Public Class SplitPageUC
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
' Dichiaro solo visualizzazione
m_bShow = True
' Esco
ExitSplit(False)
'' Esco
'ExitSplit(False)
' Torno alla fase precedente
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
Dim nCurrPhase As Integer = EgtGetCurrPhase()
' se questa è la prima fase, non possono tornare più indietro di così
If nCurrPhase = 1 Then
Return
End If
EgtSetCurrPhase(nCurrPhase - 1)
m_bToPrev = True
' Reimposto la precedente
SplitPageUC_Loaded(Nothing, Nothing)
'SplitPageUC_Loaded(Nothing, Nothing)
' torno alla disposizione della fase corrente
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_SplitPage)
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage)
m_MainWindow.m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.MoveRawPart
End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
' ------- VISUALIZZAZIONE -------
If m_bShow Then
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
' recupero l'operazione successiva
@@ -1910,7 +1906,7 @@ Public Class SplitPageUC
Private Sub SplitPageUC_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
m_bActive = False
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
ExitSplit(Not m_bToNext)
ExitSplit(Not m_bToNext And Not m_bToPrev)
EgtDraw()
End Sub
@@ -1929,22 +1925,7 @@ Public Class SplitPageUC
EgtEnableModified()
' se modificato salvo ordine e stato delle lavorazioni
If m_bModified Then
' Al primo posto deve rimanere la disposizione della fase
Dim nFirstOperId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
For i As Integer = m_ItemList.Count() - 1 To 0 Step -1
Dim nI As Integer = m_ItemList(i).Ind
Dim nMchId As Integer = m_MachiningList(nI).m_nId
EgtRelocate(nMchId, nFirstOperId, GDB_POS.AFTER)
If m_MachiningList(nI).m_bEnabled Then
EgtSetOperationMode(m_MachiningList(nI).m_nId, True)
EgtRemoveInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF)
Else
EgtSetOperationMode(m_MachiningList(nI).m_nId, False)
EgtSetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF, True)
End If
Next
' dichiaro ordine salvato
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
SaveOrderMachinig(m_nCurrPhase)
End If
' Affondamento ridotto
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
@@ -1968,6 +1949,25 @@ Public Class SplitPageUC
End If
End Sub
Friend Sub SaveOrderMachinig(CurrPhase As Integer)
' Al primo posto deve rimanere la disposizione della fase
Dim nFirstOperId As Integer = EgtGetPhaseDisposition(CurrPhase)
For i As Integer = m_ItemList.Count() - 1 To 0 Step -1
Dim nI As Integer = m_ItemList(i).Ind
Dim nMchId As Integer = m_MachiningList(nI).m_nId
EgtRelocate(nMchId, nFirstOperId, GDB_POS.AFTER)
If m_MachiningList(nI).m_bEnabled Then
EgtSetOperationMode(m_MachiningList(nI).m_nId, True)
EgtRemoveInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF)
Else
EgtSetOperationMode(m_MachiningList(nI).m_nId, False)
EgtSetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF, True)
End If
Next
' dichiaro ordine salvato
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
End Sub
Friend Function GetDisabledCutsCount() As Integer
' Determino il numero di tagli disabilitati
Dim nCount As Integer = 0
@@ -2032,7 +2032,7 @@ Public Class SplitPageUC
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
' Altrimenti
Else
' movimento standard sulla tavola (almeno un taglio disabilitato)
' movimento standard sulla tavola (almeno un taglio disabilitato allora False)
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
' movimento su tavola di scarico
m_bOnAuxTab = Not bStdTab AndAlso (m_nCurrPhase = EgtGetPhaseCount() And m_bEnableOnAuxTab)
@@ -2198,6 +2198,7 @@ Public Class SplitPageUC
' gestione bottone per generazione ponticelli
If Type = MCH_OY.WATERJETTING Then
InvertBtn.Visibility = Visibility.Visible
' siccome la stessa posizione è occupata da due comandi sovrapposti
If CutStartBtn.Visibility = Visibility.Hidden Then
BridgesWJBtn.Visibility = Visibility.Visible
+1
View File
@@ -206,6 +206,7 @@ Module ConstIni
Public Const K_OFFSZ As String = "OffsZ"
Public Const K_OFFSXY As String = "OffsXY"
Public Const K_OFFSYY As String = "OffsYY"
Public Const K_OFFSXINTERY As String = "OffsYInterY"
Public Const K_STARTTRIM As String = "StartTrim"
Public Const K_ENDTRIM As String = "EndTrim"
Public Const K_OTHERSIDE As String = "OtherSide"
+5
View File
@@ -151,6 +151,10 @@
Public Const K_PRODLIPROBINGTCPOS2VAR As String = "ProbingTcPos2Var"
Public Const K_PRODLISAWDIAMETER2VAR As String = "SawDiameter2Var"
Public Const S_POLISHLINE As String = "PolishLine"
Public Const K_CLICKSTATE As String = "ClickState"
Public Const k_CLICKDIR As String = "ClickDir"
Public Const S_STATISTICS As String = "Stats"
Public Const K_DATADIR As String = "DataDir"
Public Const K_SHOWAREAS As String = "ShowAreas"
@@ -232,6 +236,7 @@
Public Const K_HOLES_OFFSETWJ As String = "HolesOffsetWJ"
Public Const K_MIN_RADIUSWJ As String = "MinRadiusWJ"
Public Const K_MACH_DRILLINGWJ_ON_CORNERS As String = "DrillingWJOnCorners"
Public Const K_MACH_RECTIFICATION_ON_SUBSQUARE As String = "RectificationSubSqWJ"
' DrillMillC90
' CutLongDxSx
' AngRotMultiCut
+35
View File
@@ -35,6 +35,7 @@ Public Class MachineButtonsUC
Private Const BTN_STATE_DOOR_OPENED As String = "DoorOpened"
Private Const BTN_STATE_DOOR_CLOSED As String = "DoorClosed"
Private Const BTN_STATE_PARKING As String = "Parking"
Private Const BTN_STATE_HOME As String = "Home"
Private Const BTN_ENABLE_ZONE_1 As String = "EnableZone1"
Private Const BTN_ENABLE_ZONE_2 As String = "EnableZone2"
Private Const BTN_ENABLE_PC As String = "EnablePC"
@@ -711,6 +712,40 @@ Public Class MachineButtonsUC
End If
End Sub
Friend Sub HomeStateChanged(HomeState As Boolean)
Dim nIndex As Integer = Array.IndexOf(StateFlagArray, BTN_STATE_HOME)
If nIndex = -1 Then Return
If HomeState Then
GetToggleButton(nIndex + 1).IsChecked = True
Try
Dim s As String
If (m_MainWindow.m_OptionsPageUC.ThemesCmBx.SelectedIndex = 0) Then
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & ImageArrayY(nIndex)
Else
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\" & ImageArrayY(nIndex)
End If
Dim sButtonImageSource As ImageSource = ImageConverter.ConvertFromString(s)
GetImage(nIndex + 1).Source = sButtonImageSource
Catch ex As Exception
EgtOutLog("Error loading image " & ImageArrayY(nIndex + 1))
End Try
Else
GetToggleButton(nIndex + 1).IsChecked = False
Try
Dim s As String
If (m_MainWindow.m_OptionsPageUC.ThemesCmBx.SelectedIndex = 0) Then
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & ImageArrayY(nIndex)
Else
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\" & ImageArrayY(nIndex)
End If
Dim sButtonImageSource As ImageSource = ImageConverter.ConvertFromString(s)
GetImage(nIndex + 1).Source = sButtonImageSource
Catch ex As Exception
EgtOutLog("Error loading image " & ImageArrayN(nIndex + 1))
End Try
End If
End Sub
Friend Sub EnableZoneStateChanged(ZoneState As Integer)
Dim sFlag As String = String.Empty
If ZoneState = 1 Then
+3 -1
View File
@@ -37,7 +37,7 @@ Public Class CompoDimensionUC
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
If Not String.IsNullOrEmpty(sCompoDir) Then
bEnableAlzFront = True
AlzFrontBtn.Content = "Alzatine & Frontalini"
AlzFrontBtn.Content = EgtMsg(91137)
Else
AlzFrontBtn.Visibility = Visibility.Collapsed
End If
@@ -107,8 +107,10 @@ Public Class CompoDimensionUC
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
If value Then
AlzFrontBtn.Visibility = Visibility.Visible
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Hidden
Else
AlzFrontBtn.Visibility = Visibility.Hidden
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Visible
End If
End Sub
+12 -9
View File
@@ -1138,7 +1138,7 @@ Public Class DrawPageUC
Return True
End Function
Private Function MakeSectionFrameInsert() As Boolean
Private Function MakeSectionFrameInsert(ByVal nNbr As Integer) As Boolean
' m_MainWindow.m_ImportPageUC.LoadFrame()
' recupero il primo layer del primo pezzo
Dim nLayerId As Integer = EgtGetFirstLayer(EgtGetFirstPart())
@@ -1150,13 +1150,16 @@ Public Class DrawPageUC
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Inserisco il pezzo
If Not My.Computer.FileSystem.FileExists(sTmpFile) Then Return False
EgtInsertFile(sTmpFile)
' Ne recupero l'Id
Dim nPartId As Integer = EgtGetLastPart()
' Creo la cornice
m_MainWindow.m_FrameCutPageUC.CreateFrame(nPartId)
' Ricalcolo lavorazioni
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
' eseguo inserimento
For i As Integer = 1 To nNbr
EgtInsertFile(sTmpFile)
' Ne recupero l'Id
Dim nPartId As Integer = EgtGetLastPart()
' Creo la cornice
m_MainWindow.m_FrameCutPageUC.CreateFrame(nPartId)
' Ricalcolo lavorazioni
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
Next
' Cancello il file
My.Computer.FileSystem.DeleteFile(sTmpFile)
Return True
@@ -1178,7 +1181,7 @@ Public Class DrawPageUC
' Passo al contesto principale
'MakeInsert(InsNbr, sPartName)
If m_MainWindow.FrameCutBtn.IsChecked Then
MakeSectionFrameInsert()
MakeSectionFrameInsert(InsNbr)
Else
MakeMultipleInsert(InsNbr, sPartName)
End If
+2 -1
View File
@@ -39,7 +39,8 @@ Public Class FiloTopUC
' Imposto messaggi
ParameterTxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 10) ' Offset
Parameter2TxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 11) ' Affondamento
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
Parameter3TxBl.Text = EgtMsg(91138)
If m_CallingPage = MainWindow.Pages.Draw Then
' Imposto questa come pagina correntemente visualizzata nella drawpage
+1 -1
View File
@@ -58,7 +58,7 @@
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList}"/>
<Grid Grid.Row="3" Margin="0,0,8,0">
<Grid Name="FinderGrd" Grid.Row="3" Margin="0,0,8,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="1*"/>
+25 -3
View File
@@ -19,6 +19,9 @@ Public Class ImportPageUC
Friend WithEvents ImportScene As New Scene
Private ImportSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
Private m_SelListHole As New List(Of Integer)
Private m_DeselectListHole As New List(Of Integer)
' Properties
Private m_sCurrDir As String = String.Empty
Private m_sCurrFile As String = String.Empty
@@ -101,6 +104,8 @@ Public Class ImportPageUC
' abilitazione Ordine e Distinta per importazione DXF
m_bEnableOrderList = (m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut And
GetPrivateProfileInt(S_COMPO, K_CSVDATA, 0, m_MainWindow.GetIniFile()) <> 0)
' rendo visibilie il pulsante di ricerca file
FinderGrd.Visibility = Visibility.Visible
If m_bFirst Then
' imposto colore di default
@@ -196,7 +201,6 @@ Public Class ImportPageUC
PartNumTxBx.Text = "1"
' disabilito ok
OkBtn.IsEnabled = False
End Sub
Private Sub LoadGridData()
@@ -345,7 +349,7 @@ Public Class ImportPageUC
End Function
Private Function LoadCurrFile() As Boolean
' Pulisco il DB geometrico locale
' Pulisco il DB geometrico locale
Dim bOk As Boolean = EgtNewFile()
' Costruisco path completa del file
Dim sPath = IO.Path.Combine(m_sCurrDir, m_sCurrFile)
@@ -415,7 +419,7 @@ Public Class ImportPageUC
DripCutBtn.IsEnabled = False
DripDrillBtn.IsEnabled = False
End If
' altrimenti import per cornici
' altrimenti import per cornici
Else
mmBtn.IsEnabled = (m_nFileType = FT.DXF)
inchBtn.IsEnabled = (m_nFileType = FT.DXF)
@@ -569,6 +573,8 @@ Public Class ImportPageUC
EgtSetColor(nEntId, New Color3d(127, 63, 0))
nEntId = EgtGetNext( nEntId)
End While
m_DeselectListHole.Add(nLayId)
m_SelListHole.Remove(nLayId)
End If
Else
Dim nLayId As Integer = GDB_ID.NULL
@@ -585,6 +591,8 @@ Public Class ImportPageUC
EgtSetColor(nEntId, New Color3d(255, 255, 255))
nEntId = EgtGetNext( nEntId)
End While
m_SelListHole.Add(nLayId)
m_DeselectListHole.Remove(nLayId)
End If
End If
EgtDraw()
@@ -592,6 +600,12 @@ Public Class ImportPageUC
End If
nId = EgtGetNextObjInSelWin()
End While
m_FiloTopUC.CreateFiloTopPreView(m_SelListHole)
m_FiloTopUC.EraseFiloTopPreview(m_DeselectListHole)
If m_SelListHole.Count > 0 Then
MessageTxBx.Text = ""
MessageBrd.Background = Brushes.Transparent
End If
End Sub
Private Sub OnShowDistanceVector(sender As Object, vtDist As Vector3d) Handles ImportScene.OnShowDistanceVector
@@ -1040,6 +1054,7 @@ Public Class ImportPageUC
Private Sub SideAngleBtn_Click(sender As Object, e As RoutedEventArgs) Handles SideAngleBtn.Click
If SideAngleBtn.IsChecked() Then
FinderGrd.Visibility = Visibility.Hidden
' Aggiungo regioni per percorsi interni
AdjustSelectRegions()
' Dichiaro nessuna selezione
@@ -1062,6 +1077,7 @@ Public Class ImportPageUC
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
Else
FinderGrd.Visibility = Visibility.Visible
' Rimuovo regioni per percorsi interni
RemoveSelectRegions()
FilePathTxBl.Visibility = Windows.Visibility.Visible
@@ -1092,6 +1108,7 @@ Public Class ImportPageUC
Private Sub DripCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles DripCutBtn.Click
If DripCutBtn.IsChecked() Then
FinderGrd.Visibility = Visibility.Hidden
' Dichiaro nessuna selezione
m_nSelectedPart = GDB_ID.NULL
m_nSelectedLayer = GDB_ID.NULL
@@ -1112,6 +1129,7 @@ Public Class ImportPageUC
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
Else
FinderGrd.Visibility = Visibility.Visible
FilePathTxBl.Visibility = Windows.Visibility.Visible
FileListBox.Visibility = Windows.Visibility.Visible
LeftGrid.Children.Remove(m_SideAngleUC)
@@ -1142,6 +1160,7 @@ Public Class ImportPageUC
Private Sub DripDrillBtn_Click(sender As Object, e As RoutedEventArgs) Handles DripDrillBtn.Click
If DripDrillBtn.IsChecked() Then
FinderGrd.Visibility = Visibility.Hidden
' Aggiungo regioni di selezione per percorsi interni
AdjustSelectRegions()
' Imposto modalità fori da sotto
@@ -1160,6 +1179,7 @@ Public Class ImportPageUC
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 15) ' Selezionare uno o più fori
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
Else
FinderGrd.Visibility = Visibility.Visible
' Rimuovo regioni per percorsi interni
RemoveSelectRegions()
FilePathTxBl.Visibility = Windows.Visibility.Visible
@@ -1187,6 +1207,7 @@ Public Class ImportPageUC
Private Sub FiloTopBtn_Click(sender As Object, e As RoutedEventArgs) Handles FiloTopBtn.Click
If FiloTopBtn.IsChecked() Then
FinderGrd.Visibility = Visibility.Hidden
' Aggiungo regioni per percorsi interni
AdjustSelectRegions()
' Dichiaro nessuna selezione
@@ -1208,6 +1229,7 @@ Public Class ImportPageUC
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno interno
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
Else
FinderGrd.Visibility = Visibility.Visible
' Rimuovo regioni per percorsi interni
RemoveSelectRegions()
FilePathTxBl.Visibility = Windows.Visibility.Visible
+1
View File
@@ -41,6 +41,7 @@ Public Class MainComponentPageUC
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.m_bBackFromInternalCompo = False
End Sub
Private Function GetButton(ByVal nInd As Integer) As Button
+23 -9
View File
@@ -39,6 +39,15 @@
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="CompoBtn" Grid.Column="2" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource DrawImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="SelSectionBtn" Grid.Column="3" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
@@ -63,6 +72,7 @@
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="1.7*"/>
@@ -78,14 +88,13 @@
</ComboBox>
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelSectionBtn"
<!--<Button Name="SelSectionBtn"
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
</Button>-->
<Grid>
<Button Name="SelGuideBtn"
Style="{DynamicResource OmagCut_YellowTextButton}"/>
<Button Name="SelGuideBtn" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
@@ -110,11 +119,16 @@
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsYyTxBl" Grid.Row="4" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<TextBlock Name="OffsXInteryTxBl" Grid.Row="5" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsXInteryTxBx" Grid.Column="2" Grid.Row="5" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
<Button Name="MirrorPartBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource SpecchiaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
@@ -125,12 +139,12 @@
</Button>
</UniformGrid>
<UniformGrid Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
<!--<UniformGrid Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
<Button Name="CompoBtn"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource DrawImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
</UniformGrid>
</UniformGrid>-->
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
+22 -5
View File
@@ -52,6 +52,8 @@ Public Class FrameCutPageUC
OffsXyTxBx.Text = LenToString(dOffsXY, 3)
Dim dOffsYY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSYY, 5, m_MainWindow.GetIniFile())
OffsYyTxBx.Text = LenToString(dOffsYY, 3)
Dim dOffsXInterY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSXINTERY, 5, m_MainWindow.GetIniFile())
OffsXInteryTxBx.Text = LenToString(dOffsXInterY, 3)
' Imposto i messaggi letti dal file dei messaggi
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
@@ -70,6 +72,7 @@ Public Class FrameCutPageUC
OffsZTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 8) 'Distanza sopra
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
End Sub
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -82,7 +85,11 @@ Public Class FrameCutPageUC
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
m_ProjectMgr.RegisterBtn.Visibility = Windows.Visibility.Hidden
' Visualizzo il bottone per l'importazione dei compo frame
CompoBtn.Visibility = If(GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 0, Visibility.Visible, Visibility.Hidden)
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.COMPOFRAME) AndAlso GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 0 Then
CompoBtn.Visibility = Visibility.Visible
Else
CompoBtn.Visibility = Visibility.Hidden
End If
' Recupero dimensioni e kerf del grezzo
m_nRawId = EgtGetFirstRawPart()
GetRawBox(m_RawBox)
@@ -273,7 +280,7 @@ Public Class FrameCutPageUC
End If
End Sub
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed, OffsXInteryTxBx.EgtClosed
' Forzo aggiornamento grezzo nella pagina di Nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
' Parcheggio pezzi presenti nel grezzo
@@ -298,9 +305,13 @@ Public Class FrameCutPageUC
WritePrivateProfileString(S_FRAME, K_OFFSXY, DoubleToString(dOffsXy, 3), m_MainWindow.GetIniFile())
End If
Dim dOffsYy As Double = 0
If StringToLen(OffsYyTxBx.Text, dOffsYY) Then
If StringToLen(OffsYyTxBx.Text, dOffsYy) Then
WritePrivateProfileString(S_FRAME, K_OFFSYY, DoubleToString(dOffsYy, 3), m_MainWindow.GetIniFile())
End If
Dim dOffsXIntery As Double = 0
If StringToLen(OffsXInteryTxBx.Text, dOffsXIntery) Then
WritePrivateProfileString(S_FRAME, K_OFFSXINTERY, DoubleToString(dOffsXIntery, 3), m_MainWindow.GetIniFile())
End If
End Sub
Private Sub MirrorPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles MirrorPartBtn.Click
@@ -948,12 +959,18 @@ Public Class FrameCutPageUC
' Determino distanza da spessore lama
Dim dMinDist As Double = 0
Dim dSawThick As Double = 0
Dim dOffsXIntery As Double = 0
StringToLen(OffsXInteryTxBx.Text, dOffsXIntery)
If EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw) AndAlso
EgtTdbGetCurrToolParam(MCH_TP.THICK, dSawThick) Then
dMinDist = dSawThick + 5 * EPS_SMALL
If dOffsXIntery <= dSawThick Then
dMinDist = dSawThick + 5 * EPS_SMALL
Else
dMinDist = dOffsXIntery + 5 * EPS_SMALL
End If
Else
EgtOutLog("Not found current saw for frames mindist")
dMinDist = 0
dMinDist = dOffsXIntery
End If
' Inserisco il pezzo nel grezzo
Dim ptIns As Point3d
+25
View File
@@ -184,6 +184,31 @@
</GroupBox>
<!--Parametri rettifica tagli sottosquadra: 1 Parametro -->
<GroupBox Name="RectificationWJParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" >
<Grid Grid.Column="3" Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Name="EnableRectificationTxBl" Grid.Row="0" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
<CheckBox Name="EnableRectificationChBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
HorizontalAlignment="Right" Margin="0,0,10,0"/>
<!--<TextBlock Name="OffsetRectificationTxBl" Grid.Row="1" Grid.Column="0"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsetRectificationTxBx" Grid.Row="1" Grid.Column="1" Margin="10,0,10,0"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>-->
</Grid>
</GroupBox>
<!--Parametri WaterJet: 5 Parametro (se questo GroupBox attivo allora nascondo Fori/Fresatura)-->
<GroupBox Name="WjsParamGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="4"
Style="{DynamicResource OmagCut_GroupBox}">
+18 -3
View File
@@ -97,7 +97,10 @@ Public Class AlarmsPageUC
HolesOffsetWJTxBl.Text = "Offset"
MinRadiusWJTxBl.Text = "Min Radius"
OneHoleInCornerWJTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 26)
'-- FINE -- nuovi parametri per preforo lavello
'-- INIZIO -- nuovi parametro Rettifica tagli sottosquadra WJ
REctificationWJParamGpBx.Header = "Rectification"
EnableRectificationTxBl.Text = "Enable (on subsquare angle)"
'-- FINE -- nuovi parametro Rettifica tagli sottosquadra WJ
NestingParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 31) ' Nesting
AlignTxBl.Text = EgtMsg(90932) ' Allineato
GhigliottinaTxBl.Text = EgtMsg(91066) ' Ghigliottina
@@ -175,6 +178,7 @@ Public Class AlarmsPageUC
' Se non previsti tagli waterjet, disabilito relativo box
If Not m_CurrentMachine.bWaterJetting Then
WjsParamGpBx.Visibility = Visibility.Hidden
RectificationWJParamGpBx.Visibility = Visibility.Hidden
End If
' Abilitazione box per contorni grezzo da foto
@@ -354,7 +358,9 @@ Public Class AlarmsPageUC
MinRadiusWJTxBx.Text = LenToString(dVal, 2)
OneHoleInCornerWJChBx.IsChecked =
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
' leggo se attiva la rettifica degli angoli per WaterJet
EnableRectificationChBx.IsChecked =
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, 0, m_MainWindow.GetMachIniFile()) <> 0)
' Leggo accorciamento angoli con fresa
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
ShortTxBx.Text = LenToString(dVal, 2)
@@ -970,9 +976,18 @@ Public Class AlarmsPageUC
WritePrivateProfileString(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, "0", m_MainWindow.GetMachIniFile())
End If
End Sub
' -- FINE -- nuovi parametri per prefori WaterJet
' -- INIZIO -- nuovi parametri per Rettifica angoli in sottosquadra WaterJet
Private Sub EnableRectificationChBx_Click(sender As Object, e As EventArgs) Handles EnableRectificationChBx.Click
If EnableRectificationChBx.IsChecked() Then
WritePrivateProfileString(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, "1", m_MainWindow.GetMachIniFile)
Else
WritePrivateProfileString(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, "0", m_MainWindow.GetMachIniFile)
End If
End Sub
' -- FINE -- nuovi parametri per Rettifica angoli in sottosquadra WaterJet
Private Sub TmEnableChBx_Click(sender As Object, e As RoutedEventArgs) Handles TmEnableChBx.Click
If TmEnableChBx.IsChecked() Then
WritePrivateProfileString(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, "1", m_MainWindow.GetMachIniFile())
+24 -2
View File
@@ -1,6 +1,7 @@
Imports System.Collections.ObjectModel
Imports EgtWPFLib5
Imports EgtUILib
Imports System.IO
Public Class CurrentMachine
@@ -51,6 +52,8 @@ Public Class CurrentMachine
Private m_sProdLiProbingState2Var As String = ""
Private m_sProdLiProbingTcPos2Var As String = ""
Private m_sProdLiSawDiameter2Var As String = ""
Private m_sClickState As String = "E80028"
Private m_sClickDir As String = ""
' Numero e tipo di utensili correntemente disponibili sulla macchina
Private m_MountedToolConfig As MountedToolConfigs = MountedToolConfigs.SAW
@@ -316,7 +319,7 @@ Public Class CurrentMachine
Return m_bAskNewOnResend
End Get
End Property
Friend ReadOnly Property nProdLiSawProbe As Integer
Get
@@ -324,6 +327,18 @@ Public Class CurrentMachine
End Get
End Property
Friend ReadOnly Property sClickState As String
Get
Return m_sClickState
End Get
End Property
Friend ReadOnly Property sClickDir As String
Get
Return m_sClickDir
End Get
End Property
Friend Function sProdLiProbingStateVar(nI As Integer) As String
If nI = 1 Then Return m_sProdLiProbingStateVar
If nI = 2 Then Return m_sProdLiProbingState2Var
@@ -788,7 +803,7 @@ Public Class CurrentMachine
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), K_TAB3_ADDITIONALTABLE, value)
End If
End If
Case 2
Case 2
If Math.Abs(value - m_dTab2AdditionalTable) > EPS_SMALL And
WritePrivateProfileString(S_TABLE, K_TAB2_ADDITIONALTABLE, DoubleToString(value, 3), sMachIniFile) Then
' Aggiorno il valore corrente
@@ -1153,6 +1168,13 @@ Public Class CurrentMachine
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLIPROBINGTCPOS2VAR, "0", m_sProdLiProbingTcPos2Var, sMachIniFile)
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLISAWDIAMETER2VAR, "", m_sProdLiSawDiameter2Var, sMachIniFile)
GetPrivateProfileString(S_POLISHLINE, K_CLICKSTATE, "", m_sClickState, sMachIniFile)
GetPrivateProfileString(S_POLISHLINE, k_CLICKDIR, "", m_sClickDir, sMachIniFile)
If Not Directory.Exists(m_sClickDir) Then
m_sClickState = ""
EgtOutLog("Directory " & m_sClickDir & " does not exist")
End If
' Leggo configurazione degli utensili in macchina
m_MountedToolConfig = GetPrivateProfileInt(S_TOOLS, K_MOUNTEDTOOLCONFIG, 0, sMachIniFile)
' Leggo flag presenza tipologie utensili
+6
View File
@@ -279,6 +279,12 @@ Public Class MachineStatusUC
Sub DisplayFeed()
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
' modifica richiesta 26/05/2023 da Rosario per cliente Lanzetta
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
dRealFeed = m_CN.d_DInterpo_Prog_Feed
Else
dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
End If
'Feed = DoubleToString(dRealFeed, 0)
FeedTxBx.Text = LenToString(dRealFeed, 0, True)
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
+2 -2
View File
@@ -61,8 +61,8 @@ Public Class PolishingsPageUC
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
StepTxBl.Text = EgtMsg(90787) ' Passo
OffSetTxBl.Text = EgtMsg(91089) ' Offset
RadiusTxBl.Text = "Raggio"
DistanceTxBl.Text = "Distanza"
RadiusTxBl.Text = EgtMsg(91139) ' Raggio
DistanceTxBl.Text = EgtMsg(91140) ' Distanza
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
+1 -1
View File
@@ -53,7 +53,7 @@
</ToggleButton>
</Grid>
<Button Grid.Column="2" Style="{DynamicResource OmagCut_BlueIconButton}" Click="ExitBtn_Click">
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_BlueIconButton}" Click="ExitBtn_Click">
<Image Source="{DynamicResource XImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>
+6 -4
View File
@@ -100,6 +100,7 @@ Class MainWindow
OFFICE_TYPE = 2 ^ 19 ' 524288
REGISTRATION = 2 ^ 20 ' 1048576
SIMPLESTATISTICS = 2 ^ 21 ' 2097152
COMPOFRAME = 2 ^ 22 ' 4194304
End Enum
' Opzione nesting automatico
Private m_bAutoNest As Boolean = False
@@ -328,8 +329,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2505, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2505, 1, m_nKeyOptions)
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2506, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2506, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface
@@ -560,7 +561,7 @@ Class MainWindow
End If
End If
' --------------------------------- SLAB DB -------------------------------------------------------
ExitBtn.ToolTip = "Exit" & vbCrLf & "Minimize (Shift)"
End Sub
Private Sub ManageSingleIstance()
@@ -1226,7 +1227,8 @@ Class MainWindow
m_ProdLineTimer.Interval = TimeSpan.FromMilliseconds(2000)
m_ProdLineTimer.Start()
End If
' di default attivo la pagina CadCut
m_ActivePage = MainWindow.Pages.CadCut
' seleziono il tipo di avvio
m_CurrentProjectPageUC.StartProgram()
' aggiorno la grafica
+2 -2
View File
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.5.5.1")>
<Assembly: AssemblyFileVersion("2.5.5.1")>
<Assembly: AssemblyVersion("2.5.6.2")>
<Assembly: AssemblyFileVersion("2.5.6.2")>
+30
View File
@@ -133,6 +133,10 @@ Public Class CNCommunication
Refresh()
End If
If Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sClickState) Then
ClickOnPolishLine()
End If
m_bTimerBusy = False
m_RefreshTimer.Start()
Else
@@ -499,6 +503,31 @@ Public Class CNCommunication
End Sub
Private Sub ClickOnPolishLine()
' Se richiesto di scattare foto sulla linea di lucidatura
m_CN.n_DReadELS_handle = 0
m_CN.ReadEls_Add_Parameter(m_MainWindow.m_CurrentMachine.sClickState, 1)
Dim nClickState As Integer = 0
For I As Integer = 0 To 10
System.Threading.Thread.Sleep(50)
If m_CN.n_DReadELS_handle = 1 Then
nClickState = CInt(m_CN.d_DReadELS_value)
If nClickState = 1 Then
' procedo a costruire un nuovo file nella cartella indicata in configurazione
Try
File.Create(m_MainWindow.m_CurrentMachine.sClickDir & "\NewClick.txt")
' Dichiaro di aver provveduto a comunicare di scattare la foto
m_CN.DVariables_WriteVariables2(m_MainWindow.m_CurrentMachine.sClickState, "0")
Catch ex As Exception
EgtOutLog("Error on PolishLine comunication: " & ex.ToString)
End Try
End If
Exit For
End If
Next
End Sub
Private Sub Refresh()
If m_bNewPosData Then
@@ -654,6 +683,7 @@ Public Class CNCommunication
End If
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.DoorStateChanged(m_CN.nDoorClosedState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ParkingStateChanged(m_CN.bParkingState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.HomeStateChanged(m_CN.bHomeState)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.EnableZoneStateChanged(m_CN.nEnableZone)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.EnablePcStateChanged(m_CN.nEnablePc)
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.TableUpChanged(m_CN.bTableUpState)
+1 -3
View File
@@ -650,9 +650,7 @@ Namespace Fanuc
' ...
Case CnData.Feed ' (2)
Dim qq As Short = n_temp
'd_DInterpo_Prog_Feed = CDbl(CLng(values(n))) ' d_DInterpo_Prog_Feed
d_DInterpo_Prog_Feed = CDbl(n_temp) ' d_DInterpo_Prog_Feed
Case CnData.FeedOvr ' (3) Potenziom. Feed = * 0.47059
d_DInterpo_Feed_override = CDbl(n_temp)
+13 -1
View File
@@ -491,7 +491,19 @@ Public Class OpenPageUC
m_SceneButtons.MeasureBtn.IsChecked = False
' Istruzioni per chiudere OpenPageUC e aprire currentproject e cadcut page
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
If m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut Then
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
If Not m_MainWindow.CadCutBtn.IsChecked Then
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
m_MainWindow.CadCutBtn.IsChecked = True
End If
ElseIf m_MainWindow.m_PrevActivePage = MainWindow.Pages.FrameCut Then
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
If Not m_MainWindow.FrameCutBtn.IsChecked Then
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_FrameCutPageUC)
m_MainWindow.FrameCutBtn.IsChecked = True
End If
End If
' Non modifico progetto corrente
m_MainWindow.m_ActivePage = m_MainWindow.m_PrevActivePage
End Sub
+115
View File
@@ -1,6 +1,7 @@
Imports System.ComponentModel
Imports System.Drawing
Imports System.IO
Imports System.Windows.Forms.Integration
Imports EgtUILib
Imports EgtWPFLib
@@ -32,6 +33,7 @@ Public Class ProjectMgrUC
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 2) 'Work - Lavora
End If
TestBtn.ToolTip = EgtMsg(90255) 'Test
ResetCutBtn.ToolTip = "Reset Cuts" & vbCrLf & "Reset Feed (Shift)"
End Sub
Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -250,6 +252,11 @@ Public Class ProjectMgrUC
End Sub
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
If (Keyboard.Modifiers And ModifierKeys.Shift) Then
' eseguo il ricalcolo delle sole FEED di lavorazione
UpdateFeedAllMachining()
Return
End If
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Cancello eventuali messaggi
m_CurrProjPage.ClearMessage()
@@ -263,6 +270,8 @@ Public Class ProjectMgrUC
Dim nWarn As Integer = 0
ResetAllMachinings(nWarn)
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni
ResetAllRawPart()
' Aggiorno Info C Home
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
@@ -709,6 +718,112 @@ Public Class ProjectMgrUC
End While
End Sub
Public Sub UpdateFeedAllMachining()
' recupero il valore di Feed della lavorazione corrente
Dim sMachiningName As String = String.Empty
If Not EgtMdbGetCurrMachiningParam(MCH_MP.NAME, sMachiningName) Then
' errore: lavorazione non trovata
EgtOutLog(" - Prima di 'Reset Feed' accedere alla pagina MACCHINA!")
'm_MainWindow.m_CurrentProjectPageUC.SetErrorMessage("Salvare la lavorazione corrente")
Return
End If
Dim dFeed As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.FEED, dFeed)
Dim dFeedStarted As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
Dim dFeedEnded As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
Dim dFeedTipped As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
Dim dFeedBack As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.BACKFEED, dFeedBack)
Dim dFeedSideAng As Double = 0
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
Dim MachiningList As New List(Of SplitMach)
' Recupero l'indice della fase corrente
Dim nCurrPhase As Integer = 1
' recupero in numero di fasi presenti nel progetto
Dim nCountPhase As Integer = EgtGetPhaseCount()
' ciclo su tutte le fasi di lavorazione
Dim nMach As Integer = 0
Dim nMachUpdated As Integer = 0
For IndexPhase As Integer = 1 To nCountPhase
' imposto la fase corrente
nCurrPhase = IndexPhase
' Preparo la lista delle lavorazioni
CalculateSplitMachList(nCurrPhase, MachiningList)
' per ogni lavorazione corrente procedo ad aggiornare la feed
For IndexMachining As Integer = 0 To MachiningList.Count - 1
nMach += 1
Dim nOperId As Integer = MachiningList(IndexMachining).m_nId
' setto la lavorazione come corrente
If EgtSetCurrMachining(nOperId) Then
Dim bUpdate As Boolean = False
' STANDARD
Dim dOrigFeed As Double
EgtGetMachiningParam(MCH_MP.FEED, dOrigFeed)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeed - dFeed) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.FEED, dFeed)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' STARTED
Dim dOrigFeedStarted As Double
EgtGetMachiningParam(MCH_MP.STARTFEED, dOrigFeedStarted)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedStarted - dFeedStarted) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' ENDED
Dim dOrigFeedEnded As Double
EgtGetMachiningParam(MCH_MP.ENDFEED, dOrigFeedEnded)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedEnded - dFeedEnded) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' TIPPED
Dim dOrigFeedTipped As Double
EgtGetMachiningParam(MCH_MP.TIPFEED, dOrigFeedTipped)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedTipped - dFeedTipped) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' BACK
Dim dOrigFeedBack As Double
EgtGetMachiningParam(MCH_MP.BACKFEED, dOrigFeedBack)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedBack - dFeedBack) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.BACKFEED, dFeedBack)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' SIDEANG
Dim dOrigFeedSideAng As Double
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dOrigFeedSideAng)
' imposto il valore di Feed solo se differente da quello nuovo
If Math.Abs(dOrigFeedBack - dFeedSideAng) > 0.1 Then
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
EgtApplyMachining(True)
End If
' conto il numero di lavorazioni aggiornate
If bUpdate Then
nMachUpdated += 1
End If
End If
Next
Next
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage("Lavorazione aggiornate: " & nMachUpdated & "/ " & nMach)
End Sub
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double)
+10
View File
@@ -315,6 +315,16 @@ Public Class Camera
GetPrivateProfileString(S_NCDATA, K_SPOTLIGHT2, "", sPLCVarSpotLight2, m_MainWindow.GetMachIniFile())
Dim nPhotoDeley As Integer = GetPrivateProfileInt(S_NCNUM, K_PHOTODELEY, "100", m_MainWindow.GetMachIniFile())
' eventualmente rimuovo inizio stringa: "PLC, ___"
Dim sItemString1() As String = Split(sPLCVarSpotLight1, ","c)
If sItemString1.Count > 1 Then
sPLCVarSpotLight1 = sItemString1(1).Trim
End If
Dim sItemString2() As String = Split(sPLCVarSpotLight2, ","c)
If sItemString2.Count > 1 Then
sPLCVarSpotLight2 = sItemString2(1).Trim
End If
Select Case m_MainWindow.m_CNCommunication.m_nNCType
Case 1, 2
If m_MainWindow.m_CNCommunication.m_nNCType = 2 Then
+1
View File
@@ -2060,6 +2060,7 @@ Public Class RawPartPageUC
End Sub
Public Sub RefTabModeChange()
If Not m_bOtherRefTab Then Return
MoveRawToMaiRefTab()
MoveRawToOtherRefTab()
UpdateRefTabDraw()
+45 -5
View File
@@ -567,16 +567,56 @@ Public Class SimulationPageUC
End Sub
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
' eventualmente fermo la simulazione
m_nStatus = MCH_SIM_ST.UI_STOP
m_bPlay = False
PlayPauseBtn_Click(Nothing, Nothing)
' se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
Dim IsPressedShiftKey As Boolean = False
If Keyboard.Modifiers And ModifierKeys.Shift Then
IsPressedShiftKey = True
End If
' eventualmente fermo la simulazione
m_nStatus = MCH_SIM_ST.UI_STOP
m_bPlay = False
PlayPauseBtn_Click(Nothing, Nothing)
' Se nella pagina di tagli diretti
If m_MainWindow.DirectCutBtn.IsChecked And Not m_MainWindow.CadCutBtn.IsChecked Then
' Genero file CNC (lancio anche se errore in precedenza)
Dim sCncPathDirect As String = m_MainWindow.GetCncDir() & "\DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt
Dim bOkDirect As Boolean = EgtGenerate(sCncPathDirect, "OmagCut ver." & m_MainWindow.GetVersion())
' Costringo ad aggiornare UI
UpdateUI()
' Ripristino come fase corrente quella iniziale
EgtSetCurrPhase(1)
If bOkDirect Then
m_CurrProjPage.SetInfoMessage("Genarato file " & "DirectCut" & m_MainWindow.m_CurrentMachine.sIsoFileExt)
Else
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
End If
' procedo all'apertura del file CadCut1 apenna generato (solo se generazione corretta)
If bOkDirect And IsPressedShiftKey Then
Try
Process.Start("Notepad.exe", sCncPathDirect)
Catch ex As Exception
EgtOutLog(ex.ToString)
End Try
End If
' ricarico la pagina di simulazione
EgtSetCurrPhase(1)
' nascondo i pezzi in parcheggio
HideParkedParts(True)
' Avvio ambiente di simulazione
EgtSimInit()
EgtSimStart()
' Imposto stato corrente
SetStatus(MCH_SIM_ST.UI_STOP)
m_bPlay = True
' Costringo ad aggiornare UI
UpdateUI()
' esco
Return
End If
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Elimino eventuale attrezzaggio da OmagOFFICE
+51 -26
View File
@@ -4,6 +4,7 @@ Imports System.Collections.ObjectModel
Imports System.Runtime.InteropServices
Imports EgtUILib
Imports EgtWPFLib
Imports OmagCUT.VeinMatchingWindow
Public Class VeinMatchingWindow
@@ -19,6 +20,11 @@ Public Class VeinMatchingWindow
Private m_nIdToSel As Integer = GDB_ID.NULL
Private m_nIdToDesel As Integer = GDB_ID.NULL
Enum ALETTE
F = 2
A = 1
End Enum
Private Sub Window_Initialized(sender As Object, e As EventArgs)
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
VeinMatchingSceneHost.Child = VeinMatchingScene
@@ -267,7 +273,7 @@ Friend Module VeinMatching
Dim nRegId As Integer = EgtGetFirstInGroup(nRegLayId)
While nRegId <> GDB_ID.NULL
If EgtGetType(nRegId) = GDB_TY.SRF_FRGN Then
Exit While
Exit While
End If
nRegId = EgtGetNext(nRegId)
End While
@@ -364,19 +370,21 @@ Friend Module VeinMatching
' Imposto il contesto del progetto
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
' Riattivo il gruppo di lavoro
EgtSetCurrMachGroup( EgtGetFirstMachGroup())
EgtSetCurrMachGroup(EgtGetFirstMachGroup())
' Verifico quali pezzi sono nel grezzo, per dichiararlo al VM
nId = EgtGetFirstPartInRawPart( CamAuto.GetCurrentRaw())
nId = EgtGetFirstPartInRawPart(CamAuto.GetCurrentRaw())
While nId <> GDB_ID.NULL
' Dichiaro pezzo nel grezzo per VM
VeinMatching.OnInsertPartInRaw( nId)
VeinMatching.OnInsertPartInRaw(nId)
' Passo al pezzo successivo
nId = EgtGetNextPartInRawPart(nId)
End While
' Ripristino visualizzazione di eventuali pezzi in parcheggio
ShowParkedParts()
' Ripristino il contesto corrente
EgtSetCurrentContext( nCurrCtx)
EgtSetCurrentContext(nCurrCtx)
' EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyVeinMatch.nge", NGE.TEXT)
Return True
End Function
@@ -422,11 +430,11 @@ Friend Module VeinMatching
nCurrId = EgtGetFirstNameInGroup(nVeinId2, NAME_PREVIEW)
EgtSetStatus(nCurrId, GDB_ST.OFF)
' Se esiste OutLoop.orig OutLoop -> OutLoop.mach e OutLoop.orig -> OutLoop
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP & ".orig")
Dim nOutLoopOrig As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP & ".orig")
If nOutLoopOrig <> GDB_ID.NULL Then
Dim nOutLoop As Integer = EgtGetFirstNameInGroup( nVeinId2, NAME_OUTLOOP)
EgtSetName( nOutLoop, NAME_OUTLOOP & ".mach")
EgtSetName( nOutLoopOrig, NAME_OUTLOOP)
Dim nOutLoop As Integer = EgtGetFirstNameInGroup(nVeinId2, NAME_OUTLOOP)
EgtSetName(nOutLoop, NAME_OUTLOOP & ".mach")
EgtSetName(nOutLoopOrig, NAME_OUTLOOP)
End If
' Se necessario, ripristino il contesto originale
If nCurrCtx > 0 Then EgtSetCurrentContext(nCurrCtx)
@@ -555,8 +563,8 @@ Friend Module VeinMatching
' Se richiesto, eseguo deselezione
If bDeselect Then EgtDeselectObj(nId)
End If
EgtDraw()
End If
EgtDraw()
EgtSetCurrentContext(nMainCtx)
Return True
End Function
@@ -1039,37 +1047,44 @@ Friend Module VeinMatching
End Function
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
' A: alzatina, F: frontalino
Dim nType As Integer
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
Dim ptSRef, ptERef, ptE As Point3d
Dim ptSRef, ptERef, ptS, ptE As Point3d
' Piano cucina
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
' AlzFront
If Not EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptS) Then Return False
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
' vettore lato cucina
Dim vtRotRef As Vector3d = ptERef - ptSRef
' vettore lato AlzFront
Dim vtRot As Vector3d = ptE - ptS
' ruoto il solido intorno al lato di riferimento
Dim vtRot As Vector3d = ptERef - ptSRef
If nType = 1 Then
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
ElseIf nType = 2 Then
If nType = ALETTE.A Then
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
ElseIf nType = ALETTE.F Then
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
End If
' punto di riferimento per la traslazione sul solido
Dim ptSolid As Point3d
If nType = 1 Then
If nType = ALETTE.A Then
' cerco id della curva che definisce la front face
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
EgtStartPoint(nFrontCrvId, ptSolid)
ElseIf nType = 2 Then
EgtStartPoint(Item.SideId, ptSolid)
EgtStartPoint(nFrontCrvId, GDB_ID.ROOT, ptSolid)
ElseIf nType = ALETTE.F Then
EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptSolid)
End If
Dim ItemFrame As New Frame3d
If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
ptSolid.ToGlob(ItemFrame)
' Dim ItemFrame As New Frame3d
' If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
' ptSolid.ToGlob(ItemFrame)
'punto di riferimento per la traslazione sul piano cucina
Dim ptKitchen As Point3d = ptERef
@@ -1077,6 +1092,16 @@ Friend Module VeinMatching
Dim vtMove As Vector3d = ptKitchen - ptSolid
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
' eventualmente ruoto per allineare l'alzatina al piano cucina
Dim dLRef, dAngVRef, dAngHRef As Double
vtRotRef.ToSpherical(dLRef, dAngVRef, dAngHRef)
Dim dL, dAngV, dAngH As Double
vtRot.Rotate(Vector3d.Z_AX, 180)
vtRot.ToSpherical(dL, dAngV, dAngH)
Dim dDelta As Double = dAngHRef - dAngH
If Math.Abs(dDelta) < EPS_ANG_SMALL Then Return True
EgtRotate(Item.PartId, ptKitchen, Vector3d.Z_AX, dDelta, GDB_RT.GLOB)
Return True
End Function
@@ -1206,7 +1231,7 @@ Friend Module VeinMatching
' Se necessario, cambio contesto
If m_nVeinCtx <> nCurrCtx Then
If EgtSetCurrentContext(m_nVeinCtx) Then
Return If( nCurrCtx > 0, nCurrCtx, -2)
Return If(nCurrCtx > 0, nCurrCtx, -2)
Else
Return 0
End If
@@ -1268,7 +1293,7 @@ Friend Module VeinMatching
While nId <> GDB_ID.NULL
Dim nOriId As Integer
If EgtGetInfo(nId, KEY_ORI_ID, nOriId) AndAlso nOriId = nPartId Then
Exit While
Exit While
End If
nId = EgtGetNextPart(nId)
End While