Compare commits
200 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a18cba5261 | |||
| 0e08cc7d0d | |||
| a2bb9e250c | |||
| 7565e2e0ed | |||
| 2673d51008 | |||
| 1d5cce387f | |||
| 07e5756793 | |||
| e5e80e9a55 | |||
| cd0388b970 | |||
| 135be5f104 | |||
| 2f116ba3fe | |||
| 96ee5b5172 | |||
| 484f7eb410 | |||
| c1eb839fe8 | |||
| f3b1d80de7 | |||
| 14b4897575 | |||
| 213a66d916 | |||
| c9c7aeafae | |||
| 07d54499b7 | |||
| 9f266f1c56 | |||
| 48e523ce26 | |||
| a73b45d23e | |||
| 8ea607611c | |||
| bdf0971c20 | |||
| 7d77297695 | |||
| bdcdcaecf0 | |||
| 44011c5775 | |||
| cba095188e | |||
| ebedccf46a | |||
| 8bd7d9e3fa | |||
| 8dfa932bd7 | |||
| 5422e905e7 | |||
| da396cc82e | |||
| da8e7a9e42 | |||
| d8cbe1a2c6 | |||
| 79c2c17d6b | |||
| ccb8945a4f | |||
| 842ab19e8b | |||
| 5cfc72be27 | |||
| 45d3f5c7d8 | |||
| ac67a14fea | |||
| 1df823cdec | |||
| be29ea050d | |||
| cd4d2b1ccb | |||
| c730513f27 | |||
| 9f3920a2b2 | |||
| f388dc0c50 | |||
| 6613b3d551 | |||
| 615d6d2652 | |||
| 3ea8335357 | |||
| bbdac91894 | |||
| c424ff6661 | |||
| 4d64328b1b | |||
| 10c4c7ecc1 | |||
| 03def4b530 | |||
| a3b56444f6 | |||
| 837380226a | |||
| f15935ecbc | |||
| 00360013e3 | |||
| 0010deb7fc | |||
| 9c267aacf7 | |||
| 311cf40a8e | |||
| 4c34b62e65 | |||
| 87037b6c6a | |||
| 74c479d17d | |||
| ee6c0ad146 | |||
| ead6bcec6d | |||
| a1ad658f27 | |||
| 4ab7811b50 | |||
| 1899c9a735 | |||
| 3f769c49da | |||
| da4ddb2a7f | |||
| 3667ecb3b7 | |||
| 206af48539 | |||
| 253e92b111 | |||
| 123d6118e9 | |||
| a2104eaa03 | |||
| 65b9bfdcdb | |||
| 004591896c | |||
| 02af01052b | |||
| 2bc386807f | |||
| 82af1baae3 | |||
| 68b4dfed80 | |||
| ffc7536177 | |||
| 70368b73be | |||
| 05b4e2e95a | |||
| 1d7cdf8fa0 | |||
| 5190a41470 | |||
| 3afe6bb35b | |||
| c546df45ca | |||
| 554ae16e48 | |||
| 1b4d239202 | |||
| 3b2d15703a | |||
| 8e5a4d4ac5 | |||
| ef621a340a | |||
| f2ce55ff27 | |||
| ae3b16b715 | |||
| 8ff4b74725 | |||
| 18fb37b497 | |||
| 246e55f733 | |||
| e7e1946230 | |||
| 8dc6b63801 | |||
| 9b29b16a33 | |||
| 1debeab653 | |||
| 63c3a4e085 | |||
| 7830105bc4 | |||
| 8a11051575 | |||
| 0b50832b4e | |||
| 7f548e5ba6 | |||
| 40bdcec46e | |||
| 2cf1be7348 | |||
| bb932788f9 | |||
| 4c0da9af53 | |||
| 9eaca47566 | |||
| 7c53ecceb4 | |||
| 9a6f6ad37e | |||
| 8174c6137a | |||
| b84699e3c1 | |||
| 5101c1cca9 | |||
| 3ad3694454 | |||
| 9d9e184efa | |||
| cf3f756683 | |||
| 72544190cc | |||
| 2ce454ad0a | |||
| 5a3ad4356f | |||
| ba4414c9f6 | |||
| aa29e4106d | |||
| 76eb17868c | |||
| 829b58a0e5 | |||
| 79847e3cce | |||
| 59be071d12 | |||
| d9150c75f4 | |||
| 00088315cd | |||
| e12a310010 | |||
| 449fe3ad57 | |||
| e8d8637832 | |||
| 6671f2269e | |||
| 26ef6b2d3b | |||
| b5e9686da2 | |||
| f57410dffb | |||
| 346c452546 | |||
| 2eff34e8b6 | |||
| 7c3a107c31 | |||
| e119e9673a | |||
| 2407d3a0ae | |||
| fd32ba3ea1 | |||
| 9045469c0d | |||
| 10972a466d | |||
| e6b674ec46 | |||
| 68cdd41b20 | |||
| cf23a2b7c2 | |||
| 67c2a9d0ec | |||
| 7b70a27ff4 | |||
| 00c37ad74f | |||
| 18e079d235 | |||
| f734885de5 | |||
| 0cc673b047 | |||
| acc1365fd2 | |||
| 7dcf1fe8dc | |||
| fcca1ed72c | |||
| 03ecf3493b | |||
| 36b667fcc5 | |||
| cd748dea7a | |||
| c2f03a883a | |||
| 9b09eeaa9c | |||
| 919890e68d | |||
| fa0bc2ffdd | |||
| b8143b0ff5 | |||
| 085975338a | |||
| 53fc2694a3 | |||
| 9c8563f5c3 | |||
| 2f78dd796d | |||
| 378369d3d5 | |||
| 656c5a7d54 | |||
| c40bc508d0 | |||
| de2234387d | |||
| d7c1ecacc2 | |||
| ec813beae5 | |||
| 7a9faf537f | |||
| 6f58b6f090 | |||
| 529fb6d3a6 | |||
| 53d06d6098 | |||
| eb571bf5fd | |||
| 3d11abfa31 | |||
| b1f8d21cc5 | |||
| ec8fbd3297 | |||
| fdd3342492 | |||
| f41b8f1409 | |||
| 5edd5300cd | |||
| 92be9189c6 | |||
| 6c0bb175d9 | |||
| a079596aed | |||
| 60da7384a2 | |||
| 761842bf45 | |||
| 32cfbfbeec | |||
| 2ff2e6ffc4 | |||
| 0c7c729914 | |||
| 7195e16c37 | |||
| 42b0622bdf | |||
| 8419659647 |
@@ -23,7 +23,8 @@
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
</Grid.RowDefinitions>
|
||||
@@ -35,7 +36,7 @@
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border Name="LogoBrd" Grid.Column="1">
|
||||
<Image Source="../Resources/AboutBoxImage.png" Stretch="Uniform"/>
|
||||
<Image Source="../Resources/NewIcons/Logo-Egalware (3).png" Stretch="Uniform"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<TextBlock Name="DescriptionLbl" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Center"
|
||||
@@ -44,13 +45,17 @@
|
||||
VerticalAlignment="Center" FontSize="18"/>
|
||||
<TextBlock Name="KeyLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="18"/>
|
||||
<TextBlock Name="MachineLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Center"
|
||||
|
||||
<TextBlock Name="AssStatusLbl" Grid.Column="1" Grid.Row="6" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="18"/>
|
||||
<TextBlock Name="ProjectLbl" Grid.Column="1" Grid.Row="7" HorizontalAlignment="Center"
|
||||
|
||||
<TextBlock Name="MachineLbl" Grid.Column="1" Grid.Row="7" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="18"/>
|
||||
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="8" HorizontalAlignment="Center"
|
||||
<TextBlock Name="ProjectLbl" Grid.Column="1" Grid.Row="8" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="18"/>
|
||||
<TextBlock Name="CopyrightLbl" Grid.Column="1" Grid.Row="9" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" FontSize="15" />
|
||||
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="10" IsCancel="True"
|
||||
<Button Name="ExitBtn" Grid.Column="1" Grid.Row="11" IsCancel="True"
|
||||
Style="{DynamicResource OmagCut_WindowGrayTextButton}" Margin="1,0"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -33,6 +33,19 @@ Public Class AboutBoxWD
|
||||
#Else
|
||||
KeyLbl.Text = sKey & " - " & sOpts
|
||||
#End If
|
||||
' COPIATO da codice CAM5
|
||||
Dim sAssStatus As String = " discontinued"
|
||||
Dim nAssLeftDays As Integer
|
||||
If EgtGetKeyAssLeftDays(nAssLeftDays) And nAssLeftDays >= 0 Then
|
||||
If nAssLeftDays > 30 Then
|
||||
sAssStatus = "expires within " & nAssLeftDays.ToString() & " days"
|
||||
ElseIf nAssLeftDays > 0 Then
|
||||
sAssStatus = "to be renewed within " & nAssLeftDays.ToString() & " days"
|
||||
Else
|
||||
sAssStatus = "to be renewed by today"
|
||||
End If
|
||||
End If
|
||||
AssStatusLbl.Text = sAssStatus
|
||||
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
|
||||
MachineLbl.Text = "Machine : " & m_MainWindow.m_CurrentMachine.sMachineName
|
||||
ProjectLbl.Text = "Project : " & m_MainWindow.m_CurrentProjectPageUC.GetCurrentProjectName()
|
||||
|
||||
@@ -22,9 +22,12 @@ Friend Module CamAuto
|
||||
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Add")
|
||||
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
||||
EgtLuaResetGlobVar("CAM")
|
||||
If nErr <> 0 Then
|
||||
If nErr > 0 Then
|
||||
bOk = False
|
||||
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
|
||||
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
|
||||
Return bOk
|
||||
@@ -40,9 +43,34 @@ Friend Module CamAuto
|
||||
bOk = bOk AndAlso EgtLuaCallFunction("CAM.AddWaterJet")
|
||||
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
||||
EgtLuaResetGlobVar("CAM")
|
||||
If nErr <> 0 Then
|
||||
If nErr > 0 Then
|
||||
bOk = False
|
||||
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
|
||||
Return bOk
|
||||
End Function
|
||||
@@ -56,9 +84,11 @@ Friend Module CamAuto
|
||||
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Erase")
|
||||
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
||||
EgtLuaResetGlobVar("CAM")
|
||||
If nErr <> 0 Then
|
||||
If nErr > 0 Then
|
||||
bOk = False
|
||||
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
||||
ElseIf nErr < 0 Then
|
||||
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
|
||||
End If
|
||||
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
|
||||
m_MainWindow.m_CurrentProjectPageUC.ResetProjectNcRestart()
|
||||
@@ -74,9 +104,11 @@ Friend Module CamAuto
|
||||
bOk = bOk AndAlso EgtLuaCallFunction("CAM.InvertVerticalCut")
|
||||
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
||||
EgtLuaResetGlobVar("CAM")
|
||||
If nErr <> 0 Then
|
||||
If nErr > 0 Then
|
||||
bOk = False
|
||||
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
||||
ElseIf nErr < 0 Then
|
||||
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
@@ -164,6 +196,45 @@ Friend Module CamAuto
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function ResetAllSplitCut() As Boolean
|
||||
Dim PartList As New List(Of Integer)
|
||||
' Ricerca nei grezzi dei pezzi (devono essere ricercati tra quelli presenti nei grezzi)
|
||||
Dim bOk As Boolean = True
|
||||
' Recupero il numero di fasi presenti nel progetto
|
||||
Dim nPhaseCount As Integer = EgtGetPhaseCount()
|
||||
For nPhase As Integer = 1 To nPhaseCount
|
||||
EgtSetCurrPhase(nPhase)
|
||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
Dim nParId As Integer = EgtGetFirstPartInRawPart(nRawId)
|
||||
If EgtVerifyRawPartPhase(nRawId, nPhase) Then
|
||||
While nParId <> GDB_ID.NULL
|
||||
Dim nNextParId As Integer = EgtGetNextPartInRawPart(nParId)
|
||||
' verifico se il pezzo passato è un taglio di sepatazione (il nome deve contenere "SpliCut")
|
||||
Dim sName As String = String.Empty
|
||||
If EgtGetName(nParId, sName) AndAlso sName.Contains(SPLIT_CUT) Then
|
||||
' Rimuovo il pezzo dal grezzo
|
||||
If EgtRemovePartFromRawPart(nParId) Then
|
||||
' Salvo l'indice del pezzo se non è stato già inserito
|
||||
Dim nIndex As Integer = PartList.FirstOrDefault(Function(nId) nId = nParId)
|
||||
If nIndex = 0 Then PartList.Add(nParId)
|
||||
End If
|
||||
End If
|
||||
nParId = nNextParId
|
||||
End While
|
||||
End If
|
||||
nRawId = EgtGetNextRawPart(nRawId)
|
||||
End While
|
||||
Next
|
||||
' Reimposto la prima fase del progetto
|
||||
EgtSetCurrPhase(1)
|
||||
' Procedo ad eliminare il pezzo
|
||||
For Each Item As Integer In PartList
|
||||
bOk = bOk And EgtErase(Item)
|
||||
Next
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function ResetAllRawPart() As Boolean
|
||||
Dim nPhase As Integer = 1
|
||||
Dim nOtherRaw As Integer = EgtGetFirstRawPart()
|
||||
@@ -232,9 +303,11 @@ Friend Module CamAuto
|
||||
bOk = bOk AndAlso EgtLuaCallFunction("CAM.UpdateAllTp")
|
||||
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
||||
EgtLuaResetGlobVar("CAM")
|
||||
If nErr <> 0 Then
|
||||
If nErr > 0 Then
|
||||
bOk = False
|
||||
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
||||
ElseIf nErr < 0 Then
|
||||
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
@@ -248,9 +321,11 @@ Friend Module CamAuto
|
||||
bOk = bOk AndAlso EgtLuaCallFunction("CAM.Sort")
|
||||
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
||||
EgtLuaResetGlobVar("CAM")
|
||||
If nErr <> 0 Then
|
||||
If nErr > 0 Then
|
||||
bOk = False
|
||||
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
||||
ElseIf nErr < 0 Then
|
||||
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
@@ -265,9 +340,11 @@ Friend Module CamAuto
|
||||
bOk = bOk AndAlso EgtLuaCallFunction("CAM.SpecApplyDisp")
|
||||
EgtLuaGetGlobIntVar("CAM.ERR", nErr)
|
||||
EgtLuaResetGlobVar("CAM")
|
||||
If nErr <> 0 Then
|
||||
If nErr > 0 Then
|
||||
bOk = False
|
||||
EgtOutLog("Error in CamAuto : " & nErr.ToString())
|
||||
ElseIf nErr < 0 Then
|
||||
EgtOutLog("Warning in CamAuto : " & nErr.ToString())
|
||||
End If
|
||||
If ResetOrderMachiningFlag Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.ResetOrderMachiningFlag()
|
||||
@@ -504,6 +581,7 @@ Friend Module CamAuto
|
||||
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
|
||||
' Ciclo sulle lavorazioni
|
||||
Dim nOperId As Integer = EgtGetFirstOperation()
|
||||
Dim LocalListOperId As New List(Of Integer)
|
||||
While nOperId <> GDB_ID.NULL
|
||||
' verifico sia una lavorazione valida di taglio con lama
|
||||
If IsValidMachining( nOperId) And EgtGetOperationType( nOperId) = MCH_OY.SAWING Then
|
||||
@@ -518,12 +596,14 @@ Friend Module CamAuto
|
||||
' se abilitato e attivo waterjet, lo aggiungo per completare il taglio
|
||||
If m_MainWindow.m_CurrentMachine.WaterJettingActive Then
|
||||
Dim nWarn As Integer = 0
|
||||
AddWaterJetMachining(nOperId, nWarn)
|
||||
LocalListOperId.Add(nOperId)
|
||||
'AddWaterJetMachining(nOperId, nWarn)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
nOperId = EgtGetNextOperation(nOperId)
|
||||
End While
|
||||
If LocalListOperId.Count > 0 Then AddWaterJetMachining(LocalListOperId, 0)
|
||||
Return bModified
|
||||
End Function
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--Griglia per oscurare i bottoni della pagina sottostante-->
|
||||
<Grid Background="{DynamicResource OmagCut_Gray}">
|
||||
<Grid Background="{DynamicResource OmagCut_Gray}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<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"/>
|
||||
|
||||
<TreeView Name="PartsTreeView" Grid.Row="2" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}">
|
||||
<TreeView Name="PartsTreeView" Grid.Row="2" Background="{StaticResource OmagCut_TreeViewGradientGray}">
|
||||
<TreeView.Resources>
|
||||
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
|
||||
<!--renderlo apribile con un solo click -->
|
||||
@@ -62,7 +62,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<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>
|
||||
|
||||
@@ -123,7 +123,10 @@
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<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>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -131,18 +134,25 @@
|
||||
</HierarchicalDataTemplate>
|
||||
<!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo-->
|
||||
<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>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="60"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock 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 Grid.Column="2" Text="{Binding sText2}" Height="18" FontSize="14" HorizontalAlignment="Left"/>
|
||||
<TextBlock x:Name="TbName" Grid.Column="0" Text="{Binding Name}" Height="18" FontSize="14" HorizontalAlignment="Right"/>
|
||||
<TextBlock x:Name="TbText1" Grid.Column="1" Text="{Binding sText1}" Height="18" FontSize="14" HorizontalAlignment="Center"/>
|
||||
<TextBlock x:Name="TbText2" Grid.Column="2" Text="{Binding sText2}" Height="18" FontSize="14" HorizontalAlignment="Left"/>
|
||||
|
||||
</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>
|
||||
</TreeView.Resources>
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Imports EgtWPFLib
|
||||
Imports System.Reflection
|
||||
Imports System.Globalization
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class CadCutPageUC
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<Window x:Class="ChooseTestToolWD"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
FontFamily="{DynamicResource OmagCut_Font}"
|
||||
Title="OpenFile" Height="382.6" Width="426.6" WindowStyle="None"
|
||||
ResizeMode="NoResize" ShowInTaskbar="False" AllowsTransparency="True"
|
||||
Background="Transparent">
|
||||
|
||||
<Border Style="{DynamicResource OmagCut_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="FilePathTxBl" Grid.Column="1" Grid.Row="1" Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}" />
|
||||
<!--TextAlignment="Center"
|
||||
FontSize="20"
|
||||
VerticalAlignment="Center"-->
|
||||
<ListBox Name="SetUpToolListBox" Grid.Column="1" Grid.Row="2"
|
||||
ItemsSource="{Binding ItemList}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding ToolAlias}" Style="{StaticResource OmagCut_ListBoxTextBlock}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<Grid Grid.Column="1" Grid.Row="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" >
|
||||
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="ExitBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}" IsCancel="True">
|
||||
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Window>
|
||||
@@ -0,0 +1,287 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class ChooseTestToolWD
|
||||
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
Private m_SetUpToolList As New ObservableCollection(Of TestTool)
|
||||
|
||||
Sub New(Owner As Window)
|
||||
Me.Owner = Owner
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
|
||||
Private Sub OpenFile_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
' Posizione finestra
|
||||
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
|
||||
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||
' Definizione del collegamento tra ItemList e ListBox1
|
||||
SetUpToolListBox.ItemsSource = m_SetUpToolList
|
||||
FilePathTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 45) ' Selezionare l'utensile da tastare
|
||||
End Sub
|
||||
|
||||
Private Sub OpenFile_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
|
||||
' carico elenco degli utensili impostati attualmente in macchina (anche il laser!)
|
||||
LoadSetUpTool()
|
||||
' ricerco l'utensile della lavorazione indicata
|
||||
Dim Item As TestTool = m_SetUpToolList.FirstOrDefault(Function(x) x.ToolName = m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrToolFromSelectedSawCurv)
|
||||
Dim Index As Integer = m_SetUpToolList.IndexOf(Item)
|
||||
If Index < 0 Then
|
||||
Index = 0
|
||||
End If
|
||||
' se presente seleziono il primo elemento
|
||||
If m_SetUpToolList.Count > 0 Then
|
||||
SetUpToolListBox.SelectedItem = m_SetUpToolList(Index)
|
||||
OkBtn.IsEnabled = True
|
||||
Else
|
||||
OkBtn.IsEnabled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function LoadSetUpTool() As Boolean
|
||||
Dim sNameTool As String = String.Empty
|
||||
Dim sHeadTool As String = String.Empty
|
||||
Dim nExitTool As Integer = 0
|
||||
|
||||
'sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
'If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' ' Imposto la lama
|
||||
' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool, True))
|
||||
'End If
|
||||
'sNameTool = m_MainWindow.m_CurrentMachine.sCurrMill
|
||||
'If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' ' Imposto la fresa
|
||||
' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool, False))
|
||||
'End If
|
||||
'sNameTool = m_MainWindow.m_CurrentMachine.sCurrDrill
|
||||
'If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' ' Imposto il foretto
|
||||
' m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool, False))
|
||||
'End If
|
||||
|
||||
sNameTool = "Laser point"
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' Imposto laser di puntamento
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, ""))
|
||||
End If
|
||||
|
||||
sNameTool = m_MainWindow.m_CurrentMachine.sCurrWaterJet
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' Imposto WJ
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||
End If
|
||||
|
||||
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
|
||||
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' Imposto la lama
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||
End If
|
||||
sNameTool = m_MainWindow.m_CurrentMachine.sCurrMill
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' Imposto la fresa
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||
End If
|
||||
sNameTool = m_MainWindow.m_CurrentMachine.sCurrDrill
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' Imposto il foretto
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||
End If
|
||||
|
||||
Case CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER
|
||||
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' Imposto la lama
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||
End If
|
||||
' Recupero tutti gli utensili attrezzati (nel ToolChanger e nel ManualToolChanger)
|
||||
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger
|
||||
'm_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False))
|
||||
sNameTool = ToolChangerPos.sTool
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' Imposto la lama
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||
End If
|
||||
Next
|
||||
Return True
|
||||
|
||||
Case CurrentMachine.MountedToolConfigs.TOOLCHANGER
|
||||
' Recupero tutti gli utensili attrezzati (nel ToolChanger e nel ManualToolChanger)
|
||||
sNameTool = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' Imposto la lama
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||
End If
|
||||
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ToolChanger
|
||||
If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then
|
||||
'm_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False))
|
||||
sNameTool = ToolChangerPos.sTool
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' Imposto la lama
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
For Each ToolChangerPos As ToolChangerPos In m_MainWindow.m_CurrentMachine.ManualToolChanger
|
||||
If Not String.IsNullOrWhiteSpace(ToolChangerPos.sTool) Then
|
||||
'm_SetUpToolList.Add(New ToolPos(ToolChangerPos.sTool, ToolChangerPos.sName, False))
|
||||
sNameTool = ToolChangerPos.sTool
|
||||
If Not String.IsNullOrEmpty(sNameTool) Then
|
||||
' Imposto la lama
|
||||
m_SetUpToolList.Add(New TestTool(sNameTool, sNameTool))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return True
|
||||
Case Else
|
||||
Return False
|
||||
End Select
|
||||
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub SetUpToolListBox_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) Handles SetUpToolListBox.PreviewMouseUp
|
||||
' Disabilito Ok
|
||||
OkBtn.IsEnabled = False
|
||||
' Recupero item selezionato
|
||||
If SetUpToolListBox.SelectedItems.Count() = 0 Then
|
||||
Return
|
||||
End If
|
||||
' A seconda del tipo
|
||||
OkBtn.IsEnabled = True
|
||||
End Sub
|
||||
|
||||
Private Sub SetUpToolListBox_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles SetUpToolListBox.SelectionChanged
|
||||
' Disabilito Ok
|
||||
OkBtn.IsEnabled = False
|
||||
' Recupero item selezionato
|
||||
If SetUpToolListBox.SelectedItems.Count() = 0 Then
|
||||
Return
|
||||
Else
|
||||
OkBtn.IsEnabled = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
DialogResult = True
|
||||
End Sub
|
||||
|
||||
' restituisce l'oggetto selezionato in elenco e lo imposta come attivo
|
||||
Friend Function GetSelectedTool() As TestTool
|
||||
Dim SelTestTool As TestTool = DirectCast(SetUpToolListBox.SelectedItem, TestTool)
|
||||
If SelTestTool.ToolAlias = "Laser point" Then
|
||||
SelTestTool.ToolHead = "H3"
|
||||
SelTestTool.ToolExit = 1
|
||||
SelTestTool.ToolIsSaw = False
|
||||
SelTestTool.ToolIsLaser = True
|
||||
Else
|
||||
EgtTdbSetCurrTool(SelTestTool.ToolName)
|
||||
Dim sHeadTool As String = String.Empty
|
||||
Dim nExitTool As Integer = 0
|
||||
Dim sTypeTool As String = String.Empty
|
||||
Dim nTypeTool As Integer
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nTypeTool)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.HEAD, sHeadTool)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.EXIT_, nExitTool)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TYPE, sTypeTool)
|
||||
SelTestTool.ToolHead = sHeadTool
|
||||
SelTestTool.ToolExit = nExitTool
|
||||
SelTestTool.ToolType = nTypeTool
|
||||
SelTestTool.ToolIsSaw = (nTypeTool = MCH_TY.SAW_STD)
|
||||
SelTestTool.ToolIsLaser = False
|
||||
End If
|
||||
|
||||
Return SelTestTool
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Public Class TestTool
|
||||
|
||||
Private m_ToolAlias As String = String.Empty
|
||||
Private m_ToolName As String = String.Empty
|
||||
Private m_ToolHead As String = "H1"
|
||||
Private m_ToolExit As Integer = 1
|
||||
Private m_ToolIsSaw As Boolean = False
|
||||
Private m_ToolIsLaser As Boolean = False
|
||||
Private m_ToolType As Integer = -1
|
||||
|
||||
Public Property ToolAlias As String
|
||||
Get
|
||||
Return m_ToolAlias
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ToolAlias = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property ToolName As String
|
||||
Get
|
||||
Return m_ToolName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ToolName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property ToolHead As String
|
||||
Get
|
||||
Return m_ToolHead
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ToolHead = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property ToolExit As Integer
|
||||
Get
|
||||
Return m_ToolExit
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_ToolExit = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property ToolType As Integer
|
||||
Get
|
||||
Return m_ToolType
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_ToolType = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property ToolIsSaw As Boolean
|
||||
Get
|
||||
Return m_ToolIsSaw
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_ToolIsSaw = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property ToolIsLaser As Boolean
|
||||
Get
|
||||
Return m_ToolIsLaser
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_ToolIsLaser = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sToolAlias As String, sToolName As String)
|
||||
m_ToolAlias = sToolAlias
|
||||
m_ToolName = sToolName
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -127,16 +127,23 @@ Public Class MoveRawPartPage
|
||||
UnloadPartsBtn.Content = "Go to MOVE part"
|
||||
' altrimenti, aggiorno visualizzazione
|
||||
ElseIf Not m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
|
||||
EgtDraw()
|
||||
UnloadPartsBtn.Content = "Go to UNLOAD part"
|
||||
End If
|
||||
'---------------------------- AUX TABLE ----------------------------
|
||||
|
||||
EgtDraw()
|
||||
' Carico i parametri di movimento
|
||||
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
|
||||
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())
|
||||
RotationAngleTxBx.Text = DoubleToString(m_dRotation, 3)
|
||||
' Se movimento manuale perpendicolare
|
||||
@@ -341,7 +348,6 @@ Public Class MoveRawPartPage
|
||||
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||
End If
|
||||
Else
|
||||
|
||||
' verifico che il pezzo precedente possa essere depositato correttamente
|
||||
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||
' mantengo la selezione del pezzo
|
||||
@@ -351,6 +357,15 @@ Public Class MoveRawPartPage
|
||||
' esco dal ciclo, prima devo depositare correttamente il pezzo
|
||||
Exit While
|
||||
End If
|
||||
' Verifico che il pezzo corrente sia prelevabile - versione 2.6c3 -
|
||||
If VerifyCollisionWithOtherRawPart(nId, True) Then
|
||||
' mantengo la selezione del pezzo
|
||||
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
|
||||
EgtDraw()
|
||||
' esco dal ciclo, prima devo depositare correttamente il pezzo
|
||||
Exit While
|
||||
End If
|
||||
' salvo l'indice del pezzo correntemente attaccato alle ventose
|
||||
m_CurrRawOnVacuum = nId
|
||||
|
||||
@@ -374,7 +389,7 @@ Public Class MoveRawPartPage
|
||||
VacuumCups.ResetHeadName()
|
||||
Dim bPutVacuum As Boolean = PutVacuumCupsOnRaw(nId, rmData)
|
||||
If Not bPutVacuum Then
|
||||
Dim bTwoHeadVac As Boolean = ( EgtGetHeadId( VACUUM_HEAD_2) <> GDB_ID.NULL)
|
||||
Dim bTwoHeadVac As Boolean = (EgtGetHeadId(VACUUM_HEAD_2) <> GDB_ID.NULL)
|
||||
If bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(nId, rmData)
|
||||
End If
|
||||
|
||||
@@ -421,7 +436,7 @@ Public Class MoveRawPartPage
|
||||
End Sub
|
||||
|
||||
' Veririfica che il grezzo non entri in colliosione con altri pezzi
|
||||
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
|
||||
Private Function VerifyCollisionWithOtherRawPart_0(nIdOnVacumm As Integer) As Boolean
|
||||
' se movimento su tavola di scarico non eseguo il controllo (evito di segnalre errori per pezzi ricavati interni al grezzo...)
|
||||
If m_SplitPage.m_bOnAuxTab Then Return False
|
||||
If nIdOnVacumm = GDB_ID.NULL Then Return False
|
||||
@@ -455,6 +470,69 @@ Public Class MoveRawPartPage
|
||||
Return False
|
||||
End Function
|
||||
|
||||
' Veririfica che il grezzo non entri in colliosione con altri pezzi - versione 2.6c3 -
|
||||
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer, Optional IsTaking As Boolean = False) As Boolean
|
||||
' se movimento su tavola di scarico non eseguo il controllo (evito di segnalre errori per pezzi ricavati interni al grezzo...)
|
||||
If m_SplitPage.m_bOnAuxTab Then Return False
|
||||
If nIdOnVacumm = GDB_ID.NULL Then Return False
|
||||
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
|
||||
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
||||
If m_nTempId = GDB_ID.NULL Then Return False
|
||||
EgtSetName(m_nTempId, "RawTemp")
|
||||
' recupero il contorno del'ID attaccato alle ventose e da questo genero una superificie
|
||||
Dim nIdUpRegionOnVac As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawUpReg")
|
||||
Dim nIdDwnRegionOnVac As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawDwnReg")
|
||||
' recupero gli ID di tutti i grezzi della fase corrente
|
||||
Dim nCurrPhase As Integer = EgtGetCurrPhase()
|
||||
Dim nRawGroupId = EgtGetParent(EgtGetFirstRawPart())
|
||||
Dim nIdRaw As Integer = EgtGetFirstRawPart()
|
||||
' ciclo su tutti i grezzi per veririficare eventuali collisioni
|
||||
While nIdRaw <> GDB_ID.NULL
|
||||
' verifico la fase del grezzo
|
||||
If EgtVerifyRawPartCurrPhase(nIdRaw) And nIdOnVacumm <> nIdRaw Then
|
||||
' recupero il contorno del pezzo e genero la sua sueperificie
|
||||
Dim nIdUpRegion As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawUpReg")
|
||||
Dim nIdDwnRegion As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawDwnReg")
|
||||
' creo la copia delle superifici
|
||||
Dim nCopy_IdDwnRegionOnVac As Integer = EgtCopyGlob(nIdDwnRegionOnVac, m_nTempId)
|
||||
Dim nCopy_nIdUpRegion As Integer = EgtCopyGlob(nIdUpRegion, m_nTempId)
|
||||
' PRELIEVO
|
||||
If EgtSurfFrIntersect(nCopy_IdDwnRegionOnVac, nCopy_nIdUpRegion) Then
|
||||
' se esite una superficie allora esiste un'intersezione
|
||||
If EgtExistsObj(nCopy_IdDwnRegionOnVac) Then
|
||||
EgtErase(m_nTempId)
|
||||
' Esco: Intersezione TROVATA → true
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
If Not IsTaking Then
|
||||
' DEPOSITO : devono essere esguiti due controlli ulteririori
|
||||
Dim nCopy_IdUpRegionOnVac As Integer = EgtCopyGlob(nIdUpRegionOnVac, m_nTempId)
|
||||
Dim nCopy_nIdDwnRegion As Integer = EgtCopyGlob(nIdDwnRegion, m_nTempId)
|
||||
If EgtSurfFrIntersect(nCopy_IdDwnRegionOnVac, nCopy_nIdDwnRegion) Then
|
||||
' se esite una superficie allora esiste un'intersezione
|
||||
If EgtExistsObj(nCopy_IdDwnRegionOnVac) Then
|
||||
EgtErase(m_nTempId)
|
||||
' Esco: Intersezione TROVATA → true
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
If EgtSurfFrIntersect(nCopy_IdUpRegionOnVac, nCopy_nIdUpRegion) Then
|
||||
' se esite una superficie allora esiste un'intersezione
|
||||
If EgtExistsObj(nCopy_IdUpRegionOnVac) Then
|
||||
EgtErase(m_nTempId)
|
||||
' Esco: Intersezione TROVATA → true
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
nIdRaw = EgtGetNextRawPart(nIdRaw)
|
||||
End While
|
||||
EgtErase(m_nTempId)
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Function VerifyIsNewScrap(nMyId As Integer) As Boolean
|
||||
Dim nVal As Integer = 0
|
||||
If EgtGetInfo(nMyId, K_ISNEWSCRAPS, nVal) Then
|
||||
@@ -789,6 +867,12 @@ Public Class MoveRawPartPage
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Private Sub RemovePart_KeyCancel(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles m_CurrProjPage.OnKeyCancelDownScene
|
||||
If e.KeyCode = System.Windows.Forms.Keys.Delete Then
|
||||
RemovePartBtn_Click(Nothing, Nothing)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
|
||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||
While nRawId <> GDB_ID.NULL
|
||||
@@ -856,6 +940,7 @@ Public Class MoveRawPartPage
|
||||
' Mantengo la fase che è stata creata e passo a gestire solo la visualizzazione dei bottoni
|
||||
RefreshVisibility()
|
||||
EgtZoom(ZM.ALL, True)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
|
||||
@@ -1291,7 +1376,7 @@ Public Class MoveRawPartPage
|
||||
Return
|
||||
End If
|
||||
|
||||
' ------- VISUALIZZAZIONE -------
|
||||
' ------- VISUALIZZAZIONE (navigazione tra le fasi) -------
|
||||
If m_SplitPage.m_bShow Then
|
||||
' verifico se la fase successiva è uno scarico frontale
|
||||
If NextOperationIsUnloading(m_nCurrDisposition) Then
|
||||
@@ -1435,7 +1520,12 @@ Public Class MoveRawPartPage
|
||||
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||
UnloadPartsBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||
If m_SplitPage.m_bShow Then
|
||||
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
|
||||
' se ultima fase (e non sacrico su tavola)
|
||||
If m_nCurrPhase = EgtGetPhaseCount() And m_SplitPage.m_bOnAuxTab Then
|
||||
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
|
||||
Else
|
||||
NextBtn.IsEnabled = (m_nCurrPhase <= EgtGetPhaseCount())
|
||||
End If
|
||||
Else
|
||||
' Se esistono delle lavorazioni allora abilito il pulsante per procedere
|
||||
If Not bExistsMachining Then
|
||||
@@ -1443,7 +1533,6 @@ Public Class MoveRawPartPage
|
||||
Else
|
||||
NextBtn.IsEnabled = True
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
@@ -107,7 +107,7 @@
|
||||
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Name="ModPointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
<Image Source="{DynamicResource Move-Spot-RegImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
<ToggleButton Name="RemovePointRegBtn" Visibility="Hidden"
|
||||
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
@@ -118,10 +118,10 @@
|
||||
<!--Comandi attivi solo in madalità REG-->
|
||||
<UniformGrid Name ="UG1_Reg" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" Visibility="Hidden">
|
||||
<Button Name="AdjustPointRegBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource Parcheggia-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
<Image Source="{DynamicResource Muovi-grezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
<ToggleButton Name="ActivatePointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource ON_OFF-singolo-taglioImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
<Image Source="{DynamicResource ON_OFF-REGImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</UniformGrid>
|
||||
|
||||
@@ -149,29 +149,31 @@
|
||||
</ToggleButton>
|
||||
</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}">
|
||||
<Image Source="{DynamicResource Seleziona-tuttoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="DeselectAllBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource Deseleziona-tuttoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
</UniformGrid>
|
||||
<ToggleButton Name="ParkIndBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Name="ParkIndImg" Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--LowerButtonGrid-->
|
||||
<Grid Grid.Column="2" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Column="2" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -9,6 +9,9 @@ Public Class NestPageUC
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
' Fisetra per la gestione dei parcheggi
|
||||
Private m_SelParkInd As SelParkIndWD
|
||||
|
||||
' Flag di pagina attiva
|
||||
Private m_bActive As Boolean = False
|
||||
' Flag per modalità nesting standard o registrazione posizione lastra
|
||||
@@ -30,6 +33,7 @@ Public Class NestPageUC
|
||||
' Id della curva e del taglio selezionati per eseguire il test
|
||||
Friend m_CurrSelectedCurv As Integer = GDB_ID.NULL
|
||||
Friend m_CurrSelectedSawCurv As Integer = GDB_ID.NULL
|
||||
Friend m_CurrToolFromSelectedSawCurv As String = String.Empty
|
||||
|
||||
' Id del rettangolo, del taglio e della curva da modificare tramite Drag
|
||||
Private m_nIdSelectedOutLoopRettangle As Integer = GDB_ID.NULL
|
||||
@@ -143,11 +147,30 @@ Public Class NestPageUC
|
||||
StartCurveWJBtn.Visibility = Visibility.Collapsed
|
||||
End If
|
||||
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
|
||||
|
||||
Dim ImageConverter As New ImageSourceConverter
|
||||
|
||||
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
m_bActive = True
|
||||
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)
|
||||
End Sub
|
||||
|
||||
@@ -196,9 +219,16 @@ Public Class NestPageUC
|
||||
' Garantisco visibilità eventuale contorno da foto
|
||||
m_CurrProjPage.ShowContour(True)
|
||||
|
||||
' Veroifico se esiste il gruppo "REG"
|
||||
' Disabilito impostazione modificato
|
||||
Dim bOldEnMod As Boolean = EgtGetEnableModified()
|
||||
If bOldEnMod Then EgtDisableModified()
|
||||
|
||||
' Verifico se esiste il gruppo "REG"
|
||||
Dim nIdRaws As Integer = EgtGetParent(m_CurrProjPage.m_nRawId)
|
||||
Dim nIdReg As Integer = EgtGetFirstNameInGroup(EgtGetParent(nIdRaws), "Reg")
|
||||
' Resetto le variabili di conteggio
|
||||
m_nCountSpot = 0
|
||||
m_nCountSpotCUT = 0
|
||||
If nIdReg <> GDB_ID.NULL Then
|
||||
m_nRegGroupId = nIdReg
|
||||
EgtGetInfo(m_nRegGroupId, COUNTSPOT, m_nCountSpot)
|
||||
@@ -212,16 +242,26 @@ Public Class NestPageUC
|
||||
m_nCountSpot = 0
|
||||
m_nCountSpotCUT = 0
|
||||
End If
|
||||
'EgtOutLog("Numero di SPOT caricati da OFFICE: " & m_nCountSpot.ToString)
|
||||
' Se nel progetto non sono inseriti punti SpotReg disabilito i comandi
|
||||
If m_nCountSpot < 1 Then
|
||||
UG0_Reg.IsEnabled = False
|
||||
UG1_Reg.IsEnabled = False
|
||||
'EgtOutLog(" Abilito comandi gestione SPOT")
|
||||
Else
|
||||
UG0_Reg.IsEnabled = True
|
||||
UG1_Reg.IsEnabled = True
|
||||
'EgtOutLog(" Disabilito comandi gestione SPOT")
|
||||
End If
|
||||
' Se nel progetto non sono inseriti punti SpotRegCUT provvedo ad aggiungerli
|
||||
If m_nCountSpotCUT < 1 Then
|
||||
InsertSportRegistration()
|
||||
InsertSpotRegistration()
|
||||
'EgtOutLog(" Creo SPOT_CUT")
|
||||
End If
|
||||
|
||||
' Se necessario riabilito impostazione modificato
|
||||
If bOldEnMod Then EgtEnableModified()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateStepsOnUI()
|
||||
@@ -245,7 +285,9 @@ Public Class NestPageUC
|
||||
End If
|
||||
' Se esiste un elemento selezionato
|
||||
EgtResetMark(m_CurrSelectedSawCurv)
|
||||
' provo a riconoscere il valore medio del segmento
|
||||
m_CurrToolFromSelectedSawCurv = String.Empty
|
||||
' ripulisco da eventuali messaggi
|
||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||
Dim nSelMy As Integer
|
||||
@@ -270,20 +312,52 @@ Public Class NestPageUC
|
||||
' recupero il gruppo della lavorazione associata
|
||||
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
||||
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
|
||||
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
|
||||
If Not EgtGetGroupObjs(nIdSaw) Then
|
||||
m_CurrSelectedSawCurv = nIdSaw
|
||||
m_CurrSelectedCurv = nIdMy
|
||||
EgtSetMark(nIdSaw)
|
||||
EgtSelectObj(nIdMy)
|
||||
EgtDraw()
|
||||
Exit While
|
||||
End If
|
||||
|
||||
Dim nIdMachining As Integer = EgtGetFirstInGroup(nIdPV)
|
||||
While nIdMachining <> GDB_ID.NULL
|
||||
Dim sNameMachining As String = String.Empty
|
||||
EgtGetName(nIdMachining, sNameMachining)
|
||||
If sNameMachining.Contains(nIdMy.ToString) Then
|
||||
Exit While
|
||||
End If
|
||||
nIdMachining = EgtGetNext(nIdMachining)
|
||||
End While
|
||||
|
||||
' recupero la lavorazione associata nel gruppo Opers
|
||||
Dim sIdRefMachining As Integer = -1
|
||||
EgtGetInfo(nIdMachining, "MId", sIdRefMachining)
|
||||
EgtSetCurrMachining(sIdRefMachining)
|
||||
' recupero il nome dell'utensile associato alla lavorazione
|
||||
Dim sToolCurrMachining As String = String.Empty
|
||||
EgtGetMachiningParam(MCH_MP.TOOL, sToolCurrMachining)
|
||||
' seleziono le entità nel disegno
|
||||
m_CurrToolFromSelectedSawCurv = sToolCurrMachining
|
||||
m_CurrSelectedSawCurv = nIdMachining
|
||||
m_CurrSelectedCurv = nIdMy
|
||||
EgtSetMark(nIdMachining)
|
||||
EgtSelectObj(nIdMy)
|
||||
EgtDraw()
|
||||
|
||||
'Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
|
||||
'If Not EgtGetGroupObjs(nIdSaw) Then
|
||||
' m_CurrSelectedSawCurv = nIdSaw
|
||||
' m_CurrSelectedCurv = nIdMy
|
||||
' EgtSetMark(nIdSaw)
|
||||
' EgtSelectObj(nIdMy)
|
||||
' EgtDraw()
|
||||
' Exit While
|
||||
'End If
|
||||
|
||||
Exit While
|
||||
|
||||
End If
|
||||
End If
|
||||
nIdMy = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
If nIdMy = GDB_ID.NULL Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetErrorMessage("Select OUTLOOP")
|
||||
End If
|
||||
Return
|
||||
End Sub
|
||||
|
||||
@@ -1021,8 +1095,7 @@ Public Class NestPageUC
|
||||
End If
|
||||
|
||||
' Si può selezionare solo con il tasto sinistro e se stato NULL
|
||||
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
||||
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
||||
If e.Button <> Windows.Forms.MouseButtons.Left Or Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
||||
Return
|
||||
End If
|
||||
|
||||
@@ -1034,7 +1107,6 @@ Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
||||
m_bIsCounterLy = False
|
||||
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
|
||||
If m_bIsCheckedDragRettangle Then
|
||||
OnMyMouseDownSceneSelSideRettangle(sender, e)
|
||||
' Dati per drag (abilito il Drag)
|
||||
m_locPrev = e.Location
|
||||
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRettangle <> GDB_ID.NULL
|
||||
@@ -1518,6 +1590,10 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
' Eseguo verifica
|
||||
If VerifyTrfData(nMoveId) And EgtVerifyPart(nMoveId, m_bReducedCut) Then
|
||||
m_CurrProjPage.ResetOrderMachiningFlag()
|
||||
' Aggiorno la lista dei parcheggi
|
||||
If ParkIndBtn.IsChecked Then
|
||||
m_SelParkInd.UpdateList()
|
||||
End If
|
||||
' Non superata riporto alla posizione iniziale
|
||||
Else
|
||||
If m_bFromParking Then
|
||||
@@ -1549,7 +1625,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
CountPartInFamily(sRefGroup)
|
||||
End If
|
||||
End If
|
||||
'---------------------- COUNTER PART ----------------------
|
||||
'---------------------- COUNTER PART ----------------------
|
||||
End If
|
||||
m_bFromParking = False
|
||||
End If
|
||||
@@ -2219,7 +2295,10 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Else
|
||||
StandardInsert()
|
||||
End If
|
||||
|
||||
' Aggiorno la lista dei parcheggi
|
||||
If ParkIndBtn.IsChecked Then
|
||||
m_SelParkInd.UpdateList()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub StandardInsert()
|
||||
@@ -2661,6 +2740,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
End Function
|
||||
|
||||
#End Region ' Manager Counter Part
|
||||
|
||||
Private Sub DragRettangle_Click() Handles DragRettanleBtn.Click
|
||||
If DragRettanleBtn.IsChecked Then
|
||||
m_bIsCheckedDragRettangle = True
|
||||
@@ -2726,6 +2806,12 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Dim nNextId = EgtGetNextSelectedObj()
|
||||
' Metto in parcheggio, se in grezzo
|
||||
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
|
||||
VeinMatching.OnRemovePartFromRaw(nId)
|
||||
' Passo al successivo selezionato
|
||||
@@ -2735,6 +2821,8 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
m_nPartPos = PART_POS.NONE_TABLE
|
||||
' Aggiorno vista
|
||||
EgtZoom(ZM.ALL)
|
||||
' Aggiorno la lista dei parcheggi
|
||||
ReloadListParkInd()
|
||||
End Sub
|
||||
|
||||
' ripulisco la lista dei pezzi in parcheggio
|
||||
@@ -2766,6 +2854,31 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Friend Function StoreOnePartDXF(nId As Integer, DimX As Double, DimY As Double, MaxPt As Point3d) 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 Offs_y As Double = b3Tab.Min.y - MaxPt.y - STORE_DIST
|
||||
Dim Offs_x As Double = b3Tab.Min.x - (MaxPt.x - DimX) + (b3Tab.DimX - DimX) / 2
|
||||
Dim vt As New Vector3d(Offs_x, Offs_y, 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
|
||||
' Recupero box tavola
|
||||
Dim b3Tab As New BBox3d
|
||||
@@ -2781,6 +2894,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 dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
|
||||
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)
|
||||
End Function
|
||||
|
||||
@@ -2869,8 +2993,43 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
m_CurrProjPage.ShowAreas()
|
||||
' Aggiorno vista
|
||||
EgtZoom(ZM.ALL)
|
||||
' Aggiorno la lista dei parcheggi
|
||||
If ParkIndBtn.IsChecked Then
|
||||
m_SelParkInd.UpdateList()
|
||||
End If
|
||||
UpdateImageParkInd()
|
||||
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)
|
||||
' verifico se esistono dei ponticelli associati al pezzo indicato
|
||||
' recuoero il gruppo di lavorazione corrente
|
||||
@@ -2914,6 +3073,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
|
||||
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
|
||||
Dim nPartTab As Integer = EgtGetPartInRawPartCount(m_nRawId)
|
||||
' Se già selezionati in tavola o non ci sono selezionati e pezzi in tavola
|
||||
@@ -2922,8 +3088,21 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
' Seleziono tutti i pezzi in tavola
|
||||
Dim nPartId As Integer = EgtGetFirstGroupInGroup(m_nRawId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
EgtSelectObj(nPartId)
|
||||
VeinMatching.OnSelectPart(nPartId, False)
|
||||
' ------------------ INIZIO ------------------ Recupero l'indice del parcheggio in cui è inserito il pezzo
|
||||
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)
|
||||
End While
|
||||
' Aggiorno flag
|
||||
@@ -2933,8 +3112,21 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
' Seleziono tutti i pezzi in parcheggio
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
EgtSelectObj(nPartId)
|
||||
VeinMatching.OnSelectPart(nPartId, False)
|
||||
' ------------------ INIZIO ------------------ Recupero l'indice del parcheggio in cui è inserito il pezzo
|
||||
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)
|
||||
End While
|
||||
' Aggiorno flag
|
||||
@@ -2957,6 +3149,35 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
EgtDraw()
|
||||
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
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
' Se non ci sono pezzi selezionati o non sono in parcheggio, esco
|
||||
@@ -3053,7 +3274,10 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Else
|
||||
m_dRegStep = Math.Max(dVal, 2 * EPS_SMALL)
|
||||
End If
|
||||
WritePrivateProfileString(S_NEST, K_STEP, StepMoveTxBx.Text, m_MainWindow.GetIniFile())
|
||||
Dim dCurrVal As Double = 0
|
||||
StringToLen(StepMoveTxBx.Text, dCurrVal)
|
||||
DoubleToString(dCurrVal, 2)
|
||||
WritePrivateProfileString(S_NEST, K_STEP, DoubleToString(dCurrVal, 2), m_MainWindow.GetIniFile())
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -3077,6 +3301,13 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
End Sub
|
||||
|
||||
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_MainWindow.m_CadCutPageUC.m_ProjectMgr.VeinMatchingHide()
|
||||
End Sub
|
||||
@@ -3277,6 +3508,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
' Riposiziono i punti SpotReg (tutti) in funzione dell'altezza del grezzo
|
||||
Public Sub UpdateSpotRegistration()
|
||||
Dim ptCentArc As Point3d
|
||||
If m_nRegGroupId <> GDB_ID.NULL Then Return
|
||||
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||
Dim sNameEnt As String = String.Empty
|
||||
Dim sName As String = String.Empty
|
||||
@@ -3293,9 +3525,6 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Dim dOffsetZ As Double = m_b3Raw.Max().z - ptCentArc.z
|
||||
If Math.Abs(dOffsetZ) > 0.1 Then
|
||||
MoveAllSpotRegistration(New Vector3d(0, 0, dOffsetZ + 0.1), False)
|
||||
Else
|
||||
' se già in posizione allora mi occupo solo di visualizzarli
|
||||
EgtDraw()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -3314,7 +3543,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
End Sub
|
||||
|
||||
' Per ogni SpotReg di OFFICE viene generato (nella stessa posizione) uno SpotRegCUT
|
||||
Private Function InsertSportRegistration() As Boolean
|
||||
Private Function InsertSpotRegistration() As Boolean
|
||||
' recupero l'elenco non ordinato degli Id dei punti SpotReg (da Office)
|
||||
Dim SpotRegList As New List(Of Integer)
|
||||
Dim nId As Integer = GDB_ID.NULL
|
||||
@@ -3399,6 +3628,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Dim nInfo As Integer = 0
|
||||
Dim bOk As Boolean = True
|
||||
If Not EgtGetInfo(nSpotRegId, ACTIVATESPOTCUT, nInfo) Then
|
||||
' 1: Attivo, 0: Disbilitato
|
||||
nInfo = 1
|
||||
End If
|
||||
If nInfo = 1 Then
|
||||
@@ -3438,7 +3668,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
|
||||
' inserisco una Info sullo SpotReg (OFFICE) che indica che è disattivo
|
||||
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREG_ & nIndexSpot.ToString)
|
||||
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 0)
|
||||
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 1)
|
||||
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Arc")
|
||||
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
|
||||
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineV")
|
||||
@@ -3512,10 +3742,16 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Next
|
||||
vtMoveStart.z = 0
|
||||
' Determino la deformazione media
|
||||
dScaleSum = 1 - dScaleSum / (ptCentCUTList.Count - 1)
|
||||
Dim dScaleAvarage As Double = 1 - dScaleSum / (ptCentCUTList.Count - 1)
|
||||
MoveAllRawParts(vtMoveStart)
|
||||
' Ruoto del valor medio delle differenze angolari
|
||||
RotateAllRawParts(dAngRotSum / (ptCentCUTList.Count - 1), ptCentCUTList(0))
|
||||
Dim dAngAvarage As Double = dAngRotSum / (ptCentCUTList.Count - 1)
|
||||
RotateAllRawParts(dAngAvarage, ptCentCUTList(0))
|
||||
Dim sCurrINdexSpot As String = GetIndexGroupSpotReg(SpotRegCUTList(0)).ToString
|
||||
EgtOutLog(" → REG Adjustment datas :")
|
||||
EgtOutLog(" → move SpotReg_" & sCurrINdexSpot & " : " & vtMoveStart.x.ToString & ", " & vtMoveStart.y.ToString)
|
||||
EgtOutLog(" → average rotation around SpotRegCUT_" & sCurrINdexSpot & " : " & dAngAvarage.ToString)
|
||||
EgtOutLog(" → average scale deformation : " & dScaleAvarage.ToString)
|
||||
|
||||
' Correggo lo spostamento in funzione della deformazione misurata
|
||||
Dim vtMoveSum As Vector3d = New Vector3d(0, 0, 0)
|
||||
@@ -3525,7 +3761,7 @@ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
||||
Next
|
||||
vtMoveSum.z = 0
|
||||
vtMoveSum = vtMoveSum / (ptCentCUTList.Count - 1)
|
||||
MoveAllRawParts(vtMoveSum * dScaleSum / 2)
|
||||
MoveAllRawParts(vtMoveSum * dScaleAvarage / 2)
|
||||
EgtDraw()
|
||||
|
||||
Return True
|
||||
|
||||
@@ -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>
|
||||
@@ -0,0 +1,929 @@
|
||||
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 (manca 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
|
||||
|
||||
' Dato il nome del progetto crea le immagini dei parcheggi
|
||||
Public Shared Sub CopyImgSvg(sNewFileName As String, refListParkInd As List(Of ParkInd), 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)
|
||||
If Not IsNothing(refListParkInd) Then
|
||||
ListParkInd = refListParkInd
|
||||
Else
|
||||
' ricarico la lista
|
||||
SelParkIndWD.LoadParkInd(ListParkInd, nCtx)
|
||||
End If
|
||||
'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 = 10
|
||||
Dim DimY As Integer = 10
|
||||
If DimViewBox.Count = 4 Then
|
||||
DimX = Math.Abs(CInt(DimViewBox(2))) + Math.Abs(CInt(DimViewBox(0)))
|
||||
DimY = Math.Abs(CInt(DimViewBox(3))) + Math.Abs(CInt(DimViewBox(1)))
|
||||
End If
|
||||
|
||||
' 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
|
||||
@@ -38,6 +38,8 @@ Public Module SplitAuto
|
||||
Public m_dStartFreeLen As Double
|
||||
Public m_dEndFreeLen As Double
|
||||
Public m_vtDir As Vector3d
|
||||
' ver 2.6f4: tagli corti gestiti con LeadIn.OUT/LeadOut.OUT
|
||||
Public m_bMngLeadInOnIntCorner As Boolean
|
||||
End Class
|
||||
|
||||
'-----------------------------------------------------------------------------------------------
|
||||
@@ -111,15 +113,38 @@ Public Module SplitAuto
|
||||
EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
|
||||
If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
|
||||
Mach.m_nEntId = nEntId
|
||||
EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner)
|
||||
End If
|
||||
' verifico se trasformabile in un taglio di separazione (almeno da un lato)
|
||||
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL) And
|
||||
Mach.m_sLay = NAME_OUTLOOP And Mach.m_nInterf = FMI_TYPE.NONE Then
|
||||
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||
Mach.m_sLay = NAME_OUTLOOP And ( Mach.m_nInterf And FMI_TYPE.RM) = 0 Then
|
||||
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
|
||||
Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL And (nRes And CAR_RES.LI_OK) <> 0) And
|
||||
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine
|
||||
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL And (nRes And CAR_RES.LO_OK) <> 0) And
|
||||
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine
|
||||
Dim bIn As Boolean = False
|
||||
Dim bOut As Boolean = False
|
||||
CanExtendSides(Mach, bIn, bOut)
|
||||
Mach.m_bCanStartAll = ((dStartAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LI_OK) <> 0) And
|
||||
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine And bIn
|
||||
Mach.m_bCanEndAll = ((dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And (nRes And CAR_RES.LO_OK) <> 0) And
|
||||
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine And bOut
|
||||
If nRes = 0 Then
|
||||
EgtOutLog("Operation ID " & nOperId.ToString & " isn't split cut! verify depth machining.")
|
||||
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
|
||||
@@ -171,6 +196,26 @@ Public Module SplitAuto
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function CanExtendSides(CurrMach As SplitMach, ByRef bIn As Boolean, ByRef bOut As Boolean) As Boolean
|
||||
If CurrMach.m_dPrevAng < -EPS_ANG_SMALL And CurrMach.m_dNextAng > EPS_ANG_SMALL Then
|
||||
' Posso estendere SOLO l'uscita
|
||||
bOut = True
|
||||
bIn = False
|
||||
ElseIf CurrMach.m_dPrevAng > EPS_ANG_SMALL And CurrMach.m_dNextAng < -EPS_ANG_SMALL Then
|
||||
' Posso estendere SOLO l'ingresso
|
||||
bIn = True
|
||||
bOut = False
|
||||
ElseIf CurrMach.m_dPrevAng < -EPS_ANG_SMALL And CurrMach.m_dNextAng < -EPS_ANG_SMALL Then
|
||||
' NON Posso estendere
|
||||
bIn = False
|
||||
bOut = False
|
||||
Else
|
||||
bIn = True
|
||||
bOut = True
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
'-----------------------------------------------------------------------------------------------
|
||||
' calcolo il numero di tipi di lavorazioni
|
||||
Friend Sub CountMachiningType(MachSplit As SplitMach, ByRef nCountSawing As Integer, ByRef nCountWaterjetting As Integer, ByRef nCountOtherMachining As Integer)
|
||||
@@ -799,13 +844,13 @@ Public Module SplitAuto
|
||||
|
||||
Private Function ExecMove(nDispId As Integer, vNewRaws As List(Of Integer),
|
||||
vtMove As Vector3d, dMinMove As Double) As Boolean
|
||||
Dim bTwoHeadVac As Boolean = ( EgtGetHeadId( VACUUM_HEAD_2) <> GDB_ID.NULL)
|
||||
Dim bTwoHeadVac As Boolean = (EgtGetHeadId(VACUUM_HEAD_2) <> GDB_ID.NULL)
|
||||
Dim rmData As New RawMoveData
|
||||
Dim vtMove2 As Vector3d = -vtMove
|
||||
|
||||
VacuumCups.ResetHeadName()
|
||||
Dim bPutVacuum As Boolean = PutVacuumCupsOnRaw(vNewRaws(1), rmData)
|
||||
If Not bPutVacuum And bTwoHeadVac Then bPutVacuum= PutVacuumCupsOnRaw(vNewRaws(1), rmData)
|
||||
If Not bPutVacuum And bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(vNewRaws(1), rmData)
|
||||
If bPutVacuum AndAlso SafeMoveRawPart(vNewRaws(1), vtMove, dMinMove) Then
|
||||
rmData.m_vtRawMove = vtMove
|
||||
SaveOneMoveInfoInDisposition(nDispId, rmData)
|
||||
@@ -826,9 +871,9 @@ Public Module SplitAuto
|
||||
|
||||
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
|
||||
' Spostamento originale
|
||||
Dim vtOriMove As New Vector3d( vtMove)
|
||||
Dim vtOriMove As New Vector3d(vtMove)
|
||||
' Livello di movimento
|
||||
Dim nMoveLevel As Integer = GetPrivateProfileInt( S_SPLIT, K_MOVE_LEV, 5, m_MainWindow.GetIniFile())
|
||||
Dim nMoveLevel As Integer = GetPrivateProfileInt(S_SPLIT, K_MOVE_LEV, 5, m_MainWindow.GetIniFile())
|
||||
Dim nMove As Integer = 1
|
||||
' Se esce dalla tavola, movimento già annullato ed esco con errore
|
||||
If Not EgtMoveRawPart(nRawId, vtOriMove) Then Return False
|
||||
@@ -863,7 +908,7 @@ Public Module SplitAuto
|
||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||
vtMove += 0.5 * vtOriMove
|
||||
nMove += 1
|
||||
If nMoveLevel = nMove Then return True
|
||||
If nMoveLevel = nMove Then Return True
|
||||
Else
|
||||
EgtMoveRawPart(nRawId, -0.5 * vtOriMove)
|
||||
End If
|
||||
|
||||
@@ -100,8 +100,14 @@
|
||||
<Button Name="MoveDownBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource DownArrowImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</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.ColumnDefinitions>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.ComponentModel
|
||||
Imports System.Drawing
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class SplitPageUC
|
||||
@@ -8,6 +9,9 @@ Public Class SplitPageUC
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
|
||||
' Creazione converter da String a ImageSource
|
||||
Private ImageConverter As New ImageSourceConverter
|
||||
|
||||
' Flag di pagina attiva
|
||||
Private m_bActive As Boolean = False
|
||||
' Tipo movimento dei grezzi (manuale o con testa ventosa)
|
||||
@@ -61,6 +65,9 @@ Public Class SplitPageUC
|
||||
' Abilita la mofica Inizio fine per i tagli interni sugli angoli
|
||||
Private m_StartEndModifyOnIntCorner As Boolean = False
|
||||
|
||||
Private m_IsCtrlKeyDown As Boolean = False
|
||||
Private m_IsShiftKeyDown As Boolean = False
|
||||
|
||||
Private Sub SplitPageUC_Initialized(sender As Object, e As EventArgs)
|
||||
PrevBtn.IsEnabled = False
|
||||
' Collego lista di oggetti a ListBox
|
||||
@@ -180,6 +187,9 @@ Public Class SplitPageUC
|
||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||
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
|
||||
|
||||
' preparo la lista delle lavorazioni da mostrare in interfaccia
|
||||
@@ -343,7 +353,6 @@ Public Class SplitPageUC
|
||||
EgtTrimCurveEndAtLen(nIdBridge, dLen - 10 * EPS_SMALL)
|
||||
EgtTrimCurveStartAtLen(nIdBridge, 10 * EPS_SMALL)
|
||||
End If
|
||||
' EgtSaveFile("c:\EgtData\OmagCUT\Temp\Bridge.nge", NGE.BIN)
|
||||
Dim nIdPart As Integer = GDB_ID.NULL
|
||||
nIdPart = EgtGetFirstPartInRawPart(m_CurrProjPage.m_nRawId)
|
||||
While nIdPart <> GDB_ID.NULL
|
||||
@@ -351,7 +360,6 @@ Public Class SplitPageUC
|
||||
Dim nIdSurf As Integer = EgtGetFirstInGroup(nIdRegion)
|
||||
While nIdSurf <> GDB_ID.NULL
|
||||
If EgtGetType(nIdSurf) = GDB_TY.SRF_FRGN Then
|
||||
' EgtSaveFile("c:\EgtData\OmagCUT\Temp\Bridge.nge", NGE.BIN)
|
||||
' se la linea bridge interseca la superficie allora restitusco false
|
||||
If EgtCurveWithRegionClassify(nIdBridge, nIdSurf) <> CREGC.OUT Then
|
||||
EgtExtendCurveStartByLen(nIdBridge, 10 * EPS_SMALL)
|
||||
@@ -455,6 +463,10 @@ Public Class SplitPageUC
|
||||
|
||||
#End Region ' Bridge
|
||||
|
||||
Private Sub OnMyMouseDownScene_DoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene_DoubleClick
|
||||
OnOffCut()
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
|
||||
If Not m_bActive OrElse m_bShow Then Return
|
||||
@@ -566,6 +578,11 @@ Public Class SplitPageUC
|
||||
m_nDragInd = -1
|
||||
m_nDragType = 0
|
||||
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 Sub
|
||||
|
||||
@@ -597,6 +614,7 @@ Public Class SplitPageUC
|
||||
Dim dUsal As Double
|
||||
' ----------------------- REPEAT -----------------------
|
||||
Do
|
||||
If Not m_MachiningList(m_nDragInd).m_bCanStartAll Then Exit Do
|
||||
dDelta = -dDelta
|
||||
' Leggo il valore salvato nella geometria
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||
@@ -630,6 +648,7 @@ Public Class SplitPageUC
|
||||
Dim dUeal As Double
|
||||
dDelta = -dDelta
|
||||
Do
|
||||
If Not m_MachiningList(m_nDragInd).m_bCanEndAll Then Exit Do
|
||||
dDelta = -dDelta
|
||||
' Leggo il valore salvato nella geometria
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||
@@ -693,6 +712,11 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
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 = 1 Then m_bAreHomogeneous = True
|
||||
' creo lista ordinata dei selezionati
|
||||
@@ -733,6 +757,13 @@ Public Class SplitPageUC
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
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
|
||||
OnOffCut()
|
||||
End Sub
|
||||
|
||||
Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click
|
||||
MoveItem(-1)
|
||||
End Sub
|
||||
@@ -741,6 +772,25 @@ Public Class SplitPageUC
|
||||
MoveItem(1)
|
||||
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)
|
||||
' Checking selected item
|
||||
If m_CurrFirstInd = -1 OrElse MachiningLsBx.SelectedIndex < 0 Then
|
||||
@@ -916,11 +966,31 @@ Public Class SplitPageUC
|
||||
EnableButtons()
|
||||
End Sub
|
||||
|
||||
' ERRORE: questo evento non è eseguito!
|
||||
Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs)
|
||||
If e.Key = Key.Escape Then
|
||||
' se sono in fase di creazione di un ponticello interrompo
|
||||
DeselectWJBridgesPart()
|
||||
'' DA FARE: quando seleziono Esc devo togliere deselezionare tutte le enità!
|
||||
'Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
||||
' If e.Key = Key.Escape Then
|
||||
' ' se sono in fase di creazione di un ponticello interrompo
|
||||
' DeselectWJBridgesPart()
|
||||
' EgtDeselectAll()
|
||||
' RemoveMarkAndNumbers()
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
Private Sub MachiningLsBx_KeyDown(sender As Object, e As KeyEventArgs) Handles MachiningLsBx.KeyDown
|
||||
If e.Key = Key.LeftCtrl Or e.Key = Key.RightCtrl Then
|
||||
m_IsCtrlKeyDown = True
|
||||
End If
|
||||
If e.Key = Key.LeftShift Or e.Key = Key.RightShift Then
|
||||
m_IsShiftKeyDown = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MachiningLsBx_KeyUp(sender As Object, e As KeyEventArgs) Handles MachiningLsBx.KeyUp
|
||||
If e.Key = Key.LeftCtrl Or e.Key = Key.RightCtrl Then
|
||||
m_IsCtrlKeyDown = False
|
||||
End If
|
||||
If e.Key = Key.LeftShift Or e.Key = Key.RightShift Then
|
||||
m_IsShiftKeyDown = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1127,37 +1197,46 @@ Public Class SplitPageUC
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLiPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
|
||||
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
|
||||
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
|
||||
EgtOutLog(" ⚠️ L'ingresso di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
|
||||
Else
|
||||
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLiPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.OUT)
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
|
||||
End If
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
@@ -1195,24 +1274,33 @@ Public Class SplitPageUC
|
||||
|
||||
Private Sub AllCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenStartBtn.Click
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLiPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
|
||||
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
|
||||
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
|
||||
EgtOutLog(" ⚠️ L'ingresso di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
|
||||
Else
|
||||
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLiPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||
If nLiPrev = MCH_SAW_LI.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLiPrev = MCH_SAW_LI.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADINTYPE, MCH_SAW_LI.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadIn(nI, MCH_SAW_LI.CENT)
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
|
||||
Next
|
||||
EgtDraw()
|
||||
' Imposto flag di modifica
|
||||
@@ -1228,37 +1316,46 @@ Public Class SplitPageUC
|
||||
End If
|
||||
Dim nI As Integer = m_ItemList(Index).Ind
|
||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLoPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
If nLoPrev = MCH_SAW_LO.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
|
||||
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
|
||||
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
|
||||
EgtOutLog(" ⚠️ L'uscita di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
|
||||
Else
|
||||
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLoPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
If nLoPrev = MCH_SAW_LO.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_CENT Then
|
||||
' allungo
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_OUT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.OUT)
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
bGenModif = True
|
||||
|
||||
End If
|
||||
Next
|
||||
' Se modificato qualcosa
|
||||
@@ -1296,24 +1393,33 @@ Public Class SplitPageUC
|
||||
|
||||
Private Sub AllCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenEndBtn.Click
|
||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLoPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
If nLoPrev = MCH_SAW_LO.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
|
||||
' se ho forzato il tipo di ingresso da CamAuto qui non posso moficarlo!
|
||||
If m_MachiningList(nI).m_bMngLeadInOnIntCorner Then
|
||||
EgtOutLog(" ⚠️ L'uscita di taglio associato all'entita'_" & m_MachiningList(nI).m_nEntId & " non puo' essere modificato per problemi di ingombro lama ⚠️")
|
||||
Else
|
||||
|
||||
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||
Dim nLoPrev As Integer
|
||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||
If nLoPrev = MCH_SAW_LO.OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
' ri-verifico interferenza
|
||||
EgtVerifyMachining(m_MachiningList(nI).m_nId, m_MachiningList(nI).m_nInterf)
|
||||
ElseIf nLoPrev = MCH_SAW_LO.EXT_OUT Then
|
||||
' accorcio
|
||||
EgtSetMachiningParam(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.EXT_CENT)
|
||||
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||
ModifyOtherLeadOut(nI, MCH_SAW_LO.CENT)
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
|
||||
Next
|
||||
EgtDraw()
|
||||
' Imposto flag di modifica
|
||||
@@ -1391,6 +1497,12 @@ Public Class SplitPageUC
|
||||
' Se taglio con lama
|
||||
If nMachiningType = MCH_MY.SAWING And
|
||||
(m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dPrevAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
|
||||
|
||||
If Not m_MachiningList(nI).m_bCanStartAll Then
|
||||
EgtOutLog(" ⚠️ Il taglio non puo' essere allungato all'interno del pezzo ⚠️")
|
||||
Return
|
||||
End If
|
||||
|
||||
' leggo il valore salvato nella geometria
|
||||
Dim dOrigUsal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||
@@ -1566,6 +1678,11 @@ Public Class SplitPageUC
|
||||
If nMachiningType = MCH_MY.SAWING And
|
||||
(m_MachiningList(nI).m_bIsLine Or m_MachiningList(nI).m_dNextAng > FL_ARC_ANG_MIN Or m_MachiningList(nI).m_sLay = NAME_ONPATH) Then
|
||||
|
||||
If Not m_MachiningList(nI).m_bCanEndAll Then
|
||||
EgtOutLog(" ⚠️ Il taglio non puo' essere allungato all'interno del pezzo ⚠️")
|
||||
Return
|
||||
End If
|
||||
|
||||
Dim dOrigUeal As Double = 0
|
||||
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||
|
||||
@@ -1784,7 +1901,7 @@ Public Class SplitPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
||||
' ------- VISUALIZZAZIONE -------
|
||||
' ------- VISUALIZZAZIONE (navigazione tra le fasi) -------
|
||||
If m_bShow Then
|
||||
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||
' recupero l'operazione successiva
|
||||
@@ -1867,22 +1984,22 @@ Public Class SplitPageUC
|
||||
NumberDirectionMachining(nI)
|
||||
Next
|
||||
|
||||
' -------------------- Recupero le lavorazioni indicate come attive --------------------
|
||||
' -------------------- Recupero le lavorazioni indicate come attive -- INIZIO --------------------
|
||||
Dim ActiveMachLst As New List(Of Integer)
|
||||
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
||||
ActiveMachLst.Add(ItemSplitMach.Ind)
|
||||
If ItemSplitMach.bIsActive Then ActiveMachLst.Add(ItemSplitMach.Ind)
|
||||
Next
|
||||
' -------------------- Recupero le lavorazioni indicate come attive --------------------
|
||||
' -------------------- Recupero le lavorazioni indicate come attive -- FINE --------------------
|
||||
|
||||
' Preparo la lista degli Item
|
||||
ShowMachiningList()
|
||||
|
||||
' -------------------- Riattivo le lavorazioni precedenti --------------------
|
||||
|
||||
' -------------------- Riattivo le lavorazioni precedenti -- INIZIO --------------------
|
||||
For Each Item As SplitMach In m_MachiningList
|
||||
' spengo tutte le lavorazioni disponibili
|
||||
EgtSetInfo(Item.m_nId, INFO_MCH_USER_OFF, True)
|
||||
Next
|
||||
|
||||
' riattivo solo quelle indicate come attive
|
||||
For nIndex As Integer = 0 To ActiveMachLst.Count - 1
|
||||
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
||||
If ItemSplitMach.Ind = ActiveMachLst(nIndex) Then
|
||||
@@ -1895,7 +2012,7 @@ Public Class SplitPageUC
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
' -------------------- Riattivo le lavorazioni precedenti --------------------
|
||||
' -------------------- Riattivo le lavorazioni precedenti -- FINE --------------------
|
||||
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
@@ -2093,6 +2210,33 @@ Public Class SplitPageUC
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub OnOffCut()
|
||||
If MachiningLsBx.SelectedItems.Count = 1 Then
|
||||
Dim x As NameIdLsBxItem = DirectCast(MachiningLsBx.SelectedItems(0), NameIdLsBxItem)
|
||||
Dim nI As Integer = x.Ind
|
||||
If m_MachiningList(nI).m_bEnabled Then
|
||||
m_MachiningList(nI).m_bEnabled = False
|
||||
x.bIsActive = False
|
||||
Else
|
||||
m_MachiningList(nI).m_bEnabled = True
|
||||
x.bIsActive = True
|
||||
End If
|
||||
ColorMachining(m_MachiningList(nI))
|
||||
ColorNumberArrow(nI)
|
||||
EgtDraw()
|
||||
' Imposto flag di modifica
|
||||
m_bModified = True
|
||||
' recupero l'elenco degli elementi selezionati
|
||||
Dim ItemList As New List(Of NameIdLsBxItem)
|
||||
For Each Item As NameIdLsBxItem In MachiningLsBx.SelectedItems
|
||||
ItemList.Add(Item)
|
||||
Next
|
||||
VerifyHomogenousMachining(ItemList)
|
||||
' Abilitazione bottone Next
|
||||
EnableButtons()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub VerifyHomogenousMachining(ItemList As List(Of NameIdLsBxItem))
|
||||
If IsNothing(ItemList) OrElse ItemList.Count = 0 Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||
@@ -2274,6 +2418,11 @@ Public Class SplitPageUC
|
||||
' Aggiungo a numero info con identificativo della lavorazione e viceversa
|
||||
EgtSetInfo(nNbrId, "MId", m_MachiningList(nI).m_nId)
|
||||
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
|
||||
' Se taglio con lama, metto la direzione accanto al numero
|
||||
If m_MachiningList(nI).m_nType = MCH_OY.SAWING Then
|
||||
@@ -2285,6 +2434,11 @@ Public Class SplitPageUC
|
||||
' Aggiungo a freccia info con identificativo della lavorazione e viceversa
|
||||
EgtSetInfo(nArrId, "MId", m_MachiningList(nI).m_nId)
|
||||
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
|
||||
m_MachiningList(nI).m_nArrId = GDB_ID.NULL
|
||||
End If
|
||||
@@ -2401,6 +2555,27 @@ Public Class SplitPageUC
|
||||
EgtResetMark(nNbrId)
|
||||
EgtResetMark(nArrId)
|
||||
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
|
||||
|
||||
Private Sub ColorNumberArrow(nI As Integer)
|
||||
|
||||
@@ -157,6 +157,8 @@ Module ConstGen
|
||||
' Info per identificazione gruppo pezzi
|
||||
Public Const INFO_REFGROUP As String = "RefGroup"
|
||||
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
|
||||
Public Const NAME_PROJMARK As String = "OmagCut"
|
||||
@@ -223,6 +225,8 @@ Module ConstGen
|
||||
Public Const INFO_DEPTH2 As String = "Depth2"
|
||||
Public Const INFO_AGG2 As String = "Agg2"
|
||||
Public Const INFO_ROUNDOFF As String = "RoundOff"
|
||||
Public Const INFO_DIRECTCUT As String = "DirectCut"
|
||||
Public Const INFO_STEP_TYPE As String = "StepType"
|
||||
' Info in entità da tagliare per taglio ristretto
|
||||
Public Const INFO_STRICT As String = "Strict"
|
||||
' Info in entità da tagliare per angolo di lato e tallone
|
||||
@@ -318,6 +322,8 @@ Module ConstGen
|
||||
Public Const INFO_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
|
||||
' Info in OutLoop per punto inzio lavorazione WaterJet
|
||||
Public Const INFO_START As String = "Start"
|
||||
' Nome dei tagli diretti inseriti in fase di Splitting
|
||||
Public Const SPLIT_CUT As String = "SplitCut"
|
||||
|
||||
' Nome di pezzo che è una cornice
|
||||
Public Const NAME_FRAME As String = "Frame"
|
||||
|
||||
@@ -19,6 +19,7 @@ Module ConstIni
|
||||
Public Const K_DEBUG As String = "Debug"
|
||||
Public Const K_LICENCE As String = "Licence"
|
||||
Public Const K_NETKEY As String = "NetKey"
|
||||
Public Const K_LOCKID As String = "LockId"
|
||||
Public Const K_MESSAGESDIR As String = "MessagesDir"
|
||||
Public Const K_MESSAGES As String = "Messages"
|
||||
Public Const K_SUPPORT As String = "Support"
|
||||
@@ -52,7 +53,10 @@ Module ConstIni
|
||||
Public Const K_GENERATECN As String = "GenerateCN"
|
||||
Public Const K_FRACTIONPATTERN As String = "FractionPattern"
|
||||
Public Const K_PRECISION As String = "Precision"
|
||||
|
||||
Public Const K_QUITDRAWPAGE As String = "QuitDrawPage"
|
||||
Public Const 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 K_LANGUAGE As String = "Language"
|
||||
@@ -86,6 +90,7 @@ Module ConstIni
|
||||
Public Const K_TEXMAXLINPIX As String = "TextureMaxLinPixels"
|
||||
Public Const K_ZOOMWIN As String = "ZoomWin"
|
||||
Public Const K_DISTLINE As String = "DistLine"
|
||||
Public Const K_ORTOGRAPHIC As String = "OrtoGraphic"
|
||||
|
||||
Public Const S_ALZFRONT As String = "Alz&Front"
|
||||
Public Const K_ALZFRONT As String = "Alz&Front"
|
||||
@@ -207,6 +212,7 @@ Module ConstIni
|
||||
Public Const K_OFFSXY As String = "OffsXY"
|
||||
Public Const K_OFFSYY As String = "OffsYY"
|
||||
Public Const K_OFFSXINTERY As String = "OffsYInterY"
|
||||
Public Const K_OFFSXINTERYSAWTH As String = "OffsYInterYSawTh"
|
||||
Public Const K_STARTTRIM As String = "StartTrim"
|
||||
Public Const K_ENDTRIM As String = "EndTrim"
|
||||
Public Const K_OTHERSIDE As String = "OtherSide"
|
||||
@@ -231,10 +237,13 @@ Module ConstIni
|
||||
Public Const K_OTHERREFTABX As String = "OtherRefTabX"
|
||||
Public Const K_OTHERREFTABY As String = "OtherRefTabY"
|
||||
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 K_RAWSTEP As String = "Step"
|
||||
Public Const K_EXTRASTEP As String = "ExtraStep"
|
||||
Public Const K_RAWROTATION As String = "Rotation"
|
||||
Public Const K_PERPENDICULAR As String = "Perpendicular"
|
||||
|
||||
@@ -286,6 +295,8 @@ Module ConstIni
|
||||
Public Const S_VEINMATCHING As String = "VeinMatching"
|
||||
Public Const K_VEINMA_ENABLE As String = "Enable"
|
||||
Public Const K_VEINMA_PLACE As String = "WinPlace"
|
||||
Public Const K_VEINMA_WIDTH As String = "Width"
|
||||
Public Const K_VEINMA_HEIGHT As String = "Height"
|
||||
|
||||
Public Const S_FASTGRID As String = "FastGrid"
|
||||
Public Const K_FG_ENABLE As String = "FGEnable"
|
||||
@@ -332,6 +343,8 @@ Module ConstIni
|
||||
Public Const K_DC_FLATT_HEADSIDE As String = "FlattHeadSide"
|
||||
Public Const K_DC_FLATT_MACHTYPE As String = "FlattMachType"
|
||||
Public Const K_DC_FLATT_ROTLOCK As String = "FlattRotLock"
|
||||
Public Const K_DC_FLATT_SAWTH As String = "FlattSawThick"
|
||||
Public Const K_DC_FLAT_CHAINEDPATH As String = "ChainedPath"
|
||||
Public Const K_DC_FLATT_POSX As String = "FlattPosX"
|
||||
Public Const K_DC_FLATT_POSY As String = "FlattPosY"
|
||||
Public Const K_DC_POLISH_NAME As String = "PolishName"
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
Public Const K_A10ID As String = "A10Id"
|
||||
Public Const K_DELTA_C As String = "DeltaC"
|
||||
Public Const K_ININCHES As String = "InInches"
|
||||
Public Const K_CPOS As String = "CPos"
|
||||
|
||||
Public Const S_NCSIEMENS As String = "NcSiemens"
|
||||
Public Const K_COMM_NAME As String = "CommName"
|
||||
@@ -97,6 +98,9 @@
|
||||
Public Const K_ENABLEZONE As String = "EnableZone"
|
||||
Public Const K_ENABLEPC As String = "EnablePC"
|
||||
Public Const K_HSM As String = "Hsm"
|
||||
Public Const BTN_ENABLE_ZONE_1 As String = "EnableZone1"
|
||||
Public Const BTN_ENABLE_ZONE_2 As String = "EnableZone2"
|
||||
Public Const BTN_ENABLE_PC As String = "EnablePC"
|
||||
Public Const K_VACUUMUP As String = "VacuumUp"
|
||||
Public Const K_VACUUMDOWN As String = "VacuumDown"
|
||||
Public Const K_VACUUM2UP As String = "Vacuum2Up"
|
||||
@@ -126,6 +130,7 @@
|
||||
Public Const K_SPOTLIGHT1 As String = "SpotLight1"
|
||||
Public Const K_SPOTLIGHT2 As String = "SpotLight2"
|
||||
Public Const K_NAXES As String = "nAxes"
|
||||
Public Const K_RESETSTATUS As String = "ResetStatus"
|
||||
' Nuove variabili
|
||||
Public Const K_SPEEDHOLD As String = "SpeedHold"
|
||||
Public Const K_XYJOG As String = "XYJog"
|
||||
@@ -176,6 +181,12 @@
|
||||
Public Const K_PHOTO_OFFSETY As String = "OffsetY"
|
||||
Public Const K_PHOTO_TAB2_OFFSETX As String = "Tab2OffsetX"
|
||||
Public Const K_PHOTO_TAB2_OFFSETY As String = "Tab2OffsetY"
|
||||
Public Const K_PHOTO_HQ_OFFSETX As String = "HQOffsetX"
|
||||
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 K_DRILLBIT As String = "Drillbit"
|
||||
@@ -225,6 +236,7 @@
|
||||
Public Const K_MACH_MILLING_ON_SINKS As String = "MillingOnSinks"
|
||||
Public Const K_MACH_MILLING_SHORTENING As String = "MillingShortening"
|
||||
Public Const K_MACH_ENGRAVING_WITHMILL As String = "EngravingWithMill"
|
||||
Public Const K_MACH_STARTCENERTOOLPATH As String = "StartCenterToolPath"
|
||||
Public Const K_MACH_ENGRAVING_DEPTH As String = "EngravingDepth"
|
||||
Public Const K_MACH_ENGRAVING_WIDTH As String = "EngravingWidth"
|
||||
Public Const K_MACH_NEST_ALIGNED As String = "Aligned"
|
||||
@@ -242,7 +254,7 @@
|
||||
Public Const K_MIN_RADIUSWJ As String = "MinRadiusWJ"
|
||||
Public Const K_MACH_DRILLINGWJ_ON_CORNERS As String = "DrillingWJOnCorners"
|
||||
Public Const K_MACH_RECTIFICATION_ON_SUBSQUARE As String = "RectificationSubSqWJ"
|
||||
' DrillMillC90
|
||||
Public Const K_MACH_DRILL_MILL_C90 As String = "DrillMillC90"
|
||||
' CutLongDxSx
|
||||
' AngRotMultiCut
|
||||
' MinDistHeadsMultiCut
|
||||
|
||||
@@ -53,7 +53,6 @@ Public Class ControlsDirectCutUC
|
||||
FlatteningCut
|
||||
Polishing
|
||||
CopyTemplate
|
||||
SawTest
|
||||
SingleCutAuto
|
||||
SingleDrill
|
||||
Squaring
|
||||
@@ -183,6 +182,9 @@ Public Class ControlsDirectCutUC
|
||||
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
||||
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
||||
End If
|
||||
If Not bSaw Then
|
||||
EgtOutLog(" WARNING! Impossible to get point from SAW, there isn't SAW or SAWING! It's available only by DRAW")
|
||||
End If
|
||||
m_SingleCut.SetEnableParam(bSaw)
|
||||
m_MultipleCut.SetEnableParam(bSaw)
|
||||
m_GridCut.SetEnableParam(bSaw)
|
||||
|
||||
@@ -99,6 +99,9 @@ Public Class ControlsDirectCutUC1
|
||||
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
||||
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
||||
End If
|
||||
If Not bSaw Then
|
||||
EgtOutLog(" WARNING! Impossible to get point from SAW, there isn't SAW or SAWING! It's available only by DRAW")
|
||||
End If
|
||||
'm_SingleCut.SetEnableParam(bSaw)
|
||||
'm_MultipleCut.SetEnableParam(bSaw)
|
||||
'm_GridCut.SetEnableParam(bSaw)
|
||||
|
||||
@@ -23,6 +23,9 @@ Public Class ControlsMachineButtonUC
|
||||
Friend m_CN As CN_generico
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' visualizzo l'elenco degli elementi della pagina sono al primo avvio
|
||||
Friend Shared m_OutLogTypeButton As Boolean = True
|
||||
|
||||
' Creazione converter da String a ImageSource
|
||||
Dim ImageConverter As New ImageSourceConverter
|
||||
|
||||
@@ -72,6 +75,12 @@ Public Class ControlsMachineButtonUC
|
||||
If Not IsNothing(ButtonToAdd) Then m_ButtonList.Add(ButtonToAdd)
|
||||
End If
|
||||
End While
|
||||
|
||||
For Each MachineButton As MachineButton In m_ButtonList
|
||||
GetTypeButton(MachineButton)
|
||||
Next
|
||||
m_OutLogTypeButton = False
|
||||
|
||||
NotifyPropertyChanged("ButtonList")
|
||||
End If
|
||||
End Sub
|
||||
@@ -81,6 +90,22 @@ Public Class ControlsMachineButtonUC
|
||||
' i segeunti metodi notificano il cambiamento di stato di specifici bottoni
|
||||
'-------------------------------------------------------------------------------
|
||||
|
||||
Friend Sub GetTypeButton(CurrMachineButton As MachineButton)
|
||||
If Not m_OutLogTypeButton Then Return
|
||||
Dim BtnType As Type = CurrMachineButton.GetType
|
||||
If BtnType Is GetType(NoStateButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(0) ") & " , " & CurrMachineButton.StateFlag)
|
||||
ElseIf BtnType Is GetType(TwoStateButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(1) ") & " , " & CurrMachineButton.StateFlag)
|
||||
ElseIf BtnType Is GetType(ThreeStateButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(2) ") & " , " & CurrMachineButton.StateFlag)
|
||||
ElseIf BtnType Is GetType(DoubleCommandButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(3) ") & " , " & CurrMachineButton.StateFlag)
|
||||
ElseIf BtnType Is GetType(PressedCommandButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(4) ") & " , " & CurrMachineButton.StateFlag)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub SpindleStateChanged(SpindleState As Boolean)
|
||||
Dim SpindleButton As TwoStateButton = Nothing
|
||||
For Each MachineButton As MachineButton In m_ButtonList
|
||||
@@ -344,33 +369,61 @@ Public Class ControlsMachineButtonUC
|
||||
End Sub
|
||||
|
||||
Friend Sub ZoneStateChanged(ZoneState As Integer)
|
||||
'Dim sFlag As String = String.Empty
|
||||
'If ZoneState = 1 Then
|
||||
' sFlag = BTN_ENABLE_ZONE_1
|
||||
'ElseIf ZoneState = 2 Then
|
||||
' sFlag = BTN_ENABLE_ZONE_2
|
||||
'End If
|
||||
'Dim EnableZoneButton As TwoStateButton = Nothing
|
||||
'For Each MachineButton As MachineButton In m_ButtonList
|
||||
' If MachineButton.StateFlag = K_ENABLEZONE Then
|
||||
' EnableZoneButton = MachineButton
|
||||
' End If
|
||||
'Next
|
||||
'If Not IsNothing(EnableZoneButton) Then
|
||||
' EnableZoneButton.SetIsChecked(EnableZone)
|
||||
'End If
|
||||
Dim bEnableZone1 As Boolean = False
|
||||
If ZoneState = 1 Then
|
||||
bEnableZone1 = True
|
||||
ElseIf ZoneState = 2 Then
|
||||
bEnableZone1 = False
|
||||
End If
|
||||
' attivo il comando associato
|
||||
Dim EnableZoneButton As TwoStateButton = Nothing
|
||||
For Each MachineButton As MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = BTN_ENABLE_ZONE_1 Then
|
||||
EnableZoneButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(EnableZoneButton) Then
|
||||
EnableZoneButton.SetIsChecked(bEnableZone1)
|
||||
End If
|
||||
' disattivo l'altro per esclusione
|
||||
EnableZoneButton = Nothing
|
||||
For Each MachineButton As MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = BTN_ENABLE_ZONE_2 Then
|
||||
EnableZoneButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(EnableZoneButton) Then
|
||||
EnableZoneButton.SetIsChecked(Not bEnableZone1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub PcStateChanged(EnablePC As Boolean)
|
||||
'Dim EnablePCButton As TwoStateButton = Nothing
|
||||
'For Each MachineButton As MachineButton In m_ButtonList
|
||||
' If MachineButton.StateFlag = K_ENABLEPC Then
|
||||
' EnablePCButton = MachineButton
|
||||
' End If
|
||||
'Next
|
||||
'If Not IsNothing(EnablePCButton) Then
|
||||
' EnablePCButton.SetIsChecked(EnablePC)
|
||||
'End If
|
||||
Friend Sub PcStateChanged(EnablePC As Integer)
|
||||
Dim bEnablePC1 As Boolean = False
|
||||
If EnablePC = 1 Then
|
||||
bEnablePC1 = True
|
||||
ElseIf EnablePC = 2 Then
|
||||
bEnablePC1 = False
|
||||
End If
|
||||
' attivo/disattivo il comando associato
|
||||
Dim EnablePCButton As TwoStateButton = Nothing
|
||||
For Each MachineButton As MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = K_ENABLEPC & "_1" Then
|
||||
EnablePCButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(EnablePCButton) Then
|
||||
EnablePCButton.SetIsChecked(bEnablePC1)
|
||||
End If
|
||||
' disattivo/attivo l'altro per esclusione
|
||||
EnablePCButton = Nothing
|
||||
For Each MachineButton As MachineButton In m_ButtonList
|
||||
If MachineButton.StateFlag = BTN_ENABLE_ZONE_2 Then
|
||||
EnablePCButton = MachineButton
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(EnablePCButton) Then
|
||||
EnablePCButton.SetIsChecked(Not bEnablePC1)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' State Range
|
||||
@@ -702,8 +755,17 @@ Public MustInherit Class MachineButton
|
||||
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
||||
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
||||
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
||||
|
||||
' versione 2.6h1
|
||||
Dim sCurrTable As String = String.Empty
|
||||
Dim nCuttTable As Integer = 1
|
||||
EgtGetTableName(sCurrTable)
|
||||
If sCurrTable <> "MainTab" Then nCuttTable = 2
|
||||
EgtLuaSetGlobIntVar("CMD.TABLE", nCuttTable)
|
||||
|
||||
EgtLuaCallFunction("CmdString")
|
||||
' Leggo variabili
|
||||
|
||||
' Leggo variabili da file Lua
|
||||
CmdString = String.Empty
|
||||
EgtLuaGetGlobStringVar("CMD.CMDSTRING", CmdString)
|
||||
b2Start = False
|
||||
@@ -760,11 +822,26 @@ Public Class TwoStateButton
|
||||
Set(value As Boolean)
|
||||
' accendo il comando, anche se dovrei aspettare di leggere lo stato da PLC
|
||||
m_IsChecked = value
|
||||
Dim sLuaScriptFile As String = m_MainWindow.m_CurrentMachine.sMachDir & "\DirectCmd\"
|
||||
If value Then
|
||||
sLuaScriptFile &= TLuaScriptName
|
||||
ExecuteMDICommand(TLuaScriptName)
|
||||
Else
|
||||
sLuaScriptFile &= FLuaScriptName
|
||||
ExecuteMDICommand(FLuaScriptName)
|
||||
End If
|
||||
|
||||
Dim IsPressedShiftKey As Boolean = False
|
||||
If Keyboard.Modifiers And ModifierKeys.Shift And
|
||||
GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_MainWindow.GetIniFile()) > 4 Then IsPressedShiftKey = True
|
||||
' procedo all'apertura del file CadCut1 appena generato (solo se generazione corretta)
|
||||
If IsPressedShiftKey Then
|
||||
Try
|
||||
Process.Start("Notepad.exe", sLuaScriptFile)
|
||||
Catch ex As Exception
|
||||
EgtOutLog(ex.ToString)
|
||||
End Try
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetIsChecked(value As Boolean)
|
||||
|
||||
@@ -166,6 +166,15 @@ Public Class CopyTemplateUC
|
||||
Private Sub Point1Btn_Click(sender As Object, e As RoutedEventArgs) Handles Point1Btn.Click
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bTabOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1 solo per macchina con 2 teste
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
If bIsMultiCut Then
|
||||
EgtSetCalcTool(sSaw, "H1", 1)
|
||||
End If
|
||||
|
||||
' Se acquisizione lama o laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Recupero la posizione macchina
|
||||
@@ -173,14 +182,19 @@ Public Class CopyTemplateUC
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then
|
||||
Return
|
||||
End If
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Se punto da laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
' Ora imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Altrimenti da lama
|
||||
@@ -188,7 +202,7 @@ Public Class CopyTemplateUC
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
End If
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
@@ -196,8 +210,6 @@ Public Class CopyTemplateUC
|
||||
Else
|
||||
' Verifico presenza punto da mouse
|
||||
If Not m_bMouseOk Then Return
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Assegno punto selezionato nel disegno a m_ptTipP1
|
||||
|
||||
@@ -146,6 +146,9 @@ Public Class DirectCutPageUC
|
||||
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
||||
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
||||
End If
|
||||
If Not bSaw Then
|
||||
EgtOutLog(" WARNING! Impossible to get point from SAW, there isn't SAW or SAWING! It's available only by DRAW")
|
||||
End If
|
||||
m_ControlsDirectCutUC.m_SingleCut.SetEnableParam(bSaw)
|
||||
m_ControlsDirectCutUC.m_MultipleCut.SetEnableParam(bSaw)
|
||||
m_ControlsDirectCutUC.m_GridCut.SetEnableParam(bSaw)
|
||||
@@ -479,7 +482,7 @@ Public Class DirectCutPageUC
|
||||
|
||||
Private Sub ManualModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles ManualModeBtn.Click
|
||||
' 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
|
||||
|
||||
|
||||
@@ -7,142 +7,185 @@
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="597.3" d:DesignWidth="256">
|
||||
|
||||
<!--<Border CornerRadius="{StaticResource Page_CornerRadius}" Background="{DynamicResource OmagCut_LightGray}">-->
|
||||
<Border Style="{DynamicResource OmagCut_DirectCutPageBorder}">
|
||||
<!--<Border CornerRadius="{StaticResource Page_CornerRadius}" Background="{DynamicResource OmagCut_LightGray}">-->
|
||||
<Border Style="{DynamicResource OmagCut_DirectCutPageBorder}">
|
||||
|
||||
<!-- Definizione della Grid FlatteningCut -->
|
||||
<Grid Name="FlatteningCutGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!-- Definizione della Grid FlatteningCut -->
|
||||
<Grid Name="FlatteningCutGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Row="0" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ToggleButton Name="Point1Btn" Grid.Column="0"
|
||||
<ToggleButton Name="Point1Btn" Grid.Column="0"
|
||||
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource Acquisisci-P1Img}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
<Image Source="{DynamicResource Acquisisci-P1Img}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
|
||||
<ToggleButton Name="Point2Btn" Grid.Column="1"
|
||||
<ToggleButton Name="Point2Btn" Grid.Column="1"
|
||||
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource Acquisisci-P2Img}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
<Image Source="{DynamicResource Acquisisci-P2Img}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<ComboBox Name="PointModeCmBx" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}" Margin="6,0,6,0">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="DepthTxBl" Grid.Column="0" Grid.Row="2"
|
||||
<ScrollViewer VerticalScrollBarVisibility="Visible" Visibility="Visible"
|
||||
Grid.Row="1" Grid.RowSpan="11" Grid.ColumnSpan="2">
|
||||
|
||||
<Grid Name="DatiTaglioGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.1"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition Height="0.1"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ComboBox Name="PointModeCmBx" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}" Margin="6,0,6,0">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="DepthTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="DepthTxBx" Grid.Column="1" Grid.Row="2" Margin="0,0,6,0"
|
||||
<EgtWPFLib:EgtTextBox Name="DepthTxBx" Grid.Column="1" Grid.Row="2" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="3"
|
||||
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="3"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0" IsLength="False"
|
||||
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0" IsLength="False"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="LenghtTxBl" Grid.Column="0" Grid.Row="4"
|
||||
<TextBlock Name="LenghtTxBl" Grid.Column="0" Grid.Row="4"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="LenghtTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0"
|
||||
<EgtWPFLib:EgtTextBox Name="LenghtTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="WidthTxBl" Grid.Column="0" Grid.Row="5"
|
||||
<TextBlock Name="WidthTxBl" Grid.Column="0" Grid.Row="5"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="WidthTxBx" Grid.Column="1" Grid.Row="5" Margin="0,0,6,0"
|
||||
<EgtWPFLib:EgtTextBox Name="WidthTxBx" Grid.Column="1" Grid.Row="5" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="OverlapTxBl" Grid.Column="0" Grid.Row="6"
|
||||
<TextBlock Name="OverlapTxBl" Grid.Column="0" Grid.Row="6"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="OverlapTxBx" Grid.Column="1" Grid.Row="6" Margin="0,0,6,0"
|
||||
<EgtWPFLib:EgtTextBox Name="OverlapTxBx" Grid.Column="1" Grid.Row="6" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="ZReleasedTxBl" Grid.Column="0" Grid.Row="7"
|
||||
<TextBlock Name="ZReleasedTxBl" Grid.Column="0" Grid.Row="7"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="ZReleasedTxBx" Grid.Column="1" Grid.Row="7" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="ZReleasedTxBx" Grid.Column="1" Grid.Row="7" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="SideTxBl" Grid.Row="8" Grid.ColumnSpan="2"
|
||||
<TextBlock Name="SideTxBl" Grid.Row="8" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<CheckBox Name="SideChBx" Grid.Row="8" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
<CheckBox Name="SideChBx" Grid.Row="8" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,6,0"/>
|
||||
|
||||
<ComboBox Name="TypeCmBx" Grid.Row="9" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}" Margin="6,0,6,0">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<ComboBox Name="TypeCmBx" Grid.Row="9" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}" Margin="6,0,6,0">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="RotLockTxBl" Grid.Row="10" Grid.ColumnSpan="2"
|
||||
<TextBlock Name="RotLockTxBl" Grid.Row="10" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<CheckBox Name="RotLockChBx" Grid.Row="10" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
<CheckBox Name="RotLockChBx" Grid.Row="10" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,6,0"/>
|
||||
|
||||
<Grid Grid.Row="11" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="XcoordTxBl" Grid.Column="0" Text="X"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||
<EgtWPFLib:EgtTextBox Name="XcoordTxBx" Grid.Column="1" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<TextBlock Name="YcoordTxBl" Grid.Column="2" Text="Y"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||
<EgtWPFLib:EgtTextBox Name="YcoordTxBx" Grid.Column="3" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
</Grid>
|
||||
<TextBlock Name="ChainedPathTxBl" Grid.Row="11" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<CheckBox Name="ChainedPathChBx" Grid.Row="11" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,6,0"/>
|
||||
|
||||
<Grid Grid.Row="12" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ComboBox Name="SelToolCmBx" Grid.Row="12" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}" Margin="6,0,6,0">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<Grid Grid.Row="13" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="XcoordTxBl" Grid.Column="0" Text="X"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||
<EgtWPFLib:EgtTextBox Name="XcoordTxBx" Grid.Column="1" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<TextBlock Name="YcoordTxBl" Grid.Column="2" Text="Y"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||
<EgtWPFLib:EgtTextBox Name="YcoordTxBx" Grid.Column="3" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
<Grid Grid.Row="12" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="SimulBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource SimulaImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource EseguiImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<Button Name="SimulBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource SimulaImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="OkBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource EseguiImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Imports EgtUILib
|
||||
Imports System.Reflection
|
||||
Imports EgtUILib
|
||||
Imports EgtUILib.EgtInterface
|
||||
|
||||
Public Class FlatteningCut
|
||||
|
||||
@@ -35,14 +37,18 @@ Public Class FlatteningCut
|
||||
Private m_bHeadSide As Boolean = False
|
||||
Private m_nMachType As Integer = 1
|
||||
Private m_bRotLock As Boolean = False
|
||||
Private m_bChainedPath As Boolean = True
|
||||
Private m_nTool As Integer = 0
|
||||
' Array delle modalità di acquisizione dei punti
|
||||
Private m_PointsModeArray(2) As String
|
||||
' Array delle tipologia di lavorazione della spianatura
|
||||
Private m_TypeArray(1) As String
|
||||
Private m_TypeArray(2) As String
|
||||
' Punto selezionato nel disegno
|
||||
Private m_ptPrev As Point3d
|
||||
' Layer per crocette temporanee
|
||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||
' Array degliutensili disponibili (lama e fresa)
|
||||
Private m_ToolsArray(1) As String
|
||||
|
||||
' Costanti
|
||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||
@@ -57,8 +63,9 @@ Public Class FlatteningCut
|
||||
End Enum
|
||||
' Costanti che indicano la tipologia di lavorazione della spianatura
|
||||
Private Enum MACH_TYPE As Integer
|
||||
ONEWAY = 0
|
||||
ZIGZAG = 1
|
||||
ZIGZAG = 0
|
||||
ONEWAY = 1
|
||||
SPIRAL = 2
|
||||
End Enum
|
||||
'Costante che indica il lato in cui posizionare i tagli
|
||||
Private Enum CutSide As Integer
|
||||
@@ -66,6 +73,11 @@ Public Class FlatteningCut
|
||||
Right
|
||||
End Enum
|
||||
|
||||
Private Enum TOOL As Integer
|
||||
SAW = 0
|
||||
MILL = 1
|
||||
End Enum
|
||||
|
||||
' Per abilitare la spianatura con la FRESA deve essere imposatato a TRUE il flag "Usa Fresa" nella pagina MACCHINA (campo INCISIONI)
|
||||
Private Sub FlatteningCut_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
' Creo lista modalità di acquisizione punto
|
||||
@@ -75,8 +87,9 @@ Public Class FlatteningCut
|
||||
' la associo alla combobox
|
||||
PointModeCmBx.ItemsSource = m_PointsModeArray
|
||||
' Creo lista tipo lavorazione
|
||||
m_TypeArray(MACH_TYPE.ONEWAY) = EgtMsg(MSG_COMBOBOXPARAM + 39)
|
||||
m_TypeArray(MACH_TYPE.ZIGZAG) = EgtMsg(MSG_COMBOBOXPARAM + 38)
|
||||
m_TypeArray(MACH_TYPE.ONEWAY) = EgtMsg(MSG_COMBOBOXPARAM + 39)
|
||||
m_TypeArray(MACH_TYPE.SPIRAL) = EgtMsg(MSG_COMBOBOXPARAM + 51)
|
||||
' la associo alla combobox
|
||||
TypeCmBx.ItemsSource = m_TypeArray
|
||||
' assegno messaggi
|
||||
@@ -90,19 +103,26 @@ Public Class FlatteningCut
|
||||
ZReleasedTxBl.Text = "Z Svincolo"
|
||||
SideTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 23)
|
||||
RotLockTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 29)
|
||||
ChainedPathTxBl.Text = "Chained path"
|
||||
SimulBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
||||
OkBtn.ToolTip = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
||||
' tipo di utensile in uso per la lavorazione
|
||||
m_ToolsArray(TOOL.SAW) = EgtMsg(MSG_DIRECTCUTPAGEUC + 24)
|
||||
m_ToolsArray(TOOL.MILL) = "Mill"
|
||||
SelToolCmBx.ItemsSource = m_ToolsArray
|
||||
' Carico i dati dell'ultimo taglio
|
||||
m_dDepth = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_FLATT_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
|
||||
m_dAngO = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_FLATT_ANGH, m_dAngO, m_MainWindow.GetIniFile())
|
||||
m_dLen = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_FLATT_LENGTH, m_dLen, m_MainWindow.GetIniFile())
|
||||
m_dWid = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_FLATT_WIDTH, m_dWid, m_MainWindow.GetIniFile())
|
||||
m_dDepth = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
|
||||
m_dAngO = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_ANGH, m_dAngO, m_MainWindow.GetIniFile())
|
||||
m_dLen = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_LENGTH, m_dLen, m_MainWindow.GetIniFile())
|
||||
m_dWid = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_WIDTH, m_dWid, m_MainWindow.GetIniFile())
|
||||
m_dOverlap = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_OVERLAP, m_dOverlap, m_MainWindow.GetIniFile())
|
||||
m_dZReleased = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_Z_RELEASED, m_dZReleased, m_MainWindow.GetIniFile())
|
||||
m_bHeadSide = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_FLATT_HEADSIDE, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
m_nMachType = GetPrivateProfileInt( S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType, m_MainWindow.GetIniFile())
|
||||
m_bRotLock = ( GetPrivateProfileInt( S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
m_ptTipP1.x = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_FLATT_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
|
||||
m_nMachType = GetPrivateProfileInt(S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType, m_MainWindow.GetIniFile())
|
||||
m_bRotLock = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
m_bChainedPath = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_FLAT_CHAINEDPATH, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
m_nTool = GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, 1, m_MainWindow.GetMachIniFile())
|
||||
m_ptTipP1.x = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
|
||||
m_ptTipP1.y = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
|
||||
End Sub
|
||||
|
||||
@@ -125,16 +145,16 @@ Public Class FlatteningCut
|
||||
' Disabilito registrazione progetto modificato
|
||||
EgtDisableModified()
|
||||
' Creo layer temporaneo per crocette
|
||||
m_nTempLay = EgtCreateGroup( GDB_ID.ROOT)
|
||||
EgtSetLevel( m_nTempLay, GDB_LV.TEMP)
|
||||
m_nTempLay = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetLevel(m_nTempLay, GDB_LV.TEMP)
|
||||
' Origine tavola
|
||||
m_bRawOk = True
|
||||
If Not EgtGetTableRef( 1, m_ptTabOri) Then
|
||||
If Not EgtGetTableRef(1, m_ptTabOri) Then
|
||||
m_bRawOk = False
|
||||
EgtOutLog("Error on TableRef1")
|
||||
End If
|
||||
' Dati del grezzo
|
||||
If Not GetRawBox( m_ptRawMin, m_ptRawMax) Then
|
||||
If Not GetRawBox(m_ptRawMin, m_ptRawMax) Then
|
||||
m_bRawOk = False
|
||||
EgtOutLog("Error on RawBox")
|
||||
End If
|
||||
@@ -142,7 +162,7 @@ Public Class FlatteningCut
|
||||
m_bPointP1Ok = False
|
||||
m_bPointP2Ok = False
|
||||
' Inizializzo primo punto acquisito dal disegno
|
||||
m_ptPrev = m_ptTipP1 + ( m_ptTabOri - Point3d.ORIG())
|
||||
m_ptPrev = m_ptTipP1 + (m_ptTabOri - Point3d.ORIG())
|
||||
m_ptPrev.z = m_ptRawMax.z
|
||||
' Disegno crocetta che indica il punto acquisito
|
||||
CreateCross(m_nTempLay, m_ptPrev)
|
||||
@@ -151,10 +171,10 @@ Public Class FlatteningCut
|
||||
SetCoordVisibility(True)
|
||||
ShowCoord()
|
||||
' Assegno parametri di lavorazione già definiti
|
||||
DepthTxBx.Text = LenToString( m_dDepth, 1)
|
||||
DirectionTxBx.Text = DoubleToString( m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
||||
LenghtTxBx.Text = LenToString( m_dLen, 1)
|
||||
WidthTxBx.Text = LenToString( m_dWid, 2)
|
||||
DepthTxBx.Text = LenToString(m_dDepth, 1)
|
||||
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
||||
LenghtTxBx.Text = LenToString(m_dLen, 1)
|
||||
WidthTxBx.Text = LenToString(m_dWid, 2)
|
||||
OverlapTxBx.Text = LenToString(m_dOverlap, 2)
|
||||
ZReleasedTxBx.Text = LenToString(m_dZReleased, 2)
|
||||
' carico la quota di svincolo per la spianatura
|
||||
@@ -163,6 +183,9 @@ Public Class FlatteningCut
|
||||
SideChBx.IsChecked = m_bHeadSide
|
||||
TypeCmBx.SelectedIndex = m_nMachType
|
||||
RotLockChBx.IsChecked = m_bRotLock
|
||||
ChainedPathChBx.IsChecked = m_bChainedPath
|
||||
' Assegno l'utensile in definito in macchina per la fresatura
|
||||
SelToolCmBx.SelectedIndex = m_nTool
|
||||
' Reset taglio e disabilito bottone esecuzione
|
||||
m_bCutOk = False
|
||||
UpdateSimulOkBtn()
|
||||
@@ -176,22 +199,22 @@ Public Class FlatteningCut
|
||||
|
||||
Friend Sub FlatteningCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
' Salvo i dati correnti
|
||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_DEPTH, DoubleToString( m_dDepth, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_ANGH, DoubleToString( m_dAngO, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_LENGTH, DoubleToString( m_dLen, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_WIDTH, DoubleToString( m_dWid, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_OVERLAP, DoubleToString(m_dOverlap, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_Z_RELEASED, DoubleToString(m_dZReleased, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_HEADSIDE, If( m_bHeadSide, "1", "0"), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType.ToString(), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, If( m_bRotLock, "1", "0"), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString( S_DIRECTCUTS, K_DC_FLATT_POSX, DoubleToString( m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_DEPTH, DoubleToString(m_dDepth, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_ANGH, DoubleToString(m_dAngO, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_LENGTH, DoubleToString(m_dLen, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_WIDTH, DoubleToString(m_dWid, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_OVERLAP, DoubleToString(m_dOverlap, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_Z_RELEASED, DoubleToString(m_dZReleased, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_HEADSIDE, If(m_bHeadSide, "1", "0"), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_MACHTYPE, m_nMachType.ToString(), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_ROTLOCK, If(m_bRotLock, "1", "0"), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_POSX, DoubleToString(m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
|
||||
' imposto la Z di sicurezza corretta
|
||||
EgtMdbSetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
|
||||
EgtMdbSave()
|
||||
' Se non vado in simulazione
|
||||
If Not m_bSimul Then
|
||||
' imposto la Z di sicurezza corretta
|
||||
EgtMdbSetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
|
||||
EgtMdbSave()
|
||||
' Dichiaro sottopagina da non riattivare
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC.DirectCutPages.DirectCut
|
||||
' Rimuovo layer temporaneo per crocette
|
||||
@@ -268,30 +291,43 @@ Public Class FlatteningCut
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1 solo per macchina con 2 teste
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
If bIsMultiCut Then
|
||||
EgtSetCalcTool(sSaw, "H1", 1)
|
||||
End If
|
||||
|
||||
' Se acquisizone lama o laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Se punto da laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
' Ora imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Altrimenti da lama
|
||||
' Altrimenti da lama
|
||||
Else
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP1) Then Return
|
||||
If Not EgtGetCalcToolDirFromAngles(vAng, m_vtToolP1) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP1Ok = True
|
||||
@@ -301,15 +337,13 @@ Public Class FlatteningCut
|
||||
m_dAngO = dTAngO + 90
|
||||
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
||||
|
||||
' Altrimenti da disegno
|
||||
' Altrimenti da disegno
|
||||
Else
|
||||
' Assegno punto selezionato nel disegno a m_ptTipP1
|
||||
m_ptTipP1 = m_ptPrev
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP1Ok = True
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
End If
|
||||
@@ -339,27 +373,41 @@ Public Class FlatteningCut
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1 solo per macchina con 2 teste
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
If bIsMultiCut Then
|
||||
EgtSetCalcTool(sSaw, "H1", 1)
|
||||
End If
|
||||
|
||||
' Se acquisizone lama o laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Se punto da laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
|
||||
' Ora imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Altrimenti da lama
|
||||
' Altrimenti da lama
|
||||
Else
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
|
||||
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP2) Then Return
|
||||
@@ -367,15 +415,13 @@ Public Class FlatteningCut
|
||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP2Ok = True
|
||||
|
||||
' Altrimenti da disegno
|
||||
' Altrimenti da disegno
|
||||
Else
|
||||
' Assegno punto selezionato nel disegno a m_ptTipP2
|
||||
m_ptTipP2 = m_ptPrev
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP2Ok = True
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
End If
|
||||
@@ -524,6 +570,16 @@ Public Class FlatteningCut
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub SelToolCmBx_SelectionChanged(sender As Object, e As EventArgs) Handles SelToolCmBx.SelectionChanged
|
||||
m_nTool = SelToolCmBx.SelectedIndex
|
||||
' Disabilito il concatenamento
|
||||
ChainedPathChBx.IsEnabled = (m_nTool = TOOL.MILL)
|
||||
' Disegno il taglio
|
||||
CreateFlatteningCut()
|
||||
SetMachineInCurrPos()
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub RotLockChBx_Click(sender As Object, e As EventArgs) Handles RotLockChBx.Click
|
||||
m_bRotLock = RotLockChBx.IsChecked
|
||||
' Disegno il taglio
|
||||
@@ -532,6 +588,14 @@ Public Class FlatteningCut
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub ChainedPathChBx_Click(sender As Object, e As EventArgs) Handles ChainedPathChBx.Click
|
||||
m_bChainedPath = ChainedPathChBx.IsChecked
|
||||
' Disegno il taglio
|
||||
CreateFlatteningCut()
|
||||
SetMachineInCurrPos()
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub XcoordTxBx_EgtClosed(sender As Object, e As EventArgs) Handles XcoordTxBx.EgtClosed
|
||||
' Recupero il valore della coordinata (in 0 Tab)
|
||||
Dim dXcoord As Double = 0
|
||||
@@ -583,9 +647,9 @@ Public Class FlatteningCut
|
||||
m_CurrProjPage.SetWarningMessage("Trial Version")
|
||||
#Else
|
||||
' Verifico non sia versione Ufficio
|
||||
If m_MainWindow.GetKeyOption( MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
||||
m_CurrProjPage.SetWarningMessage( "Office Version")
|
||||
Return
|
||||
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
||||
m_CurrProjPage.SetWarningMessage("Office Version")
|
||||
Return
|
||||
End If
|
||||
' Verifico ci sia un taglio valido
|
||||
If Not m_bCutOk Then Return
|
||||
@@ -600,13 +664,15 @@ Public Class FlatteningCut
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||
Return
|
||||
End If
|
||||
Dim sNameProg As Integer = 900
|
||||
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
|
||||
' copio il progetto corrente come progetto in lavorazione
|
||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||
' lancio eventuale lua post-trasmissione
|
||||
m_MainWindow.ExecSentProgScript( True)
|
||||
m_MainWindow.ExecSentProgScript(True)
|
||||
End If
|
||||
#End If
|
||||
End Sub
|
||||
@@ -620,10 +686,12 @@ Public Class FlatteningCut
|
||||
' ricavo l'ingombro di lavorazione in funzione dell'utensile selezionato
|
||||
Private Function GetFootPrintTool() As Double
|
||||
' vedere nella pagina Allarm il capito "Incisioni"
|
||||
Dim bForceUseMill As Boolean = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
Dim bForceUseMill As Boolean = (m_nTool = TOOL.MILL)
|
||||
Dim dFootPrint As Double = 0
|
||||
' verifico quale lavorazione è attiva
|
||||
If Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrSawing) AndAlso Not bForceUseMill Then
|
||||
Dim bSetTool As Boolean = EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw)
|
||||
If Not bSetTool Then EgtOutLog("Erro nel settaggio utensile lama " & m_MainWindow.m_CurrentMachine.sCurrSaw)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dFootPrint)
|
||||
ElseIf Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrMilling) Then
|
||||
Dim sCurrMill = m_MainWindow.m_CurrentMachine.sCurrMill
|
||||
@@ -658,18 +726,39 @@ Public Class FlatteningCut
|
||||
Dim ptStart As Point3d = m_ptTipP1
|
||||
ptStart.z = 0
|
||||
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
||||
|
||||
' -- APPLICO OFFSET AI TAGLI -- And PointModeCmBx.SelectedIndex = PT_MODE.SAW
|
||||
If m_nTool = TOOL.SAW And PointModeCmBx.SelectedIndex = PT_MODE.SAW Then
|
||||
' Applico un offset al taglio:
|
||||
Dim vtOffs As New Vector3d
|
||||
EgtStartVector(nCutId, GDB_RT.GLOB, vtOffs)
|
||||
vtOffs.Rotate(Vector3d.Z_AX, 90)
|
||||
Dim SawThick As Double = GetFootPrintTool()
|
||||
Dim DirOffs As Double = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_SAWTH, 0, m_MainWindow.GetIniFile)
|
||||
Dim vtNormTool As Vector3d = m_vtToolP1
|
||||
vtNormTool.Normalize()
|
||||
EgtOutLog("Offset flattening: " & DirOffs.ToString & "*" & SawThick.ToString)
|
||||
If DirOffs <> 0 Then EgtMove(nCutId, vtOffs * DirOffs * SawThick, GDB_RT.GLOB)
|
||||
End If
|
||||
|
||||
EgtSetInfo(nCutId, INFO_DIRECTCUT, 1)
|
||||
' Imposto affondamento e angolo di fianco sul taglio
|
||||
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
||||
If (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, 1, m_MainWindow.GetMachIniFile()) <> 0) Then
|
||||
If (m_nTool = TOOL.MILL) Then
|
||||
EgtSetInfo(nCutId, INFO_WIDTH, GetFootPrintTool)
|
||||
End If
|
||||
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, 0)
|
||||
' Imposto prima direzione
|
||||
EgtSetInfo(nCutId, INFO_DIR, 1)
|
||||
' Imposto se iniziare la fresatura dal punto indicato
|
||||
Dim bReducePath As Boolean = Not GetPrivateProfileInt(S_MACH_NEST, K_MACH_STARTCENERTOOLPATH, 0, m_MainWindow.GetMachIniFile()) <> 0
|
||||
If Not bReducePath Then EgtSetInfo(nCutId, INFO_STRICT, 0)
|
||||
|
||||
' Eventuale bloccaggio rotazione asse C tra le passate
|
||||
If RotLockChBx.IsChecked Then
|
||||
EgtSetInfo(nCutId, INFO_ENABLE_INVERT, False)
|
||||
End If
|
||||
EgtSetInfo(nCutId, INFO_STEP_TYPE, m_nMachType)
|
||||
' Funzione che crea i tagli successivi al primo
|
||||
MultiplyCut(nLayerId, nCutId)
|
||||
' Creo layer per crocetta di riferimento
|
||||
@@ -702,10 +791,17 @@ Public Class FlatteningCut
|
||||
End Function
|
||||
|
||||
Private Function MultiplyCut(nLayerId As Integer, nCutId As Integer) As Boolean
|
||||
Dim bEngWithMill As Boolean = (m_nTool = TOOL.MILL)
|
||||
Dim bReducePath As Boolean = Not GetPrivateProfileInt(S_MACH_NEST, K_MACH_STARTCENERTOOLPATH, 0, m_MainWindow.GetMachIniFile()) <> 0
|
||||
|
||||
' Recupero spessore della lama (utensile) correntemente attiva
|
||||
Dim dThick As Double = GetFootPrintTool()
|
||||
If dThick = 0 Then Return False
|
||||
|
||||
' Salvo la prima curva nella lista dei percorsi da concatenare
|
||||
Dim CutsList As New List(Of Integer)
|
||||
CutsList.Add(nCutId)
|
||||
|
||||
' Imposto angolo di rotazione a seconda del lato dei tagli
|
||||
Dim dRotAngO As Double = If(SideChBx.IsChecked(), -90, 90)
|
||||
' Definisco vettore di spostamento
|
||||
@@ -723,6 +819,10 @@ Public Class FlatteningCut
|
||||
If nStepNum > 1 Then
|
||||
dDelta = dWidth / (nStepNum - 1)
|
||||
End If
|
||||
' definisco la larghezza dell'utensile (solo per la fresa)
|
||||
EgtSetInfo(nCutId, INFO_WIDTH, dThick)
|
||||
' definisco il tipo di utensile da utilizzare
|
||||
EgtSetInfo(nCutId, "EngravingWithMill", m_nTool)
|
||||
' Creo vettore delta
|
||||
vtDelta *= dDelta
|
||||
' Creo indice per impostare info che indica tipologia di spianatura
|
||||
@@ -731,6 +831,8 @@ Public Class FlatteningCut
|
||||
Dim vtPerpMove As Vector3d = Index * vtDelta
|
||||
' Creo copie
|
||||
Dim nCut2Id = EgtCopyGlob(nCutId, nLayerId)
|
||||
EgtSetInfo(nCut2Id, INFO_WIDTH, dThick)
|
||||
EgtSetInfo(nCutId, "EngravingWithMill", m_nTool)
|
||||
' Assegno info direzione a seconda del tipo di spianatura
|
||||
If TypeCmBx.SelectedIndex = MACH_TYPE.ZIGZAG Then
|
||||
If nTypeIndex = 1 Then
|
||||
@@ -744,10 +846,77 @@ Public Class FlatteningCut
|
||||
EgtSetInfo(nCut2Id, INFO_DIR, 1)
|
||||
End If
|
||||
EgtMove(nCut2Id, vtPerpMove, GDB_RT.GLOB)
|
||||
|
||||
' ----------------------- CREO SEGMENTI PER CONCATENAMENTO CURVE -----------------------
|
||||
If m_bChainedPath And bEngWithMill Then
|
||||
If bReducePath Then
|
||||
If Index < nStepNum - 1 Then
|
||||
ExtendLenghtMillPath(nCut2Id, -dThick / 2)
|
||||
ElseIf Index = nStepNum - 1 Then
|
||||
If nStepNum Mod 2 = 0 Then
|
||||
ExtendLenghtMillPath(nCut2Id, -dThick / 2, False, True)
|
||||
Else
|
||||
ExtendLenghtMillPath(nCut2Id, -dThick / 2, True, False)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
CutsList.Add(nCut2Id)
|
||||
End If
|
||||
' ----------------------- CREO SEGMENTI PER CONCATENAMENTO CURVE -----------------------
|
||||
|
||||
Next
|
||||
|
||||
' ----------------------- CREO UN UNICO PERCORSO CONCATENATO -----------------------
|
||||
If m_bChainedPath And bEngWithMill Then
|
||||
' Decidere se accorciare i tagli del valore del raggio utensile!
|
||||
If bReducePath Then
|
||||
ExtendLenghtMillPath(CutsList(0), -dThick / 2, False, True)
|
||||
End If
|
||||
For Index As Integer = 0 To CutsList.Count - 2
|
||||
If Index Mod 2 <> 0 Then
|
||||
' Costruisco la linea di collegamento tra due curve adiacenti
|
||||
Dim PtStart_1 As Point3d
|
||||
EgtStartPoint(CutsList(Index), GDB_RT.GLOB, PtStart_1)
|
||||
Dim PtStart_2 As Point3d
|
||||
EgtStartPoint(CutsList(Index + 1), GDB_RT.GLOB, PtStart_2)
|
||||
CutsList.Add(EgtCreateLine(nLayerId, PtStart_1, PtStart_2))
|
||||
Else
|
||||
' Costruisco la linea di collegamento tra due curve adiacenti
|
||||
Dim PtStart_1 As Point3d
|
||||
EgtEndPoint(CutsList(Index), GDB_RT.GLOB, PtStart_1)
|
||||
Dim PtStart_2 As Point3d
|
||||
EgtEndPoint(CutsList(Index + 1), GDB_RT.GLOB, PtStart_2)
|
||||
CutsList.Add(EgtCreateLine(nLayerId, PtStart_1, PtStart_2))
|
||||
End If
|
||||
Next
|
||||
Dim ptNear As Point3d
|
||||
EgtStartPoint(CutsList(0), ptNear)
|
||||
Dim IdJointCurv As Integer = EgtCreateCurveCompoByChain(nLayerId, CutsList.ToArray, ptNear, True)
|
||||
EgtSetInfo(IdJointCurv, INFO_DIRECTCUT, 1)
|
||||
EgtSetInfo(IdJointCurv, INFO_STEP_TYPE, m_nMachType)
|
||||
EgtSetInfo(IdJointCurv, INFO_WIDTH, dThick)
|
||||
' Se unisco il percorso devo per forza usare la fresa!
|
||||
EgtSetInfo(IdJointCurv, "EngravingWithMill", 1)
|
||||
If Not bReducePath Then EgtSetInfo(IdJointCurv, INFO_STRICT, 0)
|
||||
End If
|
||||
' ----------------------- CREO UN UNICO PERCORSO CONCATENATO -----------------------
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub ExtendLenghtMillPath(ByVal IdCurv As Integer, ByVal ReduceVal As Double,
|
||||
ByVal Optional bStart As Boolean = True, ByVal Optional bEnd As Boolean = True)
|
||||
Dim PtStart As Point3d
|
||||
EgtStartPoint(IdCurv, GDB_RT.GLOB, PtStart)
|
||||
Dim PtEnd As Point3d
|
||||
EgtEndPoint(IdCurv, GDB_RT.GLOB, PtEnd)
|
||||
If bStart Then EgtTrimExtendCurveByLen(IdCurv, ReduceVal, PtStart, GDB_RT.GLOB)
|
||||
If bEnd Then EgtTrimExtendCurveByLen(IdCurv, ReduceVal, PtEnd, GDB_RT.GLOB)
|
||||
Dim dLenLine As Double
|
||||
EgtCurveLength(IdCurv, dLenLine)
|
||||
EgtOutLog("Lunghezza segmento ridotto: " & dLenLine.ToString)
|
||||
End Sub
|
||||
|
||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||
' Aggiungo crocette
|
||||
Dim vtCrossX As New Vector3d(20, 0, 0)
|
||||
|
||||
@@ -38,6 +38,8 @@ Public Class GridCut
|
||||
Private m_ptPrev As Point3d
|
||||
' Layer per crocette temporanee
|
||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||
' Gestione spessore lama
|
||||
Private m_bSawTh As Boolean = False
|
||||
|
||||
' Costanti
|
||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||
@@ -82,7 +84,12 @@ Public Class GridCut
|
||||
m_nNumX = GetPrivateProfileInt( S_DIRECTCUTS, K_DC_GRID_NUMX, m_nNumX, m_MainWindow.GetIniFile())
|
||||
m_dDimX = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_GRID_DIMX, m_dDimX, m_MainWindow.GetIniFile())
|
||||
m_nNumY = GetPrivateProfileInt( S_DIRECTCUTS, K_DC_GRID_NUMY, m_nNumY, m_MainWindow.GetIniFile())
|
||||
m_dDimY = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_GRID_DIMY, m_dDimY, m_MainWindow.GetIniFile())
|
||||
m_dDimY = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_DIMY, m_dDimY, m_MainWindow.GetIniFile())
|
||||
|
||||
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
|
||||
m_bHeadSide = ( GetPrivateProfileInt( S_DIRECTCUTS, K_DC_GRID_HEADSIDE, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
m_ptTipP1.x = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_GRID_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
|
||||
m_ptTipP1.y = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_GRID_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
|
||||
@@ -141,6 +148,11 @@ Public Class GridCut
|
||||
NumPzYTxBx.Text = m_nNumY.ToString()
|
||||
DimPzYTxBx.Text = LenToString( m_dDimY, 1)
|
||||
SideChBx.IsChecked = m_bHeadSide
|
||||
|
||||
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
|
||||
' Reset taglio e disabilito bottone esecuzione
|
||||
m_bCutOk = False
|
||||
UpdateSimulOkBtn()
|
||||
@@ -248,6 +260,12 @@ Public Class GridCut
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1 solo per macchina con 2 teste
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
If bIsMultiCut Then
|
||||
m_MainWindow.m_DirectCutPageUC.ReloadParam()
|
||||
End If
|
||||
|
||||
' Recupero dati utensile e testa corrente
|
||||
Dim sTool As String = ""
|
||||
Dim sHead As String = ""
|
||||
@@ -260,6 +278,13 @@ Public Class GridCut
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Se punto da laser
|
||||
@@ -267,7 +292,7 @@ Public Class GridCut
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
' Altrimenti da lama
|
||||
@@ -275,10 +300,10 @@ Public Class GridCut
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP1) Then Return
|
||||
If Not EgtGetCalcToolDirFromAngles(vAng, m_vtToolP1) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP1Ok = True
|
||||
@@ -327,6 +352,12 @@ Public Class GridCut
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1 solo per macchina con 2 teste
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
If bIsMultiCut Then
|
||||
m_MainWindow.m_DirectCutPageUC.ReloadParam()
|
||||
End If
|
||||
|
||||
' Recupero dati utensile e testa corrente
|
||||
Dim sTool As String = ""
|
||||
Dim sHead As String = ""
|
||||
@@ -339,6 +370,13 @@ Public Class GridCut
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Se punto da laser
|
||||
@@ -346,7 +384,7 @@ Public Class GridCut
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
' Altrimenti da lama
|
||||
@@ -354,10 +392,10 @@ Public Class GridCut
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP2) Then Return
|
||||
If Not EgtGetCalcToolDirFromAngles(vAng, m_vtToolP2) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP2Ok = True
|
||||
@@ -523,13 +561,15 @@ Public Class GridCut
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||
Return
|
||||
End If
|
||||
Dim sNameProg As Integer = 900
|
||||
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
|
||||
' copio il progetto corrente come progetto in lavorazione
|
||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||
' lancio eventuale lua post-trasmissione
|
||||
m_MainWindow.ExecSentProgScript( True)
|
||||
m_MainWindow.ExecSentProgScript(True)
|
||||
End If
|
||||
#End If
|
||||
End Sub
|
||||
@@ -616,6 +656,15 @@ Public Class GridCut
|
||||
If dDimPzY <> 0 And nNumPzY > 0 And dDimPzX <> 0 And nNumPzX > 0 Then
|
||||
Dim dLenX As Double = dThick + (dDimPzX + dThick) * nNumPzX
|
||||
Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX + 0.1)
|
||||
|
||||
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
' Recupero spessore lama corrente
|
||||
Dim sSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||
If m_bSawTh And Not String.IsNullOrEmpty(sSawing) Then
|
||||
EgtOffsetCurve(nCutParaId, -dThick, OFF_TYPE.EXTEND)
|
||||
End If
|
||||
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
|
||||
' Imposto affondamento e angolo di fianco sul taglio
|
||||
EgtSetInfo(nCutParaId, INFO_DEPTH, m_dDepth)
|
||||
EgtSetInfo(nCutParaId, INFO_SIDE_ANGLE, m_dAngV)
|
||||
@@ -634,6 +683,13 @@ Public Class GridCut
|
||||
' Arretro il punto di partenza di uno spessore lama
|
||||
Dim vtDeltaPos As Vector3d = Vector3d.FromPolar(dThick + 0.1, m_dAngO - 90)
|
||||
Dim nCutPerpId = EgtCreateLinePDL(nLayerId, ptStart + vtDeltaPos, m_dAngO + 90, dLenY + 0.2)
|
||||
|
||||
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
If m_bSawTh And Not String.IsNullOrEmpty(sSawing) Then
|
||||
EgtOffsetCurve(nCutPerpId, -dThick, OFF_TYPE.EXTEND)
|
||||
End If
|
||||
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
|
||||
' Specchio se è attivo il flag che cambia lato di disegno
|
||||
If SideChBx.IsChecked() Then
|
||||
Dim vtRot As Vector3d = Vector3d.FromPolar(1, m_dAngO + 90)
|
||||
@@ -656,6 +712,7 @@ Public Class GridCut
|
||||
End Function
|
||||
|
||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||
ptP += New Vector3d(0, 0, 0.15)
|
||||
' Aggiungo crocette
|
||||
Dim vtCrossX As New Vector3d(20, 0, 0)
|
||||
Dim vtCrossY As New Vector3d(0, 20, 0)
|
||||
|
||||
@@ -53,14 +53,43 @@ Public Class ManualAxesMoveUC
|
||||
' Imposto check per considerare spessore lama
|
||||
L1SawThChBx.IsChecked = m_MainWindow.m_CurrentMachine.bAddSawThTo5AxMove
|
||||
L2SawThChBx.IsChecked = m_MainWindow.m_CurrentMachine.bAddSawThTo5AxMove
|
||||
|
||||
' Aggiorno visualizzazione
|
||||
SetMachineInCurrPos()
|
||||
EgtDraw()
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
||||
End Sub
|
||||
|
||||
Private Sub ManualAxesMove_UnLoaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
m_Timer.Stop()
|
||||
m_MainWindow.m_CurrentMachine.bAddSawThTo5AxMove = (L1SawThChBx.IsEnabled And L1SawThChBx.IsChecked) Or
|
||||
(L2SawThChBx.IsEnabled And L2SawThChBx.IsChecked)
|
||||
' Nascondo la macchina
|
||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Function SetMachineInCurrPos() As Boolean
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return False
|
||||
' Recupero il nome degli assi macchina
|
||||
Dim sL1 As String = String.Empty
|
||||
Dim sL2 As String = String.Empty
|
||||
Dim sL3 As String = String.Empty
|
||||
Dim sR1 As String = String.Empty
|
||||
Dim sR2 As String = String.Empty
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesNames(sL1, sL2, sL3, sR1, sR2) Then Return False
|
||||
' Visualizzo macchina in posizione
|
||||
EgtSetAxisPos(sL1, dL1)
|
||||
EgtSetAxisPos(sL2, dL2)
|
||||
EgtSetAxisPos(sL3, dL3)
|
||||
EgtSetAxisPos(sR1, dR1)
|
||||
EgtSetAxisPos(sR2, dR2)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub UpdateAxesNames()
|
||||
Dim sL1 As String = String.Empty
|
||||
Dim sL2 As String = String.Empty
|
||||
@@ -125,11 +154,16 @@ Public Class ManualAxesMoveUC
|
||||
Private Sub Timer_tick()
|
||||
UpdateAxesNames()
|
||||
UpdateUseSawThickness()
|
||||
' Aggiorno posizione macchina in disegno
|
||||
SetMachineInCurrPos()
|
||||
' Aggiorno il disegno
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private m_MoveClicked As Boolean = False
|
||||
Private Sub XXBtn_Click(sender As Object, e As MouseButtonEventArgs) Handles L1Btn.PreviewMouseDown, L2Btn.PreviewMouseDown, L3Btn.PreviewMouseDown, R1Btn.PreviewMouseDown, R2Btn.PreviewMouseDown
|
||||
If e.ClickCount > 1 OrElse m_MoveClicked Then
|
||||
EgtOutLog(" → Hold on! Do not click compulsively.")
|
||||
Return
|
||||
End If
|
||||
m_MoveClicked = True
|
||||
@@ -216,6 +250,7 @@ Public Class ManualAxesMoveUC
|
||||
Private Sub SiemensMoveAxis(CurrentBtn As Button)
|
||||
' leggo se stato reset
|
||||
If Not m_CN.bResetState Then
|
||||
EgtOutLog("Reset status is 'False', is denied to execute file '\DirectCmd\AxesMove.lua'.")
|
||||
m_MoveClicked = False
|
||||
Return
|
||||
End If
|
||||
|
||||
@@ -38,7 +38,8 @@ Public Class MultipleCut
|
||||
Private m_ptPrev As Point3d
|
||||
' Layer per crocette temporanee
|
||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||
|
||||
' Gestione spessore lama
|
||||
Private m_bSawTh As Boolean = False
|
||||
' Costanti
|
||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||
Private Const MIN_CUT_LEN As Double = 10.0
|
||||
@@ -90,9 +91,14 @@ Public Class MultipleCut
|
||||
m_dAngO = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_MULT_ANGH, m_dAngO, m_MainWindow.GetIniFile())
|
||||
m_dAngV = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_MULT_ANGV, m_dAngV, m_MainWindow.GetIniFile())
|
||||
For nI As Integer = 0 To 9
|
||||
m_nNum( nI) = GetPrivateProfileInt( S_DIRECTCUTS, K_DC_MULT_NUM & (nI+1).ToString(), 0, m_MainWindow.GetIniFile())
|
||||
m_dDim( nI) = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_MULT_DIM & (nI+1).ToString(), 0, m_MainWindow.GetIniFile())
|
||||
m_nNum(nI) = GetPrivateProfileInt(S_DIRECTCUTS, K_DC_MULT_NUM & (nI + 1).ToString(), 0, m_MainWindow.GetIniFile())
|
||||
m_dDim(nI) = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_MULT_DIM & (nI + 1).ToString(), 0, m_MainWindow.GetIniFile())
|
||||
Next
|
||||
|
||||
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
|
||||
m_bHeadSide = ( GetPrivateProfileInt( S_DIRECTCUTS, K_DC_MULT_HEADSIDE, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
m_ptTipP1.x = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_MULT_POSX, m_ptTipP1.x, m_MainWindow.GetIniFile())
|
||||
m_ptTipP1.y = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_MULT_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
|
||||
@@ -168,6 +174,11 @@ Public Class MultipleCut
|
||||
NumPz10TxBx.Text = m_nNum(9).ToString()
|
||||
DimPz10TxBx.Text = LenToString( m_dDim(9), 1)
|
||||
SideChBx.IsChecked = m_bHeadSide
|
||||
|
||||
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
m_bSawTh = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_SING_SAWTH, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
|
||||
' Reset taglio e disabilito bottone esecuzione
|
||||
m_bCutOk = False
|
||||
UpdateSimulOkBtn()
|
||||
@@ -274,6 +285,12 @@ Public Class MultipleCut
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1 solo per macchina con 2 teste
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
If bIsMultiCut Then
|
||||
m_MainWindow.m_DirectCutPageUC.ReloadParam()
|
||||
End If
|
||||
|
||||
' Recupero dati utensile e testa corrente
|
||||
Dim sTool As String = ""
|
||||
Dim sHead As String = ""
|
||||
@@ -286,6 +303,13 @@ Public Class MultipleCut
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Se punto da laser
|
||||
@@ -293,7 +317,7 @@ Public Class MultipleCut
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
|
||||
@@ -303,10 +327,10 @@ Public Class MultipleCut
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP1) Then Return
|
||||
If Not EgtGetCalcToolDirFromAngles(vAng, m_vtToolP1) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP1Ok = True
|
||||
@@ -354,6 +378,12 @@ Public Class MultipleCut
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1 solo per macchina con 2 teste
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
If bIsMultiCut Then
|
||||
m_MainWindow.m_DirectCutPageUC.ReloadParam()
|
||||
End If
|
||||
|
||||
' Recupero dati utensile e testa corrente
|
||||
Dim sTool As String = ""
|
||||
Dim sHead As String = ""
|
||||
@@ -366,6 +396,13 @@ Public Class MultipleCut
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Se punto da laser
|
||||
@@ -373,7 +410,7 @@ Public Class MultipleCut
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
' Altrimenti da lama
|
||||
@@ -381,10 +418,10 @@ Public Class MultipleCut
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP2) Then Return
|
||||
If Not EgtGetCalcToolDirFromAngles(vAng, m_vtToolP2) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP2Ok = True
|
||||
@@ -569,13 +606,15 @@ Public Class MultipleCut
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||
Return
|
||||
End If
|
||||
Dim sNameProg As Integer = 900
|
||||
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
|
||||
' copio il progetto corrente come progetto in lavorazione
|
||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||
' lancio eventuale lua post-trasmissione
|
||||
m_MainWindow.ExecSentProgScript( True)
|
||||
m_MainWindow.ExecSentProgScript(True)
|
||||
End If
|
||||
#End If
|
||||
End Sub
|
||||
@@ -606,6 +645,22 @@ Public Class MultipleCut
|
||||
Dim ptStart As Point3d = m_ptTipP1
|
||||
ptStart.z = 0
|
||||
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
||||
|
||||
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
' Recupero spessore lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
Dim sSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||
EgtTdbSetCurrTool(sSaw)
|
||||
Dim dThick As Double = 0
|
||||
' Se è impostata una lavorazione di lama
|
||||
If Not String.IsNullOrEmpty(sSawing) Then
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
End If
|
||||
If m_bSawTh And Not String.IsNullOrEmpty(sSawing) Then
|
||||
EgtOffsetCurve(nCutId, -dThick, OFF_TYPE.EXTEND)
|
||||
End If
|
||||
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
|
||||
' Imposto affondamento e angolo di fianco sul taglio
|
||||
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
||||
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
|
||||
@@ -698,6 +753,7 @@ Public Class MultipleCut
|
||||
End Function
|
||||
|
||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||
ptP += New Vector3d(0, 0, 0.15)
|
||||
' Aggiungo crocette
|
||||
Dim vtCrossX As New Vector3d(20, 0, 0)
|
||||
Dim vtCrossY As New Vector3d(0, 20, 0)
|
||||
|
||||
@@ -180,13 +180,15 @@ Public Class Polishing
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||
Return
|
||||
End If
|
||||
Dim sNameProg As Integer = 900
|
||||
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
|
||||
' copio il progetto corrente come progetto in lavorazione
|
||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||
' lancio eventuale lua post-trasmissione
|
||||
m_MainWindow.ExecSentProgScript( True)
|
||||
m_MainWindow.ExecSentProgScript(True)
|
||||
End If
|
||||
#End If
|
||||
End Sub
|
||||
|
||||
@@ -210,17 +210,30 @@ Public Class SawTestUC
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1 solo per macchina con 2 teste
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
If bIsMultiCut Then
|
||||
EgtSetCalcTool(m_sSaw, "H1", 1)
|
||||
End If
|
||||
|
||||
' Se acquisizone lama o laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Se punto da laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
' Ora imposto la lama corrente
|
||||
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
||||
' Altrimenti da lama
|
||||
@@ -228,10 +241,10 @@ Public Class SawTestUC
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP1) Then Return
|
||||
If Not EgtGetCalcToolDirFromAngles(vAng, m_vtToolP1) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP1Ok = True
|
||||
@@ -280,17 +293,30 @@ Public Class SawTestUC
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1 solo per macchina con 2 teste
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
If bIsMultiCut Then
|
||||
EgtSetCalcTool(m_sSaw, "H1", 1)
|
||||
End If
|
||||
|
||||
' Se acquisizone lama o laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Se punto da laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
|
||||
' Ora imposto la lama corrente
|
||||
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
||||
' Altrimenti da lama
|
||||
@@ -298,10 +324,10 @@ Public Class SawTestUC
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP2) Then Return
|
||||
If Not EgtGetCalcToolDirFromAngles(vAng, m_vtToolP2) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP2Ok = True
|
||||
@@ -450,13 +476,15 @@ Public Class SawTestUC
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||
Return
|
||||
End If
|
||||
Dim sNameProg As Integer = 900
|
||||
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
|
||||
' copio il progetto corrente come progetto in lavorazione
|
||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||
' lancio eventuale lua post-trasmissione
|
||||
m_MainWindow.ExecSentProgScript( True)
|
||||
m_MainWindow.ExecSentProgScript(True)
|
||||
End If
|
||||
#End If
|
||||
End Sub
|
||||
@@ -502,6 +530,10 @@ Public Class SawTestUC
|
||||
ElseIf nWSide = MCH_SAW_WS.LEFT Then
|
||||
vtPerp = vtDir
|
||||
vtPerp.Rotate(Vector3d.Z_AX, +90)
|
||||
Else
|
||||
m_CurrProjPage.ClearMessage()
|
||||
' 91143 = Set machining side: right or left.
|
||||
m_CurrProjPage.SetInfoMessage(EgtMsg(91143))
|
||||
End If
|
||||
Dim ptEnd As Point3d = ptStart + vtDir * m_dLen + vtPerp * dThick
|
||||
Dim dLen2 As Double = m_dLen / 2
|
||||
|
||||
@@ -268,6 +268,12 @@ Public Class SingleCutUC
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1 solo per macchina con 2 teste
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
If bIsMultiCut Then
|
||||
m_MainWindow.m_DirectCutPageUC.ReloadParam()
|
||||
End If
|
||||
|
||||
' Recupero dati utensile e testa corrente
|
||||
Dim sTool As String = ""
|
||||
Dim sHead As String = ""
|
||||
@@ -279,6 +285,13 @@ Public Class SingleCutUC
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Se punto da laser
|
||||
@@ -286,7 +299,8 @@ Public Class SingleCutUC
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
EgtOutLog("Coordinate punto 1 da H3: " & m_ptTipP1.x.ToString & " ," & m_ptTipP1.y.ToString)
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
' Altrimenti da lama
|
||||
@@ -294,10 +308,11 @@ Public Class SingleCutUC
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
EgtOutLog("Coordinate punto 1 da H1: " & m_ptTipP1.x.ToString & " ," & m_ptTipP1.y.ToString)
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP1) Then Return
|
||||
If Not EgtGetCalcToolDirFromAngles(vAng, m_vtToolP1) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP1Ok = True
|
||||
@@ -318,7 +333,6 @@ Public Class SingleCutUC
|
||||
m_bPointP1Ok = True
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
|
||||
End If
|
||||
|
||||
' Disegno il taglio
|
||||
@@ -348,6 +362,12 @@ Public Class SingleCutUC
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
If bIsMultiCut Then
|
||||
m_MainWindow.m_DirectCutPageUC.ReloadParam()
|
||||
End If
|
||||
|
||||
' Recupero dati utensile e testa corrente
|
||||
Dim sTool As String = ""
|
||||
Dim sHead As String = ""
|
||||
@@ -359,6 +379,13 @@ Public Class SingleCutUC
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
' Se punto da laser
|
||||
@@ -366,20 +393,20 @@ Public Class SingleCutUC
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
|
||||
EgtOutLog("Coordinate punto 2 da H3: " & m_ptTipP2.x.ToString & " ," & m_ptTipP2.y.ToString)
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
|
||||
' Altrimenti da lama
|
||||
Else
|
||||
' Reimposto eventuale precedente utensile
|
||||
EgtSetCalcTool(sTool, sHead, nExit)
|
||||
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP2) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP2) Then Return
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP2) Then Return
|
||||
If Not EgtGetCalcToolDirFromAngles(vAng, m_vtToolP2) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP2Ok = True
|
||||
@@ -412,6 +439,7 @@ Public Class SingleCutUC
|
||||
m_dAngO = dAngOrizzDeg
|
||||
LenghtTxBx.Text = LenToString(m_dLen, 1)
|
||||
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
||||
EgtOutLog("Lunghezza taglio: " & dLen.ToString & "Angolo: " & dAngOrizzDeg.ToString)
|
||||
CreateSingleCut()
|
||||
' Disegno la macchina nella sua posizione reale
|
||||
SetMachineInCurrPos()
|
||||
@@ -584,13 +612,15 @@ Public Class SingleCutUC
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||
Return
|
||||
End If
|
||||
Dim sNameProg As Integer = 900
|
||||
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
|
||||
' copio il progetto corrente come progetto in lavorazione
|
||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||
' lancio eventuale lua post-trasmissione
|
||||
m_MainWindow.ExecSentProgScript( True)
|
||||
m_MainWindow.ExecSentProgScript(True)
|
||||
End If
|
||||
#End If
|
||||
End Sub
|
||||
@@ -602,6 +632,7 @@ Public Class SingleCutUC
|
||||
Private Function CreateSingleCut() As Boolean
|
||||
' Verifico sia definito il punto iniziale e il grezzo
|
||||
If Not m_bPointP1Ok Or Not m_bRawOk Then
|
||||
EgtOutLog("Primo punto non valido")
|
||||
m_bCutOk = False
|
||||
Return False
|
||||
End If
|
||||
|
||||
@@ -72,7 +72,10 @@ Public Class SingleDrillUC
|
||||
Private Sub SingleDrill_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
m_sCurrDrill = m_CurrentMachine.sCurrDrill
|
||||
GetDrillFromDrilling(m_sCurrDrill, m_CurrentMachine.sCurrDrilling)
|
||||
|
||||
' rimuovo utensile su uscite 1
|
||||
EgtSetCalcTool("", "H1", 1)
|
||||
' imposto utensile su uscita 2
|
||||
EgtSetCalcTool(m_sCurrDrill, "H1", 2)
|
||||
' recupero informazioni del foretto usato
|
||||
EgtTdbSetCurrTool(m_sCurrDrill)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_dDiameter)
|
||||
@@ -213,21 +216,33 @@ Public Class SingleDrillUC
|
||||
' Verifico configurazione tavola e grezzo
|
||||
If Not m_bRawOk Then Return
|
||||
|
||||
' forzo utilizzo testa H1 solo per macchina con 2 teste
|
||||
Dim bIsMultiCut As Boolean = (EgtGetHeadId("H101") <> GDB_ID.NULL)
|
||||
' Ricavo dati lama corrente
|
||||
Dim sDrill As String = m_sCurrDrill
|
||||
If bIsMultiCut Then
|
||||
EgtSetCalcTool(sDrill, "H1", 2)
|
||||
End If
|
||||
|
||||
' Se acquisizione lama o laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.DRILL Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
|
||||
' Ricavo dati Foretto corrente
|
||||
Dim sDrill As String = m_sCurrDrill
|
||||
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||
Dim vAng() As Double = {dR1, dR2, 0}
|
||||
If bIsMultiCut Then
|
||||
vAng(0) = 0
|
||||
vAng(1) = dR1
|
||||
vAng(2) = dR2
|
||||
End If
|
||||
' Se punto da laser
|
||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
' Ora imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sDrill, "H1", 2) Then Return
|
||||
' Altrimenti da lama
|
||||
@@ -235,10 +250,10 @@ Public Class SingleDrillUC
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sDrill, "H1", 2) Then Return
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, m_ptTipP1) Then Return
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, vAng, True, m_ptTipP1) Then Return
|
||||
End If
|
||||
' Calcolo direzione asse lama
|
||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP1) Then Return
|
||||
If Not EgtGetCalcToolDirFromAngles(vAng, m_vtToolP1) Then Return
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP1Ok = True
|
||||
@@ -250,10 +265,8 @@ Public Class SingleDrillUC
|
||||
' Porto il tip nell'origine tavola
|
||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||
m_bPointP1Ok = True
|
||||
' Ricavo dati lama corrente
|
||||
Dim sDrill As String = m_sCurrDrill
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sDrill, "H1", 1) Then Return
|
||||
If Not EgtSetCalcTool(sDrill, "H1", 2) Then Return
|
||||
End If
|
||||
|
||||
' Disegno il taglio
|
||||
@@ -371,8 +384,10 @@ Public Class SingleDrillUC
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||
Return
|
||||
End If
|
||||
Dim sNameProg As Integer = 900
|
||||
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
|
||||
' copio il progetto corrente come progetto in lavorazione
|
||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||
@@ -431,9 +446,9 @@ Public Class SingleDrillUC
|
||||
ptIns.z = dRawHeight
|
||||
' Inserisco il pezzo nel grezzo
|
||||
EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId)
|
||||
EgtSetCurrPhase(1)
|
||||
' Inserisco la lavorazione
|
||||
m_bCutOk = AddMachinings(nPartId) AndAlso UpdateAllMachiningsToolpaths()
|
||||
EgtSetCurrPhase(1)
|
||||
' Eventuale eliminazione Home finale
|
||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||
RemoveFinalHome()
|
||||
|
||||
@@ -287,8 +287,10 @@ Public Class SquaringUC
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||
Return
|
||||
End If
|
||||
Dim sNameProg As Integer = 900
|
||||
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, 900) Then
|
||||
If m_MainWindow.m_CNCommunication.SendProgram(sCncPath, sNameProg) Then
|
||||
' copio il progetto corrente come progetto in lavorazione
|
||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||
@@ -348,6 +350,7 @@ Public Class SquaringUC
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
|
||||
Dim dThick As Double = 0
|
||||
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
|
||||
dThick = dThick / Math.Cos(m_dAngV * Math.PI / 180)
|
||||
' Imposto angolo di rotazione a seconda del lato dei tagli paralleli
|
||||
@@ -365,9 +368,12 @@ Public Class SquaringUC
|
||||
If dDimPzY <> 0 And nNumPzY > 0 And dDimPzX <> 0 And nNumPzX > 0 Then
|
||||
Dim dLenX As Double = dThick + (dDimPzX + dThick) * nNumPzX
|
||||
Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX + 0.1)
|
||||
' Imposto affondamento e angolo di fianco sul taglio
|
||||
EgtSetInfo(nCutParaId, INFO_DEPTH, m_dDepth)
|
||||
EgtSetInfo(nCutParaId, INFO_SIDE_ANGLE, m_dAngV)
|
||||
' Imposto affondamento e angolo di fianco sul taglio (solo se non lama STD)
|
||||
If Not nType = MCH_TY.SAW_STD Then
|
||||
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
|
||||
EgtExtendCurveStartByLen(nCutParaId, m_dOffsetSquaring + m_dExtraLength)
|
||||
EgtExtendCurveEndByLen(nCutParaId, m_dOffsetSquaring + +m_dExtraLength)
|
||||
|
||||
@@ -22,6 +22,9 @@ Public Class VacuumMachineButtonUC
|
||||
Friend m_CN As CN_generico
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' visualizzo l'elenco degli elementi della pagina sono al primo avvio
|
||||
Friend m_OutLogTypeButton As Boolean = True
|
||||
|
||||
' Creazione converter da String a ImageSource
|
||||
Dim ImageConverter As New ImageSourceConverter
|
||||
|
||||
@@ -71,10 +74,37 @@ Public Class VacuumMachineButtonUC
|
||||
If Not IsNothing(ButtonToAdd) Then m_ButtonList.Add(ButtonToAdd)
|
||||
End If
|
||||
End While
|
||||
|
||||
For Each MachineButton As MachineButton In m_ButtonList
|
||||
OutLogTypeButton(MachineButton)
|
||||
Next
|
||||
m_OutLogTypeButton = False
|
||||
|
||||
NotifyPropertyChanged("ButtonList")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "STATE CHANGED"
|
||||
' ------------------------------------------------------------------------------
|
||||
' i segeunti metodi notificano il cambiamento di stato di specifici bottoni
|
||||
'-------------------------------------------------------------------------------
|
||||
|
||||
Friend Sub OutLogTypeButton(CurrMachineButton As MachineButton)
|
||||
If Not m_OutLogTypeButton Then Return
|
||||
Dim BtnType As Type = CurrMachineButton.GetType
|
||||
If BtnType Is GetType(NoStateButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(0) ") & " , " & CurrMachineButton.StateFlag)
|
||||
ElseIf BtnType Is GetType(TwoStateButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(1) ") & " , " & CurrMachineButton.StateFlag)
|
||||
ElseIf BtnType Is GetType(ThreeStateButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(2) ") & " , " & CurrMachineButton.StateFlag)
|
||||
ElseIf BtnType Is GetType(DoubleCommandButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(3) ") & " , " & CurrMachineButton.StateFlag)
|
||||
ElseIf BtnType Is GetType(PressedCommandButton) Then
|
||||
EgtOutLog(" ► " & BtnType.ToString.Replace("OmagCUT.", "(4) ") & " , " & CurrMachineButton.StateFlag)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub VacuumUpChanged(VacuumUpState As Boolean)
|
||||
Dim VacuumUpButton As TwoStateButton = Nothing
|
||||
For Each MachineButton As MachineButton In m_ButtonList
|
||||
@@ -371,6 +401,8 @@ Public Class VacuumMachineButtonUC
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' State Range
|
||||
|
||||
Public Function GetPrivateProfileMachineButtons(
|
||||
ByVal lpAppName As String,
|
||||
ByVal lpKeyName As String,
|
||||
|
||||
@@ -1185,22 +1185,42 @@ Public Class DrawPageUC
|
||||
Else
|
||||
MakeMultipleInsert(InsNbr, sPartName)
|
||||
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
|
||||
' Se Shift premuto eseguo il contrario
|
||||
If Keyboard.Modifiers And ModifierKeys.Shift Then
|
||||
bExitPage = Not bExitPage
|
||||
End If
|
||||
If bExitPage Then
|
||||
' Aggiorno ambiente principale
|
||||
EgtZoom(ZM.ALL)
|
||||
' Elimino nome del componente precedente
|
||||
m_sCompoName = String.Empty
|
||||
' Reset inclinazioni
|
||||
m_SideAngleUC.DeleteSideAngle()
|
||||
' Chiudo compo interni nel caso siano aperti
|
||||
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
|
||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
|
||||
Else
|
||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
DrawPage_Unloaded(sender, e)
|
||||
' Elimino nome del componente precedente
|
||||
m_sCompoName = String.Empty
|
||||
' Reset inclinazioni
|
||||
m_SideAngleUC.DeleteSideAngle()
|
||||
If String.IsNullOrEmpty(m_MainComponentPage.m_SecondaryComponentPage.m_sCurrCompo) Then
|
||||
DrawPage_Loaded(sender, e)
|
||||
Else
|
||||
LoadSecondaryPage()
|
||||
End If
|
||||
|
||||
' Aggiorno ambiente principale
|
||||
EgtZoom(ZM.ALL)
|
||||
' Elimino nome del componente precedente
|
||||
m_sCompoName = String.Empty
|
||||
' Reset inclinazioni
|
||||
m_SideAngleUC.DeleteSideAngle()
|
||||
' Chiudo compo interni nel caso siano aperti
|
||||
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_InternalCompoPage)
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
|
||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' esco dalla pagina corrente
|
||||
@@ -1221,6 +1241,24 @@ Public Class DrawPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
|
||||
|
||||
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
|
||||
|
||||
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
|
||||
@@ -1492,17 +1530,39 @@ Public Class DrawPageUC
|
||||
' Seleziono la Tab e la Page di apertura
|
||||
Select Case m_ActiveComponentPage
|
||||
Case Pages.MainComponent
|
||||
LeftButtonGrd.Children.Remove( m_MainComponentPage)
|
||||
LeftButtonGrd.Children.Remove(m_MainComponentPage)
|
||||
|
||||
Case Pages.SecondaryComponent
|
||||
LeftButtonGrd.Children.Remove( m_MainComponentPage.m_SecondaryComponentPage)
|
||||
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
|
||||
|
||||
Case Pages.InternalComponent
|
||||
LeftButtonGrd.Children.Remove( m_MainWindow.m_DrawPageUC.m_CompoDimension.m_InternalCompoPage)
|
||||
LeftButtonGrd.Children.Remove(m_MainWindow.m_DrawPageUC.m_CompoDimension.m_InternalCompoPage)
|
||||
|
||||
Case Pages.CompoDimension
|
||||
VariablesGrd.Children.Remove( m_CompoDimension)
|
||||
VariablesGrd.Children.Remove(m_CompoDimension)
|
||||
|
||||
Case Pages.SideAngle
|
||||
VariablesGrd.Children.Remove( m_SideAngleUC)
|
||||
Select Case m_SideAngleUC.m_Mode
|
||||
Case SideAngleUC.ModeOpt.SIDEANGLE
|
||||
SideAngleBtn.IsChecked = False
|
||||
SideAngleBtn_Click(Nothing, Nothing)
|
||||
Case SideAngleUC.ModeOpt.ENGRAVE
|
||||
EngraveBtn.IsChecked = False
|
||||
EngraveBtn_Click(Nothing, Nothing)
|
||||
Case SideAngleUC.ModeOpt.DRIP
|
||||
DripCutBtn.IsChecked = False
|
||||
DripCutBtn_Click(Nothing, Nothing)
|
||||
End Select
|
||||
VariablesGrd.Children.Remove(m_SideAngleUC)
|
||||
|
||||
Case Pages.FiloTop
|
||||
FiloTopBtn.IsChecked = False
|
||||
FiloTopBtn_Click(Nothing, Nothing)
|
||||
VariablesGrd.Children.Remove(m_FiloTopUC)
|
||||
|
||||
Case Pages.AlzFront
|
||||
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
|
||||
|
||||
End Select
|
||||
|
||||
' Pulisco l'ambiente lua
|
||||
|
||||
@@ -38,7 +38,7 @@ Public Class FiloTopUC
|
||||
m_CallingPage = m_MainWindow.m_ActivePage
|
||||
|
||||
' Imposto messaggi
|
||||
ParameterTxBl.Text = EgtMsg( MSG_IMPORTPAGEUC + 10) ' Offset
|
||||
ParameterTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
|
||||
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
|
||||
Parameter3TxBl.Text = EgtMsg(91138)
|
||||
|
||||
@@ -46,10 +46,10 @@ Public Class FiloTopUC
|
||||
' Imposto questa come pagina correntemente visualizzata nella drawpage
|
||||
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.FiloTop
|
||||
' Imposto contesto corrente
|
||||
EgtSetCurrentContext( m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
||||
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
||||
ElseIf m_CallingPage = MainWindow.Pages.Import Then
|
||||
' Imposto contesto corrente
|
||||
EgtSetCurrentContext( m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
|
||||
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
|
||||
End If
|
||||
|
||||
' Gestisco visualizzazione dei parametri
|
||||
@@ -58,9 +58,9 @@ Public Class FiloTopUC
|
||||
Parameter3TxBl.Visibility = Windows.Visibility.Visible
|
||||
|
||||
' Aggiorno valori
|
||||
m_dFiloTopOffset = GetPrivateProfileDouble( S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
|
||||
ParameterTxBx.Text = LenToString( m_dFiloTopOffset, 3)
|
||||
m_dFiloTopDepth = GetPrivateProfileDouble( S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
|
||||
m_dFiloTopOffset = GetPrivateProfileDouble(S_SIDES, K_FILOTOPOFFSET, 5, m_MainWindow.GetIniFile())
|
||||
ParameterTxBx.Text = LenToString(m_dFiloTopOffset, 3)
|
||||
m_dFiloTopDepth = GetPrivateProfileDouble(S_SIDES, K_FILOTOPDEPTH, 5, m_MainWindow.GetIniFile())
|
||||
Parameter2TxBx.Text = LenToString(m_dFiloTopDepth, 3)
|
||||
m_bCornerradius = GetPrivateProfileInt(S_SIDES, K_ROUNDOFF, 0, m_MainWindow.GetIniFile()) <> 0
|
||||
Parameter3ChBx.IsChecked = m_bCornerradius
|
||||
@@ -81,8 +81,8 @@ Public Class FiloTopUC
|
||||
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
|
||||
While nLayId <> GDB_ID.NULL
|
||||
Dim sLayName As String = ""
|
||||
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
|
||||
EgtSetInfo( nLayId, INFO_OFFSET, m_dFiloTopOffset)
|
||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
|
||||
EgtSetInfo(nLayId, INFO_OFFSET, m_dFiloTopOffset)
|
||||
End If
|
||||
nLayId = EgtGetNextLayer(nLayId)
|
||||
End While
|
||||
@@ -102,8 +102,8 @@ Public Class FiloTopUC
|
||||
Dim nLayId As Integer = EgtGetFirstLayer(nPartId)
|
||||
While nLayId <> GDB_ID.NULL
|
||||
Dim sLayName As String = ""
|
||||
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
|
||||
EgtSetInfo( nLayId, INFO_DEPTH, m_dFiloTopDepth)
|
||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
|
||||
EgtSetInfo(nLayId, INFO_DEPTH, m_dFiloTopDepth)
|
||||
End If
|
||||
nLayId = EgtGetNextLayer(nLayId)
|
||||
End While
|
||||
@@ -215,10 +215,13 @@ Public Class FiloTopUC
|
||||
EgtErase(nLayFiloTop)
|
||||
EgtRemoveInfo(nLayId, "FiloTopRef")
|
||||
EgtOutLog("Error in generation OffsetPreView in TopEgde ")
|
||||
Else
|
||||
m_MainWindow.m_DrawPageUC.MessageTxBx.Text = ""
|
||||
m_MainWindow.m_DrawPageUC.MessageBrd.Background = Brushes.Transparent
|
||||
End If
|
||||
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
|
||||
End If
|
||||
nLayId = EgtGetNextLayer(nLayId)
|
||||
nLayId = EgtGetNextLayer(nLayId)
|
||||
End While
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
|
||||
@@ -7,55 +7,57 @@
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="ImportPage_Initialized" Loaded="ImportPage_Loaded" Unloaded="ImportPage_Unloaded">
|
||||
|
||||
<!-- Definizione della ImportPage -->
|
||||
<Border>
|
||||
<Grid Name="ImportPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<!-- Definizione della Grid superiore per Button -->
|
||||
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
|
||||
<!-- Definizione della ImportPage -->
|
||||
<Border>
|
||||
<Grid Name="ImportPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ToggleButton Name="SideAngleBtn" Grid.Column="0"
|
||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||
<ToggleButton Name="FiloTopBtn" Grid.Column="1"
|
||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||
<ToggleButton Name="DripCutBtn" Grid.Column="2" Padding="0"
|
||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||
<ToggleButton Name="DripDrillBtn" Grid.Column="3" Padding="0"
|
||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||
<Button Name="Cad2dBtn" Grid.Column="4" Padding="0"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid laterale -->
|
||||
<Grid Name="LeftGrid" Grid.RowSpan="3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="7.25*"/>
|
||||
<RowDefinition Height="0.75*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="FilePathTxBl" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
|
||||
|
||||
<!-- Definizione della Grid superiore per Button -->
|
||||
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ToggleButton Name="SideAngleBtn" Grid.Column="0"
|
||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||
<ToggleButton Name="FiloTopBtn" Grid.Column="1"
|
||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||
<ToggleButton Name="DripCutBtn" Grid.Column="2" Padding="0"
|
||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||
<ToggleButton Name="EngraveBtn" Grid.Column="2"
|
||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||
<ToggleButton Name="DripDrillBtn" Grid.Column="3" Padding="0"
|
||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||
<Button Name="Cad2dBtn" Grid.Column="4" Padding="0"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid laterale -->
|
||||
<Grid Name="LeftGrid" Grid.RowSpan="3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="7.25*"/>
|
||||
<RowDefinition Height="0.75*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="FilePathTxBl" Foreground="White" Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
|
||||
ItemsSource="{Binding ItemList}"/>
|
||||
|
||||
<Grid Name="FinderGrd" Grid.Row="3" Margin="0,0,8,0">
|
||||
@@ -68,68 +70,68 @@
|
||||
<Button Name="ClearFindBtn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Margin="0,6,2,6">
|
||||
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}" Width="30" />
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<Border Name="MessageBrd" Grid.Row="5" BorderThickness="0,1,0,0" BorderBrush="Gray">
|
||||
<TextBlock Name="MessageTxBx" TextAlignment="Center"
|
||||
</Grid>
|
||||
|
||||
<Border Name="MessageBrd" Grid.Row="5" BorderThickness="0,1,0,0" BorderBrush="Gray">
|
||||
<TextBlock Name="MessageTxBx" TextAlignment="Center"
|
||||
Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</Border>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid inferiore per Button -->
|
||||
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="UseLayerBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="UseClosedCurveBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="UseRegionBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="ResetBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
<RadioButton Name="mmBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
||||
<RadioButton Name="inchBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
||||
|
||||
<Button Name="OrderListBtn" Grid.Column="6" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
<ToggleButton Name="TopBtn" Grid.Column="7" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
||||
|
||||
<Grid Name="PartNumberGrd" Grid.Column="8" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Name="PartNumTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"
|
||||
TextAlignment="Right"/>
|
||||
<EgtWPFLib:EgtTextBox Name="PartNumTxBx" Grid.Column="1" Width="60" IsLength="False"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
</Grid>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="10" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<!-- Definizione della Grid inferiore per Button -->
|
||||
<Grid Name="LowerButtonGrid" Grid.Column="1" Grid.Row="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="UseLayerBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="UseClosedCurveBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="UseRegionBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="ResetBtn" Grid.Column="3" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
<RadioButton Name="mmBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
||||
<RadioButton Name="inchBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
||||
|
||||
<Button Name="OrderListBtn" Grid.Column="6" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
<ToggleButton Name="TopBtn" Grid.Column="7" Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
||||
|
||||
<Grid Name="PartNumberGrd" Grid.Column="8" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Name="PartNumTxBl" Grid.Column="0" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"
|
||||
TextAlignment="Right"/>
|
||||
<EgtWPFLib:EgtTextBox Name="PartNumTxBx" Grid.Column="1" Width="60" IsLength="False"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
</Grid>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="10" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
<Button Name="ExitBtn" Grid.Column="11" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
<Button Name="ExitBtn" Grid.Column="11" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -38,6 +38,8 @@ Public Class ImportPageUC
|
||||
Private Const FT_TRF As Integer = 51
|
||||
' Costante per formato CUT
|
||||
Private Const FT_CUT As Integer = 52
|
||||
' Indice del parcheggio corrente
|
||||
Private NewParkInd As Integer = 0
|
||||
|
||||
' Indentificativo del pezzo selezionato
|
||||
Private m_nSelectedPart As Integer = GDB_ID.NULL
|
||||
@@ -82,12 +84,13 @@ Public Class ImportPageUC
|
||||
ResetBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 3) 'Reset
|
||||
mmBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 4) 'mm
|
||||
inchBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 5) 'inch
|
||||
OrderListBtn.Content = EgtMsg( 90398) 'Dati Csv
|
||||
TopBtn.Content = EgtMsg( 90384) 'Indica Lato Sopra
|
||||
OrderListBtn.Content = EgtMsg(90398) 'Dati Csv
|
||||
TopBtn.Content = EgtMsg(90384) 'Indica Lato Sopra
|
||||
PartNumTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 15) 'Numero
|
||||
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
|
||||
EngraveBtn.Content = "Engrave"
|
||||
DripDrillBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 14) 'Foro da sotto
|
||||
Cad2dBtn.Content = "Cad 2d"
|
||||
|
||||
@@ -97,7 +100,6 @@ Public Class ImportPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub ImportPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
' abilitazione importazione TRF
|
||||
m_bEnableTrf = (m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut And
|
||||
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.TRF_IMPORT))
|
||||
@@ -159,10 +161,14 @@ Public Class ImportPageUC
|
||||
' Verifico esistenza Cad 2d
|
||||
GetPrivateProfileString(S_CAD2D, K_CAD2D_NAME, "", m_sCad2dName, 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
|
||||
ClearView()
|
||||
' Definizione di quale comando deve essere visualizzato
|
||||
DripCutBtn.Visibility = If(String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw), Visibility.Hidden, Visibility.Visible)
|
||||
EngraveBtn.Visibility = If(DripCutBtn.Visibility <> Visibility.Visible, Visibility.Visible, Visibility.Hidden)
|
||||
|
||||
FileListBox.UnselectAll()
|
||||
' inibisco selezione diretta da Scene
|
||||
ImportScene.SetStatusNull()
|
||||
@@ -174,7 +180,7 @@ Public Class ImportPageUC
|
||||
UseClosedCurveBtn.Visibility = Windows.Visibility.Visible
|
||||
ResetBtn.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
|
||||
PartNumberGrd.Visibility = Windows.Visibility.Visible
|
||||
Else
|
||||
@@ -184,7 +190,7 @@ Public Class ImportPageUC
|
||||
ResetBtn.Visibility = Windows.Visibility.Hidden
|
||||
SideAngleBtn.Visibility = Windows.Visibility.Hidden
|
||||
OrderListBtn.Visibility = Windows.Visibility.Hidden
|
||||
TopBtn.Visibility = Windows.Visibility.Hidden
|
||||
TopBtn.Visibility = Windows.Visibility.Hidden
|
||||
PartNumberGrd.Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
mmBtn.IsEnabled = True
|
||||
@@ -201,6 +207,8 @@ Public Class ImportPageUC
|
||||
PartNumTxBx.Text = "1"
|
||||
' disabilito ok
|
||||
OkBtn.IsEnabled = False
|
||||
' Azzero l'idice di parcheggio
|
||||
NewParkInd = 0
|
||||
End Sub
|
||||
|
||||
Private Sub LoadGridData()
|
||||
@@ -343,7 +351,12 @@ Public Class ImportPageUC
|
||||
ResetBtn.IsEnabled = False
|
||||
SideAngleBtn.IsEnabled = False
|
||||
FiloTopBtn.IsEnabled = False
|
||||
DripCutBtn.IsEnabled = False
|
||||
' Evito di settare le proprietà di oggeti che sono con visibilità Hidden
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = False
|
||||
Else
|
||||
EngraveBtn.IsEnabled = False
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = False
|
||||
Return True
|
||||
End Function
|
||||
@@ -361,6 +374,10 @@ Public Class ImportPageUC
|
||||
Dim dScale As Double = If(m_bMM, ONEMM, ONEINCH)
|
||||
' Importo file DXF
|
||||
bOk = bOk AndAlso EgtImportDxf(sPath, dScale)
|
||||
' riporto al piano tutte le superifici
|
||||
EgtSelectAll()
|
||||
EgtScale(GDB_ID.SEL, Frame3d.GLOB, 1, 1, 0)
|
||||
EgtDeselectAll()
|
||||
ElseIf m_nFileType = FT.NGE Then
|
||||
' Carico Nge
|
||||
bOk = bOk AndAlso EgtOpenFile(sPath)
|
||||
@@ -400,7 +417,11 @@ Public Class ImportPageUC
|
||||
OkBtn.IsEnabled = False
|
||||
SideAngleBtn.IsEnabled = False
|
||||
FiloTopBtn.IsEnabled = False
|
||||
DripCutBtn.IsEnabled = False
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = False
|
||||
Else
|
||||
EngraveBtn.IsEnabled = False
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = False
|
||||
ElseIf m_nFileType = FT_TRF Or m_nFileType = FT_CUT Then
|
||||
' abilito bottone Insert, disabilito bottoni UseLayer, UseClosedCurve, UseRegion e Reset
|
||||
@@ -416,7 +437,11 @@ Public Class ImportPageUC
|
||||
OkBtn.IsEnabled = True
|
||||
SideAngleBtn.IsEnabled = False
|
||||
FiloTopBtn.IsEnabled = False
|
||||
DripCutBtn.IsEnabled = False
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = False
|
||||
Else
|
||||
EngraveBtn.IsEnabled = False
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = False
|
||||
End If
|
||||
' altrimenti import per cornici
|
||||
@@ -429,12 +454,12 @@ Public Class ImportPageUC
|
||||
End Function
|
||||
|
||||
Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ImportScene.OnMouseDownScene
|
||||
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Then
|
||||
OnMouseDownSceneSideAngle( e)
|
||||
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Or EngraveBtn.IsChecked Then
|
||||
OnMouseDownSceneSideAngle(e)
|
||||
ElseIf DripDrillBtn.IsChecked() Then
|
||||
OnMouseDownSceneUnderDrill( e)
|
||||
OnMouseDownSceneUnderDrill(e)
|
||||
ElseIf FiloTopBtn.IsChecked() Then
|
||||
OnMouseDownSceneFiloTop( e)
|
||||
OnMouseDownSceneFiloTop(e)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -564,14 +589,14 @@ Public Class ImportPageUC
|
||||
EgtDeselectObj(nId)
|
||||
EgtDeselectObj(nLayId)
|
||||
Dim sLayName As String = ""
|
||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo( nLayId, INFO_FILOTOP) Then
|
||||
EgtRemoveInfo( nLayId, INFO_FILOTOP)
|
||||
EgtRemoveInfo( nLayId, INFO_OFFSET)
|
||||
EgtRemoveInfo( nLayId, INFO_DEPTH)
|
||||
Dim nEntId As Integer = EgtGetFirstInGroup( nLayId)
|
||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP AndAlso EgtExistsInfo(nLayId, INFO_FILOTOP) Then
|
||||
EgtRemoveInfo(nLayId, INFO_FILOTOP)
|
||||
EgtRemoveInfo(nLayId, INFO_OFFSET)
|
||||
EgtRemoveInfo(nLayId, INFO_DEPTH)
|
||||
Dim nEntId As Integer = EgtGetFirstInGroup(nLayId)
|
||||
While nEntId <> GDB_ID.NULL
|
||||
EgtSetColor(nEntId, New Color3d(127, 63, 0))
|
||||
nEntId = EgtGetNext( nEntId)
|
||||
nEntId = EgtGetNext(nEntId)
|
||||
End While
|
||||
m_DeselectListHole.Add(nLayId)
|
||||
m_SelListHole.Remove(nLayId)
|
||||
@@ -580,16 +605,16 @@ Public Class ImportPageUC
|
||||
Dim nLayId As Integer = GDB_ID.NULL
|
||||
EgtGetInfo(nId, "ID", nLayId)
|
||||
Dim sLayName As String = ""
|
||||
If EgtGetName( nLayId, sLayName) AndAlso sLayName = NAME_INLOOP Then
|
||||
EgtSelectObj( nId)
|
||||
EgtSelectObj( nLayId)
|
||||
EgtSetInfo( nLayId, INFO_FILOTOP, 1)
|
||||
EgtSetInfo( nLayId, INFO_OFFSET, m_FiloTopUC.FiloTopOffset)
|
||||
EgtSetInfo( nLayId, INFO_DEPTH, m_FiloTopUC.FiloTopDepth)
|
||||
Dim nEntId As Integer = EgtGetFirstInGroup( nLayId)
|
||||
If EgtGetName(nLayId, sLayName) AndAlso sLayName = NAME_INLOOP Then
|
||||
EgtSelectObj(nId)
|
||||
EgtSelectObj(nLayId)
|
||||
EgtSetInfo(nLayId, INFO_FILOTOP, 1)
|
||||
EgtSetInfo(nLayId, INFO_OFFSET, m_FiloTopUC.FiloTopOffset)
|
||||
EgtSetInfo(nLayId, INFO_DEPTH, m_FiloTopUC.FiloTopDepth)
|
||||
Dim nEntId As Integer = EgtGetFirstInGroup(nLayId)
|
||||
While nEntId <> GDB_ID.NULL
|
||||
EgtSetColor(nEntId, New Color3d(255, 255, 255))
|
||||
nEntId = EgtGetNext( nEntId)
|
||||
nEntId = EgtGetNext(nEntId)
|
||||
End While
|
||||
m_SelListHole.Add(nLayId)
|
||||
m_DeselectListHole.Remove(nLayId)
|
||||
@@ -615,7 +640,7 @@ Public Class ImportPageUC
|
||||
|
||||
Private Sub SelectedPartChanged()
|
||||
' Se sono in modalità inclinazioni o gocciolatoio calcolo lati inclinabili e creo testi
|
||||
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Then
|
||||
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Or EngraveBtn.IsChecked() Then
|
||||
m_SideAngleUC.ReLoadSideAnglePage()
|
||||
End If
|
||||
End Sub
|
||||
@@ -638,7 +663,7 @@ Public Class ImportPageUC
|
||||
' Ciclo sulle regioni
|
||||
Dim EntId As Integer = EgtGetFirstInGroup(RegionId)
|
||||
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)
|
||||
End While
|
||||
RegionId = EgtGetNextName(PartId, NAME_REGION)
|
||||
@@ -676,8 +701,12 @@ Public Class ImportPageUC
|
||||
' abilito bottone angoli su lati esterni
|
||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
||||
Else
|
||||
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||
End Sub
|
||||
@@ -708,8 +737,12 @@ Public Class ImportPageUC
|
||||
' abilito bottone angoli su lati esterni
|
||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
||||
Else
|
||||
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||
End Sub
|
||||
@@ -740,8 +773,12 @@ Public Class ImportPageUC
|
||||
' abilito bottone angoli su lati esterni
|
||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
||||
Else
|
||||
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||
End Sub
|
||||
@@ -822,20 +859,38 @@ Public Class ImportPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub OrderListBtn_Click(sender As Object, e As RoutedEventArgs) Handles OrderListBtn.Click
|
||||
Dim DlgOrderList As New CompoCsvData( m_MainWindow)
|
||||
DlgOrderList.SetData( m_sOrder, m_sList)
|
||||
Dim DlgOrderList As New CompoCsvData(m_MainWindow)
|
||||
DlgOrderList.SetData(m_sOrder, m_sList)
|
||||
If DlgOrderList.ShowDialog() Then
|
||||
DlgOrderList.GetData( m_sOrder, m_sList)
|
||||
DlgOrderList.GetData(m_sOrder, m_sList)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
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
|
||||
If m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut Then
|
||||
' Eseguo importazione pezzi piatti
|
||||
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
|
||||
LoadFrame()
|
||||
End If
|
||||
@@ -845,6 +900,80 @@ Public Class ImportPageUC
|
||||
m_MainWindow.m_ActivePage = m_MainWindow.m_PrevActivePage
|
||||
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()
|
||||
' Cancello regioni di selezione dai pezzi
|
||||
Dim PartId As Integer = EgtGetFirstPart()
|
||||
@@ -917,21 +1046,37 @@ Public Class ImportPageUC
|
||||
If My.Computer.FileSystem.FileExists(sTmpFile) Then
|
||||
My.Computer.FileSystem.DeleteFile(sTmpFile)
|
||||
End If
|
||||
|
||||
' Calcolo l'area dei pezzi inseriti
|
||||
Dim dNewArea As Double = 0
|
||||
Dim nId As Integer = nFirstId
|
||||
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)
|
||||
' Passo al pezzo successivo
|
||||
nId = EgtGetNextPart(nId)
|
||||
End While
|
||||
' Nascondo tutti i pezzi inseriti (per evitare interferenze con pezzi in fase di parcheggio)
|
||||
nId = nFirstId
|
||||
Dim GlobBBox As New BBox3d
|
||||
While nId <> GDB_ID.NULL
|
||||
Dim bboxTemp As New BBox3d
|
||||
EgtGetBBox(nId, 0, bboxTemp)
|
||||
GlobBBox.Add(bboxTemp)
|
||||
EgtSetStatus(nId, GDB_ST.OFF)
|
||||
' Passo al pezzo successivo
|
||||
nId = EgtGetNextPart(nId)
|
||||
End While
|
||||
Dim DimX As Double = GlobBBox.DimX
|
||||
Dim DimY As Double = GlobBBox.DimY
|
||||
Dim BBoxMaxPt As Point3d = GlobBBox.Max
|
||||
|
||||
' Ciclo sui pezzi inseriti
|
||||
nId = nFirstId
|
||||
@@ -968,7 +1113,12 @@ Public Class ImportPageUC
|
||||
' Imposto path di provenienza
|
||||
EgtSetInfo(nId, INFO_SOU_PATH, IO.Path.Combine(m_sCurrDir, m_sCurrFile))
|
||||
' 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, DimX, DimY, BBoxMaxPt)
|
||||
Else
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId, True)
|
||||
End If
|
||||
' Recupero Id di pezzo successivo
|
||||
Dim nNextId As Integer = EgtGetNextPart(nId)
|
||||
' Se richiesto posizionamento diretto, lo eseguo
|
||||
@@ -1025,22 +1175,24 @@ Public Class ImportPageUC
|
||||
' Salvo direttorio corrente
|
||||
WritePrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, m_sCurrDir, m_MainWindow.GetIniFile())
|
||||
' Tolgo pagina inclinazioni/gocciolatoi se attiva
|
||||
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Then
|
||||
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Or EngraveBtn.IsChecked() Then
|
||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||
FileListBox.Visibility = Windows.Visibility.Visible
|
||||
LeftGrid.Children.Remove(m_SideAngleUC)
|
||||
If SideAngleBtn.IsChecked() Then
|
||||
SideAngleBtn.IsChecked = False
|
||||
ElseIf EngraveBtn.IsChecked() Then
|
||||
EngraveBtn.IsChecked = False
|
||||
Else
|
||||
DripCutBtn.IsChecked() = False
|
||||
End If
|
||||
' Tolgo pagina fori da sotto se attiva
|
||||
' Tolgo pagina fori da sotto se attiva
|
||||
ElseIf DripDrillBtn.IsChecked() Then
|
||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||
FileListBox.Visibility = Windows.Visibility.Visible
|
||||
LeftGrid.Children.Remove(m_UnderDrillUC)
|
||||
DripDrillBtn.IsChecked() = False
|
||||
' Tolgo pagina Filo Top se attiva
|
||||
' Tolgo pagina Filo Top se attiva
|
||||
ElseIf FiloTopBtn.IsChecked() Then
|
||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||
FileListBox.Visibility = Windows.Visibility.Visible
|
||||
@@ -1067,7 +1219,11 @@ Public Class ImportPageUC
|
||||
FileListBox.Visibility = Windows.Visibility.Hidden
|
||||
' Disabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
|
||||
FiloTopBtn.IsEnabled = False
|
||||
DripCutBtn.IsEnabled = False
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = False
|
||||
Else
|
||||
EngraveBtn.IsEnabled = False
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = False
|
||||
mmBtn.IsEnabled = False
|
||||
inchBtn.IsEnabled = False
|
||||
@@ -1089,8 +1245,72 @@ Public Class ImportPageUC
|
||||
EgtDeselectAll()
|
||||
' Riabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
|
||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
||||
Else
|
||||
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||
mmBtn.IsEnabled = True
|
||||
inchBtn.IsEnabled = True
|
||||
' Elimino scritte angoli per input e inserisco quelle definitive
|
||||
SideAngle.WriteSideAngleForNest(ImportScene.GetCtx())
|
||||
' Riabilito bottone reset
|
||||
ResetBtn.IsEnabled = True
|
||||
' Pulisco area messaggi
|
||||
MessageTxBx.Text = ""
|
||||
MessageBrd.Background = Brushes.Transparent
|
||||
End If
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
Private Sub EngraveBtn_Click(sender As Object, e As RoutedEventArgs) Handles EngraveBtn.Click
|
||||
If EngraveBtn.IsChecked() Then
|
||||
FinderGrd.Visibility = Visibility.Hidden
|
||||
' Aggiungo regioni per percorsi interni
|
||||
AdjustSelectRegions()
|
||||
' Dichiaro nessuna selezione
|
||||
m_nSelectedPart = GDB_ID.NULL
|
||||
m_nSelectedLayer = GDB_ID.NULL
|
||||
' Imposto modalità sideangle
|
||||
m_SideAngleUC.m_Mode = SideAngleUC.ModeOpt.ENGRAVE
|
||||
LeftGrid.Children.Add(m_SideAngleUC)
|
||||
FilePathTxBl.Visibility = Windows.Visibility.Hidden
|
||||
FileListBox.Visibility = Windows.Visibility.Hidden
|
||||
' Disabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
|
||||
SideAngleBtn.IsEnabled = False
|
||||
FiloTopBtn.IsEnabled = False
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = False
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = False
|
||||
mmBtn.IsEnabled = False
|
||||
inchBtn.IsEnabled = False
|
||||
' Disabilito bottone reset
|
||||
ResetBtn.IsEnabled = False
|
||||
' Messaggio di selezione da effettuare
|
||||
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
|
||||
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
||||
Else
|
||||
FinderGrd.Visibility = Visibility.Visible
|
||||
' Rimuovo regioni per percorsi interni
|
||||
RemoveSelectRegions()
|
||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||
FileListBox.Visibility = Windows.Visibility.Visible
|
||||
LeftGrid.Children.Remove(m_SideAngleUC)
|
||||
' Deseleziono eventuali pezzi rimasti selezionati
|
||||
m_nSelectedPart = GDB_ID.NULL
|
||||
m_nSelectedLayer = GDB_ID.NULL
|
||||
EgtDeselectAll()
|
||||
' Riabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
|
||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||
mmBtn.IsEnabled = True
|
||||
@@ -1120,6 +1340,9 @@ Public Class ImportPageUC
|
||||
' Disabilito SideAngleBtn,FiloTop, DripDrillBtn e unità di misura
|
||||
SideAngleBtn.IsEnabled = False
|
||||
FiloTopBtn.IsEnabled = False
|
||||
If DripCutBtn.Visibility <> Visibility.Visible Then
|
||||
EngraveBtn.IsEnabled = False
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = False
|
||||
mmBtn.IsEnabled = False
|
||||
inchBtn.IsEnabled = False
|
||||
@@ -1140,8 +1363,9 @@ Public Class ImportPageUC
|
||||
' Riabilito SideAngleBtn, FiloTop, DripDrillBtn e unità di misura
|
||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||
If DripCutBtn.Visibility <> Visibility.Visible Then
|
||||
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
End If
|
||||
mmBtn.IsEnabled = True
|
||||
inchBtn.IsEnabled = True
|
||||
' Elimino scritte angoli per input e inserisco quelle definitive
|
||||
@@ -1170,7 +1394,11 @@ Public Class ImportPageUC
|
||||
' Disabilito SideAngleBtn, FiloTop, DripCutBtn e unità di misura
|
||||
SideAngleBtn.IsEnabled = False
|
||||
FiloTopBtn.IsEnabled = False
|
||||
DripCutBtn.IsEnabled = False
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = False
|
||||
Else
|
||||
EngraveBtn.IsEnabled = False
|
||||
End If
|
||||
mmBtn.IsEnabled = False
|
||||
inchBtn.IsEnabled = False
|
||||
' Disabilito bottone reset
|
||||
@@ -1192,8 +1420,12 @@ Public Class ImportPageUC
|
||||
' Riabilito SideAngleBtn, FiloTop, DripCutBtn e unità di misura
|
||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
||||
Else
|
||||
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
End If
|
||||
mmBtn.IsEnabled = True
|
||||
inchBtn.IsEnabled = True
|
||||
' Riabilito bottone reset
|
||||
@@ -1219,7 +1451,11 @@ Public Class ImportPageUC
|
||||
FileListBox.Visibility = Windows.Visibility.Hidden
|
||||
' Disabilito SideAngleBtn, DripCutBtn, DripDrillBtn e unità di misura
|
||||
SideAngleBtn.IsEnabled = False
|
||||
DripCutBtn.IsEnabled = False
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = False
|
||||
Else
|
||||
EngraveBtn.IsEnabled = False
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = False
|
||||
mmBtn.IsEnabled = False
|
||||
inchBtn.IsEnabled = False
|
||||
@@ -1241,8 +1477,12 @@ Public Class ImportPageUC
|
||||
EgtDeselectAll()
|
||||
' Riabilito SideAngleBtn, DripCutBtn, DripDrillBtn e unità di misura
|
||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
||||
Else
|
||||
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||
End If
|
||||
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||
mmBtn.IsEnabled = True
|
||||
@@ -1301,8 +1541,9 @@ Public Class ImportPageUC
|
||||
If nType = GDB_TY.CRV_LINE Or nType = GDB_TY.CRV_ARC Or nType = GDB_TY.CRV_COMPO Then
|
||||
vCrvId.Add(nCrvId)
|
||||
End If
|
||||
ElseIf DripDrillBtn.IsChecked
|
||||
if nType = GDB_TY.CRV_ARC
|
||||
ElseIf DripDrillBtn.IsChecked Then
|
||||
|
||||
If nType = GDB_TY.CRV_ARC Then
|
||||
vCrvId.Add(nCrvId)
|
||||
End If
|
||||
End If
|
||||
@@ -1328,11 +1569,11 @@ Public Class ImportPageUC
|
||||
|
||||
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
|
||||
ShowWindow( ProcsCad2d(0).MainWindowHandle, 3)
|
||||
ShowWindow(ProcsCad2d(0).MainWindowHandle, 3)
|
||||
Else
|
||||
Process.Start( m_sCad2dPath)
|
||||
Process.Start(m_sCad2dPath)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -1341,42 +1582,42 @@ End Class
|
||||
|
||||
Public Class IconListBoxItem
|
||||
|
||||
Private m_iPictureID As Integer
|
||||
Private m_sName As String
|
||||
Private m_iPictureID As Integer
|
||||
Private m_sName As String
|
||||
|
||||
Public Property PictureID() As Integer
|
||||
Get
|
||||
Return m_iPictureID
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_iPictureID = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property PictureID() As Integer
|
||||
Get
|
||||
Return m_iPictureID
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_iPictureID = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property Name() As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
Public Property Name() As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PictureString() As String
|
||||
Get
|
||||
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property PictureString() As String
|
||||
Get
|
||||
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New()
|
||||
Me.Name = String.Empty
|
||||
Me.PictureID = 0
|
||||
End Sub
|
||||
Sub New()
|
||||
Me.Name = String.Empty
|
||||
Me.PictureID = 0
|
||||
End Sub
|
||||
|
||||
Sub New(Name As String, PictureID As Integer)
|
||||
Me.Name = Name
|
||||
Me.PictureID = PictureID
|
||||
End Sub
|
||||
Sub New(Name As String, PictureID As Integer)
|
||||
Me.Name = Name
|
||||
Me.PictureID = PictureID
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
@@ -33,10 +33,26 @@ Public Class MainComponentPageUC
|
||||
m_bIsFirstPage = True
|
||||
LoadPage()
|
||||
CurrentBtn = Nothing
|
||||
Compo9.SetValue(Grid.ColumnProperty, 0)
|
||||
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
||||
LabelCompo9.Visibility = Windows.Visibility.Visible
|
||||
If m_MainWindow.FrameCutBtn.IsChecked Then
|
||||
' se il numero delle componenti è superiore a 8 allora inserisco la seconda pagina
|
||||
If GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 8 Then
|
||||
OthersBackGr.Visibility = Visibility.Visible
|
||||
Compo9.SetValue(Grid.ColumnProperty, 0)
|
||||
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
||||
LabelCompo9.Visibility = Windows.Visibility.Visible
|
||||
Else
|
||||
OthersBackGr.Visibility = Visibility.Hidden
|
||||
End If
|
||||
Else
|
||||
OthersBackGr.Visibility = Visibility.Visible
|
||||
Compo9.SetValue(Grid.ColumnProperty, 0)
|
||||
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
||||
LabelCompo9.Visibility = Windows.Visibility.Visible
|
||||
End If
|
||||
|
||||
|
||||
m_MainWindow.m_DrawPageUC.SideAngleBtn.IsEnabled = False
|
||||
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
|
||||
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
|
||||
|
||||
@@ -123,10 +123,19 @@
|
||||
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="OffsXInteryTxBl" Grid.Row="5" Grid.ColumnSpan="2"
|
||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="OffsXInteryTxBx" Grid.Column="2" Grid.Row="5" Width="50"
|
||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||
<Grid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<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" >
|
||||
<Button Name="MirrorPartBtn"
|
||||
|
||||
@@ -54,6 +54,8 @@ Public Class FrameCutPageUC
|
||||
OffsYyTxBx.Text = LenToString(dOffsYY, 3)
|
||||
Dim dOffsXInterY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSXINTERY, 5, m_MainWindow.GetIniFile())
|
||||
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
|
||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
|
||||
@@ -73,6 +75,17 @@ Public Class FrameCutPageUC
|
||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
||||
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
|
||||
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
|
||||
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
|
||||
|
||||
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
@@ -280,7 +293,7 @@ Public Class FrameCutPageUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed, 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
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
||||
' Parcheggio pezzi presenti nel grezzo
|
||||
@@ -312,6 +325,11 @@ Public Class FrameCutPageUC
|
||||
If StringToLen(OffsXInteryTxBx.Text, dOffsXIntery) Then
|
||||
WritePrivateProfileString(S_FRAME, K_OFFSXINTERY, DoubleToString(dOffsXIntery, 3), m_MainWindow.GetIniFile())
|
||||
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
|
||||
|
||||
Private Sub MirrorPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles MirrorPartBtn.Click
|
||||
@@ -963,11 +981,22 @@ Public Class FrameCutPageUC
|
||||
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
|
||||
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 = dOffsXIntery + 5 * EPS_SMALL
|
||||
dMinDist = dSawThick + 5 * EPS_SMALL
|
||||
End If
|
||||
'If dOffsXIntery <= dSawThick Then
|
||||
' dMinDist = dSawThick + 5 * EPS_SMALL
|
||||
' EgtOutLog("WARNINGS: Saw tickness is more width then interaxis")
|
||||
'Else
|
||||
' dMinDist = dOffsXIntery + 5 * EPS_SMALL
|
||||
'End If
|
||||
Else
|
||||
EgtOutLog("Not found current saw for frames mindist")
|
||||
dMinDist = dOffsXIntery
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<Window x:Class="LicenseWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
FontFamily="{DynamicResource OmagCut_Font}"
|
||||
Title="OpenFile" Height="587.4" Width="500.6" WindowStyle="None"
|
||||
ResizeMode="NoResize" ShowInTaskbar="False" AllowsTransparency="True"
|
||||
Background="Transparent">
|
||||
<Border Style="{DynamicResource OmagCut_Border}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.2*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="0.2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="5.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3"
|
||||
Orientation="Horizontal"
|
||||
HorizontalAlignment="Center">
|
||||
<TextBlock Name="IconTxBl" Foreground="White" FontSize="32"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
<TextBlock Name="LicenseTxBl"
|
||||
Foreground="White" FontSize="20"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||
TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal"
|
||||
HorizontalAlignment="Center">
|
||||
<ScrollViewer Name="MyScrollViewer" VerticalScrollBarVisibility="Auto">
|
||||
<TextBlock Name="LicenseMsgTxBl" MaxWidth="425"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="{DynamicResource Omag_White}" FontSize="20" VerticalAlignment="Center"
|
||||
TextWrapping="Wrap"/>
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="1" Grid.Row="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}" IsCancel="True">
|
||||
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
</Window>
|
||||
@@ -0,0 +1,37 @@
|
||||
Public Class LicenseWindow
|
||||
|
||||
Private m_sMessage As String = String.Empty
|
||||
Private m_sTitle As String = String.Empty
|
||||
|
||||
Public Sub New(Owner As Window, sMsg As String, sTitle As String)
|
||||
Me.Owner = Owner
|
||||
m_sMessage = sMsg
|
||||
m_sTitle = sTitle
|
||||
|
||||
' La chiamata è richiesta dalla finestra di progettazione.
|
||||
InitializeComponent()
|
||||
|
||||
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub Init() Handles Me.Initialized
|
||||
IconTxBl.Text = "⚠️"
|
||||
LicenseTxBl.Text = m_sTitle
|
||||
m_sMessage = m_sMessage.Replace("/n", "£")
|
||||
Dim sItems As String() = m_sMessage.Split("£")
|
||||
For Index As Integer = 0 To sItems.Count - 1
|
||||
If Index = 0 Then
|
||||
m_sMessage = sItems(Index)
|
||||
Else
|
||||
m_sMessage &= vbCrLf & sItems(Index)
|
||||
End If
|
||||
Next
|
||||
LicenseMsgTxBl.Text = m_sMessage
|
||||
End Sub
|
||||
|
||||
Public Sub Exit_Click() Handles ExitBtn.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -1193,6 +1193,7 @@ Public Class AlarmsPageUC
|
||||
Dim dToolDiam As Double = 0
|
||||
Dim dToolThick As Double = 0
|
||||
Dim dToolLen As Double = 0
|
||||
Dim dCore As Double = 0
|
||||
Dim sToolParam As String = String.Empty
|
||||
EgtTdbGetCurrToolParam(MCH_TP.HEAD, sToolParam)
|
||||
EgtLuaSetGlobStringVar("CMD.HEAD", sToolParam)
|
||||
@@ -1204,6 +1205,8 @@ Public Class AlarmsPageUC
|
||||
EgtLuaSetGlobNumVar("CMD.THICK", dToolThick * 1000)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.LEN, dToolLen)
|
||||
EgtLuaSetGlobNumVar("CMD.LENGTH", dToolLen * 1000)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.CORE, dCore)
|
||||
EgtLuaSetGlobNumVar("CMD.CORE", dCore * 1000)
|
||||
' Nuova varibile per gestione tastatura utensili Frankfurt (Polishing)
|
||||
Dim nType As Integer
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
|
||||
@@ -1262,7 +1265,7 @@ Public Class AlarmsPageUC
|
||||
System.Threading.Thread.Sleep(300)
|
||||
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
||||
' Creo MsgBox di attesa
|
||||
Dim MsgBoxStateInfo As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_DIRECTCUTPAGEUC + 41), EgtMsg(MSG_DIRECTCUTPAGEUC + 42), True, EgtMsgBox.Buttons.CANCEL, EgtMsgBox.Icons.NULL)
|
||||
Dim MsgBoxStateInfo As New EgtMsgBox(m_MainWindow, String.Format(EgtMsg(MSG_DIRECTCUTPAGEUC + 41), ToolForProbing.m_ToolName), EgtMsg(MSG_DIRECTCUTPAGEUC + 42), True, EgtMsgBox.Buttons.CANCEL, EgtMsgBox.Icons.NULL)
|
||||
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||
' Definisco flag tastatura
|
||||
Dim bProbingOk As Boolean = False
|
||||
|
||||
@@ -139,6 +139,8 @@ Public Class CurrentMachine
|
||||
Private m_dPhotoOffsetY As Double = 0
|
||||
Private m_dTab2PhotoOffsetX As Double = 0
|
||||
Private m_dTab2PhotoOffsetY As Double = 0
|
||||
Private m_dHQPhotoOffsetX As Double = 0
|
||||
Private m_dHQPhotoOffsetY As Double = 0
|
||||
|
||||
' Abilitazione scelta restart
|
||||
Private m_bEnableRestart As Boolean = False
|
||||
@@ -202,6 +204,9 @@ Public Class CurrentMachine
|
||||
' Massima profondità lavorabile nei tagli diretti
|
||||
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"
|
||||
Friend ReadOnly Property MaxTabDepth As Double
|
||||
Get
|
||||
@@ -764,6 +769,10 @@ Public Class CurrentMachine
|
||||
Set(value As String)
|
||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRWATERJETTING, value, sMachIniFile) Then
|
||||
m_sCurrWaterJetting = value
|
||||
If m_MainWindow.m_CurrentMachine.bWaterJet And EgtGetHeadId("H1") = GDB_ID.NULL Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.MachiningTxBx.Text = value
|
||||
End If
|
||||
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
@@ -860,6 +869,10 @@ Public Class CurrentMachine
|
||||
Case 2
|
||||
Return New Vector3d(m_dTab2PhotoOffsetX, m_dTab2PhotoOffsetY, 0)
|
||||
Case Else
|
||||
' verifico quale delle due fotocamere è attualmente attiva
|
||||
If GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
|
||||
Return New Vector3d(m_dHQPhotoOffsetX, m_dHQPhotoOffsetY, 0)
|
||||
End If
|
||||
Return New Vector3d(m_dPhotoOffsetX, m_dPhotoOffsetY, 0)
|
||||
End Select
|
||||
End Get
|
||||
@@ -1139,6 +1152,12 @@ Public Class CurrentMachine
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property dHighPieceZ As Double
|
||||
Get
|
||||
Return m_dHighPieceZ
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
Sub New()
|
||||
@@ -1332,6 +1351,8 @@ Public Class CurrentMachine
|
||||
m_dPhotoOffsetY = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_OFFSETY, 0, sMachIniFile)
|
||||
m_dTab2PhotoOffsetX = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_TAB2_OFFSETX, 0, sMachIniFile)
|
||||
m_dTab2PhotoOffsetY = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_TAB2_OFFSETY, 0, sMachIniFile)
|
||||
m_dHQPhotoOffsetX = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_HQ_OFFSETX, 0, sMachIniFile)
|
||||
m_dHQPhotoOffsetY = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_HQ_OFFSETY, 0, sMachIniFile)
|
||||
|
||||
' Leggo abilitazione per restart
|
||||
m_bEnableRestart = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENABLERESTART, 0, sMachIniFile) <> 0)
|
||||
@@ -1405,6 +1426,9 @@ Public Class CurrentMachine
|
||||
If m_MaxTabDepth < 0 Then
|
||||
m_MaxTabDepth = 10.0
|
||||
End If
|
||||
|
||||
' Massimo spessore lavorabile con lama grande
|
||||
m_dHighPieceZ = GetPrivateProfileDouble(S_RAWMOVE, "MaxHeightPiece", 800.0, m_MainWindow.GetMachIniFile())
|
||||
End Sub
|
||||
|
||||
' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili
|
||||
@@ -1650,7 +1674,9 @@ Public Class CurrentMachine
|
||||
Dim dToolDiam As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam)
|
||||
' Confronto con massimo ammesso
|
||||
Return (dToolDiam <= dMaxSawDiamForProbe)
|
||||
Dim bOk As Boolean = dToolDiam <= dMaxSawDiamForProbe
|
||||
If Not bOk Then EgtOutLog("WARNING: Saw diameter to big for probing")
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
Friend Function GetPrivateProfileMaterial(
|
||||
|
||||
@@ -298,6 +298,8 @@ Public Class MachinePageUC
|
||||
WaterJetBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_WaterJetPageUC)
|
||||
MachinePageGrid.Children.Add(m_MachiningDbPageUC)
|
||||
' Aggiorno lista materiali
|
||||
m_MainWindow.m_CurrentMachine.LoadWJMaterial()
|
||||
m_ActiveMachinePage = MachinePages.MachiningDb
|
||||
Case MachinePages.MachineCN
|
||||
MachiningDBBtn.IsChecked = True
|
||||
|
||||
@@ -279,12 +279,16 @@ Public Class MachineStatusUC
|
||||
|
||||
Sub DisplayFeed()
|
||||
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
|
||||
' modifica richiesta 26/05/2023 da Rosario per cliente Lanzetta
|
||||
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||
dRealFeed = m_CN.d_DInterpo_Prog_Feed
|
||||
Else
|
||||
dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
|
||||
End If
|
||||
'' modifica richiesta 26/05/2023 da Rosario per cliente Lanzetta (lettura feed per CN Fanuc)
|
||||
'If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||
' dRealFeed = m_CN.d_DInterpo_Prog_Feed
|
||||
'Else
|
||||
' dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
|
||||
'End If
|
||||
|
||||
' 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)
|
||||
FeedTxBx.Text = LenToString(dRealFeed, 0, True)
|
||||
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
|
||||
@@ -308,8 +312,16 @@ Public Class MachineStatusUC
|
||||
Dim dSpindleOvr As Double
|
||||
' se attivi nuovi comandi MDI su siemens
|
||||
If m_MainWindow.m_CNCommunication.m_nNCType = 3 AndAlso m_MainWindow.m_CNCommunication.m_CN.m_IsSiemensOne Then
|
||||
dSpindlePower = m_CN.d_data(0)
|
||||
dSpindleOvr = m_CN.d_data(1)
|
||||
|
||||
If m_MainWindow.m_CNCommunication.m_CN.m_IsSiemensOne Then
|
||||
dSpindlePower = m_CN.d_spindle_power
|
||||
'dSpindleOvr = If(m_CN.bPowerOvr > 0, m_CN.d_spindle_power / m_CN.bPowerOvr * 100, 0)
|
||||
dSpindleOvr = m_CN.bPowerOvr
|
||||
Else
|
||||
' questo sistema è deprecabile dalla versione 2.6d2 (nuova gestione dei vettori)
|
||||
dSpindlePower = m_CN.d_data(0)
|
||||
dSpindleOvr = m_CN.d_data(1)
|
||||
End If
|
||||
ElseIf m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||
dSpindlePower = m_CN.d_spindle_power / 1000
|
||||
Else
|
||||
|
||||
@@ -61,7 +61,7 @@ Public Class MachiningDbPageUC
|
||||
StepType = {EgtMsg(MSG_COMBOBOXPARAM + 38), EgtMsg(MSG_COMBOBOXPARAM + 39), EgtMsg(MSG_COMBOBOXPARAM + 40)}
|
||||
RouFinStepType = {EgtMsg(MSG_COMBOBOXPARAM + 38), EgtMsg(MSG_COMBOBOXPARAM + 39)}
|
||||
ExtCornType = {EgtMsg(MSG_COMBOBOXPARAM + 43), EgtMsg(MSG_COMBOBOXPARAM + 44), EgtMsg(MSG_COMBOBOXPARAM + 45)}
|
||||
IntCornType = {EgtMsg(MSG_COMBOBOXPARAM + 43), EgtMsg(MSG_COMBOBOXPARAM + 44)}
|
||||
IntCornType = {EgtMsg(MSG_COMBOBOXPARAM + 43), EgtMsg(MSG_COMBOBOXPARAM + 44), EgtMsg(90852)}
|
||||
|
||||
' Assegno array a combobox
|
||||
WorkSideCmBx.ItemsSource = WorkSide
|
||||
@@ -208,7 +208,7 @@ Public Class MachiningDbPageUC
|
||||
MillTool.Clear()
|
||||
bFound = EgtTdbGetFirstTool(MCH_TF.MILL, sToolName, nType)
|
||||
While bFound
|
||||
If nType = MCH_TY.MILL_STD Then MillTool.Add( sToolName)
|
||||
If nType = MCH_TY.MILL_STD And sToolName.Trim.ToLower <> "probe" Then MillTool.Add(sToolName)
|
||||
bFound = EgtTdbGetNextTool(MCH_TF.MILL, sToolName, nType)
|
||||
End While
|
||||
PocketTool.Clear()
|
||||
|
||||
@@ -695,7 +695,16 @@ Public Class ToolsDbPageUC
|
||||
Dim ToolName As String = String.Empty
|
||||
Dim bFound As Boolean = EgtTdbGetFirstTool(nTType, ToolName, nType)
|
||||
While bFound
|
||||
If nType = nTType Then ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
|
||||
Dim nDebug As Integer = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_sIniFile)
|
||||
If nType = nTType Then
|
||||
If nTType <> MCH_TY.MILL_STD Then
|
||||
' se utensile diverso da MILL
|
||||
ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
|
||||
ElseIf nTType = MCH_TY.MILL_STD And (ToolName.Trim.ToLower <> "probe" Or nDebug > 4) Then
|
||||
' Se utensile MILL con nome "probe" aggiungo solo se livello debug maggiore di 4
|
||||
ToolCathegory.Items.Add(New CustomItem(ToolName, nType))
|
||||
End If
|
||||
End If
|
||||
bFound = EgtTdbGetNextTool(nTType, ToolName, nType)
|
||||
End While
|
||||
ToolsList.Add(ToolCathegory)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Name="LogoBrd" Background="Transparent">
|
||||
<Image Source="{DynamicResource LogoOmagImg}" Stretch="Uniform" Margin="1"/>
|
||||
<Image Source="../Resources/NewIcons/logo-OmCut.png" Stretch="Uniform" Margin="1"/>
|
||||
</Border>
|
||||
|
||||
<!-- ** Definizione della Grid delle tab ** -->
|
||||
|
||||
@@ -23,6 +23,11 @@ Class MainWindow
|
||||
' Coefficiente di scalatura della finestra rispetto a standard
|
||||
Friend m_dMWinScale As Double = 1
|
||||
|
||||
' Variabile che definisce l'avvio forzato in modalità FRAME
|
||||
Friend m_OnlyFrame As Boolean = False
|
||||
|
||||
Public Shared m_bShowSVGParkInd As Boolean = True
|
||||
|
||||
' Dichiarazione delle Page UserControl
|
||||
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
|
||||
Friend m_CurrentProjectPageUC As CurrentProjectPageUC
|
||||
@@ -101,6 +106,7 @@ Class MainWindow
|
||||
REGISTRATION = 2 ^ 20 ' 1048576
|
||||
SIMPLESTATISTICS = 2 ^ 21 ' 2097152
|
||||
COMPOFRAME = 2 ^ 22 ' 4194304
|
||||
CUT_LIGHT = 2 ^ 23 ' 8388608
|
||||
End Enum
|
||||
' Opzione nesting automatico
|
||||
Private m_bAutoNest As Boolean = False
|
||||
@@ -326,13 +332,28 @@ Class MainWindow
|
||||
EgtSetNestKey(sNestKey)
|
||||
Dim bNetHwKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
||||
EgtSetNetHwKey(bNetHwKey)
|
||||
|
||||
' Impostazioni per chiave di rete
|
||||
Dim bNetKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
||||
EgtSetNetHwKey(bNetKey)
|
||||
Dim sLockId As String = ""
|
||||
EgtUILib.GetPrivateProfileString(S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
|
||||
If Not String.IsNullOrEmpty(sLockId) Then
|
||||
EgtSetLockId(sLockId)
|
||||
End If
|
||||
|
||||
' Verifico abilitazione nesting automatico
|
||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||
' Recupero opzioni della chiave
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2508, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2508, 1, m_nKeyOptions)
|
||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2704, 1, m_nKeyLevel) And
|
||||
EgtGetKeyOptions(9423, 2704, 1, m_nKeyOptions)
|
||||
' Verifico abilitazione prodotto
|
||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
|
||||
If Not bProd Then
|
||||
m_OnlyFrame = GetKeyOption(KEY_OPT.CUT_LIGHT)
|
||||
End If
|
||||
|
||||
' Inizializzazione generale di EgtInterface
|
||||
m_nDebug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_sIniFile)
|
||||
m_sVersion = My.Application.Info.Version.Major.ToString() & "." &
|
||||
@@ -442,6 +463,7 @@ Class MainWindow
|
||||
If GetPrivateProfileInt(S_GENERAL, "Test", "0", m_sIniFile) = 0 OrElse
|
||||
Not File.Exists(m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
|
||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Collapsed
|
||||
EgtOutLog("Warning: Missing file 'TestWork.lua' in folder 'DirectCmd', buttun 'TEST' collapsed!")
|
||||
Else
|
||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Visible
|
||||
End If
|
||||
@@ -634,6 +656,41 @@ Class MainWindow
|
||||
m_IdleTimer.Interval = TimeSpan.FromMilliseconds(100)
|
||||
m_IdleTimer.Start()
|
||||
|
||||
Dim sAssStatus As String = " discontinued"
|
||||
Dim nAssLeftDays As Integer
|
||||
' MESSAGGIO...
|
||||
If EgtGetKeyAssLeftDays(nAssLeftDays) And nAssLeftDays >= 0 Then
|
||||
If nAssLeftDays > 0 Then
|
||||
sAssStatus = "expires within " & nAssLeftDays.ToString() & " days"
|
||||
'sAssStatus = "to be renewed within " & nAssLeftDays.ToString() & " days"
|
||||
Else
|
||||
sAssStatus = "Expired"
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim bShowInfoAssistance As Boolean = True
|
||||
bShowInfoAssistance = (GetPrivateProfileInt(S_GENERAL, K_SHOWEXPIREASSITANCE, "1", GetIniFile) <> 0)
|
||||
' Or nAssLeftDays = 358
|
||||
If bShowInfoAssistance And ((nAssLeftDays <= 7 And nAssLeftDays >= 0) Or nAssLeftDays = 14 Or nAssLeftDays = 21 Or nAssLeftDays = 28) Then
|
||||
' 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
|
||||
GetPrivateProfileString(S_GENERAL, "Assistances", "", sAssistance, GetIniFile)
|
||||
Dim sItems As String() = sAssistance.Split(","c)
|
||||
For Each Item As String In sItems
|
||||
sMsg_RefAssistance &= " → " & Item.Trim & " /n"
|
||||
Next
|
||||
' 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()
|
||||
End If
|
||||
|
||||
' inizilizzo
|
||||
End Sub
|
||||
|
||||
@@ -1100,7 +1157,7 @@ Class MainWindow
|
||||
End If
|
||||
' Inizio la chiusura del programma (se NUM_OLD verifico di aver terminato il processo DripFeed)
|
||||
EgtOutLog("Iniziato processo di chiusura programma")
|
||||
m_IsClosingApplication = If( m_CNCommunication.m_nNCType = 1, 1, 2)
|
||||
m_IsClosingApplication = If(m_CNCommunication.m_nNCType = 1, 1, 2)
|
||||
Dim nCount As Integer = 0
|
||||
While m_IsClosingApplication <> 2
|
||||
If nCount > 5 Then
|
||||
@@ -1161,13 +1218,17 @@ Class MainWindow
|
||||
m_DirectCutPageUC.m_ControlsDirectCutUC.m_GridCut.GridCut_Unloaded(sender, e)
|
||||
Case ControlsDirectCutUC.DirectCutPages.FlatteningCut
|
||||
m_DirectCutPageUC.m_ControlsDirectCutUC.m_FlatteningCut.FlatteningCut_Unloaded(sender, e)
|
||||
End Select
|
||||
|
||||
Select Case m_DirectCutPageUC.m_ControlsDirectCutUC1.m_ActiveDirectCutPage
|
||||
Case ControlsDirectCutUC.DirectCutPages.CopyTemplate
|
||||
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_CopyTemplate.CopyTemplate_Unloaded(sender, e)
|
||||
Case ControlsDirectCutUC.DirectCutPages.Polishing
|
||||
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_Polishing.Polishing_Unloaded(sender, e)
|
||||
Case ControlsDirectCutUC.DirectCutPages.SawTest
|
||||
Case ControlsDirectCutUC1.DirectCutPages.SawTest
|
||||
m_DirectCutPageUC.m_ControlsDirectCutUC1.m_SawTest.SawTest_Unloaded(sender, e)
|
||||
End Select
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -1238,11 +1299,16 @@ Class MainWindow
|
||||
m_ProdLineTimer.Start()
|
||||
End If
|
||||
' di default attivo la pagina CadCut
|
||||
m_ActivePage = MainWindow.Pages.CadCut
|
||||
If m_OnlyFrame Then
|
||||
m_ActivePage = MainWindow.Pages.FrameCut
|
||||
Else
|
||||
m_ActivePage = MainWindow.Pages.CadCut
|
||||
End If
|
||||
' seleziono il tipo di avvio
|
||||
m_CurrentProjectPageUC.StartProgram()
|
||||
' aggiorno la grafica
|
||||
EgtZoom(ZM.ALL, True)
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Sub EgtWPFInit()
|
||||
@@ -1274,8 +1340,34 @@ Class MainWindow
|
||||
Dim bHeadH1 As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
||||
EgtSetCurrentContext(nCurrCtx)
|
||||
' Aggiorno interfaccia
|
||||
CadCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FRAMES)
|
||||
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso bHeadH1
|
||||
If m_OnlyFrame Then
|
||||
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
|
||||
m_ActivePage <> Pages.RawPart And m_ActivePage <> Pages.DirectCut And m_ActivePage <> Pages.Simulation Then
|
||||
Dim FrameWnd As New EgtMsgBox(Me, EgtMsg(91141), EgtMsg(91142), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
'' Gestione stato FastGrid
|
||||
'm_CadCutPageUC.m_FastGridSlabManager.OnPreNewProject()
|
||||
' Cancello progetto salvato con nome da file ini
|
||||
WritePrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", GetIniFile())
|
||||
' Scelta tavola della macchina
|
||||
Dim nTabInd As Integer = m_CadCutPageUC.m_ProjectMgr.ChooseTable()
|
||||
' Creo nuovo progetto
|
||||
m_CurrentProjectPageUC.NewProject(nTabInd, False)
|
||||
'' Gestione stato FastGrid
|
||||
'm_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
|
||||
FrameCutBtn_Click(Nothing, Nothing)
|
||||
CadCutBtn.IsEnabled = False
|
||||
Else
|
||||
FrameCutBtn.IsEnabled = True
|
||||
CadCutBtn.IsEnabled = False
|
||||
' Attivo il pulsante FRAME
|
||||
'FrameCutBtn.IsChecked = True
|
||||
'CadCutBtn.IsChecked = False
|
||||
End If
|
||||
Else
|
||||
CadCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FRAMES)
|
||||
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso bHeadH1
|
||||
End If
|
||||
|
||||
' DirectCutBtn.IsEnabled = bHeadH1
|
||||
End Sub
|
||||
|
||||
@@ -2028,6 +2120,7 @@ Class MainWindow
|
||||
EgtDeselectObj(m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv)
|
||||
EgtDeselectObj(m_CadCutPageUC.m_NestPage.m_CurrSelectedSawCurv)
|
||||
EgtResetMark(m_CadCutPageUC.m_NestPage.m_CurrSelectedSawCurv)
|
||||
m_CadCutPageUC.m_NestPage.m_CurrToolFromSelectedSawCurv = String.Empty
|
||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.IsChecked = False
|
||||
Me.m_CadCutPageUC.m_NestPage.m_bSelectCurv = False
|
||||
End Sub
|
||||
|
||||
@@ -22,7 +22,7 @@ Imports System.Windows
|
||||
#End If
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("OmagCUT")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2015-2023 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2015-2025 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.5.8.1")>
|
||||
<Assembly: AssemblyFileVersion("2.5.8.1")>
|
||||
<Assembly: AssemblyVersion("2.7.4.1")>
|
||||
<Assembly: AssemblyFileVersion("2.7.4.1")>
|
||||
|
||||
@@ -4,6 +4,8 @@ Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
Imports EgtWPFLib.EgtMsgBox
|
||||
Imports OmagCUT.CN_generico
|
||||
|
||||
Public Class CNCommunication
|
||||
|
||||
@@ -28,6 +30,9 @@ Public Class CNCommunication
|
||||
' Oggetto CN
|
||||
Public WithEvents m_CN As CN_generico
|
||||
|
||||
' NUOVO ! in fase di test
|
||||
Private ListReferenceIndex As New List(Of RefereceFlagSimens)
|
||||
|
||||
' Flag di aggiornamento dati
|
||||
Private m_bNewPosData As Boolean = True
|
||||
Private m_bNewDeltaData As Boolean = True
|
||||
@@ -236,6 +241,17 @@ Public Class CNCommunication
|
||||
m_bInInches = (GetPrivateProfileInt(S_AXES, K_ININCHES, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
End Sub
|
||||
|
||||
Private Sub KillSimensCom(sProcessName As String)
|
||||
Dim sAppName As String = Path.GetFileNameWithoutExtension(sProcessName)
|
||||
Dim pList() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses
|
||||
For Each proc As System.Diagnostics.Process In pList
|
||||
If proc.ProcessName.ToString = sAppName Then
|
||||
proc.Kill()
|
||||
EgtOutLog("ProcessKill : " & """" & sProcessName & """")
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub InitCn()
|
||||
|
||||
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Yellow")
|
||||
@@ -271,6 +287,7 @@ Public Class CNCommunication
|
||||
|
||||
' Recupero e imposto le variabili per i dati del CN (feed, speed,...)
|
||||
GetPrivateProfileString(S_NCDATA, K_COMM, "XIP01, 0, 10, 0, 0, 0", sVal, m_MainWindow.GetMachIniFile())
|
||||
EgtOutLog(" → Tipo di comunicazione: " & sVal)
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Comm, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_REFRESH, "200", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.Refresh, sVal)
|
||||
@@ -372,6 +389,9 @@ Public Class CNCommunication
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.VacuumOff, sVal)
|
||||
GetPrivateProfileString(S_NCDATA, K_BYPASSTATE, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.BypassState, sVal)
|
||||
' ver 2.6i1 : nuova gestione SiemensONE
|
||||
GetPrivateProfileString(S_NCDATA, K_RESETSTATUS, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
m_CN.SetCnDataVar(CN_generico.CnData.ResetStatus, sVal)
|
||||
|
||||
' nuove variabili: stato dei nuovi pulsanti
|
||||
nVal = GetPrivateProfileInt(S_NCDATA, K_NEWCONSOLE, 0, m_MainWindow.GetMachIniFile())
|
||||
@@ -389,10 +409,14 @@ Public Class CNCommunication
|
||||
If Not String.IsNullOrEmpty(sVal) Then m_CN.SetCnDataVar(CN_generico.CnData.Remote, sVal)
|
||||
End If
|
||||
|
||||
' Solo per controllo FANUNC
|
||||
' Solo per controllo FANUC
|
||||
GetPrivateProfileString(S_NCDATA, K_NAXES, "", sVal, m_MainWindow.GetMachIniFile())
|
||||
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
|
||||
m_CN.Init()
|
||||
@@ -402,6 +426,10 @@ Public Class CNCommunication
|
||||
EgtOutLog("Error starting NC communication : " & ex.Message)
|
||||
End Try
|
||||
|
||||
'' !!!!!!!!!!!!! Per forzare la lettura delle variabili siemens di configurazione !!!!!!!!!!!!!
|
||||
' m_nNCType = 3
|
||||
'' !!!!!!!!!!!!! Per forzare la lettura delle variabili siemens di configurazione !!!!!!!!!!!!!
|
||||
|
||||
Select Case m_nNCType
|
||||
Case 0 'Debug
|
||||
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_Yellow")
|
||||
@@ -426,26 +454,137 @@ Public Class CNCommunication
|
||||
Try
|
||||
m_MachineStatus.MachineStatusGrid.Background = Application.Current.FindResource("OmagCut_DarkGray")
|
||||
Dim sArg As String = "-start """ & m_sCNSiemensPath & """"
|
||||
|
||||
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
|
||||
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
|
||||
KillSimensCom(m_sCNSiemensHMIPath)
|
||||
Process.Start(m_sCNSiemensHMIPath, sArg)
|
||||
' !!!!!!!!!!!!!! FORZO LA SIMULAZIONE DELLA LETTURA DELLE VARIBILI E SIEMENS !!!!!!!!!!!!!!
|
||||
|
||||
EgtOutLog("ProcessStart : " & """" & m_sCNSiemensHMIPath & """" & " " & sArg)
|
||||
m_CN.m_IsSiemensOne = GetPrivateProfileInt(S_NCSIEMENS, K_ISSIEMENSONE, 0, m_MainWindow.GetMachIniFile()) > 0
|
||||
m_CN.m_IsActiveModeSubscription = GetPrivateProfileInt(S_NCSIEMENS, K_ISACTIVEMODESUBSCR, 0, m_MainWindow.GetMachIniFile()) > 0
|
||||
If m_CN.m_IsSiemensOne Then
|
||||
' stati bottoni parte 1
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.Laser), VarType.TInteger, 0)
|
||||
' stati bottoni ventose
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.LaserTrac), VarType.TInteger, 1)
|
||||
'stati porte
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.DoorClosed), VarType.TInteger, 2)
|
||||
'
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.BlowState), VarType.TInteger, 3)
|
||||
' stati bottoni parte 2
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.CBAxes), VarType.TInteger, 4)
|
||||
' ampere e ampere override
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.Spindle), VarType.TDouble, 0)
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.SpeedOvr), VarType.TDouble, 1)
|
||||
|
||||
' Leggo tutte le varaibili che sono state caricate nel percorso [NcData] del file *.ini
|
||||
Dim nIndexArrayBool As Integer = 0
|
||||
Dim nIndexArrayInt As Integer = 0
|
||||
Dim nIndexArrayLong As Integer = 0
|
||||
Dim nIndexArrayDoub As Integer = 0
|
||||
Dim nIndexArrayStr As Integer = 0
|
||||
' lista che associa Indice del vettore al nome (per associazioni Bit a Bit)
|
||||
Dim ListIndexToVar As New List(Of IndexArrayToBit)
|
||||
' Creo un vettore che mi permetta di risalire a cosa contiene ogni vettore FLAG (di tipo Enum)
|
||||
For ItemIndex As Integer = 0 To m_CN.m_szCnDataVar.Count - 1
|
||||
' escludo i Flag 'Comm' e 'Refresh'
|
||||
If ItemIndex = CnData.Comm Or ItemIndex = CnData.Refresh Then
|
||||
Continue For
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(m_CN.m_szCnDataVar(ItemIndex)) Then
|
||||
Dim sItem As String() = m_CN.m_szCnDataVar(ItemIndex).Split(","c)
|
||||
Dim nVarType As VarType = VarType.TInteger
|
||||
If sItem.Count > 1 Then
|
||||
If IsNumeric(sItem(0)) Then
|
||||
Select Case CInt(sItem(0))
|
||||
Case 0
|
||||
If nIndexArrayBool > 14 Then
|
||||
Continue For
|
||||
End If
|
||||
nVarType = VarType.TBoolean
|
||||
m_CN.DVariables_Read_Subscription(sItem(1), nVarType, nIndexArrayBool)
|
||||
Dim NewRefFlafSiemens As RefereceFlagSimens = New RefereceFlagSimens(nIndexArrayBool, ItemIndex, nVarType)
|
||||
If sItem.Count = 3 Then
|
||||
' forzo la lettura della variabile di default (ignoro lo stato letto da CN)
|
||||
NewRefFlafSiemens.DefaultValue = sItem(2)
|
||||
End If
|
||||
ListReferenceIndex.Add(NewRefFlafSiemens)
|
||||
nIndexArrayBool += 1
|
||||
Case 1
|
||||
If nIndexArrayInt > 14 Then
|
||||
Continue For
|
||||
End If
|
||||
nVarType = VarType.TInteger
|
||||
m_CN.DVariables_Read_Subscription(sItem(1), nVarType, nIndexArrayInt)
|
||||
ListReferenceIndex.Add(New RefereceFlagSimens(nIndexArrayInt, ItemIndex, nVarType))
|
||||
nIndexArrayInt += 1
|
||||
Case 2
|
||||
If nIndexArrayLong > 14 Then
|
||||
Continue For
|
||||
End If
|
||||
nVarType = VarType.TLong
|
||||
m_CN.DVariables_Read_Subscription(sItem(1), nVarType, nIndexArrayLong)
|
||||
ListReferenceIndex.Add(New RefereceFlagSimens(nIndexArrayLong, ItemIndex, nVarType))
|
||||
nIndexArrayLong += 1
|
||||
Case 3
|
||||
If nIndexArrayDoub > 14 Then
|
||||
Continue For
|
||||
End If
|
||||
nVarType = VarType.TDouble
|
||||
m_CN.DVariables_Read_Subscription(sItem(1), nVarType, nIndexArrayDoub)
|
||||
ListReferenceIndex.Add(New RefereceFlagSimens(nIndexArrayDoub, ItemIndex, nVarType))
|
||||
nIndexArrayDoub += 1
|
||||
Case 4
|
||||
If nIndexArrayStr > 14 Then
|
||||
Continue For
|
||||
End If
|
||||
nVarType = VarType.TString
|
||||
m_CN.DVariables_Read_Subscription(sItem(1), nVarType, nIndexArrayStr)
|
||||
ListReferenceIndex.Add(New RefereceFlagSimens(nIndexArrayStr, ItemIndex, nVarType))
|
||||
nIndexArrayStr += 1
|
||||
Case 5
|
||||
If nIndexArrayInt > 14 Then
|
||||
Continue For
|
||||
End If
|
||||
' verifico se devo riempire un vettore con bit
|
||||
Dim sSubItem As String() = sItem(1).Split("."c)
|
||||
' //My. name. Is Bond._James Bond!
|
||||
Dim sVarName = String.Join(".", sSubItem.Take(sSubItem.Length - 1)) ' //My. name. Is Bond
|
||||
Dim sIndexBit = sSubItem.Last() ' //_James Bond!
|
||||
If sSubItem.Count > 1 And IsNumeric(sIndexBit) Then
|
||||
Dim bFound As Boolean = False
|
||||
Dim nIndexArrayInt_1 As Integer = nIndexArrayInt
|
||||
For Each VarSiemens As IndexArrayToBit In ListIndexToVar
|
||||
If VarSiemens.sNameVar.Trim = sVarName.Trim Then
|
||||
nIndexArrayInt_1 = VarSiemens.nIndex
|
||||
bFound = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
nVarType = VarType.TInteger
|
||||
m_CN.DVariables_Read_Subscription(sVarName, nVarType, nIndexArrayInt_1)
|
||||
Dim NewRefFlafSiemens As RefereceFlagSimens = New RefereceFlagSimens(nIndexArrayInt_1, ItemIndex, nVarType, sIndexBit)
|
||||
If sItem.Count = 3 Then
|
||||
' forzo la lettura della variabile di default (ignoro lo stato letto da CN)
|
||||
NewRefFlafSiemens.DefaultValue = sItem(2)
|
||||
End If
|
||||
ListReferenceIndex.Add(NewRefFlafSiemens)
|
||||
If Not bFound Then
|
||||
nIndexArrayInt += 1
|
||||
ListIndexToVar.Add(New IndexArrayToBit(nIndexArrayInt_1, sVarName.Trim))
|
||||
End If
|
||||
Else
|
||||
EgtOutLog(" ATTENZIONE: in [NcData] '" & m_CN.m_szCnDataVar(ItemIndex) & "' non è inidicato il bit associato")
|
||||
End If
|
||||
Case Else
|
||||
If nIndexArrayInt > 14 Then
|
||||
Continue For
|
||||
End If
|
||||
nVarType = VarType.TInteger
|
||||
m_CN.DVariables_Read_Subscription(sItem(1), nVarType, nIndexArrayInt)
|
||||
ListReferenceIndex.Add(New RefereceFlagSimens(nIndexArrayInt, ItemIndex, nVarType))
|
||||
nIndexArrayInt += 1
|
||||
End Select
|
||||
End If
|
||||
Else
|
||||
EgtOutLog(" ATTENZIONE: in [NcData] '" & m_CN.m_szCnDataVar(ItemIndex) & "' non è indicato il tipo (0→Bool,1→Int,2→Long,3→Double,4→String,5→Bit)")
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
' Attraverso la funzione "RefreshNoEvents" rileggo i dati caricati
|
||||
|
||||
' Recupero il perocorso delle variabili PLC
|
||||
GetPrivateProfileString(S_NCSIEMENS, K_DBVARPATH, "", m_CN.m_DbVarPath, m_MainWindow.GetMachIniFile)
|
||||
|
||||
ElseIf m_CN.m_IsActiveModeSubscription Then
|
||||
m_CN.DVariables_Read_Subscription(m_CN.m_szCnDataVar(CN_generico.CnData.BlowState), VarType.TInteger, 3)
|
||||
End If
|
||||
@@ -630,8 +769,8 @@ Public Class CNCommunication
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.LimitZChanged(m_CN.bLimitZState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.FiveAxisStateChanged(m_CN.Is_G24_active())
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ParkingStateChanged(m_CN.bParkingState)
|
||||
'm_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ZoneStateChanged(m_CN.nEnableZone)
|
||||
'm_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.PcStateChanged(m_CN.nEnablePc)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.ZoneStateChanged(m_CN.nEnableZone)
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsMachineButton.PcStateChanged(m_CN.nEnablePc)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumUpChanged(m_CN.bVacuumUp)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.VacuumDownChanged(m_CN.bVacuumDown)
|
||||
m_MainWindow.m_DirectCutPageUC.m_VacuumMachineButton.Vacuum2UpChanged(m_CN.bVacuum2Up)
|
||||
@@ -973,6 +1112,68 @@ Public Class CNCommunication
|
||||
'Laser = 16384
|
||||
End Enum
|
||||
|
||||
#Region "MASCHERA per conttrollo Bit a Bit"
|
||||
<Flags()>
|
||||
Public Enum Mask As Integer
|
||||
bit_Err = -1
|
||||
bit_0 = &H1 ' 1
|
||||
bit_1 = &H2 ' 2
|
||||
bit_2 = &H4 ' 4
|
||||
bit_3 = &H8 ' 8
|
||||
bit_4 = &H10 ' 16
|
||||
bit_5 = &H20 ' 32
|
||||
bit_6 = &H40 ' 64
|
||||
bit_7 = &H80 ' 128
|
||||
bit_8 = &H100 ' 256
|
||||
bit_9 = &H200 ' 512
|
||||
bit_10 = &H400 ' 1024
|
||||
bit_11 = &H800 ' 2048
|
||||
bit_12 = &H1000 ' 4096
|
||||
bit_13 = &H2000 ' 8192
|
||||
bit_14 = &H4000 ' 16384
|
||||
bit_15 = &H8000 ' 32768
|
||||
End Enum
|
||||
|
||||
Public Function GetMaskByBit(IndexBit As Integer) As Mask
|
||||
Dim Bit_ As Mask = Mask.bit_Err
|
||||
Select Case IndexBit
|
||||
Case 0
|
||||
Bit_ = Mask.bit_0
|
||||
Case 1
|
||||
Bit_ = Mask.bit_1
|
||||
Case 2
|
||||
Bit_ = Mask.bit_2
|
||||
Case 3
|
||||
Bit_ = Mask.bit_3
|
||||
Case 4
|
||||
Bit_ = Mask.bit_4
|
||||
Case 5
|
||||
Bit_ = Mask.bit_5
|
||||
Case 6
|
||||
Bit_ = Mask.bit_6
|
||||
Case 7
|
||||
Bit_ = Mask.bit_7
|
||||
Case 8
|
||||
Bit_ = Mask.bit_8
|
||||
Case 9
|
||||
Bit_ = Mask.bit_9
|
||||
Case 10
|
||||
Bit_ = Mask.bit_10
|
||||
Case 11
|
||||
Bit_ = Mask.bit_11
|
||||
Case 12
|
||||
Bit_ = Mask.bit_12
|
||||
Case 13
|
||||
Bit_ = Mask.bit_13
|
||||
Case 14
|
||||
Bit_ = Mask.bit_14
|
||||
Case 15
|
||||
Bit_ = Mask.bit_15
|
||||
End Select
|
||||
Return Bit_
|
||||
End Function
|
||||
#End Region ' Maschera per controllo Bit a Bit
|
||||
|
||||
Public Function IsSetAll(value As Integer, flag As Integer) As Boolean
|
||||
' somma Bit a Bit
|
||||
Return ((value And flag) = flag)
|
||||
@@ -988,23 +1189,23 @@ Public Class CNCommunication
|
||||
|
||||
m_MachineStatus.DisplaySpeed()
|
||||
|
||||
m_MachineStatus.DisplayPower()
|
||||
'm_MachineStatus.DisplayPower()
|
||||
|
||||
m_MachineStatus.DisplayVar()
|
||||
'EgtOutLog("Modo attivato: " & m_CN.read_active_mode & " modo attivo: " & m_nCurrMode)
|
||||
|
||||
If m_nCountRefresh > 10 Then
|
||||
Dim TempCurrMode As Short = m_CN.read_active_mode()
|
||||
'EgtOutLog("Machine status: " & TempCurrMode)
|
||||
If TempCurrMode <> m_nCurrMode Then
|
||||
'EgtOutLog("Modo attivo: " & m_CN.read_active_mode)
|
||||
m_nCurrMode = CInt(TempCurrMode)
|
||||
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||
End If
|
||||
m_nCountRefresh = 0
|
||||
Else
|
||||
m_nCountRefresh = m_nCountRefresh + 1
|
||||
End If
|
||||
'If m_nCountRefresh > 10 Then
|
||||
' Dim TempCurrMode As Short = m_CN.read_active_mode()
|
||||
' 'EgtOutLog("Machine status: " & TempCurrMode)
|
||||
' If TempCurrMode <> m_nCurrMode Then
|
||||
' 'EgtOutLog("Modo attivo: " & m_CN.read_active_mode)
|
||||
' m_nCurrMode = CInt(TempCurrMode)
|
||||
' m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||
' End If
|
||||
' m_nCountRefresh = 0
|
||||
'Else
|
||||
' m_nCountRefresh = m_nCountRefresh + 1
|
||||
'End If
|
||||
|
||||
If m_CN.b_NC_error Then
|
||||
ErrorList.Clear()
|
||||
@@ -1021,61 +1222,176 @@ Public Class CNCommunication
|
||||
End If
|
||||
End If
|
||||
|
||||
' lettura delle variabili abbonate
|
||||
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
||||
|
||||
' lettura variabili stati mancanti su Siemens
|
||||
Dim nVarValue As Integer = m_CN.n_data(0)
|
||||
EgtOutLog("Variabile PLC control addr: " & 1 & " value: " & nVarValue)
|
||||
m_CN.bSpindleState = IsSetAll(nVarValue, ControlStates.Spindle)
|
||||
m_CN.bLaserTracState = IsSetAll(nVarValue, ControlStates.LaserTrac)
|
||||
m_CN.bCoolantState = IsSetAll(nVarValue, ControlStates.Coolant)
|
||||
m_CN.bInternalCoolantState = IsSetAll(nVarValue, ControlStates.InternalCoolant)
|
||||
m_CN.bExternCoolantState = IsSetAll(nVarValue, ControlStates.ExternCoolant)
|
||||
m_CN.bCBAxesState = IsSetAll(nVarValue, ControlStates.CAxis)
|
||||
m_CN.bAirBlowState = IsSetAll(nVarValue, ControlStates.AirBlow)
|
||||
m_CN.bHomeState = IsSetAll(nVarValue, ControlStates.Home)
|
||||
m_CN.bTableUpState = IsSetAll(nVarValue, ControlStates.TableUp)
|
||||
m_CN.bTableDownState = IsSetAll(nVarValue, ControlStates.TableDown)
|
||||
m_CN.bLimitZState = IsSetAll(nVarValue, ControlStates.LimitZ)
|
||||
m_CN.b5AxesState = IsSetAll(nVarValue, ControlStates.Axis5)
|
||||
'------------ SINUMERIK ONE ----------------------------------------------
|
||||
For IndxLst As Integer = 0 To ListReferenceIndex.Count - 1
|
||||
Dim nType As Integer = ListReferenceIndex(IndxLst).TypeArray
|
||||
Dim nFlag As Integer = ListReferenceIndex(IndxLst).FlagIndex
|
||||
Dim nIndex As Integer = ListReferenceIndex(IndxLst).SiemnesArrayIndex
|
||||
Dim nIndexBit As Integer = ListReferenceIndex(IndxLst).IndexBit
|
||||
Dim sDefaultValue As String = ListReferenceIndex(IndxLst).DefaultValue
|
||||
Dim b_temp As Boolean = False
|
||||
Dim n_temp As Integer = 0
|
||||
Dim l_temp As Long = 0.0
|
||||
Dim d_temp As Double = 0.0
|
||||
' leggo il valore caricato
|
||||
Select Case nType
|
||||
Case VarType.TBoolean
|
||||
If Not String.IsNullOrEmpty(sDefaultValue) Then
|
||||
' ver 2.6i1
|
||||
Try
|
||||
b_temp = CBool(sDefaultValue)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Default boolean value of flag " & nFlag.ToString & " is not Boolean, verify the form: True or true or 1, False or false or 0")
|
||||
b_temp = m_CN.b_data(nIndex)
|
||||
End Try
|
||||
Else
|
||||
b_temp = m_CN.b_data(nIndex)
|
||||
End If
|
||||
Case VarType.TInteger
|
||||
n_temp = m_CN.n_data(nIndex)
|
||||
' VENTOSE: lettura dato da intero Bit a Bit (ver_2.6h1), ritorno un Boolean
|
||||
If Not String.IsNullOrEmpty(sDefaultValue) Then
|
||||
' ver 2.6i1
|
||||
Try
|
||||
b_temp = CBool(sDefaultValue)
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Default bit value of flag " & nFlag.ToString & " is not Boolean, verify the form: True or true or 1, False or false or 0")
|
||||
b_temp = ReadBit(nIndexBit, n_temp)
|
||||
End Try
|
||||
Else
|
||||
b_temp = ReadBit(nIndexBit, n_temp)
|
||||
End If
|
||||
Case VarType.TLong
|
||||
l_temp = m_CN.l_data(nIndex)
|
||||
Case VarType.TDouble
|
||||
d_temp = m_CN.d_data(nIndex)
|
||||
Case VarType.TString
|
||||
'b_temp = If(m_CN.d_data(nIndex) = 0, True, False)
|
||||
End Select
|
||||
|
||||
nVarValue = m_CN.n_data(1)
|
||||
'EgtOutLog("Variabile PLC vacuum addr: " & m_CN.m_szCnDataVar(CN_generico.CnData.LaserTrac) & " value: " & nVarValue)
|
||||
m_CN.bVacuumUp = IsSetAll(nVarValue, VacuumStates.VacuumUp)
|
||||
m_CN.bVacuumDown = IsSetAll(nVarValue, VacuumStates.VacuumDown)
|
||||
m_CN.bVacuum2Up = IsSetAll(nVarValue, VacuumStates.Vacuum2Up)
|
||||
m_CN.bVacuum2Down = IsSetAll(nVarValue, VacuumStates.Vacuum2Down)
|
||||
m_CN.bVacuum1State = IsSetAll(nVarValue, VacuumStates.Vacuum1State)
|
||||
m_CN.bVacuum2State = IsSetAll(nVarValue, VacuumStates.Vacuum2State)
|
||||
m_CN.bVacuum3State = IsSetAll(nVarValue, VacuumStates.Vacuum3State)
|
||||
m_CN.bVacuum4State = IsSetAll(nVarValue, VacuumStates.Vacuum4State)
|
||||
m_CN.bVacuum5State = IsSetAll(nVarValue, VacuumStates.Vacuum5State)
|
||||
m_CN.bVacuum6State = IsSetAll(nVarValue, VacuumStates.Vacuum6State)
|
||||
m_CN.bOpenAllState = (m_CN.bVacuum1State And m_CN.bVacuum2State And m_CN.bVacuum3State And m_CN.bVacuum4State And m_CN.bVacuum5State And m_CN.bVacuum6State)
|
||||
m_CN.bCloseAllState = (Not m_CN.bVacuum1State And Not m_CN.bVacuum2State And Not m_CN.bVacuum3State And Not m_CN.bVacuum4State And Not m_CN.bVacuum5State And Not m_CN.bVacuum6State)
|
||||
m_CN.bOpen123State = (m_CN.bVacuum1State And m_CN.bVacuum2State And m_CN.bVacuum3State)
|
||||
m_CN.bOpen456State = (m_CN.bVacuum4State And m_CN.bVacuum5State And m_CN.bVacuum6State)
|
||||
m_CN.bClose123State = (Not m_CN.bVacuum1State And Not m_CN.bVacuum2State And Not m_CN.bVacuum3State)
|
||||
m_CN.bClose456State = (Not m_CN.bVacuum4State And Not m_CN.bVacuum5State And Not m_CN.bVacuum6State)
|
||||
m_CN.bBlowState = IsSetAll(nVarValue, VacuumStates.AirBlow)
|
||||
m_CN.bVacuumOn = IsSetAll(nVarValue, VacuumStates.VacuumOn)
|
||||
m_CN.bVacuumOff = IsSetAll(nVarValue, VacuumStates.VacuumOff)
|
||||
m_CN.bBypassState = IsSetAll(nVarValue, VacuumStates.BypassState)
|
||||
Select Case nFlag
|
||||
Case CN_generico.CnData.Mode ' (0) Stato modo attivo
|
||||
m_CN.n_index_mode = nIndex
|
||||
If m_nCountRefresh > 10 Then
|
||||
Dim TempCurrMode As Short = m_CN.read_active_mode()
|
||||
'EgtOutLog("Machine status: " & TempCurrMode)
|
||||
If TempCurrMode <> m_nCurrMode Then
|
||||
'EgtOutLog("Modo attivo: " & m_CN.read_active_mode)
|
||||
m_nCurrMode = CInt(TempCurrMode)
|
||||
m_MachineStatus.DisplayActiveMode(m_nCurrMode)
|
||||
m_CN.nMachineMode = m_nCurrMode
|
||||
End If
|
||||
m_nCountRefresh = 0
|
||||
Else
|
||||
m_nCountRefresh = m_nCountRefresh + 1
|
||||
End If
|
||||
Case CN_generico.CnData.Power
|
||||
m_CN.d_spindle_power = d_temp
|
||||
Case CN_generico.CnData.Spindle ' (7) Stato rotazione mandrino
|
||||
m_CN.bSpindleState = b_temp
|
||||
Case CN_generico.CnData.Coolant ' (8) Stato acqua
|
||||
m_CN.bCoolantState = b_temp
|
||||
Case CN_generico.CnData.Laser ' (9) Stato laser punto
|
||||
m_CN.bLaserState = b_temp
|
||||
Case CN_generico.CnData.PowerOvr ' (10) Amperaggio
|
||||
m_CN.bPowerOvr = d_temp
|
||||
Case CN_generico.CnData.InternalCoolant ' (13) Stato acqua interna
|
||||
m_CN.bInternalCoolantState = b_temp
|
||||
Case CN_generico.CnData.ExternCoolant ' (14) Stato acqua esterna
|
||||
m_CN.bExternCoolantState = b_temp
|
||||
Case CN_generico.CnData.CBAxes ' (15) Stato ativazione assi c e b
|
||||
m_CN.bCBAxesState = b_temp
|
||||
Case CN_generico.CnData.AirBlow ' (16) Stato soffio utensile
|
||||
m_CN.bAirBlowState = b_temp
|
||||
Case CN_generico.CnData.Home ' (17) Stato home
|
||||
m_CN.bHomeState = b_temp
|
||||
Case CN_generico.CnData.TableUp ' (18) Stato tavolo su
|
||||
m_CN.bTableUpState = b_temp
|
||||
Case CN_generico.CnData.TableDown ' (19) Stato tavolo giu'
|
||||
m_CN.bTableDownState = b_temp
|
||||
Case CN_generico.CnData.DoorClosed ' (20) Stato porte
|
||||
m_CN.nDoorClosedState = n_temp
|
||||
Case CN_generico.CnData.LimitZ ' (21) Stato limitazione asse Z
|
||||
m_CN.bLimitZState = b_temp
|
||||
Case CN_generico.CnData.VacuumUp ' (22) Stato ventosa su'
|
||||
m_CN.bVacuumUp = b_temp
|
||||
Case CN_generico.CnData.VacuumDown ' (23) Stato ventosa giu'
|
||||
m_CN.bVacuumDown = b_temp
|
||||
Case CN_generico.CnData.Vacuum2Up ' (24) Stato ventosa2 su'
|
||||
m_CN.bVacuum2Up = b_temp
|
||||
Case CN_generico.CnData.Vacuum2Down ' (25) Stato ventosa2 giu'
|
||||
m_CN.bVacuum2Down = b_temp
|
||||
Case CN_generico.CnData.Vacuum1State ' (26) Stato ventosa 1
|
||||
m_CN.bVacuum1State = b_temp
|
||||
Case CN_generico.CnData.Vacuum2State ' (27) Stato ventosa 2
|
||||
m_CN.bVacuum2State = b_temp
|
||||
Case CN_generico.CnData.Vacuum3State ' (28) Stato ventosa 3
|
||||
m_CN.bVacuum3State = b_temp
|
||||
Case CN_generico.CnData.Vacuum4State ' (29) Stato ventosa 4
|
||||
m_CN.bVacuum4State = b_temp
|
||||
Case CN_generico.CnData.Vacuum5State ' (30) Stato ventosa 5
|
||||
m_CN.bVacuum5State = b_temp
|
||||
Case CN_generico.CnData.Vacuum6State ' (31) Stato ventosa 6
|
||||
m_CN.bVacuum6State = b_temp
|
||||
Case CN_generico.CnData.Vacuum135State ' (32) Stato ventose 135
|
||||
m_CN.bVacuum135State = b_temp
|
||||
Case CN_generico.CnData.Vacuum246State ' (33) Stato ventose 246
|
||||
m_CN.bVacuum246State = b_temp
|
||||
Case CN_generico.CnData.OpenAllState ' (34) Stato apertura ventose
|
||||
m_CN.bOpenAllState = b_temp
|
||||
Case CN_generico.CnData.CloseAllState ' (35) Stato chiusura ventose
|
||||
m_CN.bCloseAllState = b_temp
|
||||
Case CN_generico.CnData.Open123State ' (36) Stato apertura ventose
|
||||
m_CN.bOpen123State = b_temp
|
||||
Case CN_generico.CnData.Open456State ' (37) Stato apertura ventose
|
||||
m_CN.bOpen456State = b_temp
|
||||
Case CN_generico.CnData.Close123State ' (38) Stato chiusura ventose
|
||||
m_CN.bClose123State = b_temp
|
||||
Case CN_generico.CnData.Close456State ' (39) Stato chiusura ventose
|
||||
m_CN.bClose456State = b_temp
|
||||
Case CN_generico.CnData.BlowState ' (40) Stato soffio ventose
|
||||
m_CN.bBlowState = b_temp
|
||||
Case CN_generico.CnData.VacuumOn ' (41) Stato aspirazione ventose acceso
|
||||
m_CN.bVacuumOn = b_temp
|
||||
Case CN_generico.CnData.BypassState ' (42) Stato bypass
|
||||
m_CN.bBypassState = b_temp
|
||||
Case CN_generico.CnData.Vacuum0 ' (43) Stato rotazione ventosa 0
|
||||
m_CN.bVacuum0 = b_temp
|
||||
Case CN_generico.CnData.Vacuum90 ' (44) Stato rotazione ventosa 0
|
||||
m_CN.bVacuum90 = b_temp
|
||||
Case CN_generico.CnData.VacuumOff ' (45) Stato aspirazione ventose spento
|
||||
m_CN.bVacuumOff = b_temp
|
||||
Case CN_generico.CnData.LaserTrac ' (46) Stato laser tracciatura
|
||||
m_CN.bLaserTracState = b_temp
|
||||
Case CN_generico.CnData.XYJog ' (47)
|
||||
m_CN.bXYJog = b_temp
|
||||
Case CN_generico.CnData.ZCJog ' (48)
|
||||
m_CN.bZCJog = b_temp
|
||||
Case CN_generico.CnData.ZBJog ' (49)
|
||||
m_CN.bZBCJog = b_temp
|
||||
Case CN_generico.CnData.PowerON ' (50)
|
||||
m_CN.bPowerON = b_temp
|
||||
Case CN_generico.CnData.Remote ' (51)
|
||||
m_CN.bRemote = b_temp
|
||||
Case CN_generico.CnData.Parking ' (52)
|
||||
m_CN.bParkingState = b_temp
|
||||
Case CN_generico.CnData.nAxes ' (55)
|
||||
m_CN.n_index_is_G24_active = nIndex
|
||||
m_CN.b5AxesState = b_temp
|
||||
Case CN_generico.CnData.ResetStatus ' (56)
|
||||
m_CN.bResetState = b_temp
|
||||
|
||||
nVarValue = m_CN.n_data(2)
|
||||
'EgtOutLog("Variabile PLC door addr: " & m_CN.m_szCnDataVar(CN_generico.CnData.DoorClosed) & " value: " & nVarValue)
|
||||
m_CN.nDoorClosedState = nVarValue
|
||||
|
||||
nVarValue = m_CN.n_data(4)
|
||||
'EgtOutLog("Variabile PLC control 2 addr: " & 3 & " value: " & nVarValue)
|
||||
m_CN.bLaserState = IsSetAll(nVarValue, ControlStates2.Laser)
|
||||
m_CN.bHsm = IsSetAll(nVarValue, ControlStates2.Hsm)
|
||||
m_CN.bResetState = IsSetAll(nVarValue, ControlStates2.ResetState)
|
||||
m_CN.bFeedHold = IsSetAll(nVarValue, ControlStates2.FeedHold)
|
||||
m_CN.bSpeedHold = IsSetAll(nVarValue, ControlStates2.SpindleHold)
|
||||
End Select
|
||||
Next
|
||||
'------------ SINUMERIK ONE ----------------------------------------------
|
||||
|
||||
End If
|
||||
|
||||
m_MachineStatus.DisplayPower()
|
||||
|
||||
' Flag e variabili per bottoni macchina, che verifico solo nelle pagine in cui ci sono
|
||||
If m_MainWindow.m_ActivePage = MainWindow.Pages.DirectCut Then
|
||||
If m_MainWindow.m_DirectCutPageUC.m_NewMachineButtonsType Then
|
||||
@@ -1125,6 +1441,7 @@ Public Class CNCommunication
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.CoolantStateChanged(m_CN.bCoolantState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.LaserStateChanged(m_CN.bLaserState)
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.LaserTracStateChanged(m_CN.bLaserTracState)
|
||||
' modalità vecchia
|
||||
If m_CN.Is_G24_active() Then
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.ThreeAxisStateChanged(False)
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.FiveAxisStateChanged(True)
|
||||
@@ -1153,8 +1470,25 @@ Public Class CNCommunication
|
||||
End If
|
||||
End If
|
||||
|
||||
If m_MainWindow.m_ActivePage = MainWindow.Pages.Machine Then
|
||||
If m_IsNewConsole Then
|
||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerONChanged(m_CN.bPowerON)
|
||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.PowerOFFChanged(Not m_CN.bPowerON)
|
||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
|
||||
End If
|
||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.CncModeChange(m_CN.nMachineMode)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function ReadBit(IndexBit As Integer, Val As Integer) As Boolean
|
||||
If IndexBit < 0 Then Return False
|
||||
Dim _mask = GetMaskByBit(IndexBit)
|
||||
If _mask = Mask.bit_Err Then Return False
|
||||
If (Val And _mask) = 0 Then Return False
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function SetProgramMainOrSub(bMain As Boolean) As Boolean
|
||||
Return m_CN.SetProgramMainOrSub(bMain)
|
||||
End Function
|
||||
@@ -1162,6 +1496,11 @@ Public Class CNCommunication
|
||||
Friend Function SendProgram(ByVal sCncPath As String, ByVal nNumProg As Integer,
|
||||
Optional bActivate As Boolean = True) As Boolean
|
||||
Dim bOk As Boolean = True
|
||||
|
||||
' !!!!!!!!!!!!!!!!!! FORZO IL PROGRAMMA !!!!!!!!!!!!!!!!!!
|
||||
' m_nNCType = 2
|
||||
' !!!!!!!!!!!!!!!!!! FORZO IL PROGRAMMA !!!!!!!!!!!!!!!!!!
|
||||
|
||||
' Download programma
|
||||
If m_MainWindow.m_bNCLink Then
|
||||
bOk = (m_nNCType > 0)
|
||||
@@ -1195,7 +1534,7 @@ Public Class CNCommunication
|
||||
' Attesa opportuna
|
||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||
End If
|
||||
EgtOutLog("Download_NC_prog(sCncPath, sNumProg)")
|
||||
EgtOutLog("Download_NC_prog(" & sCncPath & ", " & sNumProg.ToString & ")")
|
||||
' -------------- START DOWNLOAD --------------
|
||||
TimeSpanInit()
|
||||
bOk = bOk AndAlso (m_CN.Download_NC_prog(sCncPath, sNumProg) = 0)
|
||||
@@ -1236,7 +1575,7 @@ Public Class CNCommunication
|
||||
' Se richiesta attivazione
|
||||
If bActivate Then
|
||||
' Attivazione programma
|
||||
EgtOutLog("ActivateProgram(nNumProg)")
|
||||
EgtOutLog("ActivateProgram(" & nNumProg.ToString & ")")
|
||||
TimeSpanInit()
|
||||
bOk = bOk AndAlso (m_CN.ActivateProgram(nNumProg) = 0)
|
||||
EgtOutLog(TimeSpanEnd())
|
||||
@@ -1265,9 +1604,17 @@ Public Class CNCommunication
|
||||
Return bOk
|
||||
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,
|
||||
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
|
||||
' gestione speciale asse C
|
||||
GetSpecialCAxes()
|
||||
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)
|
||||
dA3 = If(m_nA3 >= 0, m_CN.d_axis_position(m_nA3), 0)
|
||||
@@ -1284,6 +1631,8 @@ Public Class CNCommunication
|
||||
|
||||
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
|
||||
' gestione speciale asse C
|
||||
GetSpecialCAxes()
|
||||
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)
|
||||
dA3 = If(m_nA3 >= 0, m_CN.d_axis_position(m_nA3), 0)
|
||||
@@ -1302,6 +1651,8 @@ Public Class CNCommunication
|
||||
End Function
|
||||
|
||||
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)
|
||||
dR2 = If(m_nA5 >= 0, m_CN.d_axis_position(m_nA5), 0)
|
||||
Return m_bAxesOk
|
||||
@@ -1366,3 +1717,95 @@ Public Class CNCommunication
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Public Class RefereceFlagSimens
|
||||
|
||||
Private m_SiemnesArrayIndex As Integer
|
||||
Private m_FlagIndex As Integer
|
||||
Private m_TypeArray As Integer
|
||||
' Opzionale
|
||||
Private m_IndexBit As Integer = -1
|
||||
Private m_DefaultValue As String = ""
|
||||
|
||||
Public Property SiemnesArrayIndex As Integer
|
||||
Get
|
||||
Return m_SiemnesArrayIndex
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_SiemnesArrayIndex = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property FlagIndex As Integer
|
||||
Get
|
||||
Return m_FlagIndex
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_FlagIndex = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property TypeArray As Integer
|
||||
Get
|
||||
Return m_TypeArray
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_TypeArray = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property IndexBit As String
|
||||
Get
|
||||
Return m_IndexBit
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_IndexBit = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property DefaultValue As String
|
||||
Get
|
||||
Return m_DefaultValue
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_DefaultValue = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(IndArray As Integer, Flag As Integer, nType As Integer)
|
||||
m_SiemnesArrayIndex = IndArray
|
||||
m_FlagIndex = Flag
|
||||
m_TypeArray = nType
|
||||
End Sub
|
||||
|
||||
Sub New(IndArray As Integer, Flag As Integer, nType As Integer, nIndBit As Integer)
|
||||
m_SiemnesArrayIndex = IndArray
|
||||
m_FlagIndex = Flag
|
||||
m_TypeArray = nType
|
||||
m_IndexBit = nIndBit
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class IndexArrayToBit
|
||||
|
||||
Private m_nIndex As Integer = 0
|
||||
Public ReadOnly Property nIndex As Integer
|
||||
Get
|
||||
Return m_nIndex
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sNameVar As String = ""
|
||||
Public ReadOnly Property sNameVar As String
|
||||
Get
|
||||
Return m_sNameVar
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(Index As Integer, NameVar As String)
|
||||
m_nIndex = Index
|
||||
m_sNameVar = NameVar
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -87,6 +87,7 @@ Public Class CN_Siemens
|
||||
Case 8 ' Modalita Ref Point
|
||||
sDBVarPath &= "REF_POINT"
|
||||
End Select
|
||||
' /plc/"OmagCUT_DB".CTRL.AUTO
|
||||
DVariables_WriteVariables3(sDBVarPath, 1, 1, 0, 0, "")
|
||||
Return 0
|
||||
Else
|
||||
@@ -132,7 +133,7 @@ Public Class CN_Siemens
|
||||
Public Overrides Function read_active_mode() As Short
|
||||
'EgtOutLog("Modo attivo: " & M_MMFiles.SiemensRet.n_param2)
|
||||
If m_IsSiemensOne Or m_IsActiveModeSubscription Then
|
||||
Select Case n_data(3)
|
||||
Select Case n_data(n_index_mode)
|
||||
Case 1
|
||||
Return 0
|
||||
Case 2
|
||||
@@ -152,7 +153,12 @@ Public Class CN_Siemens
|
||||
|
||||
Public Overrides Function Is_G24_active() As Boolean
|
||||
|
||||
Return M_MMFiles.SiemensRet.b_interf_G24
|
||||
If m_IsSiemensOne Or m_IsActiveModeSubscription Then
|
||||
Return b_data(n_index_is_G24_active)
|
||||
|
||||
Else
|
||||
Return M_MMFiles.SiemensRet.b_interf_G24
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
@@ -217,12 +223,12 @@ Public Class CN_Siemens
|
||||
Public Overrides Sub DVariables_WriteVariables3(VarAddr As String, ParType As Short, nVarValue As Integer, lVarValue As Long, dVarValue As Double, sVarValue As String)
|
||||
Dim n_ret As Short = Write_var(VarAddr, ParType, nVarValue, lVarValue, dVarValue, sVarValue)
|
||||
'EgtOutLog("CN SIEMENS Dopo scrittura variabile")
|
||||
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub DVariables_Read_Subscription(VarAddr As String, ParType As Short, Index As Integer)
|
||||
' Ricevo il percorso della varibile, il tipo
|
||||
Dim n_ret As Short = Read_subscription(VarAddr, ParType, Index)
|
||||
'EgtOutLog("CN SIEMENS Dopo lettura abbonamento")
|
||||
EgtOutLog(" ABBONAMENTO (Esito: " & n_ret.ToString & ") -> Address: " & VarAddr & ", Type: " & ParType.ToString & ", Index: " & Index.ToString)
|
||||
End Sub
|
||||
|
||||
'
|
||||
|
||||
@@ -8,7 +8,7 @@ Public MustInherit Class CN_generico
|
||||
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_TOOLS As Short = 100
|
||||
Public Const NUM_DATA = 56 ' 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
|
||||
|
||||
@@ -72,6 +72,10 @@ Public MustInherit Class CN_generico
|
||||
EnablePC = 54
|
||||
|
||||
nAxes = 55
|
||||
|
||||
ResetStatus = 56
|
||||
|
||||
CPos = 57
|
||||
End Enum
|
||||
|
||||
Public Enum Type As Short
|
||||
@@ -138,6 +142,9 @@ Public MustInherit Class CN_generico
|
||||
Public d_param1 As Double
|
||||
Public sz_string As String ' ( MAX 200 caratteri )
|
||||
|
||||
' Indice del vettore n_data associato alla lettura nMode
|
||||
Public n_index_mode As Integer = 0
|
||||
Public n_index_is_G24_active As Integer = 0
|
||||
Public b_data(14) As Boolean
|
||||
Public n_data(14) As Int16
|
||||
Public l_data(14) As Long
|
||||
@@ -228,6 +235,10 @@ Public MustInherit Class CN_generico
|
||||
Public bRemote As Boolean
|
||||
' Nuovi di bottoni -------------------------------------------
|
||||
|
||||
' gestione speciale asse C
|
||||
Public bCPos As Boolean = False
|
||||
Public dCPos As Double
|
||||
|
||||
' solo per NumOld
|
||||
Public bIsDripFeed As Boolean = False
|
||||
|
||||
|
||||
@@ -1683,7 +1683,16 @@ Module M_Fanuc
|
||||
sz_Err_Msg = ""
|
||||
If Not bSimulation Then
|
||||
|
||||
sz_MDI_program = sz_MDI_command
|
||||
' Nicola: 10/05/2024
|
||||
|
||||
Dim sItems As String() = sz_MDI_command.Split(";")
|
||||
Dim sNew_MDI_program As String = ""
|
||||
For Each sItem As String In sItems
|
||||
sNew_MDI_program &= sItem & vbLf
|
||||
Next
|
||||
sNew_MDI_program &= "%"
|
||||
|
||||
sz_MDI_program = sNew_MDI_program
|
||||
|
||||
' Nicola: 29/03/2023
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ Module M_MMFiles
|
||||
|
||||
#Region " Structures"
|
||||
|
||||
|
||||
<StructLayout(LayoutKind.Sequential)> _
|
||||
' Struttura per spedire un "comando" al Siemens
|
||||
<StructLayout(LayoutKind.Sequential)>
|
||||
Structure SiemensSendStruct
|
||||
|
||||
Public n_Flag As Integer
|
||||
@@ -46,7 +46,7 @@ Module M_MMFiles
|
||||
|
||||
Private SiemensSend As SiemensSendStruct
|
||||
|
||||
|
||||
' Struttura per leggere l'esito di un "comando" al Siemens
|
||||
<StructLayout(LayoutKind.Sequential)> _
|
||||
Structure SiemensRetStruct
|
||||
|
||||
@@ -75,6 +75,7 @@ Module M_MMFiles
|
||||
Public b_is_laser_ON As Boolean
|
||||
Public b_is_spindle_ON As Boolean
|
||||
|
||||
' Vettore assi macchina (file SiemensComm: axes_0_M, axes_0_P)
|
||||
<MarshalAs(UnmanagedType.ByValArray, ArraySubType:=UnmanagedType.R8, SizeConst:=16)> _
|
||||
Public d_interf_axis_position() As Double
|
||||
|
||||
@@ -176,7 +177,7 @@ Module M_MMFiles
|
||||
#End Region
|
||||
|
||||
#Region " Commands constants"
|
||||
|
||||
' Elenco codici comandi per spedire programma a SiemensComm.exe
|
||||
Enum CMD As Short
|
||||
|
||||
CMD_Download_NC_prog = 1
|
||||
@@ -205,6 +206,7 @@ Module M_MMFiles
|
||||
End Enum
|
||||
|
||||
Friend Enum VarType As Short
|
||||
TBoolean = 0
|
||||
TInteger = 1
|
||||
TLong = 2
|
||||
TDouble = 3
|
||||
@@ -343,6 +345,9 @@ Module M_MMFiles
|
||||
Function ActivateProgram(ByVal sz_part_program As String) As Short
|
||||
'EgtOutLog("ActivateProgram start dell'm_mmFiles")
|
||||
|
||||
EgtOutLog("Flag di comando: " & CMD.CMD_ActivateProgram.ToString)
|
||||
EgtOutLog("Stringa di comando: " & sz_part_program.ToString)
|
||||
|
||||
SiemensSend.n_Command = CMD.CMD_ActivateProgram
|
||||
SiemensSend.sz_string = sz_part_program
|
||||
|
||||
@@ -370,7 +375,8 @@ Module M_MMFiles
|
||||
SiemensSend.n_Command = CMD.CMD_CycleStart
|
||||
|
||||
execute_command()
|
||||
'EgtOutLog("CycleStart end dell'm_mmFiles")
|
||||
' Rimango in attesa
|
||||
EgtOutLog(" → CycleStart")
|
||||
Return SiemensRet.n_result
|
||||
|
||||
End Function
|
||||
@@ -597,16 +603,15 @@ Module M_MMFiles
|
||||
'EgtOutLog("Write_Nc_var start dell'm_mmFiles")
|
||||
SiemensSend.n_Command = CMD.CMD_Read_NC_subscription
|
||||
SiemensSend.sz_string_2 = VarAddr ' indirizzo su CN dell' oggetto da scrivere
|
||||
|
||||
EgtOutLog(" → Sottoscrivo lettura di '" & VarAddr & "'")
|
||||
SiemensSend.n_param1 = Index ' tipo di dato da scrivere
|
||||
|
||||
EgtOutLog(" Indice del vettore associato '" & Index & "'")
|
||||
SiemensSend.n_param2 = ParType ' tipo di dato da scrivere
|
||||
|
||||
EgtOutLog(" Indice tipo di variabile '" & ParType & "'")
|
||||
execute_command()
|
||||
m_MainWindow.m_CNCommunication.m_CN.sz_interf_error_message = SiemensRet.sz_interf_error_message
|
||||
|
||||
EgtOutLog("sz_interf_error_message: " & m_MainWindow.m_CNCommunication.m_CN.sz_interf_error_message)
|
||||
EgtOutLog("n_result: " & SiemensRet.n_result)
|
||||
EgtOutLog(" sz_interf_error_message: " & m_MainWindow.m_CNCommunication.m_CN.sz_interf_error_message)
|
||||
EgtOutLog(" n_result: " & SiemensRet.n_result)
|
||||
Return SiemensRet.n_result
|
||||
End Function
|
||||
|
||||
@@ -765,7 +770,7 @@ Module M_MMFiles
|
||||
End If
|
||||
|
||||
' copio variabili in abbonamento
|
||||
For Index As Integer = 0 To 5
|
||||
For Index As Integer = 0 To 14
|
||||
CurrCN.b_data(Index) = SiemensRet.b_data(Index)
|
||||
CurrCN.n_data(Index) = SiemensRet.n_data(Index)
|
||||
CurrCN.l_data(Index) = SiemensRet.l_data(Index)
|
||||
|
||||
@@ -53,14 +53,14 @@ Namespace Num
|
||||
Dim WithEvents objDRunTimeSystem As FXServer.DRunTimeSystem
|
||||
Dim WithEvents objDGroupManager As FXServer.DGroupManager
|
||||
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
|
||||
' 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 objDReadTestExectime As FXServer.DReadTestExectime
|
||||
Dim WithEvents objDPosition As FXServer.DPosition
|
||||
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 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.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_LabAmper") ' Ampère = *0.01
|
||||
'sz_var_names.Add("Application.GVL_HMI_OMAG.HMI_LabAmper") ' Amp�re = *0.01
|
||||
|
||||
' Creo lista nomi variabili PLC da leggere
|
||||
m_nCnDataVarNum = 0
|
||||
@@ -823,7 +823,7 @@ Namespace Num
|
||||
|
||||
|
||||
' 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
|
||||
|
||||
Dim edata_type As eDatatype
|
||||
@@ -996,7 +996,7 @@ Namespace Num
|
||||
d_spindle_eff(0) = CDbl(values(n))
|
||||
Case CnData.SpeedOvr ' (5) Potenziom. speed = ...
|
||||
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) Amp�re = * 0.01
|
||||
d_spindle_power = CDbl(CLng(values(n))) * 0.01
|
||||
b_spindle_power_changed = True
|
||||
Case CnData.Spindle ' (7) Stato rotazione mandrino
|
||||
@@ -1095,6 +1095,9 @@ Namespace Num
|
||||
Case CnData.EnablePC ' (54)
|
||||
nEnablePc = CInt(values(n))
|
||||
|
||||
Case CnData.CPos ' (57)
|
||||
dCPos = CDbl(values(n))
|
||||
|
||||
End Select
|
||||
Next
|
||||
|
||||
@@ -1701,11 +1704,11 @@ Namespace Num
|
||||
nTimeOut += 1
|
||||
End While
|
||||
If Not bSetModeDone Then
|
||||
EgtOutLog("Errore cambio modalità in MDI: " & TIMEOUT)
|
||||
EgtOutLog("Errore cambio modalit� in MDI: " & TIMEOUT)
|
||||
Return TIMEOUT 'Errore di timeout
|
||||
End If
|
||||
If nSetModeResult <> 0 Then
|
||||
EgtOutLog("Errore 2 cambio modalità in MDI: " & nSetModeResult)
|
||||
EgtOutLog("Errore 2 cambio modalit� in MDI: " & nSetModeResult)
|
||||
End If
|
||||
Return nSetModeResult
|
||||
|
||||
|
||||
@@ -289,6 +289,7 @@ Namespace Num
|
||||
|
||||
' Stringhe valide : "COM" o "XIP01, 0, 10, 0, 0, 0"
|
||||
Dim nret As Integer = NC_connect(m_szCnDataVar(CnData.Comm))
|
||||
EgtOutLog(" → Risultatao apertura connessiione: " & nret)
|
||||
If nret <> 0 Then Return False
|
||||
|
||||
n_state = 2
|
||||
@@ -583,7 +584,6 @@ Namespace Num
|
||||
End Function
|
||||
|
||||
Function Read_machine_pos() As Int16
|
||||
|
||||
Dim nret As Int16
|
||||
Dim i, n As Integer
|
||||
|
||||
@@ -1297,14 +1297,14 @@ Namespace Num
|
||||
End Function
|
||||
|
||||
Function VerifyBusy() As eStateType
|
||||
For I As Integer = 0 To 50
|
||||
For I As Integer = 0 To 150
|
||||
If global_state <> eStateType.READY Then
|
||||
System.Threading.Thread.Sleep(SLEEP_TIME)
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
EgtOutLog("eStateType: " & global_state.ToString & " -- if eStateType=0 it means READY")
|
||||
Return global_state
|
||||
|
||||
End Function
|
||||
|
||||
@@ -115,6 +115,9 @@
|
||||
<Reference Include="AxInterop.FXLib">
|
||||
<HintPath>..\..\EgtProg\OmagCUT\AxInterop.FXLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DotNetZip">
|
||||
<HintPath>..\..\EgtProg\OmagCUT\DotNetZip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EgtPHOTOLib">
|
||||
<HintPath>..\..\EgtProg\Dll32\EgtPHOTOLib.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -142,9 +145,6 @@
|
||||
<HintPath>..\..\EgtProg\OmagCUT\Interop.FXServer.dll</HintPath>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\..\EgtProg\OmagCUT\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationFramework.Aero" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SQLite, Version=1.0.112.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">
|
||||
@@ -174,9 +174,15 @@
|
||||
<Compile Include="AboutBox\AboutBoxWD.xaml.vb">
|
||||
<DependentUpon>AboutBoxWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CadCuts\ChooseTestToolWD.xaml.vb">
|
||||
<DependentUpon>ChooseTestToolWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CadCuts\SelectPartFromFamilyWD.xaml.vb">
|
||||
<DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CadCuts\SelParkIndWD.xaml.vb">
|
||||
<DependentUpon>SelParkIndWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CAM\CamPolishing.vb" />
|
||||
<Compile Include="DirectCuts\ControlsDirectCutUC.xaml.vb">
|
||||
<DependentUpon>ControlsDirectCutUC.xaml</DependentUpon>
|
||||
@@ -209,6 +215,9 @@
|
||||
<Compile Include="DrawImport\UnderDrillUC.xaml.vb">
|
||||
<DependentUpon>UnderDrillUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LicenseWindow.xaml.vb">
|
||||
<DependentUpon>LicenseWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Machine\AlarmsPageUC.xaml.vb">
|
||||
<DependentUpon>AlarmsPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -441,10 +450,18 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="CadCuts\ChooseTestToolWD.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="CadCuts\SelectPartFromFamilyWD.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="CadCuts\SelParkIndWD.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="DirectCuts\ControlsDirectCutUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -485,6 +502,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>XamlIntelliSenseFileGenerator</Generator>
|
||||
</Page>
|
||||
<Page Include="LicenseWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Machine\AlarmsPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -1352,6 +1373,45 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\ImportPageListBoxImages\5.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Muovi-grezzo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\ON_OFF-REG.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Move-Spot-Reg.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Logo-Egalware.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Logo-Egalware %282%29.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\NewIcons\Logo-Egalware %283%29.png" />
|
||||
<Resource Include="Resources\NewIcons\RawHeight.png" />
|
||||
</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" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
||||
|
||||
@@ -133,6 +133,7 @@
|
||||
<BitmapImage x:Key="PhotoImg" UriSource="Resources/Photo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="RawPartImg" UriSource="Resources/RawPart.png"></BitmapImage>
|
||||
<BitmapImage x:Key="RawProbeImg" UriSource="Resources/RawProbe.png"></BitmapImage>
|
||||
<BitmapImage x:Key="RawHeightImg" UriSource="Resources/NewIcons/RawHeight.png"></BitmapImage>
|
||||
<BitmapImage x:Key="RightArrowImg" UriSource="Resources/RightArrow.png"></BitmapImage>
|
||||
<BitmapImage x:Key="SawProbeImg" UriSource="Resources/SawProbe.png"></BitmapImage>
|
||||
<BitmapImage x:Key="SendImg" UriSource="Resources/Send.png"></BitmapImage>
|
||||
@@ -171,6 +172,7 @@
|
||||
<BitmapImage x:Key="Vein-matchImg" UriSource="Resources/NewIcons/Vein-match.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Test-lamaImg" UriSource="Resources/NewIcons/Test-lama.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Parcheggia-pezzoImg" UriSource="Resources/NewIcons/Parcheggia-pezzo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Muovi-grezzoImg" UriSource="Resources/NewIcons/Muovi-grezzo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Inserisci-pezzoImg" UriSource="Resources/NewIcons/Inserisci-pezzo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Elimina-pezzoImg" UriSource="Resources/NewIcons/Elimina-pezzo.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
|
||||
@@ -225,6 +227,7 @@
|
||||
<BitmapImage x:Key="QualityWJImg" UriSource="Resources/NewIcons/Quality.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Fine-Allunga-AccorciaImg" UriSource="Resources/NewIcons/Fine-allunga-o-accorcia.png"></BitmapImage>
|
||||
<BitmapImage x:Key="ON_OFF-singolo-taglioImg" UriSource="Resources/NewIcons/ON_OFF-singolo-taglio.png"></BitmapImage>
|
||||
<BitmapImage x:Key="ON_OFF-REGImg" UriSource="Resources/NewIcons/ON_OFF-REG.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Tutti-ONImg" UriSource="Resources/NewIcons/Tutti-ON.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Tutti-OFFImg" UriSource="Resources/NewIcons/Tutti-OFF.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Inizio-Centro-FuoriImg" UriSource="Resources/NewIcons/Inizio-centro-fuori.png"></BitmapImage>
|
||||
@@ -240,6 +243,7 @@
|
||||
<BitmapImage x:Key="Tutti-allungaImg" UriSource="Resources/NewIcons/Tutti-allunga.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Tutti-accorciaImg" UriSource="Resources/NewIcons/Tutti-accorcia.png"></BitmapImage>
|
||||
<BitmapImage x:Key="LastProjImg" UriSource="Resources/NewIcons/PlayStep.png"></BitmapImage>
|
||||
<BitmapImage x:Key="Move-Spot-RegImg" UriSource="Resources/NewIcons/Move-Spot-Reg.png"></BitmapImage>
|
||||
|
||||
<FontFamily x:Key="OmagCut_Font">./Resources/Fonts/#Century Gothic</FontFamily>
|
||||
|
||||
@@ -791,7 +795,13 @@
|
||||
<Setter Property="Margin" Value="0,8,6,4"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________ -->
|
||||
<!--Style di un immagine in al posto di una text-->
|
||||
<Style x:Key="OmagCut_TextIcon" TargetType="{x:Type Image}" >
|
||||
<Setter Property="Width" Value="30"/>
|
||||
<Setter Property="Height" Value="30"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!-- ScrollBar & it's component (RepeatButton, Thumb) -->
|
||||
|
||||
@@ -1188,7 +1198,7 @@
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________ -->
|
||||
<!-- ______________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!--TextBox-->
|
||||
|
||||
@@ -1263,11 +1273,14 @@
|
||||
|
||||
<Style x:Key="OmagCut_FixedTextBox" TargetType="{x:Type EgtWPFLib:EgtTextBox}" BasedOn="{StaticResource OmagCut_TextBox}">
|
||||
<Setter Property="BorderBrush" Value="{StaticResource OmagCut_Gray}"/>
|
||||
<Setter Property="Background" Value="White"/>
|
||||
<Setter Property="Background" Value="White"/>
|
||||
<Setter Property="IsReadOnly" Value="True"/>
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="Template" Value="{StaticResource FixedTextBoxTemplate}" />
|
||||
</Style>
|
||||
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
|
||||
<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________ -->
|
||||
|
||||
|
||||
@@ -1304,6 +1304,8 @@ Public Class OptionsPageUC
|
||||
End If
|
||||
Try
|
||||
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
|
||||
zip.AlternateEncodingUsage = Ionic.Zip.ZipOption.Always
|
||||
zip.AlternateEncoding = Text.Encoding.UTF8
|
||||
' aggiungo file macchine
|
||||
For Each sMachineName As String In Machines
|
||||
Dim sMachineDir As String = m_MainWindow.GetMachinesRootDir() & "\" & sMachineName
|
||||
|
||||
@@ -7,79 +7,87 @@
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1280"
|
||||
Initialized="CurrentProjectPage_Initialized" Loaded="CurrentProjectPage_Loaded">
|
||||
|
||||
<!-- Definizione della CurrentProjectPage -->
|
||||
<Grid Name="CurrentProjectPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Definizione della Grid superiore -->
|
||||
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid laterale -->
|
||||
<Grid Grid.RowSpan="3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="7*"/>
|
||||
<!-- Definizione della CurrentProjectPage -->
|
||||
<Grid Name="CurrentProjectPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Definizione della Grid con le caratteristiche del progetto -->
|
||||
<!-- Definizione della Grid superiore -->
|
||||
<Grid Name="UpperButtonGrid" Grid.Column="1" Grid.Row="0" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid laterale -->
|
||||
<Grid Grid.RowSpan="3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="7*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Definizione della Grid con le caratteristiche del progetto -->
|
||||
<Border Name="CurrProjGrid" Style="{DynamicResource OmagCut_MachiningBorder}" Grid.Row="0" >
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="MaterialTxBl" Grid.Row="0"
|
||||
Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="MaterialTxBx" Grid.Column="1" Grid.Row="0" Width="100"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}"/>
|
||||
<TextBlock Name="HeightTxBl" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HeightTxBx" Grid.Column="1" Grid.Row="1" Width="100"
|
||||
<Image Name="MaterialTxBl"
|
||||
Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_TextIcon}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="MaterialTxBx" Grid.Column="1" Grid.Row="0" Margin="0,0,10,0"
|
||||
TextAlignment="Right" Style="{DynamicResource OmagCut_FixedTextBox}"/>
|
||||
<Image Name="HeightTxBl" Grid.Row="1"
|
||||
Source="{DynamicResource RawHeightImg}" Style="{StaticResource OmagCut_TextIcon}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="HeightTxBx" Grid.Column="1" Grid.Row="1" Margin="0,0,10,0"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}" TextAlignment="Right"/>
|
||||
<Image Name="ToolTxBl" Grid.Row="2"
|
||||
Source="{DynamicResource DB-utensiliImg}" Style="{StaticResource OmagCut_TextIcon}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="ToolTxBx" Grid.Column="1" Grid.Row="2" Margin="0,0,10,0"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}" TextAlignment="Right"/>
|
||||
<Image Name="MachiningTxBl" Grid.Row="3"
|
||||
Source="{DynamicResource DB-lavorazioniImg}" Style="{StaticResource OmagCut_TextIcon}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="MachiningTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,10,0"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}" TextAlignment="Right"/>
|
||||
<TextBlock Name="ToolTxBl" Grid.Row="2" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="ToolTxBx" Grid.Column="1" Grid.Row="2" Width="100"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}"/>
|
||||
<TextBlock Name="MachiningTxBl" Grid.Row="3"
|
||||
Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="MachiningTxBx" Grid.Column="1" Grid.Row="3" Width="100"
|
||||
Style="{DynamicResource OmagCut_FixedTextBox}"/>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</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" >
|
||||
<TextBlock Name="OutMessageTxBl" TextAlignment="Center"
|
||||
<Border Name="OutMessageBrd" Grid.Row="2" >
|
||||
<TextBlock Name="OutMessageTxBl" TextAlignment="Center"
|
||||
Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</Border>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
<Grid Name="SceneHostGrid" Grid.Row="1" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="6*"/>
|
||||
<ColumnDefinition Width="1.2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.IO
|
||||
Imports System.Security.Cryptography
|
||||
Imports System.Windows.Interop
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
@@ -7,8 +8,10 @@ Imports EgtWPFLib5
|
||||
Public Class CurrentProjectPageUC
|
||||
' Dichiarazione eventi
|
||||
Friend Event OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Friend Event OnMouseDownScene_DoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Friend Event OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Friend Event OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Friend Event OnKeyCancelDownScene(sender As Object, e As System.Windows.Forms.KeyEventArgs)
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
' Dichiarazione delle Page UserControl
|
||||
@@ -17,7 +20,8 @@ Public Class CurrentProjectPageUC
|
||||
Private m_bFirst As Boolean = True
|
||||
' Dichiarazione 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
|
||||
Private m_nCurrProj As Integer = 0
|
||||
' Dati del grezzo
|
||||
@@ -53,15 +57,17 @@ Public Class CurrentProjectPageUC
|
||||
|
||||
'Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
||||
CurrentProjectSceneHost.Child = CurrentProjectScene
|
||||
CurrentProjectSceneHost.SetValue(Grid.ColumnProperty, 1)
|
||||
CurrentProjectSceneHost.SetValue(Grid.RowProperty, 1)
|
||||
Me.CurrentProjectPageGrid.Children.Add(CurrentProjectSceneHost)
|
||||
CurrentProjectSceneHost.SetValue(Grid.ColumnProperty, 0)
|
||||
CurrentProjectSceneHost.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
' CurrentProjectSceneHost.SetValue(Grid.RowProperty, 1)
|
||||
'Me.CurrentProjectPageGrid.Children.Add(CurrentProjectSceneHost)
|
||||
Me.SceneHostGrid.Children.Add(CurrentProjectSceneHost)
|
||||
|
||||
'Imposto i messaggi letti dal file dei messaggi
|
||||
MaterialTxBl.Text = EgtMsg(MSG_RAWPARTPAGEUC + 9) 'Material - Materiale
|
||||
HeightTxBl.Text = EgtMsg(MSG_RAWPARTPAGEUC + 5) 'Height - Spessore
|
||||
ToolTxBl.Text = EgtMsg(MSG_CADCUTPAGEUC + 11) 'Tool - Utensile
|
||||
MachiningTxBl.Text = EgtMsg(MSG_CADCUTPAGEUC + 12) 'Machining - Lavorazione
|
||||
'Imposto i messaggi letti dal file dei messaggi
|
||||
MaterialTxBl.ToolTip = EgtMsg(MSG_RAWPARTPAGEUC + 9) 'Material - Materiale
|
||||
HeightTxBl.ToolTip = EgtMsg(MSG_RAWPARTPAGEUC + 5) 'Height - Spessore
|
||||
ToolTxBl.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 11) 'Tool - Utensile
|
||||
MachiningTxBl.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 12) 'Machining - Lavorazione
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -107,7 +113,7 @@ Public Class CurrentProjectPageUC
|
||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
||||
CurrentProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
|
||||
Dim bProd As Boolean = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_BASE)
|
||||
Dim bProd As Boolean = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_BASE) Or m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_LIGHT)
|
||||
If Not CurrentProjectScene.Init() Or Not bProd Then
|
||||
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
||||
Me.CurrentProjectPageGrid.Children.Remove(CurrentProjectSceneHost)
|
||||
@@ -118,11 +124,25 @@ Public Class CurrentProjectPageUC
|
||||
#Else
|
||||
' Se manca la chiave
|
||||
If m_MainWindow.GetKeyLevel() = -1 Or m_MainWindow.GetKeyLevel() = -2 Then
|
||||
EgtOutLog("Missing Dongle")
|
||||
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
|
||||
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
|
||||
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
|
||||
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
If Not EgtGetNetHwKey() Then
|
||||
EgtOutLog("Missing Dongle")
|
||||
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
|
||||
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
|
||||
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
|
||||
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
Else
|
||||
EgtOutLog("NetDongle is full")
|
||||
' Box di avviso slot chiave di rete occupato : "Chiave di Rete completamente occupata. \n Uscire dal programma su un altro PC." "Errore"
|
||||
Dim sText As String = EgtMsg(10110) & vbCrLf & EgtMsg(10111)
|
||||
Dim sTitle As String = EgtMsg(10101)
|
||||
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, sTitle, sText, EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
End If
|
||||
ElseIf m_MainWindow.GetKeyLevel() = -9 Then
|
||||
EgtOutLog("Missing Link with Net Dongle")
|
||||
' Box di avviso chiave mancante : "Collegamento con la Chiave di rete non riuscito. \n Verificare la connessione." "Errore"
|
||||
Dim sText As String = EgtMsg(10108) & vbCrLf & EgtMsg(10109)
|
||||
Dim sTitle As String = EgtMsg(10101)
|
||||
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, sTitle, sText, EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
' Altrimenti manca la licenza
|
||||
Else
|
||||
EgtOutLog("Problems with Licence")
|
||||
@@ -176,7 +196,8 @@ Public Class CurrentProjectPageUC
|
||||
' Inizializzo gestore lavorazioni
|
||||
EgtInitMachMgr(m_MainWindow.GetMachinesRootDir(), m_MainWindow.GetToolMakersDir())
|
||||
m_bFirst = False
|
||||
|
||||
Dim bOrtoGraphic As Boolean = (GetPrivateProfileInt(S_SCENE, K_ORTOGRAPHIC, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
EgtSetCameraType(bOrtoGraphic, True)
|
||||
' creo nuovo progetto
|
||||
m_nCurrProj = GetPrivateProfileInt(S_GENERAL, K_LASTPROJ, 0, m_MainWindow.GetIniFile())
|
||||
'NewProject()
|
||||
@@ -196,9 +217,17 @@ Public Class CurrentProjectPageUC
|
||||
Else
|
||||
MaterialTxBx.Text = "-----"
|
||||
End If
|
||||
' Visualizzo lama e lavorazione correnti
|
||||
ToolTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||
|
||||
' se macchina waterjet e senza una lama corrente impostata allora visualizzo info WJ
|
||||
If m_MainWindow.m_CurrentMachine.bWaterJet And String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrSaw) Then
|
||||
ToolTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrWaterJet
|
||||
MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrWaterJetting
|
||||
'& "-" & m_MainWindow.m_CurrentMachine.sCurrWaterJettingQuality
|
||||
Else
|
||||
ToolTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub StartProgram()
|
||||
@@ -276,7 +305,7 @@ Public Class CurrentProjectPageUC
|
||||
' se apro la finestra "OpenFolder" l'assegnazione dei Children è fatta direttamente nella classe ProjectMgrUC
|
||||
If MyStartLancherWD.CurrSelection <> MODE_LAUNCHER.OpenFolder Then
|
||||
' Carico sottopagina opportuna
|
||||
If GetProjectType() <> PRJ_TYPE.FRAMES Then
|
||||
If GetProjectType() <> PRJ_TYPE.FRAMES And Not m_MainWindow.m_OnlyFrame Then
|
||||
CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||
m_MainWindow.CadCutBtn.IsChecked = True
|
||||
@@ -314,6 +343,10 @@ Public Class CurrentProjectPageUC
|
||||
RaiseEvent OnMouseDownScene(sender, e)
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyMouseDownScene_DoubleClick(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.MouseDoubleClick
|
||||
RaiseEvent OnMouseDownScene_DoubleClick(sender, e)
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.OnMouseMoveScene
|
||||
RaiseEvent OnMouseMoveScene(sender, e)
|
||||
End Sub
|
||||
@@ -326,6 +359,10 @@ Public Class CurrentProjectPageUC
|
||||
SetInfoMessage(DistToString(vtDist))
|
||||
End Sub
|
||||
|
||||
Private Sub OnMyKeyCancelDownScene(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles CurrentProjectScene.KeyDown
|
||||
RaiseEvent OnKeyCancelDownScene(sender, e)
|
||||
End Sub
|
||||
|
||||
' Gestione progetto
|
||||
|
||||
Friend Sub SetNextProjectIndex()
|
||||
@@ -399,15 +436,29 @@ Public Class CurrentProjectPageUC
|
||||
' prima di parcheggiare svuoto dei pezzi in parcheggio sia vuota
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.ResetListOfGruopInPark()
|
||||
' 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()
|
||||
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
|
||||
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
|
||||
VeinMatching.UpdatePart(nId2)
|
||||
' Passo al pezzo successivo
|
||||
nId2 = EgtGetNextPart(nId2)
|
||||
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
|
||||
SetTotalArea(dTotArea)
|
||||
UpdateToProduceArea()
|
||||
@@ -422,7 +473,7 @@ Public Class CurrentProjectPageUC
|
||||
Return True
|
||||
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
|
||||
Dim nFixtId As Integer = EgtGetFirstNameInGroup(EgtGetFirstMachGroup(), MACH_FIXT_GROUP)
|
||||
Dim nAddTabId As Integer = EgtGetFirstNameInGroup(nFixtId, MACH_ADD_TABLE)
|
||||
@@ -434,7 +485,10 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
' Se valore cambiato, aggiorno...
|
||||
Dim dDeltaZ As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable - dCurrAddTab
|
||||
If Math.Abs(dDeltaZ) > EPS_SMALL Or bForced Then
|
||||
Dim bChanged As Boolean = (Math.Abs(dDeltaZ) > EPS_SMALL)
|
||||
If bChanged Or bForced Then
|
||||
Dim bOldEnMod As Boolean = EgtGetEnableModified()
|
||||
If Not bChanged AndAlso bOldEnMod Then EgtDisableModified()
|
||||
AddAdditionalTable()
|
||||
UpdateAllRawsZ(dDeltaZ)
|
||||
If GetPhoto() <> GDB_ID.NULL Then
|
||||
@@ -444,12 +498,13 @@ Public Class CurrentProjectPageUC
|
||||
ShowPhoto(False)
|
||||
Dim nRawGrpId As Integer = EgtGetFirstRawPart()
|
||||
While nRawGrpId <> GDB_ID.NULL
|
||||
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup( nRawGrpId, NAME_RAW_SOLID)
|
||||
If nRawSolidId <> GDB_ID.NULL Then EgtSetTextureName( nRawSolidId, PHOTO_NAME)
|
||||
nRawGrpId = EgtGetNextRawPart( nRawGrpId)
|
||||
Dim nRawSolidId As Integer = EgtGetFirstNameInGroup(nRawGrpId, NAME_RAW_SOLID)
|
||||
If nRawSolidId <> GDB_ID.NULL Then EgtSetTextureName(nRawSolidId, PHOTO_NAME)
|
||||
nRawGrpId = EgtGetNextRawPart(nRawGrpId)
|
||||
End While
|
||||
End If
|
||||
End If
|
||||
If Not bChanged AndAlso bOldEnMod Then EgtEnableModified()
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
@@ -469,12 +524,14 @@ Public Class CurrentProjectPageUC
|
||||
' Nuova geometria
|
||||
Dim nAddTabId As Integer = GDB_ID.NULL
|
||||
' Se esiste geometria di riferimento
|
||||
Dim nRefAddTabId = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( EgtGetTableId( MAIN_TAB), "SOLID"), MACH_ADD_TABLE)
|
||||
Dim sNameTable As String = MAIN_TAB
|
||||
EgtGetTableName(sNameTable)
|
||||
Dim nRefAddTabId = EgtGetFirstNameInGroup(EgtGetFirstNameInGroup(EgtGetTableId(sNameTable), "SOLID"), MACH_ADD_TABLE)
|
||||
If nRefAddTabId <> GDB_ID.NULL Then
|
||||
nAddTabId = EgtCopyGlob( nRefAddTabId, nFixtId)
|
||||
EgtSetStatus( nAddTabId, GDB_ST.ON_)
|
||||
EgtScale( nAddTabId, new Frame3d( ptMin), 1, 1, dAddTable / 10)
|
||||
' altrimenti la creo
|
||||
nAddTabId = EgtCopyGlob(nRefAddTabId, nFixtId)
|
||||
EgtSetStatus(nAddTabId, GDB_ST.ON_)
|
||||
EgtScale(nAddTabId, New Frame3d(ptMin), 1, 1, dAddTable / 10)
|
||||
' altrimenti la creo
|
||||
Else
|
||||
' Aggiungo sovratavola nel gruppo dei bloccaggi
|
||||
ptMax.z -= DELTAZ_ADDTAB
|
||||
@@ -485,7 +542,7 @@ Public Class CurrentProjectPageUC
|
||||
' Sistemazioni finali
|
||||
If nAddTabId = GDB_ID.NULL Then Return False
|
||||
EgtSetName(nAddTabId, MACH_ADD_TABLE)
|
||||
EgtSetColor(nAddTabId, New Color3d(150, 75, 0, 100), True)
|
||||
If nRefAddTabId = GDB_ID.NULL Then EgtSetColor(nAddTabId, New Color3d(150, 75, 0, 100), True)
|
||||
EgtSetInfo(nAddTabId, KEY_ADD_TABLE, dAddTable)
|
||||
Return True
|
||||
End Function
|
||||
@@ -542,6 +599,9 @@ Public Class CurrentProjectPageUC
|
||||
Else
|
||||
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0))
|
||||
End If
|
||||
|
||||
'SelParkIndWD.UpdateViewOnParkInd(False)
|
||||
|
||||
' Dichiaro progetto non modificato
|
||||
EgtResetModified()
|
||||
Return True
|
||||
@@ -566,8 +626,8 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
' Se la macchina del file è quella impostata
|
||||
If String.Compare(sFileMachine, m_MainWindow.GetCurrMachine(), True) = 0 Then
|
||||
AdjustAdditionalTable( True)
|
||||
' altrimenti avverto, porto i pezzi in parcheggio e cancello il grezzo
|
||||
AdjustAdditionalTable(True)
|
||||
' altrimenti avverto, porto i pezzi in parcheggio e cancello il grezzo
|
||||
Else
|
||||
' Emetto messaggio
|
||||
Dim sOut As String = EgtMsg(90320) & " (" & sFileMachine & ")" ' Macchina diversa
|
||||
@@ -717,6 +777,17 @@ Public Class CurrentProjectPageUC
|
||||
' Notifico a foto il cambio di path
|
||||
EgtChangePhotoPath(nPhotoId, sNewPhoto)
|
||||
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, Nothing)
|
||||
SelParkIndWD.sActualProj = String.Empty
|
||||
SelParkIndWD.CopyImgSvg(sNewFileName, Nothing)
|
||||
End If
|
||||
'--------------------------------------------------------------------------------
|
||||
|
||||
' Se assente, inserisco contrassegno di progetto OmagCut valido
|
||||
AddProjectMark()
|
||||
' Eseguo
|
||||
@@ -727,18 +798,20 @@ Public Class CurrentProjectPageUC
|
||||
m_MruFiles.Add(sPath)
|
||||
' Dichiaro progetto non modificato
|
||||
EgtResetModified()
|
||||
|
||||
EgtOutLog("PROJECT " & CurrProjName & " SAVED")
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function ExportProject( sPath As String) As Boolean
|
||||
Friend Function ExportProject(sPath As String) As Boolean
|
||||
' Copio eventuale fotografia
|
||||
Dim nPhotoId As Integer = GetPhoto()
|
||||
If nPhotoId <> GDB_ID.NULL Then
|
||||
' Path originale
|
||||
Dim sPhoto As String = String.Empty
|
||||
EgtGetPhotoPath( nPhotoId, sPhoto)
|
||||
EgtGetPhotoPath(nPhotoId, sPhoto)
|
||||
' 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
|
||||
If Not String.Equals(sPhoto, sNewPhoto, StringComparison.InvariantCultureIgnoreCase) Then
|
||||
Try
|
||||
@@ -753,7 +826,7 @@ Public Class CurrentProjectPageUC
|
||||
' Se assente, inserisco contrassegno di progetto OmagCut valido
|
||||
AddProjectMark()
|
||||
' Eseguo copia
|
||||
Return SaveFile( sPath)
|
||||
Return SaveFile(sPath)
|
||||
End Function
|
||||
|
||||
Friend Function GetCurrentProject() As Integer
|
||||
@@ -840,7 +913,7 @@ Public Class CurrentProjectPageUC
|
||||
EgtSetName(nMarkId, NAME_PROJMARK)
|
||||
EgtSetLevel(nMarkId, GDB_LV.SYSTEM)
|
||||
EgtSetInfo(nMarkId, INFO_REDUCEDCUT, nReducedCut)
|
||||
' altrimenti, aggiorno il flag dei tagli ridotti
|
||||
' altrimenti, aggiorno il flag dei tagli ridotti
|
||||
Else
|
||||
Dim nMarkReducedCut As Integer = 0
|
||||
If Not EgtGetInfo(nMarkId, INFO_REDUCEDCUT, nMarkReducedCut) OrElse nMarkReducedCut <> nReducedCut Then
|
||||
@@ -996,10 +1069,16 @@ Public Class CurrentProjectPageUC
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateMachiningTxBx()
|
||||
MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||
' se macchina waterjet e senza uscita lama allora visualizzo info WJ
|
||||
If m_MainWindow.m_CurrentMachine.bWaterJet And EgtGetHeadId("H1") = GDB_ID.NULL Then
|
||||
MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrWaterJetting
|
||||
'& "-" & m_MainWindow.m_CurrentMachine.sCurrWaterJettingQuality
|
||||
Else
|
||||
MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' Gestione fotografia della lastra (compreso riconoscimento contorno)
|
||||
' Gestione fotografia della lastra (compreso riconoscimento contorno)
|
||||
|
||||
Friend Function LoadPhoto(sPath As String) As Boolean
|
||||
' Verifico esistenza file immagine
|
||||
@@ -1293,23 +1372,23 @@ Public Class CurrentProjectPageUC
|
||||
|
||||
' 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()
|
||||
Return EgtSetInfo(nMarkId, INFO_TOTAREA, dTotArea)
|
||||
End Function
|
||||
|
||||
Friend Function UpdateTotalArea( dNewArea As Double) As Boolean
|
||||
Friend Function UpdateTotalArea(dNewArea As Double) As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Dim dTotArea As Double = 0
|
||||
EgtGetInfo( nMarkId, INFO_TOTAREA, dTotArea)
|
||||
dTotArea = Math.Max( dTotArea + dNewArea, 0)
|
||||
EgtGetInfo(nMarkId, INFO_TOTAREA, dTotArea)
|
||||
dTotArea = Math.Max(dTotArea + dNewArea, 0)
|
||||
Return EgtSetInfo(nMarkId, INFO_TOTAREA, dTotArea)
|
||||
End Function
|
||||
|
||||
Friend Function GetTotalArea() As Double
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Dim dTotArea As Double = 0
|
||||
EgtGetInfo( nMarkId, INFO_TOTAREA, dTotArea)
|
||||
EgtGetInfo(nMarkId, INFO_TOTAREA, dTotArea)
|
||||
Return dTotArea
|
||||
End Function
|
||||
|
||||
@@ -1317,17 +1396,17 @@ Public Class CurrentProjectPageUC
|
||||
Dim dToProdArea As Double = 0
|
||||
' Se programma non ancora inviato al CN, ciclo sui pezzi nella lastra
|
||||
If GetProjectNcProgSent() = 0 Then
|
||||
Dim nPartInRawId As Integer = EgtGetFirstPartInRawPart( CamAuto.GetCurrentRaw())
|
||||
Dim nPartInRawId As Integer = EgtGetFirstPartInRawPart(CamAuto.GetCurrentRaw())
|
||||
While nPartInRawId <> GDB_ID.NULL
|
||||
dToProdArea += GeomCalc.GetPartArea( nPartInRawId)
|
||||
nPartInRawId = EgtGetNextPartInRawPart( nPartInRawId)
|
||||
dToProdArea += GeomCalc.GetPartArea(nPartInRawId)
|
||||
nPartInRawId = EgtGetNextPartInRawPart(nPartInRawId)
|
||||
End While
|
||||
End If
|
||||
' Ciclo sui pezzi in parcheggio
|
||||
Dim nPartId As Integer = EgtGetFirstPart()
|
||||
While nPartId <> GDB_ID.NULL
|
||||
dToProdArea += GeomCalc.GetPartArea( nPartId)
|
||||
nPartId = EgtGetNextPart( nPartId)
|
||||
dToProdArea += GeomCalc.GetPartArea(nPartId)
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtSetInfo(nMarkId, INFO_TOPRODAREA, dToProdArea)
|
||||
@@ -1336,16 +1415,16 @@ Public Class CurrentProjectPageUC
|
||||
Friend Function GetToProduceArea() As Double
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Dim dToProdArea As Double = 0
|
||||
EgtGetInfo( nMarkId, INFO_TOPRODAREA, dToProdArea)
|
||||
EgtGetInfo(nMarkId, INFO_TOPRODAREA, dToProdArea)
|
||||
Return dToProdArea
|
||||
End Function
|
||||
|
||||
Friend Sub ShowAreas()
|
||||
' Recupero il gruppo di Mark e lo svuoto
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
EgtEmptyGroup( nMarkId)
|
||||
EgtEmptyGroup(nMarkId)
|
||||
' 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
|
||||
Dim dTotArea As Double = GetTotalArea()
|
||||
Dim dToProdArea As Double = GetToProduceArea()
|
||||
@@ -1357,23 +1436,29 @@ Public Class CurrentProjectPageUC
|
||||
End If
|
||||
' Scritte
|
||||
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 sUnit As String = " m²"
|
||||
If Not EgtUiUnitsAreMM() Then
|
||||
dCoeff = 1.0 / ( 12 * ONEINCH * 12 * ONEINCH)
|
||||
dCoeff = 1.0 / (12 * ONEINCH * 12 * ONEINCH)
|
||||
sUnit = " ft²"
|
||||
End If
|
||||
Dim sText As String = EgtMsg( 90328) & " " & DoubleToString( dTotArea * 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)
|
||||
EgtSetColor( nText, New Color3d( 0, 0, 0))
|
||||
Dim sText As String = EgtMsg(90328) & " " & DoubleToString(dTotArea * 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)
|
||||
EgtSetColor(nText, New Color3d(0, 0, 0))
|
||||
End Sub
|
||||
|
||||
Friend Sub SetAreasStatus( bShow As Boolean)
|
||||
Friend Sub SetAreasStatus(bShow As Boolean)
|
||||
Dim nMarkId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK)
|
||||
If nMarkId = GDB_ID.NULL Then Return
|
||||
EgtSetStatus( nMarkId, If( bShow, GDB_ST.ON_, GDB_ST.OFF))
|
||||
|
||||
' Disabilito impostazione modificato
|
||||
Dim bOldEnMod As Boolean = EgtGetEnableModified()
|
||||
If bOldEnMod Then EgtDisableModified()
|
||||
' Cambio stato visualizzazione
|
||||
EgtSetStatus(nMarkId, If(bShow, GDB_ST.ON_, GDB_ST.OFF))
|
||||
' Se necessario riabilito impostazione modificato
|
||||
If bOldEnMod Then EgtEnableModified()
|
||||
End Sub
|
||||
|
||||
' Gestione messaggi in interfaccia
|
||||
|
||||
@@ -6,33 +6,40 @@
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="OpenPage_Initialized" Loaded="OpenPage_Loaded" Unloaded="OpenPage_Unloaded">
|
||||
|
||||
<!-- Definizione della OpenPage -->
|
||||
<Border>
|
||||
<Grid Name="OpenPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
|
||||
<!-- Definizione della OpenPage -->
|
||||
<Border>
|
||||
<Grid Name="OpenPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</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}"/>
|
||||
|
||||
<Grid Grid.Row="1" Grid.RowSpan="2">
|
||||
<!-- Definizione della Grid Superiore -->
|
||||
<Grid Name="UpperButtonsGrid" Grid.Column="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>
|
||||
<RowDefinition Height="6.5*"/>
|
||||
<RowDefinition Height="0.65*"/>
|
||||
@@ -53,39 +60,39 @@
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Border Name="MessageBrd" Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="Gray">
|
||||
<TextBlock Name="MessageTxBx" TextAlignment="Center"
|
||||
|
||||
<Border Name="MessageBrd" Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="Gray">
|
||||
<TextBlock Name="MessageTxBx" TextAlignment="Center"
|
||||
Style="{DynamicResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</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>
|
||||
</Border>
|
||||
|
||||
<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}"/>
|
||||
</Button>
|
||||
</Button>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
<Button Name="OkBtn" Grid.Column="3" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
<Button Name="ExitBtn" Grid.Column="4" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||
<Image Source="{DynamicResource XImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
</Button>
|
||||
<Button Name="ExitBtn" Grid.Column="4" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||
<Image Source="{DynamicResource XImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -5,6 +5,7 @@ Public Class OpenPageUC
|
||||
|
||||
'Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private m_SelParkInd As SelParkIndWD
|
||||
|
||||
'Dichiarazione dello UserControl SceneButtons
|
||||
Private m_SceneButtons As SceneButtonsUC
|
||||
@@ -35,11 +36,12 @@ Public Class OpenPageUC
|
||||
|
||||
' Assegnazione scena all'host e posizionamento nella OpenPageGrid
|
||||
OpenSceneHost.Child = OpenScene
|
||||
OpenSceneHost.SetValue(Grid.ColumnProperty, 1)
|
||||
OpenSceneHost.SetValue(Grid.RowProperty, 2)
|
||||
OpenSceneHost.SetValue(Grid.ColumnProperty, 0) '1
|
||||
OpenSceneHost.SetValue(Grid.RowProperty, 0) ' 2
|
||||
' OpenSceneHost.SetValue(Grid.RowSpanProperty, 1)
|
||||
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
|
||||
FileListBox.ItemsSource = m_MainWindow.m_OpenItemList
|
||||
@@ -100,6 +102,10 @@ Public Class OpenPageUC
|
||||
LoadCurrDir()
|
||||
m_bFirst = False
|
||||
Else
|
||||
GetPrivateProfileString(S_SLABDXF, K_SLABLAYER, "SlabBoundary", m_sSlabLayer, m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_SLABDXF, K_PARTSLAYER, "Counters", m_sPartsLayer, m_MainWindow.GetIniFile())
|
||||
GetPrivateProfileString(S_SLABDXF, K_SCRAPLAYER, "ReservedAreaBoundary", m_sScrapLayer, m_MainWindow.GetIniFile())
|
||||
m_dSlabThick = GetPrivateProfileDouble(S_SLABDXF, K_STDTHICK, 20, m_MainWindow.GetIniFile())
|
||||
EgtSetCurrentContext(OpenScene.GetCtx())
|
||||
End If
|
||||
' Pulisco tutto
|
||||
@@ -237,6 +243,14 @@ Public Class OpenPageUC
|
||||
Private Function ClearView() As Boolean
|
||||
' Pulisco il DB geometrico locale
|
||||
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
|
||||
OpenScene.ZoomAll()
|
||||
' Cancello messaggio
|
||||
@@ -298,6 +312,24 @@ Public Class OpenPageUC
|
||||
MessageBrd.Background = Brushes.Tomato
|
||||
OkBtn.IsEnabled = False
|
||||
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
|
||||
OpenScene.ZoomAll()
|
||||
Return bOk
|
||||
@@ -471,11 +503,21 @@ Public Class OpenPageUC
|
||||
' Se file dxf devo processarlo opportunamente
|
||||
Dim bFileDxf As Boolean = (EgtGetFileType(m_sCurrFile) = FT.DXF)
|
||||
If bFileDxf Then AdjustSlabDxf()
|
||||
|
||||
' Istruzioni per chiudere OpenPageUC e aprire currentproject
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
' Lancio caricamento nuovo progetto corrente
|
||||
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, Nothing, OpenScene.GetCtx)
|
||||
SelParkIndWD.sActualProj = String.Empty
|
||||
'--------------------------------------------------------------------------------
|
||||
|
||||
' Se file dxf
|
||||
If bFileDxf Then
|
||||
' Applico le lavorazioni
|
||||
@@ -509,6 +551,12 @@ Public Class OpenPageUC
|
||||
End Sub
|
||||
|
||||
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 Class
|
||||
|
||||
@@ -99,8 +99,20 @@ Public Class ProjectMgrUC
|
||||
End If
|
||||
' Scelta tavola della macchina
|
||||
Dim nTabInd As Integer = ChooseTable()
|
||||
|
||||
' Ricarico la lista dei parcheggi del progetto precedente a quello nuovo
|
||||
Dim ListParkInd As New List(Of ParkInd)
|
||||
SelParkIndWD.LoadParkInd(ListParkInd)
|
||||
|
||||
' Creo nuovo progetto
|
||||
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
|
||||
|
||||
' Gestione visulizzazione lista pezzi in parcheggio
|
||||
Dim sNewFileName As String = SelParkIndWD.GetPathCurrProj()
|
||||
SelParkIndWD.CopyImgSvg(sNewFileName, ListParkInd)
|
||||
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.ReloadListParkInd()
|
||||
|
||||
' Gestione stato FastGrid
|
||||
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
|
||||
End Sub
|
||||
@@ -233,6 +245,9 @@ Public Class ProjectMgrUC
|
||||
If m_MainWindow.m_ActivePage = MainWindow.Pages.FrameCut Then
|
||||
ShowAllCurrPhaseMachinings()
|
||||
End If
|
||||
|
||||
'SelParkIndWD.UpdateViewOnParkInd(False)
|
||||
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
@@ -266,6 +281,8 @@ Public Class ProjectMgrUC
|
||||
ResetAllStartCurv()
|
||||
' cancello tutti i ponticelli disegnati
|
||||
ResetAllBRidges()
|
||||
' cancella tutti i tagli di separazione inseriti in OFFICE
|
||||
ResetAllSplitCut()
|
||||
' Ricalcolo tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
@@ -312,47 +329,117 @@ Public Class ProjectMgrUC
|
||||
Dim m_ptRawMax, m_ptRawMin As Point3d
|
||||
If Not GetRawBox(m_ptRawMin, m_ptRawMax) Then Return
|
||||
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
|
||||
|
||||
' Recupero spessore lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
EgtTdbSetCurrTool(sSaw)
|
||||
Dim TestToolWD As New ChooseTestToolWD(m_MainWindow)
|
||||
TestToolWD.ShowDialog()
|
||||
If Not TestToolWD.DialogResult Then Return
|
||||
Dim CurrTestTool As TestTool = TestToolWD.GetSelectedTool
|
||||
|
||||
'Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
'EgtTdbSetCurrTool(sSaw)
|
||||
|
||||
Dim dThick As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
Dim dDiam As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dDiam)
|
||||
Dim dHeight As Double = 0
|
||||
If CurrTestTool.ToolIsSaw Then
|
||||
' Spessore LAMA
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
' Diametro
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dHeight)
|
||||
' Raggio lama
|
||||
dHeight = dHeight / 2
|
||||
ElseIf CurrTestTool.ToolIsLaser Then
|
||||
' Raggio
|
||||
dThick = 0
|
||||
dHeight = 0
|
||||
Else
|
||||
' Diametro FRESA/FORETTO (l'altezza non serve: posizione calcolata tiene conto del Tip Tool)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dThick)
|
||||
' Raggio
|
||||
dThick = dThick / 2
|
||||
End If
|
||||
|
||||
|
||||
'recupero il lato selezionato
|
||||
Dim nIdSelected As Integer = m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv
|
||||
If nIdSelected = -1 Then Return
|
||||
' recupero gli estremi del latovda tagliare
|
||||
Dim ptStart As Point3d
|
||||
EgtStartPoint(nIdSelected, GDB_ID.ROOT, ptStart)
|
||||
Dim ptEnd As Point3d
|
||||
EgtEndPoint(nIdSelected, GDB_ID.ROOT, ptEnd)
|
||||
Dim vtDirLine As Vector3d = ptEnd - ptStart
|
||||
' calcolo il versore perpendicolare alla linea di taglio (diretto verso l'interno del pezzo)
|
||||
' recupero il vettore nel punto medio dell'entità
|
||||
Dim vtDirLine As Vector3d
|
||||
EgtMidVector(nIdSelected, GDB_ID.ROOT, vtDirLine)
|
||||
|
||||
' calcolo il versore della linea di taglio
|
||||
Dim vtDirT As Vector3d = vtDirLine
|
||||
vtDirT.Normalize()
|
||||
vtDirT.Rotate(Vector3d.Z_AX, 90)
|
||||
' calcolo la direzione di offset da applicare all'utensile
|
||||
Dim vtOffset As New Vector3d(vtDirT.x, vtDirT.y, vtDirT.z)
|
||||
vtOffset.Rotate(Vector3d.Z_AX, 90)
|
||||
|
||||
If CurrTestTool.ToolIsSaw Then
|
||||
' calcolo il versore perpendicolare alla linea di taglio (diretto verso l'interno del pezzo)
|
||||
vtDirT.Rotate(Vector3d.Z_AX, 90)
|
||||
Else
|
||||
' calcolo il versore perpendicolare alla linea di taglio (diretto verso l'interno del pezzo)
|
||||
vtDirT.Rotate(Vector3d.Z_AX, 90)
|
||||
' calcolo il versore perpendicolare al piano di taglio (diretto verso l'interno dell'utensile)
|
||||
vtDirT.Rotate(vtDirLine, 90)
|
||||
End If
|
||||
|
||||
' Calcolo punto di posizionamemto (punto medio)
|
||||
Dim ptMid, m_ptTabOri As Point3d
|
||||
|
||||
If Not EgtGetTableRef(1, m_ptTabOri) Then Return
|
||||
ptMid.x = (ptEnd.x + ptStart.x) / 2
|
||||
ptMid.y = (ptEnd.y + ptStart.y) / 2
|
||||
ptMid.z = (ptEnd.z + ptStart.z) / 2 + dDiam / 2
|
||||
ptMid -= vtDirT * dThick
|
||||
' recupero il punto medio della curva
|
||||
EgtMidPoint(nIdSelected, GDB_ID.ROOT, ptMid)
|
||||
ptMid.z = m_ptTabOri.z + CamAuto.GetRawHeight() + dHeight + m_MainWindow.m_CurrentMachine.dAdditionalTable
|
||||
' Offset dovuto allo spessore Utensile
|
||||
ptMid -= vtOffset * dThick
|
||||
|
||||
'--------------------------- Imposto la posizione della macchina ----------------------------
|
||||
' Recupero la posizione macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||
' Imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
|
||||
' Imposto la lama corrente, preso dalla scelta precedente
|
||||
'If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||
If Not EgtSetCalcTool(CurrTestTool.ToolName, CurrTestTool.ToolHead, CurrTestTool.ToolExit) Then Return
|
||||
|
||||
' calcolo la posizione degli assi rotanti C, B
|
||||
Dim nStat As Integer
|
||||
Dim dC1, dB1, dC2, dB2 As Double
|
||||
EgtGetCalcAngles(vtDirT, Vector3d.Z_AX(), nStat, dC1, dB1, dC2, dB2)
|
||||
If CurrTestTool.ToolIsSaw Then
|
||||
' Se LAMA
|
||||
EgtGetCalcAngles(vtDirT, Vector3d.Z_AX(), nStat, dC1, dB1, dC2, dB2)
|
||||
ElseIf CurrTestTool.ToolIsLaser Then
|
||||
' Se LASER
|
||||
Dim dHomeC As Double = 90
|
||||
EgtGetAxisHomePos("C", dHomeC)
|
||||
Dim vtPrefAuxDir As Vector3d = -Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, dHomeC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
' Forzo B90
|
||||
dB1 = 90
|
||||
' Forzo la pozione in Z alla quota di Home (per evitare l'errore di fine corsa asse Z)
|
||||
Dim dHomeZ As Double = 0
|
||||
EgtGetAxisHomePos("Z", dHomeZ)
|
||||
ptMid.z = dHomeZ
|
||||
Else
|
||||
' Se utensile speciale
|
||||
If CurrTestTool.ToolType = MCH_TY.MILL_STD Or CurrTestTool.ToolType = MCH_TY.DRILL_STD Then
|
||||
' Se FRESA/FORETTO
|
||||
Dim nStepRotC As Integer = GetPrivateProfileInt(S_NEST, K_MACH_DRILL_MILL_C90, 1, m_MainWindow.GetMachIniFile())
|
||||
Dim vtPrefAuxDir As Vector3d = -Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, 90 * nStepRotC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
ElseIf CurrTestTool.ToolType = MCH_TY.WATERJET Then
|
||||
' Se WJ
|
||||
Dim dHomeC As Double = 90
|
||||
EgtGetAxisHomePos("C", dHomeC)
|
||||
Dim vtPrefAuxDir As Vector3d = Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, dHomeC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
End If
|
||||
End If
|
||||
|
||||
' calcolo la posizione degli assi lineari X, Y, Z
|
||||
Dim dX, dY, dZ As Double
|
||||
EgtGetCalcPositions(ptMid, dC1, dB1, nStat, dX, dY, dZ)
|
||||
@@ -360,16 +447,49 @@ Public Class ProjectMgrUC
|
||||
' verifica assi lineari
|
||||
EgtVerifyOutstroke(dX, dY, dZ, dC1, dB1, nStat)
|
||||
If nStat <> 0 Then
|
||||
EgtOutLog("Out of stroke: " & nStat)
|
||||
vtDirT = -vtDirT
|
||||
ptMid -= vtDirT * dThick
|
||||
EgtGetCalcAngles(vtDirT, Vector3d.Z_AX(), nStat, dC1, dB1, dC2, dB2)
|
||||
If CurrTestTool.ToolIsSaw Then
|
||||
EgtGetCalcAngles(vtDirT, Vector3d.Z_AX(), nStat, dC1, dB1, dC2, dB2)
|
||||
ElseIf CurrTestTool.ToolIsLaser Then
|
||||
' Se LASER
|
||||
Dim dHomeC As Double = 90
|
||||
EgtGetAxisHomePos("C", dHomeC)
|
||||
Dim vtPrefAuxDir As Vector3d = -Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, dHomeC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
' Forzo B90
|
||||
dB1 = 90
|
||||
Else
|
||||
If CurrTestTool.ToolType = MCH_TY.MILL_STD Or CurrTestTool.ToolType = MCH_TY.DRILL_STD Then
|
||||
' Se FRESA/FORETTO
|
||||
Dim nStepRotC As Integer = GetPrivateProfileInt(S_NEST, K_MACH_DRILL_MILL_C90, 1, m_MainWindow.GetMachIniFile())
|
||||
Dim vtPrefAuxDir As Vector3d = -Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, 90 * nStepRotC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
ElseIf CurrTestTool.ToolType = MCH_TY.WATERJET Then
|
||||
' Se WJ
|
||||
Dim dHomeC As Double = 90
|
||||
EgtGetAxisHomePos("C", dHomeC)
|
||||
Dim vtPrefAuxDir As Vector3d = Vector3d.X_AX()
|
||||
vtPrefAuxDir.Rotate(Vector3d.Z_AX, dHomeC)
|
||||
EgtGetCalcAngles(vtDirT, vtPrefAuxDir, nStat, dC1, dB1, dC2, dB2)
|
||||
End If
|
||||
End If
|
||||
' calcolo la posizione degli assi lineari X, Y, Z ( correggere il punto ptMid.z sommando il raggio utensile)
|
||||
EgtGetCalcPositions(ptMid, dC1, dB1, nStat, dX, dY, dZ)
|
||||
|
||||
' verifica assi lineari
|
||||
EgtVerifyOutstroke(dX, dY, dZ, dC1, dB1, nStat)
|
||||
If nStat <> 0 Then
|
||||
EgtOutLog("2nd attemp out of stroke: " & nStat)
|
||||
End If
|
||||
End If
|
||||
|
||||
'--------------------------- Comunico i movimenti in origine macchina al CN ----------------------------------------
|
||||
Dim ptMachine As Point3d = New Point3d(dX, dY, dZ)
|
||||
ExecuteCommandCNC(ptMachine, dC1, dB1)
|
||||
Dim ptMachine As Point3d = New Point3d(dX, dY, If(CurrTestTool.ToolIsLaser, 0, dZ))
|
||||
ExecuteCommandCNC(ptMachine, dC1, dB1, CurrTestTool)
|
||||
Return
|
||||
End If
|
||||
' ---------------------------- Fine modalità test --------------------------------------------
|
||||
@@ -654,6 +774,12 @@ Public Class ProjectMgrUC
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
' leggo il nome della tavola da cui sto lanciando il progetto
|
||||
Dim sTabeName As String = String.Empty
|
||||
EgtGetTableName(sTabeName)
|
||||
Dim bDoubleProg As Boolean = (GetPrivateProfileInt(S_PRODUCTIONLINE, "DoubleProg", 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||
|
||||
' Leggo eventuale variabile per lavorazione con 2 tavole in parallelo (standard E80027)
|
||||
Dim nVarProgTwins As Integer = 1
|
||||
If Not String.IsNullOrWhiteSpace(m_CurrMachine.sVarProgTwins) Then
|
||||
@@ -667,8 +793,26 @@ Public Class ProjectMgrUC
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
' Verifico se posso scrivere nell'area 1
|
||||
If nVarProg1 = 0 And (nVarProg2 <> 1 Or nVarProgTwins = 2) Then
|
||||
Dim bSendToAre1 As Boolean = (nVarProg1 = 0 And (nVarProg2 <> 1 Or nVarProgTwins = 2))
|
||||
Dim bSendToAre2 As Boolean = (nVarProg2 = 0 And (nVarProg1 <> 1 Or nVarProgTwins = 2))
|
||||
|
||||
If bDoubleProg Then
|
||||
If sTabeName = MAIN_TAB Then
|
||||
' spedisco il programma da tavola 1 solo se CN ha terminato programma 901
|
||||
bSendToAre1 = (nVarProg1 = 0)
|
||||
bSendToAre2 = False
|
||||
EgtOutLog(" Invio programma da tavola 1")
|
||||
Else
|
||||
' spedisco il programma da tavola 2 solo se CN ha terminato programma 902
|
||||
bSendToAre1 = False
|
||||
bSendToAre2 = (nVarProg2 = 0)
|
||||
EgtOutLog(" Invio programma da tavola 2")
|
||||
End If
|
||||
End If
|
||||
|
||||
If bSendToAre1 Then
|
||||
m_CurrNcComm.SetProgramMainOrSub(False)
|
||||
If m_CurrNcComm.SendProgram(sCncPath, m_CurrMachine.nProg1, False) Then
|
||||
' Dichiaro part program inviato
|
||||
@@ -685,7 +829,7 @@ Public Class ProjectMgrUC
|
||||
End If
|
||||
m_CurrNcComm.SetProgramMainOrSub(True)
|
||||
' Altrimenti verifico se posso scrivere nell'area 2
|
||||
ElseIf nVarProg2 = 0 And (nVarProg1 <> 1 Or nVarProgTwins = 2) Then
|
||||
ElseIf bSendToAre2 Then
|
||||
m_CurrNcComm.SetProgramMainOrSub(False)
|
||||
If m_CurrNcComm.SendProgram(sCncPath, m_CurrMachine.nProg2, False) Then
|
||||
' Dichiaro part program inviato
|
||||
@@ -705,6 +849,12 @@ Public Class ProjectMgrUC
|
||||
Else
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90318)) 'La macchina non accetta il programma CN
|
||||
End If
|
||||
' avvio programma solo se DoubleProg
|
||||
If (GetPrivateProfileInt(S_GENERAL, K_STARTPROGRAM, 0, m_MainWindow.GetIniFile()) <> 0 And bDoubleProg) And
|
||||
(bSendToAre1 Or bSendToAre2) Then
|
||||
Dim MyCicloStartWD As New CicloStartWD(m_MainWindow)
|
||||
MyCicloStartWD.ShowDialog()
|
||||
End If
|
||||
|
||||
End If
|
||||
#End If
|
||||
@@ -843,7 +993,7 @@ Public Class ProjectMgrUC
|
||||
End Sub
|
||||
|
||||
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
|
||||
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double)
|
||||
Private Sub ExecuteCommandCNC(ptMid As Point3d, dAngC As Double, dAngB As Double, SelTestTool As TestTool)
|
||||
|
||||
Dim CmdString As String = String.Empty
|
||||
If Not EgtLuaExecFile(m_MainWindow.m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
|
||||
@@ -869,12 +1019,23 @@ Public Class ProjectMgrUC
|
||||
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
||||
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
||||
|
||||
' Recupero spessore lama corrente
|
||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
EgtTdbSetCurrTool(sSaw)
|
||||
'' Recupero spessore lama corrente
|
||||
'Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
'EgtTdbSetCurrTool(sSaw)
|
||||
'Dim dThick As Double = 0
|
||||
'EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
'EgtLuaSetGlobNumVar("CMD.SAWTH", dThick)
|
||||
|
||||
EgtTdbSetCurrTool(SelTestTool.ToolName)
|
||||
EgtLuaSetGlobStringVar("CMD.TLNAME", SelTestTool.ToolName)
|
||||
EgtLuaSetGlobStringVar("CMD.TLALIAS", SelTestTool.ToolAlias)
|
||||
Dim dThick As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
EgtLuaSetGlobNumVar("CMD.SAWTH", dThick)
|
||||
Dim sTCPos As String = String.Empty
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTCPos)
|
||||
EgtLuaSetGlobStringVar("CMD.TCPOS", sTCPos)
|
||||
|
||||
|
||||
'----------- ASSEGNO POSIZIONE DI ARRIVO MACCHINA -----------
|
||||
' Assegno valore ad ogni asse da muovere (in zero macchina)
|
||||
@@ -933,6 +1094,7 @@ Public Class ProjectMgrUC
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.m_bSelectCurv = False
|
||||
EgtDeselectObj(m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv)
|
||||
EgtResetMark(m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedSawCurv)
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrToolFromSelectedSawCurv = String.Empty
|
||||
End If
|
||||
' aggiorno il disegno
|
||||
EgtDraw()
|
||||
@@ -1006,6 +1168,7 @@ Public Class ProjectMgrUC
|
||||
' Nascondo bottoni rawpage
|
||||
m_MainWindow.m_RawPartPage.OtherRefTabBtn.Visibility = Windows.Visibility.Hidden
|
||||
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.LoadParams()
|
||||
' Rendo visibili i bottoni per la definizione degli Spotreg
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Visible
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.UG1_Reg.Visibility = Visibility.Visible
|
||||
@@ -1042,13 +1205,14 @@ Public Class ProjectMgrUC
|
||||
' Visualizzo step adatti alla scelta fatta
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
|
||||
|
||||
' Cancello eventuali messaggi di errore/avvertimento
|
||||
m_CurrProjPage.ClearMessage()
|
||||
|
||||
' visualizzo i punti di SpotReg
|
||||
EgtSetStatus(m_MainWindow.m_CadCutPageUC.m_NestPage.m_nRegGroupId, GDB_ST.ON_)
|
||||
' eventualmente risistemo tutti i punti Spotreg in funzione dell'altezza del grezzo
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateSpotRegistration()
|
||||
|
||||
' Cancello eventuali messaggi di errore/avvertimento
|
||||
m_CurrProjPage.ClearMessage()
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub RegisterBtn_Unchecked(sender As Object, e As RoutedEventArgs) Handles RegisterBtn.Unchecked
|
||||
|
||||
@@ -39,6 +39,43 @@
|
||||
<Button Name="TopViewBtn" Grid.Column="6" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||
<Image Source="{DynamicResource LookFromTOPImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</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>
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@ Public Class SceneButtonsUC
|
||||
'Riferimento alla 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
|
||||
GetCurrScene.SetStatusGetDistance()
|
||||
Dim ptRef1 As Point3d
|
||||
@@ -49,6 +53,12 @@ Public Class SceneButtonsUC
|
||||
'End Sub
|
||||
|
||||
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()
|
||||
End Sub
|
||||
|
||||
@@ -69,7 +79,35 @@ Public Class SceneButtonsUC
|
||||
End Sub
|
||||
|
||||
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
|
||||
|
||||
Private Function GetCurrScene() As EgtUILib.Scene
|
||||
|
||||
@@ -96,16 +96,22 @@ Public Class StartLauncherWD
|
||||
Dim ItemFile As String = String.Empty
|
||||
'carico la liste dei file recenti
|
||||
Dim sFileName As String = String.Empty
|
||||
Dim MruFileListRemove As New List(Of String)
|
||||
For Each ItemFile In m_MainWindow.m_CurrentProjectPageUC.m_MruFiles.FileNames
|
||||
sFileName = ItemFile.Replace("__", "_")
|
||||
If Not String.IsNullOrEmpty(sFileName) Then
|
||||
If Not String.IsNullOrEmpty(sFileName) AndAlso File.Exists(sFileName) Then
|
||||
m_RecentFileList.Add(New FileNameLsBxItem(sFileName, File.GetLastAccessTime(sFileName)))
|
||||
m_RecentFileList.Add(New FileNameLsBxItem(sFileName, File.GetLastAccessTime(sFileName)))
|
||||
Else
|
||||
m_MainWindow.m_CurrentProjectPageUC.m_MruFiles.Remove(ItemFile)
|
||||
MruFileListRemove.Add(ItemFile)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each ItemFileRemove As String In MruFileListRemove
|
||||
m_MainWindow.m_CurrentProjectPageUC.m_MruFiles.Remove(ItemFileRemove)
|
||||
EgtOutLog(" WARNING: File " & ItemFileRemove & " does not exist or is not accessible, it's been removed from MruFiles list")
|
||||
Next
|
||||
|
||||
' posiziono la fistra in centro alla pagina
|
||||
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
|
||||
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||
|
||||
@@ -347,6 +347,13 @@ Public Class Camera
|
||||
|
||||
' ------------------------------------ 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)
|
||||
Dim bOk As Boolean = False
|
||||
Dim sArgs As String = "2 0"
|
||||
@@ -364,6 +371,66 @@ Public Class Camera
|
||||
Return bOk
|
||||
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
|
||||
' Ciclo di ricerca foto scattata
|
||||
Dim nMaxThick = 10 * m_nTimeout
|
||||
|
||||
@@ -175,20 +175,24 @@ Public Class ChooseMachining
|
||||
|
||||
End Select
|
||||
|
||||
' verifico che lista delle lavorazioni di lama non sia vuoto
|
||||
If m_SawingList.Count > 0 Then
|
||||
' provo ad assegnare la lama corrente (se l'associazione fallisce corrispoende ad impostare un campo vuoto)
|
||||
CurrSawingCmBx.SelectedItem = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||
If m_CurrentMachine.bWaterJet And EgtGetHeadId("H1") = GDB_ID.NULL Then
|
||||
|
||||
Else
|
||||
m_MainWindow.m_CurrentMachine.sCurrSawing = String.Empty
|
||||
End If
|
||||
' se non riesco a fare l'assegnazione della lama allora elimino il nome della lama salvata
|
||||
If String.IsNullOrEmpty(CurrSawingCmBx.SelectedItem) Then
|
||||
' verifico che il nome della lama esista
|
||||
If CurrSawingCmBx.SelectedItem <> m_MainWindow.m_CurrentMachine.sCurrSawing Then
|
||||
m_MachIsModified = True
|
||||
' verifico che lista delle lavorazioni di lama non sia vuoto
|
||||
If m_SawingList.Count > 0 Then
|
||||
' provo ad assegnare la lama corrente (se l'associazione fallisce corrispoende ad impostare un campo vuoto)
|
||||
CurrSawingCmBx.SelectedItem = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||
Else
|
||||
m_MainWindow.m_CurrentMachine.sCurrSawing = String.Empty
|
||||
End If
|
||||
' se non riesco a fare l'assegnazione della lama allora elimino il nome della lama salvata
|
||||
If String.IsNullOrEmpty(CurrSawingCmBx.SelectedItem) Then
|
||||
' verifico che il nome della lama esista
|
||||
If CurrSawingCmBx.SelectedItem <> m_MainWindow.m_CurrentMachine.sCurrSawing Then
|
||||
m_MachIsModified = True
|
||||
End If
|
||||
m_MainWindow.m_CurrentMachine.sCurrSawing = String.Empty
|
||||
End If
|
||||
m_MainWindow.m_CurrentMachine.sCurrSawing = String.Empty
|
||||
End If
|
||||
|
||||
' definizione della lista delle lavorazioni secondarie -- DA RIMUOVERE COMPLETAMENTE --
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
FontFamily="{DynamicResource OmagCut_Font}"
|
||||
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-->
|
||||
<Border Style="{DynamicResource OmagCut_Border}">
|
||||
@@ -28,14 +28,30 @@
|
||||
<RowDefinition Height="0.2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.2*"/>
|
||||
<RowDefinition Height="0.2*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="0.2*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="RefRawTxbl" Grid.Column="1" Grid.Row="1"
|
||||
<TextBlock Name="SelRefTxbl" Grid.Column="1" Grid.Row="1"
|
||||
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">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
@@ -44,17 +60,17 @@
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="3"
|
||||
<TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="5"
|
||||
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}"/>
|
||||
|
||||
<TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="5"
|
||||
<TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="7"
|
||||
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}"/>
|
||||
|
||||
<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>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
|
||||
@@ -12,9 +13,14 @@ Public Class OtherRefTabWD
|
||||
Private m_dPrevOffsetX 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
|
||||
|
||||
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
|
||||
' La chiamata è richiesta dalla finestra di progettazione.
|
||||
InitializeComponent()
|
||||
@@ -25,6 +31,7 @@ Public Class OtherRefTabWD
|
||||
m_dPrevOffsetX = OffsetX
|
||||
m_dPrevOffsetY = OffsetY
|
||||
m_SelIndex = OtherRefMode
|
||||
m_SelRef = SelRef
|
||||
End Sub
|
||||
|
||||
Private Sub OtherRrefTabWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
@@ -36,8 +43,11 @@ Public Class OtherRefTabWD
|
||||
RefRawTxbl.Text = "Raw reference"
|
||||
RefTabXTxbl.Text = "Position X"
|
||||
RefTabYTxbl.Text = "Position Y"
|
||||
RefTabModeCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabList
|
||||
RefTabModeCmBx.SelectedIndex = m_RawPartPage.m_OtherRefTabPos
|
||||
SelRefTxbl.Text = "Sel reference"
|
||||
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
|
||||
|
||||
Private Sub OtherRrefTabWD_Load(sender As Object, e As EventArgs) Handles Me.Loaded
|
||||
@@ -45,9 +55,44 @@ Public Class OtherRefTabWD
|
||||
RefTabYTxBx.Text = m_sPosY
|
||||
End Sub
|
||||
|
||||
Private Sub RefTabModeCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabModeCmBx.SelectionChanged
|
||||
m_RawPartPage.m_OtherRefTabPos = RefTabModeCmBx.SelectedIndex
|
||||
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile())
|
||||
Private Sub RefTabCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RefTabCmBx.SelectionChanged
|
||||
If m_bModifX Or m_bModifY Then
|
||||
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()
|
||||
End Sub
|
||||
|
||||
@@ -66,6 +111,7 @@ Public Class OtherRefTabWD
|
||||
' errore, posizione fuori dalla tavola
|
||||
End If
|
||||
m_RawPartPage.m_OtherRefTabX = dX
|
||||
m_bModifX = True
|
||||
m_RawPartPage.RefTabModeChange()
|
||||
End If
|
||||
End Sub
|
||||
@@ -85,24 +131,99 @@ Public Class OtherRefTabWD
|
||||
' errore, posizione fuori dalla tavola
|
||||
End If
|
||||
m_RawPartPage.m_OtherRefTabY = dY
|
||||
m_bModifY = True
|
||||
m_RawPartPage.RefTabModeChange()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click() Handles OkBtn.Click
|
||||
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABX, DoubleToString(RefTabXTxBx.Text, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABY, DoubleToString(RefTabYTxBx.Text, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_RAWPART, K_OTHERREFTABPOS, m_RawPartPage.m_OtherRefTabPos.ToString, m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_RAWPART, K_CURRENTREFTAB, m_RawPartPage.m_CurrRefTab.ToString, m_MainWindow.GetIniFile())
|
||||
' Aggiorno il valore del riferimento correntemente modificato
|
||||
UpdateCurrOffset()
|
||||
m_RawPartPage.RefTabModeChange()
|
||||
Me.Close()
|
||||
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
|
||||
' riposiziono l'origine
|
||||
m_RawPartPage.m_OtherRefTabX = m_sPosX
|
||||
m_RawPartPage.m_OtherRefTabY = m_sPosY
|
||||
' ripristino il valore della combobox
|
||||
m_RawPartPage.m_OtherRefTabPos = m_SelIndex
|
||||
' Recupero la prima selezione eseguita
|
||||
m_RawPartPage.m_CurrRefTab = m_SelRef
|
||||
Dim temp_RefTab As ReferenceTable = m_RawPartPage.m_OtherRefTabList(m_RawPartPage.m_CurrRefTab)
|
||||
' aggiorno i valori
|
||||
m_RawPartPage.m_OtherRefTabX = temp_RefTab.dOffsetX
|
||||
m_RawPartPage.m_OtherRefTabY = temp_RefTab.dOffsetY
|
||||
m_RawPartPage.m_OtherRefTabPos = temp_RefTab.nPos
|
||||
m_RawPartPage.RefTabModeChange()
|
||||
End Sub
|
||||
|
||||
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
|
||||
@@ -136,7 +136,9 @@
|
||||
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
||||
<ToggleButton Name="RemoveBtn" Grid.Column="1"
|
||||
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
||||
<Button Name="CloseBtn" Grid.Row="1" Grid.ColumnSpan="2"
|
||||
<Button Name="CloseBtn" Grid.Row="1"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
<Button Name="RectangleBtn" Grid.Row="1" Grid.Column="1"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||
</Grid>
|
||||
|
||||
@@ -174,7 +176,9 @@
|
||||
<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*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
@@ -195,7 +199,11 @@
|
||||
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</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"
|
||||
VerticalAlignment="Center" />
|
||||
</Button>
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
Imports System.Globalization
|
||||
Imports System.IO
|
||||
Imports System.Windows.Media.Animation
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib
|
||||
Imports Microsoft.VisualBasic.Devices
|
||||
|
||||
Public Class RawPartPageUC
|
||||
|
||||
' Dati generali CN
|
||||
Friend m_CN As CN_generico
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Dim WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
@@ -81,13 +82,23 @@ Public Class RawPartPageUC
|
||||
' Costante raggio cerchietto
|
||||
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
|
||||
Private m_bEnableOtherRefTab As Boolean = False
|
||||
Private m_bOtherRefTab As Boolean
|
||||
Public m_OtherRefTabX As Double = 0
|
||||
Public m_OtherRefTabY As Double = 0
|
||||
Public m_OtherRefTabList(3) As String
|
||||
Public m_OtherRefTabPos As Integer = 0
|
||||
Public m_OtherRefTabX As Double = 0 ' offset riferimento corrente
|
||||
Public m_OtherRefTabY As Double = 0 ' offset riferimento corrente
|
||||
Public m_OtherRefTabPos As Integer = 0 ' poisizione riferimento (Bottom-Left, ..)
|
||||
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_OtherRefTabPoint As Point3d
|
||||
|
||||
@@ -118,13 +129,20 @@ Public Class RawPartPageUC
|
||||
FROM_SAW = 7
|
||||
End Enum
|
||||
|
||||
Private Enum OTHERREFMODE As Integer
|
||||
Friend Enum OTHERREFMODE As Integer
|
||||
BL = 0
|
||||
BR = 1
|
||||
TR = 2
|
||||
TL = 3
|
||||
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)
|
||||
|
||||
'Creazione della Page UserControl e relative impostazioni
|
||||
@@ -167,10 +185,10 @@ Public Class RawPartPageUC
|
||||
RawModeCmBx.ItemsSource = m_RawModeList
|
||||
|
||||
' Creo la lista dei riferimenti tavola
|
||||
m_OtherRefTabList(OTHERREFMODE.BL) = "Bottom left"
|
||||
m_OtherRefTabList(OTHERREFMODE.BR) = "Bottom right"
|
||||
m_OtherRefTabList(OTHERREFMODE.TR) = "Top right"
|
||||
m_OtherRefTabList(OTHERREFMODE.TL) = "Top left"
|
||||
m_OtherRefTabOrientationList(OTHERREFMODE.BL) = "Bottom left"
|
||||
m_OtherRefTabOrientationList(OTHERREFMODE.BR) = "Bottom right"
|
||||
m_OtherRefTabOrientationList(OTHERREFMODE.TR) = "Top right"
|
||||
m_OtherRefTabOrientationList(OTHERREFMODE.TL) = "Top left"
|
||||
|
||||
' lista per selezione RawModeDamaged
|
||||
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
|
||||
@@ -210,9 +228,11 @@ Public Class RawPartPageUC
|
||||
AddBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 14) 'Add - Aggiungi
|
||||
RemoveBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 15) 'Remove - Rimuovi
|
||||
CloseBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 31) 'Close - Chiudi
|
||||
RectangleBtn.Content = "Rectangle"
|
||||
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
|
||||
|
||||
OtherRefTabTxBl.Text = "New Ref On Tab"
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
@@ -319,6 +339,23 @@ Public Class RawPartPageUC
|
||||
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||
OffsetYTxBx.Text = LenToString(m_RawOffsY, 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
|
||||
m_nTempLay = EgtCreateGroup(GDB_ID.ROOT)
|
||||
EgtSetLevel(m_nTempLay, GDB_LV.TEMP)
|
||||
@@ -328,6 +365,7 @@ Public Class RawPartPageUC
|
||||
RawModeCmBx.SelectedIndex = RAWMODE.BY_POINTS
|
||||
PointsGpBx.Visibility = Windows.Visibility.Visible
|
||||
CloseBtn.Visibility = Windows.Visibility.Hidden
|
||||
RectangleBtn.Visibility = Windows.Visibility.Hidden
|
||||
' Visualizzo crocette
|
||||
UpdateCircles()
|
||||
EgtZoom(ZM.ALL)
|
||||
@@ -346,7 +384,6 @@ Public Class RawPartPageUC
|
||||
EgtZoom(ZM.ALL)
|
||||
End If
|
||||
'Imposto il materiale corrente nella combobox
|
||||
'MaterialsCmbx.SelectedItem = m_CurrentMachine.CurrMat
|
||||
Dim Item As Material
|
||||
For Each Item In MaterialsCmbx.Items
|
||||
If Not IsNothing(m_CurrentMachine.CurrMat) AndAlso Item.sName = m_CurrentMachine.CurrMat.sName Then
|
||||
@@ -366,9 +403,36 @@ Public Class RawPartPageUC
|
||||
OtherRefTabBtn.Visibility = Visibility.Visible
|
||||
End If
|
||||
m_bOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_OTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
m_OtherRefTabX = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, 0, m_MainWindow.GetIniFile())
|
||||
m_OtherRefTabY = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABY, 0, m_MainWindow.GetIniFile())
|
||||
m_OtherRefTabPos = GetPrivateProfileInt(S_RAWPART, K_OTHERREFTABPOS, 0, m_MainWindow.GetIniFile())
|
||||
' Recupero il riferimento attivo
|
||||
m_CurrRefTab = GetPrivateProfileInt(S_RAWPART, K_CURRENTREFTAB, 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
|
||||
OtherRefTabChBx.IsChecked = m_bOtherRefTab
|
||||
' se riferimento tavola differente da quello atteso
|
||||
@@ -387,6 +451,29 @@ Public Class RawPartPageUC
|
||||
' EgtDraw()
|
||||
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
|
||||
' Verifico di essere il gestore attivo
|
||||
If Not m_bActive Then Return
|
||||
@@ -569,6 +656,19 @@ Public Class RawPartPageUC
|
||||
' Ricavo il punto corrente in coordinate mondo
|
||||
Dim ptCurr As Point3d
|
||||
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
|
||||
Select Case m_ActiveRawMode
|
||||
Case RAWMODE.RECTANGLE
|
||||
@@ -579,7 +679,7 @@ Public Class RawPartPageUC
|
||||
ModifyDamaged(ptCurr)
|
||||
End Select
|
||||
' Aggiorno il punto precedente
|
||||
m_ptPrev = ptCurr
|
||||
m_ptPrev = ptTemp
|
||||
' Resetto i ponticelli (per ora non sono in grado di muoverli assieme ai pezzi)
|
||||
ResetAllBRidges()
|
||||
End Sub
|
||||
@@ -756,10 +856,19 @@ Public Class RawPartPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = False
|
||||
' Non è possibile uscire con tastatura in corso
|
||||
If m_bProbingOn Then Return
|
||||
' reimposto il comando OutLine
|
||||
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
|
||||
If ExitRawPart(True) Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(Me)
|
||||
@@ -921,6 +1030,7 @@ Public Class RawPartPageUC
|
||||
RawModeView()
|
||||
' Disattivo il bottone
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = False
|
||||
OkBtn.IsEnabled = False
|
||||
Case 3 ' Da Lama
|
||||
If Not m_MainWindow.m_CurrentMachine.bSaw Then ' Da fotografia
|
||||
@@ -953,6 +1063,7 @@ Public Class RawPartPageUC
|
||||
RawModeView()
|
||||
' Disattivo il bottone
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = False
|
||||
OkBtn.IsEnabled = False
|
||||
Case 4 ' Da fotografia
|
||||
' Se ero in modalità da laser
|
||||
@@ -1017,6 +1128,7 @@ Public Class RawPartPageUC
|
||||
AddBtn.SetValue(Grid.RowSpanProperty, 2)
|
||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 2)
|
||||
CloseBtn.Visibility = Windows.Visibility.Hidden
|
||||
RectangleBtn.Visibility = Windows.Visibility.Hidden
|
||||
' Disattivo bottoni zone rovinate e foto
|
||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||
@@ -1039,6 +1151,7 @@ Public Class RawPartPageUC
|
||||
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||
CloseBtn.Visibility = Windows.Visibility.Visible
|
||||
RectangleBtn.Visibility = Windows.Visibility.Visible
|
||||
' Disattivo bottoni zone rovinate e foto
|
||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||
@@ -1061,6 +1174,7 @@ Public Class RawPartPageUC
|
||||
AddBtn.SetValue(Grid.RowSpanProperty, 2)
|
||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 2)
|
||||
CloseBtn.Visibility = Windows.Visibility.Hidden
|
||||
RectangleBtn.Visibility = Windows.Visibility.Hidden
|
||||
' Attivo bottoni zone rovinate
|
||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Visible
|
||||
' Disattivo bottoni foto
|
||||
@@ -1100,6 +1214,7 @@ Public Class RawPartPageUC
|
||||
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||
CloseBtn.Visibility = Windows.Visibility.Visible
|
||||
RectangleBtn.Visibility = Windows.Visibility.Visible
|
||||
' Disattivo bottoni zone rovinate e foto
|
||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||
@@ -1121,6 +1236,7 @@ Public Class RawPartPageUC
|
||||
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||
CloseBtn.Visibility = Windows.Visibility.Visible
|
||||
RectangleBtn.Visibility = Windows.Visibility.Visible
|
||||
' Disattivo bottoni zone rovinate e foto
|
||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||
@@ -1142,6 +1258,7 @@ Public Class RawPartPageUC
|
||||
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||
CloseBtn.Visibility = Windows.Visibility.Visible
|
||||
RectangleBtn.Visibility = Windows.Visibility.Visible
|
||||
' Disattivo bottoni zone rovinate e foto
|
||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||
@@ -1198,6 +1315,9 @@ Public Class RawPartPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub AddBtn_Click(sender As Object, e As RoutedEventArgs) Handles AddBtn.Click
|
||||
' disabilito i comandi di chiusura contorno
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = False
|
||||
Select Case m_ActiveRawMode
|
||||
Case RAWMODE.RECTANGLE
|
||||
AddBtn.IsChecked = False
|
||||
@@ -1246,9 +1366,15 @@ Public Class RawPartPageUC
|
||||
m_bptLast = True
|
||||
End If
|
||||
m_ptLast = ptAcquired
|
||||
' Se ho almeno un segmento allora deve essere la diagonale
|
||||
If m_CurveXKerfList.Count = 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = True
|
||||
End If
|
||||
If m_CurveXKerfList.Count > 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = False
|
||||
End If
|
||||
AddBtn.IsChecked = False
|
||||
EgtDraw()
|
||||
@@ -1294,9 +1420,14 @@ Public Class RawPartPageUC
|
||||
m_bptLast = True
|
||||
End If
|
||||
m_ptLast = ptAcquired
|
||||
If m_CurveXKerfList.Count = 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = True
|
||||
End If
|
||||
If m_CurveXKerfList.Count > 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = False
|
||||
End If
|
||||
AddBtn.IsChecked = False
|
||||
EgtDraw()
|
||||
@@ -1352,9 +1483,14 @@ Public Class RawPartPageUC
|
||||
m_bptLast = True
|
||||
End If
|
||||
m_ptLast = ptAcquired
|
||||
If m_CurveXDamagedAreaList.Count = 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = True
|
||||
End If
|
||||
If m_CurveXDamagedAreaList.Count > 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = False
|
||||
End If
|
||||
AddBtn.IsChecked = False
|
||||
EgtDraw()
|
||||
@@ -1400,9 +1536,14 @@ Public Class RawPartPageUC
|
||||
m_bptLast = True
|
||||
End If
|
||||
m_ptLast = ptAcquired
|
||||
If m_CurveXDamagedAreaList.Count = 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = True
|
||||
End If
|
||||
If m_CurveXDamagedAreaList.Count > 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = False
|
||||
End If
|
||||
AddBtn.IsChecked = False
|
||||
EgtDraw()
|
||||
@@ -1487,6 +1628,17 @@ Public Class RawPartPageUC
|
||||
' Aggiorno ptLast
|
||||
EgtEndPoint(m_CurveXKerfList(m_CurveXKerfList.Count - 1), m_ptLast)
|
||||
End If
|
||||
' reset dei comandi di chiusura
|
||||
If m_CurveXKerfList.Count = 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = True
|
||||
End If
|
||||
If m_CurveXKerfList.Count > 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = False
|
||||
End If
|
||||
Else
|
||||
m_bptLast = False
|
||||
End If
|
||||
@@ -1507,6 +1659,17 @@ Public Class RawPartPageUC
|
||||
' Aggiorno ptLast
|
||||
EgtEndPoint(m_CurveXKerfList(m_CurveXKerfList.Count - 1), m_ptLast)
|
||||
End If
|
||||
' reset dei comandi di chiusura
|
||||
If m_CurveXKerfList.Count = 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = True
|
||||
End If
|
||||
If m_CurveXKerfList.Count > 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = False
|
||||
End If
|
||||
Else
|
||||
m_bptLast = False
|
||||
End If
|
||||
@@ -1537,6 +1700,17 @@ Public Class RawPartPageUC
|
||||
' Aggiorno ptLast
|
||||
EgtEndPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
|
||||
End If
|
||||
' reset dei comandi di chiusura
|
||||
If m_CurveXDamagedAreaList.Count = 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = True
|
||||
End If
|
||||
If m_CurveXDamagedAreaList.Count > 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = False
|
||||
End If
|
||||
Else
|
||||
m_bptLast = False
|
||||
End If
|
||||
@@ -1557,6 +1731,17 @@ Public Class RawPartPageUC
|
||||
' Aggiorno ptLast
|
||||
EgtEndPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
|
||||
End If
|
||||
' reset dei comandi di chiusura
|
||||
If m_CurveXDamagedAreaList.Count = 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = True
|
||||
End If
|
||||
If m_CurveXDamagedAreaList.Count > 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
CloseBtn.IsEnabled = True
|
||||
RectangleBtn.IsEnabled = False
|
||||
End If
|
||||
Else
|
||||
m_bptLast = False
|
||||
End If
|
||||
@@ -1939,6 +2124,8 @@ Public Class RawPartPageUC
|
||||
Dim dInvertKerf As Double = 1
|
||||
EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, 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
|
||||
m_CurrProjPage.ClearMessage()
|
||||
If dKerf < 0 Then
|
||||
@@ -1983,6 +2170,8 @@ Public Class RawPartPageUC
|
||||
If Not StringToLen(HeightTxBx.Text, dHeight) Then
|
||||
Return
|
||||
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
|
||||
m_CurrProjPage.ClearMessage()
|
||||
If Math.Abs(dHeight - m_RawHeight) > EPS_SMALL Then
|
||||
@@ -2052,6 +2241,91 @@ Public Class RawPartPageUC
|
||||
End If
|
||||
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"
|
||||
|
||||
Private Sub OtherRefTabChBx_Click(sender As Object, e As EventArgs) Handles OtherRefTabChBx.Click
|
||||
@@ -2148,11 +2422,19 @@ Public Class RawPartPageUC
|
||||
End Sub
|
||||
|
||||
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
|
||||
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()
|
||||
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
|
||||
|
||||
Private Sub KerfTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KerfTxBx.EgtClosed
|
||||
@@ -2272,6 +2554,8 @@ Public Class RawPartPageUC
|
||||
KerfTxBx.Text = LenToString(m_RawKerf, 2)
|
||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 22) & " " & LenToString(dMaxKerf, 2)) 'Massimo kerf =
|
||||
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
|
||||
|
||||
Private Sub RawProbingBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawProbingBtn.Click
|
||||
@@ -2581,6 +2865,21 @@ Public Class RawPartPageUC
|
||||
EgtEmptyGroup(m_nTempLay)
|
||||
End Sub
|
||||
|
||||
Private Sub RectangleBtn_Click(sender As Object, e As RoutedEventArgs) Handles RectangleBtn.Click
|
||||
Select Case m_ActiveRawMode
|
||||
Case RAWMODE.DAMAGED_BY_LASER
|
||||
CloseDamagedAreaByLaser_Rectangle()
|
||||
Case RAWMODE.DAMAGED_BY_SAW
|
||||
CloseDamagedAreaBySaw_Rectangle()
|
||||
Case RAWMODE.FROM_SAW
|
||||
CloseRawBySaw_Rectangle()
|
||||
Case Else
|
||||
CloseRawByLaser_Rectangle()
|
||||
End Select
|
||||
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
|
||||
EgtEmptyGroup(m_nTempLay)
|
||||
End Sub
|
||||
|
||||
Private Sub CloseRawByLaser()
|
||||
' Verifico ci siano punti
|
||||
If m_CurveXKerfList.Count() = 0 Then Return
|
||||
@@ -2615,6 +2914,33 @@ Public Class RawPartPageUC
|
||||
EgtDraw()
|
||||
' Disattivo il bottone chiudi grezzo
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = False
|
||||
End Sub
|
||||
|
||||
Private Sub CloseRawByLaser_Rectangle()
|
||||
' Verifico ci siano punti
|
||||
If m_CurveXKerfList.Count() <> 1 Then Return
|
||||
' Recupero punto iniziale prima e unica linea del grezzo
|
||||
Dim ptStart As Point3d
|
||||
EgtStartPoint(m_CurveXKerfList(0), ptStart)
|
||||
' Recupero punto finale prima e unica linea del grezzo
|
||||
Dim ptEnd As Point3d
|
||||
EgtEndPoint(m_CurveXKerfList(0), ptEnd)
|
||||
' Elimo il segmemnto usato come diagonale
|
||||
EgtErase(m_CurveXKerfList(0))
|
||||
' Pulisco lista entità del grezzo (che contiene la diagonale)
|
||||
m_CurveXKerfList.Clear()
|
||||
' Procedo a costruire il rettangolo
|
||||
Dim pt_Temp As Point3d = New Point3d(ptEnd.x, ptStart.y, ptStart.z)
|
||||
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptStart, pt_Temp))
|
||||
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptEnd))
|
||||
pt_Temp = New Point3d(ptStart.x, ptEnd.y, ptStart.z)
|
||||
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptEnd, pt_Temp))
|
||||
' salvo come ultimo punto, l'ultimo calcolato
|
||||
m_ptLast = pt_Temp
|
||||
'CurveXKerfArray(3) = EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptStart)
|
||||
'm_CurveXKerfList.Add(CurveXKerfArray(3))
|
||||
CloseRawByLaser()
|
||||
End Sub
|
||||
|
||||
Private Sub CloseRawBySaw()
|
||||
@@ -2651,6 +2977,33 @@ Public Class RawPartPageUC
|
||||
EgtDraw()
|
||||
' Disattivo il bottone chiudi grezzo
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = False
|
||||
End Sub
|
||||
|
||||
Private Sub CloseRawBySaw_Rectangle()
|
||||
' Verifico ci siano punti
|
||||
If m_CurveXKerfList.Count() <> 1 Then Return
|
||||
' Recupero punto iniziale prima e unica linea del grezzo
|
||||
Dim ptStart As Point3d
|
||||
EgtStartPoint(m_CurveXKerfList(0), ptStart)
|
||||
' Recupero punto finale prima e unica linea del grezzo
|
||||
Dim ptEnd As Point3d
|
||||
EgtEndPoint(m_CurveXKerfList(0), ptEnd)
|
||||
' Elimo il segmemnto usato come diagonale
|
||||
EgtErase(m_CurveXKerfList(0))
|
||||
' Pulisco lista entità del grezzo (che contiene la diagonale)
|
||||
m_CurveXKerfList.Clear()
|
||||
' Procedo a costruire il rettangolo
|
||||
Dim pt_Temp As Point3d = New Point3d(ptEnd.x, ptStart.y, ptStart.z)
|
||||
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptStart, pt_Temp))
|
||||
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptEnd))
|
||||
pt_Temp = New Point3d(ptStart.x, ptEnd.y, ptStart.z)
|
||||
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptEnd, pt_Temp))
|
||||
' salvo come ultimo punto, l'ultimo calcolato
|
||||
m_ptLast = pt_Temp
|
||||
'CurveXKerfArray(3) = EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptStart)
|
||||
'm_CurveXKerfList.Add(CurveXKerfArray(3))
|
||||
CloseRawBySaw()
|
||||
End Sub
|
||||
|
||||
#Region "Damaged Area"
|
||||
@@ -2707,6 +3060,32 @@ Public Class RawPartPageUC
|
||||
EgtDraw()
|
||||
' Disattivo il bottone chiudi grezzo
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = False
|
||||
End Sub
|
||||
|
||||
Private Sub CloseDamagedAreaByLaser_Rectangle()
|
||||
' Verifico che esista una sola linea
|
||||
If m_CurveXDamagedAreaList.Count() <> 1 Then Return
|
||||
' Recupero punto iniziale prima linea del grezzo
|
||||
Dim ptStart As Point3d
|
||||
EgtStartPoint(m_CurveXDamagedAreaList(0), ptStart)
|
||||
' Recupero punto finale prima e unica linea del grezzo
|
||||
Dim ptEnd As Point3d
|
||||
EgtEndPoint(m_CurveXDamagedAreaList(0), ptEnd)
|
||||
' Elimo il segmemnto usato come diagonale
|
||||
EgtErase(m_CurveXDamagedAreaList(0))
|
||||
' Pulisco lista entità del grezzo (che contiene la diagonale)
|
||||
m_CurveXDamagedAreaList.Clear()
|
||||
' Procedo a costruire il rettangolo
|
||||
Dim pt_Temp As Point3d = New Point3d(ptEnd.x, ptStart.y, ptStart.z)
|
||||
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptStart, pt_Temp))
|
||||
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptEnd))
|
||||
pt_Temp = New Point3d(ptStart.x, ptEnd.y, ptStart.z)
|
||||
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptEnd, pt_Temp))
|
||||
' salvo come ultimo punto, l'ultimo calcolato
|
||||
m_ptLast = pt_Temp
|
||||
' procedo a costruire il rettangolo
|
||||
CloseDamagedAreaByLaser()
|
||||
End Sub
|
||||
|
||||
Private Sub CloseDamagedAreaBySaw()
|
||||
@@ -2733,6 +3112,32 @@ Public Class RawPartPageUC
|
||||
EgtDraw()
|
||||
' Disattivo il bottone chiudi grezzo
|
||||
CloseBtn.IsEnabled = False
|
||||
RectangleBtn.IsEnabled = False
|
||||
End Sub
|
||||
|
||||
Private Sub CloseDamagedAreaBySaw_Rectangle()
|
||||
' Verifico che esista una sola linea
|
||||
If m_CurveXDamagedAreaList.Count() <> 1 Then Return
|
||||
' Recupero punto iniziale prima linea del grezzo
|
||||
Dim ptStart As Point3d
|
||||
EgtStartPoint(m_CurveXDamagedAreaList(0), ptStart)
|
||||
' Recupero punto finale prima e unica linea del grezzo
|
||||
Dim ptEnd As Point3d
|
||||
EgtEndPoint(m_CurveXDamagedAreaList(0), ptEnd)
|
||||
' Elimo il segmemnto usato come diagonale
|
||||
EgtErase(m_CurveXDamagedAreaList(0))
|
||||
' Pulisco lista entità del grezzo (che contiene la diagonale)
|
||||
m_CurveXDamagedAreaList.Clear()
|
||||
' Procedo a costruire il rettangolo
|
||||
Dim pt_Temp As Point3d = New Point3d(ptEnd.x, ptStart.y, ptStart.z)
|
||||
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptStart, pt_Temp))
|
||||
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, pt_Temp, ptEnd))
|
||||
pt_Temp = New Point3d(ptStart.x, ptEnd.y, ptStart.z)
|
||||
m_CurveXDamagedAreaList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, ptEnd, pt_Temp))
|
||||
' salvo come ultimo punto, l'ultimo calcolato
|
||||
m_ptLast = pt_Temp
|
||||
' procedo a costruire il rettangolo
|
||||
CloseDamagedAreaBySaw()
|
||||
End Sub
|
||||
|
||||
Private Sub RemoveDamagedArea()
|
||||
@@ -2860,7 +3265,6 @@ Public Class RawPartPageUC
|
||||
End If
|
||||
|
||||
EgtDraw()
|
||||
'EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyTest.nge", NGE.BIN)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1018 B |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
@@ -206,6 +206,12 @@ Public Class SimulationPageUC
|
||||
Else
|
||||
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/Play.png", UriKind.Relative))
|
||||
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
|
||||
|
||||
Private Sub StepBtn_Click(sender As Object, e As RoutedEventArgs) Handles StepBtn.Click
|
||||
|
||||
@@ -25,18 +25,18 @@ Module Utility
|
||||
StopWatch.Start()
|
||||
End Sub
|
||||
|
||||
Friend Function TimeSpanEnd()
|
||||
Dim sTime As String = ""
|
||||
If Not IsNothing(StopWatch) Then
|
||||
StopWatch.Stop()
|
||||
Dim ts As TimeSpan = StopWatch.Elapsed
|
||||
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
|
||||
End If
|
||||
Return sTime
|
||||
End Function
|
||||
Friend Function TimeSpanEnd() As String
|
||||
Dim sTime As String = ""
|
||||
If Not IsNothing(StopWatch) Then
|
||||
StopWatch.Stop()
|
||||
Dim ts As TimeSpan = StopWatch.Elapsed
|
||||
sTime = String.Format("{0:00}:{1:00}:{2:00}.{3:000}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds)
|
||||
End If
|
||||
Return sTime
|
||||
End Function
|
||||
|
||||
'--------------------------------------------------------------------------------------------------
|
||||
Friend Sub UpdateUI()
|
||||
'--------------------------------------------------------------------------------------------------
|
||||
Friend Sub UpdateUI()
|
||||
' Costringo ad aggiornare UI
|
||||
Dim nDummy As Integer
|
||||
Application.Current.Dispatcher.Invoke(Windows.Threading.DispatcherPriority.Background, _
|
||||
@@ -362,6 +362,10 @@ Module Utility
|
||||
EgtSetStatus(nPartId, GDB_ST.ON_)
|
||||
nPartId = EgtGetNextPart(nPartId)
|
||||
End While
|
||||
|
||||
' Visualizzo gli elementi attivi in parcheggio
|
||||
SelParkIndWD.UpdateViewOnParkInd(False)
|
||||
|
||||
' Se necessario, ripristino precedente impostazione modificato
|
||||
If bOldEnMod Then EgtEnableModified()
|
||||
End Sub
|
||||
|
||||
@@ -4,27 +4,77 @@
|
||||
TextBlock.FontFamily="{DynamicResource OmagCut_Font}"
|
||||
Height="500" Width="500" ShowInTaskbar="False" Initialized="Window_Initialized" MinWidth="300" MinHeight="300">
|
||||
|
||||
<Grid Name="VeinMatchingGrid" Background="{DynamicResource OmagCut_Gray}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="91"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Button Name="NewBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="New"/>
|
||||
<Button Name="ExportBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="Export"/>
|
||||
<Button Name="AssemblyBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="3D"/>
|
||||
<Button Name="ImportCurrProjBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="Import"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid Name="VeinMatchingGrid" Background="{DynamicResource OmagCut_Gray}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="91"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<DockPanel>
|
||||
<StackPanel Orientation="Vertical" VerticalAlignment="Top" DockPanel.Dock="Top">
|
||||
<Button Name="NewBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="New"/>
|
||||
<Button Name="ExportBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="Export"/>
|
||||
<Button Name="AssemblyBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="3D"/>
|
||||
<Button Name="ImportCurrProjBtn" Height="64"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Content="Import"/>
|
||||
<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>
|
||||
|
||||
</Window>
|
||||
|
||||
@@ -31,7 +31,9 @@ Public Class VeinMatchingWindow
|
||||
VeinMatchingSceneHost.SetValue(Grid.ColumnProperty, 1)
|
||||
Me.VeinMatchingGrid.Children.Add(VeinMatchingSceneHost)
|
||||
' Per non farla visualizzare alla creazione
|
||||
Me.Left = 32000
|
||||
If GetPrivateProfileInt(S_VEINMATCHING, K_VEINMA_ENABLE, 0, m_MainWindow.GetIniFile()) = 1 Then
|
||||
Me.Left = 32000
|
||||
End If
|
||||
' Assegno messaggi
|
||||
NewBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 3)
|
||||
ExportBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 10)
|
||||
@@ -80,6 +82,8 @@ Public Class VeinMatchingWindow
|
||||
Dim nTxrMaxLinPix As Integer = GetPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096, m_MainWindow.GetIniFile())
|
||||
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
|
||||
m_bFirst = False
|
||||
' nascondo la visulizzazione dei campi
|
||||
DistanceStkPnl.Visibility = Visibility.Hidden
|
||||
End If
|
||||
' inibisco selezione diretta da Scene
|
||||
VeinMatchingScene.SetStatusNull()
|
||||
@@ -192,6 +196,25 @@ Public Class VeinMatchingWindow
|
||||
EgtDraw()
|
||||
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
|
||||
VeinMatching.Clear()
|
||||
End Sub
|
||||
@@ -209,6 +232,25 @@ Public Class VeinMatchingWindow
|
||||
VeinMatching.LoadCurrPartFromProj()
|
||||
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
|
||||
|
||||
Friend Module VeinMatching
|
||||
@@ -383,8 +425,6 @@ Friend Module VeinMatching
|
||||
ShowParkedParts()
|
||||
' Ripristino il contesto corrente
|
||||
EgtSetCurrentContext(nCurrCtx)
|
||||
|
||||
' EgtSaveFile("C:\EgtData\OmagCUT\Temp\MyVeinMatch.nge", NGE.TEXT)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -1176,6 +1216,8 @@ Friend Module VeinMatching
|
||||
' Esporto il file come immagine
|
||||
EgtSetCurrentContext(m_nVeinCtx)
|
||||
Dim bOk As Boolean = (EgtGetFileType(sFilePath) = FT.IMG)
|
||||
m_nImgWidth = GetPrivateProfileDouble(S_VEINMATCHING, K_VEINMA_WIDTH, m_nImgWidth, m_MainWindow.GetIniFile)
|
||||
m_nImgHeight = GetPrivateProfileDouble(S_VEINMATCHING, K_VEINMA_HEIGHT, m_nImgHeight, m_MainWindow.GetIniFile)
|
||||
bOk = bOk AndAlso EgtGetImage(EgtGetShowMode(), New Color3d(255, 255, 255), New Color3d(255, 255, 255),
|
||||
m_nImgWidth, m_nImgHeight, sFilePath)
|
||||
' Ripristino il contesto originale
|
||||
|
||||
@@ -189,25 +189,33 @@ Public Class WorkInProgressPageUC
|
||||
' Valori precedenti degli assi macchina
|
||||
Dim dL1p, dL2p, dL3p, dR1p, dR2p As Double
|
||||
Dim bFirst As Boolean = True
|
||||
|
||||
' Gestione fase di lavoro
|
||||
Dim sPhaseVar As String = String.Empty
|
||||
GetPrivateProfileString(S_MACH_INPROGRESS, K_PHASEVAR, "E80020", sPhaseVar, m_MainWindow.GetMachIniFile())
|
||||
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
Dim nCurrPhase = 1
|
||||
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
||||
nCurrPhase = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
|
||||
Dim bCurrPhaseExists As Boolean = False
|
||||
If GetPrivateProfileString(S_MACH_INPROGRESS, K_PHASEVAR, "E80020", sPhaseVar, m_MainWindow.GetMachIniFile()) <> 0 Then
|
||||
bCurrPhaseExists = True
|
||||
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
|
||||
System.Threading.Thread.Sleep(100)
|
||||
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
||||
nCurrPhase = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
|
||||
End If
|
||||
EgtSetCurrPhase(nCurrPhase, True)
|
||||
EgtDraw()
|
||||
Else
|
||||
EgtOutLog("Variabile 'PhaseVar' mancante! In CurrentMachine non sarà aggiornata la fase del grezzo")
|
||||
End If
|
||||
EgtSetCurrPhase(nCurrPhase, True)
|
||||
EgtDraw()
|
||||
|
||||
' Tempo di ritardo nel ciclo
|
||||
Dim nTimeStep As Integer = 50
|
||||
nTimeStep = GetPrivateProfileInt(S_MACH_INPROGRESS, K_WP_STEPTIME, nTimeStep, m_MainWindow.GetMachIniFile())
|
||||
EgtOutLog("Tempo di attesa tra una lettura degli assi e la successiva: " & nTimeStep.ToString & " (ms)")
|
||||
' Ciclo
|
||||
While m_bContinue
|
||||
' Rileggo la variabile di fase
|
||||
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
|
||||
If bCurrPhaseExists Then m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
|
||||
' Recupero la posizione degli assi macchina
|
||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||
@@ -238,7 +246,7 @@ Public Class WorkInProgressPageUC
|
||||
' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU
|
||||
System.Threading.Thread.Sleep(nTimeStep)
|
||||
' Leggo la fase
|
||||
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
||||
If bCurrPhaseExists AndAlso m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
||||
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||
Dim nNextPhase As Integer = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
|
||||
If nNextPhase > nCurrPhase Then
|
||||
@@ -263,12 +271,12 @@ Public Class WorkInProgressPageUC
|
||||
Private Sub MachViewModeBtn_Click(sender As Object, e As RoutedEventArgs) Handles MachViewModeBtn.Click
|
||||
' aggiorno lo stato
|
||||
Select Case m_nMachLook
|
||||
Case MCH_LOOK.ALL
|
||||
m_nMachLook = MCH_LOOK.TAB_HEAD
|
||||
Case MCH_LOOK.TAB_HEAD
|
||||
m_nMachLook = MCH_LOOK.TAB_TOOL
|
||||
Case Else
|
||||
m_nMachLook = MCH_LOOK.ALL
|
||||
Case MCH_LOOK.ALL
|
||||
m_nMachLook = MCH_LOOK.TAB_HEAD
|
||||
Case MCH_LOOK.TAB_HEAD
|
||||
m_nMachLook = MCH_LOOK.TAB_TOOL
|
||||
Case Else
|
||||
m_nMachLook = MCH_LOOK.ALL
|
||||
End Select
|
||||
' aggiorno lo stato della macchina e la sua visualizzazione
|
||||
EgtSetMachineLook(m_nMachLook)
|
||||
@@ -309,7 +317,7 @@ Public Class WorkInProgressPageUC
|
||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
||||
WorkInProgressScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
|
||||
Dim bProd As Boolean = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_BASE)
|
||||
Dim bProd As Boolean = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_BASE) Or m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.CUT_LIGHT)
|
||||
If Not WorkInProgressScene.Init() Or Not bProd Then
|
||||
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
||||
Me.WorkInProgressPageGrid.Children.Remove(WorkInProgressSceneHost)
|
||||
@@ -320,16 +328,30 @@ Public Class WorkInProgressPageUC
|
||||
#Else
|
||||
' Se manca la chiave
|
||||
If m_MainWindow.GetKeyLevel() = -1 Or m_MainWindow.GetKeyLevel() = -2 Then
|
||||
EgtOutLog("Missing Dongle")
|
||||
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
|
||||
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
|
||||
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
|
||||
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
' Altrimenti manca la licenza
|
||||
If Not EgtGetNetHwKey() Then
|
||||
EgtOutLog("Missing Dongle")
|
||||
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
|
||||
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
|
||||
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
|
||||
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, EgtMsg(MSG_MISSINGKEYWD + 1), EgtMsg(MSG_MISSINGKEYWD + 2) & " " & EgtMsg(MSG_MISSINGKEYWD + 3), EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
Else
|
||||
EgtOutLog("NetDongle is full")
|
||||
' Box di avviso slot chiave di rete occupato : "Chiave di Rete completamente occupata. \n Uscire dal programma su un altro PC." "Errore"
|
||||
Dim sText As String = EgtMsg(10110) & vbCrLf & EgtMsg(10111)
|
||||
Dim sTitle As String = EgtMsg(10101)
|
||||
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, sTitle, sText, EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
End If
|
||||
ElseIf m_MainWindow.GetKeyLevel() = -9 Then
|
||||
EgtOutLog("Missing Link with Net Dongle")
|
||||
' Box di avviso chiave mancante : "Collegamento con la Chiave di rete non riuscito. \n Verificare la connessione." "Errore"
|
||||
Dim sText As String = EgtMsg(10108) & vbCrLf & EgtMsg(10109)
|
||||
Dim sTitle As String = EgtMsg(10101)
|
||||
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, sTitle, sText, EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL)
|
||||
' Altrimenti manca la licenza
|
||||
Else
|
||||
EgtOutLog("Problems with Licence")
|
||||
' Box di avviso licenza con problemi : "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
|
||||
Dim sKeyInfo As String = "" : EgtGetKeyInfo( sKeyInfo)
|
||||
Dim sKeyInfo As String = "" : EgtGetKeyInfo(sKeyInfo)
|
||||
Dim sText As String = sKeyInfo & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6)
|
||||
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
|
||||
Dim MissingKeyWnd As New EgtMsgBox(m_MainWindow, sTitle, sText, EgtMsgBox.Buttons.OK, EgtMsgBox.Icons.NULL, 0, 2)
|
||||
@@ -360,7 +382,7 @@ Public Class WorkInProgressPageUC
|
||||
End If
|
||||
#End If
|
||||
m_MainWindow.Close()
|
||||
If bRestart Then Process.Start( Application.ResourceAssembly.Location)
|
||||
If bRestart Then Process.Start(Application.ResourceAssembly.Location)
|
||||
Return True
|
||||
End If
|
||||
' dimensione lineare max in pixel delle textures
|
||||
@@ -389,19 +411,19 @@ Public Class WorkInProgressPageUC
|
||||
' Imposto il giusto contesto
|
||||
Dim bOk As Boolean = EgtSetCurrentContext(WorkInProgressScene.GetCtx())
|
||||
' Svuoto le teste
|
||||
EgtResetHeadSet( "H1")
|
||||
EgtResetHeadSet( "H2")
|
||||
EgtResetHeadSet("H1")
|
||||
EgtResetHeadSet("H2")
|
||||
' Imposto la lama corrente
|
||||
Dim sSaw As String = GetFirstTool()
|
||||
If bOk Then
|
||||
If Not EgtSetCalcTool( sSaw, "H1", 1) Then bOk = False
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then bOk = False
|
||||
End If
|
||||
' Imposto eventuale secondo utensile montato
|
||||
If bOk Then
|
||||
Dim sHead As String = ""
|
||||
Dim nExit As Integer = 0
|
||||
Dim sTool As String = GetSecondTool( sHead, nExit)
|
||||
If Not String.IsNullOrEmpty( sTool) AndAlso Not EgtLoadTool( sHead, nExit, sTool) Then
|
||||
Dim sTool As String = GetSecondTool(sHead, nExit)
|
||||
If Not String.IsNullOrEmpty(sTool) AndAlso Not EgtLoadTool(sHead, nExit, sTool) Then
|
||||
bOk = False
|
||||
End If
|
||||
End If
|
||||
@@ -414,7 +436,7 @@ Public Class WorkInProgressPageUC
|
||||
Return m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||
End Function
|
||||
|
||||
Private Function GetSecondTool( ByRef sHead As String, ByRef nExit As Integer) As String
|
||||
Private Function GetSecondTool(ByRef sHead As String, ByRef nExit As Integer) As String
|
||||
' Se non previsto secondo utensile, non c'è
|
||||
If m_MainWindow.m_CurrentMachine.MountedToolConfig <> CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL Then
|
||||
Return ""
|
||||
@@ -454,17 +476,17 @@ Public Class WorkInProgressPageUC
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If bOk Then
|
||||
' Calcolo standard con utensile principale (lama)
|
||||
If Not EgtGetCalcTipFromPositions( dL1, dL2, dL3, dR1, dR2, True, ptTip) Then bOk = False
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, ptTip) Then bOk = False
|
||||
' Se testa verticale e presente altro utensile, rifaccio calcolo con questo
|
||||
Dim vtTool As Vector3d
|
||||
If EgtGetCalcToolDirFromAngles( dR1, dR2, vtTool) AndAlso ( vtTool - Vector3d.Z_AX()).IsSmall() Then
|
||||
If EgtGetCalcToolDirFromAngles(dR1, dR2, vtTool) AndAlso (vtTool - Vector3d.Z_AX()).IsSmall() Then
|
||||
Dim sHead As String = ""
|
||||
Dim nExit As Integer = 0
|
||||
Dim sTool As String = GetSecondTool( sHead, nExit)
|
||||
If Not String.IsNullOrEmpty( sTool) AndAlso EgtSetCalcTool( sTool, sHead, nExit) Then
|
||||
Dim sTool As String = GetSecondTool(sHead, nExit)
|
||||
If Not String.IsNullOrEmpty(sTool) AndAlso EgtSetCalcTool(sTool, sHead, nExit) Then
|
||||
' Calcolo secondo tip
|
||||
Dim ptTip2 As Point3d
|
||||
If EgtGetCalcTipFromPositions( dL1, dL2, dL3, dR1, dR2, True, ptTip2) Then
|
||||
If EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, ptTip2) Then
|
||||
ptTip = ptTip2
|
||||
End If
|
||||
' Ripristino configurazione standard
|
||||
|
||||