Compare commits

...

94 Commits

Author SHA1 Message Date
Nicola Pievani fcca1ed72c - Inseriti commenti per lettura variabili CurrPhase - Definizione nome programma tagli diretti 2024-02-08 18:12:46 +01:00
Nicola Pievani 36b667fcc5 Lettura variabile opzionale della fase corrente 2024-02-08 12:18:00 +01:00
Nicola Pievani 919890e68d - Nascondo utensile PROBE - Pagina ASSISTENZA in scandeza - Correzione Text per spostamenti 2024-02-06 15:04:00 +01:00
Nicola Pievani b8143b0ff5 Cambio versione 2024-01-11 19:29:27 +01:00
Nicola Pievani 085975338a Merge commit '53fc2694a34f89878a5d9821387894adcfa808d2' into develop 2023-12-20 11:47:19 +01:00
Nicola Pievani 53fc2694a3 Aggiornamento versione 2.5l1 2023-12-20 11:46:48 +01:00
Nicola Pievani 9c8563f5c3 Merge commit '2f78dd796d946b2622a93aa975fa1e7df4407eaa' 2023-12-19 20:17:23 +01:00
Nicola Pievani 2f78dd796d Gestione OffsetLama tagli diretti MULTIPI e GRIGLIA 2023-12-19 20:16:57 +01:00
Nicola Pievani 378369d3d5 Merge commit '656c5a7d54504095793cba103234ee49403c7fee' into develop 2023-12-19 15:24:36 +01:00
Nicola Pievani 656c5a7d54 Migliorata importazione DXF 2023-11-28 09:35:09 +01:00
Nicola Pievani c40bc508d0 Merge commit 'de2234387d145276935dd44369dcb4989bbbb6bc' 2023-11-14 11:27:19 +01:00
Nicola Pievani de2234387d Merge commit 'd7c1ecacc2d11234a0ddbdfb38d2bc3fdfb2af2a' into develop 2023-11-14 11:27:03 +01:00
Nicola Pievani d7c1ecacc2 Correzione gestione Flattening (CamAuto) 2023-11-14 11:26:51 +01:00
Nicola Pievani ec813beae5 Reset dei tagli di separazione inseriti in OFFICE 2023-10-12 16:13:27 +02:00
Nicola Pievani 7a9faf537f Merge branch 'develop' 2023-10-10 18:56:56 +02:00
Nicola Pievani 6f58b6f090 Correzione NextBtn in spostamento grezzi 2023-10-10 18:56:16 +02:00
Nicola Pievani 53d06d6098 Inserita immagine logo Egalware 2023-10-06 14:51:16 +02:00
Nicola Pievani eb571bf5fd Merge commit '3d11abfa314f94573451e994c53a8aa19302d5a0' 2023-09-11 12:45:54 +02:00
Nicola Pievani 3d11abfa31 Aggiunta gestione bottoni EnableZone/EnablePC per macchina con due tavole 2023-09-11 12:45:13 +02:00
Nicola Pievani b1f8d21cc5 Merge commit 'ec8fbd3297eb42576e0a949ae749830551cba528' 2023-09-01 18:34:53 +02:00
Nicola Pievani ec8fbd3297 Merge commit 'f41b8f1409c1cafab3fee1d1cc4581410582d9b3' into develop 2023-09-01 18:34:06 +02:00
Nicola Pievani fdd3342492 Lettura info SlabDxf 2023-09-01 18:33:46 +02:00
Nicola Pievani f41b8f1409 Merge commit '5edd5300cdce93c5d0eb62cfd79215216586b52f' 2023-08-11 16:18:43 +02:00
Nicola Pievani 5edd5300cd Merge commit '92be9189c689ff507b4c99ac98fa477edc6b9689' into develop 2023-08-11 11:47:30 +02:00
Dario Sassi 92be9189c6 OmagCUT :
- disabilitato notifica progetto cambiato su alcune operazioni che non cambiano realmente i dati al carico.
2023-08-10 20:24:36 +02:00
Nicola Pievani 6c0bb175d9 Migliorata gestione uscita dalla pagina DrawImport 2023-08-09 13:07:20 +02:00
Nicola Pievani a079596aed Nuova gestione uscita dalla pagina DrawImport 2023-08-08 18:59:51 +02:00
Nicola Pievani 60da7384a2 Migliorata gestione parametro Width per spianatura 2023-08-08 18:15:33 +02:00
Nicola Pievani 761842bf45 Merge commit '32cfbfbeec30a6c8f173c01062978fdaf76414f4' into develop 2023-08-07 10:01:12 +02:00
Nicola Pievani 32cfbfbeec Aggiunte icone nuove per REG 2023-08-07 10:00:58 +02:00
Nicola Pievani 2ff2e6ffc4 Merge commit '0c7c729914506c957c2ebf89d7b0df45303aa1c0' 2023-08-03 19:29:21 +02:00
Nicola Pievani 0c7c729914 Migliorata visualizzazione Compo Frame 2023-08-03 18:48:40 +02:00
Nicola Pievani 7195e16c37 Aggiunti messaggi di Log per nuova gestione SpotReg 2023-08-03 16:53:23 +02:00
Nicola Pievani 42b0622bdf Miglioramento gestione Nuovo REG 2023-08-03 16:08:06 +02:00
Nicola Pievani bcdb79e796 Modificata versione 2.5h1 2023-08-03 15:26:02 +02:00
Nicola Pievani d7aa8902d9 Merge branch 'Featurese/New_Registration' into develop 2023-08-03 15:22:51 +02:00
Nicola Pievani 9d7fb9ab99 Gestione punti SpotReg 2023-08-03 15:22:31 +02:00
Nicola Pievani 8419659647 Merge branch 'develop' 2023-07-27 19:05:07 +02:00
Nicola Pievani 8becdfb219 Gestione profondità tagli singoli e gestione Scrap su linea. 2023-07-27 19:04:51 +02:00
Nicola Pievani 7c6b18d996 Correzione lettura assi per verifica finecorsa 2023-07-27 12:54:43 +02:00
Nicola Pievani 44e9a448fe Merge commit '5740820eedd1be0eab9bebb88cfd8f15c72e9a74' into develop 2023-07-26 12:18:47 +02:00
Nicola Pievani 5740820eed Merge commit '1c861ee7e3bcd1425ff12de2d2806a5014effd41' 2023-07-26 12:12:12 +02:00
DarioS 3202993a3e OmagCUT :
- inibita la generazione CN in simulazione se versione ufficio.
2023-07-26 11:10:25 +02:00
DarioS b293156a30 Merge branch 'master' of https://gitlab.steamware.net/egaltech/OmagCUT 2023-07-25 19:17:16 +02:00
DarioS dfe876638f OmagCUT :
- semplificata e migliorata generazione CN da pagina di simulazione.
2023-07-25 19:14:13 +02:00
Nicola Pievani 1c861ee7e3 Merge commit '5da026accb291341ce8e05d082d951f3a0d9d554' into develop 2023-07-25 17:03:38 +02:00
Nicola Pievani 5da026accb Gestione doppia fotocamera (rulliera-tavolo) 2023-07-25 17:03:26 +02:00
Nicola Pievani 5396796d28 Merge commit 'ae18c7f027cc2408ed5f4adb03903ff9521da07d' into develop 2023-07-25 12:51:17 +02:00
Nicola Pievani ae18c7f027 Merge commit '54122d82e6f5179fe8dcfe0a6a907ed15a0c1a43' 2023-07-25 12:50:31 +02:00
DarioS 54122d82e6 OmagCUT 2.5g2 :
- migliorie varie alla gestione spostamento pezzi con due teste su macchine di linea
- disabilitati attese di comunicazione in modalità demo.
2023-07-25 08:33:05 +02:00
Nicola Pievani f85e97a126 Aggiunti commenti e apertura file Log 2023-07-24 18:40:18 +02:00
DarioS 06654d923c OmagCUT :
- in chiusura si aspetta chiusura DreepFeed solo se NUM_OLD (Axium).
2023-07-24 08:29:53 +02:00
Nicola Pievani ce1c6fcf02 Merge commit 'da11ec0a11faa5e6e59cee2171b222747faec822' 2023-07-21 17:31:58 +02:00
Nicola Pievani da11ec0a11 Merge commit '52688ed0dafd532cfca811a82f0c7c32b057cfb4' into develop 2023-07-21 17:31:38 +02:00
Nicola Pievani 52688ed0da Inizio gestione Vaccum due teste 2023-07-21 14:31:25 +02:00
Nicola Pievani 60eda04669 Correzione creazione file NewClick,txt 2023-07-17 09:51:25 +02:00
Nicola Pievani b95dd8f41d Gestione estensione file inviato al CN 2023-07-13 10:42:42 +02:00
Nicola Pievani 4b2351c20a Cambio versione 2.5g1 2023-07-11 16:02:51 +02:00
Nicola Pievani 988743187b Merge commit '2c0afccbe3b165a9d3c82b57d7328409ba334513' into develop 2023-07-10 14:59:29 +02:00
Nicola Pievani 2c0afccbe3 Avvio lo scatto automatico per OmagPHOTO 2023-07-10 14:58:14 +02:00
Nicola Pievani a5d6d34664 Merge commit '27b13292cf73a4d6b5ecfbaf614d5eaf6eaa1d54' 2023-06-26 18:32:42 +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 10cb8f64f5 Merge commit '6dbf4f5ccbeb207f8df7d69550dd6d8bf6d06b89' 2023-06-13 18:34:25 +02:00
Nicola Pievani 6dbf4f5ccb Gestione multi inserimento e interasse Frame 2023-06-13 18:29:39 +02:00
Nicola Pievani 4ba0fe2520 Merge commit 'a55ab4f83d56dc7237f70ed32fd7aba08221c063' 2023-06-08 17:14:51 +02:00
Nicola Pievani a55ab4f83d Correzione importazione DXF 2023-06-07 12:53:57 +02:00
Nicola Pievani 419776c89f Merge commit 'fd89a6cf3b31ca241a41a8fc450fca9dbdc3f4aa' 2023-06-05 10:33:36 +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 c475f7dc12 Miglioramento gestione scarico frontale 2023-05-23 15:13:41 +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 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 07d8145d57 Iniziata gestione navigazione all'interno delle fasi 2023-03-20 20:15:31 +01:00
Nicola Pievani 8d363b8b06 Inizio creazione nuova fase scarico durante lavorazioni 2023-03-17 18:20:27 +01:00
Nicola Pievani 0eaebd5aad Inserito comando per passare alla pagina di scarico frontale 2023-03-08 11:49:52 +01:00
67 changed files with 2709 additions and 698 deletions
+10 -5
View File
@@ -23,7 +23,8 @@
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.25*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.25*"/>
</Grid.RowDefinitions>
@@ -44,13 +45,17 @@
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="KeyLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="MachineLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Center"
<TextBlock Name="AssStatusLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="ProjectLbl" Grid.Column="1" Grid.Row="7" HorizontalAlignment="Center"
<TextBlock Name="MachineLbl" Grid.Column="1" Grid.Row="7" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="8" HorizontalAlignment="Center"
<TextBlock Name="ProjectLbl" Grid.Column="1" Grid.Row="8" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="18"/>
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="9" HorizontalAlignment="Center"
VerticalAlignment="Center" FontSize="15" />
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="10" IsCancel="True"
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="11" IsCancel="True"
Style="{DynamicResource OmagCut_WindowGrayTextButton}" Margin="1,0"/>
</Grid>
+13
View File
@@ -33,6 +33,19 @@ Public Class AboutBoxWD
#Else
KeyLbl.Text = sKey & " - " & sOpts
#End If
' COPIATO da codice CAM5
Dim sAssStatus As String = " discontinued"
Dim nAssLeftDays As Integer
If EgtGetKeyAssLeftDays(nAssLeftDays) And nAssLeftDays >= 0 Then
If nAssLeftDays > 30 Then
sAssStatus = "expires within " & nAssLeftDays.ToString() & " days"
ElseIf nAssLeftDays > 0 Then
sAssStatus = "to be renewed within " & nAssLeftDays.ToString() & " days"
Else
sAssStatus = "to be renewed by today"
End If
End If
AssStatusLbl.Text = sAssStatus
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
MachineLbl.Text = "Machine : " & m_MainWindow.m_CurrentMachine.sMachineName
ProjectLbl.Text = "Project : " & m_MainWindow.m_CurrentProjectPageUC.GetCurrentProjectName()
+58 -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,61 @@ Friend Module CamAuto
Return bOk
End Function
Friend Function ResetAllSplitCut() As Boolean
Dim PartList As New List(Of Integer)
' Ricerca nei grezzi dei pezzi (devono essere ricercati tra quelli presenti nei grezzi)
Dim bOk As Boolean = True
' Recupero il numero di fasi presenti nel progetto
Dim nPhaseCount As Integer = EgtGetPhaseCount()
For nPhase As Integer = 1 To nPhaseCount
EgtSetCurrPhase(nPhase)
Dim nRawId As Integer = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
Dim nParId As Integer = EgtGetFirstPartInRawPart(nRawId)
If EgtVerifyRawPartPhase(nRawId, nPhase) Then
While nParId <> GDB_ID.NULL
Dim nNextParId As Integer = EgtGetNextPartInRawPart(nParId)
' verifico se il pezzo passato è un taglio di sepatazione (il nome deve contenere "SpliCut")
Dim sName As String = String.Empty
If EgtGetName(nParId, sName) AndAlso sName.Contains(SPLIT_CUT) Then
' Rimuovo il pezzo dal grezzo
If EgtRemovePartFromRawPart(nParId) Then
' Salvo l'indice del pezzo se non è stato già inserito
Dim nIndex As Integer = PartList.FirstOrDefault(Function(nId) nId = nParId)
If nIndex = 0 Then PartList.Add(nParId)
End If
End If
nParId = nNextParId
End While
End If
nRawId = EgtGetNextRawPart(nRawId)
End While
Next
' Reimposto la prima fase del progetto
EgtSetCurrPhase(1)
' Procedo ad eliminare il pezzo
For Each Item As Integer In PartList
bOk = bOk And EgtErase(Item)
Next
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)
+1 -1
View File
@@ -30,7 +30,7 @@
</Grid.ColumnDefinitions>
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
<Image Name="PhotoIMG" Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
+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>
+321 -74
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
@@ -329,7 +370,15 @@ Public Class MoveRawPartPage
VacuumCups.SetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
VacuumCups.SetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
VacuumCups.SetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
If PutVacuumCupsOnRaw(nId, rmData) Then
VacuumCups.ResetHeadName()
Dim bPutVacuum As Boolean = PutVacuumCupsOnRaw(nId, rmData)
If Not bPutVacuum Then
Dim bTwoHeadVac As Boolean = (EgtGetHeadId(VACUUM_HEAD_2) <> GDB_ID.NULL)
If bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(nId, rmData)
End If
If bPutVacuum Then
' Visualizzo le ventose
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
' Aggiorno i dati
@@ -351,6 +400,8 @@ Public Class MoveRawPartPage
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
End If
End If
End If
End If
EgtDraw()
@@ -445,7 +496,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 +539,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 +831,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 +899,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 +1085,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 +1131,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 +1141,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 +1167,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 +1219,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 +1253,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 +1291,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 +1380,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 +1391,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 +1417,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 +1433,39 @@ 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())
' se ultima fase (e non sacrico su tavola)
If m_nCurrPhase = EgtGetPhaseCount() And m_SplitPage.m_bOnAuxTab Then
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
Else
NextBtn.IsEnabled = (m_nCurrPhase <= EgtGetPhaseCount())
End If
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 +1481,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 +1499,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 +1527,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
+26 -1
View File
@@ -100,7 +100,32 @@
VerticalAlignment="Center" />
</Button>
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3" >
<!--Comandi attivi solo in madalità REG-->
<UniformGrid Name ="UG0_Reg" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="3" Visibility="Hidden">
<ToggleButton Name="AddPointRegBtn" Visibility="Hidden"
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<ToggleButton Name="ModPointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource Move-Spot-RegImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
<ToggleButton Name="RemovePointRegBtn" Visibility="Hidden"
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
</UniformGrid>
<!--Comandi attivi solo in madalità REG-->
<UniformGrid Name ="UG1_Reg" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" Visibility="Hidden">
<Button Name="AdjustPointRegBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Muovi-grezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
<ToggleButton Name="ActivatePointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Source="{DynamicResource ON_OFF-REGImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
</UniformGrid>
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3">
<Button Name="InsertPartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button>
+742 -10
View File
@@ -1,4 +1,8 @@
Imports EgtUILib
Imports System.ComponentModel
Imports System.Reflection
Imports System.Windows.Forms
Imports System.Windows.Forms.Integration
Imports EgtUILib
Imports EgtWPFLib
Public Class NestPageUC
@@ -104,12 +108,17 @@ Public Class NestPageUC
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
DragRettanleBtn.ToolTip = "Strech"
' Nascondo i pulsanti in uso quando attivo la modalità REG
UG0_Reg.Visibility = Visibility.Hidden
Dim nColumsIn_UG1 As Integer = 2
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
m_bIsVisibleDragRettangle = (GetPrivateProfileInt(S_NEST, K_DRAG_RETTANGLE, 0, m_MainWindow.GetIniFile()) <> 0)
If Not m_bIsVisibleDragRettangle Then
nColumsIn_UG1 = 1
DragRettanleBtn.Visibility = Visibility.Collapsed
Else
DragRettanleBtn.Visibility = Visibility.Visible
End If
' gestisco la visualizzazione del comando Splt (per i tagli waterjet)
@@ -186,6 +195,43 @@ Public Class NestPageUC
ShowParkedParts()
' Garantisco visibilità eventuale contorno da foto
m_CurrProjPage.ShowContour(True)
' Disabilito impostazione modificato
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If bOldEnMod Then EgtDisableModified()
' Verifico se esiste il gruppo "REG"
Dim nIdRaws As Integer = EgtGetParent(m_CurrProjPage.m_nRawId)
Dim nIdReg As Integer = EgtGetFirstNameInGroup(EgtGetParent(nIdRaws), "Reg")
' Resetto le variabili di conteggio
m_nCountSpot = 0
m_nCountSpotCUT = 0
If nIdReg <> GDB_ID.NULL Then
m_nRegGroupId = nIdReg
EgtGetInfo(m_nRegGroupId, COUNTSPOT, m_nCountSpot)
EgtGetInfo(m_nRegGroupId, COUNTSPOTCUT, m_nCountSpotCUT)
' Lo nascondo
EgtSetStatus(m_nRegGroupId, GDB_ST.OFF)
Else
' Creo layer per definire i punti di REG
m_nRegGroupId = EgtCreateGroup(EgtGetParent(nIdRaws))
EgtSetName(m_nRegGroupId, REG)
m_nCountSpot = 0
m_nCountSpotCUT = 0
End If
' Se nel progetto non sono inseriti punti SpotReg disabilito i comandi
If m_nCountSpot < 1 Then
UG0_Reg.IsEnabled = False
UG1_Reg.IsEnabled = False
End If
' Se nel progetto non sono inseriti punti SpotRegCUT provvedo ad aggiungerli
If m_nCountSpotCUT < 1 Then
InsertSpotRegistration()
End If
' Se necessario riabilito impostazione modificato
If bOldEnMod Then EgtEnableModified()
End Sub
Public Sub UpdateStepsOnUI()
@@ -890,10 +936,103 @@ Public Class NestPageUC
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo e non in modalità registrazione
If Not m_bActive Or m_bRegister Then Return
If Not m_bActive Or m_bRegister Then
' procedo solo sel il click è avvenuto con il tasto sinistro del mouse
If e.Button <> MouseButtons.Left Then Return
' se aggiungo SpotReg e numero di Spot inferiore a quelli inseriti in Office
If AddPointRegBtn.IsChecked Then
If m_nCountSpotCUT < m_nCountSpot Then
' Acquisisco punto da disegno
EgtUnProjectPoint(e.Location, m_ptPrev)
Dim ptRawMax As Point3d = m_b3Raw.Max()
m_ptPrev.z = ptRawMax.z
' Inserisco un nuovo punto registrazione
CreateSpotRegistration(m_nRegGroupId, m_ptPrev, m_nCountSpotCUT + 1)
EgtDraw()
' disattivo il comando di inserimento
AddPointRegBtn.IsChecked = False
Else
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("Max spot for reg: " & m_nCountSpot.ToString)
End If
ElseIf RemovePointRegBtn.IsChecked Then
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(True, True, True, True, True)
Dim nSelect As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
Dim sName As String = String.Empty
While nSelId <> GDB_ID.NULL
sName = String.Empty
EgtGetName(nSelId, sName)
If sName.StartsWith(SPOTREGCUT_) Then
' recupero recupero il centro della prima curva
Dim nIdParent As Integer = EgtGetParent(nSelId)
RemoveSpotRegistration(nIdParent)
EgtDraw()
EgtErase(nIdParent)
RemovePointRegBtn.IsChecked = False
' Esco dal ciclo
Exit While
End If
nSelId = EgtGetNextObjInSelWin()
End While
ElseIf ModPointRegBtn.IsChecked Then
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(True, True, True, True, True)
Dim nSelect As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
Dim sName As String = String.Empty
While nSelId <> GDB_ID.NULL
sName = String.Empty
EgtGetName(nSelId, sName)
If sName.StartsWith(SPOTREGCUT_) Then
EgtDeselectAll()
EgtResetMark(m_nCurrSpotRegId)
' recupero l'Id del gruppo di appartenenza
Dim nIdParent As Integer = EgtGetParent(nSelId)
EgtSelectGroupObjs(nIdParent)
EgtSetMark(nIdParent)
EgtDraw()
' Acquisisco punto da disegno
EgtUnProjectPoint(e.Location, m_ptPrev)
m_bDrag = True
' Salvo l'Id del punto SpotReg da spostare
m_nCurrSpotRegId = nIdParent
' Esco dal ciclo
Exit While
End If
nSelId = EgtGetNextObjInSelWin()
End While
ElseIf ActivatePointRegBtn.IsChecked Then
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(True, True, True, True, True)
Dim nSelect As Integer
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
Dim sName As String = String.Empty
While nSelId <> GDB_ID.NULL
sName = String.Empty
EgtGetName(nSelId, sName)
' accetto qualsiasi punto di tipo SpotReg (sia da OFFICE che da CUT)
If sName.StartsWith(SPOTREG_) Or sName.StartsWith(SPOTREGCUT_) Then
Dim nIdParent As Integer = EgtGetParent(nSelId)
ActivateSpotRegistration(nIdParent)
EgtDraw()
' Esco dal ciclo
Exit While
End If
nSelId = EgtGetNextObjInSelWin()
End While
End If
' Devo sempre uscire da questa condizione
Return
End If
' Si può selezionare solo con il tasto sinistro e se stato NULL
If e.Button <> Windows.Forms.MouseButtons.Left Or
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Return
End If
@@ -902,7 +1041,6 @@ Public Class NestPageUC
OnMyMouseDownSceneSelCurv(sender, e)
Return
End If
m_bIsCounterLy = False
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
If m_bIsCheckedDragRettangle Then
@@ -963,7 +1101,6 @@ Public Class NestPageUC
End If
End If
End If
If Not m_bIsCounterLy Then
' Se già selezionato o posizione oggetto incompatibile con flag posizione selezionati
If nStat = GDB_ST.SEL Then
@@ -1022,6 +1159,10 @@ Public Class NestPageUC
EgtSetCurrPhase(nI)
EgtSetTableAreaOffset(TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
Next
' aggiorno posizionamento ventose per lavorazioni da sotto
UpdateVacuumsForDrip()
' dichiaro tutto aggiornato
m_CurrProjPage.SetOrderMachiningFlag()
EgtSetCurrPhase(1)
' Rotazione
Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
@@ -1067,7 +1208,6 @@ Public Class NestPageUC
m_bKeyLeftShiftPressed = m_bVerify
m_vtTotMove = Vector3d.NULL()
End Sub
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
' Verifico di essere il gestore attivo
If Not m_bActive Then Return
@@ -1076,7 +1216,7 @@ Public Class NestPageUC
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
If m_bDragToStart Then
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Return
End If
m_bDragToStart = False
@@ -1087,6 +1227,19 @@ Public Class NestPageUC
OnMyMouseMoveSawRettangle(sender, e)
Return
End If
If ModPointRegBtn.IsChecked Then
' Ricavo il punto corrente in coordinate mondo
Dim ptCurr_ As Point3d
EgtUnProjectPoint(e.Location, ptCurr_)
' Ricavo il vettore di movimento
Dim vtMove As Vector3d = ptCurr_ - m_ptPrev
MoveSpotRegistration(m_nCurrSpotRegId, vtMove)
' Aggiorno il punto precedente
m_ptPrev = ptCurr_
' Terminata esecuzione di drag
m_bDragging = False
Return
End If
' Determino cosa muovere
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
@@ -1650,6 +1803,10 @@ Public Class NestPageUC
nRevPhase += 1
End While
End If
' Muovo i punti SpotReg generati nel programma OFFICE
If bMoveOk Then
MoveAllSpotRegistration(vtMove)
End If
' Ripristino lo stato iniziale
EgtSetCurrPhase(1)
HideAllMachinings()
@@ -1909,12 +2066,160 @@ Public Class NestPageUC
' Dichiaro grezzo per punti
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
End If
' Ruoto i punti SpotReg disegnati in Office
If bMoveOk Then
RotateAllSpotRegistration(dAngDeg, ptCen)
End If
' Ripristino lo stato iniziale
EgtSetCurrPhase(1)
HideAllMachinings()
Return bMoveOk
End Function
Friend Function RotateAllRawParts(dAngDeg As Double, ptCen As Point3d, Optional bIsReg As Boolean = True) As Boolean
' Recupero rotazione totale
Dim dRegRot As Double = GetRegistrationRotation()
' Recupero il centro del grezzo iniziale per usarlo come centro della rotazione
'Dim ptCen As New Point3d
'GetRawCenter(ptCen)
' Provo la rotazione
Dim bMoveOk As Boolean = True
Dim nPhase As Integer = 1
Dim nRawId As Integer = GDB_ID.NULL
While nPhase <= EgtGetPhaseCount()
EgtSetCurrPhase(nPhase)
nRawId = EgtGetFirstRawPart()
While nRawId <> GDB_ID.NULL
If EgtVerifyRawPartPhase(nRawId, nPhase) Then
' Rotazione del centro come spostamento grezzo più rotazione grezzo attorno al suo centro
Dim ptRawCen As New Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
Dim ptMovCen As New Point3d(ptRawCen)
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), dAngDeg)
If Not EgtMoveRawPart(nRawId, ptMovCen - ptRawCen) Then
bMoveOk = False
Exit While
End If
If Not EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngDeg) Then
EgtMoveRawPart(nRawId, -(ptMovCen - ptRawCen))
bMoveOk = False
Exit While
End If
End If
nRawId = EgtGetNextRawPart(nRawId)
End While
If Not bMoveOk Then Exit While
nPhase += 1
End While
' Se rotazione impossibile, ripristino posizione dei grezzi già spostati
If Not bMoveOk Then
Dim nRevPhase As Integer = 1
Dim nRevRawId As Integer = GDB_ID.NULL
While nRevPhase <= nPhase
EgtSetCurrPhase(nRevPhase)
nRevRawId = EgtGetFirstRawPart()
While nRevRawId <> GDB_ID.NULL And (nRevPhase < nPhase Or nRevRawId <> nRawId)
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
' Eseguo al contrario
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
Dim ptRawCen As New Point3d
EgtGetRawPartCenter(nRevRawId, ptRawCen)
Dim ptMovCen As New Point3d(ptRawCen)
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
End If
nRevRawId = EgtGetNextRawPart(nRevRawId)
End While
nRevPhase += 1
End While
' Altrimenti eseguo sistemazioni
Else
' Origine della tavola
Dim ptOri As Point3d
EgtGetTableRef(1, ptOri)
' Annullo rotazioni dei grezzi e le rifaccio sulle parti componenti
Dim nRevPhase As Integer = 1
Dim nRevRawId As Integer = GDB_ID.NULL
While nRevPhase <= EgtGetPhaseCount()
EgtSetCurrPhase(nRevPhase)
nRevRawId = EgtGetFirstRawPart()
While nRevRawId <> GDB_ID.NULL
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
' Eseguo al contrario
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
Dim ptRawCen As New Point3d
EgtGetRawPartCenter(nRevRawId, ptRawCen)
Dim ptMovCen As New Point3d(ptRawCen)
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
' Rifaccio sugli oggetti contenuti nel grezzo
Dim nId As Integer = EgtGetFirstInGroup(nRevRawId)
While nId <> GDB_ID.NULL
EgtRotate(nId, ptCen, Vector3d.Z_AX(), dAngDeg, GDB_RT.GLOB)
nId = EgtGetNext(nId)
End While
' Imposto posizione esatta del grezzo dopo rotazione
Dim b3Raw As New BBox3d
EgtGetRawPartBBox(nRevRawId, b3Raw)
EgtMoveToCornerRawPart(nRevRawId, (b3Raw.Min() - ptOri) + Point3d.ORIG(), MCH_CR.BL)
End If
nRevRawId = EgtGetNextRawPart(nRevRawId)
End While
nRevPhase += 1
End While
' Ruoto opportunamente anche i dati di movimento
Dim nOpeId As Integer = EgtGetFirstActiveOperation()
While nOpeId <> GDB_ID.NULL
If EgtGetOperationType(nOpeId) = MCH_OY.DISP Then
' Recupero i gruppi con i dati
Dim nRpmId As Integer = EgtGetFirstNameInGroup(nOpeId, "Rpm*")
While nRpmId <> GDB_ID.NULL
' Recupero le informazioni
Dim vtRawMove As New Vector3d
If EgtGetInfo(nRpmId, "Mv", vtRawMove) Then
vtRawMove.Rotate(Vector3d.Z_AX(), dAngDeg)
EgtSetInfo(nRpmId, "Mv", vtRawMove)
End If
Dim vtDelta As New Vector3d
If EgtGetInfo(nRpmId, "Dt", vtDelta) Then
vtDelta.Rotate(Vector3d.Z_AX(), dAngDeg)
EgtSetInfo(nRpmId, "Dt", vtDelta)
End If
Dim dAngRotDeg As Double = 0
If EgtGetInfo(nRpmId, "Ad", dAngRotDeg) Then
EgtSetInfo(nRpmId, "Ad", dAngRotDeg + dAngDeg)
End If
' Cerco un altro gruppo
nRpmId = EgtGetNextName(nRpmId, "Rpm*")
End While
End If
nOpeId = EgtGetNextActiveOperation(nOpeId)
End While
' Se non è registrazione, ruoto anche l'eventuale foto della lastra
'If Not bIsReg Then
' Dim nPhotoId = m_CurrProjPage.GetPhoto()
' If nPhotoId <> GDB_ID.NULL then EgtRotatePhoto(nPhotoId, ptCen, Vector3d.Z_AX(), dAngDeg)
'End If
' Aggiorno rotazione totale
If bIsReg Then
SetRegistrationRotation(dRegRot + dAngDeg)
Else
SetRegistrationRotation(0)
End If
' Dichiaro grezzo per punti
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
End If
' Ruoto i punti SpotReg disegnati in Office
If bMoveOk Then
RotateAllSpotRegistration(dAngDeg, ptCen)
End If
' Ripristino lo stato iniziale
EgtSetCurrPhase(1)
HideAllMachinings()
Return bMoveOk
End Function
Private Sub InsertPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPartBtn.Click
' Se inserimento automatico
If GetPrivateProfileInt(S_NEST, K_AUTOMATICOPTIMIZE, 0, m_MainWindow.GetIniFile()) <> 0 And
@@ -2482,8 +2787,11 @@ Public Class NestPageUC
Const STORE_LARGH As Double = 6000
Const STORE_DIST As Double = 200
Const STORE_OFFS As Double = 20 + 40 + 20
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (STORE_LARGH - b3Tab.DimX())
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + STORE_LARGH, b3Tab.Min().y - STORE_DIST, STORE_OFFS, False)
Dim dStoreLarg As Double = GetPrivateProfileDouble("Store", "StoreLargh", STORE_LARGH, m_MainWindow.GetMachIniFile())
Dim dStoreDist As Double = GetPrivateProfileDouble("Store", "StoreDist", STORE_DIST, m_MainWindow.GetMachIniFile())
Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (dStoreLarg - b3Tab.DimX())
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + dStoreLarg, b3Tab.Min().y - dStoreDist, dStoreOffs, False)
End Function
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
@@ -2755,7 +3063,10 @@ Public Class NestPageUC
Else
m_dRegStep = Math.Max(dVal, 2 * EPS_SMALL)
End If
WritePrivateProfileString(S_NEST, K_STEP, StepMoveTxBx.Text, m_MainWindow.GetIniFile())
Dim dCurrVal As Double = 0
StringToLen(StepMoveTxBx.Text, dCurrVal)
DoubleToString(dCurrVal, 2)
WritePrivateProfileString(S_NEST, K_STEP, DoubleToString(dCurrVal, 2), m_MainWindow.GetIniFile())
End If
End Sub
@@ -2852,6 +3163,427 @@ Public Class NestPageUC
Return True
End Function
#Region "SPOT REG"
' Layer per crocette dei punti REG (creato in Office)
Public m_nRegGroupId As Integer = GDB_ID.NULL
' Numero di spot inseriti nel grezzo corrente (da Office)
Private m_nCountSpot As Integer = 0
' Gruppo Spot attualmente selezionato
Private m_nCurrSpotRegId As Integer = GDB_ID.NULL
' Nome info nuomero Spot (da Office)
Private Const COUNTSPOT As String = "CountSpot"
' Nome gruppo
Private Const REG As String = "Reg"
' Nome del gruppo di ogno Spot (da Office)
Private Const SPOTREG_ As String = "SpotReg_"
Private Const RADSPOT As Double = 20
' numero di Spot inseriti (da Cut)
Private m_nCountSpotCUT As Integer = 0
' Nome del gruppo di ogno Spot (da Cut)
Private Const SPOTREGCUT_ As String = "SpotRegCUT_"
' Nome info nuomero Spot (da Office)
Private Const COUNTSPOTCUT As String = "CountSpotCUT"
' Nome della Info per indicare se il punto è da usare
Private Const ACTIVATESPOTCUT As String = "ActivateSpotCut"
Private Sub AddPointReg_Click() Handles AddPointRegBtn.Click
DeselectCurSpotReg()
ModPointRegBtn.IsChecked = False
RemovePointRegBtn.IsChecked = False
ActivatePointRegBtn.IsChecked = False
End Sub
Private Sub ModPointReg_Click() Handles ModPointRegBtn.Click
' Deseleziono lo Spotreg selezionato
DeselectCurSpotReg()
AddPointRegBtn.IsChecked = False
RemovePointRegBtn.IsChecked = False
ActivatePointRegBtn.IsChecked = False
End Sub
Private Sub RemovePointReg_Click() Handles RemovePointRegBtn.Click
DeselectCurSpotReg()
ModPointRegBtn.IsChecked = False
AddPointRegBtn.IsChecked = False
ActivatePointRegBtn.IsChecked = False
End Sub
Private Sub AdjustPointReg_Click() Handles AdjustPointRegBtn.Click
PointRegCheckedOff()
AdjustRawWithSpotReg()
End Sub
Private Sub ActivatePointRegBtn_Click() Handles ActivatePointRegBtn.Click
DeselectCurSpotReg()
AddPointRegBtn.IsChecked = False
ModPointRegBtn.IsChecked = False
RemovePointRegBtn.IsChecked = False
End Sub
Private Sub DeselectCurSpotReg()
EgtDeselectAll()
If m_nCurrSpotRegId <> GDB_ID.NULL Then
EgtResetMark(m_nCurrSpotRegId)
m_nCurrSpotRegId = GDB_ID.NULL
EgtDraw()
End If
End Sub
' disabilito contemporaneamente tutti i comandi per la gestione punti SpotReg
Public Sub PointRegCheckedOff()
DeselectCurSpotReg()
AddPointRegBtn.IsChecked = False
ModPointRegBtn.IsChecked = False
RemovePointRegBtn.IsChecked = False
ActivatePointRegBtn.IsChecked = False
End Sub
' riceve l'ID del gruppo da muovere
Private Function MoveSpotRegistration(nIdGroup As Integer, vtMove As Vector3d) As Boolean
If nIdGroup = GDB_ID.NULL Then Return False
' Non ci deve essere movimento in Z
vtMove.z = 0
' Recupero il cercio di riferimento
Dim nArcId As Integer = EgtGetFirstInGroup(nIdGroup)
Dim b3Crv As New BBox3d
EgtGetBBoxGlob(nArcId, GDB_BB.STANDARD, b3Crv)
Dim ptMin, ptMax As Point3d
If EgtGetTableArea(1, ptMin, ptMax) Then
Dim m_ptTableMin As Point3d = ptMin
Dim m_dTableLength As Double = ptMax.x - ptMin.x
Dim m_dTableWidth As Double = ptMax.y - ptMin.y
b3Crv.Move(vtMove)
If b3Crv.Min().x < m_ptTableMin.x + 10 * EPS_SMALL Then
vtMove.x += m_ptTableMin.x + 10 * EPS_SMALL - b3Crv.Min().x
ElseIf b3Crv.Max().x > m_ptTableMin.x + m_dTableLength + 10 * EPS_SMALL Then
vtMove.x += m_ptTableMin.x + m_dTableLength - 10 * EPS_SMALL - b3Crv.Max().x
End If
If b3Crv.Min().y < m_ptTableMin.y + 10 * EPS_SMALL Then
vtMove.y += m_ptTableMin.y + 10 * EPS_SMALL - b3Crv.Min().y
ElseIf b3Crv.Max().y > m_ptTableMin.y + m_dTableWidth + 10 * EPS_SMALL Then
vtMove.y += m_ptTableMin.y + m_dTableWidth - 10 * EPS_SMALL - b3Crv.Max().y
End If
' muovo il gruppo
EgtMove(nIdGroup, vtMove)
EgtDraw()
Return True
End If
Return False
End Function
' Muovo solo gli elementi SpotReg creati nel programma OFFICE
Private Sub MoveAllSpotRegistration(vtMove As Vector3d, Optional bOnlyOfficeSpot As Boolean = True)
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
While nId <> GDB_ID.NULL
Dim sName As String = String.Empty
EgtGetName(nId, sName)
If Not sName.Contains("CUT") Or Not bOnlyOfficeSpot Then
EgtMove(nId, vtMove)
End If
nId = EgtGetNext(nId)
End While
EgtDraw()
End Sub
' Riposiziono i punti SpotReg (tutti) in funzione dell'altezza del grezzo
Public Sub UpdateSpotRegistration()
Dim ptCentArc As Point3d
If m_nRegGroupId <> GDB_ID.NULL Then Return
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
Dim sNameEnt As String = String.Empty
Dim sName As String = String.Empty
EgtGetName(nId, sName)
If sName.Contains("CUT") Then
sNameEnt = SPOTREGCUT_ & "Arc"
Else
sNameEnt = SPOTREG_ & "Arc"
End If
Dim nIdArc As Integer = EgtGetFirstNameInGroup(nId, sNameEnt)
If Not EgtCenterPoint(nIdArc, GDB_ID.ROOT, ptCentArc) Then
Return
End If
Dim dOffsetZ As Double = m_b3Raw.Max().z - ptCentArc.z
If Math.Abs(dOffsetZ) > 0.1 Then
MoveAllSpotRegistration(New Vector3d(0, 0, dOffsetZ + 0.1), False)
End If
End Sub
' Ruoto solo gli elementi SpotReg creati nel programma OFFICE
Private Sub RotateAllSpotRegistration(dAngRot As Double, ptCen As Point3d)
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
While nId <> GDB_ID.NULL
Dim sName As String = String.Empty
EgtGetName(nId, sName)
If Not sName.Contains("CUT") Then
EgtRotate(nId, ptCen, Vector3d.Z_AX, dAngRot)
End If
nId = EgtGetNext(nId)
End While
EgtDraw()
End Sub
' Per ogni SpotReg di OFFICE viene generato (nella stessa posizione) uno SpotRegCUT
Private Function InsertSpotRegistration() As Boolean
' recupero l'elenco non ordinato degli Id dei punti SpotReg (da Office)
Dim SpotRegList As New List(Of Integer)
Dim nId As Integer = GDB_ID.NULL
' Creo la lista ordinata dei punti SpotReg (da OFFICE)
For nIndexSpot As Integer = 1 To m_nCountSpot
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREG_ & nIndexSpot.ToString)
SpotRegList.Add(nId)
Next
' Creo i punti SpotRegCUT sovrapposti a quelli inseriti in OFFICE
Dim bOk As Boolean = True
For nIndex As Integer = 0 To SpotRegList.Count - 1
Dim ptCent As Point3d
GetCenterSpotReg(SpotRegList, SPOTREG_ & "Arc", nIndex + 1, ptCent)
bOk = bOk And CreateSpotRegistration(m_nRegGroupId, ptCent, nIndex + 1)
Next
Return bOk
End Function
' Creo il punto nel gruppo "Reg/SpotRegCUT_"
Private Function CreateSpotRegistration(nLayerIdReg As Integer, ptP As Point3d, nIndexSpot As Integer) As Boolean
' creo uno specifico layer per ogni spot (definito da una croce inscritta in un cerchio)
Dim nIdSpotLay As Integer = EgtCreateGroup(nLayerIdReg)
' Aggiungo cerchio
Dim nCircId As Integer = EgtCreateCircle(nIdSpotLay, ptP, RADSPOT)
' Inserisco una croce all'interno del
Dim nLineVId As Integer = EgtCreateLinePVL(nIdSpotLay, ptP, Vector3d.Y_AX, RADSPOT)
EgtExtendCurveStartByLen(nLineVId, RADSPOT)
Dim nLineHId As Integer = EgtCreateLinePVL(nIdSpotLay, ptP, Vector3d.X_AX, RADSPOT)
EgtExtendCurveStartByLen(nLineHId, RADSPOT)
Dim nTextId As Integer = EgtCreateText(nIdSpotLay, ptP + New Vector3d(1, 1, 0), nIndexSpot.ToString, 10)
' coloro gli oggetti appena creati ed assegno il nome
Dim bOk As Boolean = EgtSetColor(nCircId, New Color3d(0, 255, 0))
bOk = bOk And EgtSetName(nCircId, SPOTREGCUT_ & "Arc")
bOk = bOk And EgtSetColor(nLineVId, New Color3d(0, 255, 0))
bOk = bOk And EgtSetName(nLineVId, SPOTREGCUT_ & "LineV")
bOk = bOk And EgtSetColor(nLineHId, New Color3d(0, 255, 0))
bOk = bOk And EgtSetName(nLineHId, SPOTREGCUT_ & "LineH")
bOk = bOk And EgtSetColor(nTextId, New Color3d(255, 0, 0))
bOk = bOk And EgtSetName(nTextId, SPOTREGCUT_ & "Text")
' assegno il nome del gruppo corrente
bOk = bOk And EgtSetName(nIdSpotLay, SPOTREGCUT_ & nIndexSpot.ToString)
If bOk Then
' Aggiorno il contatore degli Spot
EgtSetInfo(nLayerIdReg, COUNTSPOTCUT, nIndexSpot)
m_nCountSpotCUT = nIndexSpot
End If
Return bOk
End Function
' Elimino il punto nel gruppo "Reg/SpotRegCUT_"
Private Function RemoveSpotRegistration(nSpotRegId As Integer) As Boolean
Dim nIndSpotReg As Integer = GetIndexGroupSpotReg(nSpotRegId)
If Not EgtErase(nSpotRegId) Then Return False
' faccio scorrere tutti i gruppi ed eventualmente li rinomino
Dim n_IdSR As Integer = EgtGetFirstInGroup(m_nRegGroupId)
m_nCountSpotCUT -= 1
EgtSetInfo(m_nRegGroupId, COUNTSPOTCUT, m_nCountSpotCUT)
While n_IdSR <> GDB_ID.NULL
Dim sName As String = String.Empty
EgtGetName(n_IdSR, sName)
If sName.Contains("CUT") Then
Dim nCurrIndSpotReg As Integer = GetIndexGroupSpotReg(n_IdSR)
If nCurrIndSpotReg > nIndSpotReg Then
' Recupero il testo
Dim nIdtext As Integer = EgtGetFirstNameInGroup(n_IdSR, SPOTREGCUT_ & "Text")
nCurrIndSpotReg -= 1
EgtModifyText(nIdtext, nCurrIndSpotReg.ToString)
EgtSetName(n_IdSR, SPOTREGCUT_ & nCurrIndSpotReg.ToString)
End If
End If
n_IdSR = EgtGetNext(n_IdSR)
End While
EgtDraw()
Return True
End Function
' Cambio lo stato dello SpotReg (sia di OFFICE che di CUT)
Private Function ActivateSpotRegistration(nSpotRegId As Integer) As Boolean
Dim nIndexSpot As Integer = GetIndexGroupSpotReg(nSpotRegId)
Dim nParentId As Integer = EgtGetParent(nSpotRegId)
Dim nInfo As Integer = 0
Dim bOk As Boolean = True
If Not EgtGetInfo(nSpotRegId, ACTIVATESPOTCUT, nInfo) Then
' 1: Attivo, 0: Disbilitato
nInfo = 1
End If
If nInfo = 1 Then
' inserisco una Info sullo SpotRegCUT che indica che è disattivo
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREGCUT_ & nIndexSpot.ToString)
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 0)
Dim nEntId As Integer = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Arc")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineV")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineH")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Text")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 255, 0))
' inserisco una Info sullo SpotReg (OFFICE) che indica che è disattivo
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREG_ & nIndexSpot.ToString)
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 0)
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Arc")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineV")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineH")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Text")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
Else
' inserisco una Info sul pezzo che indica che è attivo
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREGCUT_ & nIndexSpot.ToString)
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 1)
Dim nEntId As Integer = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Arc")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineV")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineH")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Text")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
' inserisco una Info sullo SpotReg (OFFICE) che indica che è disattivo
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREG_ & nIndexSpot.ToString)
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 1)
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Arc")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineV")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineH")
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Text")
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
End If
Return bOk
End Function
' Restituisce l'indice dello "SpotReg_" oppure "SpotRegCUT_"
Private Function GetIndexGroupSpotReg(nSpotRegId As Integer) As Integer
Dim sNameParent As String = String.Empty
EgtGetName(nSpotRegId, sNameParent)
' Ricavo l'indice dal nome
Dim sItems As String() = sNameParent.Split("_"c)
Dim nCurrIndex As Integer = 0
If sItems.Count = 2 Then
If Not Integer.TryParse(sItems(1), nCurrIndex) Then
nCurrIndex = -1
End If
End If
Return nCurrIndex
End Function
' Calcola gli spostamenti del grezzo per posizionare i punti di SpotReg
Private Function AdjustRawWithSpotReg() As Boolean
' Verifico che almeno un punto sia stato inserito
If m_nCountSpotCUT < 1 Then
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("Insert one spot reg to start.")
End If
' recupero l'elenco non ordinato degli Id dei punti SpotReg (da Office)
Dim SpotRegList As New List(Of Integer)
Dim SpotRegCUTList As New List(Of Integer)
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
' Creo la lista ordinata dei punti
For nIndexSpot As Integer = 1 To m_nCountSpotCUT
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREGCUT_ & nIndexSpot.ToString)
Dim nActivate As Integer = 0
If Not EgtGetInfo(nId, ACTIVATESPOTCUT, nActivate) Then
nActivate = 1
End If
If nId <> GDB_ID.NULL And nActivate = 1 Then
SpotRegCUTList.Add(nId)
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREG_ & nIndexSpot.ToString)
SpotRegList.Add(nId)
End If
Next
' Carico la lista dei centri
Dim ptCentCUTList As New List(Of Point3d)
Dim ptCentLIst As New List(Of Point3d)
If Not GetAllCenterSpotReg(SpotRegCUTList, SpotRegList, ptCentCUTList, ptCentLIst) Then Return False
' Eseguo il primo posizionamento di massima
Dim vtMoveStart As Vector3d = ptCentCUTList(0) - ptCentLIst(0)
Dim dAngRotSum As Double = 0.0
Dim dScaleSum As Double = 0.0
For nIndex As Integer = 1 To ptCentCUTList.Count - 1
Dim vtDirCUT As Vector3d = ptCentCUTList(nIndex) - ptCentCUTList(0)
Dim vtDir As Vector3d = ptCentLIst(nIndex) - ptCentLIst(0)
Dim dLenCUT, dLen, dAngVCUT, dAngV, dAngHCUT, dAngH As Double
vtDirCUT.ToSpherical(dLenCUT, dAngVCUT, dAngHCUT)
vtDir.ToSpherical(dLen, dAngV, dAngH)
dScaleSum += Math.Abs(dLenCUT - dLen) / dLenCUT
dAngRotSum += dAngHCUT - dAngH
Next
vtMoveStart.z = 0
' Determino la deformazione media
Dim dScaleAvarage As Double = 1 - dScaleSum / (ptCentCUTList.Count - 1)
MoveAllRawParts(vtMoveStart)
' Ruoto del valor medio delle differenze angolari
Dim dAngAvarage As Double = dAngRotSum / (ptCentCUTList.Count - 1)
RotateAllRawParts(dAngAvarage, ptCentCUTList(0))
Dim sCurrINdexSpot As String = GetIndexGroupSpotReg(SpotRegCUTList(0)).ToString
EgtOutLog(" → REG Adjustment datas :")
EgtOutLog(" → move SpotReg_" & sCurrINdexSpot & " : " & vtMoveStart.x.ToString & ", " & vtMoveStart.y.ToString)
EgtOutLog(" → average rotation around SpotRegCUT_" & sCurrINdexSpot & " : " & dAngAvarage.ToString)
EgtOutLog(" → average scale deformation : " & dScaleAvarage.ToString)
' Correggo lo spostamento in funzione della deformazione misurata
Dim vtMoveSum As Vector3d = New Vector3d(0, 0, 0)
GetAllCenterSpotReg(SpotRegCUTList, SpotRegList, ptCentCUTList, ptCentLIst)
For nIndex As Integer = 1 To ptCentCUTList.Count - 1
vtMoveSum += ptCentCUTList(nIndex) - ptCentLIst(nIndex)
Next
vtMoveSum.z = 0
vtMoveSum = vtMoveSum / (ptCentCUTList.Count - 1)
MoveAllRawParts(vtMoveSum * dScaleAvarage / 2)
EgtDraw()
Return True
End Function
Private Function GetAllCenterSpotReg(SpotRegCUTList As List(Of Integer), SpotRegList As List(Of Integer),
ByRef ptCentCUTList As List(Of Point3d), ByRef ptCentLIst As List(Of Point3d)) As Boolean
ptCentCUTList.Clear()
ptCentLIst.Clear()
For nIndex As Integer = 0 To m_nCountSpotCUT
Dim ptCenCUT As Point3d
Dim ptCent As Point3d
If GetCenterSpotReg(SpotRegCUTList, SPOTREGCUT_ & "Arc", nIndex + 1, ptCenCUT) Then
ptCentCUTList.Add(ptCenCUT)
GetCenterSpotReg(SpotRegList, SPOTREG_ & "Arc", nIndex + 1, ptCent)
ptCentLIst.Add(ptCent)
End If
Next
If ptCentCUTList.Count > 0 AndAlso ptCentCUTList.Count = ptCentLIst.Count Then
Return True
Else
Return False
End If
End Function
' Data la lista di punti Spot e l'indice dello spot da ricercare restituisce il centro del punto indicato
Private Function GetCenterSpotReg(ListSR As List(Of Integer), sName As String, nIndex As Integer, ByRef ptCentArc As Point3d) As Boolean
For Each ItemSR As Integer In ListSR
If GetIndexGroupSpotReg(ItemSR) = nIndex Then
Dim nIdArc As Integer = EgtGetFirstNameInGroup(ItemSR, sName)
If EgtCenterPoint(nIdArc, GDB_ID.ROOT, ptCentArc) Then
Return True
End If
End If
Next
Return False
End Function
#End Region
End Class
+82 -18
View File
@@ -1,4 +1,6 @@
Imports EgtUILib
Imports System.Net
Imports System.Windows.Forms.Integration
Imports EgtUILib
Public Module SplitAuto
@@ -118,6 +120,9 @@ Public Module SplitAuto
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL And (nRes And CAR_RES.LO_OK) <> 0) And
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine
If nRes = 0 Then
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
End If
End If
' se trasformabile in taglio di separazione, verifico se lo è
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
@@ -132,7 +137,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 +146,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 +161,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 +199,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 +224,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 +347,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 +399,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 +432,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
@@ -743,21 +799,29 @@ Public Module SplitAuto
Private Function ExecMove(nDispId As Integer, vNewRaws As List(Of Integer),
vtMove As Vector3d, dMinMove As Double) As Boolean
Dim vtMove2 As Vector3d = -vtMove
Dim bTwoHeadVac As Boolean = ( EgtGetHeadId( VACUUM_HEAD_2) <> GDB_ID.NULL)
Dim rmData As New RawMoveData
If PutVacuumCupsOnRaw(vNewRaws(1), rmData) AndAlso
SafeMoveRawPart(vNewRaws(1), vtMove, dMinMove) Then
Dim vtMove2 As Vector3d = -vtMove
VacuumCups.ResetHeadName()
Dim bPutVacuum As Boolean = PutVacuumCupsOnRaw(vNewRaws(1), rmData)
If Not bPutVacuum And bTwoHeadVac Then bPutVacuum= PutVacuumCupsOnRaw(vNewRaws(1), rmData)
If bPutVacuum AndAlso SafeMoveRawPart(vNewRaws(1), vtMove, dMinMove) Then
rmData.m_vtRawMove = vtMove
SaveOneMoveInfoInDisposition(nDispId, rmData)
Return True
ElseIf PutVacuumCupsOnRaw(vNewRaws(0), rmData) AndAlso
SafeMoveRawPart(vNewRaws(0), vtMove2, dMinMove) Then
End If
VacuumCups.ResetHeadName()
Dim bPut2Vacuum As Boolean = PutVacuumCupsOnRaw(vNewRaws(0), rmData)
If Not bPut2Vacuum And bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(vNewRaws(0), rmData)
If bPut2Vacuum AndAlso SafeMoveRawPart(vNewRaws(0), vtMove2, dMinMove) Then
rmData.m_vtRawMove = vtMove2
SaveOneMoveInfoInDisposition(nDispId, rmData)
Return True
Else
Return False
End If
Return False
End Function
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
+49 -50
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)
@@ -340,7 +343,6 @@ Public Class SplitPageUC
EgtTrimCurveEndAtLen(nIdBridge, dLen - 10 * EPS_SMALL)
EgtTrimCurveStartAtLen(nIdBridge, 10 * EPS_SMALL)
End If
' EgtSaveFile("c:\EgtData\OmagCUT\Temp\Bridge.nge", NGE.BIN)
Dim nIdPart As Integer = GDB_ID.NULL
nIdPart = EgtGetFirstPartInRawPart(m_CurrProjPage.m_nRawId)
While nIdPart <> GDB_ID.NULL
@@ -348,7 +350,6 @@ Public Class SplitPageUC
Dim nIdSurf As Integer = EgtGetFirstInGroup(nIdRegion)
While nIdSurf <> GDB_ID.NULL
If EgtGetType(nIdSurf) = GDB_TY.SRF_FRGN Then
' EgtSaveFile("c:\EgtData\OmagCUT\Temp\Bridge.nge", NGE.BIN)
' se la linea bridge interseca la superficie allora restitusco false
If EgtCurveWithRegionClassify(nIdBridge, nIdSurf) <> CREGC.OUT Then
EgtExtendCurveStartByLen(nIdBridge, 10 * EPS_SMALL)
@@ -710,30 +711,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 +806,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 +1698,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 +1712,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 +1724,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 +1763,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 +1904,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 +1923,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 +1947,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 +2030,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 +2196,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
+75 -40
View File
@@ -1,5 +1,6 @@
Imports EgtUILib
Imports System.Text.RegularExpressions
Imports System.Threading
Module VacuumCups
' Tipo manipolatore con ventosa (0=assente, 1=dietro, 2=laterale)
@@ -31,6 +32,19 @@ Module VacuumCups
' Nome del gruppo temporaneo per le ventose
Private Const VACTMP_GRP As String = "VacTmp"
Private m_sHeadName As String = VACUUM_HEAD
Public Sub ResetHeadName()
Dim bReload As Boolean = (m_sHeadName <> VACUUM_HEAD)
m_sHeadName = VACUUM_HEAD
If bReload Then LoadVacuumCups()
End Sub
Public Function ChangeHeadName() As Boolean
If EgtGetHeadId( VACUUM_HEAD_2) = GDB_ID.NULL Then Return False
m_sHeadName = If( m_sHeadName = VACUUM_HEAD, VACUUM_HEAD_2, VACUUM_HEAD)
LoadVacuumCups()
Return True
End Function
'-----------------------------------------------------------------------------------------------
Friend Class RawMoveData
@@ -87,17 +101,17 @@ Module VacuumCups
Friend Function LoadVacuumCups() As Boolean
' Leggo tipo manipolatore con ventosa
m_nVacType = 0
EgtGetInfo(EgtGetHeadId(VACUUM_HEAD), KEY_VAC_TYPE, m_nVacType)
EgtGetInfo(EgtGetHeadId(m_sHeadName), KEY_VAC_TYPE, m_nVacType)
' Cancello eventuali vecchie ventose
RemoveVacuumCups()
' Identificativo ventose nella macchina
Dim nLayId As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), VACUUM_HEAD_LAYOUT)
Dim nLayId As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), VACUUM_HEAD_LAYOUT)
If nLayId = GDB_ID.NULL Then Return False
' Identificativo riferimento della testa nella macchina
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), HEAD_FIRST_EXIT)
If nT1Id = GDB_ID.NULL Then Return False
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
EgtSetCalcTool("", "H4", 1)
EgtSetCalcTool("", m_sHeadName, 1)
' Creo gruppo temporaneo in cui copiarli
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
If m_nTempId = GDB_ID.NULL Then Return False
@@ -107,23 +121,23 @@ Module VacuumCups
m_nVacId = EgtCopyGlob(nLayId, m_nTempId)
If m_nVacId = GDB_ID.NULL Then Return False
' Angolo di rotazione preferito
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
' Angoli di rotazione preferiti per ventosa in verticale (lungo Y) a sinistra e a destra del centro tavola
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFVROTXMINUS, m_dPrefVertRotXMinus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXMINUS, m_dPrefVertRotXMinus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYMINUS, m_dPrefVertRotYMinus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYPLUS, m_dPrefVertRotYPlus)
' Direzione di riferimento per tagli Drip
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
EgtGetInfo(m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
EgtSetStatus(m_nVacId, GDB_ST.OFF)
Dim nId As Integer = EgtGetFirstInGroup(m_nVacId)
While nId <> GDB_ID.NULL
Select Case EgtGetType(nId)
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
EgtSetStatus(nId, GDB_ST.ON_)
Case Else
EgtSetStatus(nId, GDB_ST.OFF)
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
EgtSetStatus(nId, GDB_ST.ON_)
Case Else
EgtSetStatus(nId, GDB_ST.OFF)
End Select
nId = EgtGetNext(nId)
End While
@@ -152,7 +166,7 @@ Module VacuumCups
Friend Function ResetVacuumCups() As Boolean
' Ripristino posizione e rotazione originali
Dim frOriRef As New Frame3d
EgtFrame(EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT), GDB_ID.ROOT, frOriRef)
EgtFrame(EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), HEAD_FIRST_EXIT), GDB_ID.ROOT, frOriRef)
Dim frCurrRef As New Frame3d
EgtFrame(m_nRefId, GDB_ID.ROOT, frCurrRef)
EgtMove(m_nVacId, frOriRef.Orig() - frCurrRef.Orig(), GDB_RT.GLOB)
@@ -164,10 +178,10 @@ Module VacuumCups
Dim nId As Integer = EgtGetFirstInGroup(m_nVacId)
While nId <> GDB_ID.NULL
Select Case EgtGetType(nId)
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
EgtSetStatus(nId, GDB_ST.ON_)
Case Else
EgtSetStatus(nId, GDB_ST.OFF)
Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO
EgtSetStatus(nId, GDB_ST.ON_)
Case Else
EgtSetStatus(nId, GDB_ST.OFF)
End Select
nId = EgtGetNext(nId)
End While
@@ -207,14 +221,17 @@ Module VacuumCups
EgtSurfFrGrossArea(nRKerfId, RawArea)
' volume calcolato in mmc
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
' peso calolato in kg
' peso calcolato in kg
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
'-------------------- FINE CALCOLO PESO --------------------
' Eseguo ricerca
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
Return True
Else
If ChangeHeadName() Then Return False
End If
' In caso di fallimento, provo riducendo con offset la regione di kerf
' (così si simula la proiezione del centro sul MAT - medial axis transform)
Dim bOkFind As Boolean = False
@@ -241,20 +258,20 @@ Module VacuumCups
' Verifico sia veramente un pezzo
If EgtGetRawPartFromPart(nPartId) = GDB_ID.NULL Then Return False
' Cerco la direzione del primo taglio attivo da sotto
Dim nDripLayId As Integer = EgtGetFirstNameInGroup( nPartId, NAME_DRIPCUT)
Dim nDripLineId As Integer = EgtGetFirstInGroup( nDripLayId)
Dim nDripLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_DRIPCUT)
Dim nDripLineId As Integer = EgtGetFirstInGroup(nDripLayId)
While nDripLineId <> GDB_ID.NULL
Dim nMchId As Integer = EgtGetOperationId( "DripSaw" & nDripLineId.ToString())
Dim nMchId As Integer = EgtGetOperationId("DripSaw" & nDripLineId.ToString())
Dim nMode As Integer
If EgtGetMode( nMchId, nMode) AndAlso nMode = GDB_MD.STD Then Exit While
nDripLineId = EgtGetNext( nDripLineId)
If EgtGetMode(nMchId, nMode) AndAlso nMode = GDB_MD.STD Then Exit While
nDripLineId = EgtGetNext(nDripLineId)
End While
Dim vtDir As New Vector3d
if EgtStartVector( nDripLineId, GDB_ID.ROOT, vtDir) Then
If EgtStartVector(nDripLineId, GDB_ID.ROOT, vtDir) Then
Dim dLen, dAngV, dAngH As Double
vtDir.ToSpherical( dLen, dAngV, dAngH)
vtDir.ToSpherical(dLen, dAngV, dAngH)
Dim dOffsAng = dAngH - m_dDripRefAng
While dOffsAng - m_dPreferredRot >= 90
While dOffsAng - m_dPreferredRot >= 90
dOffsAng -= 180
End While
While dOffsAng - m_dPreferredRot <= -90
@@ -388,7 +405,7 @@ Module VacuumCups
Private Function GetVacRotAxisSteps(ByRef vAngRot As List(Of Double)) As Boolean
' Recupero l'asse rotante della testa ventosa
Dim nRotAxId As Integer = EgtGetParent(EgtGetHeadId(VACUUM_HEAD))
Dim nRotAxId As Integer = EgtGetParent(EgtGetHeadId(m_sHeadName))
' Verifico se contiene info con STEPS
Dim sSteps As String = ""
If Not EgtGetInfo(nRotAxId, KEY_ROTVAC_STEPS, sSteps) Then Return False
@@ -493,15 +510,15 @@ Module VacuumCups
' Ordino secondo distanza angolare crescente da direzione di allineamento (modulo 180 deg)
Dim dRotRefDeg As Double = dRotAngDeg
vAngRot.Sort(Function(P, Q)
Dim dDiffP = Math.Abs( P - dRotRefDeg)
If Math.Abs( dDiffP - 180) < 10 * EPS_ANG_SMALL Then dDiffP = 1
Dim dDiffQ = Math.Abs( Q - dRotRefDeg)
If Math.Abs( dDiffQ - 180) < 10 * EPS_ANG_SMALL Then dDiffQ = 1
Return ( dDiffP - dDiffQ)
Dim dDiffP = Math.Abs(P - dRotRefDeg)
If Math.Abs(dDiffP - 180) < 10 * EPS_ANG_SMALL Then dDiffP = 1
Dim dDiffQ = Math.Abs(Q - dRotRefDeg)
If Math.Abs(dDiffQ - 180) < 10 * EPS_ANG_SMALL Then dDiffQ = 1
Return (dDiffP - dDiffQ)
End Function)
' Annullo la rotazione di allineamento
dRotAngDeg = 0
' altrimenti in continuo
' altrimenti in continuo
Else
' Assegno più valori di ricerca e conservo angolo di allineamento
vAngRot.AddRange({0, +5, -5, +12.5, -12.5, +25, -25, +45, -45})
@@ -548,25 +565,43 @@ Module VacuumCups
' assegnate le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
Dim sAxisName As String = "C"
' verifico che il nome dell'asse impostato sia corretto
If EgtGetAxisId(sAxisName) = GDB_ID.NULL Then
If m_sHeadName = VACUUM_HEAD Then
sAxisName = "C1"
Else
sAxisName = "C2"
End If
End If
' Posizione Home dell'asse rotante
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
EgtGetAxisHomePos(sAxisName, dCHome)
' Corse dell'asse
Dim dCMin As Double
EgtGetAxisMin("C", dCMin)
EgtGetAxisMin(sAxisName, dCMin)
Dim dCMax As Double
EgtGetAxisMax("C", dCMax)
EgtGetAxisMax(sAxisName, dCMax)
' Porto l'angolo nel range
Dim dRotAngMachDeg As Double = dRotAngDeg + dCHome
AdjustAngleInRange(dRotAngMachDeg, dCMin, dCMax)
' Imposto la ventosa come fosse un utensile
EgtSetCalcTool("", "H4", 1)
EgtSetCalcTool("", m_sHeadName, 1)
' Calcolo gli assi macchina
Dim dX, dY, dZ As Double
Dim nStat As Integer
EgtGetCalcPositions(ptRef, dRotAngMachDeg, 0, nStat, dX, dY, dZ)
' Verifico le corse
EgtVerifyOutstroke(dX, dY, dZ, dRotAngMachDeg, 0, nStat)
If EgtGetAxisId("A") <> GDB_ID.NULL Then
' Asse tavola rotante (movimenti solo con A0)
EgtGetCalcPositions(ptRef, 0, dRotAngMachDeg, nStat, dX, dY, dZ)
' Verifico le corse
EgtVerifyOutstroke(dX, dY, dZ, 0, dRotAngMachDeg, nStat)
Else
EgtGetCalcPositions(ptRef, dRotAngMachDeg, 0, nStat, dX, dY, dZ)
' Verifico le corse
EgtVerifyOutstroke(dX, dY, dZ, dRotAngMachDeg, 0, nStat)
End If
Return nStat
End Function
@@ -732,7 +767,7 @@ Module VacuumCups
rmList.RemoveAt(nInd)
nInd = rmList.Count() - 1
End If
' Se non trovato, lo accodo
' Se non trovato, lo accodo
Else
rmList.Add(New RawMoveData(nRawId))
nInd = rmList.Count() - 1
+7
View File
@@ -84,6 +84,11 @@ Module ConstGen
' Nome testa con ventose per spostamento pezzi
Public Const VACUUM_HEAD As String = "H4"
Public Const VACUUM_HEAD_2 As String = "H104"
' Nome teste laser
Public Const LASER_HEAD As String = "H3"
Public Const LASER_HEAD_2 As String = "H103"
' Info tipo ventosa
Public Const KEY_VAC_TYPE As String = "VacType"
' Nome gruppo layout in testa con ventose
@@ -313,6 +318,8 @@ Module ConstGen
Public Const INFO_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
' Info in OutLoop per punto inzio lavorazione WaterJet
Public Const INFO_START As String = "Start"
' Nome dei tagli diretti inseriti in fase di Splitting
Public Const SPLIT_CUT As String = "SplitCut"
' Nome di pezzo che è una cornice
Public Const NAME_FRAME As String = "Frame"
+3 -1
View File
@@ -19,6 +19,7 @@ Module ConstIni
Public Const K_DEBUG As String = "Debug"
Public Const K_LICENCE As String = "Licence"
Public Const K_NETKEY As String = "NetKey"
Public Const K_LOCKID As String = "LockId"
Public Const K_MESSAGESDIR As String = "MessagesDir"
Public Const K_MESSAGES As String = "Messages"
Public Const K_SUPPORT As String = "Support"
@@ -52,7 +53,7 @@ Module ConstIni
Public Const K_GENERATECN As String = "GenerateCN"
Public Const K_FRACTIONPATTERN As String = "FractionPattern"
Public Const K_PRECISION As String = "Precision"
Public Const K_QUITDRAWPAGE As String = "QuitDrawPage"
Public Const S_LANGUAGES As String = "Languages"
Public Const K_LANGUAGE As String = "Language"
@@ -206,6 +207,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"
+13
View File
@@ -5,6 +5,7 @@
Public Const S_PARTPROGRAM As String = "PartProgram"
Public Const K_EXTENSION As String = "Extension"
Public Const K_EXTFILECN As String = "ExtFileCN"
Public Const S_AXES As String = "Axes"
Public Const K_AXESNUM As String = "AxesNum"
@@ -56,6 +57,10 @@
Public Const S_EXECLUA As String = "ExecLua"
Public Const K_FILESCRIPT_LUA As String = "FileScript"
Public Const S_CAMERAHQ As String = "CameraHQ"
Public Const K_CAMERAHQ_ENABLE As String = "EnableHQ"
Public Const K_CAMERAHQ_ACTIVATE As String = "ActivateHQ"
Public Const S_NCDATA As String = "NcData"
Public Const K_NEWVARIABLE As String = "NewVariable"
Public Const K_NEWCONSOLE As String = "NewConsole"
@@ -92,6 +97,9 @@
Public Const K_ENABLEZONE As String = "EnableZone"
Public Const K_ENABLEPC As String = "EnablePC"
Public Const K_HSM As String = "Hsm"
Public Const BTN_ENABLE_ZONE_1 As String = "EnableZone1"
Public Const BTN_ENABLE_ZONE_2 As String = "EnableZone2"
Public Const BTN_ENABLE_PC As String = "EnablePC"
Public Const K_VACUUMUP As String = "VacuumUp"
Public Const K_VACUUMDOWN As String = "VacuumDown"
Public Const K_VACUUM2UP As String = "Vacuum2Up"
@@ -151,6 +159,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 +244,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
+53 -25
View File
@@ -344,33 +344,61 @@ Public Class ControlsMachineButtonUC
End Sub
Friend Sub ZoneStateChanged(ZoneState As Integer)
'Dim sFlag As String = String.Empty
'If ZoneState = 1 Then
' sFlag = BTN_ENABLE_ZONE_1
'ElseIf ZoneState = 2 Then
' sFlag = BTN_ENABLE_ZONE_2
'End If
'Dim EnableZoneButton As TwoStateButton = Nothing
'For Each MachineButton As MachineButton In m_ButtonList
' If MachineButton.StateFlag = K_ENABLEZONE Then
' EnableZoneButton = MachineButton
' End If
'Next
'If Not IsNothing(EnableZoneButton) Then
' EnableZoneButton.SetIsChecked(EnableZone)
'End If
Dim bEnableZone1 As Boolean = False
If ZoneState = 1 Then
bEnableZone1 = True
ElseIf ZoneState = 2 Then
bEnableZone1 = False
End If
' attivo il comando associato
Dim EnableZoneButton As TwoStateButton = Nothing
For Each MachineButton As MachineButton In m_ButtonList
If MachineButton.StateFlag = BTN_ENABLE_ZONE_1 Then
EnableZoneButton = MachineButton
End If
Next
If Not IsNothing(EnableZoneButton) Then
EnableZoneButton.SetIsChecked(bEnableZone1)
End If
' disattivo l'altro per esclusione
EnableZoneButton = Nothing
For Each MachineButton As MachineButton In m_ButtonList
If MachineButton.StateFlag = BTN_ENABLE_ZONE_2 Then
EnableZoneButton = MachineButton
End If
Next
If Not IsNothing(EnableZoneButton) Then
EnableZoneButton.SetIsChecked(Not bEnableZone1)
End If
End Sub
Friend Sub PcStateChanged(EnablePC As Boolean)
'Dim EnablePCButton As TwoStateButton = Nothing
'For Each MachineButton As MachineButton In m_ButtonList
' If MachineButton.StateFlag = K_ENABLEPC Then
' EnablePCButton = MachineButton
' End If
'Next
'If Not IsNothing(EnablePCButton) Then
' EnablePCButton.SetIsChecked(EnablePC)
'End If
Friend Sub PcStateChanged(EnablePC As Integer)
Dim bEnablePC1 As Boolean = False
If EnablePC = 1 Then
bEnablePC1 = True
ElseIf EnablePC = 2 Then
bEnablePC1 = False
End If
' attivo/disattivo il comando associato
Dim EnablePCButton As TwoStateButton = Nothing
For Each MachineButton As MachineButton In m_ButtonList
If MachineButton.StateFlag = K_ENABLEPC & "_1" Then
EnablePCButton = MachineButton
End If
Next
If Not IsNothing(EnablePCButton) Then
EnablePCButton.SetIsChecked(bEnablePC1)
End If
' disattivo/attivo l'altro per esclusione
EnablePCButton = Nothing
For Each MachineButton As MachineButton In m_ButtonList
If MachineButton.StateFlag = BTN_ENABLE_ZONE_2 Then
EnablePCButton = MachineButton
End If
Next
If Not IsNothing(EnablePCButton) Then
EnablePCButton.SetIsChecked(Not bEnablePC1)
End If
End Sub
#End Region ' State Range
+10 -6
View File
@@ -187,11 +187,11 @@ Public Class FlatteningCut
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, If( m_bRotLock, "1", "0"), m_MainWindow.GetIniFile())
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_POSX, DoubleToString( m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
' imposto la Z di sicurezza corretta
EgtMdbSetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
EgtMdbSave()
' Se non vado in simulazione
If Not m_bSimul Then
' imposto la Z di sicurezza corretta
EgtMdbSetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
EgtMdbSave()
' Dichiaro sottopagina da non riattivare
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC.DirectCutPages.DirectCut
' Rimuovo layer temporaneo per crocette
@@ -409,7 +409,7 @@ Public Class FlatteningCut
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
' Verifico che l'affondamento impostato non sia superiore a quello massimo
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
Dim dDepth As Double = 0
StringToLen(DepthTxBx.Text, dDepth)
If dDepth < 0 Then
@@ -600,13 +600,15 @@ Public Class FlatteningCut
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
@@ -723,6 +725,7 @@ Public Class FlatteningCut
If nStepNum > 1 Then
dDelta = dWidth / (nStepNum - 1)
End If
EgtSetInfo(nCutId, INFO_WIDTH, dThick)
' Creo vettore delta
vtDelta *= dDelta
' Creo indice per impostare info che indica tipologia di spianatura
@@ -731,6 +734,7 @@ Public Class FlatteningCut
Dim vtPerpMove As Vector3d = Index * vtDelta
' Creo copie
Dim nCut2Id = EgtCopyGlob(nCutId, nLayerId)
EgtSetInfo(nCut2Id, INFO_WIDTH, dThick)
' Assegno info direzione a seconda del tipo di spianatura
If TypeCmBx.SelectedIndex = MACH_TYPE.ZIGZAG Then
If nTypeIndex = 1 Then
+35 -4
View File
@@ -38,6 +38,8 @@ Public Class GridCut
Private m_ptPrev As Point3d
' Layer per crocette temporanee
Private m_nTempLay As Integer = GDB_ID.NULL
' Gestione spessore lama
Private m_bSawTh As Boolean = False
' Costanti
Private Const MAX_TAB_DEPTH As Double = 10.0
@@ -82,7 +84,12 @@ Public Class GridCut
m_nNumX = GetPrivateProfileInt( S_DIRECTCUTS, K_DC_GRID_NUMX, m_nNumX, m_MainWindow.GetIniFile())
m_dDimX = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_GRID_DIMX, m_dDimX, m_MainWindow.GetIniFile())
m_nNumY = GetPrivateProfileInt( S_DIRECTCUTS, K_DC_GRID_NUMY, m_nNumY, m_MainWindow.GetIniFile())
m_dDimY = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_GRID_DIMY, m_dDimY, m_MainWindow.GetIniFile())
m_dDimY = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_DIMY, m_dDimY, m_MainWindow.GetIniFile())
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
m_bHeadSide = ( GetPrivateProfileInt( S_DIRECTCUTS, K_DC_GRID_HEADSIDE, 0, m_MainWindow.GetIniFile()) <> 0)
m_ptTipP1.x = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_GRID_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
m_ptTipP1.y = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_GRID_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
@@ -141,6 +148,11 @@ Public Class GridCut
NumPzYTxBx.Text = m_nNumY.ToString()
DimPzYTxBx.Text = LenToString( m_dDimY, 1)
SideChBx.IsChecked = m_bHeadSide
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
' Reset taglio e disabilito bottone esecuzione
m_bCutOk = False
UpdateSimulOkBtn()
@@ -405,7 +417,7 @@ Public Class GridCut
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
' Verifico che l'affondamento impostato non sia superiore a quello massimo
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
Dim dDepth As Double = 0
StringToLen(DepthTxBx.Text, dDepth)
If dDepth < 0 Then
@@ -523,13 +535,15 @@ Public Class GridCut
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
@@ -616,6 +630,15 @@ Public Class GridCut
If dDimPzY <> 0 And nNumPzY > 0 And dDimPzX <> 0 And nNumPzX > 0 Then
Dim dLenX As Double = dThick + (dDimPzX + dThick) * nNumPzX
Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX + 0.1)
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
' Recupero spessore lama corrente
Dim sSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
If m_bSawTh And Not String.IsNullOrEmpty(sSawing) Then
EgtOffsetCurve(nCutParaId, -dThick, OFF_TYPE.EXTEND)
End If
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
' Imposto affondamento e angolo di fianco sul taglio
EgtSetInfo(nCutParaId, INFO_DEPTH, m_dDepth)
EgtSetInfo(nCutParaId, INFO_SIDE_ANGLE, m_dAngV)
@@ -634,6 +657,13 @@ Public Class GridCut
' Arretro il punto di partenza di uno spessore lama
Dim vtDeltaPos As Vector3d = Vector3d.FromPolar(dThick + 0.1, m_dAngO - 90)
Dim nCutPerpId = EgtCreateLinePDL(nLayerId, ptStart + vtDeltaPos, m_dAngO + 90, dLenY + 0.2)
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
If m_bSawTh And Not String.IsNullOrEmpty(sSawing) Then
EgtOffsetCurve(nCutPerpId, -dThick, OFF_TYPE.EXTEND)
End If
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
' Specchio se è attivo il flag che cambia lato di disegno
If SideChBx.IsChecked() Then
Dim vtRot As Vector3d = Vector3d.FromPolar(1, m_dAngO + 90)
@@ -656,6 +686,7 @@ Public Class GridCut
End Function
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
ptP += New Vector3d(0, 0, 0.15)
' Aggiungo crocette
Dim vtCrossX As New Vector3d(20, 0, 0)
Dim vtCrossY As New Vector3d(0, 20, 0)
+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
+36 -6
View File
@@ -38,7 +38,8 @@ Public Class MultipleCut
Private m_ptPrev As Point3d
' Layer per crocette temporanee
Private m_nTempLay As Integer = GDB_ID.NULL
' Gestione spessore lama
Private m_bSawTh As Boolean = False
' Costanti
Private Const MAX_TAB_DEPTH As Double = 10.0
Private Const MIN_CUT_LEN As Double = 10.0
@@ -90,9 +91,14 @@ Public Class MultipleCut
m_dAngO = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_MULT_ANGH, m_dAngO, m_MainWindow.GetIniFile())
m_dAngV = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_MULT_ANGV, m_dAngV, m_MainWindow.GetIniFile())
For nI As Integer = 0 To 9
m_nNum( nI) = GetPrivateProfileInt( S_DIRECTCUTS, K_DC_MULT_NUM & (nI+1).ToString(), 0, m_MainWindow.GetIniFile())
m_dDim( nI) = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_MULT_DIM & (nI+1).ToString(), 0, m_MainWindow.GetIniFile())
m_nNum(nI) = GetPrivateProfileInt(S_DIRECTCUTS, K_DC_MULT_NUM & (nI + 1).ToString(), 0, m_MainWindow.GetIniFile())
m_dDim(nI) = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_MULT_DIM & (nI + 1).ToString(), 0, m_MainWindow.GetIniFile())
Next
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
m_bHeadSide = ( GetPrivateProfileInt( S_DIRECTCUTS, K_DC_MULT_HEADSIDE, 0, m_MainWindow.GetIniFile()) <> 0)
m_ptTipP1.x = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_MULT_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
m_ptTipP1.y = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_MULT_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
@@ -168,6 +174,11 @@ Public Class MultipleCut
NumPz10TxBx.Text = m_nNum(9).ToString()
DimPz10TxBx.Text = LenToString( m_dDim(9), 1)
SideChBx.IsChecked = m_bHeadSide
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
' Reset taglio e disabilito bottone esecuzione
m_bCutOk = False
UpdateSimulOkBtn()
@@ -435,7 +446,7 @@ Public Class MultipleCut
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
' Verifico che l'affondamento impostato non sia superiore a quello massimo
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
Dim dDepth As Double = 0
StringToLen(DepthTxBx.Text, dDepth)
If dDepth < 0 Then
@@ -569,13 +580,15 @@ Public Class MultipleCut
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
@@ -606,6 +619,22 @@ Public Class MultipleCut
Dim ptStart As Point3d = m_ptTipP1
ptStart.z = 0
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
' Recupero spessore lama corrente
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
Dim sSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
EgtTdbSetCurrTool(sSaw)
Dim dThick As Double = 0
' Se è impostata una lavorazione di lama
If Not String.IsNullOrEmpty(sSawing) Then
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
End If
If m_bSawTh And Not String.IsNullOrEmpty(sSawing) Then
EgtOffsetCurve(nCutId, -dThick, OFF_TYPE.EXTEND)
End If
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
' Imposto affondamento e angolo di fianco sul taglio
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
@@ -698,6 +727,7 @@ Public Class MultipleCut
End Function
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
ptP += New Vector3d(0, 0, 0.15)
' Aggiungo crocette
Dim vtCrossX As New Vector3d(20, 0, 0)
Dim vtCrossY As New Vector3d(0, 20, 0)
+4 -2
View File
@@ -180,13 +180,15 @@ Public Class Polishing
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
+5 -3
View File
@@ -351,7 +351,7 @@ Public Class SawTestUC
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
' Verifico che l'affondamento impostato non sia superiore a quello massimo
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
Dim dDepth As Double = 0
StringToLen(DepthTxBx.Text, dDepth)
If dDepth < 0 Then
@@ -450,13 +450,15 @@ Public Class SawTestUC
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
+6 -4
View File
@@ -40,7 +40,7 @@ Public Class SingleCutUC
Private m_nTempLay As Integer = GDB_ID.NULL
' Costanti
Private Const MAX_TAB_DEPTH As Double = 10.0
Private Const MAX_TAB_DEPTH As Double = 10.0 ' sostituita da un m_MaxTabDepth letto da file ini macchina
Private Const MIN_CUT_LEN As Double = 10.0
Private Const MAX_SIDE_ANG As Double = 60.0
' Costanti che indicano la modalità di acquisizione dei punti
@@ -429,7 +429,7 @@ Public Class SingleCutUC
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
' Verifico che l'affondamento impostato non sia superiore a quello massimo
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
Dim dDepth As Double = 0
StringToLen(DepthTxBx.Text, dDepth)
If dDepth < 0 Then
@@ -584,13 +584,15 @@ Public Class SingleCutUC
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
' lancio eventuale lua post-trasmissione
m_MainWindow.ExecSentProgScript( True)
m_MainWindow.ExecSentProgScript(True)
End If
#End If
End Sub
+3 -1
View File
@@ -371,8 +371,10 @@ Public Class SingleDrillUC
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
+3 -1
View File
@@ -287,8 +287,10 @@ Public Class SquaringUC
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
Return
End If
Dim sNameProg As Integer = 900
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
' Download programma (eventuali errori sono segnalati dalla funzione)
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
' copio il progetto corrente come progetto in lavorazione
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
+72 -30
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,26 +1181,43 @@ 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
' Aggiorno ambiente principale
EgtZoom(ZM.ALL)
' Elimino nome del componente precedente
m_sCompoName = String.Empty
' Reset inclinazioni
m_SideAngleUC.DeleteSideAngle()
' Chiudo compo interni nel caso siano aperti
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
Dim bExitPage As Boolean = GetPrivateProfileInt(S_GENERAL, K_QUITDRAWPAGE, 1, m_MainWindow.GetIniFile) <> 0
' Se Shift premuto eseguo il contrario
If Keyboard.Modifiers And ModifierKeys.Shift Then
bExitPage = Not bExitPage
End If
If bExitPage And m_MainWindow.FrameCutBtn.IsChecked Then
' Aggiorno ambiente principale
EgtZoom(ZM.ALL)
' Elimino nome del componente precedente
m_sCompoName = String.Empty
' Reset inclinazioni
m_SideAngleUC.DeleteSideAngle()
' Chiudo compo interni nel caso siano aperti
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
Else
m_SceneButtons.MeasureBtn.IsChecked = False
DrawPage_Unloaded(sender, e)
' Elimino nome del componente precedente
m_sCompoName = String.Empty
' Reset inclinazioni
m_SideAngleUC.DeleteSideAngle()
If String.IsNullOrEmpty(m_MainComponentPage.m_SecondaryComponentPage.m_sCurrCompo) Then
DrawPage_Loaded(sender, e)
Else
LoadSecondaryPage()
End If
End If
End Sub
' esco dalla pagina corrente
@@ -1489,17 +1509,39 @@ Public Class DrawPageUC
' Seleziono la Tab e la Page di apertura
Select Case m_ActiveComponentPage
Case Pages.MainComponent
LeftButtonGrd.Children.Remove( m_MainComponentPage)
LeftButtonGrd.Children.Remove(m_MainComponentPage)
Case Pages.SecondaryComponent
LeftButtonGrd.Children.Remove( m_MainComponentPage.m_SecondaryComponentPage)
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
Case Pages.InternalComponent
LeftButtonGrd.Children.Remove( m_MainWindow.m_DrawPageUC.m_CompoDimension.m_InternalCompoPage)
LeftButtonGrd.Children.Remove(m_MainWindow.m_DrawPageUC.m_CompoDimension.m_InternalCompoPage)
Case Pages.CompoDimension
VariablesGrd.Children.Remove( m_CompoDimension)
VariablesGrd.Children.Remove(m_CompoDimension)
Case Pages.SideAngle
VariablesGrd.Children.Remove( m_SideAngleUC)
Select Case m_SideAngleUC.m_Mode
Case SideAngleUC.ModeOpt.SIDEANGLE
SideAngleBtn.IsChecked = False
SideAngleBtn_Click(Nothing, Nothing)
Case SideAngleUC.ModeOpt.ENGRAVE
EngraveBtn.IsChecked = False
EngraveBtn_Click(Nothing, Nothing)
Case SideAngleUC.ModeOpt.DRIP
DripCutBtn.IsChecked = False
DripCutBtn_Click(Nothing, Nothing)
End Select
VariablesGrd.Children.Remove(m_SideAngleUC)
Case Pages.FiloTop
FiloTopBtn.IsChecked = False
FiloTopBtn_Click(Nothing, Nothing)
VariablesGrd.Children.Remove(m_FiloTopUC)
Case Pages.AlzFront
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
End Select
' Pulisco l'ambiente lua
+14 -11
View File
@@ -38,7 +38,7 @@ Public Class FiloTopUC
m_CallingPage = m_MainWindow.m_ActivePage
' Imposto messaggi
ParameterTxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 10) ' Offset
ParameterTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
Parameter3TxBl.Text = EgtMsg(91138)
@@ -46,10 +46,10 @@ Public Class FiloTopUC
' Imposto questa come pagina correntemente visualizzata nella drawpage
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.FiloTop
' Imposto contesto corrente
EgtSetCurrentContext( m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
ElseIf m_CallingPage = MainWindow.Pages.Import Then
' Imposto contesto corrente
EgtSetCurrentContext( m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
End If
' Gestisco visualizzazione dei parametri
@@ -58,9 +58,9 @@ Public Class FiloTopUC
Parameter3TxBl.Visibility = Windows.Visibility.Visible
' Aggiorno valori
m_dFiloTopOffset = GetPrivateProfileDouble( S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
ParameterTxBx.Text = LenToString( m_dFiloTopOffset, 3)
m_dFiloTopDepth = GetPrivateProfileDouble( S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
m_dFiloTopOffset = GetPrivateProfileDouble(S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
ParameterTxBx.Text = LenToString(m_dFiloTopOffset, 3)
m_dFiloTopDepth = GetPrivateProfileDouble(S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
Parameter2TxBx.Text = LenToString(m_dFiloTopDepth, 3)
m_bCornerradius = GetPrivateProfileInt(S_SIDES, K_ROUNDOFF, 0, m_MainWindow.GetIniFile()) <> 0
Parameter3ChBx.IsChecked = m_bCornerradius
@@ -81,8 +81,8 @@ Public Class FiloTopUC
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL
Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
EgtSetInfo( nLayId, INFO_OFFSET, m_dFiloTopOffset)
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtSetInfo(nLayId, INFO_OFFSET, m_dFiloTopOffset)
End If
nLayId = EgtGetNextLayer(nLayId)
End While
@@ -102,8 +102,8 @@ Public Class FiloTopUC
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
While nLayId <> GDB_ID.NULL
Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
EgtSetInfo( nLayId, INFO_DEPTH, m_dFiloTopDepth)
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtSetInfo(nLayId, INFO_DEPTH, m_dFiloTopDepth)
End If
nLayId = EgtGetNextLayer(nLayId)
End While
@@ -215,10 +215,13 @@ Public Class FiloTopUC
EgtErase(nLayFiloTop)
EgtRemoveInfo(nLayId, "FiloTopRef")
EgtOutLog("Error in generation OffsetPreView in TopEgde ")
Else
m_MainWindow.m_DrawPageUC.MessageTxBx.Text = ""
m_MainWindow.m_DrawPageUC.MessageBrd.Background = Brushes.Transparent
End If
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
End If
nLayId = EgtGetNextLayer(nLayId)
nLayId = EgtGetNextLayer(nLayId)
End While
nPartId = EgtGetNextPart(nPartId)
End While
+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*"/>
+29 -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)
@@ -357,6 +361,10 @@ Public Class ImportPageUC
Dim dScale As Double = If(m_bMM, ONEMM, ONEINCH)
' Importo file DXF
bOk = bOk AndAlso EgtImportDxf(sPath, dScale)
' riporto al piano tutte le superifici
EgtSelectAll()
EgtScale(GDB_ID.SEL, Frame3d.GLOB, 1, 1, 0)
EgtDeselectAll()
ElseIf m_nFileType = FT.NGE Then
' Carico Nge
bOk = bOk AndAlso EgtOpenFile(sPath)
@@ -415,7 +423,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 +577,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 +595,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 +604,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 +1058,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 +1081,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 +1112,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 +1133,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 +1164,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 +1183,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 +1211,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 +1233,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
+20 -4
View File
@@ -33,10 +33,26 @@ Public Class MainComponentPageUC
m_bIsFirstPage = True
LoadPage()
CurrentBtn = Nothing
Compo9.SetValue(Grid.ColumnProperty, 0)
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
ImageCompo9.Visibility = Windows.Visibility.Hidden
LabelCompo9.Visibility = Windows.Visibility.Visible
If m_MainWindow.FrameCutBtn.IsChecked Then
' se il numero delle componenti è superiore a 8 allora inserisco la seconda pagina
If GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 8 Then
OthersBackGr.Visibility = Visibility.Visible
Compo9.SetValue(Grid.ColumnProperty, 0)
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
ImageCompo9.Visibility = Windows.Visibility.Hidden
LabelCompo9.Visibility = Windows.Visibility.Visible
Else
OthersBackGr.Visibility = Visibility.Hidden
End If
Else
OthersBackGr.Visibility = Visibility.Visible
Compo9.SetValue(Grid.ColumnProperty, 0)
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
ImageCompo9.Visibility = Windows.Visibility.Hidden
LabelCompo9.Visibility = Windows.Visibility.Visible
End If
m_MainWindow.m_DrawPageUC.SideAngleBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
+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
+63
View File
@@ -0,0 +1,63 @@
<Window x:Class="LicenseWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
FontFamily="{DynamicResource OmagCut_Font}"
Title="OpenFile" Height="500.6" Width="426.6" WindowStyle="None"
ResizeMode="NoResize" ShowInTaskbar="False" AllowsTransparency="True"
Background="Transparent">
<Border Style="{DynamicResource OmagCut_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="5.5*"/>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3"
Orientation="Horizontal"
HorizontalAlignment="Center">
<TextBlock Name="IconTxBl" Foreground="White" FontSize="32"
VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Name="LicenseTxBl"
Foreground="White" FontSize="20"
VerticalAlignment="Center" HorizontalAlignment="Left"
TextWrapping="Wrap"/>
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal"
HorizontalAlignment="Center">
<ScrollViewer Name="MyScrollViewer" VerticalScrollBarVisibility="Auto">
<TextBlock Name="LicenseMsgTxBl" MaxWidth="340"
HorizontalAlignment="Center"
Foreground="{DynamicResource Omag_White}" FontSize="20" VerticalAlignment="Center"
TextWrapping="Wrap"/>
</ScrollViewer>
</StackPanel>
<Grid Grid.Column="1" Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}" IsCancel="True">
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</Window>
+37
View File
@@ -0,0 +1,37 @@
Public Class LicenseWindow
Private m_sMessage As String = String.Empty
Private m_sTitle As String = String.Empty
Public Sub New(Owner As Window, sMsg As String, sTitle As String)
Me.Owner = Owner
m_sMessage = sMsg
m_sTitle = sTitle
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
End Sub
Public Sub Init() Handles Me.Initialized
IconTxBl.Text = "⚠️"
LicenseTxBl.Text = "Warning" & vbCrLf & m_sTitle
m_sMessage = m_sMessage.Replace("/n", "£")
Dim sItems As String() = m_sMessage.Split("£")
For Index As Integer = 0 To sItems.Count - 1
If Index = 0 Then
m_sMessage = sItems(Index)
Else
m_sMessage &= vbCrLf & sItems(Index)
End If
Next
LicenseMsgTxBl.Text = m_sMessage
End Sub
Public Sub Exit_Click() Handles ExitBtn.Click
Me.Close()
End Sub
End Class
+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())
+47 -2
View File
@@ -1,6 +1,7 @@
Imports System.Collections.ObjectModel
Imports EgtWPFLib5
Imports EgtUILib
Imports System.IO
Public Class CurrentMachine
@@ -51,6 +52,10 @@ 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 = ""
' Gestione speciale per canali CN
Private m_sExtFileCN As String = ".0"
' Numero e tipo di utensili correntemente disponibili sulla macchina
Private m_MountedToolConfig As MountedToolConfigs = MountedToolConfigs.SAW
@@ -194,8 +199,15 @@ Public Class CurrentMachine
' Massimo numero di utensili su Tc manuale
Friend MAX_TCMAN_TOOLS As Integer = 60
' Massima profondità lavorabile nei tagli diretti
Private m_MaxTabDepth As Double = 10.0
#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
Friend ReadOnly Property MaxTabDepth As Double
Get
Return m_MaxTabDepth
End Get
End Property
Friend ReadOnly Property sMachineName As String
Get
@@ -316,7 +328,7 @@ Public Class CurrentMachine
Return m_bAskNewOnResend
End Get
End Property
Friend ReadOnly Property nProdLiSawProbe As Integer
Get
@@ -324,6 +336,24 @@ 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 ReadOnly Property sExtFileCN As String
Get
Return m_sExtFileCN
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 +818,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
@@ -1120,6 +1150,8 @@ Public Class CurrentMachine
m_sMachIniFile = m_MainWindow.GetMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
' Leggo estensione del file programma pezzo
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "xpi", m_sIsoFileExt, sMachIniFile)
' per gestione canali separati (macchina NUM con più di 5 Assi) ver. 2.5g1
GetPrivateProfileString(S_PARTPROGRAM, K_EXTFILECN, ".0", m_sExtFileCN, sMachIniFile)
If m_sIsoFileExt(0) <> "." Then m_sIsoFileExt = "." & m_sIsoFileExt
' Leggo flag incremento asse C
m_dDeltaC = GetPrivateProfileDouble(S_AXES, K_DELTA_C, 0.0, sMachIniFile)
@@ -1153,6 +1185,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
@@ -1360,6 +1399,12 @@ Public Class CurrentMachine
m_HasRawProbe = (GetPrivateProfileInt(S_MACH_PROBING, K_ENABLERAWPROBE, 1, sMachIniFile) <> 0)
' leggo se la macchina ha il lettore di codice a barre della lastra
m_nEnableBarCodeReader = GetPrivateProfileInt(S_MACH_BARCODEREADER, K_ENABLEBCR, 0, sMachIniFile)
' affonadamento massimo oltre la tavola (inidicata in positivo!)
m_MaxTabDepth = GetPrivateProfileDouble(S_MACH_NEST, "MaxTabDepth", 10.0, m_MainWindow.GetMachIniFile())
If m_MaxTabDepth < 0 Then
m_MaxTabDepth = 10.0
End If
End Sub
' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili
+90 -77
View File
@@ -7,110 +7,123 @@
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1280">
<!-- Definizione della ImportPage -->
<Border Background="{DynamicResource OmagCut_Gray}" >
<!-- Definizione della ImportPage -->
<Border Background="{DynamicResource OmagCut_Gray}" >
<Grid Name="ImportPageGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="7.5*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="4.5*"/>
</Grid.RowDefinitions>
<Grid Name="ImportPageGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="7.5*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="4.5*"/>
</Grid.RowDefinitions>
<GroupBox Name="CNModeGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.ColumnSpan="2" Margin="0,0,4,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<GroupBox Name="CNModeGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.ColumnSpan="2" Margin="0,0,4,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1.5*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<ToggleButton Name="AutoBtn" Grid.Column="0"
<ToggleButton Name="AutoBtn" Grid.Column="0"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
<ToggleButton Name="ManualBtn" Grid.Column="1"
<ToggleButton Name="ManualBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
<ToggleButton Name="MDIBtn" Grid.Column="2"
<ToggleButton Name="MDIBtn" Grid.Column="2"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
<ToggleButton Name="SingleBtn" Grid.Column="3"
<ToggleButton Name="SingleBtn" Grid.Column="3"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
<ToggleButton Name="HomeBtn" Grid.Column="4"
<ToggleButton Name="HomeBtn" Grid.Column="4"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
</Grid>
</Grid>
</GroupBox>
</GroupBox>
<GroupBox Name="CommandsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2" Grid.ColumnSpan="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<GroupBox Name="CommandsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="2" Grid.ColumnSpan="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="StopBtn" Grid.Column="1"
<Button Name="StartBtn" Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="StopBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="ResetBtn" Grid.Column="2"
<Button Name="ResetBtn" Grid.Column="2"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
</Grid>
</Grid>
</GroupBox>
</GroupBox>
<GroupBox Name="MDICommandGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1.5*"/>
</Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="MDITxBx" Margin="10,0,10,0" Style="{DynamicResource OmagCut_MDIKeyboardTextBox}"/>
<Button Name="MDIConfirmBtn" Grid.Column="1"
<Button Name="MDIConfirmBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
</Grid>
</Grid>
</GroupBox>
</GroupBox>
<GroupBox Name="PartProgTransferGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
<GroupBox Name="CameraHQ" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<ToggleButton Name="CameraHQBtn" Grid.Column="2"
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
Foreground="White"/>
</Grid>
</GroupBox>
<GroupBox Name="PartProgTransferGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
Grid.ColumnSpan="3">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<Button Name="DownloadBtn" Grid.Column="0"
<Button Name="DownloadBtn" Grid.Column="0"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="UploadBtn" Grid.Column="1"
<Button Name="UploadBtn" Grid.Column="1"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="ActivateBtn" Grid.Column="2"
<Button Name="ActivateBtn" Grid.Column="2"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<Button Name="DeleteBtn" Grid.Column="3"
<Button Name="DeleteBtn" Grid.Column="3"
Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
<EgtWPFLib:EgtTextBox Name="DULoadTxBx" Grid.Column="4" Width="100" Text="900.0"
<EgtWPFLib:EgtTextBox Name="DULoadTxBx" Grid.Column="4" Width="100" Text="900.0"
Style="{DynamicResource OmagCut_KeyboardTextBox}"/>
</Grid>
</GroupBox>
</Grid>
</GroupBox>
<GroupBox Name="PowerGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
Grid.Column="3" Grid.ColumnSpan="3" Margin="5,0,0,0">
@@ -131,18 +144,18 @@
</GroupBox>
<GroupBox Name="ErrorLstGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="3" Grid.ColumnSpan="4">
<ListBox Name="ErrorLstBx">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ListBox Name="ErrorLstBx">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</GroupBox>
</GroupBox>
</Grid>
</Grid>
</Border>
</Border>
</UserControl>
+37
View File
@@ -29,6 +29,7 @@ Public Class MachineCNPageUC
MDICommandGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 16)
PartProgTransferGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 17)
ErrorLstGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 12)
' Attivo gruppo PartProgTransferGpBx leggendo la variabile nel file ini
If GetPrivateProfileInt(S_GENERAL, K_TESTINGPAGE, 0, m_MainWindow.GetIniFile()) = 1 Then
PartProgTransferGpBx.Visibility = Windows.Visibility.Visible
@@ -44,6 +45,28 @@ Public Class MachineCNPageUC
Else
PowerGpBx.Visibility = Visibility.Collapsed
End If
' verifico che sia attiva la modalità per l'uso di due fotocamere
If GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ENABLE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
CameraHQ.Visibility = Visibility.Visible
CameraHQ.Header = "Photo on table"
CameraHQBtn.Content = "HQ"
' verifico quale camera è impostata
If GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
CameraHQBtn.IsChecked = True
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1HQ.png", UriKind.Relative))
End If
Else
CameraHQBtn.IsChecked = False
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1.png", UriKind.Relative))
End If
End If
Else
CameraHQ.Visibility = Visibility.Collapsed
End If
End Sub
Private Sub TestingPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -203,6 +226,20 @@ Public Class MachineCNPageUC
m_CN.DGeneralFunctions_WriteCncMode(8)
End Sub
Private Sub CameraHQBtn_Click(sender As Object, e As RoutedEventArgs) Handles CameraHQBtn.Click
Dim sEnableHQ As String = If(CameraHQBtn.IsChecked, "1", "0")
WritePrivateProfileString(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, sEnableHQ, m_MainWindow.GetMachIniFile())
If CameraHQBtn.IsChecked Then
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1HQ.png", UriKind.Relative))
End If
Else
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1.png", UriKind.Relative))
End If
End If
End Sub
Private Sub MDITxBx_KeyDown(sender As Object, e As KeyEventArgs) Handles MDITxBx.KeyDown
If e.Key = Key.Return Then
' leggo se stato reset
+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) & "%"
+1 -1
View File
@@ -208,7 +208,7 @@ Public Class MachiningDbPageUC
MillTool.Clear()
bFound = EgtTdbGetFirstTool(MCH_TF.MILL, sToolName, nType)
While bFound
If nType = MCH_TY.MILL_STD Then MillTool.Add( sToolName)
If nType = MCH_TY.MILL_STD And sToolName.Trim.ToLower <> "probe" Then MillTool.Add(sToolName)
bFound = EgtTdbGetNextTool(MCH_TF.MILL, sToolName, nType)
End While
PocketTool.Clear()
+10 -1
View File
@@ -695,7 +695,16 @@ Public Class ToolsDbPageUC
Dim ToolName As String = String.Empty
Dim bFound As Boolean = EgtTdbGetFirstTool(nTType, ToolName, nType)
While bFound
If nType = nTType Then ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
Dim nDebug As Integer = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_sIniFile)
If nType = nTType Then
If nTType <> MCH_TY.MILL_STD Then
' se utensile diverso da MILL
ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
ElseIf nTType <> MCH_TY.MILL_STD And ToolName.Trim.ToLower = "probe" And nDebug > 4 Then
' Se utensile MILL con nome "probe" aggiungo solo se livello debug maggiore di 4
ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
End If
End If
bFound = EgtTdbGetNextTool(nTType, ToolName, nType)
End While
ToolsList.Add(ToolCathegory)
+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>
+94 -39
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
@@ -323,13 +324,23 @@ Class MainWindow
Dim sNestKey As String = ""
EgtUILib.GetPrivateProfileString(S_LICENCE, K_NESTKEY, "", sNestKey, sLicFile)
EgtSetNestKey(sNestKey)
Dim bNetHwKey As Boolean = ( GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
EgtSetNetHwKey( bNetHwKey)
Dim bNetHwKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
EgtSetNetHwKey(bNetHwKey)
' Impostazioni per chiave di rete
Dim bNetKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
EgtSetNetHwKey(bNetKey)
Dim sLockId As String = ""
EgtUILib.GetPrivateProfileString(S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
If Not String.IsNullOrEmpty(sLockId) Then
EgtSetLockId(sLockId)
End If
' 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, 2512, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2512, 1, m_nKeyOptions)
' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Inizializzazione generale di EgtInterface
@@ -439,7 +450,7 @@ Class MainWindow
' abilito il bottone per la gestione del comando di Check-Up-Start (posziona lama prelavorazione)
If GetPrivateProfileInt(S_GENERAL, "Test", "0", m_sIniFile) = 0 OrElse
Not File.Exists( m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
Not File.Exists(m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Collapsed
Else
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Visible
@@ -553,14 +564,14 @@ Class MainWindow
' è permessa una sola istanza alla volta del programma OmagCUT -> "(1)" : "(" & nIstance.ToString & ")"
EgtPHOTOLib.MainData.SetUser(Environment.MachineName & "\" & Environment.UserName & " (1)")
Dim sIdKey As String = String.Empty
EgtGetKeyInfo(sIdKey)
EgtPHOTOLib.MainData.SetKey(sIdKey)
End If
Dim sIdKey As String = String.Empty
EgtGetKeyInfo(sIdKey)
EgtPHOTOLib.MainData.SetKey(sIdKey)
End If
End If
End If
' --------------------------------- SLAB DB -------------------------------------------------------
ExitBtn.ToolTip = "Exit" & vbCrLf & "Minimize (Shift)"
End Sub
Private Sub ManageSingleIstance()
@@ -633,6 +644,35 @@ Class MainWindow
m_IdleTimer.Interval = TimeSpan.FromMilliseconds(100)
m_IdleTimer.Start()
Dim sAssStatus As String = " discontinued"
Dim nAssLeftDays As Integer
If EgtGetKeyAssLeftDays(nAssLeftDays) And nAssLeftDays >= 0 Then
If nAssLeftDays > 30 Then
sAssStatus = "expires within " & nAssLeftDays.ToString() & " days"
ElseIf nAssLeftDays > 0 Then
sAssStatus = "to be renewed within " & nAssLeftDays.ToString() & " days"
Else
sAssStatus = "to be renewed by today"
End If
End If
' Or nAssLeftDays = 358
If (nAssLeftDays <= 7 And nAssLeftDays >= 0) Or nAssLeftDays = 14 Or nAssLeftDays = 21 Or nAssLeftDays = 28 Then
'Dim sText As String = "Fai ammenda," & vbCrLf & "gli aggiornamenti sono in fase di scadenza!"
'Dim sTitle As String = "⚠️ Warning!"
'Dim MissingKeyWnd As New EgtMsgBox(Me, sTitle, sText, EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
' finestra Custom
Dim sMsg As String = EgtMsg(91141)
Dim sAssistance As String = String.Empty
GetPrivateProfileString(S_GENERAL, "Assistances", "", sAssistance, GetIniFile)
Dim sItems As String() = sAssistance.Split(","c)
For Each Item As String In sItems
sMsg &= "" & Item.Trim & " /n"
Next
Dim MyLicWn As New LicenseWindow(Me, sMsg, "Assistance " & sAssStatus)
MyLicWn.Show()
End If
' inizilizzo
End Sub
@@ -997,6 +1037,16 @@ Class MainWindow
' Se già visualizzato errore, lo nascondo
If m_CurrentProjectPageUC.OutMessageBrd.IsMouseOver Then
m_CurrentProjectPageUC.ClearMessage()
' se è premuto il pulsante Shift allora provvedo ad aprire il file di Log
If Keyboard.Modifiers And ModifierKeys.Shift Then
' Genero file CNC (lancio anche se errore in precedenza)
Dim sTemoDirect As String = GetTempDir() & "\OmagCUTLog.txt"
Try
Process.Start("Notepad.exe", sTemoDirect)
Catch ex As Exception
EgtOutLog(ex.ToString)
End Try
End If
End If
' Condizioni che impediscono di clickare fuori dalla calcolatrice o tastiera quando una di queste è aperta
If EgtWPFLib.EgtCalculator.GetbIsActive Then
@@ -1087,9 +1137,9 @@ Class MainWindow
m_CurrentProjectPageUC.SaveNamedProject()
m_CurrentProjectPageUC.SaveProject()
End If
' Inizio la chiusura del programma (verifico di aver terminato il processo DripFeed)
' Inizio la chiusura del programma (se NUM_OLD verifico di aver terminato il processo DripFeed)
EgtOutLog("Iniziato processo di chiusura programma")
m_IsClosingApplication = 1
m_IsClosingApplication = If( m_CNCommunication.m_nNCType = 1, 1, 2)
Dim nCount As Integer = 0
While m_IsClosingApplication <> 2
If nCount > 5 Then
@@ -1216,7 +1266,7 @@ Class MainWindow
Private Sub MainWindow_ContentRendered(sender As Object, e As EventArgs) Handles Me.ContentRendered
' Verifico presenza del collegamento al CN
m_bNCLink = (GetPrivateProfileInt(S_GENERAL, K_CNLINK, 0, m_sIniFile) <> 0) And
Not GetKeyOption( KEY_OPT.OFFICE_TYPE)
Not GetKeyOption(KEY_OPT.OFFICE_TYPE)
m_CNCommunication.CNCommunication_Initialization()
' Se linea di produzione abilitata e collegata, lancio relativo timer
If m_bNCLink And m_CurrentMachine.bProdLine Then
@@ -1232,6 +1282,7 @@ Class MainWindow
m_CurrentProjectPageUC.StartProgram()
' aggiorno la grafica
EgtZoom(ZM.ALL, True)
End Sub
Friend Sub EgtWPFInit()
@@ -1293,7 +1344,9 @@ Class MainWindow
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjFinished, 1)
Dim nVarFin As Integer = 0
For I As Integer = 1 To 4
System.Threading.Thread.Sleep(50)
If Not m_CurrentMachine.bDemo Then
System.Threading.Thread.Sleep(50)
End If
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
nVarFin = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
Exit For
@@ -1306,11 +1359,11 @@ Class MainWindow
' Salvo in INI indice del progetto terminato
WritePrivateProfileString(S_GENERAL, K_LASTPROJFINISHED, nVarFin.ToString("D4"), GetIniFile())
' Salvo in INI data e ora attuali di termine lavorazione del progetto (solo gli ultimi 10 tramite modulo)
Dim sKey As String = K_DATETIMEFINISHED & "." & ( nVarFin Mod 10).ToString()
Dim sKey As String = K_DATETIMEFINISHED & "." & (nVarFin Mod 10).ToString()
Dim sDateTime As String = My.Computer.Clock.LocalTime.ToString("dd.MM.yyyy HH\:mm\:ss")
WritePrivateProfileString(S_GENERAL, sKey, sDateTime, GetIniFile())
' Eseguo script
ExecFinishedProgScript( nVarFin, sDateTime)
ExecFinishedProgScript(nVarFin, sDateTime)
End If
End If
' Se OmagVIEW blocca, esco (riproverò al prossimo giro)
@@ -1346,16 +1399,18 @@ Class MainWindow
' Se richieste modalità standard o speciali
If m_CurrentMachine.nSaveProduced <> 3 Then
StandardAndSpecialViewFileManagement()
' altrimenti modalità custom
' altrimenti modalità custom
Else
CustomViewFileManagement( nProjInd)
CustomViewFileManagement(nProjInd)
End If
' Leggo variabile con indice progetto da copiare per OmagVIEW (standard E80025)
m_CNCommunication.m_CN.n_DReadELS_handle = 0
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjCopy, 1)
Dim nVarCopy As Integer = 0
For I As Integer = 1 To 10
System.Threading.Thread.Sleep(50)
If Not m_CurrentMachine.bDemo Then
System.Threading.Thread.Sleep(50)
End If
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
nVarCopy = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
Exit For
@@ -1556,7 +1611,7 @@ Class MainWindow
nNewProjInd -= 1
End While
End If
' se altrimenti richiesto progetto successivo
' se altrimenti richiesto progetto successivo
ElseIf nMove > 0 Then
nNewProjInd = nProjInd + 1
If nProjInd > nLastProj Then
@@ -1657,7 +1712,7 @@ Class MainWindow
Catch ex As Exception
EgtOutLog("Error erasing " & sDestEplFile)
End Try
' altrimenti, ogni commessa ha il suo file dei pezzi rovinati
' altrimenti, ogni commessa ha il suo file dei pezzi rovinati
Else
' Sposto nel direttorio temporaneo
Dim sDestEplFile = m_sTempDir & "\" & CURR_PROJ_EPL
@@ -1767,7 +1822,7 @@ Class MainWindow
Return True
End Function
Private Function CustomViewFileManagement( nProjInd As Integer) As Boolean
Private Function CustomViewFileManagement(nProjInd As Integer) As Boolean
' Se non esiste file EPL, esco
Dim sSouEplFile As String = m_CurrentMachine.sLineDataDir & "\" & CURR_PROJ_EPL
If Not My.Computer.FileSystem.FileExists(sSouEplFile) Then Return True
@@ -1806,7 +1861,7 @@ Class MainWindow
' Verifico progetto restituito da View
If nProjInd = 0 Then nProjInd = nLastCopy
' Leggo variabile con data termine lavorazione
Dim sKey As String = K_DATETIMEFINISHED & "." & ( nProjInd Mod 10).ToString()
Dim sKey As String = K_DATETIMEFINISHED & "." & (nProjInd Mod 10).ToString()
GetPrivateProfileString(S_GENERAL, sKey, sDateTime, sDateTime, GetIniFile())
' Recupero direttorio per pezzi rovinati
Dim sRuPartsDir As String = GetRuinedPartsDir()
@@ -1833,7 +1888,7 @@ Class MainWindow
Return True
End Function
Friend Function ExecSentProgScript( bDirectCut As Boolean, Optional bAlreadySent As Boolean = False) As Boolean
Friend Function ExecSentProgScript(bDirectCut As Boolean, Optional bAlreadySent As Boolean = False) As Boolean
' Verifico esistenza script
Dim sLuaPath As String = m_CurrentMachine.sMachDir() & "\Scripts\SentProg.lua"
If Not My.Computer.FileSystem.FileExists(sLuaPath) Then Return True
@@ -1852,8 +1907,8 @@ Class MainWindow
End If
EgtLuaResetGlobVar("SPS")
If nErr <> 0 Then
EgtOutLog("Error in SentProg : " & nErr.ToString())
m_CurrentProjectPageUC.SetErrorMessage(EgtMsg(90325)) 'Errore nel salvataggio delle statistiche
EgtOutLog("Error in SentProg : " & nErr.ToString())
m_CurrentProjectPageUC.SetErrorMessage(EgtMsg(90325)) 'Errore nel salvataggio delle statistiche
End If
Return (nErr = 0)
End Function
@@ -1935,15 +1990,15 @@ Class MainWindow
End If
' Dichiaro progetto passato da View
If nProjInd = m_CurrentProjectPageUC.GetCurrentProject() Then
EgtSetInfo( EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
Else
Dim nTmpCtx As Integer = EgtInitContext()
If nTmpCtx <> 0 Then
Dim sNgeFile As String = GetSaveDir() & "\" & nProjInd.ToString("D4") & ".nge"
EgtOpenFile( sNgeFile)
EgtSetInfo( EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
EgtSaveFile( sNgeFile, NGE.CMPTEXT)
EgtDeleteContext( nTmpCtx)
EgtOpenFile(sNgeFile)
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_UNLOADSAVED, 1)
EgtSaveFile(sNgeFile, NGE.CMPTEXT)
EgtDeleteContext(nTmpCtx)
EgtSetCurrentContext(m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
End If
End If
@@ -1977,21 +2032,21 @@ Class MainWindow
' Evento che apre AboutBox quando viene clickato il logo
Private Sub LogoBrd_MouseDown(sender As Object, e As MouseButtonEventArgs) Handles LogoBrd.MouseDown
' Se non premuto Shift -> AboutBox
If ( Keyboard.Modifiers And ModifierKeys.Shift) = 0 Then
Dim AboutBox As New AboutBoxWD( Me)
' Altrimenti lancio cambio macchina (solo uso interno)
If (Keyboard.Modifiers And ModifierKeys.Shift) = 0 Then
Dim AboutBox As New AboutBoxWD(Me)
' Altrimenti lancio cambio macchina (solo uso interno)
Else
If m_ActivePage = Pages.CadCut Or m_ActivePage = Pages.FrameCut Then
' Cambio macchina
EgtLuaCreateGlobTable( "CHM")
EgtLuaExecFile( GetConfigDir() & "\ChangeMachine.lua")
EgtLuaCreateGlobTable("CHM")
EgtLuaExecFile(GetConfigDir() & "\ChangeMachine.lua")
Dim nRestart As Integer = 0
EgtLuaGetGlobIntVar( "CHM.RESTART", nRestart)
EgtLuaResetGlobVar( "CHM")
EgtLuaGetGlobIntVar("CHM.RESTART", nRestart)
EgtLuaResetGlobVar("CHM")
' Riavvio
If nRestart = 1 Then
Close()
Process.Start( Application.ResourceAssembly.Location)
Process.Start(Application.ResourceAssembly.Location)
End If
End If
End If
+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.2")>
<Assembly: AssemblyFileVersion("2.5.5.2")>
<Assembly: AssemblyVersion("2.5.12.4")>
<Assembly: AssemblyFileVersion("2.5.12.4")>
+36 -3
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,33 @@ 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
Dim fs As FileStream = File.Create(m_MainWindow.m_CurrentMachine.sClickDir & "\NewClick.txt")
' chiudo il file creato
fs.Close()
' 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
@@ -599,8 +630,8 @@ Public Class CNCommunication
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LimitZChanged(m_CN.bLimitZState)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.FiveAxisStateChanged(m_CN.Is_G24_active())
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ParkingStateChanged(m_CN.bParkingState)
'm_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ZoneStateChanged(m_CN.nEnableZone)
'm_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.PcStateChanged(m_CN.nEnablePc)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ZoneStateChanged(m_CN.nEnableZone)
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.PcStateChanged(m_CN.nEnablePc)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumUpChanged(m_CN.bVacuumUp)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumDownChanged(m_CN.bVacuumDown)
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum2UpChanged(m_CN.bVacuum2Up)
@@ -654,6 +685,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)
@@ -1135,7 +1167,8 @@ Public Class CNCommunication
bOk = (m_nNCType > 0)
Dim sNumProg As String = String.Empty
If m_nNCType = 1 Or m_nNCType = 2 Then
sNumProg = "%" & nNumProg.ToString() & ".0"
Dim sExtFileCN As String = m_MainWindow.m_CurrentMachine.sExtFileCN
sNumProg = "%" & nNumProg.ToString() & sExtFileCN
Else
sNumProg = nNumProg.ToString()
End If
+1 -1
View File
@@ -144,7 +144,7 @@ Public Class CN_Siemens
End Select
Else
' per verificare che la comunicazione funzioni correttamente
EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
' EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
Return M_MMFiles.read_active_mode()
'Return CShort(M_MMFiles.SiemensRet.n_param2)
End If
+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)
+31 -3
View File
@@ -115,6 +115,9 @@
<Reference Include="AxInterop.FXLib">
<HintPath>..\..\EgtProg\OmagCUT\AxInterop.FXLib.dll</HintPath>
</Reference>
<Reference Include="DotNetZip">
<HintPath>..\..\EgtProg\OmagCUT\DotNetZip.dll</HintPath>
</Reference>
<Reference Include="EgtPHOTOLib">
<HintPath>..\..\EgtProg\Dll32\EgtPHOTOLib.dll</HintPath>
</Reference>
@@ -142,9 +145,6 @@
<HintPath>..\..\EgtProg\OmagCUT\Interop.FXServer.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Ionic.Zip">
<HintPath>..\..\EgtProg\OmagCUT\Ionic.Zip.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework.Aero" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.112.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">
@@ -209,6 +209,9 @@
<Compile Include="DrawImport\UnderDrillUC.xaml.vb">
<DependentUpon>UnderDrillUC.xaml</DependentUpon>
</Compile>
<Compile Include="LicenseWindow.xaml.vb">
<DependentUpon>LicenseWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Machine\AlarmsPageUC.xaml.vb">
<DependentUpon>AlarmsPageUC.xaml</DependentUpon>
</Compile>
@@ -485,6 +488,10 @@
<SubType>Designer</SubType>
<Generator>XamlIntelliSenseFileGenerator</Generator>
</Page>
<Page Include="LicenseWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Machine\AlarmsPageUC.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -1340,6 +1347,27 @@
<ItemGroup>
<Resource Include="Resources\NewIcons\RefTab.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\PhotoHQ.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\icone-tagli-1HQ.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ImportPageListBoxImages\4.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ImportPageListBoxImages\5.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\Muovi-grezzo.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\ON_OFF-REG.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\Move-Spot-Reg.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+3
View File
@@ -171,6 +171,7 @@
<BitmapImage x:Key="Vein-matchImg" UriSource="Resources/NewIcons/Vein-match.png"></BitmapImage>
<BitmapImage x:Key="Test-lamaImg" UriSource="Resources/NewIcons/Test-lama.png"></BitmapImage>
<BitmapImage x:Key="Parcheggia-pezzoImg" UriSource="Resources/NewIcons/Parcheggia-pezzo.png"></BitmapImage>
<BitmapImage x:Key="Muovi-grezzoImg" UriSource="Resources/NewIcons/Muovi-grezzo.png"></BitmapImage>
<BitmapImage x:Key="Inserisci-pezzoImg" UriSource="Resources/NewIcons/Inserisci-pezzo.png"></BitmapImage>
<BitmapImage x:Key="Elimina-pezzoImg" UriSource="Resources/NewIcons/Elimina-pezzo.png"></BitmapImage>
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
@@ -225,6 +226,7 @@
<BitmapImage x:Key="QualityWJImg" UriSource="Resources/NewIcons/Quality.png"></BitmapImage>
<BitmapImage x:Key="Fine-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Fine-allunga-o-accorcia.png"></BitmapImage>
<BitmapImage x:Key="ON_OFF-singolo-taglioImg" UriSource="Resources/NewIcons/ON_OFF-singolo-taglio.png"></BitmapImage>
<BitmapImage x:Key="ON_OFF-REGImg" UriSource="Resources/NewIcons/ON_OFF-REG.png"></BitmapImage>
<BitmapImage x:Key="Tutti-ONImg" UriSource="Resources/NewIcons/Tutti-ON.png"></BitmapImage>
<BitmapImage x:Key="Tutti-OFFImg" UriSource="Resources/NewIcons/Tutti-OFF.png"></BitmapImage>
<BitmapImage x:Key="Inizio-Centro-FuoriImg" UriSource="Resources/NewIcons/Inizio-centro-fuori.png"></BitmapImage>
@@ -240,6 +242,7 @@
<BitmapImage x:Key="Tutti-allungaImg" UriSource="Resources/NewIcons/Tutti-allunga.png"></BitmapImage>
<BitmapImage x:Key="Tutti-accorciaImg" UriSource="Resources/NewIcons/Tutti-accorcia.png"></BitmapImage>
<BitmapImage x:Key="LastProjImg" UriSource="Resources/NewIcons/PlayStep.png"></BitmapImage>
<BitmapImage x:Key="Move-Spot-RegImg" UriSource="Resources/NewIcons/Move-Spot-Reg.png"></BitmapImage>
<FontFamily x:Key="OmagCut_Font">./Resources/Fonts/#Century Gothic</FontFamily>
+2
View File
@@ -1304,6 +1304,8 @@ Public Class OptionsPageUC
End If
Try
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
zip.AlternateEncodingUsage = Ionic.Zip.ZipOption.Always
zip.AlternateEncoding = Text.Encoding.UTF8
' aggiungo file macchine
For Each sMachineName As String In Machines
Dim sMachineDir As String = m_MainWindow.GetMachinesRootDir() & "\" & sMachineName
+14 -2
View File
@@ -434,7 +434,10 @@ Public Class CurrentProjectPageUC
End If
' Se valore cambiato, aggiorno...
Dim dDeltaZ As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable - dCurrAddTab
If Math.Abs(dDeltaZ) > EPS_SMALL Or bForced Then
Dim bChanged As Boolean = ( Math.Abs(dDeltaZ) > EPS_SMALL)
If bChanged Or bForced Then
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If Not bChanged AndAlso bOldEnMod Then EgtDisableModified()
AddAdditionalTable()
UpdateAllRawsZ(dDeltaZ)
If GetPhoto() <> GDB_ID.NULL Then
@@ -450,6 +453,7 @@ Public Class CurrentProjectPageUC
End While
End If
End If
If Not bChanged AndAlso bOldEnMod Then EgtEnableModified()
End If
Return True
End Function
@@ -1373,7 +1377,14 @@ Public Class CurrentProjectPageUC
Friend Sub SetAreasStatus( bShow As Boolean)
Dim nMarkId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK)
If nMarkId = GDB_ID.NULL Then Return
' Disabilito impostazione modificato
Dim bOldEnMod As Boolean = EgtGetEnableModified()
If bOldEnMod Then EgtDisableModified()
' Cambio stato visualizzazione
EgtSetStatus( nMarkId, If( bShow, GDB_ST.ON_, GDB_ST.OFF))
' Se necessario riabilito impostazione modificato
If bOldEnMod Then EgtEnableModified()
End Sub
' Gestione messaggi in interfaccia
@@ -1400,7 +1411,8 @@ Public Class CurrentProjectPageUC
Friend Sub ClearMessage()
OutMessageBrd.Background = Brushes.Transparent
OutMessageBrd.Visibility = Windows.Visibility.Hidden
OutMessageTxBl.Text = ""
'OutMessageBrd.Visibility = Windows.Visibility.Hidden
End Sub
End Class
+4
View File
@@ -100,6 +100,10 @@ Public Class OpenPageUC
LoadCurrDir()
m_bFirst = False
Else
GetPrivateProfileString(S_SLABDXF, K_SLABLAYER, "SlabBoundary", m_sSlabLayer, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_SLABDXF, K_PARTSLAYER, "Counters", m_sPartsLayer, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_SLABDXF, K_SCRAPLAYER, "ReservedAreaBoundary", m_sScrapLayer, m_MainWindow.GetIniFile())
m_dSlabThick = GetPrivateProfileDouble(S_SLABDXF, K_STDTHICK, 20, m_MainWindow.GetIniFile())
EgtSetCurrentContext(OpenScene.GetCtx())
End If
' Pulisco tutto
+188 -3
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()
@@ -259,10 +266,14 @@ Public Class ProjectMgrUC
ResetAllStartCurv()
' cancello tutti i ponticelli disegnati
ResetAllBRidges()
' cancella tutti i tagli di separazione inseriti in OFFICE
ResetAllSplitCut()
' Ricalcolo tutte le lavorazioni
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)
@@ -508,7 +519,6 @@ Public Class ProjectMgrUC
' apro la finestra con l'elenco degli sfridi
Dim MyScrapsWD As New ScrapsWD(m_MainWindow, Me, NewScrapsList)
MyScrapsWD.ShowDialog()
End If
' ------------------ FINE gestione SCRAPS -----------------------------
@@ -578,6 +588,13 @@ Public Class ProjectMgrUC
EgtDraw()
' Dichiaro che il progetto è nuovo
bAlreadySent = False
' reimposto tutti gli sfridi come nuovi sfridi
Dim CurrScrapsList As New List(Of Scrap)
' procedo all'aggiornamento della lista degli sfridi
UpDateScrapList(CurrScrapsList)
For Each ItemScrap As Scrap In CurrScrapsList
ItemScrap.ResetState()
Next
End If
End If
If bAlreadySent Then
@@ -588,6 +605,18 @@ Public Class ProjectMgrUC
End If
End If
' ------------------ INIZIO gestione SCRAPS ---------------------------
Dim NewScrapsList As New List(Of Scrap)
' procedo all'aggiornamento della lista degli sfridi
UpDateScrapList(NewScrapsList)
' se esiste almeno uno sfrido da inserire come nuovo grezzo
If NewScrapsList.Count > 0 Then
' apro la finestra con l'elenco degli sfridi
Dim MyScrapsWD As New ScrapsWD(m_MainWindow, Me, NewScrapsList)
MyScrapsWD.ShowDialog()
End If
' ------------------ FINE gestione SCRAPS -----------------------------
' Se non collegato alla macchina
If Not m_MainWindow.m_bNCLink Then
' salvo il progetto corrente incrementando il valore del progetto
@@ -709,6 +738,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)
@@ -849,6 +984,7 @@ Public Class ProjectMgrUC
ResetCutBtn.Visibility = Windows.Visibility.Hidden
SimulateBtn.Visibility = Windows.Visibility.Hidden
WorkBtn.Visibility = Windows.Visibility.Hidden
If TestBtn.Visibility = Windows.Visibility.Visible Then TestBtn.Visibility = Windows.Visibility.Hidden
' Nascondo bottoni CadCutPageUC
m_MainWindow.m_CadCutPageUC.PhotoBtn.Visibility = Windows.Visibility.Hidden
m_MainWindow.m_CadCutPageUC.RawPartBtn.Visibility = Windows.Visibility.Hidden
@@ -864,6 +1000,18 @@ Public Class ProjectMgrUC
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Hidden
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Hidden
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Hidden
' nuovi bottoni pagina di Nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRettanleBtn.Visibility = Windows.Visibility.Hidden
If m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Visible Then
m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Hidden
End If
' Nascondo bottoni rawpage
m_MainWindow.m_RawPartPage.OtherRefTabBtn.Visibility = Windows.Visibility.Hidden
' Rendo visibili i bottoni per la definizione degli Spotreg
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Visible
m_MainWindow.m_CadCutPageUC.m_NestPage.UG1_Reg.Visibility = Visibility.Visible
' Deseleziono tutto
EgtDeselectAll()
' Se c'è la foto devo sistemare
@@ -895,8 +1043,15 @@ Public Class ProjectMgrUC
End If
' Visualizzo step adatti alla scelta fatta
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
' Cancello eventuali messaggi di errore/avvertimento
m_CurrProjPage.ClearMessage()
' visualizzo i punti di SpotReg
EgtSetStatus(m_MainWindow.m_CadCutPageUC.m_NestPage.m_nRegGroupId, GDB_ST.ON_)
' eventualmente risistemo tutti i punti Spotreg in funzione dell'altezza del grezzo
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateSpotRegistration()
EgtDraw()
End Sub
Private Sub RegisterBtn_Unchecked(sender As Object, e As RoutedEventArgs) Handles RegisterBtn.Unchecked
@@ -924,6 +1079,7 @@ Public Class ProjectMgrUC
m_MainWindow.m_CadCutPageUC.DrawBtn.Visibility = Windows.Visibility.Visible
m_MainWindow.m_CadCutPageUC.ImportBtn.Visibility = Windows.Visibility.Visible
m_MainWindow.m_CadCutPageUC.SplitBtn.Visibility = Windows.Visibility.Visible
If TestBtn.Visibility = Windows.Visibility.Hidden Then TestBtn.Visibility = Windows.Visibility.Visible
' Visualizzo bottoni nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.m_bRegister = False
m_MainWindow.m_CadCutPageUC.m_NestPage.MaximizeMoveBtn.IsEnabled = True
@@ -933,6 +1089,22 @@ Public Class ProjectMgrUC
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Visible
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Visible
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Visible
' nuovi bottoni pagina di Nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRettanleBtn.Visibility = Windows.Visibility.Visible
If m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Hidden Then
m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Visible
End If
' disabilito i comandi per gestioen SpotReg
m_MainWindow.m_CadCutPageUC.m_NestPage.PointRegCheckedOff()
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Hidden
m_MainWindow.m_CadCutPageUC.m_NestPage.UG1_Reg.Visibility = Visibility.Hidden
' Nascondo bottoni rawpage
m_MainWindow.m_RawPartPage.OtherRefTabBtn.Visibility = Windows.Visibility.Visible
' Nascondo i bottoni per la definizione degli Spotreg
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Hidden
' Se c'è la foto devo sistemare
If m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then
' Recupero il riferimento originale del primo grezzo
@@ -977,6 +1149,11 @@ Public Class ProjectMgrUC
End If
' Visualizzo step adatti alla scelta fatta
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
' nascondi i punti di SpotReg
EgtSetStatus(m_MainWindow.m_CadCutPageUC.m_NestPage.m_nRegGroupId, GDB_ST.OFF)
EgtDraw()
' Cancello eventuali messaggi di errore/avvertimento
m_CurrProjPage.ClearMessage()
End Sub
@@ -988,6 +1165,7 @@ Public Class Scrap
Private m_iPictureID As Integer
Private m_sName As String
Private m_IdRaw As Integer
' nState=1 -> da inserire in DB, nState=2 -> già inserito in DB
Private m_nState As Integer
Public Property PictureID() As Integer
@@ -1020,9 +1198,16 @@ Public Class Scrap
End Get
End Property
Public ReadOnly Property PictureString() As String
Public Sub ResetState(Optional nNewState As Integer = 1)
m_nState = nNewState
EgtSetInfo(m_IdRaw, K_ISNEWSCRAPS, nNewState)
EgtRemoveInfo(m_IdRaw, K_DATABASEID)
End Sub
Public ReadOnly Property PreviewState As System.Windows.Media.Imaging.BitmapImage
Get
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
Dim sPath As String = "/Resources/ImportPageListBoxImages/" & PictureID.ToString() & ".png"
Return New System.Windows.Media.Imaging.BitmapImage(New Uri(sPath, UriKind.Relative))
End Get
End Property
+19 -3
View File
@@ -22,10 +22,26 @@
</Grid.RowDefinitions>
<Label Name="TitleTxBl" Grid.Column="1" Grid.Row="1" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
<ListBox Name="ScrapsListBox" Grid.Column="1" Grid.Row="2" ItemTemplate="{DynamicResource DataTemplateItem}"
ItemsSource="{Binding ItemList, NotifyOnSourceUpdated=True}"/>
<ListBox Name="ScrapsListBox" Grid.Column="1" Grid.Row="2">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<Image Source="{Binding PreviewState}" VerticalAlignment="Center"
MaxWidth="50" MaxHeight="50"
Stretch="Uniform" Grid.Column="0" />
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"
Grid.Column="1"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="1" Grid.Row="4">
<Grid Grid.Column="1" Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="1*"/>
+16
View File
@@ -205,6 +205,12 @@ Public Class Camera
Dim nInd As Integer = 1
If m_nCameraCount = 2 Then
nInd = GetCurrentTable()
' verifico se la macchina è configurata per fotocamera sulla tavola di lavoro
If (GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ENABLE, 0, m_MainWindow.GetMachIniFile()) <> 0) AndAlso
(GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, 0, m_MainWindow.GetMachIniFile()) <> 0) Then
' forzo l'utilizzo della seconda camera (sopra alla tavola di lavoro)
nInd = 2
End If
If nInd <> 1 And nInd <> 2 Then Return 0
End If
' Se gestore macchina non attivo, lo lancio in modo cieco
@@ -315,6 +321,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
+10 -2
View File
@@ -362,6 +362,8 @@ Public Class RawPartPageUC
OtherRefTabChBx.Visibility = Visibility.Collapsed
OtherRefTabTxBl.Visibility = Visibility.Collapsed
Return
Else
OtherRefTabBtn.Visibility = Visibility.Visible
End If
m_bOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_OTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
m_OtherRefTabX = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, 0, m_MainWindow.GetIniFile())
@@ -1420,7 +1422,7 @@ Public Class RawPartPageUC
Dim nExit As Integer = 0
EgtGetCalcTool(sTool, sHead, nExit)
' Imposto come testa corrente il laser (senza utensile ovviamente)
If Not EgtSetCalcTool("", "H3", 1) Then
If Not EgtSetCalcTool("", LASER_HEAD, 1) Then
Return False
End If
' Trasformo in posizione punta utensile in basso
@@ -1432,6 +1434,10 @@ Public Class RawPartPageUC
' Porto il tip nell'origine tavola
ptAcquired = ptTipP1
ptAcquired.ToLoc(New Frame3d(m_ptTableMin))
EgtOutLog("Actual axis laser H3: L1=" & dL1.ToString & ", L2=" & dL2.ToString & ", L3=" & dL3.ToString &
", R1=" & dR1.ToString & ", R2=" & dR2.ToString)
EgtOutLog("Actual pos laser H3: " & ptTipP1.x.ToString & "," & ptTipP1.y.ToString & "," & ptTipP1.z.ToString &
"; on table: " & ptAcquired.x.ToString & "," & ptAcquired.y.ToString & "," & ptAcquired.z.ToString)
Return True
End Function
@@ -1449,6 +1455,8 @@ Public Class RawPartPageUC
EgtGetCalcTool(sTool, sHead, nExit)
' Trasformo in posizione punta utensile in basso
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, ptTipP1) Then
EgtOutLog("Actual pos " & sHead & ": L1=" & dL1.ToString & ", L2=" & dL2.ToString & ", L3=" & dL3.ToString &
", R1=" & dR1.ToString & ", R2=" & dR2.ToString)
Return False
End If
' Porto il tip nell'origine tavola
@@ -2060,6 +2068,7 @@ Public Class RawPartPageUC
End Sub
Public Sub RefTabModeChange()
If Not m_bOtherRefTab Then Return
MoveRawToMaiRefTab()
MoveRawToOtherRefTab()
UpdateRefTabDraw()
@@ -2851,7 +2860,6 @@ Public Class RawPartPageUC
End If
EgtDraw()
'EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyTest.nge", NGE.BIN)
Return True
End Function
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

+2 -2
View File
@@ -240,10 +240,10 @@
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="GenerateCN_Btn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="GenerateXPIUC_Click">
<Button Name="GenerateCN_Btn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="GenerateCN_Click">
<Image Source="{DynamicResource GenerateCNImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
</Button>
<Button Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="ExitBtnUC_Click">
<Button Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="ExitBtn_Click">
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
</Button>
+28 -90
View File
@@ -77,7 +77,7 @@ Public Class SimulationPageUC
End If
' Pulsante Play
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Play.png", UriKind.Relative))
' abilito la visualizzazione del pulsante per la sola generazione del codice CN
' abilito la visualizzazione del pulsante per la generazione del codice CN (se previsto)
If GetPrivateProfileInt(S_GENERAL, K_GENERATECN, 0, m_MainWindow.GetIniFile()) <> 0 Then
GenerateCN_Btn.Visibility = Visibility.Visible
Else
@@ -535,7 +535,7 @@ Public Class SimulationPageUC
End If
End Sub
Private Sub ExitBtnUC_Click(sender As Object, e As RoutedEventArgs)
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs)
' Mi assicuro di terminare la simulazione
ResetSimulation()
' Nascondo tutte le lavorazioni
@@ -566,62 +566,23 @@ Public Class SimulationPageUC
End Sub
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
' eventualmente fermo la simulazione
Private Sub GenerateCN_Click(sender As Object, e As RoutedEventArgs)
' 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
' 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
Dim bOk As Boolean = True
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Elimino eventuale attrezzaggio da OmagOFFICE
EgtEraseCurrSetup()
' Verifico l'attrezzaggio degli utensili utilizzati
Dim sMissingTools As String = String.Empty
If Not VerifySetup(sMissingTools) Then
m_CurrProjPage.SetErrorMessage(EgtMsg(90322) & " " & sMissingTools) 'Mancano gli utensili : ...
' Se versione ufficio non genero
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
m_CurrProjPage.SetWarningMessage("Office Version")
Return
End If
' Costringo ad aggiornare UI
UpdateUI()
' Aggiorno flag per lavaggio
m_CurrProjPage.UpdateWashingFlag()
' Aggiorno flag per tastatura per tagli con angolo di fianco
m_CurrProjPage.UpdateSideAngCutProbeFlag()
' Se pezzi piani e non c'è ordine delle lavorazioni, ricalcolo tutto e ne faccio uno automatico
Dim nPrjType As Integer = m_CurrProjPage.GetCurrentProjectType()
Dim bDirectCut As Boolean = (GetDirectCutPart() <> GDB_ID.NULL)
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
Not bDirectCut And
Not m_CurrProjPage.GetOrderMachiningFlag() Then
ResetAllMachinings()
bOk = SortAllMachinings()
If bOk Then
m_CurrProjPage.SetOrderMachiningFlag()
Dim bModif As Boolean = TestAllMachiningsForStrict()
If bModif Then
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
Else
m_CurrProjPage.SetInfoMessage(EgtMsg(90399)) 'Aggiornate tutte le lavorazioni
End If
EgtDraw()
End If
End If
' Costringo ad aggiornare UI
UpdateUI()
' Disabilito impostazione modificato
EgtDisableModified()
' Aggiorno le lavorazioni
bOk = UpdateAllMachiningsToolpaths() And bOk
' Aggiorno posizionamento ventose sui pezzi per eventuali tagli da sotto con lama
bOk = UpdateVacuumsForDrip() And bOk
' Costringo ad aggiornare UI
UpdateUI()
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Inserisco indice di progetto
m_CurrProjPage.SetProjectIndexFlag()
' Inserisco il materiale
@@ -631,45 +592,22 @@ Public Class SimulationPageUC
m_CurrProjPage.SaveFile(sMchPath)
' Costringo ad aggiornare UI
UpdateUI()
' Se modalità Ufficio, copio il progetto ed esco
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
' Ripristino come fase corrente quella iniziale
EgtSetCurrPhase(1)
' Chiedo il nome del file esportato
Dim MySaveNameWD As New SaveNameWD(m_MainWindow, SaveNameWD.SAVE_TYPE.PRJ_COPY)
MySaveNameWD.ShowDialog()
Return
' Nome e path del file CN da generare
Dim sFileName As String = ""
' Se in Tagli Diretti
If m_MainWindow.DirectCutBtn.IsChecked And Not m_MainWindow.CadCutBtn.IsChecked Then
sFileName = "DirectCut"
' Altrimenti in Tagli Cad
Else
Dim nIndexTab As Integer = CamAuto.GetCurrentTable()
Dim sIndexTab As String = If( nIndexTab > 0, nIndexTab.ToString, "")
sFileName = "CadCut" & sIndexTab
End If
' Se presente ripartenza, ne chiedo conferma
Dim nPhaseRestart As Integer = m_CurrProjPage.GetProjectNcRestart()
If nPhaseRestart <> 0 Then
' Confermi ripartenza dalla fase NNN ?
Dim AskNcRestart As New EgtMsgBox(m_MainWindow, "", String.Format(EgtMsg(90326), nPhaseRestart),
EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL, 2)
Select Case AskNcRestart.m_nPressedBtn
Case 1 ' YES
Case 2 ' NO
EgtEnableModified()
m_CurrProjPage.ResetProjectNcRestart()
nPhaseRestart = 0
EgtDisableModified()
Case Else ' CANCEL
Return
End Select
End If
' Se abilitate, eseguo le stime
If GetPrivateProfileInt(S_MACH_ESTIMATIONS, K_ENABLEEST, 0, m_MainWindow.GetMachIniFile()) <> 0 Then
EgtEstimate(m_MainWindow.GetTempDir() & "\MachProj.html", "OmagCut ver." & m_MainWindow.GetVersion())
End If
' Genero file CNC (lancio anche se errore in precedenza) -> recupero la tavola corrente! CamAuto.GetCurrentTable()
Dim nIndexTab As Integer = CamAuto.GetCurrentTable()
Dim sIndexTab As String = String.Empty
If nIndexTab > 0 Then
sIndexTab = nIndexTab.ToString
End If
Dim sFileName As String = "CadCut" & sIndexTab
Dim sCncPath As String = m_MainWindow.GetCncDir() & "\" & sFileName & m_MainWindow.m_CurrentMachine.sIsoFileExt
bOk = EgtGenerate(sCncPath, "OmagCut ver." & m_MainWindow.GetVersion()) And bOk
' Genero file CNC
Dim bOk As Boolean = EgtGenerate(sCncPath, "OmagCut ver." & m_MainWindow.GetVersion())
' Costringo ad aggiornare UI
UpdateUI()
' Ripristino come fase corrente quella iniziale
@@ -679,7 +617,7 @@ Public Class SimulationPageUC
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)
' procedo all'apertura del file CadCut1 appena generato (solo se generazione corretta)
If bOk And IsPressedShiftKey Then
Try
Process.Start("Notepad.exe", sCncPath)
+11 -11
View File
@@ -25,18 +25,18 @@ Module Utility
StopWatch.Start()
End Sub
Friend Function TimeSpanEnd()
Dim sTime As String = ""
If Not IsNothing(StopWatch) Then
StopWatch.Stop()
Dim ts As TimeSpan = StopWatch.Elapsed
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
End If
Return sTime
End Function
Friend Function TimeSpanEnd() As String
Dim sTime As String = ""
If Not IsNothing(StopWatch) Then
StopWatch.Stop()
Dim ts As TimeSpan = StopWatch.Elapsed
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
End If
Return sTime
End Function
'--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI()
'--------------------------------------------------------------------------------------------------
Friend Sub UpdateUI()
' Costringo ad aggiornare UI
Dim nDummy As Integer
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _
-2
View File
@@ -383,8 +383,6 @@ Friend Module VeinMatching
ShowParkedParts()
' Ripristino il contesto corrente
EgtSetCurrentContext(nCurrCtx)
' EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyVeinMatch.nge", NGE.TEXT)
Return True
End Function
+18 -10
View File
@@ -189,25 +189,33 @@ Public Class WorkInProgressPageUC
' Valori precedenti degli assi macchina
Dim dL1p, dL2p, dL3p, dR1p, dR2p As Double
Dim bFirst As Boolean = True
' Gestione fase di lavoro
Dim sPhaseVar As String = String.Empty
GetPrivateProfileString(S_MACH_INPROGRESS, K_PHASEVAR, "E80020", sPhaseVar, m_MainWindow.GetMachIniFile())
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
System.Threading.Thread.Sleep(100)
Dim nCurrPhase = 1
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
nCurrPhase = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
Dim bCurrPhaseExists As Boolean = False
If GetPrivateProfileString(S_MACH_INPROGRESS, K_PHASEVAR, "E80020", sPhaseVar, m_MainWindow.GetMachIniFile()) <> 0 Then
bCurrPhaseExists = True
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
System.Threading.Thread.Sleep(100)
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
nCurrPhase = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
End If
EgtSetCurrPhase(nCurrPhase, True)
EgtDraw()
Else
EgtOutLog("Variabile 'PhaseVar' mancante! In CurrentMachine non sarà aggiornata la fase del grezzo")
End If
EgtSetCurrPhase(nCurrPhase, True)
EgtDraw()
' Tempo di ritardo nel ciclo
Dim nTimeStep As Integer = 50
nTimeStep = GetPrivateProfileInt(S_MACH_INPROGRESS, K_WP_STEPTIME, nTimeStep, m_MainWindow.GetMachIniFile())
EgtOutLog("Tempo di attesa tra una lettura degli assi e la successiva: " & nTimeStep.ToString & " (ms)")
' Ciclo
While m_bContinue
' Rileggo la variabile di fase
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
If bCurrPhaseExists Then m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
' Recupero la posizione degli assi macchina
Dim dL1, dL2, dL3, dR1, dR2 As Double
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
@@ -238,7 +246,7 @@ Public Class WorkInProgressPageUC
' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU
System.Threading.Thread.Sleep(nTimeStep)
' Leggo la fase
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
If bCurrPhaseExists AndAlso m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
Dim nNextPhase As Integer = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
If nNextPhase > nCurrPhase Then