Compare commits

...

66 Commits

Author SHA1 Message Date
Nicola Pievani 18966d103e Pulizia codice 2025-04-08 14:11:07 +02:00
Nicola Pievani 8a65942370 Creazione primo frame non parallelo agli assi 2025-04-08 12:18:12 +02:00
Nicola Pievani c55cbfa5bb Inizio gestione inserimento cornici (DA RIFARE) 2025-04-04 11:32:18 +02:00
Nicola Pievani 1557f0865c Merge commit 'e5e80e9a55ff8ea618bd0bc5149e626c3ac3ac7d' into develop 2025-04-03 12:16:45 +02:00
Nicola Pievani e5e80e9a55 Correzione/miglioramento gestione offset spostamento 2025-04-02 16:09:35 +02:00
Nicola Pievani c7828774d8 Inizio gestione Frame allineato con il grezzo 2025-04-01 12:04:43 +02:00
Nicola Pievani cd0388b970 Merge commit '135be5f104c891b92201b98e3855117851ed42d5' into develop 2025-03-26 11:26:41 +01:00
Nicola Pievani 135be5f104 Modifica lettura Feed per controllo FANUC 2025-03-24 19:14:54 +01:00
Nicola Pievani 2f116ba3fe Gestione più di un riferimento del grezzo 2025-03-24 15:01:43 +01:00
Nicola Pievani 96ee5b5172 Correzione gestione lama test 2025-03-19 18:32:45 +01:00
Nicola Pievani 484f7eb410 Merge branch 'develop' 2025-03-13 17:58:13 +01:00
Nicola Pievani c1eb839fe8 Nascondo le pareti dell'area sicura quando esco dal grezzo 2025-03-13 17:58:01 +01:00
Nicola Pievani f3b1d80de7 Merge branch 'master' into develop 2025-03-13 11:18:49 +01:00
Nicola Pievani 14b4897575 Migliorata gestione movimento grezzo nell'area sicura 2025-03-12 17:29:04 +01:00
Nicola Pievani 213a66d916 Migliorata gestione grezzo per tagli OverZ 2025-03-12 14:45:19 +01:00
Nicola Pievani c9c7aeafae Gestione Warning da CamAuto 2025-03-11 12:09:26 +01:00
Nicola Pievani 07d54499b7 Correzione gestione cambio modo da pagina Grezzo 2025-03-10 17:58:42 +01:00
Nicola Pievani 9f266f1c56 Correzione gestione comando Manual da pagina tagli diretti 2025-03-10 16:13:36 +01:00
Nicola Pievani 48e523ce26 Merge commit 'a73b45d23ec23ddf0120a92ec35d85440229ffd0' 2025-02-24 15:33:53 +01:00
Nicola Pievani a73b45d23e Nuova gestione interasse cornici 2025-02-24 15:33:09 +01:00
Nicola Pievani 8ea607611c Gestione attesa per scatto fotografia (EnableGoHome) 2025-02-17 15:01:33 +01:00
Nicola Pievani bdf0971c20 Gestione apertura/salvataggio porgetti con multiparcheggio 2025-02-17 13:10:30 +01:00
Nicola Pievani 7d77297695 Merge branch 'develop' 2025-02-13 11:10:48 +01:00
Nicola Pievani bdcdcaecf0 Gestione sfondo dinamico PopUp viste 2025-02-12 17:51:09 +01:00
Nicola Pievani 44011c5775 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/OmagCUT into develop 2025-02-12 17:39:10 +01:00
Nicola Pievani cba095188e Migliorata gestione parcheggi in fase creazione nuovo progetto 2025-02-12 17:37:54 +01:00
Demetrio Cassarino ebedccf46a Aggiunto popup viste 2025-02-12 12:33:18 +01:00
Nicola Pievani 8bd7d9e3fa Merge branch 'develop' 2025-02-06 16:14:46 +01:00
Nicola Pievani 8dfa932bd7 Gestione SQUARING con lama 2025-02-06 16:13:33 +01:00
Nicola Pievani 5422e905e7 Aggiornamento lista materiali da DB waterjet 2025-02-06 15:59:03 +01:00
Nicola Pievani da396cc82e Merge branch 'Features/Read_C_Step' into develop 2025-02-06 15:01:08 +01:00
Nicola Pievani da8e7a9e42 Aggiornamento logo 2.7 2025-02-06 15:00:57 +01:00
Nicola Pievani d8cbe1a2c6 Aggiunto comando diretto per selezione modalità Manual 2025-02-03 11:23:40 +01:00
Nicola Pievani 79c2c17d6b Gestione taglio speciali per pezzi oltre il limite corsa in Z 2025-01-31 17:37:05 +01:00
Nicola Pievani ccb8945a4f Lettura posizione asse C da variabile PLC 2025-01-22 15:07:12 +01:00
Nicola Pievani 842ab19e8b Merge commit '5cfc72be27681812199b9ba326f0b285d6d93906' into develop 2025-01-17 16:55:55 +01:00
Nicola Pievani 5cfc72be27 Gestione PNG/SVG da variabile MainWindow 2025-01-17 16:25:51 +01:00
Nicola Pievani 45d3f5c7d8 Gestione lista dei parcheggi con file SVG 2025-01-16 17:48:05 +01:00
Nicola Pievani ac67a14fea Gestione lista parcheggi come UserControl 2025-01-14 14:29:23 +01:00
Nicola Pievani 1df823cdec Gestione estesa dei pezzi in parcheggio 2025-01-10 20:46:47 +01:00
Nicola Pievani be29ea050d Gestione visualizzazione di pezzi sovrapposti 2025-01-02 19:26:45 +01:00
Nicola Pievani cd4d2b1ccb Merge branch 'master' into Features/Import_DXF_In_Parck 2025-01-02 10:17:47 +01:00
Nicola Pievani c730513f27 Configurazione finestra licenza 2024-12-30 09:02:50 +01:00
Nicola Pievani 9f3920a2b2 Nuova gestione visualizzazione layer info lavorazioni 2024-12-24 14:39:09 +01:00
Nicola Pievani f388dc0c50 Merge commit '6613b3d551b2f06a1940fcd7b1c2dd9ca6743bd5' 2024-12-23 13:28:25 +01:00
Nicola Pievani 6613b3d551 Nuovi messaggi per assistenza 2024-12-23 12:33:19 +01:00
Nicola Pievani 615d6d2652 Nuova gestione tagli parziali Saw&Waterjet 2024-12-23 11:23:53 +01:00
Nicola Pievani 3ea8335357 Gestione parcheggio per scatto foto 2024-12-16 15:40:03 +01:00
Nicola Pievani bbdac91894 Migliorata gestione tempi comunicazione NUM_old 2024-12-13 17:04:55 +01:00
Nicola Pievani c424ff6661 Migliorata gestione tempi comunicazione NUM_old 2024-12-13 17:04:37 +01:00
Nicola Pievani 4d64328b1b Merge commit '10c4c7ecc1ba0521ad4c251fce28268d7f0dd6e8' into Features/Import_DXF_In_Parck 2024-11-28 08:38:56 +01:00
Nicola Pievani 10c4c7ecc1 Reimpostato logo OmagCut 2024-11-11 11:51:07 +01:00
Nicola Pievani 03def4b530 Merge commit '4ab7811b50e72cb716abfca74c60e4f3c586d6f5' into develop 2024-11-11 11:45:00 +01:00
Nicola Pievani a3b56444f6 Correzione altezza posizionamento per Test taglio 2024-11-11 11:40:05 +01:00
Nicola Pievani 837380226a Merge commit 'f15935ecbc2c3b1994f8684ea5511d32382fefde' into develop 2024-11-04 15:12:09 +01:00
Dario Sassi f15935ecbc OmagCUT 2.6k1 :
- piccola modifica di testa per tagli di separazione lastra prolungabili da un solo lato.
2024-11-04 08:38:45 +01:00
Nicola Pievani 00360013e3 Merge commit '9c267aacf77c6517f98ba584c5d945bae21bc656' into develop 2024-10-30 11:25:34 +01:00
Nicola Pievani 0010deb7fc Inizio gestione disoposizione DXF in parcheggio 2024-10-29 15:23:57 +01:00
Demetrio Cassarino 9c267aacf7 -modifica grafica treeview cvs 2024-10-29 11:57:05 +01:00
Nicola Pievani 311cf40a8e Allungo lato libero di tagli ridotti 2024-10-29 11:52:44 +01:00
Nicola Pievani 4c34b62e65 Inserito comando Righello nella pagina VeinMatch 2024-10-29 09:54:01 +01:00
Nicola Pievani 87037b6c6a Migliorata gestione selezione OnOff da lista lavorazioni 2024-10-28 12:09:15 +01:00
Nicola Pievani 74c479d17d Gestione attivazione comando modifica 2024-10-28 11:23:53 +01:00
Nicola Pievani ee6c0ad146 Merge branch 'develop' 2024-10-09 16:34:24 +02:00
Nicola Pievani ead6bcec6d Gestione deselezione tagli in pagina split 2024-10-09 16:33:45 +02:00
Nicola Pievani a1ad658f27 Correzione DoubleClick OnOff scena 2024-10-09 15:54:47 +02:00
61 changed files with 3552 additions and 1037 deletions
+50 -9
View File
@@ -22,9 +22,12 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Add") bOk = bOk AndAlso EgtLuaCallFunction("CAM.Add")
EgtLuaGetGlobIntVar("CAM.ERR", nErr) EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM") EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then If nErr > 0 Then
bOk = False bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString()) EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(91017))
End If End If
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag() m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
Return bOk Return bOk
@@ -40,9 +43,34 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.AddWaterJet") bOk = bOk AndAlso EgtLuaCallFunction("CAM.AddWaterJet")
EgtLuaGetGlobIntVar("CAM.ERR", nErr) EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM") EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then If nErr > 0 Then
bOk = False bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString()) EgtOutLog("Error in CamAuto : " & nErr.ToString())
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If
Return bOk
End Function
' versione CamAuto 2.6l1: gestione tagli con ridotto affondamento
Friend Function AddWaterJetMachining(LocaList As List(Of Integer), ByRef nWarn As Integer) As Boolean
EgtLuaCreateGlobTable("CAM")
SetLuaStandardCamParams()
For i As Integer = 0 To LocaList.Count - 1
EgtLuaSetGlobIntVar("CAM.TAB_OPERID." & (i + 1).ToString, LocaList(i))
Next
Dim nErr As Integer = 999
Dim bOk As Boolean = EgtLuaExecFile(m_MainWindow.GetCamAutoDir() & "\CamAuto.lua")
bOk = bOk AndAlso EgtLuaGetGlobIntVar("CAM.ERR", nErr) AndAlso nErr = 0
bOk = bOk AndAlso EgtLuaCallFunction("CAM.AddWaterJets")
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM")
If nErr > 0 Then
bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If End If
Return bOk Return bOk
End Function End Function
@@ -56,9 +84,11 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Erase") bOk = bOk AndAlso EgtLuaCallFunction("CAM.Erase")
EgtLuaGetGlobIntVar("CAM.ERR", nErr) EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM") EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then If nErr > 0 Then
bOk = False bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString()) EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If End If
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag() m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
m_MainWindow.m_CurrentProjectPageUC.ResetProjectNcRestart() m_MainWindow.m_CurrentProjectPageUC.ResetProjectNcRestart()
@@ -74,9 +104,11 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.InvertVerticalCut") bOk = bOk AndAlso EgtLuaCallFunction("CAM.InvertVerticalCut")
EgtLuaGetGlobIntVar("CAM.ERR", nErr) EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM") EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then If nErr > 0 Then
bOk = False bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString()) EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If End If
Return bOk Return bOk
End Function End Function
@@ -271,9 +303,11 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.UpdateAllTp") bOk = bOk AndAlso EgtLuaCallFunction("CAM.UpdateAllTp")
EgtLuaGetGlobIntVar("CAM.ERR", nErr) EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM") EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then If nErr > 0 Then
bOk = False bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString()) EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If End If
Return bOk Return bOk
End Function End Function
@@ -287,9 +321,11 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Sort") bOk = bOk AndAlso EgtLuaCallFunction("CAM.Sort")
EgtLuaGetGlobIntVar("CAM.ERR", nErr) EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM") EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then If nErr > 0 Then
bOk = False bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString()) EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If End If
Return bOk Return bOk
End Function End Function
@@ -304,9 +340,11 @@ Friend Module CamAuto
bOk = bOk AndAlso EgtLuaCallFunction("CAM.SpecApplyDisp") bOk = bOk AndAlso EgtLuaCallFunction("CAM.SpecApplyDisp")
EgtLuaGetGlobIntVar("CAM.ERR", nErr) EgtLuaGetGlobIntVar("CAM.ERR", nErr)
EgtLuaResetGlobVar("CAM") EgtLuaResetGlobVar("CAM")
If nErr <> 0 Then If nErr > 0 Then
bOk = False bOk = False
EgtOutLog("Error in CamAuto : " & nErr.ToString()) EgtOutLog("Error in CamAuto : " & nErr.ToString())
ElseIf nErr < 0 Then
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
End If End If
If ResetOrderMachiningFlag Then If ResetOrderMachiningFlag Then
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag() m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
@@ -543,6 +581,7 @@ Friend Module CamAuto
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile()) Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
' Ciclo sulle lavorazioni ' Ciclo sulle lavorazioni
Dim nOperId As Integer = EgtGetFirstOperation() Dim nOperId As Integer = EgtGetFirstOperation()
Dim LocalListOperId As New List(Of Integer)
While nOperId <> GDB_ID.NULL While nOperId <> GDB_ID.NULL
' verifico sia una lavorazione valida di taglio con lama ' verifico sia una lavorazione valida di taglio con lama
If IsValidMachining( nOperId) And EgtGetOperationType( nOperId) = MCH_OY.SAWING Then If IsValidMachining( nOperId) And EgtGetOperationType( nOperId) = MCH_OY.SAWING Then
@@ -557,12 +596,14 @@ Friend Module CamAuto
' se abilitato e attivo waterjet, lo aggiungo per completare il taglio ' se abilitato e attivo waterjet, lo aggiungo per completare il taglio
If m_MainWindow.m_CurrentMachine.WaterJettingActive Then If m_MainWindow.m_CurrentMachine.WaterJettingActive Then
Dim nWarn As Integer = 0 Dim nWarn As Integer = 0
AddWaterJetMachining(nOperId, nWarn) LocalListOperId.Add(nOperId)
'AddWaterJetMachining(nOperId, nWarn)
End If
End If End If
End If
End If End If
nOperId = EgtGetNextOperation(nOperId) nOperId = EgtGetNextOperation(nOperId)
End While End While
If LocalListOperId.Count > 0 Then AddWaterJetMachining(LocalListOperId, 0)
Return bModified Return bModified
End Function End Function
+18 -8
View File
@@ -27,7 +27,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!--Griglia per oscurare i bottoni della pagina sottostante--> <!--Griglia per oscurare i bottoni della pagina sottostante-->
<Grid Background="{DynamicResource OmagCut_Gray}"> <Grid Background="{DynamicResource OmagCut_Gray}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
@@ -49,7 +49,7 @@
<Label Name="CsvPathTxBl" Grid.Row="1" Background="White" FontSize="16" VerticalAlignment="Center" Padding="2,5,0,5"/> <Label Name="CsvPathTxBl" Grid.Row="1" Background="White" FontSize="16" VerticalAlignment="Center" Padding="2,5,0,5"/>
<TreeView Name="PartsTreeView" Grid.Row="2" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}"> <TreeView Name="PartsTreeView" Grid.Row="2" Background="{StaticResource OmagCut_TreeViewGradientGray}">
<TreeView.Resources> <TreeView.Resources>
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per --> <!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
<!--renderlo apribile con un solo click --> <!--renderlo apribile con un solo click -->
@@ -62,7 +62,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" /> <Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" />
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="10" /> <TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="10" Foreground="Black" />
</Grid> </Grid>
@@ -123,7 +123,10 @@
</Setter> </Setter>
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding bIsActive}" Value="False"> <DataTrigger Binding="{Binding bIsActive}" Value="False">
<Setter Property="Foreground" Value="{StaticResource OmagCut_LightGray}"/> <Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
</DataTrigger>
<DataTrigger Binding="{Binding bIsActive}" Value="True">
<Setter Property="Foreground" Value="Black"/>
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
@@ -131,18 +134,25 @@
</HierarchicalDataTemplate> </HierarchicalDataTemplate>
<!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo--> <!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo-->
<DataTemplate DataType="{x:Type self:PartCustomItem}"> <DataTemplate DataType="{x:Type self:PartCustomItem}">
<Grid Width="246" Margin="0,5,0,5" HorizontalAlignment="Right"> <Grid Width="234.8" Margin="0,5,0,5" HorizontalAlignment="Right">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="60"/> <ColumnDefinition Width="60"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Name}" Height="18" FontSize="14" HorizontalAlignment="Right"/> <TextBlock x:Name="TbName" Grid.Column="0" Text="{Binding Name}" Height="18" FontSize="14" HorizontalAlignment="Right"/>
<TextBlock Grid.Column="1" Text="{Binding sText1}" Height="18" FontSize="14" HorizontalAlignment="Center"/> <TextBlock x:Name="TbText1" Grid.Column="1" Text="{Binding sText1}" Height="18" FontSize="14" HorizontalAlignment="Center"/>
<TextBlock Grid.Column="2" Text="{Binding sText2}" Height="18" FontSize="14" HorizontalAlignment="Left"/> <TextBlock x:Name="TbText2" Grid.Column="2" Text="{Binding sText2}" Height="18" FontSize="14" HorizontalAlignment="Left"/>
</Grid> </Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding bIsActive}" Value="False">
<Setter TargetName="TbName" Property="TextDecorations" Value="Strikethrough" />
<Setter TargetName="TbText1" Property="TextDecorations" Value="Strikethrough" />
<Setter TargetName="TbText2" Property="TextDecorations" Value="Strikethrough" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate> </DataTemplate>
</TreeView.Resources> </TreeView.Resources>
+1
View File
@@ -2,6 +2,7 @@
Imports EgtWPFLib Imports EgtWPFLib
Imports System.Reflection Imports System.Reflection
Imports System.Globalization Imports System.Globalization
Imports EgtWPFLib5
Public Class CadCutPageUC Public Class CadCutPageUC
+6
View File
@@ -74,6 +74,12 @@ Public Class ChooseTestToolWD
End If End If
Select Case m_MainWindow.m_CurrentMachine.MountedToolConfig Select Case m_MainWindow.m_CurrentMachine.MountedToolConfig
Case CurrentMachine.MountedToolConfigs.SAW
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
If Not String.IsNullOrEmpty(sNameTool) Then
' Imposto la lama
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
End If
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
If Not String.IsNullOrEmpty(sNameTool) Then If Not String.IsNullOrEmpty(sNameTool) Then
+9 -1
View File
@@ -133,9 +133,17 @@ Public Class MoveRawPartPage
EgtDraw() EgtDraw()
' Carico i parametri di movimento ' Carico i parametri di movimento
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile()) m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
' Carico il valore ci
Dim ExtraStep As Double = GetPrivateProfileDouble(S_RAWMOVE, K_EXTRASTEP, 1, m_MainWindow.GetIniFile())
' Ricavo la lunghezza del baffo di taglio ' Ricavo la lunghezza del baffo di taglio
m_dStep = SplitAuto.MaxCuttingMustache(m_dStep) m_dStep = SplitAuto.MaxCuttingMustache(m_dStep)
StepMoveTxBx.Text = LenToString(m_dStep, 1) & "+1" If ExtraStep < EPS_SMALL Then
StepMoveTxBx.Text = LenToString(m_dStep, 1)
Else
StepMoveTxBx.Text = LenToString(m_dStep, 1) & "+" & LenToString(ExtraStep, 1)
' Aggiorno il valore sommando l'extra
m_dStep = m_dStep + ExtraStep
End If
m_dRotation = GetPrivateProfileDouble(S_RAWMOVE, K_RAWROTATION, 30, m_MainWindow.GetIniFile()) m_dRotation = GetPrivateProfileDouble(S_RAWMOVE, K_RAWROTATION, 30, m_MainWindow.GetIniFile())
RotationAngleTxBx.Text = DoubleToString(m_dRotation, 3) RotationAngleTxBx.Text = DoubleToString(m_dRotation, 3)
' Se movimento manuale perpendicolare ' Se movimento manuale perpendicolare
+16 -14
View File
@@ -12,7 +12,7 @@
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/> <ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/> <ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="8*"/> <RowDefinition Height="8*"/>
@@ -149,29 +149,31 @@
</ToggleButton> </ToggleButton>
</UniformGrid> </UniformGrid>
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" > <UniformGrid Name ="UG2" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="3" >
<Button Name="SelectAllBtn" Style="{DynamicResource OmagCut_YellowIconButton}"> <Button Name="SelectAllBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Seleziona-tuttoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/> <Image Source="{DynamicResource Seleziona-tuttoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button> </Button>
<Button Name="DeselectAllBtn" Style="{DynamicResource OmagCut_YellowIconButton}"> <Button Name="DeselectAllBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource Deseleziona-tuttoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/> <Image Source="{DynamicResource Deseleziona-tuttoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button> </Button>
</UniformGrid> <ToggleButton Name="ParkIndBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
<Image Name="ParkIndImg" Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</ToggleButton>
</UniformGrid>
</Grid> </Grid>
<!--LowerButtonGrid--> <!--LowerButtonGrid-->
<Grid Grid.Column="2" Grid.Row="2"> <Grid Grid.Column="2" Grid.Row="2">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/> <ColumnDefinition Width="5*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="4*"/> <ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
</Grid> </Grid>
</Grid>
</Grid>
</UserControl> </UserControl>
+187 -13
View File
@@ -9,6 +9,9 @@ Public Class NestPageUC
' Riferimento alla MainWindow ' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private WithEvents m_CurrProjPage As CurrentProjectPageUC Private WithEvents m_CurrProjPage As CurrentProjectPageUC
' Fisetra per la gestione dei parcheggi
Private m_SelParkInd As SelParkIndWD
' Flag di pagina attiva ' Flag di pagina attiva
Private m_bActive As Boolean = False Private m_bActive As Boolean = False
' Flag per modalità nesting standard o registrazione posizione lastra ' Flag per modalità nesting standard o registrazione posizione lastra
@@ -144,11 +147,30 @@ Public Class NestPageUC
StartCurveWJBtn.Visibility = Visibility.Collapsed StartCurveWJBtn.Visibility = Visibility.Collapsed
End If End If
UG0.Columns = nColumnIn_UG0 UG0.Columns = nColumnIn_UG0
' Gestione dei comandi di parcheggio e selezione (UniformGrid2)
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) = 0 Then
EgtOutLog("Button 'EnableDXFPark' is not enable, check in file *.ini program.")
ParkIndBtn.Visibility = Visibility.Collapsed
UG2.Columns = 2
End If
End Sub End Sub
Dim ImageConverter As New ImageSourceConverter
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs) Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs)
m_bActive = True m_bActive = True
LoadParams() LoadParams()
Dim nCpuntParkInd As Integer = UpdateImageParkInd()
If nCpuntParkInd > 2 Then
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) = 0 Then
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("There are " & (nCpuntParkInd - 1).ToString & " park in project.")
EgtOutLog("WARNONG: Enable button 'EnableDXFPark' in file *.ini program.")
End If
ParkIndBtn.IsChecked = True
End If
ParkIndBtn_Click()
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
End Sub End Sub
@@ -220,21 +242,21 @@ Public Class NestPageUC
m_nCountSpot = 0 m_nCountSpot = 0
m_nCountSpotCUT = 0 m_nCountSpotCUT = 0
End If End If
EgtOutLog("Numero di SPOT caricati da OFFICE: " & m_nCountSpot.ToString) 'EgtOutLog("Numero di SPOT caricati da OFFICE: " & m_nCountSpot.ToString)
' Se nel progetto non sono inseriti punti SpotReg disabilito i comandi ' Se nel progetto non sono inseriti punti SpotReg disabilito i comandi
If m_nCountSpot < 1 Then If m_nCountSpot < 1 Then
UG0_Reg.IsEnabled = False UG0_Reg.IsEnabled = False
UG1_Reg.IsEnabled = False UG1_Reg.IsEnabled = False
EgtOutLog(" Abilito comandi gestione SPOT") 'EgtOutLog(" Abilito comandi gestione SPOT")
Else Else
UG0_Reg.IsEnabled = True UG0_Reg.IsEnabled = True
UG1_Reg.IsEnabled = True UG1_Reg.IsEnabled = True
EgtOutLog(" Disabilito comandi gestione SPOT") 'EgtOutLog(" Disabilito comandi gestione SPOT")
End If End If
' Se nel progetto non sono inseriti punti SpotRegCUT provvedo ad aggiungerli ' Se nel progetto non sono inseriti punti SpotRegCUT provvedo ad aggiungerli
If m_nCountSpotCUT < 1 Then If m_nCountSpotCUT < 1 Then
InsertSpotRegistration() InsertSpotRegistration()
EgtOutLog(" Creo SPOT_CUT") 'EgtOutLog(" Creo SPOT_CUT")
End If End If
' Se necessario riabilito impostazione modificato ' Se necessario riabilito impostazione modificato
@@ -1073,8 +1095,7 @@ Public Class NestPageUC
End If End If
' Si può selezionare solo con il tasto sinistro e se stato NULL ' Si può selezionare solo con il tasto sinistro e se stato NULL
If e.Button <> Windows.Forms.MouseButtons.Left Or If e.Button <> Windows.Forms.MouseButtons.Left Or Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Return Return
End If End If
@@ -1086,7 +1107,6 @@ Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
m_bIsCounterLy = False m_bIsCounterLy = False
' se in modalità DragRettangle (deformazione delle componenti rettangolari) ' se in modalità DragRettangle (deformazione delle componenti rettangolari)
If m_bIsCheckedDragRettangle Then If m_bIsCheckedDragRettangle Then
OnMyMouseDownSceneSelSideRettangle(sender, e)
' Dati per drag (abilito il Drag) ' Dati per drag (abilito il Drag)
m_locPrev = e.Location m_locPrev = e.Location
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRettangle <> GDB_ID.NULL m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRettangle <> GDB_ID.NULL
@@ -1570,6 +1590,10 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
' Eseguo verifica ' Eseguo verifica
If VerifyTrfData(nMoveId) And EgtVerifyPart(nMoveId, m_bReducedCut) Then If VerifyTrfData(nMoveId) And EgtVerifyPart(nMoveId, m_bReducedCut) Then
m_CurrProjPage.ResetOrderMachiningFlag() m_CurrProjPage.ResetOrderMachiningFlag()
' Aggiorno la lista dei parcheggi
If ParkIndBtn.IsChecked Then
m_SelParkInd.UpdateList()
End If
' Non superata riporto alla posizione iniziale ' Non superata riporto alla posizione iniziale
Else Else
If m_bFromParking Then If m_bFromParking Then
@@ -1601,7 +1625,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
CountPartInFamily(sRefGroup) CountPartInFamily(sRefGroup)
End If End If
End If End If
'---------------------- COUNTER PART ---------------------- '---------------------- COUNTER PART ----------------------
End If End If
m_bFromParking = False m_bFromParking = False
End If End If
@@ -2271,7 +2295,10 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Else Else
StandardInsert() StandardInsert()
End If End If
' Aggiorno la lista dei parcheggi
If ParkIndBtn.IsChecked Then
m_SelParkInd.UpdateList()
End If
End Sub End Sub
Private Sub StandardInsert() Private Sub StandardInsert()
@@ -2713,6 +2740,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
End Function End Function
#End Region ' Manager Counter Part #End Region ' Manager Counter Part
Private Sub DragRettangle_Click() Handles DragRettanleBtn.Click Private Sub DragRettangle_Click() Handles DragRettanleBtn.Click
If DragRettanleBtn.IsChecked Then If DragRettanleBtn.IsChecked Then
m_bIsCheckedDragRettangle = True m_bIsCheckedDragRettangle = True
@@ -2778,6 +2806,12 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Dim nNextId = EgtGetNextSelectedObj() Dim nNextId = EgtGetNextSelectedObj()
' Metto in parcheggio, se in grezzo ' Metto in parcheggio, se in grezzo
StoreOnePart(nId) StoreOnePart(nId)
' Aggiorno lo stato di visualizzazione
Dim nInfoStatus As Integer = 1
' Salvo lo stato (per gestire la navigazione)
EgtGetInfo(nId, INFO_PARKSTATUS, nInfoStatus)
' Imposto lo stato
EgtSetStatus(nId, nInfoStatus)
' Eventuale notifiche al VeinMatching ' Eventuale notifiche al VeinMatching
VeinMatching.OnRemovePartFromRaw(nId) VeinMatching.OnRemovePartFromRaw(nId)
' Passo al successivo selezionato ' Passo al successivo selezionato
@@ -2787,6 +2821,8 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
m_nPartPos = PART_POS.NONE_TABLE m_nPartPos = PART_POS.NONE_TABLE
' Aggiorno vista ' Aggiorno vista
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
' Aggiorno la lista dei parcheggi
ReloadListParkInd()
End Sub End Sub
' ripulisco la lista dei pezzi in parcheggio ' ripulisco la lista dei pezzi in parcheggio
@@ -2818,6 +2854,29 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Return False Return False
End Function End Function
Friend Function StoreOnePartDXF(nId As Integer, X As Double, Y As Double) As Boolean
Const STORE_LARGH As Double = 6000
Const STORE_DIST As Double = 200
Const STORE_OFFS As Double = 20 + 40 + 20
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())
' Recupero box tavola
Dim b3Tab As New BBox3d
If Not EgtGetTableArea(1, b3Tab) Then
b3Tab.Add(New Point3d(0, 0, 0))
b3Tab.Add(New Point3d(-3600, -2600, 0))
End If
Dim vt As New Vector3d(b3Tab.Min.x, b3Tab.Min.y - Y - STORE_DIST, b3Tab.Min.z)
EgtMove(nId, vt, GDB_RT.GLOB)
' Recupero il centro del pezzo in parcheggio e lo salvo
Dim ptCenter As Point3d
EgtCenterPoint(nId, GDB_ID.ROOT, ptCenter)
EgtSetInfo(nId, "PosInPark", ptCenter)
EgtSetStatus(nId, GDB_ST.ON_)
Return True
End Function
Friend Function PackPartInStore(nId As Integer) As Boolean Friend Function PackPartInStore(nId As Integer) As Boolean
' Recupero box tavola ' Recupero box tavola
Dim b3Tab As New BBox3d Dim b3Tab As New BBox3d
@@ -2833,6 +2892,17 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Dim dStoreDist As Double = GetPrivateProfileDouble("Store", "StoreDist", STORE_DIST, 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 dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (dStoreLarg - b3Tab.DimX()) Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (dStoreLarg - b3Tab.DimX())
' Verifico che il pezzo ha una posizione salvata
Dim ptCenter As Point3d
If EgtGetInfo(nId, "PosInPark", ptCenter) Then
Dim ptCurrPos As Point3d
EgtCenterPoint(nId, GDB_ID.ROOT, ptCurrPos)
Dim vt As New Vector3d(ptCenter - ptCurrPos)
EgtMove(nId, vt, GDB_RT.GLOB)
Return True
End If
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + dStoreLarg, b3Tab.Min().y - dStoreDist, dStoreOffs, False) Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + dStoreLarg, b3Tab.Min().y - dStoreDist, dStoreOffs, False)
End Function End Function
@@ -2921,8 +2991,43 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
m_CurrProjPage.ShowAreas() m_CurrProjPage.ShowAreas()
' Aggiorno vista ' Aggiorno vista
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
' Aggiorno la lista dei parcheggi
If ParkIndBtn.IsChecked Then
m_SelParkInd.UpdateList()
End If
UpdateImageParkInd()
End Sub End Sub
' Aggiorna immagine e restituisce il numero di parcheggi (+1) disponibili (+1 perchè conto anche il comando All_Off)
Private Function UpdateImageParkInd() As Integer
' Carcico la lista dei parcheggi
Dim ListparkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListparkInd)
Dim nCount As Integer = ListparkInd.Count
' Se il comando è abilitato allora provvedo ad aggiornare l'immagine
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
Dim s As String = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Parking.png"
If nCount > 1 Then
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Busy.png"
Else
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Empty.png"
End If
ParkIndImg.Source = ImageConverter.ConvertFromString(s)
Else
' Se il comando non è abilitato allora provvedo a selezionare il primo parcheggio
Dim CurrparkInd As ParkInd = SelParkIndWD.GetCurrentParkIndSelected()
If Not IsNothing(CurrparkInd) Then
SelParkIndWD.SetStatusPartInParkInd(CurrparkInd, True)
Else
If nCount > 1 Then
ListparkInd(1).Status = GDB_ST.ON_
SelParkIndWD.SetStatusPartInParkInd(ListparkInd(1), True)
End If
End If
End If
Return nCount
End Function
Private Sub DeleteBridgeAssociated(nMyId As Integer) Private Sub DeleteBridgeAssociated(nMyId As Integer)
' verifico se esistono dei ponticelli associati al pezzo indicato ' verifico se esistono dei ponticelli associati al pezzo indicato
' recuoero il gruppo di lavorazione corrente ' recuoero il gruppo di lavorazione corrente
@@ -2966,6 +3071,13 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
Private Sub SelectAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles SelectAllBtn.Click Private Sub SelectAllBtn_Click(sender As Object, e As RoutedEventArgs) Handles SelectAllBtn.Click
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx()) EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Recupero il ParkInd attualmente attivo
Dim CurrParkInd As ParkInd = SelParkIndWD.GetCurrentParkIndSelected()
' Il default è ZERO
Dim nCurrParkInd As Integer = 0
If Not IsNothing(CurrParkInd) Then
nCurrParkInd = CurrParkInd.Ind
End If
' Numero dei pezzi in tavola ' Numero dei pezzi in tavola
Dim nPartTab As Integer = EgtGetPartInRawPartCount(m_nRawId) Dim nPartTab As Integer = EgtGetPartInRawPartCount(m_nRawId)
' Se già selezionati in tavola o non ci sono selezionati e pezzi in tavola ' Se già selezionati in tavola o non ci sono selezionati e pezzi in tavola
@@ -2974,8 +3086,21 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
' Seleziono tutti i pezzi in tavola ' Seleziono tutti i pezzi in tavola
Dim nPartId As Integer = EgtGetFirstGroupInGroup(m_nRawId) Dim nPartId As Integer = EgtGetFirstGroupInGroup(m_nRawId)
While nPartId <> GDB_ID.NULL While nPartId <> GDB_ID.NULL
EgtSelectObj(nPartId) ' ------------------ INIZIO ------------------ Recupero l'indice del parcheggio in cui è inserito il pezzo
VeinMatching.OnSelectPart(nPartId, False) Dim sInfoParkInd As String = String.Empty
Dim nInfoParkInd As Integer = -1
' Recupero l'indice del parcheggio
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
nInfoParkInd = If(IsNumeric(sInfoParkInd), CInt(sInfoParkInd), -1)
Else
nInfoParkInd = 0
End If
' ------------------ FINE ------------------ Recupero l'indice del parcheggio in cui è inserito il pezzo
' Se l'indice di parcheggio è valido (uguale al parcheggio corrente)
If nInfoParkInd = nCurrParkInd Then
EgtSelectObj(nPartId)
VeinMatching.OnSelectPart(nPartId, False)
End If
nPartId = EgtGetNextGroup(nPartId) nPartId = EgtGetNextGroup(nPartId)
End While End While
' Aggiorno flag ' Aggiorno flag
@@ -2985,8 +3110,21 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
' Seleziono tutti i pezzi in parcheggio ' Seleziono tutti i pezzi in parcheggio
Dim nPartId As Integer = EgtGetFirstPart() Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL While nPartId <> GDB_ID.NULL
EgtSelectObj(nPartId) ' ------------------ INIZIO ------------------ Recupero l'indice del parcheggio in cui è inserito il pezzo
VeinMatching.OnSelectPart(nPartId, False) Dim sInfoParkInd As String = String.Empty
Dim nInfoParkInd As Integer = -1
' Recupero l'indice del parcheggio
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
nInfoParkInd = If(IsNumeric(sInfoParkInd), CInt(sInfoParkInd), -1)
Else
nInfoParkInd = 0
End If
' ------------------ FINE ------------------ Recupero l'indice del parcheggio in cui è inserito il pezzo
' Se l'indice di parcheggio è valido (uguale al parcheggio corrente)
If nInfoParkInd = nCurrParkInd Then
EgtSelectObj(nPartId)
VeinMatching.OnSelectPart(nPartId, False)
End If
nPartId = EgtGetNextPart(nPartId) nPartId = EgtGetNextPart(nPartId)
End While End While
' Aggiorno flag ' Aggiorno flag
@@ -3009,6 +3147,35 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
EgtDraw() EgtDraw()
End Sub End Sub
Private Sub ParkIndBtn_Click() Handles ParkIndBtn.Click
If ParkIndBtn.Visibility = Visibility.Collapsed Then
Return
End If
If ParkIndBtn.IsChecked Then
If IsNothing(m_SelParkInd) Then
m_SelParkInd = New SelParkIndWD(m_MainWindow)
End If
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectSceneHost.SetValue(Grid.ColumnSpanProperty, 1)
m_SelParkInd.SetValue(Grid.ColumnProperty, 1)
m_MainWindow.m_CurrentProjectPageUC.SceneHostGrid.Children.Add(m_SelParkInd)
Else
If Not IsNothing(m_SelParkInd) Then
m_MainWindow.m_CurrentProjectPageUC.SceneHostGrid.Children.Remove(m_SelParkInd)
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
m_SelParkInd = Nothing
End If
End If
EgtZoom(ZM.ALL)
End Sub
Public Sub ReloadListParkInd()
If Not IsNothing(m_SelParkInd) Then
m_SelParkInd.UpdateList()
End If
UpdateImageParkInd()
End Sub
Private Sub PartRotOnBtn_Click(sender As Object, e As RoutedEventArgs) Handles PartRotOnBtn.Click Private Sub PartRotOnBtn_Click(sender As Object, e As RoutedEventArgs) Handles PartRotOnBtn.Click
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx()) EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
' Se non ci sono pezzi selezionati o non sono in parcheggio, esco ' Se non ci sono pezzi selezionati o non sono in parcheggio, esco
@@ -3132,6 +3299,13 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
End Sub End Sub
Private Sub NestPage_Unloaded(sender As Object, e As RoutedEventArgs) Private Sub NestPage_Unloaded(sender As Object, e As RoutedEventArgs)
' se esiste l'elenco dei parcheggi lo nascondo
If Not IsNothing(m_SelParkInd) Then
' m_SelParkInd.Close()
m_MainWindow.m_CurrentProjectPageUC.SceneHostGrid.Children.Remove(m_SelParkInd)
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
m_SelParkInd = Nothing
End If
m_bActive = False m_bActive = False
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.VeinMatchingHide() m_MainWindow.m_CadCutPageUC.m_ProjectMgr.VeinMatchingHide()
End Sub End Sub
+97
View File
@@ -0,0 +1,97 @@
<UserControl x:Class="SelParkIndWD"
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}"
Background="Transparent">
<Border Style="{DynamicResource OmagCut_Border}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="0.1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.0*"/>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="10*"/>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="0.0*"/>
</Grid.RowDefinitions>
<TextBlock Name="FilePathTxBl" Grid.Column="1" Grid.Row="1" Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"
Visibility="Collapsed"/>
<!--TextAlignment="Center"
FontSize="20"
VerticalAlignment="Center"-->
<ListBox Name="ParkIndListBox" Grid.Column="1" Grid.Row="2"
ItemsSource="{Binding ItemList}" ScrollViewer.CanContentScroll="False" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical" >
<UniformGrid Columns="2" Visibility="{Binding TitleVisibility}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding ImgTab}" Height="20" Stretch="Uniform"/>
<TextBlock Text="{Binding CountInTab}" Height="20" Width="30">
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_ListBoxTextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsStatusON}" Value="False">
<Setter Property="FontStyle" Value="Oblique"/>
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsStatusON}" Value="True">
<Setter Property="Foreground" Value="black"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal">
<Image Source="{Binding ImgPark}" Height="20" Stretch="Uniform"/>
<TextBlock Text="{Binding CountInPark}" Height="20" Width="30">
<TextBlock.Style>
<Style TargetType="TextBlock" BasedOn="{StaticResource OmagCut_ListBoxTextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsStatusON}" Value="False">
<Setter Property="FontStyle" Value="Oblique"/>
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsStatusON}" Value="True">
<Setter Property="Foreground" Value="black"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
</UniformGrid>
<Image Source="{Binding Img}" Width="120" Stretch="Uniform" Visibility="{Binding MyVisibilityImg}"/>
<Viewbox Name="ViewBoxPark" Visibility="{Binding MyVisibilitySvg}">
<ContentPresenter Content="{Binding LocalMyCanvas.CurrCanvas}"/>
</Viewbox>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="1" Grid.Row="4" Visibility="Collapsed">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" >
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
</Grid>
</Border>
</UserControl>
+920
View File
@@ -0,0 +1,920 @@
Imports System.ComponentModel
Imports System.Globalization
Imports System.Windows.Ink
Imports System.Xml
Imports EgtUILib
Imports OmagCUT.NestPageUC
Public Class SelParkIndWD
Private Shared m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_nCtx As Integer = -1
Public Const nIndAllOff As Integer = 999
Public Shared sActualProj As String = String.Empty
Private m_ParkIndList As New List(Of ParkInd)
Public Property ParkIndList As List(Of ParkInd)
Get
Return m_ParkIndList
End Get
Set(value As List(Of ParkInd))
m_ParkIndList = value
End Set
End Property
Sub New(Owner As Window, Optional nCtx As Integer = -1)
'Me.Owner = Owner
InitializeComponent()
If nCtx > -1 Then m_nCtx = nCtx
End Sub
Public Sub Me_Laoded() Handles Me.Loaded
' Aggiorno la lista
UpdateList()
' Imposto la selezione del primo parcheggio disponibile
UpdateDefaultSelection()
End Sub
Public Sub UpdateList()
' Carico lista dei pezzi
LoadParkInd(m_ParkIndList, m_nCtx)
ParkIndListBox.ItemsSource = m_ParkIndList
UpdateDefaultSelection()
' Forzo l'aggiornamento della grafica
ParkIndListBox.Items.Refresh()
End Sub
Public Sub UpdateDefaultSelection()
' Procedo a selezionare il primo (E FORSE ANCHE L'UNICO?) parcheggio attivo
Dim bFound As Boolean = False
For Each ItemPark As ParkInd In m_ParkIndList
If ItemPark.IsStatusON Then
ParkIndListBox.SelectedItem = ItemPark
bFound = True
Exit For
End If
Next
If Not bFound And m_ParkIndList.Count > 0 Then
m_ParkIndList(0).Status = GDB_ST.ON_
ParkIndListBox.SelectedItem = m_ParkIndList(0)
End If
'' Provedo a spegnere tutti gli altri parcheggi
'For Each ItemParkInd As ParkInd In m_ParkIndList
' If ParkIndListBox.SelectedItem.Ind <> ItemParkInd.Ind Then
' ItemParkInd.Status = GDB_ST.OFF
' SetStatusPartInParkInd(ItemParkInd)
' End If
'Next
End Sub
Private Sub ParkIndListBox_SelectionChanged() Handles ParkIndListBox.MouseLeftButtonUp
' Non so se il click sta accendeno o spegnendo quinid faccio una verifica dello stato attuale del parcheggio
Dim localParkInd As ParkInd = ParkIndListBox.SelectedItem
' Se l'elemento selezionato è attivo allora esco (perchè altrimenti lo spegnerei)
If localParkInd.IsStatusON Then Return
Dim bFound As Boolean = False
If localParkInd.Ind = nIndAllOff Then
localParkInd.Status = GDB_ST.ON_
bFound = True
End If
Dim nPartId As Integer = EgtGetFirstPart()
' Cerco il primo pezzo del parcheggio indicato
While nPartId <> GDB_ID.NULL And Not bFound
Dim sInfoParkInd As String = String.Empty
' Se i pezzi non hanno un indice di parcheggio di default vale "0"
If Not EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then sInfoParkInd = "0"
If localParkInd.Ind.ToString = sInfoParkInd Then
' Determino lo stato da assegnare al parcheggio (prendo il primo pezzo del parcheggio come riferimento)
Dim OppositStat As Integer = If(localParkInd.Status = GDB_ST.ON_, GDB_ST.OFF, GDB_ST.ON_)
localParkInd.Status = OppositStat
bFound = True
' termino la ricerca
Exit While
End If
nPartId = EgtGetNextPart(nPartId)
End While
' Assegno lo stato del parcheggio a tutti i pezzi i parcheggio
If bFound Then
SetStatusPartInParkInd(localParkInd, True, m_nCtx)
Else
' Significa che i pezzi sono tutti in macchina: quindi i pezzi sono (SICURAMENTE?) accesi
Dim OppositStat As Integer = If(localParkInd.Status = GDB_ST.ON_, GDB_ST.OFF, GDB_ST.ON_)
localParkInd.Status = OppositStat
SetStatusPartInParkInd(localParkInd, True, m_nCtx)
End If
' Se accendo un parcheggio procedo a spegnere tutto gli atri
If localParkInd.Status = GDB_ST.ON_ Then
For Each ItemParkInd As ParkInd In m_ParkIndList
If localParkInd.Ind <> ItemParkInd.Ind Then
ItemParkInd.Status = GDB_ST.OFF
SetStatusPartInParkInd(ItemParkInd, True, m_nCtx)
End If
Next
End If
EgtZoom(ZM.ALL)
End Sub
#Region "METODI SHARED per gestione della lista parcheggi"
' Restituisce il primo indice di parcheggio libero
Public Shared Function NewParkInd(Optional nCtx As Integer = -1) As Integer
' recupero il contesto corrente
Dim CurrCtx As Integer = EgtGetCurrentContext()
' recupero il contesto del progetto
Dim ProjCtx As Integer = m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()
If nCtx > -1 Then ProjCtx = nCtx
EgtSetCurrentContext(ProjCtx)
Dim LastParkInd As Integer = 0
Dim nRawId As Integer = GetCurrentRaw()
' Leggo l'indice di parcheggio dei pezzi in tavola
Dim nPartId As Integer = EgtGetFirstGroupInGroup(nRawId)
While nPartId <> GDB_ID.NULL
' Se i pezzi non hanno un indice di parcheggio
Dim sInfoParkInd As String = String.Empty
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
If IsNumeric(sInfoParkInd) Then
Dim nInfoParkIndn As Integer = CInt(sInfoParkInd)
LastParkInd = Math.Max(LastParkInd, nInfoParkIndn)
End If
End If
nPartId = EgtGetNextGroup(nPartId)
End While
' Leggo l'indice di parcheggio dei pezzi in parcheggio
nPartId = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
' Se i pezzi non hanno un indice di parcheggio (COPIA della funzione sopra)
Dim sInfoParkInd As String = String.Empty
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
If IsNumeric(sInfoParkInd) Then
Dim nInfoParkIndn As Integer = CInt(sInfoParkInd)
LastParkInd = Math.Max(LastParkInd, nInfoParkIndn)
End If
End If
nPartId = EgtGetNextPart(nPartId)
End While
' Ripristino il contesto corrente
EgtSetCurrentContext(CurrCtx)
Return LastParkInd + 1
End Function
' Gestisce lo stato dei pezzi associati al parcheggio indicato
Public Shared Sub SetStatusPartInParkInd(localParkInd As ParkInd, Optional bDraw As Boolean = True, Optional nCtx As Integer = -1)
If IsNothing(localParkInd) Then Return
' recupero il contesto corrente
Dim CurrCtx As Integer = EgtGetCurrentContext()
' recupero il contesto del progetto
Dim ProjCtx As Integer = m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()
If nCtx > -1 Then ProjCtx = nCtx
EgtSetCurrentContext(ProjCtx)
Dim nRawId As Integer = GetCurrentRaw()
' Pezzi in tavola
Dim nPartId As Integer = EgtGetFirstGroupInGroup(nRawId)
While nPartId <> GDB_ID.NULL
Dim sInfoParkInd As String = String.Empty
If Not EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then sInfoParkInd = "0"
If localParkInd.Ind.ToString = sInfoParkInd Then
' Salvo lo stato del parcheggio (per gestire la navigazione) ANCHE SE I PEZZI SONO ACCESI
EgtSetInfo(nPartId, INFO_PARKSTATUS, localParkInd.Status)
End If
nPartId = EgtGetNextGroup(nPartId)
End While
' Pezzi in parcheggio
nPartId = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
Dim sInfoParkInd As String = String.Empty
If Not EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then sInfoParkInd = "0"
If localParkInd.Ind.ToString = sInfoParkInd Then
' Setto lo stato
EgtSetStatus(nPartId, localParkInd.Status)
' Salvo lo stato (per gestire la navigazione)
EgtSetInfo(nPartId, INFO_PARKSTATUS, localParkInd.Status)
End If
nPartId = EgtGetNextPart(nPartId)
End While
If bDraw Then EgtDraw()
' Ripristino il contesto corrente
EgtSetCurrentContext(CurrCtx)
End Sub
' Restituuisce la lista dei parcheggi del progetto corrente
Public Shared Sub LoadParkInd(P_List As List(Of ParkInd), Optional nCtx As Integer = -1)
If IsNothing(P_List) Then Return
P_List.Clear()
P_List.Add(New ParkInd(nIndAllOff, "All off", 0))
' recupero il contesto corrente
Dim CurrCtx As Integer = EgtGetCurrentContext()
' recupero il contesto del progetto
Dim ProjCtx As Integer = m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()
If nCtx > -1 Then ProjCtx = nCtx
EgtSetCurrentContext(ProjCtx)
Dim nRawId As Integer = GetCurrentRaw()
' Pezzi in tavola
Dim nPartId As Integer = EgtGetFirstGroupInGroup(nRawId)
While nPartId <> GDB_ID.NULL
Dim sInfoParkInd As String = String.Empty
Dim nInfoParkInd As Integer = -1
' Recupero l'indice del parcheggio
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
nInfoParkInd = If(IsNumeric(sInfoParkInd), CInt(sInfoParkInd), -1)
Else
nInfoParkInd = 0
End If
' Se l'indice di parcheggio restituito è valido (Maggiore di -1)
If nInfoParkInd > -1 Then
' Verifico se nella lista dei parcheggi è già presente l'indice indicato
Dim localParkInd As ParkInd = P_List.Find(Function(x) x.Ind = nInfoParkInd)
' Se non trovo nessun parcheggio con questo indice allora lo aggiungo
If IsNothing(localParkInd) Then
Dim nStatus As Integer
If Not EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus) Then nStatus = GDB_ST.ON_
' EgtGetStatus(nPartId, nStatus)
P_List.Add(New ParkInd(nInfoParkInd, "Park_" & nInfoParkInd.ToString, nStatus))
End If
End If
nPartId = EgtGetNextGroup(nPartId)
End While
' Pezzi in parcheggio
nPartId = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
Dim sInfoParkInd As String = String.Empty
Dim nInfoParkInd As Integer = -1
' Recupero l'indice del parcheggio
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
nInfoParkInd = If(IsNumeric(sInfoParkInd), CInt(sInfoParkInd), -1)
Else
nInfoParkInd = 0
End If
' Se l'indice di parcheggio restituito è valido (Maggiore di -1)
If nInfoParkInd > -1 Then
' Verifico se nella lista dei parcheggi è già presente l'indice indicato
Dim localParkInd As ParkInd = P_List.Find(Function(x) x.Ind = nInfoParkInd)
' Se non trovo nessun parcheggio con questo indice allora lo aggiungo
If IsNothing(localParkInd) Then
Dim nStatus As Integer
If Not EgtGetInfo(nPartId, INFO_PARKSTATUS, nStatus) Then nStatus = GDB_ST.ON_
' EgtGetStatus(nPartId, nStatus)
P_List.Add(New ParkInd(nInfoParkInd, "Park_" & nInfoParkInd.ToString, nStatus))
End If
End If
nPartId = EgtGetNextPart(nPartId)
End While
EgtSetCurrentContext(CurrCtx)
End Sub
' Aggiorna la lista dei parcheggi, se "bDraw=true" aggiorno la scena
Public Shared Sub UpdateViewOnParkInd(Optional bDraw As Boolean = True)
' Ricarico la lista dei parcheggi
Dim ListParkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListParkInd)
' Aggiorna la vista dei parcheggi
For Each Item As ParkInd In ListParkInd
SelParkIndWD.SetStatusPartInParkInd(Item, bDraw)
Next
End Sub
' Restituisce il primo parcheggio attivo (
Public Shared Function GetCurrentParkIndSelected() As ParkInd
Dim ListParkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListParkInd)
' Procedo a selezionare il primo (E ANCHE UNICO?..a volte no..) parcheggio attivo -> guarda funzione UpdateList <-
For Each ItemPark As ParkInd In ListParkInd
If ItemPark.IsStatusON Then
Return ItemPark
End If
Next
Return Nothing
End Function
' Restitusice il nome del file immagine del parcheggio (manance solo dell'Indice di parcheggio e dell'esetensione png)
Public Shared Function GetPathCurrProj() As String
Dim nProj As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProject()
Dim sParkPath As String = m_MainWindow.GetSaveDir() & "\" & Math.Abs(nProj).ToString("D4") & "_ParkInd_"
If Not String.IsNullOrEmpty(sActualProj) Then
Dim sDir As String = System.IO.Path.GetDirectoryName(sActualProj)
Dim sFile As String = System.IO.Path.GetFileNameWithoutExtension(sActualProj)
sParkPath = sDir & "\" & sFile & "_ParkInd_"
End If
Return sParkPath
End Function
Public Shared Sub CopyImgSvg(sNewFileName As String, Optional nCtx As Integer = -1)
If sNewFileName.EndsWith(".nge") Then
sNewFileName = sNewFileName.Remove(sNewFileName.Length - 4, 4) & "_ParkInd_"
End If
Dim Extension As String = ".svg"
If Not MainWindow.m_bShowSVGParkInd Then Extension = ".png"
Dim ListParkInd As New List(Of ParkInd)
' ricarico la lista
SelParkIndWD.LoadParkInd(ListParkInd, nCtx)
'SelParkIndWD.sActualProj = Path.GetFileNameWithoutExtension(sPath)
For Each ItemParkInd As ParkInd In ListParkInd
If ItemParkInd.Ind <> 0 And ItemParkInd.Ind <> 999 And ItemParkInd.nPartInPark > 0 Then
Try
Dim sNewFile As String = sNewFileName & ItemParkInd.Ind.ToString & Extension
If MainWindow.m_bShowSVGParkInd Then
WriteMyXML(sNewFile, ItemParkInd.LocalMyCanvas)
Else
If System.IO.File.Exists(sNewFile) Then
System.IO.File.Delete(sNewFile)
End If
System.IO.File.Copy(If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img), sNewFile)
End If
Catch ex As Exception
EgtOutLog("Copia immagine " & If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img) & " di ParkInd non roiscita")
End Try
End If
Next
End Sub
#End Region ' Metodi Shared
End Class
Public Class ParkInd
Implements INotifyPropertyChanged
Private m_VisbilityAllOff As Visibility = Visibility.Hidden
Private m_Ind As Integer
Public Property Ind As Integer
Get
Return m_Ind
End Get
Set(value As Integer)
m_Ind = value
End Set
End Property
Private m_Name As String
Public Property Name As String
Get
Return m_Name
End Get
Set(value As String)
m_Name = value
End Set
End Property
Private m_Img As String = String.Empty
Public Property Img As String
Get
Return m_Img
End Get
Set(value As String)
m_Img = value
NotifyPropertyChanged("MyVisibilityImg")
End Set
End Property
Private m_Svg As String = String.Empty
Public Property Svg As String
Get
Return m_Svg
End Get
Set(value As String)
m_Svg = value
NotifyPropertyChanged("MyVisibilitySvg")
End Set
End Property
Private m_nPartInTable As Integer = 0
Public Property nPartInTable As Integer
Get
Return m_nPartInTable
End Get
Set(value As Integer)
m_nPartInTable = value
NotifyPropertyChanged(NameOf(nPartInTable))
End Set
End Property
Private m_nPartInPark As Integer = GDB_ST.ON_
Public Property nPartInPark As Integer
Get
Return m_nPartInPark
End Get
Set(value As Integer)
m_nPartInPark = value
NotifyPropertyChanged(NameOf(nPartInPark))
End Set
End Property
Public ReadOnly Property CountInTab As String
Get
Return m_nPartInTable.ToString
End Get
End Property
Public ReadOnly Property ImgTab As String
Get
Return DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\table.png"
End Get
End Property
Public ReadOnly Property CountInPark As String
Get
Return m_nPartInPark.ToString
End Get
End Property
Public ReadOnly Property ImgPark As String
Get
Return DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park.png"
End Get
End Property
Private m_Status As Integer
Public Property Status As Integer
Get
Return m_Status
End Get
Set(value As Integer)
m_Status = value
NotifyPropertyChanged(NameOf(IsStatusON))
End Set
End Property
Public ReadOnly Property IsStatusON As Boolean
Get
Return (m_Status = GDB_ST.ON_)
End Get
End Property
Public ReadOnly Property MyVisibilityTmg As Visibility
Get
Return If(Not System.IO.File.Exists(m_Img), Visibility.Collapsed, Visibility.Visible)
End Get
End Property
Public ReadOnly Property MyVisibilitySvg As Visibility
Get
Return If(Not System.IO.File.Exists(m_Svg), Visibility.Collapsed, Visibility.Visible)
End Get
End Property
Public ReadOnly Property TitleVisibility As Visibility
Get
Return If(m_Ind = 999, m_VisbilityAllOff, Visibility.Visible)
End Get
End Property
Private m_LocalMyCanvas As MyCanvas
Public ReadOnly Property LocalMyCanvas As MyCanvas
Get
Return m_LocalMyCanvas
End Get
End Property
Sub New(Ind As Integer, Name As String, Stat As Integer)
m_Ind = Ind
m_Name = Name
m_Status = Stat
' Costruisco il percorso immagine
If m_Ind = 0 Then
' Se Ind=0 allora applico il default: C:\EgtData\OmagCUT\Resources\MachineButtonsImage\NewIcons
m_Img = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_On.png"
m_Svg = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_On.svg"
ElseIf m_Ind = 999 Then
' Se Ind=0 allora applico il default: C:\EgtData\OmagCUT\Resources\MachineButtonsImage\NewIcons
m_Img = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Off.png"
m_Svg = DirectCast(Application.Current.MainWindow, MainWindow).GetResourcesDir() & "\MachineButtonsImage\NewIcons\Park_Off.svg"
Else
m_Img = SelParkIndWD.GetPathCurrProj() & m_Ind.ToString & ".png"
m_Svg = SelParkIndWD.GetPathCurrProj() & m_Ind.ToString & ".svg"
End If
If MainWindow.m_bShowSVGParkInd Then
Dim CanvWidth As Integer = 145
Dim CanvHeight As Integer = CInt(CanvWidth / 1.4)
m_LocalMyCanvas = New MyCanvas(CanvWidth, CanvHeight)
If System.IO.File.Exists(m_Svg) Then
ReadMyXML(m_Svg, m_LocalMyCanvas)
m_Img = ""
End If
Else
m_Svg = ""
End If
' Conto il numero di pezzi in Tavola
CountPartInTable()
' Conto il numero di pezzi in parcheggio
CountPartInPark()
End Sub
' Conta in numero di pezzi di questo parcheggio in Tavola
Private Sub CountPartInTable()
Dim nCount As Integer = 0
Dim nRawId As Integer = GetCurrentRaw()
' Leggo l'indice di parcheggio dei pezzi in tavola
Dim nPartId As Integer = EgtGetFirstGroupInGroup(nRawId)
While nPartId <> GDB_ID.NULL
' Aggiorno il valore del contatore
If IncreaseCounterPart(nPartId, nCount) Then
UpdateEntInCanvas(nPartId, 0.2)
End If
nPartId = EgtGetNextGroup(nPartId)
End While
m_nPartInTable = nCount
End Sub
' Conta il numero di pezzi di questo parcheggio in Parcheggio
Private Sub CountPartInPark()
Dim nCount As Integer = 0
Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL
' Aggiorno il valore del contatore
If IncreaseCounterPart(nPartId, nCount) Then
UpdateEntInCanvas(nPartId, 1)
End If
nPartId = EgtGetNextPart(nPartId)
End While
m_nPartInPark = nCount
End Sub
Private Sub UpdateEntInCanvas(nPartId, dOpacity)
If Not IsNothing(m_LocalMyCanvas) Then
' modifico il colore del pezzo nel SVG
Dim nIdRegion As Integer = EgtGetFirstNameInGroup(nPartId, "Region")
If nIdRegion <> GDB_ID.NULL Then
Dim nIdEnt As Integer = EgtGetFirstInGroup(nIdRegion)
While nIdEnt <> GDB_ID.NULL
If EgtGetType(nIdEnt) = GDB_TY.SRF_FRGN Then
Exit While
End If
End While
If nIdEnt <> GDB_ID.NULL Then
Dim sName As String = ""
EgtGetName(nIdEnt, sName)
Dim Idpath As MyPath = m_LocalMyCanvas.ListPath.Find(Function(x) x.id = sName)
If Not IsNothing(Idpath) Then
Idpath.fill_opacity = dOpacity
m_LocalMyCanvas.UpdateMyPath(Idpath)
Idpath.LoadPath()
NotifyPropertyChanged(NameOf(LocalMyCanvas))
End If
End If
End If
End If
End Sub
' Verifica se il pezzo passato (da parcheggio o tavola) appartiene al ParkInd corrente e quindi aggiorna il valore di nCount+=1
Private Function IncreaseCounterPart(nPartId As Integer, ByRef nCount As Integer) As Boolean
Dim bOk As Boolean = False
' Se i pezzi non hanno un indice di parcheggio
Dim sInfoParkInd As String = String.Empty
Dim nInfoParkInd As Integer = -1
' Recupero l'indice del parcheggio
If EgtGetInfo(nPartId, INFO_PARKIND, sInfoParkInd) Then
nInfoParkInd = If(IsNumeric(sInfoParkInd), CInt(sInfoParkInd), -1)
Else
nInfoParkInd = 0
End If
' Se l'indice di parcheggio restituito è valido (Maggiore di -1)
If nInfoParkInd > -1 Then
' e uguale a quallo del parcheggio correntemente selezionato
If nInfoParkInd = m_Ind Then
nCount = nCount + 1
bOk = True
End If
End If
Return bOk
End Function
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Public Sub NotifyPropertyChanged(propName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
End Sub
End Class
#Region "ELEMENTI PER LA GESTIONE SVG"
Public Class MyCanvas
Private m_CurrCanvas As New Canvas
Public Property CurrCanvas As Canvas
Get
Return m_CurrCanvas
End Get
Set(value As Canvas)
m_CurrCanvas = value
End Set
End Property
Private m_ListPath As New List(Of MyPath)
Public Property ListPath As List(Of MyPath)
Get
Return m_ListPath
End Get
Set(value As List(Of MyPath))
m_ListPath = value
End Set
End Property
Private m_ViewBoxDim As String
Public Property ViewBoxDim As String
Get
Return m_ViewBoxDim
End Get
Set(value As String)
m_ViewBoxDim = value
End Set
End Property
Sub New(Width As Integer, Height As Integer)
m_CurrCanvas.Width = Width
m_CurrCanvas.Height = Height
m_CurrCanvas.ClipToBounds = True
End Sub
Public Sub LoadCanvas()
For Each ItemPath As MyPath In m_ListPath
m_CurrCanvas.Children.Add(ItemPath.CurrPath)
Next
End Sub
Public Sub UpdateMyPath(CurrPath As MyPath)
m_CurrCanvas.Children.Remove(CurrPath.CurrPath)
m_CurrCanvas.Children.Add(CurrPath.CurrPath)
End Sub
End Class
Public Class MyPath
Private m_CurrPath As New System.Windows.Shapes.Path
Public Property CurrPath As System.Windows.Shapes.Path
Get
Return m_CurrPath
End Get
Set(value As System.Windows.Shapes.Path)
m_CurrPath = value
End Set
End Property
Private m_CanvX As Double
Public ReadOnly Property CanvX As Double
Get
Return m_CanvX
End Get
End Property
Private m_CanvY As Double
Public ReadOnly Property CanvY As Double
Get
Return m_CanvY
End Get
End Property
Private m_DimX As Double
Public ReadOnly Property DimX As Double
Get
Return m_DimX
End Get
End Property
Private m_DimY As Double
Public ReadOnly Property DimY As Double
Get
Return m_DimY
End Get
End Property
Private m_id As String
Public ReadOnly Property id As String
Get
Return m_id
End Get
End Property
Private m_d As String
Public ReadOnly Property d As String
Get
Return m_d
End Get
End Property
Private m_fill As String
Public Property fill As String
Get
Return m_fill
End Get
Set(value As String)
m_fill = value
End Set
End Property
Private m_fill_opacity As Double
Public Property fill_opacity As Double
Get
Return m_fill_opacity
End Get
Set(value As Double)
m_fill_opacity = value
End Set
End Property
Private m_stroke As String
Public Property stroke As String
Get
Return m_stroke
End Get
Set(value As String)
m_stroke = value
End Set
End Property
Private m_stroke_opacity As Double
Public Property stroke_opacity As Double
Get
Return m_stroke_opacity
End Get
Set(value As Double)
m_stroke_opacity = value
End Set
End Property
Private m_stroke_width As Double
Public Property stroke_width As Double
Get
Return m_stroke_width
End Get
Set(value As Double)
m_stroke_width = value
End Set
End Property
Sub New(Id As String, D As String, CanvX As Double, CanvY As Double, DimX As Double, DimY As Double, Fill As String, FillOpacity As Double, Stroke As String, StrokeOpacity As Double)
m_id = Id
m_d = D
m_CanvX = CanvX
m_CanvY = CanvY
m_DimX = DimX
m_DimY = DimY
m_fill = Fill
m_fill_opacity = FillOpacity
m_stroke = Stroke
m_stroke_opacity = StrokeOpacity
LoadPath()
End Sub
Public Sub LoadPath()
' Carico la geometria
m_CurrPath.Data = Geometry.Parse(d)
' Carico il colore di sfondo
SetBrushFromRGBString(m_fill, m_CurrPath.Fill)
' Applico l'opacità della superificie
m_CurrPath.Opacity = m_fill_opacity
' Calcolo e applico la traslazione e la scalatura
Dim myTransformGroup As New TransformGroup()
Dim ScaleX As Double = m_CanvX / DimX
Dim ScaleY As Double = m_CanvY / DimY
Dim OffX As Double = (m_CanvX - Math.Min(ScaleX, ScaleY) * DimX) / 2
Dim OffY As Double = (m_CanvY - Math.Min(ScaleX, ScaleY) * DimY) / 2
myTransformGroup.Children.Add(New ScaleTransform(Math.Min(ScaleX, ScaleY), Math.Min(ScaleX, ScaleY)))
myTransformGroup.Children.Add(New TranslateTransform(OffX, OffY))
m_CurrPath.RenderTransform = myTransformGroup
End Sub
Private Sub SetBrushFromRGBString(sFill As String, ByRef brFill As Brush)
If String.IsNullOrEmpty(sFill) Then
brFill = Brushes.DarkRed
Return
End If
Dim s1 As String = sFill
If s1.Contains("rgb") Then
s1 = s1.Replace("rgb(", "")
s1 = s1.Replace(")", "")
Dim s2 As String = ""
For Each s As String In s1.Split(",")
s2 &= CInt(s).ToString("x2")
Next
brFill = New BrushConverter().ConvertFrom("#" & s2)
End If
End Sub
End Class
Public Module XMLReader
Public Sub ReadMyXML(FilePath As String, Canv As MyCanvas)
'Create the XML Reader
Dim m_xmlr As XmlTextReader = New XmlTextReader(FilePath)
'Disable whitespace so that you don't have to read over whitespaces
m_xmlr.WhitespaceHandling = WhitespaceHandling.None
' Leggo la prima riga: '?xml' tag
m_xmlr.Read()
' Passo a leggere la successiva: 'svg' tag
m_xmlr.Read()
' Leggo gli attributi di questo tag (dimensioni)
Dim ViewBoxDim = m_xmlr.GetAttribute("viewBox")
Canv.ViewBoxDim = ViewBoxDim
' Elaboro i dati per avere la scalatura del disegno
Dim DimViewBox As String() = ViewBoxDim.ToString.Split(" ")
Dim DimX As Integer = Math.Abs(CInt(DimViewBox(2))) + Math.Abs(CInt(DimViewBox(0)))
Dim DimY As Integer = Math.Abs(CInt(DimViewBox(3))) + Math.Abs(CInt(DimViewBox(1)))
' Leggo in loop i tag: 'path'
While Not m_xmlr.EOF
m_xmlr.Read()
If Not m_xmlr.IsStartElement() Then
Continue While
End If
' recupero il valore dell'attributo 'id'
Dim idAttribute = m_xmlr.GetAttribute("id")
' recupero il valore dell'attributo 'd'
Dim dAttribute = m_xmlr.GetAttribute("d")
' recupero il valore dell'attributo 'fill'
Dim fillAttribute = m_xmlr.GetAttribute("fill")
' recupero il valore dell'attributo 'fill-opacity'
Dim fillOpacityAttribute = m_xmlr.GetAttribute("fill-opacity")
' recupero il valore dell'attributo 'stroke'
Dim strokeAttribute = m_xmlr.GetAttribute("stroke")
' recupero il valore dell'attributo 'stroke-opacity'
Dim strokeOpacityAttribute = m_xmlr.GetAttribute("stroke-opacity")
' recupero il valore dell'attributo 'stroke - Width'
Dim strokeWidthAttribute = m_xmlr.GetAttribute("stroke-width")
' carico l'elemento in lista solo se esiste un'immagine
If Not String.IsNullOrEmpty(idAttribute) And Not String.IsNullOrEmpty(dAttribute) Then
Dim fillOpacity As Double = 1 ' CDbl(fillOpacityAttribute)
StringToDouble(fillOpacityAttribute, fillOpacity)
Dim strokeOpacity As Double = 1 ' CDbl(strokeOpacityAttribute)
StringToDouble(strokeOpacityAttribute, strokeOpacity)
Canv.ListPath.Add(New MyPath(idAttribute, dAttribute, Canv.CurrCanvas.Width, Canv.CurrCanvas.Height, DimX, DimY, fillAttribute, fillOpacity, strokeAttribute, strokeOpacity))
End If
End While
' Libero il file dalla lettura
m_xmlr.Close()
' popolo la canvas con le Ptah che ho caricato
Canv.LoadCanvas()
End Sub
Public Sub WriteMyXML(FilePath As String, Canv As MyCanvas)
Dim _namespaceDefault As String = "http://www.w3.org/2000/svg"
Dim doc As New Xml.XmlDocument
Dim elm As System.Xml.XmlNode
Dim elmSub As System.Xml.XmlNode
Dim elmMain As Xml.XmlNode
doc = New Xml.XmlDocument
elmMain = doc.CreateElement("svg")
elmSub = elmMain.Attributes.Append(doc.CreateAttribute("viewBox"))
elmSub.Value = Canv.ViewBoxDim
elmSub = elmMain.Attributes.Append(doc.CreateAttribute("xmlns"))
elmSub.Value = _namespaceDefault
For Each itemPath As MyPath In Canv.ListPath
elm = elmMain.AppendChild(doc.CreateElement("path"))
elmSub = elm.Attributes.Append(doc.CreateAttribute("id"))
elmSub.Value = itemPath.id
elmSub = elm.Attributes.Append(doc.CreateAttribute("d"))
elmSub.Value = itemPath.d
If Not String.IsNullOrEmpty(itemPath.fill) Then
elmSub = elm.Attributes.Append(doc.CreateAttribute("fill"))
elmSub.Value = itemPath.fill
End If
If Not String.IsNullOrEmpty(itemPath.fill_opacity) Then
elmSub = elm.Attributes.Append(doc.CreateAttribute("fill-opacity"))
elmSub.Value = itemPath.fill_opacity.ToString(CultureInfo.InvariantCulture)
End If
If Not String.IsNullOrEmpty(itemPath.stroke) Then
elmSub = elm.Attributes.Append(doc.CreateAttribute("stroke"))
elmSub.Value = itemPath.stroke
End If
If Not String.IsNullOrEmpty(itemPath.stroke_opacity) Then
elmSub = elm.Attributes.Append(doc.CreateAttribute("stroke-opacity"))
elmSub.Value = itemPath.stroke_opacity.ToString(CultureInfo.InvariantCulture)
End If
If Not String.IsNullOrEmpty(itemPath.stroke_width) Then
elmSub = elm.Attributes.Append(doc.CreateAttribute("stroke-width"))
elmSub.Value = itemPath.stroke_width.ToString(CultureInfo.InvariantCulture)
End If
Next
doc.AppendChild(doc.CreateXmlDeclaration("1.0", "UTF-8", ""))
doc.AppendChild(elmMain)
doc.Save(FilePath)
End Sub
End Module
#End Region ' Elementi per la gestione SVG
+20 -1
View File
@@ -117,7 +117,7 @@ Public Module SplitAuto
End If End If
' verifico se trasformabile in un taglio di separazione (almeno da un lato) ' verifico se trasformabile in un taglio di separazione (almeno da un lato)
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_sLay = NAME_OUTLOOP And Mach.m_nInterf = FMI_TYPE.NONE Then Mach.m_sLay = NAME_OUTLOOP And ( Mach.m_nInterf And FMI_TYPE.RM) = 0 Then
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId) Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
Dim bIn As Boolean = False Dim bIn As Boolean = False
Dim bOut As Boolean = False Dim bOut As Boolean = False
@@ -129,6 +129,25 @@ Public Module SplitAuto
If nRes = 0 Then If nRes = 0 Then
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.") EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
End If End If
ElseIf (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_sLay = NAME_OUTLOOP And
(Mach.m_nInterf = FMI_TYPE.LI Or Mach.m_nInterf = FMI_TYPE.LO Or Mach.m_nInterf = FMI_TYPE.RM) Then
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
Dim bIn As Boolean = False
Dim bOut As Boolean = False
CanExtendSides(Mach, bIn, bOut)
' And (nRes And CAR_RES.LI_OK) <> 0 : da aggiungere
Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn And
Mach.m_nInterf <> FMI_TYPE.LI
' And (nRes And CAR_RES.LO_OK) <> 0 : da aggiungere come sopra
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut And
Mach.m_nInterf <> FMI_TYPE.LO
If nRes = 0 Then
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
End If
End If End If
' se trasformabile in taglio di separazione, verifico se lo è ' se trasformabile in taglio di separazione, verifico se lo è
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
+7 -1
View File
@@ -100,8 +100,14 @@
<Button Name="MoveDownBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}"> <Button Name="MoveDownBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
<Image Source="{DynamicResource DownArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/> <Image Source="{DynamicResource DownArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
</Button> </Button>
<ToggleButton Name="LayNbArrTgBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowIconToggleButton}"
Height="25" Width="25">
<Image Name="LayNbArrImg"
HorizontalAlignment="Center"
VerticalAlignment="Center" Stretch="Uniform"/>
</ToggleButton>
</Grid> </Grid>
<Grid Grid.Row="3"> <Grid Grid.Row="3">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
+76 -7
View File
@@ -1,5 +1,6 @@
Imports System.Collections.ObjectModel Imports System.Collections.ObjectModel
Imports System.ComponentModel Imports System.ComponentModel
Imports System.Drawing
Imports EgtUILib Imports EgtUILib
Public Class SplitPageUC Public Class SplitPageUC
@@ -8,6 +9,9 @@ Public Class SplitPageUC
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private WithEvents m_CurrProjPage As CurrentProjectPageUC Private WithEvents m_CurrProjPage As CurrentProjectPageUC
' Creazione converter da String a ImageSource
Private ImageConverter As New ImageSourceConverter
' Flag di pagina attiva ' Flag di pagina attiva
Private m_bActive As Boolean = False Private m_bActive As Boolean = False
' Tipo movimento dei grezzi (manuale o con testa ventosa) ' Tipo movimento dei grezzi (manuale o con testa ventosa)
@@ -183,6 +187,9 @@ Public Class SplitPageUC
m_MainWindow.m_CurrentProjectPageUC.ClearMessage() m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
End If End If
End If End If
' leggo lo stato del bottone per la visualizzazione delle etichette
LayNbArrTgBtn.IsChecked = (GetPrivateProfileInt(S_GENERAL, K_SHOWNBARROW, 1, m_MainWindow.GetIniFile()) <> 0)
SetLayNbArrTgBtn_Click()
End Sub End Sub
' preparo la lista delle lavorazioni da mostrare in interfaccia ' preparo la lista delle lavorazioni da mostrare in interfaccia
@@ -571,6 +578,11 @@ Public Class SplitPageUC
m_nDragInd = -1 m_nDragInd = -1
m_nDragType = 0 m_nDragType = 0
m_nSelected = GDB_ID.NULL m_nSelected = GDB_ID.NULL
If Not IsNothing(MachiningLsBx.SelectedItem) Then
MarkMachining(MachiningLsBx.SelectedItem.Ind, False)
EgtDraw()
End If
MachiningLsBx.SelectedIndex = -1
End If End If
End Sub End Sub
@@ -700,6 +712,11 @@ Public Class SplitPageUC
End Sub End Sub
Private Sub MachiningLsBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MachiningLsBx.SelectionChanged Private Sub MachiningLsBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MachiningLsBx.SelectionChanged
' se non attiva la modifica allora esco
If m_bShow Then
MachiningLsBx.SelectedIndex = -1
Return
End If
If MachiningLsBx.SelectedItems.Count = 0 Then Return If MachiningLsBx.SelectedItems.Count = 0 Then Return
If MachiningLsBx.SelectedItems.Count = 1 Then m_bAreHomogeneous = True If MachiningLsBx.SelectedItems.Count = 1 Then m_bAreHomogeneous = True
' creo lista ordinata dei selezionati ' creo lista ordinata dei selezionati
@@ -741,6 +758,8 @@ Public Class SplitPageUC
End Sub End Sub
Private Sub MachiningLsBx_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles MachiningLsBx.MouseDoubleClick Private Sub MachiningLsBx_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles MachiningLsBx.MouseDoubleClick
' se disabilitata la modifica allora esco
If m_bShow Then Return
If m_IsCtrlKeyDown Or m_IsShiftKeyDown Then Return If m_IsCtrlKeyDown Or m_IsShiftKeyDown Then Return
OnOffCut() OnOffCut()
End Sub End Sub
@@ -753,6 +772,25 @@ Public Class SplitPageUC
MoveItem(1) MoveItem(1)
End Sub End Sub
Private Sub LayNbArrTgBtn_Click() Handles LayNbArrTgBtn.Click
SetLayNbArrTgBtn_Click()
WritePrivateProfileString(S_GENERAL, K_SHOWNBARROW, If(LayNbArrTgBtn.IsChecked, "1", "0"), m_MainWindow.GetIniFile())
End Sub
Private Sub SetLayNbArrTgBtn_Click()
If LayNbArrTgBtn.IsChecked Then
StatusOffNumbArrow(GDB_ST.ON_)
LayNbArrTgBtn.ToolTip = "Hide"
Dim Img As ImageSource = ImageConverter.ConvertFromString("pack://application:,,,/Resources/NewIcons/LightArrowOn.png")
LayNbArrImg.Source = Img
Else
StatusOffNumbArrow(GDB_ST.OFF)
LayNbArrTgBtn.ToolTip = "Show"
Dim Img As ImageSource = ImageConverter.ConvertFromString("pack://application:,,,/Resources/NewIcons/LightArrowOff.png")
LayNbArrImg.Source = Img
End If
End Sub
Private Sub MoveItem(direction As Integer) Private Sub MoveItem(direction As Integer)
' Checking selected item ' Checking selected item
If m_CurrFirstInd = -1 OrElse MachiningLsBx.SelectedIndex < 0 Then If m_CurrFirstInd = -1 OrElse MachiningLsBx.SelectedIndex < 0 Then
@@ -1946,22 +1984,22 @@ Public Class SplitPageUC
NumberDirectionMachining(nI) NumberDirectionMachining(nI)
Next Next
' -------------------- Recupero le lavorazioni indicate come attive -------------------- ' -------------------- Recupero le lavorazioni indicate come attive -- INIZIO --------------------
Dim ActiveMachLst As New List(Of Integer) Dim ActiveMachLst As New List(Of Integer)
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
ActiveMachLst.Add(ItemSplitMach.Ind) If ItemSplitMach.bIsActive Then ActiveMachLst.Add(ItemSplitMach.Ind)
Next Next
' -------------------- Recupero le lavorazioni indicate come attive -------------------- ' -------------------- Recupero le lavorazioni indicate come attive -- FINE --------------------
' Preparo la lista degli Item ' Preparo la lista degli Item
ShowMachiningList() ShowMachiningList()
' -------------------- Riattivo le lavorazioni precedenti -------------------- ' -------------------- Riattivo le lavorazioni precedenti -- INIZIO --------------------
For Each Item As SplitMach In m_MachiningList For Each Item As SplitMach In m_MachiningList
' spengo tutte le lavorazioni disponibili
EgtSetInfo(Item.m_nId, INFO_MCH_USER_OFF, True) EgtSetInfo(Item.m_nId, INFO_MCH_USER_OFF, True)
Next Next
' riattivo solo quelle indicate come attive
For nIndex As Integer = 0 To ActiveMachLst.Count - 1 For nIndex As Integer = 0 To ActiveMachLst.Count - 1
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
If ItemSplitMach.Ind = ActiveMachLst(nIndex) Then If ItemSplitMach.Ind = ActiveMachLst(nIndex) Then
@@ -1974,7 +2012,7 @@ Public Class SplitPageUC
End If End If
Next Next
Next Next
' -------------------- Riattivo le lavorazioni precedenti -------------------- ' -------------------- Riattivo le lavorazioni precedenti -- FINE --------------------
' Aggiorno visualizzazione ' Aggiorno visualizzazione
EgtDraw() EgtDraw()
@@ -2380,6 +2418,11 @@ Public Class SplitPageUC
' Aggiungo a numero info con identificativo della lavorazione e viceversa ' Aggiungo a numero info con identificativo della lavorazione e viceversa
EgtSetInfo(nNbrId, "MId", m_MachiningList(nI).m_nId) EgtSetInfo(nNbrId, "MId", m_MachiningList(nI).m_nId)
EgtSetInfo(m_MachiningList(nI).m_nId, "NbrId", nNbrId) EgtSetInfo(m_MachiningList(nI).m_nId, "NbrId", nNbrId)
If Not LayNbArrTgBtn.IsChecked Then
EgtSetStatus(nNbrId, GDB_ST.OFF)
Else
EgtSetStatus(nNbrId, GDB_ST.ON_)
End If
End If End If
' Se taglio con lama, metto la direzione accanto al numero ' Se taglio con lama, metto la direzione accanto al numero
If m_MachiningList(nI).m_nType = MCH_OY.SAWING Then If m_MachiningList(nI).m_nType = MCH_OY.SAWING Then
@@ -2391,6 +2434,11 @@ Public Class SplitPageUC
' Aggiungo a freccia info con identificativo della lavorazione e viceversa ' Aggiungo a freccia info con identificativo della lavorazione e viceversa
EgtSetInfo(nArrId, "MId", m_MachiningList(nI).m_nId) EgtSetInfo(nArrId, "MId", m_MachiningList(nI).m_nId)
EgtSetInfo(m_MachiningList(nI).m_nId, "ArrId", nArrId) EgtSetInfo(m_MachiningList(nI).m_nId, "ArrId", nArrId)
If Not LayNbArrTgBtn.IsChecked Then
EgtSetStatus(nArrId, GDB_ST.OFF)
Else
EgtSetStatus(nArrId, GDB_ST.ON_)
End If
Else Else
m_MachiningList(nI).m_nArrId = GDB_ID.NULL m_MachiningList(nI).m_nArrId = GDB_ID.NULL
End If End If
@@ -2507,6 +2555,27 @@ Public Class SplitPageUC
EgtResetMark(nNbrId) EgtResetMark(nNbrId)
EgtResetMark(nArrId) EgtResetMark(nArrId)
End If End If
If Not LayNbArrTgBtn.IsChecked And Not bMark Then
EgtSetStatus(nNbrId, GDB_ST.OFF)
EgtSetStatus(nArrId, GDB_ST.OFF)
Else
EgtSetStatus(nNbrId, GDB_ST.ON_)
EgtSetStatus(nArrId, GDB_ST.ON_)
End If
End Sub
Private Sub StatusOffNumbArrow(Status As GDB_ST)
For Each Item As SplitMach In m_MachiningList
Dim nOperId As Integer = Item.m_nId
Dim nNbrId As Integer = Item.m_nNbrId
Dim nArrId As Integer = Item.m_nArrId
Dim nInd As Integer = m_MachiningList.IndexOf(Item)
If nInd >= 0 AndAlso nInd < m_ItemList.Count AndAlso Not m_ItemList(nInd).IsSelected Then
EgtSetStatus(nNbrId, Status)
EgtSetStatus(nArrId, Status)
End If
Next
EgtDraw()
End Sub End Sub
Private Sub ColorNumberArrow(nI As Integer) Private Sub ColorNumberArrow(nI As Integer)
+2
View File
@@ -157,6 +157,8 @@ Module ConstGen
' Info per identificazione gruppo pezzi ' Info per identificazione gruppo pezzi
Public Const INFO_REFGROUP As String = "RefGroup" Public Const INFO_REFGROUP As String = "RefGroup"
Public Const INFO_COUNTERLY As String = "CounterPz" Public Const INFO_COUNTERLY As String = "CounterPz"
Public Const INFO_PARKIND As String = "ParkInd"
Public Const INFO_PARKSTATUS As String = "ParkStatus"
' Contrassegno di progetto OmagCut ' Contrassegno di progetto OmagCut
Public Const NAME_PROJMARK As String = "OmagCut" Public Const NAME_PROJMARK As String = "OmagCut"
+8
View File
@@ -54,6 +54,9 @@ Module ConstIni
Public Const K_FRACTIONPATTERN As String = "FractionPattern" Public Const K_FRACTIONPATTERN As String = "FractionPattern"
Public Const K_PRECISION As String = "Precision" Public Const K_PRECISION As String = "Precision"
Public Const K_QUITDRAWPAGE As String = "QuitDrawPage" Public Const K_QUITDRAWPAGE As String = "QuitDrawPage"
Public Const K_SHOWNBARROW As String = "ShowNbArrow"
Public Const K_SHOWEXPIREASSITANCE As String = "ShowExpireAssistance"
Public Const K_ENABLEDXFPARK As String = "EnableDXFPark"
Public Const S_LANGUAGES As String = "Languages" Public Const S_LANGUAGES As String = "Languages"
Public Const K_LANGUAGE As String = "Language" Public Const K_LANGUAGE As String = "Language"
@@ -87,6 +90,7 @@ Module ConstIni
Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels" Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels"
Public Const K_ZOOMWIN As String = "ZoomWin" Public Const K_ZOOMWIN As String = "ZoomWin"
Public Const K_DISTLINE As String = "DistLine" Public Const K_DISTLINE As String = "DistLine"
Public Const K_ORTOGRAPHIC As String = "OrtoGraphic"
Public Const S_ALZFRONT As String = "Alz&Front" Public Const S_ALZFRONT As String = "Alz&Front"
Public Const K_ALZFRONT As String = "Alz&Front" Public Const K_ALZFRONT As String = "Alz&Front"
@@ -208,6 +212,7 @@ Module ConstIni
Public Const K_OFFSXY As String = "OffsXY" Public Const K_OFFSXY As String = "OffsXY"
Public Const K_OFFSYY As String = "OffsYY" Public Const K_OFFSYY As String = "OffsYY"
Public Const K_OFFSXINTERY As String = "OffsYInterY" Public Const K_OFFSXINTERY As String = "OffsYInterY"
Public Const K_OFFSXINTERYSAWTH As String = "OffsYInterYSawTh"
Public Const K_STARTTRIM As String = "StartTrim" Public Const K_STARTTRIM As String = "StartTrim"
Public Const K_ENDTRIM As String = "EndTrim" Public Const K_ENDTRIM As String = "EndTrim"
Public Const K_OTHERSIDE As String = "OtherSide" Public Const K_OTHERSIDE As String = "OtherSide"
@@ -232,10 +237,13 @@ Module ConstIni
Public Const K_OTHERREFTABX As String = "OtherRefTabX" Public Const K_OTHERREFTABX As String = "OtherRefTabX"
Public Const K_OTHERREFTABY As String = "OtherRefTabY" Public Const K_OTHERREFTABY As String = "OtherRefTabY"
Public Const K_OTHERREFTABPOS As String = "OtherRefTabPos" Public Const K_OTHERREFTABPOS As String = "OtherRefTabPos"
Public Const K_REFTAB As String = "RefTab"
Public Const K_CURRENTREFTAB As String = "CurrRefTab"
Public Const S_RAWMOVE As String = "RawMove" Public Const S_RAWMOVE As String = "RawMove"
Public Const K_RAWSTEP As String = "Step" Public Const K_RAWSTEP As String = "Step"
Public Const K_EXTRASTEP As String = "ExtraStep"
Public Const K_RAWROTATION As String = "Rotation" Public Const K_RAWROTATION As String = "Rotation"
Public Const K_PERPENDICULAR As String = "Perpendicular" Public Const K_PERPENDICULAR As String = "Perpendicular"
+5
View File
@@ -32,6 +32,7 @@
Public Const K_A10ID As String = "A10Id" Public Const K_A10ID As String = "A10Id"
Public Const K_DELTA_C As String = "DeltaC" Public Const K_DELTA_C As String = "DeltaC"
Public Const K_ININCHES As String = "InInches" Public Const K_ININCHES As String = "InInches"
Public Const K_CPOS As String = "CPos"
Public Const S_NCSIEMENS As String = "NcSiemens" Public Const S_NCSIEMENS As String = "NcSiemens"
Public Const K_COMM_NAME As String = "CommName" Public Const K_COMM_NAME As String = "CommName"
@@ -182,6 +183,10 @@
Public Const K_PHOTO_TAB2_OFFSETY As String = "Tab2OffsetY" Public Const K_PHOTO_TAB2_OFFSETY As String = "Tab2OffsetY"
Public Const K_PHOTO_HQ_OFFSETX As String = "HQOffsetX" Public Const K_PHOTO_HQ_OFFSETX As String = "HQOffsetX"
Public Const K_PHOTO_HQ_OFFSETY As String = "HQOffsetY" Public Const K_PHOTO_HQ_OFFSETY As String = "HQOffsetY"
Public Const K_CAMERA_DIRECT_CMD As String = "CameraDirectCmd"
Public Const K_CAMERA_STATE_VAR As String = "CameraStateVar"
Public Const K_ENABELE_GOHOME_FOR_PHOTO As String = "EnableGoHomeForPhoto"
Public Const K_PENDIG_TIME_FOR_PHOTO As String = "PendigTimeForPhoto"
Public Const S_TOOLS As String = "Tools" Public Const S_TOOLS As String = "Tools"
Public Const K_DRILLBIT As String = "Drillbit" Public Const K_DRILLBIT As String = "Drillbit"
+1 -1
View File
@@ -482,7 +482,7 @@ Public Class DirectCutPageUC
Private Sub ManualModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualModeBtn.Click Private Sub ManualModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualModeBtn.Click
' Imposto modalità manuale della macchina ' Imposto modalità manuale della macchina
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale Dim nResult As Short = m_MainWindow.m_DirectCutPageUC.m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
End Sub End Sub
+2 -2
View File
@@ -532,8 +532,8 @@ Public Class SawTestUC
vtPerp.Rotate(Vector3d.Z_AX, +90) vtPerp.Rotate(Vector3d.Z_AX, +90)
Else Else
m_CurrProjPage.ClearMessage() m_CurrProjPage.ClearMessage()
' 91144 = Set machining side: right or left. ' 91143 = Set machining side: right or left.
m_CurrProjPage.SetInfoMessage(EgtMsg(91144)) m_CurrProjPage.SetInfoMessage(EgtMsg(91143))
End If End If
Dim ptEnd As Point3d = ptStart + vtDir * m_dLen + vtPerp * dThick Dim ptEnd As Point3d = ptStart + vtDir * m_dLen + vtPerp * dThick
Dim dLen2 As Double = m_dLen / 2 Dim dLen2 As Double = m_dLen / 2
+7 -3
View File
@@ -350,6 +350,7 @@ Public Class SquaringUC
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType) EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
Dim dThick As Double = 0 Dim dThick As Double = 0
EgtTdbGetCurrToolParam(If(nType = MCH_TY.SAW_STD, MCH_TP.THICK, MCH_TP.DIAM), dThick) EgtTdbGetCurrToolParam(If(nType = MCH_TY.SAW_STD, MCH_TP.THICK, MCH_TP.DIAM), dThick)
EgtOutLog("Curr tool type in use for squaring: " & If(nType = MCH_TY.SAW_STD, "SAW_STD", "NOT 'SAW_STD'"))
' Ricalcolo lo spessore in base all'inclinazione ' Ricalcolo lo spessore in base all'inclinazione
dThick = dThick / Math.Cos(m_dAngV * Math.PI / 180) dThick = dThick / Math.Cos(m_dAngV * Math.PI / 180)
' Imposto angolo di rotazione a seconda del lato dei tagli paralleli ' Imposto angolo di rotazione a seconda del lato dei tagli paralleli
@@ -367,9 +368,12 @@ Public Class SquaringUC
If dDimPzY <> 0 And nNumPzY > 0 And dDimPzX <> 0 And nNumPzX > 0 Then If dDimPzY <> 0 And nNumPzY > 0 And dDimPzX <> 0 And nNumPzX > 0 Then
Dim dLenX As Double = dThick + (dDimPzX + dThick) * nNumPzX Dim dLenX As Double = dThick + (dDimPzX + dThick) * nNumPzX
Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX + 0.1) Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX + 0.1)
' Imposto affondamento e angolo di fianco sul taglio ' Imposto affondamento e angolo di fianco sul taglio (solo se non lama STD)
EgtSetInfo(nCutParaId, INFO_DEPTH, m_dDepth) If Not nType = MCH_TY.SAW_STD Then
EgtSetInfo(nCutParaId, INFO_SIDE_ANGLE, m_dAngV) EgtSetInfo(nCutParaId, INFO_DEPTH, m_dDepth)
EgtSetInfo(nCutParaId, INFO_SIDE_ANGLE, m_dAngV)
EgtOutLog("Curr tool in use is not of type SAW_STD: Depth is limited to raw thickness")
End If
' Allungo la geometria ' Allungo la geometria
EgtExtendCurveStartByLen(nCutParaId, m_dOffsetSquaring + m_dExtraLength) EgtExtendCurveStartByLen(nCutParaId, m_dOffsetSquaring + m_dExtraLength)
EgtExtendCurveEndByLen(nCutParaId, m_dOffsetSquaring + +m_dExtraLength) EgtExtendCurveEndByLen(nCutParaId, m_dOffsetSquaring + +m_dExtraLength)
+20
View File
@@ -1185,6 +1185,8 @@ Public Class DrawPageUC
Else Else
MakeMultipleInsert(InsNbr, sPartName) MakeMultipleInsert(InsNbr, sPartName)
End If End If
' Attivo il parcheggio dei pezzi Draw (per il corretto posizionamento nella scena)
ActivateParkIndZero()
Dim bExitPage As Boolean = GetPrivateProfileInt(S_GENERAL, K_QUITDRAWPAGE, 1, m_MainWindow.GetIniFile) <> 0 Dim bExitPage As Boolean = GetPrivateProfileInt(S_GENERAL, K_QUITDRAWPAGE, 1, m_MainWindow.GetIniFile) <> 0
' Se Shift premuto eseguo il contrario ' Se Shift premuto eseguo il contrario
If Keyboard.Modifiers And ModifierKeys.Shift Then If Keyboard.Modifiers And ModifierKeys.Shift Then
@@ -1239,6 +1241,24 @@ Public Class DrawPageUC
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC) m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC) m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut) m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
End Sub
Private Sub ActivateParkIndZero()
' Aggiorno la gestione dei parcheggi: spengo tutti i parcheggi tranne quello dei pezzi disegnati "0"
Dim ListParkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListParkInd)
For Each ItemParkInd As ParkInd In ListParkInd
If ItemParkInd.Ind = 0 Then
ItemParkInd.Status = GDB_ST.ON_
Else
ItemParkInd.Status = GDB_ST.OFF
End If
Next
' Aggiorno lo stato dei pezzi
For Each Item As ParkInd In ListParkInd
SelParkIndWD.SetStatusPartInParkInd(Item, False)
Next
End Sub End Sub
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
+180 -64
View File
@@ -38,6 +38,8 @@ Public Class ImportPageUC
Private Const FT_TRF As Integer = 51 Private Const FT_TRF As Integer = 51
' Costante per formato CUT ' Costante per formato CUT
Private Const FT_CUT As Integer = 52 Private Const FT_CUT As Integer = 52
' Indice del parcheggio corrente
Private NewParkInd As Integer = 0
' Indentificativo del pezzo selezionato ' Indentificativo del pezzo selezionato
Private m_nSelectedPart As Integer = GDB_ID.NULL Private m_nSelectedPart As Integer = GDB_ID.NULL
@@ -82,11 +84,11 @@ Public Class ImportPageUC
ResetBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 3) 'Reset ResetBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 3) 'Reset
mmBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 4) 'mm mmBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 4) 'mm
inchBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 5) 'inch inchBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 5) 'inch
OrderListBtn.Content = EgtMsg( 90398) 'Dati Csv OrderListBtn.Content = EgtMsg(90398) 'Dati Csv
TopBtn.Content = EgtMsg( 90384) 'Indica Lato Sopra TopBtn.Content = EgtMsg(90384) 'Indica Lato Sopra
PartNumTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 15) 'Numero PartNumTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 15) 'Numero
SideAngleBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 7) 'Inclina lati SideAngleBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 7) 'Inclina lati
FiloTopBtn.Content = EgtMsg( 90400) 'Filo Top FiloTopBtn.Content = EgtMsg(90400) 'Filo Top
DripCutBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 8) 'Incidi da sotto DripCutBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 8) 'Incidi da sotto
EngraveBtn.Content = "Engrave" EngraveBtn.Content = "Engrave"
DripDrillBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 14) 'Foro da sotto DripDrillBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 14) 'Foro da sotto
@@ -98,7 +100,6 @@ Public Class ImportPageUC
End Sub End Sub
Private Sub ImportPage_Loaded(sender As Object, e As RoutedEventArgs) Private Sub ImportPage_Loaded(sender As Object, e As RoutedEventArgs)
' abilitazione importazione TRF ' abilitazione importazione TRF
m_bEnableTrf = (m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut And m_bEnableTrf = (m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut And
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.TRF_IMPORT)) m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.TRF_IMPORT))
@@ -160,7 +161,7 @@ Public Class ImportPageUC
' Verifico esistenza Cad 2d ' Verifico esistenza Cad 2d
GetPrivateProfileString(S_CAD2D, K_CAD2D_NAME, "", m_sCad2dName, m_MainWindow.GetIniFile()) GetPrivateProfileString(S_CAD2D, K_CAD2D_NAME, "", m_sCad2dName, m_MainWindow.GetIniFile())
GetPrivateProfileString(S_CAD2D, K_CAD2D_EXEPATH, "", m_sCad2dPath, m_MainWindow.GetIniFile()) GetPrivateProfileString(S_CAD2D, K_CAD2D_EXEPATH, "", m_sCad2dPath, m_MainWindow.GetIniFile())
Cad2dBtn.IsEnabled = My.Computer.FileSystem.FileExists( m_sCad2dPath) Cad2dBtn.IsEnabled = My.Computer.FileSystem.FileExists(m_sCad2dPath)
' Pulisco tutto ' Pulisco tutto
ClearView() ClearView()
@@ -179,7 +180,7 @@ Public Class ImportPageUC
UseClosedCurveBtn.Visibility = Windows.Visibility.Visible UseClosedCurveBtn.Visibility = Windows.Visibility.Visible
ResetBtn.Visibility = Windows.Visibility.Visible ResetBtn.Visibility = Windows.Visibility.Visible
SideAngleBtn.Visibility = Windows.Visibility.Visible SideAngleBtn.Visibility = Windows.Visibility.Visible
OrderListBtn.Visibility = If( m_bEnableOrderList, Windows.Visibility.Visible, Windows.Visibility.Hidden) OrderListBtn.Visibility = If(m_bEnableOrderList, Windows.Visibility.Visible, Windows.Visibility.Hidden)
TopBtn.Visibility = Windows.Visibility.Visible TopBtn.Visibility = Windows.Visibility.Visible
PartNumberGrd.Visibility = Windows.Visibility.Visible PartNumberGrd.Visibility = Windows.Visibility.Visible
Else Else
@@ -189,7 +190,7 @@ Public Class ImportPageUC
ResetBtn.Visibility = Windows.Visibility.Hidden ResetBtn.Visibility = Windows.Visibility.Hidden
SideAngleBtn.Visibility = Windows.Visibility.Hidden SideAngleBtn.Visibility = Windows.Visibility.Hidden
OrderListBtn.Visibility = Windows.Visibility.Hidden OrderListBtn.Visibility = Windows.Visibility.Hidden
TopBtn.Visibility = Windows.Visibility.Hidden TopBtn.Visibility = Windows.Visibility.Hidden
PartNumberGrd.Visibility = Windows.Visibility.Hidden PartNumberGrd.Visibility = Windows.Visibility.Hidden
End If End If
mmBtn.IsEnabled = True mmBtn.IsEnabled = True
@@ -206,6 +207,8 @@ Public Class ImportPageUC
PartNumTxBx.Text = "1" PartNumTxBx.Text = "1"
' disabilito ok ' disabilito ok
OkBtn.IsEnabled = False OkBtn.IsEnabled = False
' Azzero l'idice di parcheggio
NewParkInd = 0
End Sub End Sub
Private Sub LoadGridData() Private Sub LoadGridData()
@@ -456,7 +459,7 @@ Public Class ImportPageUC
ElseIf DripDrillBtn.IsChecked() Then ElseIf DripDrillBtn.IsChecked() Then
OnMouseDownSceneUnderDrill(e) OnMouseDownSceneUnderDrill(e)
ElseIf FiloTopBtn.IsChecked() Then ElseIf FiloTopBtn.IsChecked() Then
OnMouseDownSceneFiloTop( e) OnMouseDownSceneFiloTop(e)
End If End If
End Sub End Sub
@@ -586,14 +589,14 @@ Public Class ImportPageUC
EgtDeselectObj(nId) EgtDeselectObj(nId)
EgtDeselectObj(nLayId) EgtDeselectObj(nLayId)
Dim sLayName As String = "" Dim sLayName As String = ""
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
EgtRemoveInfo( nLayId, INFO_FILOTOP) EgtRemoveInfo(nLayId, INFO_FILOTOP)
EgtRemoveInfo( nLayId, INFO_OFFSET) EgtRemoveInfo(nLayId, INFO_OFFSET)
EgtRemoveInfo( nLayId, INFO_DEPTH) EgtRemoveInfo(nLayId, INFO_DEPTH)
Dim nEntId As Integer = EgtGetFirstInGroup( nLayId) Dim nEntId As Integer = EgtGetFirstInGroup(nLayId)
While nEntId <> GDB_ID.NULL While nEntId <> GDB_ID.NULL
EgtSetColor(nEntId, New Color3d(127, 63, 0)) EgtSetColor(nEntId, New Color3d(127, 63, 0))
nEntId = EgtGetNext( nEntId) nEntId = EgtGetNext(nEntId)
End While End While
m_DeselectListHole.Add(nLayId) m_DeselectListHole.Add(nLayId)
m_SelListHole.Remove(nLayId) m_SelListHole.Remove(nLayId)
@@ -602,16 +605,16 @@ Public Class ImportPageUC
Dim nLayId As Integer = GDB_ID.NULL Dim nLayId As Integer = GDB_ID.NULL
EgtGetInfo(nId, "ID", nLayId) EgtGetInfo(nId, "ID", nLayId)
Dim sLayName As String = "" Dim sLayName As String = ""
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP Then If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP Then
EgtSelectObj( nId) EgtSelectObj(nId)
EgtSelectObj( nLayId) EgtSelectObj(nLayId)
EgtSetInfo( nLayId, INFO_FILOTOP, 1) EgtSetInfo(nLayId, INFO_FILOTOP, 1)
EgtSetInfo( nLayId, INFO_OFFSET, m_FiloTopUC.FiloTopOffset) EgtSetInfo(nLayId, INFO_OFFSET, m_FiloTopUC.FiloTopOffset)
EgtSetInfo( nLayId, INFO_DEPTH, m_FiloTopUC.FiloTopDepth) EgtSetInfo(nLayId, INFO_DEPTH, m_FiloTopUC.FiloTopDepth)
Dim nEntId As Integer = EgtGetFirstInGroup( nLayId) Dim nEntId As Integer = EgtGetFirstInGroup(nLayId)
While nEntId <> GDB_ID.NULL While nEntId <> GDB_ID.NULL
EgtSetColor(nEntId, New Color3d(255, 255, 255)) EgtSetColor(nEntId, New Color3d(255, 255, 255))
nEntId = EgtGetNext( nEntId) nEntId = EgtGetNext(nEntId)
End While End While
m_SelListHole.Add(nLayId) m_SelListHole.Add(nLayId)
m_DeselectListHole.Remove(nLayId) m_DeselectListHole.Remove(nLayId)
@@ -660,7 +663,7 @@ Public Class ImportPageUC
' Ciclo sulle regioni ' Ciclo sulle regioni
Dim EntId As Integer = EgtGetFirstInGroup(RegionId) Dim EntId As Integer = EgtGetFirstInGroup(RegionId)
While EntId <> GDB_ID.NULL While EntId <> GDB_ID.NULL
If EgtGetType( EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, InsertColor) If EgtGetType(EntId) = GDB_TY.SRF_FRGN Then EgtSetColor(EntId, InsertColor)
EntId = EgtGetNext(EntId) EntId = EgtGetNext(EntId)
End While End While
RegionId = EgtGetNextName(PartId, NAME_REGION) RegionId = EgtGetNextName(PartId, NAME_REGION)
@@ -856,20 +859,38 @@ Public Class ImportPageUC
End Sub End Sub
Private Sub OrderListBtn_Click(sender As Object, e As RoutedEventArgs) Handles OrderListBtn.Click Private Sub OrderListBtn_Click(sender As Object, e As RoutedEventArgs) Handles OrderListBtn.Click
Dim DlgOrderList As New CompoCsvData( m_MainWindow) Dim DlgOrderList As New CompoCsvData(m_MainWindow)
DlgOrderList.SetData( m_sOrder, m_sList) DlgOrderList.SetData(m_sOrder, m_sList)
If DlgOrderList.ShowDialog() Then If DlgOrderList.ShowDialog() Then
DlgOrderList.GetData( m_sOrder, m_sList) DlgOrderList.GetData(m_sOrder, m_sList)
End If End If
End Sub End Sub
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
m_SceneButtons.MeasureBtn.IsChecked = False m_SceneButtons.MeasureBtn.IsChecked = False
' Genero l'immagine solo se è abilitata la modalità
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then Print()
' Se import per pezzi piatti ' Se import per pezzi piatti
If m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut Then If m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut Then
' Eseguo importazione pezzi piatti ' Eseguo importazione pezzi piatti
LoadFlatParts() LoadFlatParts()
' altrimenti import per cornici
' Aggiorno la gestione dei parcheggi: spengo tutti i parcheggi tranne quello indicato
Dim ListParkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListParkInd)
For Each ItemParkInd As ParkInd In ListParkInd
If ItemParkInd.Ind = NewParkInd Then
ItemParkInd.Status = GDB_ST.ON_
Else
ItemParkInd.Status = GDB_ST.OFF
End If
Next
' Aggiorno lo stato dei pezzi
For Each Item As ParkInd In ListParkInd
SelParkIndWD.SetStatusPartInParkInd(Item, False)
Next
' altrimenti import per cornici
Else Else
LoadFrame() LoadFrame()
End If End If
@@ -879,6 +900,80 @@ Public Class ImportPageUC
m_MainWindow.m_ActivePage = m_MainWindow.m_PrevActivePage m_MainWindow.m_ActivePage = m_MainWindow.m_PrevActivePage
End Sub End Sub
' Creo una immagine del progetto da importare salvato nel percorso di progetto "..\(#ProjInd)_ParkInd_(#ParkInd).png"
Public Sub Print()
' recupero la lista degli indici di parcheggio
NewParkInd = SelParkIndWD.NewParkInd()
Dim SM_Select As SM = SM.SHADING
' SM_Select = SM.HIDDENLINE
' SM_Select = SM.WIREFRAME
Dim nProj As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProject()
Dim sPath As String = SelParkIndWD.GetPathCurrProj() & NewParkInd.ToString & ".png"
' Recupero le dimensioni dell'area di stampa
Dim dW As Integer = 120
Dim dH As Integer = 120
If Not MainWindow.m_bShowSVGParkInd Then
Try
' Prendo l'immagine corrente per la stampa
Dim colBackTopColor As Color3d = GetBackTopColor()
Dim colBackBottomColor As Color3d = GetBackBottomColor()
' Recupero le dimensioni correnti della pagina di disegno
Dim nImgW As Integer = m_MainWindow.m_CurrentProjectPageUC.ActualWidth()
Dim nImgH As Integer = m_MainWindow.m_CurrentProjectPageUC.ActualHeight()
If Not EgtGetImage(SM_Select, colBackTopColor, colBackBottomColor, nImgW, nImgH, sPath) Then
' Error in creating the print image
EgtOutLog(EgtMsg(50181))
EgtSetLineAttribs(1)
Return
End If
EgtSetLineAttribs(1)
'Metodo complesso di stampa che permette di rilasciare il file :
'carico la bitmap e la metto in uno stream in memoria
Dim stream As System.IO.Stream = New System.IO.MemoryStream()
Dim bitmap As System.Drawing.Bitmap = New System.Drawing.Bitmap(sPath)
bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png)
bitmap.Dispose()
' la sposto in una BitmapImage
Dim bitImage As New System.Windows.Media.Imaging.BitmapImage()
bitImage.BeginInit()
bitImage.StreamSource = stream
bitImage.EndInit()
' la sposto in un Visual Control
Dim tmpImg As New Image
tmpImg.BeginInit()
tmpImg.Source = bitImage
tmpImg.Stretch = Stretch.Uniform
tmpImg.EndInit()
' eseguo la stampa
Catch
' Rrror in executing print
EgtOutLog(EgtMsg(50182))
End Try
Else
' Assegno dei nomi ai pezzi (Da controllare bene se funzione sempre)...riassegno i nomi dopo?
Dim nIdPart As Integer = EgtGetFirstPart()
Dim nIndex As Integer = 0
While nIdPart <> GDB_ID.NULL
' recupero il primo layer del part
Dim nIdLay As Integer = EgtGetFirstLayer(nIdPart)
While nIdLay <> GDB_ID.NULL
Dim nIdEnt As Integer = EgtGetFirstInGroup(nIdLay)
While nIdEnt <> GDB_ID.NULL
EgtSetName(nIdEnt, nIndex.ToString)
nIdEnt = EgtGetNext(nIdEnt)
nIndex = nIndex + 1
End While
nIdLay = EgtGetNextLayer(nIdLay)
End While
nIdPart = EgtGetNextPart(nIdPart)
End While
EgtExportSvg(GDB_ID.ROOT, SelParkIndWD.GetPathCurrProj() & NewParkInd.ToString & ".svg")
End If
End Sub
Private Sub LoadFlatParts() Private Sub LoadFlatParts()
' Cancello regioni di selezione dai pezzi ' Cancello regioni di selezione dai pezzi
Dim PartId As Integer = EgtGetFirstPart() Dim PartId As Integer = EgtGetFirstPart()
@@ -951,21 +1046,36 @@ Public Class ImportPageUC
If My.Computer.FileSystem.FileExists(sTmpFile) Then If My.Computer.FileSystem.FileExists(sTmpFile) Then
My.Computer.FileSystem.DeleteFile(sTmpFile) My.Computer.FileSystem.DeleteFile(sTmpFile)
End If End If
' Calcolo l'area dei pezzi inseriti ' Calcolo l'area dei pezzi inseriti
Dim dNewArea As Double = 0 Dim dNewArea As Double = 0
Dim nId As Integer = nFirstId Dim nId As Integer = nFirstId
While nId <> GDB_ID.NULL While nId <> GDB_ID.NULL
' Definisco l'indice di parcheggio asssganto al pezzo
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
EgtSetInfo(nId, INFO_PARKIND, NewParkInd.ToString)
' Imposto lo stato
EgtSetStatus(nId, GDB_ST.ON_)
' Salvo lo stato (per gestire la navigazione)
EgtSetInfo(nId, INFO_PARKSTATUS, GDB_ST.ON_)
End If
dNewArea += GeomCalc.GetPartArea(nId) dNewArea += GeomCalc.GetPartArea(nId)
' Passo al pezzo successivo ' Passo al pezzo successivo
nId = EgtGetNextPart(nId) nId = EgtGetNextPart(nId)
End While End While
' Nascondo tutti i pezzi inseriti (per evitare interferenze con pezzi in fase di parcheggio) ' Nascondo tutti i pezzi inseriti (per evitare interferenze con pezzi in fase di parcheggio)
nId = nFirstId nId = nFirstId
Dim GlobBBox As New BBox3d
While nId <> GDB_ID.NULL While nId <> GDB_ID.NULL
Dim bboxTemp As New BBox3d
EgtGetBBox(nId, 0, bboxTemp)
GlobBBox.Add(bboxTemp)
EgtSetStatus(nId, GDB_ST.OFF) EgtSetStatus(nId, GDB_ST.OFF)
' Passo al pezzo successivo ' Passo al pezzo successivo
nId = EgtGetNextPart(nId) nId = EgtGetNextPart(nId)
End While End While
Dim x As Double = GlobBBox.DimX
Dim Y As Double = GlobBBox.DimY
' Ciclo sui pezzi inseriti ' Ciclo sui pezzi inseriti
nId = nFirstId nId = nFirstId
@@ -1002,7 +1112,12 @@ Public Class ImportPageUC
' Imposto path di provenienza ' Imposto path di provenienza
EgtSetInfo(nId, INFO_SOU_PATH, IO.Path.Combine(m_sCurrDir, m_sCurrFile)) EgtSetInfo(nId, INFO_SOU_PATH, IO.Path.Combine(m_sCurrDir, m_sCurrFile))
' Inserisco in parcheggio ' Inserisco in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId, True) If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
' Mantengo la posizione relativa tra i pezzi
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePartDXF(nId, x, Y)
Else
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId, True)
End If
' Recupero Id di pezzo successivo ' Recupero Id di pezzo successivo
Dim nNextId As Integer = EgtGetNextPart(nId) Dim nNextId As Integer = EgtGetNextPart(nId)
' Se richiesto posizionamento diretto, lo eseguo ' Se richiesto posizionamento diretto, lo eseguo
@@ -1425,8 +1540,9 @@ Public Class ImportPageUC
If nType = GDB_TY.CRV_LINE Or nType = GDB_TY.CRV_ARC Or nType = GDB_TY.CRV_COMPO Then If nType = GDB_TY.CRV_LINE Or nType = GDB_TY.CRV_ARC Or nType = GDB_TY.CRV_COMPO Then
vCrvId.Add(nCrvId) vCrvId.Add(nCrvId)
End If End If
ElseIf DripDrillBtn.IsChecked ElseIf DripDrillBtn.IsChecked Then
if nType = GDB_TY.CRV_ARC
If nType = GDB_TY.CRV_ARC Then
vCrvId.Add(nCrvId) vCrvId.Add(nCrvId)
End If End If
End If End If
@@ -1452,11 +1568,11 @@ Public Class ImportPageUC
Private Sub Cad2dBtn_Click(sender As Object, e As RoutedEventArgs) Handles Cad2dBtn.Click Private Sub Cad2dBtn_Click(sender As Object, e As RoutedEventArgs) Handles Cad2dBtn.Click
Dim ProcsCad2d As Process() = Process.GetProcessesByName( m_sCad2dName) Dim ProcsCad2d As Process() = Process.GetProcessesByName(m_sCad2dName)
If ProcsCad2d.Length() > 0 Then If ProcsCad2d.Length() > 0 Then
ShowWindow( ProcsCad2d(0).MainWindowHandle, 3) ShowWindow(ProcsCad2d(0).MainWindowHandle, 3)
Else Else
Process.Start( m_sCad2dPath) Process.Start(m_sCad2dPath)
End If End If
End Sub End Sub
@@ -1465,42 +1581,42 @@ End Class
Public Class IconListBoxItem Public Class IconListBoxItem
Private m_iPictureID As Integer Private m_iPictureID As Integer
Private m_sName As String Private m_sName As String
Public Property PictureID() As Integer Public Property PictureID() As Integer
Get Get
Return m_iPictureID Return m_iPictureID
End Get End Get
Set(value As Integer) Set(value As Integer)
m_iPictureID = value m_iPictureID = value
End Set End Set
End Property End Property
Public Property Name() As String Public Property Name() As String
Get Get
Return m_sName Return m_sName
End Get End Get
Set(value As String) Set(value As String)
m_sName = value m_sName = value
End Set End Set
End Property End Property
Public ReadOnly Property PictureString() As String Public ReadOnly Property PictureString() As String
Get Get
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png" Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
End Get End Get
End Property End Property
Sub New() Sub New()
Me.Name = String.Empty Me.Name = String.Empty
Me.PictureID = 0 Me.PictureID = 0
End Sub End Sub
Sub New(Name As String, PictureID As Integer) Sub New(Name As String, PictureID As Integer)
Me.Name = Name Me.Name = Name
Me.PictureID = PictureID Me.PictureID = PictureID
End Sub End Sub
End Class End Class
+28 -18
View File
@@ -92,22 +92,23 @@
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}"> Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/> <Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
</Button>--> </Button>-->
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<Grid> <TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
<Button Name="SelGuideBtn" Style="{DynamicResource OmagCut_YellowTextButton}"/> Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" > <EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50"
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/> <TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2"
<EgtWPFLib:EgtTextBox Name="ArcRadTxBx" Grid.Column="2" Grid.Row="2" Width="50" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
Style="{DynamicResource OmagCut_CalculatorTextBox}"/> <EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
<TextBlock Name="ArcAngTxBl" Grid.Row="3" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/> </UniformGrid>
<EgtWPFLib:EgtTextBox Name="ArcAngTxBx" Grid.Column="2" Grid.Row="3" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
</UniformGrid>
</Grid>
</UniformGrid> </UniformGrid>
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelGuideBtn" Style="{DynamicResource OmagCut_YellowTextButton}"/>
<ToggleButton Name="SelRawSideBtn" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
</UniformGrid>
<TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2" <TextBlock Name="OffsZTxBl" Grid.Row="2" Grid.ColumnSpan="2"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/> Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="2" Width="50" <EgtWPFLib:EgtTextBox Name="OffsZTxBx" Grid.Column="2" Grid.Row="2" Width="50"
@@ -123,10 +124,19 @@
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50" <EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/> Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="OffsXInteryTxBl" Grid.Row="5" Grid.ColumnSpan="2" <Grid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3">
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/> <Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="OffsXInteryTxBx" Grid.Column="2" Grid.Row="5" Width="50" <ColumnDefinition Width="1.5*"/>
Style="{DynamicResource OmagCut_CalculatorTextBox}"/> <ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="OffsXInteryTxBl" Grid.Column="0"
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
<CheckBox Name="UseInteraxisChBx" Grid.Row="7" Grid.Column="1" Height="30" Width="40" HorizontalAlignment="Right"
Margin="-20,0,0,0"/>
<EgtWPFLib:EgtTextBox Name="OffsXInteryTxBx" Grid.Column="2" Width="50"
Style="{DynamicResource OmagCut_CalculatorTextBox}" IsEnabled="{Binding ElementName=UseInteraxisChBx, Path=IsChecked}"/>
</Grid>
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" > <UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
<Button Name="MirrorPartBtn" <Button Name="MirrorPartBtn"
+283 -88
View File
@@ -23,6 +23,10 @@ Public Class FrameCutPageUC
' Importazione guida in corso ' Importazione guida in corso
Private m_bGuide As Boolean = False Private m_bGuide As Boolean = False
' Linea selezionata dal contorno del grezzo
Private m_LineDir As Integer = -1
Private m_ptMidLineDir As New Point3d
Private Sub FrameCutPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized Private Sub FrameCutPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
' Creazione delle Page UserControl ' Creazione delle Page UserControl
m_ProjectMgr = New ProjectMgrUC m_ProjectMgr = New ProjectMgrUC
@@ -54,14 +58,17 @@ Public Class FrameCutPageUC
OffsYyTxBx.Text = LenToString(dOffsYY, 3) OffsYyTxBx.Text = LenToString(dOffsYY, 3)
Dim dOffsXInterY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSXINTERY, 5, m_MainWindow.GetIniFile()) Dim dOffsXInterY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSXINTERY, 5, m_MainWindow.GetIniFile())
OffsXInteryTxBx.Text = LenToString(dOffsXInterY, 3) OffsXInteryTxBx.Text = LenToString(dOffsXInterY, 3)
Dim bOffsYInterYSawTh As Boolean = False
UseInteraxisChBx.IsChecked = (GetPrivateProfileInt(S_FRAME, K_OFFSXINTERYSAWTH, 0, m_MainWindow.GetIniFile()) <> 1)
' Imposto i messaggi letti dal file dei messaggi ' Imposto i messaggi letti dal file dei messaggi
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 2)) 'Lungo Y m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 2)) 'Lungo Y
If GetPrivateProfileInt(S_FRAME, K_ARC_ENABLE, 0, m_MainWindow.GetIniFile()) <> 0 And If GetPrivateProfileInt(S_FRAME, K_ARC_ENABLE, 0, m_MainWindow.GetIniFile()) <> 0 And
m_MainWindow.GetKeyOption( MainWindow.KEY_OPT.CURVED_FRAME) Then m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CURVED_FRAME) Then
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 13)) 'Arco m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 13)) 'Arco
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 14)) 'Guida m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 14)) 'Guida
m_AlongAx.Add("Raw side")
End If End If
SelSectionBtn.ToolTip = EgtMsg(MSG_FRAMECUTPAGEUC + 15) 'Sezione SelSectionBtn.ToolTip = EgtMsg(MSG_FRAMECUTPAGEUC + 15) 'Sezione
SelGuideBtn.Content = EgtMsg(MSG_FRAMECUTPAGEUC + 16) 'Guida SelGuideBtn.Content = EgtMsg(MSG_FRAMECUTPAGEUC + 16) 'Guida
@@ -73,6 +80,18 @@ Public Class FrameCutPageUC
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
SelRawSideBtn.Content = "Sel raw side"
Dim sChBxToolTip As String = EgtMsg(90646) 'Applica valore indicato\n altrienti spessore lama
sChBxToolTip = sChBxToolTip.Replace("/n", "£")
Dim sItems As String() = sChBxToolTip.Split("£")
For Index As Integer = 0 To sItems.Count - 1
If Index = 0 Then
sChBxToolTip = sItems(Index).Trim
Else
sChBxToolTip &= vbCrLf & sItems(Index).Trim
End If
Next
UseInteraxisChBx.ToolTip = sChBxToolTip
End Sub End Sub
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
@@ -125,25 +144,26 @@ Public Class FrameCutPageUC
AlongAxCmBx.SelectedIndex = m_CurrAx AlongAxCmBx.SelectedIndex = m_CurrAx
AlongAxCmBx.IsEnabled = False AlongAxCmBx.IsEnabled = False
' Se cornice arco o curva, disabilito scelta nuova sezione ' Se cornice arco o curva, disabilito scelta nuova sezione
SelSectionBtn.IsEnabled = ( m_CurrAx = 0 Or m_CurrAx = 1) SelSectionBtn.IsEnabled = (m_CurrAx = 0 Or m_CurrAx = 1)
' Se cornice curva, verifico se disabilitare scelta guida ' Se cornice curva, verifico se disabilitare scelta guida
If m_CurrAx = 3 Then Dim bIsEnable As Boolean = (EgtGetFirstNameInGroup(nPartId, NAME_GUIDE) = GDB_ID.NULL)
SelGuideBtn.IsEnabled = ( EgtGetFirstNameInGroup( nPartId, NAME_GUIDE) = GDB_ID.NULL) If m_CurrAx = 3 Then SelGuideBtn.IsEnabled = bIsEnable
End If If m_CurrAx = 4 Then SelRawSideBtn.IsEnabled = bIsEnable
' Se cornice su arco ne leggo i dati ' Se cornice su arco ne leggo i dati
If m_CurrAx = 2 Then If m_CurrAx = 2 Then
Dim dExtRad As Double Dim dExtRad As Double
if EgtGetInfo(nPartId, INFO_FRAME_ARCRAD, dExtRad) Then ArcRadTxBx.Text = LenToString( dExtRad, 3) If EgtGetInfo(nPartId, INFO_FRAME_ARCRAD, dExtRad) Then ArcRadTxBx.Text = LenToString(dExtRad, 3)
Dim dAngCenDeg As Double Dim dAngCenDeg As Double
if EgtGetInfo(nPartId, INFO_FRAME_ARCANG, dAngCenDeg) Then ArcAngTxBx.Text = DoubleToString( dAngCenDeg, 3) If EgtGetInfo(nPartId, INFO_FRAME_ARCANG, dAngCenDeg) Then ArcAngTxBx.Text = DoubleToString(dAngCenDeg, 3)
End If End If
' Altrimenti ' Altrimenti
Else Else
' Abilito cambio direzione e scelta sezione ' Abilito cambio direzione e scelta sezione
AlongAxCmBx.SelectedIndex = m_CurrAx AlongAxCmBx.SelectedIndex = m_CurrAx
AlongAxCmBx.IsEnabled = True AlongAxCmBx.IsEnabled = True
SelSectionBtn.IsEnabled = True SelSectionBtn.IsEnabled = True
SelGuideBtn.IsEnabled = True If m_CurrAx = 3 Then SelGuideBtn.IsEnabled = True
If m_CurrAx = 4 Then SelRawSideBtn.IsEnabled = True
End If End If
End Sub End Sub
@@ -155,6 +175,7 @@ Public Class FrameCutPageUC
ArcGrid.Visibility = Windows.Visibility.Collapsed ArcGrid.Visibility = Windows.Visibility.Collapsed
OffsYyTxBl.Visibility = Windows.Visibility.Collapsed OffsYyTxBl.Visibility = Windows.Visibility.Collapsed
OffsYyTxBx.Visibility = Windows.Visibility.Collapsed OffsYyTxBx.Visibility = Windows.Visibility.Collapsed
SelRawSideBtn.Visibility = Windows.Visibility.Collapsed
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
Case 2 'Arco Case 2 'Arco
SelSectionBtn.Visibility = Windows.Visibility.Visible SelSectionBtn.Visibility = Windows.Visibility.Visible
@@ -162,6 +183,7 @@ Public Class FrameCutPageUC
ArcGrid.Visibility = Windows.Visibility.Visible ArcGrid.Visibility = Windows.Visibility.Visible
OffsYyTxBl.Visibility = Windows.Visibility.Visible OffsYyTxBl.Visibility = Windows.Visibility.Visible
OffsYyTxBx.Visibility = Windows.Visibility.Visible OffsYyTxBx.Visibility = Windows.Visibility.Visible
SelRawSideBtn.Visibility = Windows.Visibility.Collapsed
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
Case 3 'Guida Case 3 'Guida
SelSectionBtn.Visibility = Windows.Visibility.Visible SelSectionBtn.Visibility = Windows.Visibility.Visible
@@ -170,6 +192,16 @@ Public Class FrameCutPageUC
ArcGrid.Visibility = Windows.Visibility.Collapsed ArcGrid.Visibility = Windows.Visibility.Collapsed
OffsYyTxBl.Visibility = Windows.Visibility.Visible OffsYyTxBl.Visibility = Windows.Visibility.Visible
OffsYyTxBx.Visibility = Windows.Visibility.Visible OffsYyTxBx.Visibility = Windows.Visibility.Visible
SelRawSideBtn.Visibility = Windows.Visibility.Collapsed
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
Case 4
SelSectionBtn.Visibility = Windows.Visibility.Visible
SelGuideBtn.Visibility = Windows.Visibility.Collapsed
ArcGrid.Visibility = Windows.Visibility.Collapsed
OffsYyTxBl.Visibility = Windows.Visibility.Visible
OffsYyTxBx.Visibility = Windows.Visibility.Visible
SelRawSideBtn.Visibility = Windows.Visibility.Visible
SelRawSideBtn.IsEnabled = False
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 21) 'Distanza X
End Select End Select
End Sub End Sub
@@ -196,11 +228,58 @@ Public Class FrameCutPageUC
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
Return Return
End If End If
' Verifico se selezionato indicativo di pezzo ' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, False, True, False, False) Dim nSel As Integer = GDB_ID.NULL
Dim nSel As Integer Dim nId As Integer = GDB_ID.NULL
If SelRawSideBtn.IsChecked Then
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, False, False, False)
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
nId = EgtGetFirstObjInSelWin()
Dim ptPrev As Point3d
' Verifico cosa selezionato
Dim nSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID)
Dim nKerfId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
' Acquisisco punto da disegno
EgtUnProjectPoint(e.Location, ptPrev)
Dim sName As String = String.Empty
While nId <> GDB_ID.NULL
sName = String.Empty
EgtGetName(nId, sName)
If sName = NAME_KERF Then
' la sottoentità del Kerf selezionato
EgtUnProjectPoint(e.Location, ptPrev)
Dim dDist, dU As Double
EgtPointCurveDist(ptPrev.Loc(nKerfId), nKerfId, nKerfId, dDist, dU)
Dim ptStart As New Point3d
EgtAtParamPoint(nKerfId, CInt(Math.Floor(dU)), GDB_ID.ROOT, ptStart)
Dim ptEnd As New Point3d
EgtAtParamPoint(nKerfId, CInt(Math.Ceiling(dU)), GDB_ID.ROOT, ptEnd)
Dim nParentLineGuide As Integer = EgtCreateGroup(GDB_ID.ROOT)
' creo la linea a partire dall'entita sopra
m_LineDir = EgtCreateLine(EgtCreateGroup(nParentLineGuide), ptStart, ptEnd, GDB_RT.GLOB)
m_ptMidLineDir = New Point3d(ptStart)
EgtMidPoint(m_LineDir, GDB_RT.GLOB, m_ptMidLineDir)
EgtExtendCurveStartByLen(m_LineDir, 3500)
EgtSetMark(m_LineDir)
EgtDraw()
m_bGuide = True
If MyCreateFrame(nParentLineGuide) Then SelRawSideBtn.IsChecked = False
' Privilegio il kerf, pertanto esco
Exit While
End If
nId = EgtGetNextObjInSelWin()
End While
Return
End If
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, True, True, False, False)
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel) EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
Dim nId As Integer = EgtGetFirstObjInSelWin() nId = EgtGetFirstObjInSelWin()
While nId <> GDB_ID.NULL While nId <> GDB_ID.NULL
' Recupero l'identificativo del layer e del pezzo cui appartiene ' Recupero l'identificativo del layer e del pezzo cui appartiene
Dim nLayId As Integer = EgtGetParent(nId) Dim nLayId As Integer = EgtGetParent(nId)
@@ -280,7 +359,7 @@ Public Class FrameCutPageUC
End If End If
End Sub End Sub
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed, OffsXInteryTxBx.EgtClosed Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed, OffsXInteryTxBx.EgtClosed, UseInteraxisChBx.Click
' Forzo aggiornamento grezzo nella pagina di Nesting ' Forzo aggiornamento grezzo nella pagina di Nesting
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart() m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
' Parcheggio pezzi presenti nel grezzo ' Parcheggio pezzi presenti nel grezzo
@@ -312,6 +391,11 @@ Public Class FrameCutPageUC
If StringToLen(OffsXInteryTxBx.Text, dOffsXIntery) Then If StringToLen(OffsXInteryTxBx.Text, dOffsXIntery) Then
WritePrivateProfileString(S_FRAME, K_OFFSXINTERY, DoubleToString(dOffsXIntery, 3), m_MainWindow.GetIniFile()) WritePrivateProfileString(S_FRAME, K_OFFSXINTERY, DoubleToString(dOffsXIntery, 3), m_MainWindow.GetIniFile())
End If End If
Dim sUseInteraxis As String = "1"
If UseInteraxisChBx.IsChecked Then
sUseInteraxis = "0"
End If
WritePrivateProfileString(S_FRAME, K_OFFSXINTERYSAWTH, sUseInteraxis, m_MainWindow.GetIniFile())
End Sub End Sub
Private Sub MirrorPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles MirrorPartBtn.Click Private Sub MirrorPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles MirrorPartBtn.Click
@@ -356,14 +440,14 @@ Public Class FrameCutPageUC
' Cerco pezzo in grezzo ' Cerco pezzo in grezzo
Dim nPartId As Integer = EgtGetFirstPartInRawPart(m_nRawId) Dim nPartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
' Se modalità curva e presa solo sezione, cancello unico pezzo in grezzo ' Se modalità curva e presa solo sezione, cancello unico pezzo in grezzo
If m_CurrAx = 3 And EgtGetFirstNameInGroup( nPartId, NAME_GUIDE) = GDB_ID.NULL If m_CurrAx = 3 And EgtGetFirstNameInGroup(nPartId, NAME_GUIDE) = GDB_ID.NULL Then
If EgtRemovePartFromRawPart(nPartId) Then If EgtRemovePartFromRawPart(nPartId) Then
' Rimuovo le lavorazioni ' Rimuovo le lavorazioni
EraseMachinings(nPartId) EraseMachinings(nPartId)
' Cancello ' Cancello
EgtErase(nPartId) EgtErase(nPartId)
End If End If
' Altrimenti esco subito ' Altrimenti esco subito
Else Else
Return Return
End If End If
@@ -460,14 +544,14 @@ Public Class FrameCutPageUC
End Sub End Sub
Friend Function CreateFrame(nPartId As Integer) As Boolean Friend Function CreateFrame(nPartId As Integer) As Boolean
If Not MyCreateFrame( nPartId) Then If Not MyCreateFrame(nPartId) Then
EgtErase( nPartId) EgtErase(nPartId)
If m_CurrAx <> 2 Then If m_CurrAx <> 2 Then
' Errore : creazione cornice non riuscita ' Errore : creazione cornice non riuscita
m_CurrProjPage.SetErrorMessage( EgtMsg(MSG_FRAMECUTPAGEUC + 20)) m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_FRAMECUTPAGEUC + 20))
Else Else
' Errore : raggio più piccolo della larghezza della sezione ' Errore : raggio più piccolo della larghezza della sezione
m_CurrProjPage.SetErrorMessage( EgtMsg(MSG_FRAMECUTPAGEUC + 19)) m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_FRAMECUTPAGEUC + 19))
End If End If
Return False Return False
End If End If
@@ -483,12 +567,12 @@ Public Class FrameCutPageUC
' Sistemo la sezione o la guida della cornice ' Sistemo la sezione o la guida della cornice
If Not m_bGuide Then If Not m_bGuide Then
If Not AdjustSection(nPartId) Then If Not AdjustSection(nPartId) Then
EgtOutLog( "Error in CreateFrame : problems with Section") EgtOutLog("Error in CreateFrame : problems with Section")
Return False Return False
End If End If
Else Else
If Not AdjustGuide(nPartId) Then If Not AdjustGuide(nPartId) Then
EgtOutLog( "Error in CreateFrame : problems with Guide") EgtOutLog("Error in CreateFrame : problems with Guide")
Return False Return False
End If End If
End If End If
@@ -500,48 +584,49 @@ Public Class FrameCutPageUC
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId) Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
If nSectId = GDB_ID.NULL Then Return False If nSectId = GDB_ID.NULL Then Return False
' Creazione cornice ' Creazione cornice
nSurfId = CreateLineFrame( nSectId, nSectLayId, nPartId) nSurfId = CreateLineFrame(nSectId, nSectLayId, nPartId)
' Se non creata superficie, reset di tutto e segnalazione errore ' Se non creata superficie, reset di tutto e segnalazione errore
If nSurfId = GDB_ID.NULL Then If nSurfId = GDB_ID.NULL Then
EgtErase( nPartId) EgtErase(nPartId)
EgtOutLog( "Error in CreateFrame : Surface not constructible") EgtOutLog("Error in CreateFrame : Surface not constructible")
Return False Return False
End If End If
' se cornice su arco ' se cornice su arco
ElseIf m_CurrAx = 2 Then ElseIf m_CurrAx = 2 Then
' Recupero layer e curva della sezione ' Recupero layer e curva della sezione
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT) Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId) Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
If nSectId = GDB_ID.NULL Then Return False If nSectId = GDB_ID.NULL Then Return False
' Porto l'inizio della curva a X0 locale ' Porto l'inizio della curva a X0 locale
ChangeCurveStartToX0( nSectId) ChangeCurveStartToX0(nSectId)
' Creazione cornice ' Creazione cornice
nSurfId = CreateArcFrame( nSectId, nSectLayId, nPartId) nSurfId = CreateArcFrame(nSectId, nSectLayId, nPartId)
' Se non creata superficie, reset di tutto e segnalazione errore ' Se non creata superficie, reset di tutto e segnalazione errore
If nSurfId = GDB_ID.NULL Then If nSurfId = GDB_ID.NULL Then
EgtErase( nPartId) EgtErase(nPartId)
EgtOutLog( "Error in CreateFrame : radius too small for the section") EgtOutLog("Error in CreateFrame : radius too small for the section")
Return False Return False
End If End If
' altrimenti cornice su guida ' altrimenti cornice su guida
Else Else
If not m_bGuide Then If Not m_bGuide Then
' Recupero layer e curva della sezione ' Recupero layer e curva della sezione
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT) Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SECT)
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId) Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
If nSectId = GDB_ID.NULL Then Return False If nSectId = GDB_ID.NULL Then Return False
' Porto l'inizio della curva a X0 locale ' Porto l'inizio della curva a X0 locale
ChangeCurveStartToX0( nSectId) ChangeCurveStartToX0(nSectId)
Else Else
' Porto la guida nel pezzo con la sezione ' Porto la guida nel pezzo con la sezione
Dim nTruePartId As Integer = EgtGetFirstPartInRawPart( m_nRawId) Dim nTruePartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
If nTruePartId = GDB_ID.NULL Then If nTruePartId = GDB_ID.NULL Then
EgtOutLog( "Error in CreateFrame : Section not found") EgtOutLog("Error in CreateFrame : Section not found")
Return False Return False
End If End If
' Parcheggio il pezzo trovato ' Parcheggio il pezzo trovato
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart() m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart( nTruePartId) m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nTruePartId)
' Recupero layer e curva della sezione ' Recupero layer e curva della sezione
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_SECT) Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_SECT)
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId) Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
@@ -551,17 +636,17 @@ Public Class FrameCutPageUC
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId) Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
If nGuideId = GDB_ID.NULL Then Return False If nGuideId = GDB_ID.NULL Then Return False
' Sposto la guida in questo pezzo ' Sposto la guida in questo pezzo
EgtRelocate( nGuideLayId, nTruePartId) EgtRelocate(nGuideLayId, nTruePartId)
' Cancello il pezzo ' Cancello il pezzo
EgtErase( nPartId) EgtErase(nPartId)
' Creazione cornice ' Creazione cornice
nPartId = nTruePartId nPartId = nTruePartId
nSurfId = CreateCurveFrame( nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId) nSurfId = CreateCurveFrame(nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
m_bGuide = False m_bGuide = False
' Se non creata superficie, reset di tutto e segnalazione errore ' Se non creata superficie, reset di tutto e segnalazione errore
If nSurfId = GDB_ID.NULL Then If nSurfId = GDB_ID.NULL Then
EgtErase( nPartId) EgtErase(nPartId)
EgtOutLog( "Error in CreateFrame : Surface not constructible") EgtOutLog("Error in CreateFrame : Surface not constructible")
Return False Return False
End If End If
End If End If
@@ -605,17 +690,17 @@ Public Class FrameCutPageUC
Dim nSurfId As Integer = GDB_ID.NULL Dim nSurfId As Integer = GDB_ID.NULL
' Se cornice rettilinea ' Se cornice rettilinea
If m_CurrAx = 0 Or m_CurrAx = 1 Then If m_CurrAx = 0 Or m_CurrAx = 1 Then
nSurfId = CreateLineFrame( nSectId, nSectLayId, nPartId) nSurfId = CreateLineFrame(nSectId, nSectLayId, nPartId)
' se cornice su arco ' se cornice su arco
ElseIf m_CurrAx = 2 Then ElseIf m_CurrAx = 2 Then
nSurfId = CreateArcFrame( nSectId, nSectLayId, nPartId) nSurfId = CreateArcFrame(nSectId, nSectLayId, nPartId)
' altrimenti cornice su curva ' altrimenti cornice su curva
Else Else
' Recupero layer e curva della guida ' Recupero layer e curva della guida
Dim nGuideLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_GUIDE) Dim nGuideLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_GUIDE)
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId) Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
If nGuideId = GDB_ID.NULL Then Return False If nGuideId = GDB_ID.NULL Then Return False
nSurfId = CreateCurveFrame( nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId) nSurfId = CreateCurveFrame(nSectId, nSectLayId, nGuideId, nGuideLayId, nPartId)
End If End If
' Assegno nome e direzione a pezzo ' Assegno nome e direzione a pezzo
EgtSetName(nPartId, NAME_FRAME) EgtSetName(nPartId, NAME_FRAME)
@@ -681,7 +766,7 @@ Public Class FrameCutPageUC
ptStart = ptTmp ptStart = ptTmp
End If End If
' Se cornice rettilinea ' Se cornice rettilinea
If m_CurrAx = 0 Or m_CurrAx = 1 Then If m_CurrAx = 0 Or m_CurrAx = 1 Then
' Se linea orizzontale, aggiungo tratti verticali ' Se linea orizzontale, aggiungo tratti verticali
If b3Box.DimY() < EPS_SMALL Then If b3Box.DimY() < EPS_SMALL Then
ptStart -= 10 * EPS_SMALL * Vector3d.Y_AX() ptStart -= 10 * EPS_SMALL * Vector3d.Y_AX()
@@ -722,7 +807,7 @@ Public Class FrameCutPageUC
EgtAddCurveCompoLine(nCrvId, ptEnd) EgtAddCurveCompoLine(nCrvId, ptEnd)
b3Box.Add(ptEnd) b3Box.Add(ptEnd)
End If End If
' Altrimenti cornice curva ' Altrimenti cornice curva
Else Else
' Aggiungo linea verticale dall'estremo più alto alla quota del più basso ' Aggiungo linea verticale dall'estremo più alto alla quota del più basso
If ptStart.y > ptEnd.y Then If ptStart.y > ptEnd.y Then
@@ -749,7 +834,15 @@ Public Class FrameCutPageUC
EgtSelectLayerObjs(nLayerId) EgtSelectLayerObjs(nLayerId)
Dim nCrvIds(0) As Integer Dim nCrvIds(0) As Integer
nCrvIds(0) = GDB_ID.SEL nCrvIds(0) = GDB_ID.SEL
Dim nCrvId As Integer = EgtCreateCurveCompoByChain(nLayerId, 1, nCrvIds, New Point3d(), True) ' ---- INIZIO ---- NUOVA GESTIONE ---- Verifico che il segmento passato è una linea ricavata dal contorno del grezzo
Dim nCrvId As Integer = GDB_ID.NULL
If m_CurrAx = 4 And m_LineDir <> GDB_ID.NULL Then
nCrvId = m_LineDir
Else
nCrvId = EgtCreateCurveCompoByChain(nLayerId, 1, nCrvIds, New Point3d(), True)
End If
' ---- FINE ---- NUOVA GESTIONE ----
' Se non è stata creata esco
If nCrvId = GDB_ID.NULL Then Return False If nCrvId = GDB_ID.NULL Then Return False
' Elimino eventuali curve oltre la prima ' Elimino eventuali curve oltre la prima
Dim nId As Integer = EgtGetNext(nCrvId) Dim nId As Integer = EgtGetNext(nCrvId)
@@ -774,17 +867,17 @@ Public Class FrameCutPageUC
' Elimino vecchio layer ' Elimino vecchio layer
EgtErase(nLayerId) EgtErase(nLayerId)
' Impongo rotazione guida CCW ' Impongo rotazione guida CCW
Dim bClosed As Boolean = EgtCurveIsClosed( nCrvId) Dim bClosed As Boolean = EgtCurveIsClosed(nCrvId)
If Not bClosed Then EgtCloseCurveCompo( nCrvId) If Not bClosed Then EgtCloseCurveCompo(nCrvId)
Dim dArea As Double = 0 Dim dArea As Double = 0
EgtCurveAreaXY( nCrvId, dArea) EgtCurveAreaXY(nCrvId, dArea)
If Not bClosed Then EgtRemoveCurveCompoCurve( nCrvId) If Not bClosed Then EgtRemoveCurveCompoCurve(nCrvId)
If dArea < -1 Then EgtInvertCurve( nCrvId) If dArea < -1 Then EgtInvertCurve(nCrvId)
' Se curva chiusa, impongo inizio a metà del lato a X max ' Se curva chiusa, impongo inizio a metà del lato a X max
If bClosed Then If bClosed Then
Dim b3Guide As New BBox3d Dim b3Guide As New BBox3d
EgtGetBBox( nCrvId, GDB_BB.STANDARD, b3Guide) EgtGetBBox(nCrvId, GDB_BB.STANDARD, b3Guide)
Dim ptStart As New Point3d( b3Guide.Max().x, b3Guide.Center().y, b3Guide.Center().z) Dim ptStart As New Point3d(b3Guide.Max().x, b3Guide.Center().y, b3Guide.Center().z)
EgtChangeClosedCurveStartPoint(nCrvId, ptStart) EgtChangeClosedCurveStartPoint(nCrvId, ptStart)
End If End If
Return True Return True
@@ -810,7 +903,7 @@ Public Class FrameCutPageUC
Return True Return True
End Function End Function
Private Function CreateLineFrame( nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer Private Function CreateLineFrame(nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer
' Porto la sezione nel piano opportuno e calcolo il vettore di estrusione ' Porto la sezione nel piano opportuno e calcolo il vettore di estrusione
Dim vtExtr As Vector3d Dim vtExtr As Vector3d
If m_CurrAx = 0 Then If m_CurrAx = 0 Then
@@ -851,7 +944,7 @@ Public Class FrameCutPageUC
Return nSurfId Return nSurfId
End Function End Function
Private Function CreateArcFrame( nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer Private Function CreateArcFrame(nSectId As Integer, nSectLayId As Integer, nPartId As Integer) As Integer
' Recupero ingombro locale della sezione ' Recupero ingombro locale della sezione
Dim b3Sect As New BBox3d Dim b3Sect As New BBox3d
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect) EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
@@ -894,22 +987,22 @@ Public Class FrameCutPageUC
' Creo la superficie swept ' Creo la superficie swept
Dim dSectRotDeg As Double = 90 + dAngIniDeg Dim dSectRotDeg As Double = 90 + dAngIniDeg
EgtRotate(nSectLayId, ptStart, Vector3d.Z_AX(), dSectRotDeg, GDB_RT.LOC) EgtRotate(nSectLayId, ptStart, Vector3d.Z_AX(), dSectRotDeg, GDB_RT.LOC)
Dim nSurfId As Integer = EgtCreateSurfTmSwept( nSurfLayId, nSectId, nGuideId, True, EPS_STM) Dim nSurfId As Integer = EgtCreateSurfTmSwept(nSurfLayId, nSectId, nGuideId, True, EPS_STM)
Return nSurfId Return nSurfId
End Function End Function
Private Function CreateCurveFrame( nSectId As Integer, nSectLayId As Integer, nGuideId As Integer, nGuideLayId As Integer, nPartId As Integer) As Integer Private Function CreateCurveFrame(nSectId As Integer, nSectLayId As Integer, nGuideId As Integer, nGuideLayId As Integer, nPartId As Integer) As Integer
' Recupero flag lavorazione da lato opposto ' Recupero flag lavorazione da lato opposto
Dim bOthSide As Boolean = False Dim bOthSide As Boolean = False
EgtGetInfo( nPartId, INFO_FRAME_OTHSIDE, bOthSide) EgtGetInfo(nPartId, INFO_FRAME_OTHSIDE, bOthSide)
' Recupero dati inizio guida ' Recupero dati inizio guida
Dim ptStart As Point3d Dim ptStart As Point3d
EgtStartPoint(nGuideId, nPartId, ptStart) EgtStartPoint(nGuideId, nPartId, ptStart)
Dim vtStart As Vector3d Dim vtStart As Vector3d
EgtStartVector(nGuideId, nPartId, vtStart) EgtStartVector(nGuideId, nPartId, vtStart)
' Creo riferimento per sezione ' Creo riferimento per sezione
dim frSect As New Frame3d Dim frSect As New Frame3d
frSect.Setup( ptStart, -vtStart) frSect.Setup(ptStart, -vtStart)
' Porto la sezione in questo riferimento ' Porto la sezione in questo riferimento
EgtChangeGroupFrame(nSectLayId, frSect) EgtChangeGroupFrame(nSectLayId, frSect)
' Recupero ingombro locale della sezione ' Recupero ingombro locale della sezione
@@ -917,16 +1010,16 @@ Public Class FrameCutPageUC
EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect) EgtGetBBox(nSectId, GDB_BB.STANDARD, b3Sect)
' Recupero ingombro locale della guida ' Recupero ingombro locale della guida
Dim b3Guide As New BBox3d Dim b3Guide As New BBox3d
EgtGetBBox( nGuideId, GDB_BB.STANDARD, b3Guide) EgtGetBBox(nGuideId, GDB_BB.STANDARD, b3Guide)
b3Guide.ToLoc( frSect) b3Guide.ToLoc(frSect)
' Muovo sezione dalla parte interna della curva ' Muovo sezione dalla parte interna della curva
If ( Not bOthSide And Math.Abs( b3Guide.Min().x) > Math.Abs( b3Guide.Max().x)) OrElse If (Not bOthSide And Math.Abs(b3Guide.Min().x) > Math.Abs(b3Guide.Max().x)) OrElse
( bOthSide And Math.Abs( b3Guide.Min().x) <= Math.Abs( b3Guide.Max().x)) Then (bOthSide And Math.Abs(b3Guide.Min().x) <= Math.Abs(b3Guide.Max().x)) Then
Dim vtMove As New Vector3d( - b3Sect.Max().x, -b3Sect.Min().y, 0) Dim vtMove As New Vector3d(-b3Sect.Max().x, -b3Sect.Min().y, 0)
EgtMove( nSectId, vtMove) EgtMove(nSectId, vtMove)
Else Else
Dim vtMove As New Vector3d( - b3Sect.Min().x, -b3Sect.Min().y, 0) Dim vtMove As New Vector3d(-b3Sect.Min().x, -b3Sect.Min().y, 0)
EgtMove( nSectId, vtMove) EgtMove(nSectId, vtMove)
End If End If
' Recupero o creo layer per la superficie ' Recupero o creo layer per la superficie
Dim nSurfLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SURF) Dim nSurfLayId As Integer = EgtGetFirstNameInGroup(nPartId, NAME_SURF)
@@ -938,11 +1031,44 @@ Public Class FrameCutPageUC
End If End If
EgtSetColor(nSurfLayId, COL_FRAME()) EgtSetColor(nSurfLayId, COL_FRAME())
' Creo la superficie swept ' Creo la superficie swept
Dim nSurfId As Integer = EgtCreateSurfTmSwept( nSurfLayId, nSectId, nGuideId, True, EPS_STM) Dim nSurfId As Integer = EgtCreateSurfTmSwept(nSurfLayId, nSectId, nGuideId, True, EPS_STM)
Return nSurfId Return nSurfId
End Function End Function
Private Function InsertPartInRawPart(nPartId As Integer) As Boolean Private Function InsertPartInRawPart(nPartId As Integer) As Boolean
' Determino distanza (interasse cornici) da spessore lama oppure offset
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
If UseInteraxisChBx.IsChecked Then
If dOffsXIntery < 0 Then
dMinDist = 5 * EPS_SMALL
OffsXInteryTxBx.Text = "0"
Else
dMinDist = dOffsXIntery + 5 * EPS_SMALL
End If
Else
dMinDist = dSawThick + 5 * EPS_SMALL
End If
Else
EgtOutLog("Not found current saw for frames mindist")
dMinDist = dOffsXIntery
End If
If m_CurrAx = 4 Then
Dim nCountFrame As Integer = 0
Dim nIdOtherFrame As Integer = EgtGetFirstPartInRawPart(m_nRawId)
While nIdOtherFrame <> GDB_ID.NULL
nCountFrame += 1
nIdOtherFrame = EgtGetNextPartInRawPart(nIdOtherFrame)
End While
EgtAddPartToRawPart(nPartId, New Point3d(0, 0, 0), EgtGetFirstRawPart())
Return AdjustPartInGenericRawPart(nCountFrame, dMinDist)
End If
' Determino ingombro del pezzo ' Determino ingombro del pezzo
Dim PartBox As New BBox3d Dim PartBox As New BBox3d
EgtGetBBoxGlob(nPartId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, PartBox) EgtGetBBoxGlob(nPartId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, PartBox)
@@ -956,22 +1082,7 @@ Public Class FrameCutPageUC
End If End If
nId2 = EgtGetNextPartInRawPart(nId2) nId2 = EgtGetNextPartInRawPart(nId2)
End While End While
' 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
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 = dOffsXIntery
End If
' Inserisco il pezzo nel grezzo ' Inserisco il pezzo nel grezzo
Dim ptIns As Point3d Dim ptIns As Point3d
If OtherBox.IsEmpty() Then If OtherBox.IsEmpty() Then
@@ -998,11 +1109,95 @@ Public Class FrameCutPageUC
ptIns.y = m_dKerf ptIns.y = m_dKerf
End If End If
End If End If
Dim dOffsZ As Double = 0 Dim dOffsZ As Double = 0
StringToLen(OffsZTxBx.Text, dOffsZ) StringToLen(OffsZTxBx.Text, dOffsZ)
ptIns.z = (m_RawBox.Max().z - m_RawBox.Min().z) - (PartBox.Max().z - PartBox.Min().z) - dOffsZ ptIns.z = (m_RawBox.Max().z - m_RawBox.Min().z) - (PartBox.Max().z - PartBox.Min().z) - dOffsZ
ptIns.z = Math.Max(ptIns.z, 0) ptIns.z = Math.Max(ptIns.z, 0)
Return EgtAddPartToRawPart(nPartId, ptIns, EgtGetFirstRawPart()) Return EgtAddPartToRawPart(nPartId, ptIns, EgtGetFirstRawPart())
End Function
Public Function AdjustPartInGenericRawPart(Optional nCountOtherFrame As Integer = 0, Optional dMinDist As Double = 0) As Boolean
' --- Eseguo una traslazione per portare il FRAME sul punto iniziale della guida (NON NEL PUNTO MINIMO DEL BOX!) ---
Dim nTruePartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
' Recupero layer e curva della guida
Dim nGuideLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_GUIDE)
If nGuideLayId = GDB_ID.NULL Then Return True
Dim nGuideId As Integer = EgtGetFirstInGroup(nGuideLayId)
' Recupero il layer e il contorno della sezione
Dim nSectLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, NAME_SECT)
Dim nSectId As Integer = EgtGetFirstInGroup(nSectLayId)
' Aggiusto la poszione del pezzo: punto medio della guida sul punto medio del lato selezionato
Dim ptMid As Point3d
EgtMidPoint(nGuideId, GDB_RT.GLOB, ptMid)
Dim vtTrasl As Vector3d = m_ptMidLineDir - ptMid
vtTrasl.z = 0
EgtMove(nTruePartId, vtTrasl)
' Porto il pezzo dentro al grezzo
Dim vtPerp As New Vector3d
EgtStartVector(nGuideId, GDB_RT.GLOB, vtPerp)
vtPerp.Rotate(Vector3d.Z_AX, 90)
' Definisco il frame su cui iniziare a lavorare
Dim ptS As New Point3d
EgtStartPoint(nGuideId, GDB_RT.GLOB, ptS)
Dim vtDir As New Vector3d
EgtStartVector(nGuideId, GDB_RT.GLOB, vtDir)
Dim frSect As New Frame3d(ptS, vtDir, vtPerp, Vector3d.Z_AX)
' Costruisco il BBox nel riferimento indicato
Dim BBoxRef As New BBox3d
EgtGetBBoxRef(nTruePartId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, frSect, BBoxRef)
' Nella grafica i nomi dei parametri di offset devono diventare "Perp" e "Orto" oppure un solo parametro "Orto"?
Dim dOffsXy As Double = 0
StringToLen(OffsXyTxBx.Text, dOffsXy)
dOffsXy = (dOffsXy + BBoxRef.DimY) + (dMinDist + BBoxRef.DimY) * nCountOtherFrame
EgtMove(nTruePartId, vtPerp * dOffsXy)
' Ritaglio il volume del pezzo per occupare il grezzo
Dim nSurfLayId As Integer = EgtGetFirstNameInGroup(nTruePartId, "Surf")
Dim nSurfId As Integer = EgtGetFirstInGroup(nSurfLayId)
' Recupero una copia del grezzo
Dim nCopyRawId As Integer = EgtCopyGlob(EgtGetFirstNameInGroup(m_nRawId, "RawSolid"), nSurfLayId)
EgtSetName(nCopyRawId, "SurfTrimmed")
EgtSurfTmIntersect(nCopyRawId, nSurfId)
' Assegno colori e trasparenza
EgtSetColor(nCopyRawId, COL_FRAME)
EgtSetAlpha(nCopyRawId, 100)
EgtErase(nSurfId)
' Recupero il box in coordinate locali dell'ingombro del pezzo
Dim ptSlast As New Point3d
EgtStartPoint(nGuideId, GDB_RT.GLOB, ptSlast)
Dim frSectLast As New Frame3d(ptSlast, vtDir, vtPerp, Vector3d.Z_AX)
Dim BBoxRefLast As New BBox3d
EgtGetBBoxRef(nCopyRawId, GDB_BB.EXACT + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM, frSect, BBoxRefLast)
' Ricalcolo la lunghezza della guida
Dim dLenGUide As Double = 0
EgtCurveLength(nGuideId, dLenGUide)
Dim pt1 As New Point3d
EgtStartPoint(nGuideId, GDB_RT.GLOB, pt1)
EgtTrimExtendCurveByLen(nGuideId, -BBoxRefLast.Min.x, pt1)
Dim pt2 As New Point3d
EgtEndPoint(nGuideId, GDB_RT.GLOB, pt2)
EgtTrimExtendCurveByLen(nGuideId, BBoxRefLast.Max.x - dLenGUide, pt2)
' riposizione l'origine della sezione
Dim pt3 As New Point3d
EgtStartPoint(nGuideId, GDB_RT.GLOB, pt3)
EgtMove(nSectId, New Vector3d(pt3 - pt1), GDB_RT.GLOB)
EgtDraw()
'EgtSaveFile("C:\EgtData\OmagCUT\Temp\BOB.nge", NGE.BIN)
Return True
End Function End Function
End Class End Class
+4 -4
View File
@@ -3,15 +3,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib" xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
FontFamily="{DynamicResource OmagCut_Font}" FontFamily="{DynamicResource OmagCut_Font}"
Title="OpenFile" Height="500.6" Width="426.6" WindowStyle="None" Title="OpenFile" Height="587.4" Width="500.6" WindowStyle="None"
ResizeMode="NoResize" ShowInTaskbar="False" AllowsTransparency="True" ResizeMode="NoResize" ShowInTaskbar="False" AllowsTransparency="True"
Background="Transparent"> Background="Transparent">
<Border Style="{DynamicResource OmagCut_Border}"> <Border Style="{DynamicResource OmagCut_Border}">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/> <ColumnDefinition Width="0.2*"/>
<ColumnDefinition Width="4*"/> <ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.5*"/> <ColumnDefinition Width="0.2*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="0.5*"/> <RowDefinition Height="0.5*"/>
@@ -36,7 +36,7 @@
<StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal" <StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal"
HorizontalAlignment="Center"> HorizontalAlignment="Center">
<ScrollViewer Name="MyScrollViewer" VerticalScrollBarVisibility="Auto"> <ScrollViewer Name="MyScrollViewer" VerticalScrollBarVisibility="Auto">
<TextBlock Name="LicenseMsgTxBl" MaxWidth="340" <TextBlock Name="LicenseMsgTxBl" MaxWidth="425"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Foreground="{DynamicResource Omag_White}" FontSize="20" VerticalAlignment="Center" Foreground="{DynamicResource Omag_White}" FontSize="20" VerticalAlignment="Center"
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
+1 -1
View File
@@ -17,7 +17,7 @@
Public Sub Init() Handles Me.Initialized Public Sub Init() Handles Me.Initialized
IconTxBl.Text = "⚠️" IconTxBl.Text = "⚠️"
LicenseTxBl.Text = "Warning" & vbCrLf & m_sTitle LicenseTxBl.Text = m_sTitle
m_sMessage = m_sMessage.Replace("/n", "£") m_sMessage = m_sMessage.Replace("/n", "£")
Dim sItems As String() = m_sMessage.Split("£") Dim sItems As String() = m_sMessage.Split("£")
For Index As Integer = 0 To sItems.Count - 1 For Index As Integer = 0 To sItems.Count - 1
+12
View File
@@ -204,6 +204,9 @@ Public Class CurrentMachine
' Massima profondità lavorabile nei tagli diretti ' Massima profondità lavorabile nei tagli diretti
Private m_MaxTabDepth As Double = 10.0 Private m_MaxTabDepth As Double = 10.0
' Massima altezza lavorabile con lama grande
Private m_dHighPieceZ As Double = 200.0
#Region "Proprietà che leggono e scrivono i valori anche da o su file ini" #Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
Friend ReadOnly Property MaxTabDepth As Double Friend ReadOnly Property MaxTabDepth As Double
Get Get
@@ -1149,6 +1152,12 @@ Public Class CurrentMachine
End Get End Get
End Property End Property
Friend ReadOnly Property dHighPieceZ As Double
Get
Return m_dHighPieceZ
End Get
End Property
#End Region #End Region
Sub New() Sub New()
@@ -1417,6 +1426,9 @@ Public Class CurrentMachine
If m_MaxTabDepth < 0 Then If m_MaxTabDepth < 0 Then
m_MaxTabDepth = 10.0 m_MaxTabDepth = 10.0
End If End If
' Massimo spessore lavorabile con lama grande
m_dHighPieceZ = GetPrivateProfileDouble(S_RAWMOVE, "MaxHeightPiece", 800.0, m_MainWindow.GetMachIniFile())
End Sub End Sub
' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili ' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili
+2
View File
@@ -298,6 +298,8 @@ Public Class MachinePageUC
WaterJetBtn.IsChecked = False WaterJetBtn.IsChecked = False
MachinePageGrid.Children.Remove(m_WaterJetPageUC) MachinePageGrid.Children.Remove(m_WaterJetPageUC)
MachinePageGrid.Children.Add(m_MachiningDbPageUC) MachinePageGrid.Children.Add(m_MachiningDbPageUC)
' Aggiorno lista materiali
m_MainWindow.m_CurrentMachine.LoadWJMaterial()
m_ActiveMachinePage = MachinePages.MachiningDb m_ActiveMachinePage = MachinePages.MachiningDb
Case MachinePages.MachineCN Case MachinePages.MachineCN
MachiningDBBtn.IsChecked = True MachiningDBBtn.IsChecked = True
+10 -6
View File
@@ -279,12 +279,16 @@ Public Class MachineStatusUC
Sub DisplayFeed() Sub DisplayFeed()
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100 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 '' modifica richiesta 26/05/2023 da Rosario per cliente Lanzetta (lettura feed per CN Fanuc)
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then 'If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
dRealFeed = m_CN.d_DInterpo_Prog_Feed ' dRealFeed = m_CN.d_DInterpo_Prog_Feed
Else 'Else
dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100 ' dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
End If 'End If
' modifica richiesta 24/03/2025 da Fabio per cliente Frigerio
dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
'Feed = DoubleToString(dRealFeed, 0) 'Feed = DoubleToString(dRealFeed, 0)
FeedTxBx.Text = LenToString(dRealFeed, 0, True) FeedTxBx.Text = LenToString(dRealFeed, 0, True)
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%" 'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
+1 -1
View File
@@ -27,7 +27,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Border Name="LogoBrd" Background="Transparent"> <Border Name="LogoBrd" Background="Transparent">
<Image Source="../Resources/NewIcons/Logo-Egalware (2).png" Stretch="Uniform" Margin="1"/> <Image Source="../Resources/NewIcons/logo-OmCut.png" Stretch="Uniform" Margin="1"/>
</Border> </Border>
<!-- ** Definizione della Grid delle tab ** --> <!-- ** Definizione della Grid delle tab ** -->
+23 -11
View File
@@ -26,6 +26,8 @@ Class MainWindow
' Variabile che definisce l'avvio forzato in modalità FRAME ' Variabile che definisce l'avvio forzato in modalità FRAME
Friend m_OnlyFrame As Boolean = False Friend m_OnlyFrame As Boolean = False
Public Shared m_bShowSVGParkInd As Boolean = True
' Dichiarazione delle Page UserControl ' Dichiarazione delle Page UserControl
Friend m_WorkInProgressPageUC As WorkInProgressPageUC Friend m_WorkInProgressPageUC As WorkInProgressPageUC
Friend m_CurrentProjectPageUC As CurrentProjectPageUC Friend m_CurrentProjectPageUC As CurrentProjectPageUC
@@ -343,8 +345,8 @@ Class MainWindow
' Verifico abilitazione nesting automatico ' Verifico abilitazione nesting automatico
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey) m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
' Recupero opzioni della chiave ' Recupero opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2610, 1, m_nKeyLevel) And Dim bKey As Boolean = EgtGetKeyLevel(9423, 2704, 1, m_nKeyLevel) And
EgtGetKeyOptions(9423, 2610, 1, m_nKeyOptions) EgtGetKeyOptions(9423, 2704, 1, m_nKeyOptions)
' Verifico abilitazione prodotto ' Verifico abilitazione prodotto
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE) Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo ' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
@@ -656,26 +658,36 @@ Class MainWindow
Dim sAssStatus As String = " discontinued" Dim sAssStatus As String = " discontinued"
Dim nAssLeftDays As Integer Dim nAssLeftDays As Integer
' MESSAGGIO...
If EgtGetKeyAssLeftDays(nAssLeftDays) And nAssLeftDays >= 0 Then If EgtGetKeyAssLeftDays(nAssLeftDays) And nAssLeftDays >= 0 Then
If nAssLeftDays > 30 Then If nAssLeftDays > 0 Then
sAssStatus = "expires within " & nAssLeftDays.ToString() & " days" sAssStatus = "expires within " & nAssLeftDays.ToString() & " days"
ElseIf nAssLeftDays > 0 Then 'sAssStatus = "to be renewed within " & nAssLeftDays.ToString() & " days"
sAssStatus = "to be renewed within " & nAssLeftDays.ToString() & " days"
Else Else
sAssStatus = "to be renewed by today" sAssStatus = "Expired"
End If End If
End If End If
Dim bShowInfoAssistance As Boolean = True
bShowInfoAssistance = (GetPrivateProfileInt(S_GENERAL, K_SHOWEXPIREASSITANCE, "1", GetIniFile) <> 0)
' Or nAssLeftDays = 358 ' Or nAssLeftDays = 358
If (nAssLeftDays <= 7 And nAssLeftDays >= 0) Or nAssLeftDays = 14 Or nAssLeftDays = 21 Or nAssLeftDays = 28 Then If bShowInfoAssistance And ((nAssLeftDays <= 7 And nAssLeftDays >= 0) Or nAssLeftDays = 14 Or nAssLeftDays = 21 Or nAssLeftDays = 28) Then
Dim sMsg As String = EgtMsg(91141) ' Assistenza in scadenza /nContattare assistenza:/n ' 91145=Avviso importante
Dim sMsg_Title As String = EgtMsg(91145)
' 91146=Il contratto di aggiornamento della licenza in uso scadrà tra {0} giorni./n
Dim sMsg_AssStatus As String = String.Format(EgtMsg(91146), nAssLeftDays.ToString())
' 91147=Se desiderate rimanere aggiornati e continuare ad usufruire dei benefici del servizio, vi invitiamo a contattare la nostra assistenza al seguente indirizzo:/n
Dim sMsg_RefAssistance As String = EgtMsg(91147)
Dim sAssistance As String = String.Empty Dim sAssistance As String = String.Empty
GetPrivateProfileString(S_GENERAL, "Assistances", "", sAssistance, GetIniFile) GetPrivateProfileString(S_GENERAL, "Assistances", "", sAssistance, GetIniFile)
Dim sItems As String() = sAssistance.Split(","c) Dim sItems As String() = sAssistance.Split(","c)
For Each Item As String In sItems For Each Item As String In sItems
sMsg &= "" & Item.Trim & " /n" sMsg_RefAssistance &= "" & Item.Trim & " /n"
Next Next
Dim MyLicWn As New LicenseWindow(Me, sMsg, "Assistance " & sAssStatus) ' 91148=Grazie per la vostra collaborazione.
Dim sMsg_ThankYou As String = EgtMsg(91148)
Dim MyLicWn As New LicenseWindow(Me, sMsg_AssStatus & sMsg_RefAssistance & sMsg_ThankYou, sMsg_Title)
MyLicWn.WindowStartupLocation = WindowStartupLocation.CenterOwner
MyLicWn.Show() MyLicWn.Show()
End If End If
@@ -1327,7 +1339,7 @@ Class MainWindow
If m_OnlyFrame Then If m_OnlyFrame Then
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
m_ActivePage <> Pages.RawPart And m_ActivePage <> Pages.DirectCut And m_ActivePage <> Pages.Simulation Then m_ActivePage <> Pages.RawPart And m_ActivePage <> Pages.DirectCut And m_ActivePage <> Pages.Simulation Then
Dim FrameWnd As New EgtMsgBox(Me, EgtMsg(91142), EgtMsg(91143), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL) Dim FrameWnd As New EgtMsgBox(Me, EgtMsg(91141), EgtMsg(91142), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
'' Gestione stato FastGrid '' Gestione stato FastGrid
'm_CadCutPageUC.m_FastGridSlabManager.OnPreNewProject() 'm_CadCutPageUC.m_FastGridSlabManager.OnPreNewProject()
' Cancello progetto salvato con nome da file ini ' Cancello progetto salvato con nome da file ini
+3 -3
View File
@@ -22,7 +22,7 @@ Imports System.Windows
#End If #End If
<Assembly: AssemblyCompany("Egalware s.r.l.")> <Assembly: AssemblyCompany("Egalware s.r.l.")>
<Assembly: AssemblyProduct("OmagCUT")> <Assembly: AssemblyProduct("OmagCUT")>
<Assembly: AssemblyCopyright("Copyright © 2015-2024 by Egalware s.r.l.")> <Assembly: AssemblyCopyright("Copyright © 2015-2025 by Egalware s.r.l.")>
<Assembly: AssemblyTrademark("")> <Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)> <Assembly: ComVisible(False)>
@@ -62,5 +62,5 @@ Imports System.Windows
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.6.10.1")> <Assembly: AssemblyVersion("2.7.4.1")>
<Assembly: AssemblyFileVersion("2.6.10.1")> <Assembly: AssemblyFileVersion("2.7.4.1")>
+16
View File
@@ -413,6 +413,10 @@ Public Class CNCommunication
GetPrivateProfileString(S_NCDATA, K_NAXES, "", sVal, m_MainWindow.GetMachIniFile()) GetPrivateProfileString(S_NCDATA, K_NAXES, "", sVal, m_MainWindow.GetMachIniFile())
m_CN.SetCnDataVar(CN_generico.CnData.nAxes, sVal) m_CN.SetCnDataVar(CN_generico.CnData.nAxes, sVal)
' Solo per controllo speciale NUM 22/01/2025
GetPrivateProfileString(S_NCDATA, K_CPOS, "", sVal, m_MainWindow.GetMachIniFile())
m_CN.SetCnDataVar(CN_generico.CnData.CPos, sVal)
If Not String.IsNullOrEmpty(sVal) Then m_CN.bCPos = True
' Inizializzo la comunicazione ' Inizializzo la comunicazione
m_CN.Init() m_CN.Init()
@@ -1600,9 +1604,17 @@ Public Class CNCommunication
Return bOk Return bOk
End Function End Function
Private Sub GetSpecialCAxes()
If m_CN.bCPos Then
m_CN.d_axis_position(m_nA4) = m_CN.dCPos
End If
End Sub
Friend Function GetAxesPositions(ByRef dA1 As Double, ByRef dA2 As Double, ByRef dA3 As Double, Friend Function GetAxesPositions(ByRef dA1 As Double, ByRef dA2 As Double, ByRef dA3 As Double,
ByRef dA4 As Double, ByRef dA5 As Double, ByRef dA6 As Double, ByRef dA4 As Double, ByRef dA5 As Double, ByRef dA6 As Double,
ByRef dA7 As Double, ByRef dA8 As Double, ByRef dA9 As Double, ByRef dA10 As Double) As Boolean ByRef dA7 As Double, ByRef dA8 As Double, ByRef dA9 As Double, ByRef dA10 As Double) As Boolean
' gestione speciale asse C
GetSpecialCAxes()
dA1 = If(m_nA1 >= 0, m_CN.d_axis_position(m_nA1), 0) dA1 = If(m_nA1 >= 0, m_CN.d_axis_position(m_nA1), 0)
dA2 = If(m_nA2 >= 0, m_CN.d_axis_position(m_nA2), 0) dA2 = If(m_nA2 >= 0, m_CN.d_axis_position(m_nA2), 0)
dA3 = If(m_nA3 >= 0, m_CN.d_axis_position(m_nA3), 0) dA3 = If(m_nA3 >= 0, m_CN.d_axis_position(m_nA3), 0)
@@ -1619,6 +1631,8 @@ Public Class CNCommunication
Friend Function GetAxesPositions(ByRef dA1 As Double, ByRef dA2 As Double, ByRef dA3 As Double, Friend Function GetAxesPositions(ByRef dA1 As Double, ByRef dA2 As Double, ByRef dA3 As Double,
ByRef dA4 As Double, ByRef dA5 As Double) As Boolean ByRef dA4 As Double, ByRef dA5 As Double) As Boolean
' gestione speciale asse C
GetSpecialCAxes()
dA1 = If(m_nA1 >= 0, m_CN.d_axis_position(m_nA1), 0) dA1 = If(m_nA1 >= 0, m_CN.d_axis_position(m_nA1), 0)
dA2 = If(m_nA2 >= 0, m_CN.d_axis_position(m_nA2), 0) dA2 = If(m_nA2 >= 0, m_CN.d_axis_position(m_nA2), 0)
dA3 = If(m_nA3 >= 0, m_CN.d_axis_position(m_nA3), 0) dA3 = If(m_nA3 >= 0, m_CN.d_axis_position(m_nA3), 0)
@@ -1637,6 +1651,8 @@ Public Class CNCommunication
End Function End Function
Friend Function GetRotaryAxesPositions(ByRef dR1 As Double, ByRef dR2 As Double) As Boolean Friend Function GetRotaryAxesPositions(ByRef dR1 As Double, ByRef dR2 As Double) As Boolean
' gestione speciale asse C
GetSpecialCAxes()
dR1 = If(m_nA4 >= 0, m_CN.d_axis_position(m_nA4), 0) dR1 = If(m_nA4 >= 0, m_CN.d_axis_position(m_nA4), 0)
dR2 = If(m_nA5 >= 0, m_CN.d_axis_position(m_nA5), 0) dR2 = If(m_nA5 >= 0, m_CN.d_axis_position(m_nA5), 0)
Return m_bAxesOk Return m_bAxesOk
+7 -1
View File
@@ -8,7 +8,7 @@ Public MustInherit Class CN_generico
Public Const MAX_VAR As Short = 100 Public Const MAX_VAR As Short = 100
Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
Public Const MAX_TOOLS As Short = 100 Public Const MAX_TOOLS As Short = 100
Public Const NUM_DATA = 57 ' Numero di dati del CN (Speed,Feed,...) Public Const NUM_DATA = 58 ' Numero di dati del CN (Speed,Feed,...)
Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC
@@ -74,6 +74,8 @@ Public MustInherit Class CN_generico
nAxes = 55 nAxes = 55
ResetStatus = 56 ResetStatus = 56
CPos = 57
End Enum End Enum
Public Enum Type As Short Public Enum Type As Short
@@ -233,6 +235,10 @@ Public MustInherit Class CN_generico
Public bRemote As Boolean Public bRemote As Boolean
' Nuovi di bottoni ------------------------------------------- ' Nuovi di bottoni -------------------------------------------
' gestione speciale asse C
Public bCPos As Boolean = False
Public dCPos As Double
' solo per NumOld ' solo per NumOld
Public bIsDripFeed As Boolean = False Public bIsDripFeed As Boolean = False
+11 -8
View File
@@ -53,14 +53,14 @@ Namespace Num
Dim WithEvents objDRunTimeSystem As FXServer.DRunTimeSystem Dim WithEvents objDRunTimeSystem As FXServer.DRunTimeSystem
Dim WithEvents objDGroupManager As FXServer.DGroupManager Dim WithEvents objDGroupManager As FXServer.DGroupManager
Dim WithEvents objDReadELS As FXServer.DReadELS Dim WithEvents objDReadELS As FXServer.DReadELS
' questa è classe che serve a scrivere i dati nel PLC ' questa classe che serve a scrivere i dati nel PLC
Dim WithEvents objDPlcVariables As FXServer.DPlcVariables Dim WithEvents objDPlcVariables As FXServer.DPlcVariables
' questa è la classe che serve a scrivere i dati nelle variabili E ' questa la classe che serve a scrivere i dati nelle variabili E
Dim WithEvents objDVariables As FXServer.DVariables Dim WithEvents objDVariables As FXServer.DVariables
Dim WithEvents objDReadTestExectime As FXServer.DReadTestExectime Dim WithEvents objDReadTestExectime As FXServer.DReadTestExectime
Dim WithEvents objDPosition As FXServer.DPosition Dim WithEvents objDPosition As FXServer.DPosition
Dim WithEvents objDNCKParameter As FXServer.DNCKParameter Dim WithEvents objDNCKParameter As FXServer.DNCKParameter
' questa è la classe che serve a scrivere i comandi MDI (come ad esempio le funzioni M) ' questa la classe che serve a scrivere i comandi MDI (come ad esempio le funzioni M)
Dim WithEvents objDMdiCommand As FXServer.DMdiCommand Dim WithEvents objDMdiCommand As FXServer.DMdiCommand
Dim WithEvents objDMainCncData As FXServer.DMainCncData Dim WithEvents objDMainCncData As FXServer.DMainCncData
@@ -458,7 +458,7 @@ Namespace Num
'sz_var_names.Add("Application.IOCONFIG_GLOBALS.Flexium_NCK.WCNC.Spindle[2].Override") ' segnaposto per la speed override 'sz_var_names.Add("Application.IOCONFIG_GLOBALS.Flexium_NCK.WCNC.Spindle[2].Override") ' segnaposto per la speed override
'sz_var_names.Add("Application.GVL_HMI_OMAG.HMI_Vel_prog") ' FEED 'sz_var_names.Add("Application.GVL_HMI_OMAG.HMI_Vel_prog") ' FEED
'sz_var_names.Add("Application.GVL_HMI_OMAG.HMI_LabRPM") ' Speed 'sz_var_names.Add("Application.GVL_HMI_OMAG.HMI_LabRPM") ' Speed
'sz_var_names.Add("Application.GVL_HMI_OMAG.HMI_LabAmper") ' Ampère = *0.01 'sz_var_names.Add("Application.GVL_HMI_OMAG.HMI_LabAmper") ' Ampre = *0.01
' Creo lista nomi variabili PLC da leggere ' Creo lista nomi variabili PLC da leggere
m_nCnDataVarNum = 0 m_nCnDataVarNum = 0
@@ -823,7 +823,7 @@ Namespace Num
' Only for FX Server >= 3.9.0.0 ' Only for FX Server >= 3.9.0.0
' poi in realtà ritorna sempre tipo = -1 per cui è eguale alle altre..... ' poi in realt ritorna sempre tipo = -1 per cui eguale alle altre.....
Private Sub objDReadELS_ValueChanged3(nHandle As Integer, value As Object, DataType As Short, Writable As Short, nerrorCode As Short) Handles objDReadELS.ValueChanged3 Private Sub objDReadELS_ValueChanged3(nHandle As Integer, value As Object, DataType As Short, Writable As Short, nerrorCode As Short) Handles objDReadELS.ValueChanged3
Dim edata_type As eDatatype Dim edata_type As eDatatype
@@ -996,7 +996,7 @@ Namespace Num
d_spindle_eff(0) = CDbl(values(n)) d_spindle_eff(0) = CDbl(values(n))
Case CnData.SpeedOvr ' (5) Potenziom. speed = ... Case CnData.SpeedOvr ' (5) Potenziom. speed = ...
n_spindle_override(0) = CShort(Math.Round((CDbl(values(n)) * 50 / 255) + 50)) n_spindle_override(0) = CShort(Math.Round((CDbl(values(n)) * 50 / 255) + 50))
Case CnData.Power ' (6) Ampère = * 0.01 Case CnData.Power ' (6) Ampre = * 0.01
d_spindle_power = CDbl(CLng(values(n))) * 0.01 d_spindle_power = CDbl(CLng(values(n))) * 0.01
b_spindle_power_changed = True b_spindle_power_changed = True
Case CnData.Spindle ' (7) Stato rotazione mandrino Case CnData.Spindle ' (7) Stato rotazione mandrino
@@ -1095,6 +1095,9 @@ Namespace Num
Case CnData.EnablePC ' (54) Case CnData.EnablePC ' (54)
nEnablePc = CInt(values(n)) nEnablePc = CInt(values(n))
Case CnData.CPos ' (57)
dCPos = CDbl(values(n))
End Select End Select
Next Next
@@ -1701,11 +1704,11 @@ Namespace Num
nTimeOut += 1 nTimeOut += 1
End While End While
If Not bSetModeDone Then If Not bSetModeDone Then
EgtOutLog("Errore cambio modalità in MDI: " & TIMEOUT) EgtOutLog("Errore cambio modalit in MDI: " & TIMEOUT)
Return TIMEOUT 'Errore di timeout Return TIMEOUT 'Errore di timeout
End If End If
If nSetModeResult <> 0 Then If nSetModeResult <> 0 Then
EgtOutLog("Errore 2 cambio modalità in MDI: " & nSetModeResult) EgtOutLog("Errore 2 cambio modalit in MDI: " & nSetModeResult)
End If End If
Return nSetModeResult Return nSetModeResult
+2 -2
View File
@@ -1297,14 +1297,14 @@ Namespace Num
End Function End Function
Function VerifyBusy() As eStateType Function VerifyBusy() As eStateType
For I As Integer = 0 To 50 For I As Integer = 0 To 150
If global_state <> eStateType.READY Then If global_state <> eStateType.READY Then
System.Threading.Thread.Sleep(SLEEP_TIME) System.Threading.Thread.Sleep(SLEEP_TIME)
Else Else
Exit For Exit For
End If End If
Next Next
EgtOutLog("eStateType: " & global_state.ToString & " -- if eStateType=0 it means READY")
Return global_state Return global_state
End Function End Function
+27
View File
@@ -180,6 +180,9 @@
<Compile Include="CadCuts\SelectPartFromFamilyWD.xaml.vb"> <Compile Include="CadCuts\SelectPartFromFamilyWD.xaml.vb">
<DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon> <DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="CadCuts\SelParkIndWD.xaml.vb">
<DependentUpon>SelParkIndWD.xaml</DependentUpon>
</Compile>
<Compile Include="CAM\CamPolishing.vb" /> <Compile Include="CAM\CamPolishing.vb" />
<Compile Include="DirectCuts\ControlsDirectCutUC.xaml.vb"> <Compile Include="DirectCuts\ControlsDirectCutUC.xaml.vb">
<DependentUpon>ControlsDirectCutUC.xaml</DependentUpon> <DependentUpon>ControlsDirectCutUC.xaml</DependentUpon>
@@ -455,6 +458,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="CadCuts\SelParkIndWD.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DirectCuts\ControlsDirectCutUC.xaml"> <Page Include="DirectCuts\ControlsDirectCutUC.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@@ -1385,6 +1392,26 @@
<Resource Include="Resources\NewIcons\Logo-Egalware %283%29.png" /> <Resource Include="Resources\NewIcons\Logo-Egalware %283%29.png" />
<Resource Include="Resources\NewIcons\RawHeight.png" /> <Resource Include="Resources\NewIcons\RawHeight.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\LightArrowOff.png" />
<Resource Include="Resources\NewIcons\LightArrowOn.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\Park_Busy.png" />
<Resource Include="Resources\NewIcons\icoRight-3D.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\icoLeft-3D.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\icoBack-3D.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\icoFront-3D.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\NewIcons\icoBottom-3D.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe <PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
+609 -603
View File
File diff suppressed because it is too large Load Diff
+9 -2
View File
@@ -26,7 +26,6 @@
<ColumnDefinition Width="5*"/> <ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/> <ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
</Grid> </Grid>
<!-- Definizione della Grid laterale --> <!-- Definizione della Grid laterale -->
@@ -72,7 +71,8 @@
</Border> </Border>
<ProgressBar Name="PhotoProgress" Grid.Row="2" Height="50" Margin="10,0,10,0" Minimum="0" Maximum="100"/>
<ProgressBar Name="PhotoProgress" Grid.Row="2" Height="50" Margin="10,0,10,0" Minimum="0" Maximum="100"/>
<Border Name="OutMessageBrd" Grid.Row="2" > <Border Name="OutMessageBrd" Grid.Row="2" >
<TextBlock Name="OutMessageTxBl" TextAlignment="Center" <TextBlock Name="OutMessageTxBl" TextAlignment="Center"
@@ -81,6 +81,13 @@
</Grid> </Grid>
<Grid Name="SceneHostGrid" Grid.Row="1" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1.2*"/>
</Grid.ColumnDefinitions>
</Grid>
</Grid> </Grid>
</UserControl> </UserControl>
+75 -43
View File
@@ -1,4 +1,5 @@
Imports System.IO Imports System.IO
Imports System.Security.Cryptography
Imports System.Windows.Interop Imports System.Windows.Interop
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib Imports EgtWPFLib
@@ -19,7 +20,8 @@ Public Class CurrentProjectPageUC
Private m_bFirst As Boolean = True Private m_bFirst As Boolean = True
' Dichiarazione Scene ' Dichiarazione Scene
Friend WithEvents CurrentProjectScene As New Scene Friend WithEvents CurrentProjectScene As New Scene
Private CurrentProjectSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost ' Nella pagina Nest gestisco la dimensione della scena per visualizzare la lista dei parcheggi
Public CurrentProjectSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
' Identificativo progetto corrente ' Identificativo progetto corrente
Private m_nCurrProj As Integer = 0 Private m_nCurrProj As Integer = 0
' Dati del grezzo ' Dati del grezzo
@@ -55,9 +57,11 @@ Public Class CurrentProjectPageUC
'Assegnazione scena all'host e posizionamento nella PlacePageGrid 'Assegnazione scena all'host e posizionamento nella PlacePageGrid
CurrentProjectSceneHost.Child = CurrentProjectScene CurrentProjectSceneHost.Child = CurrentProjectScene
CurrentProjectSceneHost.SetValue(Grid.ColumnProperty, 1) CurrentProjectSceneHost.SetValue(Grid.ColumnProperty, 0)
CurrentProjectSceneHost.SetValue(Grid.RowProperty, 1) CurrentProjectSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
Me.CurrentProjectPageGrid.Children.Add(CurrentProjectSceneHost) ' CurrentProjectSceneHost.SetValue(Grid.RowProperty, 1)
'Me.CurrentProjectPageGrid.Children.Add(CurrentProjectSceneHost)
Me.SceneHostGrid.Children.Add(CurrentProjectSceneHost)
'Imposto i messaggi letti dal file dei messaggi 'Imposto i messaggi letti dal file dei messaggi
MaterialTxBl.ToolTip = EgtMsg(MSG_RAWPARTPAGEUC + 9) 'Material - Materiale MaterialTxBl.ToolTip = EgtMsg(MSG_RAWPARTPAGEUC + 9) 'Material - Materiale
@@ -192,7 +196,8 @@ Public Class CurrentProjectPageUC
' Inizializzo gestore lavorazioni ' Inizializzo gestore lavorazioni
EgtInitMachMgr(m_MainWindow.GetMachinesRootDir(), m_MainWindow.GetToolMakersDir()) EgtInitMachMgr(m_MainWindow.GetMachinesRootDir(), m_MainWindow.GetToolMakersDir())
m_bFirst = False m_bFirst = False
Dim bOrtoGraphic As Boolean = (GetPrivateProfileInt(S_SCENE, K_ORTOGRAPHIC, 1, m_MainWindow.GetIniFile()) <> 0)
EgtSetCameraType(bOrtoGraphic, True)
' creo nuovo progetto ' creo nuovo progetto
m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile()) m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
'NewProject() 'NewProject()
@@ -431,15 +436,29 @@ Public Class CurrentProjectPageUC
' prima di parcheggiare svuoto dei pezzi in parcheggio sia vuota ' prima di parcheggiare svuoto dei pezzi in parcheggio sia vuota
m_MainWindow.m_CadCutPageUC.m_NestPage.ResetListOfGruopInPark() m_MainWindow.m_CadCutPageUC.m_NestPage.ResetListOfGruopInPark()
' Parcheggio correttamente i pezzi precedentemente salvati ' Parcheggio correttamente i pezzi precedentemente salvati
Dim nIdList As New List(Of Integer)
Dim nStatList As New List(Of Integer)
Dim nId2 As Integer = EgtGetFirstPart() Dim nId2 As Integer = EgtGetFirstPart()
While nId2 <> GDB_ID.NULL While nId2 <> GDB_ID.NULL
' Forzo lo stato per avere il giusto calcolo delle posizioni per evitare sovrapposizioni
EgtSetStatus(nId2, GDB_ST.ON_)
' Inserisco correttamente in parcheggio ' Inserisco correttamente in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId2, True) m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId2, True)
' Aggiorno lo stato di visualizzazione
Dim nInfoStatus As Integer = 1
' Salvo lo stato (per gestire la navigazione)
EgtGetInfo(nId2, INFO_PARKSTATUS, nInfoStatus)
' Salvo l'Id e lo stato da impostare successivamente al posizionamento
nIdList.Add(nId2)
nStatList.Add(nInfoStatus)
' Notifica a WeinMatching per modifica Id ' Notifica a WeinMatching per modifica Id
VeinMatching.UpdatePart(nId2) VeinMatching.UpdatePart(nId2)
' Passo al pezzo successivo ' Passo al pezzo successivo
nId2 = EgtGetNextPart(nId2) nId2 = EgtGetNextPart(nId2)
End While End While
For IndIndex As Integer = 0 To nIdList.Count - 1
EgtSetStatus(nIdList(IndIndex), nStatList(IndIndex))
Next
' Aggiorno Aree totale e da lavorare dei pezzi ' Aggiorno Aree totale e da lavorare dei pezzi
SetTotalArea(dTotArea) SetTotalArea(dTotArea)
UpdateToProduceArea() UpdateToProduceArea()
@@ -454,7 +473,7 @@ Public Class CurrentProjectPageUC
Return True Return True
End Function End Function
Friend Function AdjustAdditionalTable( Optional bForced As Boolean = False) As Boolean Friend Function AdjustAdditionalTable(Optional bForced As Boolean = False) As Boolean
' Recupero altezza sottotavola corrente ' Recupero altezza sottotavola corrente
Dim nFixtId As Integer = EgtGetFirstNameInGroup(EgtGetFirstMachGroup(), MACH_FIXT_GROUP) Dim nFixtId As Integer = EgtGetFirstNameInGroup(EgtGetFirstMachGroup(), MACH_FIXT_GROUP)
Dim nAddTabId As Integer = EgtGetFirstNameInGroup(nFixtId, MACH_ADD_TABLE) Dim nAddTabId As Integer = EgtGetFirstNameInGroup(nFixtId, MACH_ADD_TABLE)
@@ -466,7 +485,7 @@ Public Class CurrentProjectPageUC
End If End If
' Se valore cambiato, aggiorno... ' Se valore cambiato, aggiorno...
Dim dDeltaZ As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable - dCurrAddTab Dim dDeltaZ As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable - dCurrAddTab
Dim bChanged As Boolean = ( Math.Abs(dDeltaZ) > EPS_SMALL) Dim bChanged As Boolean = (Math.Abs(dDeltaZ) > EPS_SMALL)
If bChanged Or bForced Then If bChanged Or bForced Then
Dim bOldEnMod As Boolean = EgtGetEnableModified() Dim bOldEnMod As Boolean = EgtGetEnableModified()
If Not bChanged AndAlso bOldEnMod Then EgtDisableModified() If Not bChanged AndAlso bOldEnMod Then EgtDisableModified()
@@ -479,9 +498,9 @@ Public Class CurrentProjectPageUC
ShowPhoto(False) ShowPhoto(False)
Dim nRawGrpId As Integer = EgtGetFirstRawPart() Dim nRawGrpId As Integer = EgtGetFirstRawPart()
While nRawGrpId <> GDB_ID.NULL While nRawGrpId <> GDB_ID.NULL
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup( nRawGrpId, NAME_RAW_SOLID) Dim nRawSolidId As Integer = EgtGetFirstNameInGroup(nRawGrpId, NAME_RAW_SOLID)
If nRawSolidId <> GDB_ID.NULL Then EgtSetTextureName( nRawSolidId, PHOTO_NAME) If nRawSolidId <> GDB_ID.NULL Then EgtSetTextureName(nRawSolidId, PHOTO_NAME)
nRawGrpId = EgtGetNextRawPart( nRawGrpId) nRawGrpId = EgtGetNextRawPart(nRawGrpId)
End While End While
End If End If
End If End If
@@ -509,10 +528,10 @@ Public Class CurrentProjectPageUC
EgtGetTableName(sNameTable) EgtGetTableName(sNameTable)
Dim nRefAddTabId = EgtGetFirstNameInGroup(EgtGetFirstNameInGroup(EgtGetTableId(sNameTable), "SOLID"), MACH_ADD_TABLE) Dim nRefAddTabId = EgtGetFirstNameInGroup(EgtGetFirstNameInGroup(EgtGetTableId(sNameTable), "SOLID"), MACH_ADD_TABLE)
If nRefAddTabId <> GDB_ID.NULL Then If nRefAddTabId <> GDB_ID.NULL Then
nAddTabId = EgtCopyGlob( nRefAddTabId, nFixtId) nAddTabId = EgtCopyGlob(nRefAddTabId, nFixtId)
EgtSetStatus( nAddTabId, GDB_ST.ON_) EgtSetStatus(nAddTabId, GDB_ST.ON_)
EgtScale( nAddTabId, new Frame3d( ptMin), 1, 1, dAddTable / 10) EgtScale(nAddTabId, New Frame3d(ptMin), 1, 1, dAddTable / 10)
' altrimenti la creo ' altrimenti la creo
Else Else
' Aggiungo sovratavola nel gruppo dei bloccaggi ' Aggiungo sovratavola nel gruppo dei bloccaggi
ptMax.z -= DELTAZ_ADDTAB ptMax.z -= DELTAZ_ADDTAB
@@ -580,6 +599,9 @@ Public Class CurrentProjectPageUC
Else Else
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0)) EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0))
End If End If
'SelParkIndWD.UpdateViewOnParkInd(False)
' Dichiaro progetto non modificato ' Dichiaro progetto non modificato
EgtResetModified() EgtResetModified()
Return True Return True
@@ -604,8 +626,8 @@ Public Class CurrentProjectPageUC
End If End If
' Se la macchina del file è quella impostata ' Se la macchina del file è quella impostata
If String.Compare(sFileMachine, m_MainWindow.GetCurrMachine(), True) = 0 Then If String.Compare(sFileMachine, m_MainWindow.GetCurrMachine(), True) = 0 Then
AdjustAdditionalTable( True) AdjustAdditionalTable(True)
' altrimenti avverto, porto i pezzi in parcheggio e cancello il grezzo ' altrimenti avverto, porto i pezzi in parcheggio e cancello il grezzo
Else Else
' Emetto messaggio ' Emetto messaggio
Dim sOut As String = EgtMsg(90320) & " (" & sFileMachine & ")" ' Macchina diversa Dim sOut As String = EgtMsg(90320) & " (" & sFileMachine & ")" ' Macchina diversa
@@ -755,6 +777,17 @@ Public Class CurrentProjectPageUC
' Notifico a foto il cambio di path ' Notifico a foto il cambio di path
EgtChangePhotoPath(nPhotoId, sNewPhoto) EgtChangePhotoPath(nPhotoId, sNewPhoto)
End If End If
'--------------------------------------------------------------------------------
If GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
' Gestione visulizzazione lista pezzi in parcheggio
Dim sNewFileName As String = SelParkIndWD.GetPathCurrProj()
SelParkIndWD.CopyImgSvg(sPath)
SelParkIndWD.sActualProj = String.Empty
SelParkIndWD.CopyImgSvg(sNewFileName)
End If
'--------------------------------------------------------------------------------
' Se assente, inserisco contrassegno di progetto OmagCut valido ' Se assente, inserisco contrassegno di progetto OmagCut valido
AddProjectMark() AddProjectMark()
' Eseguo ' Eseguo
@@ -768,15 +801,15 @@ Public Class CurrentProjectPageUC
Return True Return True
End Function End Function
Friend Function ExportProject( sPath As String) As Boolean Friend Function ExportProject(sPath As String) As Boolean
' Copio eventuale fotografia ' Copio eventuale fotografia
Dim nPhotoId As Integer = GetPhoto() Dim nPhotoId As Integer = GetPhoto()
If nPhotoId <> GDB_ID.NULL Then If nPhotoId <> GDB_ID.NULL Then
' Path originale ' Path originale
Dim sPhoto As String = String.Empty Dim sPhoto As String = String.Empty
EgtGetPhotoPath( nPhotoId, sPhoto) EgtGetPhotoPath(nPhotoId, sPhoto)
' Nuova path ' Nuova path
Dim sNewPhoto As String = Path.ChangeExtension( sPath, Path.GetExtension( sPhoto)) Dim sNewPhoto As String = Path.ChangeExtension(sPath, Path.GetExtension(sPhoto))
' Se diverse, eseguo copia ' Se diverse, eseguo copia
If Not String.Equals(sPhoto, sNewPhoto, StringComparison.InvariantCultureIgnoreCase) Then If Not String.Equals(sPhoto, sNewPhoto, StringComparison.InvariantCultureIgnoreCase) Then
Try Try
@@ -791,7 +824,7 @@ Public Class CurrentProjectPageUC
' Se assente, inserisco contrassegno di progetto OmagCut valido ' Se assente, inserisco contrassegno di progetto OmagCut valido
AddProjectMark() AddProjectMark()
' Eseguo copia ' Eseguo copia
Return SaveFile( sPath) Return SaveFile(sPath)
End Function End Function
Friend Function GetCurrentProject() As Integer Friend Function GetCurrentProject() As Integer
@@ -878,7 +911,7 @@ Public Class CurrentProjectPageUC
EgtSetName(nMarkId, NAME_PROJMARK) EgtSetName(nMarkId, NAME_PROJMARK)
EgtSetLevel(nMarkId, GDB_LV.SYSTEM) EgtSetLevel(nMarkId, GDB_LV.SYSTEM)
EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut) EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut)
' altrimenti, aggiorno il flag dei tagli ridotti ' altrimenti, aggiorno il flag dei tagli ridotti
Else Else
Dim nMarkReducedCut As Integer = 0 Dim nMarkReducedCut As Integer = 0
If Not EgtGetInfo(nMarkId, INFO_REDUCEDCUT, nMarkReducedCut) OrElse nMarkReducedCut <> nReducedCut Then If Not EgtGetInfo(nMarkId, INFO_REDUCEDCUT, nMarkReducedCut) OrElse nMarkReducedCut <> nReducedCut Then
@@ -1337,23 +1370,23 @@ Public Class CurrentProjectPageUC
' Gestione area pezzi totale e area pezzi da produrre ' Gestione area pezzi totale e area pezzi da produrre
Friend Function SetTotalArea( dTotArea As Double) As Boolean Friend Function SetTotalArea(dTotArea As Double) As Boolean
Dim nMarkId As Integer = AddProjectMark() Dim nMarkId As Integer = AddProjectMark()
Return EgtSetInfo(nMarkId, INFO_TOTAREA, dTotArea) Return EgtSetInfo(nMarkId, INFO_TOTAREA, dTotArea)
End Function End Function
Friend Function UpdateTotalArea( dNewArea As Double) As Boolean Friend Function UpdateTotalArea(dNewArea As Double) As Boolean
Dim nMarkId As Integer = AddProjectMark() Dim nMarkId As Integer = AddProjectMark()
Dim dTotArea As Double = 0 Dim dTotArea As Double = 0
EgtGetInfo( nMarkId, INFO_TOTAREA, dTotArea) EgtGetInfo(nMarkId, INFO_TOTAREA, dTotArea)
dTotArea = Math.Max( dTotArea + dNewArea, 0) dTotArea = Math.Max(dTotArea + dNewArea, 0)
Return EgtSetInfo(nMarkId, INFO_TOTAREA, dTotArea) Return EgtSetInfo(nMarkId, INFO_TOTAREA, dTotArea)
End Function End Function
Friend Function GetTotalArea() As Double Friend Function GetTotalArea() As Double
Dim nMarkId As Integer = AddProjectMark() Dim nMarkId As Integer = AddProjectMark()
Dim dTotArea As Double = 0 Dim dTotArea As Double = 0
EgtGetInfo( nMarkId, INFO_TOTAREA, dTotArea) EgtGetInfo(nMarkId, INFO_TOTAREA, dTotArea)
Return dTotArea Return dTotArea
End Function End Function
@@ -1361,17 +1394,17 @@ Public Class CurrentProjectPageUC
Dim dToProdArea As Double = 0 Dim dToProdArea As Double = 0
' Se programma non ancora inviato al CN, ciclo sui pezzi nella lastra ' Se programma non ancora inviato al CN, ciclo sui pezzi nella lastra
If GetProjectNcProgSent() = 0 Then If GetProjectNcProgSent() = 0 Then
Dim nPartInRawId As Integer = EgtGetFirstPartInRawPart( CamAuto.GetCurrentRaw()) Dim nPartInRawId As Integer = EgtGetFirstPartInRawPart(CamAuto.GetCurrentRaw())
While nPartInRawId <> GDB_ID.NULL While nPartInRawId <> GDB_ID.NULL
dToProdArea += GeomCalc.GetPartArea( nPartInRawId) dToProdArea += GeomCalc.GetPartArea(nPartInRawId)
nPartInRawId = EgtGetNextPartInRawPart( nPartInRawId) nPartInRawId = EgtGetNextPartInRawPart(nPartInRawId)
End While End While
End If End If
' Ciclo sui pezzi in parcheggio ' Ciclo sui pezzi in parcheggio
Dim nPartId As Integer = EgtGetFirstPart() Dim nPartId As Integer = EgtGetFirstPart()
While nPartId <> GDB_ID.NULL While nPartId <> GDB_ID.NULL
dToProdArea += GeomCalc.GetPartArea( nPartId) dToProdArea += GeomCalc.GetPartArea(nPartId)
nPartId = EgtGetNextPart( nPartId) nPartId = EgtGetNextPart(nPartId)
End While End While
Dim nMarkId As Integer = AddProjectMark() Dim nMarkId As Integer = AddProjectMark()
Return EgtSetInfo(nMarkId, INFO_TOPRODAREA, dToProdArea) Return EgtSetInfo(nMarkId, INFO_TOPRODAREA, dToProdArea)
@@ -1380,16 +1413,16 @@ Public Class CurrentProjectPageUC
Friend Function GetToProduceArea() As Double Friend Function GetToProduceArea() As Double
Dim nMarkId As Integer = AddProjectMark() Dim nMarkId As Integer = AddProjectMark()
Dim dToProdArea As Double = 0 Dim dToProdArea As Double = 0
EgtGetInfo( nMarkId, INFO_TOPRODAREA, dToProdArea) EgtGetInfo(nMarkId, INFO_TOPRODAREA, dToProdArea)
Return dToProdArea Return dToProdArea
End Function End Function
Friend Sub ShowAreas() Friend Sub ShowAreas()
' Recupero il gruppo di Mark e lo svuoto ' Recupero il gruppo di Mark e lo svuoto
Dim nMarkId As Integer = AddProjectMark() Dim nMarkId As Integer = AddProjectMark()
EgtEmptyGroup( nMarkId) EgtEmptyGroup(nMarkId)
' Se non sono da visualizzare esco ' Se non sono da visualizzare esco
if GetPrivateProfileInt( S_STATISTICS, K_SHOWAREAS, 0, m_MainWindow.GetMachIniFile()) = 0 Then Return If GetPrivateProfileInt(S_STATISTICS, K_SHOWAREAS, 0, m_MainWindow.GetMachIniFile()) = 0 Then Return
' Recupero dati ' Recupero dati
Dim dTotArea As Double = GetTotalArea() Dim dTotArea As Double = GetTotalArea()
Dim dToProdArea As Double = GetToProduceArea() Dim dToProdArea As Double = GetToProduceArea()
@@ -1401,20 +1434,19 @@ Public Class CurrentProjectPageUC
End If End If
' Scritte ' Scritte
Const TEXT_DIST As Double = 100 Const TEXT_DIST As Double = 100
Dim ptIns As New Point3d( b3Tab.Center().x, b3Tab.Max().y + TEXT_DIST, b3Tab.Max().z) Dim ptIns As New Point3d(b3Tab.Center().x, b3Tab.Max().y + TEXT_DIST, b3Tab.Max().z)
Dim dCoeff As Double = 1.0 / 1000000.0 Dim dCoeff As Double = 1.0 / 1000000.0
Dim sUnit As String = "" Dim sUnit As String = ""
If Not EgtUiUnitsAreMM() Then If Not EgtUiUnitsAreMM() Then
dCoeff = 1.0 / ( 12 * ONEINCH * 12 * ONEINCH) dCoeff = 1.0 / (12 * ONEINCH * 12 * ONEINCH)
sUnit = " ft²" sUnit = " ft²"
End If End If
Dim sText As String = EgtMsg( 90328) & " " & DoubleToString( dTotArea * dCoeff, 3) & sUnit & " " & Dim sText As String = EgtMsg(90328) & " " & DoubleToString(dTotArea * dCoeff, 3) & sUnit & " " &
EgtMsg( 90329) & " " & DoubleToString( dToProdArea * dCoeff, 3) & sUnit EgtMsg(90329) & " " & DoubleToString(dToProdArea * dCoeff, 3) & sUnit
Dim nText As Integer = EgtCreateTextAdv( nMarkId, ptIns, 0, sText, "", 500, False, 100, 1, 0, INS_POS.MC) Dim nText As Integer = EgtCreateTextAdv(nMarkId, ptIns, 0, sText, "", 500, False, 100, 1, 0, INS_POS.MC)
EgtSetColor( nText, New Color3d( 0, 0, 0)) EgtSetColor(nText, New Color3d(0, 0, 0))
End Sub End Sub
Friend Sub SetAreasStatus(bShow As Boolean)
Friend Sub SetAreasStatus( bShow As Boolean)
Dim nMarkId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK) Dim nMarkId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK)
If nMarkId = GDB_ID.NULL Then Return If nMarkId = GDB_ID.NULL Then Return
@@ -1422,7 +1454,7 @@ Public Class CurrentProjectPageUC
Dim bOldEnMod As Boolean = EgtGetEnableModified() Dim bOldEnMod As Boolean = EgtGetEnableModified()
If bOldEnMod Then EgtDisableModified() If bOldEnMod Then EgtDisableModified()
' Cambio stato visualizzazione ' Cambio stato visualizzazione
EgtSetStatus( nMarkId, If( bShow, GDB_ST.ON_, GDB_ST.OFF)) EgtSetStatus(nMarkId, If(bShow, GDB_ST.ON_, GDB_ST.OFF))
' Se necessario riabilito impostazione modificato ' Se necessario riabilito impostazione modificato
If bOldEnMod Then EgtEnableModified() If bOldEnMod Then EgtEnableModified()
End Sub End Sub
+59 -52
View File
@@ -6,33 +6,40 @@
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib" xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="OpenPage_Initialized" Loaded="OpenPage_Loaded" Unloaded="OpenPage_Unloaded"> d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="OpenPage_Initialized" Loaded="OpenPage_Loaded" Unloaded="OpenPage_Unloaded">
<!-- Definizione della OpenPage --> <!-- Definizione della OpenPage -->
<Border> <Border>
<Grid Name="OpenPageGrid" > <Grid Name="OpenPageGrid" >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/> <ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/> <ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="0.5*"/> <RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/> <RowDefinition Height="0.5*"/>
<RowDefinition Height="8*"/> <RowDefinition Height="8*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- Definizione della Grid Superiore -->
<Grid Name="UpperButtonsGrid" Grid.Column="1" Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
</Grid>
<TextBlock Name="FilePathTxBl" Grid.Row="0" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/> <!-- Definizione della Grid Superiore -->
<Grid Name="UpperButtonsGrid" Grid.Column="1" Grid.RowSpan="2">
<Grid Grid.Row="1" Grid.RowSpan="2"> <Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="7*"/>
</Grid.ColumnDefinitions>
</Grid>
<Grid Name="SceneHostGrid" Grid.Row="2" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="1.2*"/>
</Grid.ColumnDefinitions>
</Grid>
<TextBlock Name="FilePathTxBl" Grid.Row="0" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
<Grid Grid.Row="1" Grid.RowSpan="2">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="6.5*"/> <RowDefinition Height="6.5*"/>
<RowDefinition Height="0.65*"/> <RowDefinition Height="0.65*"/>
@@ -53,39 +60,39 @@
</Grid> </Grid>
</Grid> </Grid>
<Border Name="MessageBrd" Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="Gray"> <Border Name="MessageBrd" Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="Gray">
<TextBlock Name="MessageTxBx" TextAlignment="Center" <TextBlock Name="MessageTxBx" TextAlignment="Center"
Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/> Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
</Border> </Border>
<!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Name="BottomButtonsGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="BarCodeBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}"> <!-- Definizione della Grid Inferiore per i Button V e X -->
<Grid Name="BottomButtonsGrid" Grid.Column="1" Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="BarCodeBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource BarCodeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/> <Image Source="{DynamicResource BarCodeImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button> </Button>
<Button Name="OkBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}"> <Button Name="OkBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center" <Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
</Button> </Button>
<Button Name="ExitBtn" Grid.Column="4" Style="{DynamicResource OmagCut_GradientBlueIconButton}"> <Button Name="ExitBtn" Grid.Column="4" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource XImg}" Width="65" Height="65" HorizontalAlignment="Center" <Image Source="{DynamicResource XImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
</Button> </Button>
</Grid>
</Grid>
</Border>
</Grid>
</Grid>
</Border>
</UserControl> </UserControl>
+47 -3
View File
@@ -5,6 +5,7 @@ Public Class OpenPageUC
'Riferimento alla MainWindow 'Riferimento alla MainWindow
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private m_SelParkInd As SelParkIndWD
'Dichiarazione dello UserControl SceneButtons 'Dichiarazione dello UserControl SceneButtons
Private m_SceneButtons As SceneButtonsUC Private m_SceneButtons As SceneButtonsUC
@@ -35,11 +36,12 @@ Public Class OpenPageUC
' Assegnazione scena all'host e posizionamento nella OpenPageGrid ' Assegnazione scena all'host e posizionamento nella OpenPageGrid
OpenSceneHost.Child = OpenScene OpenSceneHost.Child = OpenScene
OpenSceneHost.SetValue(Grid.ColumnProperty, 1) OpenSceneHost.SetValue(Grid.ColumnProperty, 0) '1
OpenSceneHost.SetValue(Grid.RowProperty, 2) OpenSceneHost.SetValue(Grid.RowProperty, 0) ' 2
' OpenSceneHost.SetValue(Grid.RowSpanProperty, 1) ' OpenSceneHost.SetValue(Grid.RowSpanProperty, 1)
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2) OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
Me.OpenPageGrid.Children.Add(OpenSceneHost) 'Me.OpenPageGrid.Children.Add(OpenSceneHost)
SceneHostGrid.Children.Add(OpenSceneHost)
' Definizione del collegamento tra ItemList e ListBox1 ' Definizione del collegamento tra ItemList e ListBox1
FileListBox.ItemsSource = m_MainWindow.m_OpenItemList FileListBox.ItemsSource = m_MainWindow.m_OpenItemList
@@ -241,6 +243,14 @@ Public Class OpenPageUC
Private Function ClearView() As Boolean Private Function ClearView() As Boolean
' Pulisco il DB geometrico locale ' Pulisco il DB geometrico locale
EgtNewFile() EgtNewFile()
' Elimino elenco dei parcheggi
If Not IsNothing(m_SelParkInd) Then
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
SceneHostGrid.Children.Remove(m_SelParkInd)
m_SelParkInd = Nothing
End If
' Pulisco la selezione dei dati
SelParkIndWD.sActualProj = String.Empty
' Eseguo zoom ' Eseguo zoom
OpenScene.ZoomAll() OpenScene.ZoomAll()
' Cancello messaggio ' Cancello messaggio
@@ -302,6 +312,24 @@ Public Class OpenPageUC
MessageBrd.Background = Brushes.Tomato MessageBrd.Background = Brushes.Tomato
OkBtn.IsEnabled = False OkBtn.IsEnabled = False
End If End If
' Recupero il percorso del progetto per caricare le immagini
SelParkIndWD.sActualProj = sPath
Dim ListParkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListParkInd, OpenScene.GetCtx)
If ListParkInd.Count > 2 And GetPrivateProfileInt(S_GENERAL, K_ENABLEDXFPARK, 0, m_MainWindow.GetIniFile) <> 0 Then
m_SelParkInd = New SelParkIndWD(m_MainWindow, OpenScene.GetCtx)
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 1)
m_SelParkInd.SetValue(Grid.ColumnProperty, 1)
SceneHostGrid.Children.Add(m_SelParkInd)
Else
OpenSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
If Not IsNothing(m_SelParkInd) Then
SceneHostGrid.Children.Remove(m_SelParkInd)
m_SelParkInd = Nothing
End If
End If
' Eseguo zoom ' Eseguo zoom
OpenScene.ZoomAll() OpenScene.ZoomAll()
Return bOk Return bOk
@@ -475,11 +503,21 @@ Public Class OpenPageUC
' Se file dxf devo processarlo opportunamente ' Se file dxf devo processarlo opportunamente
Dim bFileDxf As Boolean = (EgtGetFileType(m_sCurrFile) = FT.DXF) Dim bFileDxf As Boolean = (EgtGetFileType(m_sCurrFile) = FT.DXF)
If bFileDxf Then AdjustSlabDxf() If bFileDxf Then AdjustSlabDxf()
' Istruzioni per chiudere OpenPageUC e aprire currentproject ' Istruzioni per chiudere OpenPageUC e aprire currentproject
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage) m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage)
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC) m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
' Lancio caricamento nuovo progetto corrente ' Lancio caricamento nuovo progetto corrente
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.PostLoad(m_sCurrDir, m_sCurrFile) m_MainWindow.m_CadCutPageUC.m_ProjectMgr.PostLoad(m_sCurrDir, m_sCurrFile)
'--------------------------------------------------------------------------------
' Gestione visulizzazione lista pezzi in parcheggio
Dim nProj As Integer = m_MainWindow.m_CurrentProjectPageUC.GetCurrentProject()
Dim sNewFileName As String = m_MainWindow.GetSaveDir() & "\" & Math.Abs(nProj).ToString("D4") & "_ParkInd_"
SelParkIndWD.CopyImgSvg(sNewFileName, OpenScene.GetCtx)
SelParkIndWD.sActualProj = String.Empty
'--------------------------------------------------------------------------------
' Se file dxf ' Se file dxf
If bFileDxf Then If bFileDxf Then
' Applico le lavorazioni ' Applico le lavorazioni
@@ -513,6 +551,12 @@ Public Class OpenPageUC
End Sub End Sub
Private Sub OpenPage_Unloaded(sender As Object, e As RoutedEventArgs) Private Sub OpenPage_Unloaded(sender As Object, e As RoutedEventArgs)
If Not IsNothing(m_SelParkInd) Then
SceneHostGrid.Children.Remove(m_SelParkInd)
m_SelParkInd = Nothing
End If
' resetto il nome del progetto corrente
SelParkIndWD.sActualProj = String.Empty
End Sub End Sub
End Class End Class
+36 -1
View File
@@ -99,8 +99,40 @@ Public Class ProjectMgrUC
End If End If
' Scelta tavola della macchina ' Scelta tavola della macchina
Dim nTabInd As Integer = ChooseTable() Dim nTabInd As Integer = ChooseTable()
' Creo una copia di tutte le immagini usata nella lista dei parcheggi
Dim ListParkInd As New List(Of ParkInd)
SelParkIndWD.LoadParkInd(ListParkInd)
' Creo nuovo progetto ' Creo nuovo progetto
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts) m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
' Gestione visulizzazione lista pezzi in parcheggio
m_MainWindow.m_CadCutPageUC.m_NestPage.ReloadListParkInd()
Dim sNewFileName As String = SelParkIndWD.GetPathCurrProj()
SelParkIndWD.CopyImgSvg(sNewFileName)
'Dim Extension As String = ".svg"
'If Not MainWindow.m_bShowSVGParkInd Then Extension = ".png"
'For Each ItemParkInd As ParkInd In ListParkInd
' If ItemParkInd.Ind <> 0 And ItemParkInd.Ind <> 999 And ItemParkInd.nPartInPark > 0 Then
' Try
' Dim sNewFile As String = sNewFileName & ItemParkInd.Ind.ToString & Extension
' If MainWindow.m_bShowSVGParkInd Then
' WriteMyXML(sNewFile, ItemParkInd.LocalMyCanvas)
' Else
' If File.Exists(sNewFile) Then
' File.Delete(sNewFile)
' End If
' File.Copy(If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img), sNewFile)
' End If
' Catch ex As Exception
' EgtOutLog("Copia immagine " & If(Extension = ".svg", ItemParkInd.Svg, ItemParkInd.Img) & " di ParkInd non roiscita")
' End Try
' End If
'Next
m_MainWindow.m_CadCutPageUC.m_NestPage.ReloadListParkInd()
' Gestione stato FastGrid ' Gestione stato FastGrid
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject() m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
End Sub End Sub
@@ -233,6 +265,9 @@ Public Class ProjectMgrUC
If m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut Then If m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut Then
ShowAllCurrPhaseMachinings() ShowAllCurrPhaseMachinings()
End If End If
'SelParkIndWD.UpdateViewOnParkInd(False)
EgtDraw() EgtDraw()
End Sub End Sub
@@ -375,7 +410,7 @@ Public Class ProjectMgrUC
If Not EgtGetTableRef(1, m_ptTabOri) Then Return If Not EgtGetTableRef(1, m_ptTabOri) Then Return
' recupero il punto medio della curva ' recupero il punto medio della curva
EgtMidPoint(nIdSelected, GDB_ID.ROOT, ptMid) EgtMidPoint(nIdSelected, GDB_ID.ROOT, ptMid)
ptMid.z = m_ptTabOri.z + CamAuto.GetRawHeight() + dHeight ptMid.z = m_ptTabOri.z + CamAuto.GetRawHeight() + dHeight + m_MainWindow.m_CurrentMachine.dAdditionalTable
' Offset dovuto allo spessore Utensile ' Offset dovuto allo spessore Utensile
ptMid -= vtOffset * dThick ptMid -= vtOffset * dThick
+37
View File
@@ -39,6 +39,43 @@
<Button Name="TopViewBtn" Grid.Column="6" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}"> <Button Name="TopViewBtn" Grid.Column="6" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromTOPImg}" Style="{StaticResource OmagCut_ButtonIcon}"/> <Image Source="{DynamicResource LookFromTOPImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button> </Button>
<Popup Name="ViewPopUp"
IsOpen="False"
AllowsTransparency="False"
PopupAnimation="Scroll"
StaysOpen="False"
Placement="Bottom"
PlacementTarget="{Binding ElementName=TopViewBtn}">
<WrapPanel Orientation="Vertical"
Width="78"
Background="{DynamicResource OmagCut_Gray}">
<Button x:Name="BottomViewBtn"
ToolTip="Bottom View"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromBOTTOMImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button x:Name="FrontViewBtn"
ToolTip="Front View"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromFRONTImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button x:Name="BackViewBtn"
ToolTip="Back View"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromBACKImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button x:Name="LeftViewBtn"
ToolTip="Left View"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromLEFTImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button x:Name="RightViewBtn"
ToolTip="Right View"
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="{DynamicResource LookFromRIGHTImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</WrapPanel>
</Popup>
</Grid> </Grid>
+39 -1
View File
@@ -5,6 +5,10 @@ Public Class SceneButtonsUC
'Riferimento alla MainWindow 'Riferimento alla MainWindow
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Private Sub Init() Handles Me.Initialized
TopViewBtn.ToolTip = "Top View" & vbCrLf & "Select View (Shift)"
End Sub
Private Sub MeasureBtn_Checked(sender As Object, e As RoutedEventArgs) Handles MeasureBtn.Checked Private Sub MeasureBtn_Checked(sender As Object, e As RoutedEventArgs) Handles MeasureBtn.Checked
GetCurrScene.SetStatusGetDistance() GetCurrScene.SetStatusGetDistance()
Dim ptRef1 As Point3d Dim ptRef1 As Point3d
@@ -49,6 +53,12 @@ Public Class SceneButtonsUC
'End Sub 'End Sub
Private Sub PanBtn_Click(sender As Object, e As RoutedEventArgs) Handles PanBtn.Click Private Sub PanBtn_Click(sender As Object, e As RoutedEventArgs) Handles PanBtn.Click
If Keyboard.IsKeyDown(Key.LeftShift) Then
Dim bOrtoGraphic As Boolean = (GetPrivateProfileInt(S_SCENE, K_ORTOGRAPHIC, 1, m_MainWindow.GetIniFile()) <> 0)
EgtSetCameraType(Not bOrtoGraphic, True)
WritePrivateProfileString(S_SCENE, K_ORTOGRAPHIC, If(Not bOrtoGraphic, "1", "0"), m_MainWindow.GetIniFile())
Return
End If
GetCurrScene.SetStatusPan() GetCurrScene.SetStatusPan()
End Sub End Sub
@@ -69,7 +79,35 @@ Public Class SceneButtonsUC
End Sub End Sub
Private Sub TopViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles TopViewBtn.Click Private Sub TopViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles TopViewBtn.Click
EgtSetView(VT.TOP) If (Keyboard.Modifiers And ModifierKeys.Shift) > 0 Then
If ViewPopUp.IsOpen Then
ViewPopUp.IsOpen = False
Else
ViewPopUp.IsOpen = True
End If
Else
EgtSetView(VT.TOP)
End If
End Sub
Private Sub BottomViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles BottomViewBtn.Click
EgtSetView(VT.BOTTOM)
End Sub
Private Sub FrontViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles FrontViewBtn.Click
EgtSetView(VT.FRONT)
End Sub
Private Sub BackViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackViewBtn.Click
EgtSetView(VT.BACK)
End Sub
Private Sub LeftViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles LeftViewBtn.Click
EgtSetView(VT.LEFT)
End Sub
Private Sub RightViewBtn_Click(sender As Object, e As RoutedEventArgs) Handles RightViewBtn.Click
EgtSetView(VT.RIGHT)
End Sub End Sub
Private Function GetCurrScene() As EgtUILib.Scene Private Function GetCurrScene() As EgtUILib.Scene
+67
View File
@@ -347,6 +347,13 @@ Public Class Camera
' ------------------------------------ accensione riflettori ------------------------------------ ' ------------------------------------ accensione riflettori ------------------------------------
' ------------------------------------ mando la testa in home ------------------------------------
If Not GoHomeForPhoto() Then
EgtOutLog("Error in positioning")
End If
' ------------------------------------ mando la testa in home ------------------------------------
' Scatto una foto con eventuale riconoscimento del contorno (il programma deve essere già attivo) ' Scatto una foto con eventuale riconoscimento del contorno (il programma deve essere già attivo)
Dim bOk As Boolean = False Dim bOk As Boolean = False
Dim sArgs As String = "2 0" Dim sArgs As String = "2 0"
@@ -364,6 +371,66 @@ Public Class Camera
Return bOk Return bOk
End Function End Function
Private Function GoHomeForPhoto() As Boolean
Dim bGoHome As Boolean = GetPrivateProfileInt(S_PHOTO, K_ENABELE_GOHOME_FOR_PHOTO, 0, m_MainWindow.GetMachIniFile()) <> 0
' Se non configurato esco senza generare errore
If Not bGoHome Then Return True
' Costruisco il bottone per potere eseguire il comando MDI
Dim GoHome As MachineButton = Nothing
Dim sDirectCmdFile As String = String.Empty
GetPrivateProfileString(S_PHOTO, K_CAMERA_DIRECT_CMD, "", sDirectCmdFile, m_MainWindow.GetMachIniFile())
If String.IsNullOrEmpty(sDirectCmdFile) Then
Return False
Else
EgtOutLog("Direct command for positionig head: " & sDirectCmdFile)
End If
GoHome = New TwoStateButton("", sDirectCmdFile, "", "", "")
' eseguo lo script lua associato
GoHome.ExecuteMDICommand(GoHome.TLuaScriptName)
' Leggo nome variabile posizione home raggiunta
Dim CameraStateNameVar As String = String.Empty
GetPrivateProfileString(S_PHOTO, K_CAMERA_STATE_VAR, "", CameraStateNameVar, m_MainWindow.GetMachIniFile())
Dim nSteps As Integer = 20
nSteps = GetPrivateProfileInt(S_PHOTO, K_PENDIG_TIME_FOR_PHOTO, nSteps, m_MainWindow.GetMachIniFile())
If String.IsNullOrEmpty(CameraStateNameVar) Then
'Return False
Else
EgtOutLog("Variable for read status of positioning head: " & CameraStateNameVar)
End If
' 91144=Going home
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(91144))
UpdateUI()
' Eseguo reset variabile posizione home raggiunta
m_MainWindow.m_CNCommunication.m_CN.DVariables_WriteVariables2(CameraStateNameVar, "0")
System.Threading.Thread.Sleep(300)
' Definisco flag posizionamento completato
Dim bPositionOk As Boolean = False
For I As Integer = 0 To nSteps
' Devo rileggere la variabile ad ogni ciclo
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(CameraStateNameVar, 3)
System.Threading.Thread.Sleep(100)
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
Dim CameraStateVal As Integer = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
Select Case CameraStateVal
Case 0
' Non faccio alcunchè perchè si sta posizionando
Case 1
' Posizionamento completato
bPositionOk = True
Exit For
Case 2
' Errore
bPositionOk = False
Exit For
End Select
End If
System.Threading.Thread.Sleep(900)
Next
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
UpdateUI()
Return bPositionOk
End Function
Private Function WaitPhoto(nInd As Integer) As Boolean Private Function WaitPhoto(nInd As Integer) As Boolean
' Ciclo di ricerca foto scattata ' Ciclo di ricerca foto scattata
Dim nMaxThick = 10 * m_nTimeout Dim nMaxThick = 10 * m_nTimeout
+25 -9
View File
@@ -4,7 +4,7 @@
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib" xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
FontFamily="{DynamicResource OmagCut_Font}" FontFamily="{DynamicResource OmagCut_Font}"
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent" ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
Title="ModifStartEndWD" Height="250" Width="320" ShowInTaskbar="False"> Title="ModifStartEndWD" Height="350" Width="320" ShowInTaskbar="False">
<!--Definizione della pagina di scelta del nome con cui salvare il progetto--> <!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
<Border Style="{DynamicResource OmagCut_Border}"> <Border Style="{DynamicResource OmagCut_Border}">
@@ -28,14 +28,30 @@
<RowDefinition Height="0.2*"/> <RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/> <RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/> <RowDefinition Height="0.2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="0.2*"/>
<RowDefinition Height="1.5*"/> <RowDefinition Height="1.5*"/>
<RowDefinition Height="0.2*"/> <RowDefinition Height="0.2*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Name="RefRawTxbl" Grid.Column="1" Grid.Row="1" <TextBlock Name="SelRefTxbl" Grid.Column="1" Grid.Row="1"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/> Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<ComboBox Name="RefTabModeCmBx" Grid.Column="2" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}" <ComboBox Name="RefTabCmBx" Grid.Column="2" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="0,0,0,0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Name="RefRawTxbl" Grid.Column="1" Grid.Row="3"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<ComboBox Name="RefTabOrientationCmBx" Grid.Column="2" Grid.Row="3" Style="{StaticResource OmagCut_ComboBox}"
MaxDropDownHeight="300" Margin="0,0,0,0"> MaxDropDownHeight="300" Margin="0,0,0,0">
<ComboBox.ItemTemplate> <ComboBox.ItemTemplate>
<DataTemplate> <DataTemplate>
@@ -44,17 +60,17 @@
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="3" <TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="5"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/> Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="RefTabXTxBx" Grid.Column="2" Grid.Row="3" <EgtWPFLib:EgtTextBox Name="RefTabXTxBx" Grid.Column="2" Grid.Row="5"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/> Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="5" <TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="7"
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/> Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
<EgtWPFLib:EgtTextBox Name="RefTabYTxBx" Grid.Column="2" Grid.Row="5" <EgtWPFLib:EgtTextBox Name="RefTabYTxBx" Grid.Column="2" Grid.Row="7"
Style="{DynamicResource OmagCut_CalculatorTextBox}"/> Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="7" Grid.RowSpan="1"> <Grid Name="ButtonsGrid" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="10" Grid.RowSpan="1">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/> <ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
+135 -14
View File
@@ -1,4 +1,5 @@
Imports System.IO Imports System.IO
Imports System.Reflection
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib Imports EgtWPFLib
@@ -12,9 +13,14 @@ Public Class OtherRefTabWD
Private m_dPrevOffsetX As Double = 0 Private m_dPrevOffsetX As Double = 0
Private m_dPrevOffsetY As Double = 0 Private m_dPrevOffsetY As Double = 0
Private m_bModifX As Boolean = False
Private m_bModifY As Boolean = False
Private m_SelIndex As Integer = 0 Private m_SelIndex As Integer = 0
Sub New(Owner As Window, PosX As String, PosY As String, OffsetX As Double, OffsetY As Double, OtherRefMode As Integer) Private m_SelRef As Integer = 0
Sub New(Owner As Window, PosX As String, PosY As String, OffsetX As Double, OffsetY As Double, OtherRefMode As Integer, SelRef As Integer)
Me.Owner = Owner Me.Owner = Owner
' La chiamata è richiesta dalla finestra di progettazione. ' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent() InitializeComponent()
@@ -25,6 +31,7 @@ Public Class OtherRefTabWD
m_dPrevOffsetX = OffsetX m_dPrevOffsetX = OffsetX
m_dPrevOffsetY = OffsetY m_dPrevOffsetY = OffsetY
m_SelIndex = OtherRefMode m_SelIndex = OtherRefMode
m_SelRef = SelRef
End Sub End Sub
Private Sub OtherRrefTabWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized Private Sub OtherRrefTabWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
@@ -36,8 +43,11 @@ Public Class OtherRefTabWD
RefRawTxbl.Text = "Raw reference" RefRawTxbl.Text = "Raw reference"
RefTabXTxbl.Text = "Position X" RefTabXTxbl.Text = "Position X"
RefTabYTxbl.Text = "Position Y" RefTabYTxbl.Text = "Position Y"
RefTabModeCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabList SelRefTxbl.Text = "Sel reference"
RefTabModeCmBx.SelectedIndex = m_RawPartPage.m_OtherRefTabPos RefTabOrientationCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabOrientationList
RefTabOrientationCmBx.SelectedIndex = m_RawPartPage.m_OtherRefTabPos
RefTabCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabList
RefTabCmBx.SelectedIndex = m_RawPartPage.m_CurrRefTab
End Sub End Sub
Private Sub OtherRrefTabWD_Load(sender As Object, e As EventArgs) Handles Me.Loaded Private Sub OtherRrefTabWD_Load(sender As Object, e As EventArgs) Handles Me.Loaded
@@ -45,9 +55,44 @@ Public Class OtherRefTabWD
RefTabYTxBx.Text = m_sPosY RefTabYTxBx.Text = m_sPosY
End Sub End Sub
Private Sub RefTabModeCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabModeCmBx.SelectionChanged Private Sub RefTabCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabCmBx.SelectionChanged
m_RawPartPage.m_OtherRefTabPos = RefTabModeCmBx.SelectedIndex If m_bModifX Or m_bModifY Then
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile()) Dim SaveCurrToolWnd = New EgtMsgBox(m_MainWindow, "", EgtMsg(MSG_EGTMSGBOX + 2), EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL)
Select Case SaveCurrToolWnd.m_nPressedBtn
Case 0 ' Annulla
' annullo l'operazione di cambio indice
RefTabCmBx.SelectedIndex = m_RawPartPage.m_CurrRefTab
Return
Case 1 ' Si
' salvo i valori modificati
UpdateCurrOffset()
' recupero l'oggetto precedentemente selezionato e lo aggiorno (per evitare di rileggere il file ini)
Dim temp_RefTab As ReferenceTable = m_RawPartPage.m_OtherRefTabList(m_RawPartPage.m_CurrRefTab)
temp_RefTab.dOffsetX = m_RawPartPage.m_OtherRefTabX
temp_RefTab.dOffsetY = m_RawPartPage.m_OtherRefTabY
temp_RefTab.nPos = m_RawPartPage.m_OtherRefTabPos
Case 2 ' No
' Non salvo e vado oltre
m_bModifX = False
m_bModifY = False
End Select
End If
' recupero l'oggetto selezionato
Dim local_RefTab As ReferenceTable = m_RawPartPage.m_OtherRefTabList(RefTabCmBx.SelectedIndex)
m_RawPartPage.m_CurrRefTab = RefTabCmBx.SelectedIndex
' Imposto gli Offset del riferimento selezionato
RefTabXTxBx.Text = LenToString(local_RefTab.dOffsetX, 2)
m_RawPartPage.m_OtherRefTabX = local_RefTab.dOffsetX
RefTabYTxBx.Text = LenToString(local_RefTab.dOffsetY, 2)
m_RawPartPage.m_OtherRefTabY = local_RefTab.dOffsetY
' Aggiorno la posizine del grezzo
m_RawPartPage.RefTabModeChange()
m_bModifX = False
m_bModifY = False
End Sub
Private Sub RefTabOrientationCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabOrientationCmBx.SelectionChanged
m_RawPartPage.m_OtherRefTabPos = RefTabOrientationCmBx.SelectedIndex
m_RawPartPage.RefTabModeChange() m_RawPartPage.RefTabModeChange()
End Sub End Sub
@@ -66,6 +111,7 @@ Public Class OtherRefTabWD
' errore, posizione fuori dalla tavola ' errore, posizione fuori dalla tavola
End If End If
m_RawPartPage.m_OtherRefTabX = dX m_RawPartPage.m_OtherRefTabX = dX
m_bModifX = True
m_RawPartPage.RefTabModeChange() m_RawPartPage.RefTabModeChange()
End If End If
End Sub End Sub
@@ -85,24 +131,99 @@ Public Class OtherRefTabWD
' errore, posizione fuori dalla tavola ' errore, posizione fuori dalla tavola
End If End If
m_RawPartPage.m_OtherRefTabY = dY m_RawPartPage.m_OtherRefTabY = dY
m_bModifY = True
m_RawPartPage.RefTabModeChange() m_RawPartPage.RefTabModeChange()
End If End If
End Sub End Sub
Private Sub OkBtn_Click() Handles OkBtn.Click Private Sub OkBtn_Click() Handles OkBtn.Click
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABX, DoubleToString(RefTabXTxBx.Text, 2), m_MainWindow.GetIniFile()) WritePrivateProfileString(S_RAWPART, K_CURRENTREFTAB, m_RawPartPage.m_CurrRefTab.ToString, m_MainWindow.GetIniFile())
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABY, DoubleToString(RefTabYTxBx.Text, 2), m_MainWindow.GetIniFile()) ' Aggiorno il valore del riferimento correntemente modificato
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile()) UpdateCurrOffset()
m_RawPartPage.RefTabModeChange()
Me.Close() Me.Close()
End Sub End Sub
Private Sub UpdateCurrOffset()
Dim sKeyMsg As String = K_REFTAB & m_RawPartPage.m_CurrRefTab.ToString
Dim sValMsg As String = DoubleToString(m_RawPartPage.m_OtherRefTabX, 2) & "," & DoubleToString(m_RawPartPage.m_OtherRefTabY, 2) & "," & m_RawPartPage.m_OtherRefTabPos.ToString
WritePrivateProfileString(S_RAWPART, sKeyMsg, sValMsg, m_MainWindow.GetIniFile())
End Sub
Private Sub ExitBtn_Click() Handles ExitBtn.Click Private Sub ExitBtn_Click() Handles ExitBtn.Click
' riposiziono l'origine ' Recupero la prima selezione eseguita
m_RawPartPage.m_OtherRefTabX = m_sPosX m_RawPartPage.m_CurrRefTab = m_SelRef
m_RawPartPage.m_OtherRefTabY = m_sPosY Dim temp_RefTab As ReferenceTable = m_RawPartPage.m_OtherRefTabList(m_RawPartPage.m_CurrRefTab)
' ripristino il valore della combobox ' aggiorno i valori
m_RawPartPage.m_OtherRefTabPos = m_SelIndex m_RawPartPage.m_OtherRefTabX = temp_RefTab.dOffsetX
m_RawPartPage.m_OtherRefTabY = temp_RefTab.dOffsetY
m_RawPartPage.m_OtherRefTabPos = temp_RefTab.nPos
m_RawPartPage.RefTabModeChange() m_RawPartPage.RefTabModeChange()
End Sub End Sub
End Class End Class
Public Class ReferenceTable
Private m_dOffsetX As Double
Private m_dOffsetY As Double
Private m_nPos As RawPartPageUC.OTHERREFMODE = RawPartPageUC.OTHERREFMODE.BL
Private m_nIndexRef As Integer = 0
Public Property dOffsetX As Double
Get
Return m_dOffsetX
End Get
Set(value As Double)
m_dOffsetX = value
End Set
End Property
Public Property dOffsetY As Double
Get
Return m_dOffsetY
End Get
Set(value As Double)
m_dOffsetY = value
End Set
End Property
Public Property nPos As Integer
Get
Return m_nPos
End Get
Set(value As Integer)
m_nPos = value
End Set
End Property
Public Property nIndexRef As Integer
Get
Return m_nIndexRef
End Get
Set(value As Integer)
m_nIndexRef = value
End Set
End Property
Public ReadOnly Property Name As String
Get
Return "REF_" & m_nIndexRef.ToString()
End Get
End Property
Public ReadOnly bOk As Boolean = True
Sub New(sStringFromIni As String, IndexRef As Integer)
Dim sItems() As String = sStringFromIni.Split(","c)
If sItems.Count = 3 Then
bOk = bOk And StringToLen(sItems(0), m_dOffsetX)
bOk = bOk And StringToLen(sItems(1), m_dOffsetY)
bOk = bOk And StringToInt(sItems(2), m_nPos)
m_nIndexRef = IndexRef
Else
bOk = False
End If
End Sub
End Class
+8 -2
View File
@@ -176,7 +176,9 @@
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="5*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
@@ -197,7 +199,11 @@
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ButtonIcon}"/> <Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button> </Button>
<Button Name="OkBtn" Grid.Column="6" Style="{DynamicResource OmagCut_GradientBlueIconButton}"> <Button Name="ManualModeBtn" Grid.Column="6" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
<Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="OkBtn" Grid.Column="8" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center" <Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
</Button> </Button>
+223 -19
View File
@@ -1,12 +1,13 @@
Imports System.Globalization Imports System.IO
Imports System.IO Imports System.Reflection
Imports System.Windows.Media.Animation
Imports EgtUILib Imports EgtUILib
Imports EgtWPFLib Imports EgtWPFLib
Imports Microsoft.VisualBasic.Devices
Public Class RawPartPageUC Public Class RawPartPageUC
' Dati generali CN
Friend m_CN As CN_generico
' Riferimento alla MainWindow ' Riferimento alla MainWindow
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow) Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
Dim WithEvents m_CurrProjPage As CurrentProjectPageUC Dim WithEvents m_CurrProjPage As CurrentProjectPageUC
@@ -81,13 +82,23 @@ Public Class RawPartPageUC
' Costante raggio cerchietto ' Costante raggio cerchietto
Private Const RAD_CIRCLE As Double = 30 Private Const RAD_CIRCLE As Double = 30
Private m_nIdMinRedX As Integer = -1
Private m_SafetyZone_X = 0
Private m_nIdMinRedY As Integer = -1
Private m_SafetyZone_Y = 0
Private m_bSafetyZoneRight As Boolean = True
Private m_bSafetyZoneBottom As Boolean = True
Private m_bExistsSafetyZone As Boolean = False
' Riferimento grezzo ' Riferimento grezzo
Private m_bEnableOtherRefTab As Boolean = False Private m_bEnableOtherRefTab As Boolean = False
Private m_bOtherRefTab As Boolean Private m_bOtherRefTab As Boolean
Public m_OtherRefTabX As Double = 0 Public m_OtherRefTabX As Double = 0 ' offset riferimento corrente
Public m_OtherRefTabY As Double = 0 Public m_OtherRefTabY As Double = 0 ' offset riferimento corrente
Public m_OtherRefTabList(3) As String Public m_OtherRefTabPos As Integer = 0 ' poisizione riferimento (Bottom-Left, ..)
Public m_OtherRefTabPos As Integer = 0 Public m_OtherRefTabOrientationList(3) As String ' oriemtazione riferiemnto
Public m_OtherRefTabList As New List(Of ReferenceTable) ' lista dei riferiemneti configurata nel programma
Public m_CurrRefTab As Integer = 1 ' inidice del riferimento della lista corrente
Private m_nOtherRefTabLay As Integer = GDB_ID.NULL Private m_nOtherRefTabLay As Integer = GDB_ID.NULL
Private m_OtherRefTabPoint As Point3d Private m_OtherRefTabPoint As Point3d
@@ -118,13 +129,20 @@ Public Class RawPartPageUC
FROM_SAW = 7 FROM_SAW = 7
End Enum End Enum
Private Enum OTHERREFMODE As Integer Friend Enum OTHERREFMODE As Integer
BL = 0 BL = 0
BR = 1 BR = 1
TR = 2 TR = 2
TL = 3 TL = 3
End Enum End Enum
Private Enum STATDRAG As Integer
OK = 0
X_ = 1
_Y = 2
XY = 3
End Enum
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs) Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
'Creazione della Page UserControl e relative impostazioni 'Creazione della Page UserControl e relative impostazioni
@@ -167,10 +185,10 @@ Public Class RawPartPageUC
RawModeCmBx.ItemsSource = m_RawModeList RawModeCmBx.ItemsSource = m_RawModeList
' Creo la lista dei riferimenti tavola ' Creo la lista dei riferimenti tavola
m_OtherRefTabList(OTHERREFMODE.BL) = "Bottom left" m_OtherRefTabOrientationList(OTHERREFMODE.BL) = "Bottom left"
m_OtherRefTabList(OTHERREFMODE.BR) = "Bottom right" m_OtherRefTabOrientationList(OTHERREFMODE.BR) = "Bottom right"
m_OtherRefTabList(OTHERREFMODE.TR) = "Top right" m_OtherRefTabOrientationList(OTHERREFMODE.TR) = "Top right"
m_OtherRefTabList(OTHERREFMODE.TL) = "Top left" m_OtherRefTabOrientationList(OTHERREFMODE.TL) = "Top left"
' lista per selezione RawModeDamaged ' lista per selezione RawModeDamaged
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
@@ -214,6 +232,7 @@ Public Class RawPartPageUC
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
OtherRefTabTxBl.Text = "New Ref On Tab" OtherRefTabTxBl.Text = "New Ref On Tab"
End Sub End Sub
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs) Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
@@ -320,6 +339,23 @@ Public Class RawPartPageUC
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2) OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2) OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
KerfTxBx.Text = LenToString(dInvertKerf * m_RawKerf, 2) KerfTxBx.Text = LenToString(dInvertKerf * m_RawKerf, 2)
' Recupero gli ID delle pareti che delimitano l'area Protetta (movimenti in OverZ)
Dim nIdBase As Integer = EgtGetBaseId("Base")
m_nIdMinRedX = EgtGetFirstNameInGroup(nIdBase, "MinRedX")
m_nIdMinRedY = EgtGetFirstNameInGroup(nIdBase, "MinRedY")
If m_nIdMinRedY <> GDB_ID.NULL And m_nIdMinRedY <> GDB_ID.NULL Then
m_bExistsSafetyZone = True
Dim ptMinX, ptMaxX As Point3d
EgtGetBBoxGlob(m_nIdMinRedX, GDB_BB.STANDARD, ptMinX, ptMaxX)
m_SafetyZone_X = ptMinX.x
Dim ptMinY, ptMaxY As Point3d
EgtGetBBoxGlob(m_nIdMinRedY, GDB_BB.STANDARD, ptMinY, ptMaxY)
m_SafetyZone_Y = ptMinY.y
End If
' Verifico se attivare la visualizzazione dell'area sicura (prendo la posizione corrente come posizione di partenza)
DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
' Creo layer temporaneo per crocette ' Creo layer temporaneo per crocette
m_nTempLay = EgtCreateGroup(GDB_ID.ROOT) m_nTempLay = EgtCreateGroup(GDB_ID.ROOT)
EgtSetLevel(m_nTempLay, GDB_LV.TEMP) EgtSetLevel(m_nTempLay, GDB_LV.TEMP)
@@ -348,7 +384,6 @@ Public Class RawPartPageUC
EgtZoom(ZM.ALL) EgtZoom(ZM.ALL)
End If End If
'Imposto il materiale corrente nella combobox 'Imposto il materiale corrente nella combobox
'MaterialsCmbx.SelectedItem = m_CurrentMachine.CurrMat
Dim Item As Material Dim Item As Material
For Each Item In MaterialsCmbx.Items For Each Item In MaterialsCmbx.Items
If Not IsNothing(m_CurrentMachine.CurrMat) AndAlso Item.sName = m_CurrentMachine.CurrMat.sName Then If Not IsNothing(m_CurrentMachine.CurrMat) AndAlso Item.sName = m_CurrentMachine.CurrMat.sName Then
@@ -368,9 +403,36 @@ Public Class RawPartPageUC
OtherRefTabBtn.Visibility = Visibility.Visible OtherRefTabBtn.Visibility = Visibility.Visible
End If End If
m_bOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_OTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0) m_bOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_OTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
m_OtherRefTabX = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, 0, m_MainWindow.GetIniFile()) ' Recupero il riferimento attivo
m_OtherRefTabY = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABY, 0, m_MainWindow.GetIniFile()) m_CurrRefTab = GetPrivateProfileInt(S_RAWPART, K_CURRENTREFTAB, 0, m_MainWindow.GetIniFile())
m_OtherRefTabPos = GetPrivateProfileInt(S_RAWPART, K_OTHERREFTABPOS, 0, m_MainWindow.GetIniFile()) ' carico l'elenco dei riferimenti da usare
LoadRefTabList()
' Solo se non esiste una lista allora leggo i valori
If m_OtherRefTabList.Count = 0 Then
' Versione precedente 2.7c# DEPRECABILE
Dim Off_X As Double = -1000
Dim Off_Y As Double = -1000
Dim Pos_Ind As Integer = -1
Off_X = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, -1000, m_MainWindow.GetIniFile())
Off_Y = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABY, -1000, m_MainWindow.GetIniFile())
Pos_Ind = GetPrivateProfileInt(S_RAWPART, K_OTHERREFTABPOS, -1, m_MainWindow.GetIniFile())
If Off_X <> -1000 And Off_Y <> -1000 And Pos_Ind <> -1 Then
Dim Local_Text As String = DoubleToString(Off_X, 2) & "," & DoubleToString(Off_Y, 2) & "," & Pos_Ind.ToString
Dim local_NewRef As New ReferenceTable(Local_Text, 0)
If local_NewRef.bOk Then
m_OtherRefTabList.Add(local_NewRef)
m_CurrRefTab = 0
' Carico i valori
m_OtherRefTabX = m_OtherRefTabList(m_CurrRefTab).dOffsetX
m_OtherRefTabY = m_OtherRefTabList(m_CurrRefTab).dOffsetY
m_OtherRefTabPos = m_OtherRefTabList(m_CurrRefTab).nPos
' Creo la nuova configurazione da usare
Dim sKeyMsg As String = K_REFTAB & m_CurrRefTab.ToString
Dim sValMsg As String = DoubleToString(m_OtherRefTabX, 2) & "," & DoubleToString(m_OtherRefTabY, 2) & "," & m_OtherRefTabPos.ToString
WritePrivateProfileString(S_RAWPART, sKeyMsg, sValMsg, m_MainWindow.GetIniFile())
End If
End If
End If
' RefTabPosCmbx.SelectedIndex = m_OtherRefTabPos ' RefTabPosCmbx.SelectedIndex = m_OtherRefTabPos
OtherRefTabChBx.IsChecked = m_bOtherRefTab OtherRefTabChBx.IsChecked = m_bOtherRefTab
' se riferimento tavola differente da quello atteso ' se riferimento tavola differente da quello atteso
@@ -389,6 +451,29 @@ Public Class RawPartPageUC
' EgtDraw() ' EgtDraw()
End Sub End Sub
Private Sub LoadRefTabList()
m_OtherRefTabList.Clear()
Dim sRefTab As String = String.Empty
Dim nIndex As Integer = 0
While GetPrivateProfileString(S_RAWPART, K_REFTAB & nIndex.ToString, "", sRefTab, m_MainWindow.GetIniFile()) > 0
Dim local_NewRef As New ReferenceTable(sRefTab, nIndex)
If local_NewRef.bOk Then
m_OtherRefTabList.Add(local_NewRef)
nIndex += 1
Else
EgtOutLog("ERROR in reading RefTab" & nIndex.ToString & " is not correctly defined in file OmagCUT.ini, any other reference will not loaded")
Exit While
End If
End While
' Assegno il riferimento corrente
If m_CurrRefTab < m_OtherRefTabList.Count Then
m_OtherRefTabX = m_OtherRefTabList(m_CurrRefTab).dOffsetX
m_OtherRefTabY = m_OtherRefTabList(m_CurrRefTab).dOffsetY
m_OtherRefTabPos = m_OtherRefTabList(m_CurrRefTab).nPos
End If
End Sub
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
' Verifico di essere il gestore attivo ' Verifico di essere il gestore attivo
If Not m_bActive Then Return If Not m_bActive Then Return
@@ -571,6 +656,19 @@ Public Class RawPartPageUC
' Ricavo il punto corrente in coordinate mondo ' Ricavo il punto corrente in coordinate mondo
Dim ptCurr As Point3d Dim ptCurr As Point3d
EgtUnProjectPoint(e.Location, ptCurr) EgtUnProjectPoint(e.Location, ptCurr)
' Creo una copia del punto corrente
Dim ptTemp As New Point3d(ptCurr.x, ptCurr.y, ptCurr.z)
Select Case DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ, ptCurr - m_ptPrev)
Case STATDRAG.X_
ptCurr.x = m_ptPrev.x
Case STATDRAG._Y
ptCurr.y = m_ptPrev.y
Case STATDRAG.XY
m_ptPrev = ptCurr
Return
End Select
' Eseguo modifica ' Eseguo modifica
Select Case m_ActiveRawMode Select Case m_ActiveRawMode
Case RAWMODE.RECTANGLE Case RAWMODE.RECTANGLE
@@ -581,7 +679,7 @@ Public Class RawPartPageUC
ModifyDamaged(ptCurr) ModifyDamaged(ptCurr)
End Select End Select
' Aggiorno il punto precedente ' Aggiorno il punto precedente
m_ptPrev = ptCurr m_ptPrev = ptTemp
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi) ' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
ResetAllBRidges() ResetAllBRidges()
End Sub End Sub
@@ -764,6 +862,13 @@ Public Class RawPartPageUC
If m_bProbingOn Then Return If m_bProbingOn Then Return
' reimposto il comando OutLine ' reimposto il comando OutLine
OutlineBtn_Click(Nothing, Nothing) OutlineBtn_Click(Nothing, Nothing)
' Nasocndo eventuali pareti
If m_bExistsSafetyZone Then
' gestisco la visualizzazione delle pareti che delimitano l'area sicura
EgtSetStatus(m_nIdMinRedX, GDB_ST.OFF)
EgtSetStatus(m_nIdMinRedY, GDB_ST.OFF)
End If
' Se confermata uscita ' Se confermata uscita
If ExitRawPart(True) Then If ExitRawPart(True) Then
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(Me) m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(Me)
@@ -2019,6 +2124,8 @@ Public Class RawPartPageUC
Dim dInvertKerf As Double = 1 Dim dInvertKerf As Double = 1
EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, dInvertKerf) EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, dInvertKerf)
Dim dMaxLen = m_dTableLength - m_RawOffsX - m_RawKerf * dInvertKerf Dim dMaxLen = m_dTableLength - m_RawOffsX - m_RawKerf * dInvertKerf
' Se è attiva l'area sicura allora devo ricalcolare la dimensione massima
If dLength <= dMaxLen Then If dLength <= dMaxLen Then
m_CurrProjPage.ClearMessage() m_CurrProjPage.ClearMessage()
If dKerf < 0 Then If dKerf < 0 Then
@@ -2063,6 +2170,8 @@ Public Class RawPartPageUC
If Not StringToLen(HeightTxBx.Text, dHeight) Then If Not StringToLen(HeightTxBx.Text, dHeight) Then
Return Return
End If End If
' verifico se l'altezza del pezzo è maggiore di quella consentita in macchina
DrawSafetyZone(dHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
If dHeight > -EPS_ZERO Then If dHeight > -EPS_ZERO Then
m_CurrProjPage.ClearMessage() m_CurrProjPage.ClearMessage()
If Math.Abs(dHeight - m_RawHeight) > EPS_SMALL Then If Math.Abs(dHeight - m_RawHeight) > EPS_SMALL Then
@@ -2132,6 +2241,91 @@ Public Class RawPartPageUC
End If End If
End Sub End Sub
' Funzione che si occupa di disegnare le pareti dell'area sicura e di gestire il grezzo (
Private Function DrawSafetyZone(dHeight As Double, dHighPieceZ As Double, vtMove As Vector3d) As STATDRAG
' Se non esiste allora esci senza eseguire controlli
If Not m_bExistsSafetyZone Then Return STATDRAG.OK
' Verifico se attivare la visualizzazione
Dim nStatus As GDB_ST = GDB_ST.OFF
If dHeight > dHighPieceZ Then
nStatus = GDB_ST.ON_
End If
' gestisco la visualizzazione delle pareti che delimitano l'area sicura
EgtSetStatus(m_nIdMinRedX, nStatus)
EgtSetStatus(m_nIdMinRedY, nStatus)
EgtDraw()
If nStatus = GDB_ST.ON_ Then
Return VerifyDimensionRawSafetyZone(vtMove)
End If
Return STATDRAG.OK
End Function
' Verifica che le dimensioni del grezzo siano conformi con l'area sicura (altrimenti provvedo a ridimensionare il grezzo)
Private Function VerifyDimensionRawSafetyZone(vtMove As Vector3d) As STATDRAG
Dim nRawSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID)
Dim ptMinRaw, ptMaxRaw As Point3d
EgtGetBBoxGlob(nRawSolidId, GDB_BB.STANDARD, ptMinRaw, ptMaxRaw)
' Dimensioni grezzo
Dim Len_X As Double = ptMaxRaw.x - ptMinRaw.x
Dim Wid_Y As Double = ptMaxRaw.y - ptMinRaw.y
' Posiztion SafetyZone: RIGHT-BOTTOM
Dim RedTab_X = m_dTableLength - Math.Abs(m_SafetyZone_X - m_ptTableMin.x)
Dim RedTab_Y = Math.Abs(m_SafetyZone_Y - m_ptTableMin.y)
If RedTab_X < Len_X Then
' riduco le dimensioni del grezzo
m_RawLength = RedTab_X - EPS_SMALL * 10
LengthTxBx.Text = LenToString(m_RawLength, 2)
UpdateRawPart()
End If
If RedTab_Y < Wid_Y Then
' riduco le dimensioni del grezzo
m_RawWidth = RedTab_Y - EPS_SMALL * 10
WidthTxBx.Text = LenToString(m_RawWidth, 2)
UpdateRawPart()
End If
Return VerifyRawInSafetyZone(vtMove)
End Function
' Verifico che la posizione del grezzo sia conforme con la posizione di area sicura
Private Function VerifyRawInSafetyZone(vtMove As Vector3d) As STATDRAG
Dim nStat As STATDRAG = STATDRAG.OK
Dim bCalcBBoxRaw As Boolean = False
Dim nRawSolidId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID)
Dim ptMinRaw, ptMaxRaw As Point3d
EgtGetBBoxGlob(nRawSolidId, GDB_BB.STANDARD, ptMinRaw, ptMaxRaw)
' Posiztion SafetyZone: RIGHT-BOTTOM
' Verifico che il grezzo sia all'interno di questi estremi
If ptMinRaw.x + vtMove.x < m_SafetyZone_X Then
' riposiziono il grezzo sulla parete
Dim ptRef As Point3d = New Point3d(m_SafetyZone_X - m_ptTableMin.x, ptMinRaw.y - m_ptTableMin.y, 0)
EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL)
' aggiorno il valore di Offset
m_RawOffsX = m_SafetyZone_X + m_RawKerf - m_ptTableMin.x
m_RawOffsY = ptMinRaw.y + m_RawKerf - m_ptTableMin.y
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
bCalcBBoxRaw = True
nStat = STATDRAG.X_
End If
' Ricalcolo la posizione del grezzo se nel processo sopra ho eseguito uno spostamento
If bCalcBBoxRaw Then EgtGetBBoxGlob(nRawSolidId, GDB_BB.STANDARD, ptMinRaw, ptMaxRaw)
If ptMaxRaw.y + vtMove.y > m_SafetyZone_Y Then
Dim dRawWidth As Double = ptMaxRaw.y - ptMinRaw.y
Dim ptRef As Point3d = New Point3d(ptMinRaw.x - m_ptTableMin.x, m_SafetyZone_Y - dRawWidth - m_ptTableMin.y, 0)
EgtMoveToCornerRawPart(m_CurrProjPage.m_nRawId, ptRef, MCH_CR.BL)
m_RawOffsX = ptMinRaw.x + m_RawKerf - m_ptTableMin.x
m_RawOffsY = m_SafetyZone_Y - dRawWidth + m_RawKerf - m_ptTableMin.y
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
bCalcBBoxRaw = True
nStat = nStat + STATDRAG._Y
End If
EgtDraw()
' Se ho ricalcolato la posizione del BBox grezzo allora ritorno falso
Return nStat
End Function
#Region "OTHERREFTAB" #Region "OTHERREFTAB"
Private Sub OtherRefTabChBx_Click(sender As Object, e As EventArgs) Handles OtherRefTabChBx.Click Private Sub OtherRefTabChBx_Click(sender As Object, e As EventArgs) Handles OtherRefTabChBx.Click
@@ -2228,11 +2422,19 @@ Public Class RawPartPageUC
End Sub End Sub
Private Sub OtherRefTabBtn_Click(sender As Object, e As EventArgs) Handles OtherRefTabBtn.Click Private Sub OtherRefTabBtn_Click(sender As Object, e As EventArgs) Handles OtherRefTabBtn.Click
' Aggiorno la lista dei riferimenti
LoadRefTabList()
' apro la finestra per gestire il riferimento ' apro la finestra per gestire il riferimento
Dim OthWD As New OtherRefTabWD(m_MainWindow, LenToString(m_OtherRefTabX, 2), LenToString(m_OtherRefTabY, 2), m_RawOffsX, m_RawOffsY, m_OtherRefTabPos) Dim OthWD As New OtherRefTabWD(m_MainWindow, LenToString(m_OtherRefTabX, 2), LenToString(m_OtherRefTabY, 2), m_RawOffsX, m_RawOffsY, m_OtherRefTabPos, m_CurrRefTab)
OthWD.ShowDialog() OthWD.ShowDialog()
End Sub End Sub
Private Sub ManualModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualModeBtn.Click
' Imposto modalità manuale della macchina
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
End Sub
#End Region ' OtherRefTab #End Region ' OtherRefTab
Private Sub KerfTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KerfTxBx.EgtClosed Private Sub KerfTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KerfTxBx.EgtClosed
@@ -2352,6 +2554,8 @@ Public Class RawPartPageUC
KerfTxBx.Text = LenToString(m_RawKerf, 2) KerfTxBx.Text = LenToString(m_RawKerf, 2)
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 22) & " " & LenToString(dMaxKerf, 2)) 'Massimo kerf = m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 22) & " " & LenToString(dMaxKerf, 2)) 'Massimo kerf =
End If End If
' Verifico se attivare la visualizzazione dell'area sicura (prendo la posizione corrente come posizione di partenza)
DrawSafetyZone(m_RawHeight, m_CurrentMachine.dHighPieceZ, New Vector3d(0, 0, 0))
End Sub End Sub
Private Sub RawProbingBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawProbingBtn.Click Private Sub RawProbingBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawProbingBtn.Click
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

+6
View File
@@ -206,6 +206,12 @@ Public Class SimulationPageUC
Else Else
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/Play.png", UriKind.Relative)) PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/Play.png", UriKind.Relative))
End If End If
Dim nIdBase As Integer = EgtGetBaseId("Base")
Dim m_nIdMinRedX = EgtGetFirstNameInGroup(nIdBase, "MinRedX")
If m_nIdMinRedX <> GDB_ID.NULL Then EgtSetStatus(m_nIdMinRedX, GDB_ST.OFF)
Dim m_nIdMinRedY = EgtGetFirstNameInGroup(nIdBase, "MinRedY")
If m_nIdMinRedY <> GDB_ID.NULL Then EgtSetStatus(m_nIdMinRedY, GDB_ST.OFF)
End Sub End Sub
Private Sub StepBtn_Click(sender As Object, e As RoutedEventArgs) Handles StepBtn.Click Private Sub StepBtn_Click(sender As Object, e As RoutedEventArgs) Handles StepBtn.Click
+4
View File
@@ -362,6 +362,10 @@ Module Utility
EgtSetStatus(nPartId, GDB_ST.ON_) EgtSetStatus(nPartId, GDB_ST.ON_)
nPartId = EgtGetNextPart(nPartId) nPartId = EgtGetNextPart(nPartId)
End While End While
' Visualizzo gli elementi attivi in parcheggio
SelParkIndWD.UpdateViewOnParkInd(False)
' Se necessario, ripristino precedente impostazione modificato ' Se necessario, ripristino precedente impostazione modificato
If bOldEnMod Then EgtEnableModified() If bOldEnMod Then EgtEnableModified()
End Sub End Sub
+71 -21
View File
@@ -4,27 +4,77 @@
TextBlock.FontFamily="{DynamicResource OmagCut_Font}" TextBlock.FontFamily="{DynamicResource OmagCut_Font}"
Height="500" Width="500" ShowInTaskbar="False" Initialized="Window_Initialized" MinWidth="300" MinHeight="300"> Height="500" Width="500" ShowInTaskbar="False" Initialized="Window_Initialized" MinWidth="300" MinHeight="300">
<Grid Name="VeinMatchingGrid" Background="{DynamicResource OmagCut_Gray}"> <Grid Name="VeinMatchingGrid" Background="{DynamicResource OmagCut_Gray}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="91"/> <ColumnDefinition Width="91"/>
<ColumnDefinition Width="1*"/> <ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<DockPanel>
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical" VerticalAlignment="Top" DockPanel.Dock="Top">
<Button Name="NewBtn" Height="64" <Button Name="NewBtn" Height="64"
Style="{DynamicResource OmagCut_YellowTextButton}" Style="{DynamicResource OmagCut_YellowTextButton}"
Content="New"/> Content="New"/>
<Button Name="ExportBtn" Height="64" <Button Name="ExportBtn" Height="64"
Style="{DynamicResource OmagCut_YellowTextButton}" Style="{DynamicResource OmagCut_YellowTextButton}"
Content="Export"/> Content="Export"/>
<Button Name="AssemblyBtn" Height="64" <Button Name="AssemblyBtn" Height="64"
Style="{DynamicResource OmagCut_YellowTextButton}" Style="{DynamicResource OmagCut_YellowTextButton}"
Content="3D"/> Content="3D"/>
<Button Name="ImportCurrProjBtn" Height="64" <Button Name="ImportCurrProjBtn" Height="64"
Style="{DynamicResource OmagCut_YellowTextButton}" Style="{DynamicResource OmagCut_YellowTextButton}"
Content="Import"/> Content="Import"/>
</StackPanel> <ToggleButton Name="MeasureBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
<Image Source="{DynamicResource MeasureImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
</ToggleButton>
</StackPanel>
<StackPanel Name="DistanceStkPnl" Orientation="Vertical" VerticalAlignment="Bottom" DockPanel.Dock="Bottom" Margin="10,0,0,0">
<!--Distanza-->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="MeasureLabTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="0" Foreground="{StaticResource Omag_LightGray}"
Text="Dist=" HorizontalAlignment="Right" />
<TextBlock Name="MeasureValTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="1" Foreground="{StaticResource Omag_LightGray}"
HorizontalAlignment="Left"/>
</Grid>
<!--Proiezione in X-->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="dXLabTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="0" Foreground="{StaticResource Omag_LightGray}"
Text="dX=" HorizontalAlignment="Right"/>
<TextBlock Name="dXValTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="1" Foreground="{StaticResource Omag_LightGray}"
HorizontalAlignment="Left"/>
</Grid>
<!--Proiezione in Y -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="dYLabTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="0" Foreground="{StaticResource Omag_LightGray}"
Text="dY=" HorizontalAlignment="Right"/>
<TextBlock Name="dYValTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="1" Foreground="{StaticResource Omag_LightGray}"
HorizontalAlignment="Left"/>
</Grid>
<!--Proiezione in Z -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<TextBlock Name="dZLabTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="0" Foreground="{StaticResource Omag_LightGray}"
Text="dZ=" HorizontalAlignment="Right"/>
<TextBlock Name="dZValTxBl" Height="20" DockPanel.Dock="Bottom" Grid.Column="1" Foreground="{StaticResource Omag_LightGray}"
HorizontalAlignment="Left"/>
</Grid>
</StackPanel>
</DockPanel>
</Grid> </Grid>
</Window> </Window>
+40
View File
@@ -82,6 +82,8 @@ Public Class VeinMatchingWindow
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile()) Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile())
EgtSetTextureMaxLinPixels(nTxrMaxLinPix) EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
m_bFirst = False m_bFirst = False
' nascondo la visulizzazione dei campi
DistanceStkPnl.Visibility = Visibility.Hidden
End If End If
' inibisco selezione diretta da Scene ' inibisco selezione diretta da Scene
VeinMatchingScene.SetStatusNull() VeinMatchingScene.SetStatusNull()
@@ -194,6 +196,25 @@ Public Class VeinMatchingWindow
EgtDraw() EgtDraw()
End Sub End Sub
Private Sub OnShowDistanceVector(sender As Object, vtDist As Vector3d) Handles VeinMatchingScene.OnShowDistanceVector
Dim sMsg As String = DistToString(vtDist)
Dim sItemsMsg As String() = sMsg.Split(vbCrLf)
If sItemsMsg.Count > 1 Then
' stampo solo il valore di lunghezza
MeasureValTxBl.Text = sItemsMsg(0).Split("="c)(1)
sItemsMsg(1) = sItemsMsg(1).Trim
Dim sSubItemMsg As String() = sItemsMsg(1).Split(" "c)
If sSubItemMsg.Count > 1 Then
dXValTxBl.Text = sSubItemMsg(0).Split("="c)(1)
dYValTxBl.Text = sSubItemMsg(1).Split("="c)(1)
dZValTxBl.Text = sSubItemMsg(2).Split("="c)(1)
End If
Else
MeasureValTxBl.Text = sMsg
End If
DistanceStkPnl.Visibility = Visibility.Visible
End Sub
Private Sub NewBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewBtn.Click Private Sub NewBtn_Click(sender As Object, e As RoutedEventArgs) Handles NewBtn.Click
VeinMatching.Clear() VeinMatching.Clear()
End Sub End Sub
@@ -211,6 +232,25 @@ Public Class VeinMatchingWindow
VeinMatching.LoadCurrPartFromProj() VeinMatching.LoadCurrPartFromProj()
End Sub End Sub
Private Sub MeasureBtn_Checked(sender As Object, e As RoutedEventArgs) Handles MeasureBtn.Checked
VeinMatchingScene.SetStatusGetDistance()
Dim ptRef1 As Point3d
If EgtGetTableRef(1, ptRef1) Then
EgtSetGridFrame(New Frame3d(ptRef1))
VeinMatchingScene.SetGridCursorPos(True)
End If
End Sub
Private Sub MeasureBtn_Unchecked(sender As Object, e As RoutedEventArgs) Handles MeasureBtn.Unchecked
VeinMatchingScene.ResetStatusGetDistance()
VeinMatchingScene.SetStatusNull()
MeasureValTxBl.Text = ""
dXValTxBl.Text = ""
dYValTxBl.Text = ""
dZValTxBl.Text = ""
DistanceStkPnl.Visibility = Visibility.Hidden
End Sub
End Class End Class
Friend Module VeinMatching Friend Module VeinMatching