Compare commits
265 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c267aacf7 | |||
| 87037b6c6a | |||
| 74c479d17d | |||
| ead6bcec6d | |||
| a1ad658f27 | |||
| 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 | |||
| 53d06d6098 | |||
| eb571bf5fd | |||
| 3d11abfa31 | |||
| b1f8d21cc5 | |||
| ec8fbd3297 | |||
| fdd3342492 | |||
| f41b8f1409 | |||
| 5edd5300cd | |||
| 92be9189c6 | |||
| 6c0bb175d9 | |||
| a079596aed | |||
| 60da7384a2 | |||
| 761842bf45 | |||
| 32cfbfbeec | |||
| 2ff2e6ffc4 | |||
| 0c7c729914 | |||
| 7195e16c37 | |||
| 42b0622bdf | |||
| bcdb79e796 | |||
| d7aa8902d9 | |||
| 9d7fb9ab99 | |||
| 8419659647 | |||
| 8becdfb219 | |||
| 7c6b18d996 | |||
| 44e9a448fe | |||
| 5740820eed | |||
| 3202993a3e | |||
| b293156a30 | |||
| dfe876638f | |||
| 1c861ee7e3 | |||
| 5da026accb | |||
| 5396796d28 | |||
| ae18c7f027 | |||
| 54122d82e6 | |||
| f85e97a126 | |||
| 06654d923c | |||
| ce1c6fcf02 | |||
| da11ec0a11 | |||
| 52688ed0da | |||
| 60eda04669 | |||
| b95dd8f41d | |||
| 4b2351c20a | |||
| 988743187b | |||
| 2c0afccbe3 | |||
| a5d6d34664 | |||
| 27b13292cf | |||
| 7b9d99a9c6 | |||
| 1e2b4bed27 | |||
| 4ecf7980ce | |||
| 82157d3b6e | |||
| 10cb8f64f5 | |||
| 6dbf4f5ccb | |||
| 4ba0fe2520 | |||
| a55ab4f83d | |||
| 419776c89f | |||
| fd89a6cf3b | |||
| b505b79d9a | |||
| b1313ddb55 | |||
| f3889ede24 | |||
| 5ca010ae4a | |||
| 391d25507e | |||
| c954f364e3 | |||
| 1ab6d2746f | |||
| 41de0516c8 | |||
| dec4c0d312 | |||
| 834f3afe1c | |||
| e6c95323fb | |||
| fa6e5b520f | |||
| aefc037cd9 | |||
| c475f7dc12 | |||
| c5f3d4fcfb | |||
| a04e2cbe62 | |||
| da980a649e | |||
| 4c282d7531 | |||
| a941f963c2 | |||
| eab341d7fe | |||
| 9c7d60d307 | |||
| a7adcdcaca | |||
| acb8ceed4d | |||
| 65d8f58b45 | |||
| 07cf7ced42 | |||
| b1410ca11c | |||
| 1975f46995 | |||
| 6863186e07 | |||
| b434f80030 | |||
| 0151cd8f9e | |||
| 75e3729216 | |||
| ef1aef12ed | |||
| 959fb2e44f | |||
| 59e3ae5841 | |||
| 941e7837be | |||
| 58de5d4077 | |||
| b6beef668d | |||
| 680505af10 | |||
| b0bfa67d2a | |||
| 29d8c1e29b | |||
| e5d4f223f8 | |||
| 3cfc7276c9 | |||
| 0c0233b27e | |||
| 4e8925515d | |||
| 3b552b2f4e | |||
| 3fae33404b | |||
| 0d4d853834 | |||
| 37fcbe8240 | |||
| 4393f282b7 | |||
| 6844a8c77c | |||
| 659405c52f | |||
| efafacf6ca | |||
| 6905a8d6dc | |||
| d8ba23894e | |||
| aba1572f95 | |||
| fdb0ed598b | |||
| 4cb3518346 | |||
| 56b8ee88d3 | |||
| d0439f2b05 | |||
| 07d8145d57 | |||
| 652c396933 | |||
| 997e8c380d | |||
| 8d363b8b06 | |||
| 7ecad4c218 | |||
| d49c231541 | |||
| 8d82058e49 | |||
| d6a9cac6b4 | |||
| 4ce898c25c | |||
| 6f59cddd80 | |||
| c8b018f6df | |||
| 36a1ecb509 | |||
| e287e827c4 | |||
| 68e9a9201d | |||
| 0eaebd5aad | |||
| 8946bf3a00 | |||
| aeb0be0590 | |||
| a15acb6528 | |||
| e7e9d26b75 | |||
| b48d4900ea | |||
| d9de23daca | |||
| ad5c9331ba | |||
| b67330b509 | |||
| ca66108145 | |||
| 379ccc7519 | |||
| b751c27773 | |||
| 14e1c254f0 | |||
| 6f08e5f520 | |||
| 7d8933cc39 | |||
| 2179996bff | |||
| 316bcc89ea | |||
| ce151e5db7 | |||
| b303fe2615 | |||
| 3e0d43c1d8 | |||
| 70b1822446 |
@@ -21,6 +21,7 @@
|
|||||||
<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="0.25*"/>
|
<RowDefinition Height="0.25*"/>
|
||||||
@@ -44,13 +45,17 @@
|
|||||||
VerticalAlignment="Center" FontSize="18"/>
|
VerticalAlignment="Center" FontSize="18"/>
|
||||||
<TextBlock Name="KeyLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
|
<TextBlock Name="KeyLbl" Grid.Column="1" Grid.Row="5" HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" FontSize="18"/>
|
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"/>
|
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"/>
|
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" />
|
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"/>
|
Style="{DynamicResource OmagCut_WindowGrayTextButton}" Margin="1,0"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -33,6 +33,19 @@ Public Class AboutBoxWD
|
|||||||
#Else
|
#Else
|
||||||
KeyLbl.Text = sKey & " - " & sOpts
|
KeyLbl.Text = sKey & " - " & sOpts
|
||||||
#End If
|
#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()
|
CopyrightLbl.Text = My.Application.Info.Copyright.ToString()
|
||||||
MachineLbl.Text = "Machine : " & m_MainWindow.m_CurrentMachine.sMachineName
|
MachineLbl.Text = "Machine : " & m_MainWindow.m_CurrentMachine.sMachineName
|
||||||
ProjectLbl.Text = "Project : " & m_MainWindow.m_CurrentProjectPageUC.GetCurrentProjectName()
|
ProjectLbl.Text = "Project : " & m_MainWindow.m_CurrentProjectPageUC.GetCurrentProjectName()
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtUILib
|
Imports System.Windows.Forms.Integration
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Friend Module CamAuto
|
Friend Module CamAuto
|
||||||
|
|
||||||
@@ -163,6 +164,61 @@ Friend Module CamAuto
|
|||||||
Return bOk
|
Return bOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function ResetAllSplitCut() As Boolean
|
||||||
|
Dim PartList As New List(Of Integer)
|
||||||
|
' Ricerca nei grezzi dei pezzi (devono essere ricercati tra quelli presenti nei grezzi)
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
' Recupero il numero di fasi presenti nel progetto
|
||||||
|
Dim nPhaseCount As Integer = EgtGetPhaseCount()
|
||||||
|
For nPhase As Integer = 1 To nPhaseCount
|
||||||
|
EgtSetCurrPhase(nPhase)
|
||||||
|
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||||
|
While nRawId <> GDB_ID.NULL
|
||||||
|
Dim nParId As Integer = EgtGetFirstPartInRawPart(nRawId)
|
||||||
|
If EgtVerifyRawPartPhase(nRawId, nPhase) Then
|
||||||
|
While nParId <> GDB_ID.NULL
|
||||||
|
Dim nNextParId As Integer = EgtGetNextPartInRawPart(nParId)
|
||||||
|
' verifico se il pezzo passato è un taglio di sepatazione (il nome deve contenere "SpliCut")
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
If EgtGetName(nParId, sName) AndAlso sName.Contains(SPLIT_CUT) Then
|
||||||
|
' Rimuovo il pezzo dal grezzo
|
||||||
|
If EgtRemovePartFromRawPart(nParId) Then
|
||||||
|
' Salvo l'indice del pezzo se non è stato già inserito
|
||||||
|
Dim nIndex As Integer = PartList.FirstOrDefault(Function(nId) nId = nParId)
|
||||||
|
If nIndex = 0 Then PartList.Add(nParId)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nParId = nNextParId
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
nRawId = EgtGetNextRawPart(nRawId)
|
||||||
|
End While
|
||||||
|
Next
|
||||||
|
' Reimposto la prima fase del progetto
|
||||||
|
EgtSetCurrPhase(1)
|
||||||
|
' Procedo ad eliminare il pezzo
|
||||||
|
For Each Item As Integer In PartList
|
||||||
|
bOk = bOk And EgtErase(Item)
|
||||||
|
Next
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Friend Function ResetAllRawPart() As Boolean
|
||||||
|
Dim nPhase As Integer = 1
|
||||||
|
Dim nOtherRaw As Integer = EgtGetFirstRawPart()
|
||||||
|
While nOtherRaw <> GDB_ID.NULL
|
||||||
|
' se il pezzo non appartiene alla prima fase allora viene eliminato
|
||||||
|
If Not EgtVerifyRawPartPhase(nOtherRaw, nPhase) Then
|
||||||
|
Dim NextRaw As Integer = EgtGetNextRawPart(nOtherRaw)
|
||||||
|
EgtRemoveRawPart(nOtherRaw)
|
||||||
|
nOtherRaw = NextRaw
|
||||||
|
Else
|
||||||
|
nOtherRaw = EgtGetNextRawPart(nOtherRaw)
|
||||||
|
End If
|
||||||
|
End While
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
' verifico che il contorno passato non sia stato separato
|
' verifico che il contorno passato non sia stato separato
|
||||||
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer)
|
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer)
|
||||||
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
<Label Name="CsvPathTxBl" Grid.Row="1" Background="White" FontSize="16" VerticalAlignment="Center" Padding="2,5,0,5"/>
|
<Label Name="CsvPathTxBl" Grid.Row="1" Background="White" FontSize="16" VerticalAlignment="Center" Padding="2,5,0,5"/>
|
||||||
|
|
||||||
<TreeView Name="PartsTreeView" Grid.Row="2" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}">
|
<TreeView Name="PartsTreeView" Grid.Row="2" Background="{StaticResource OmagCut_TreeViewGradientGray}">
|
||||||
<TreeView.Resources>
|
<TreeView.Resources>
|
||||||
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
|
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
|
||||||
<!--renderlo apribile con un solo click -->
|
<!--renderlo apribile con un solo click -->
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" />
|
<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" />
|
||||||
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="10" />
|
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="10" Foreground="Black" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@@ -123,7 +123,10 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<DataTrigger Binding="{Binding bIsActive}" Value="False">
|
<DataTrigger Binding="{Binding bIsActive}" Value="False">
|
||||||
<Setter Property="Foreground" Value="{StaticResource OmagCut_LightGray}"/>
|
<Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
|
||||||
|
</DataTrigger>
|
||||||
|
<DataTrigger Binding="{Binding bIsActive}" Value="True">
|
||||||
|
<Setter Property="Foreground" Value="Black"/>
|
||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -131,18 +134,25 @@
|
|||||||
</HierarchicalDataTemplate>
|
</HierarchicalDataTemplate>
|
||||||
<!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo-->
|
<!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo-->
|
||||||
<DataTemplate DataType="{x:Type self:PartCustomItem}">
|
<DataTemplate DataType="{x:Type self:PartCustomItem}">
|
||||||
<Grid Width="246" Margin="0,5,0,5" HorizontalAlignment="Right">
|
<Grid Width="234.8" Margin="0,5,0,5" HorizontalAlignment="Right">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="60"/>
|
<ColumnDefinition Width="60"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock Grid.Column="0" Text="{Binding Name}" Height="18" FontSize="14" HorizontalAlignment="Right"/>
|
<TextBlock x:Name="TbName" Grid.Column="0" Text="{Binding Name}" Height="18" FontSize="14" HorizontalAlignment="Right"/>
|
||||||
<TextBlock Grid.Column="1" Text="{Binding sText1}" Height="18" FontSize="14" HorizontalAlignment="Center"/>
|
<TextBlock x:Name="TbText1" Grid.Column="1" Text="{Binding sText1}" Height="18" FontSize="14" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Grid.Column="2" Text="{Binding sText2}" Height="18" FontSize="14" HorizontalAlignment="Left"/>
|
<TextBlock x:Name="TbText2" Grid.Column="2" Text="{Binding sText2}" Height="18" FontSize="14" HorizontalAlignment="Left"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<DataTemplate.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding bIsActive}" Value="False">
|
||||||
|
<Setter TargetName="TbName" Property="TextDecorations" Value="Strikethrough" />
|
||||||
|
<Setter TargetName="TbText1" Property="TextDecorations" Value="Strikethrough" />
|
||||||
|
<Setter TargetName="TbText2" Property="TextDecorations" Value="Strikethrough" />
|
||||||
|
</DataTrigger>
|
||||||
|
</DataTemplate.Triggers>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</TreeView.Resources>
|
</TreeView.Resources>
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
<Button Name="PhotoBtn" Grid.Column="0" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
<Image Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Name="PhotoIMG" Source="{DynamicResource PhotoImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
|||||||
@@ -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,281 @@
|
|||||||
|
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.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
|
||||||
@@ -132,13 +132,16 @@
|
|||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<!--Gestione sfridi-->
|
||||||
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
|
<Button Name="RemovePartBtn" Grid.ColumnSpan="2" Grid.Row="6"
|
||||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
|
|
||||||
<Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
|
<Button Name="ScrapsBtn" Grid.Column="3" Grid.Row="6"
|
||||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
|
|
||||||
|
<!--Gestione scarico pezzi-->
|
||||||
|
<Button Name="UnloadPartsBtn" Grid.ColumnSpan="2" Grid.Row="7"
|
||||||
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
|
|
||||||
<Grid Grid.Row="7" Grid.ColumnSpan="3">
|
<Grid Grid.Row="7" Grid.ColumnSpan="3">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtUILib
|
Imports System.Windows.Forms.Integration
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Public Class MoveRawPartPage
|
Public Class MoveRawPartPage
|
||||||
' Riferimento alla MainWindow
|
' Riferimento alla MainWindow
|
||||||
@@ -35,12 +36,16 @@ Public Class MoveRawPartPage
|
|||||||
Private m_ScrapsVisibility As Visibility = Visibility.Visible
|
Private m_ScrapsVisibility As Visibility = Visibility.Visible
|
||||||
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
|
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
|
' definisce se è stata inserito uno scarico
|
||||||
|
Private m_IsCurrPhaseUnloaded As Boolean = False
|
||||||
|
|
||||||
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
' Assegno testi
|
' Assegno testi
|
||||||
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
|
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
|
||||||
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) 'Modifica
|
ModifyBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 17) 'Modifica
|
||||||
ResetBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
|
ResetBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6) 'Reset
|
||||||
ScrapsBtn.Content = "Add Scraps"
|
ScrapsBtn.Content = "Add Scraps"
|
||||||
|
UnloadPartsBtn.Content = "Move part"
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub MoveRawPartPage_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
|
Private Sub MoveRawPartPage_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
|
||||||
@@ -60,7 +65,12 @@ Public Class MoveRawPartPage
|
|||||||
End If
|
End If
|
||||||
' Deseleziono tutto
|
' Deseleziono tutto
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
' Recupero i tagli allungati prima definiti
|
' resetto variabili di navigazione nelle fasi
|
||||||
|
m_bPrev = False
|
||||||
|
m_bToNext = False
|
||||||
|
|
||||||
|
'---------------------------- CREATE NEW PHASE ----------------------------
|
||||||
|
' Recupero i tagli ABILITATI prima definiti
|
||||||
Dim Cuts(0) As Integer
|
Dim Cuts(0) As Integer
|
||||||
m_SplitPage.GetEnabledCuts(Cuts)
|
m_SplitPage.GetEnabledCuts(Cuts)
|
||||||
' Fase precedente
|
' Fase precedente
|
||||||
@@ -69,11 +79,19 @@ Public Class MoveRawPartPage
|
|||||||
Dim vNewRaws As New List(Of Integer)
|
Dim vNewRaws As New List(Of Integer)
|
||||||
If Not m_SplitPage.m_bShow Then
|
If Not m_SplitPage.m_bShow Then
|
||||||
SplitRawParts(nPrevPhase, Cuts, vNewRaws)
|
SplitRawParts(nPrevPhase, Cuts, vNewRaws)
|
||||||
|
m_IsCurrPhaseUnloaded = False
|
||||||
Else
|
Else
|
||||||
EgtSetCurrPhase(nPrevPhase + 1)
|
nPrevPhase = nPrevPhase + 1
|
||||||
|
EgtSetCurrPhase(nPrevPhase)
|
||||||
HideAllMachinings()
|
HideAllMachinings()
|
||||||
|
' verifico se la fase corrente è di tipo scarico frontale
|
||||||
|
m_nCurrDisposition = EgtGetPhaseDisposition(nPrevPhase)
|
||||||
|
If IsDispUnloadOnAuxTab(m_nCurrDisposition) Then
|
||||||
|
m_SplitPage.m_bOnAuxTab = True
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
m_nCurrPhase = EgtGetCurrPhase()
|
m_nCurrPhase = EgtGetCurrPhase()
|
||||||
|
'---------------------------- CREATE NEW PHASE ----------------------------
|
||||||
|
|
||||||
'---------------------------- SCRAPS ----------------------------
|
'---------------------------- SCRAPS ----------------------------
|
||||||
' gestione visualizzazione del comando "Scraps"
|
' gestione visualizzazione del comando "Scraps"
|
||||||
@@ -101,14 +119,18 @@ Public Class MoveRawPartPage
|
|||||||
End If
|
End If
|
||||||
'---------------------------- SCRAPS ----------------------------
|
'---------------------------- SCRAPS ----------------------------
|
||||||
|
|
||||||
|
'---------------------------- AUX TABLE ----------------------------
|
||||||
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
|
' Se movimento pezzi finale, sistemazioni per tavolo ausiliario
|
||||||
If m_SplitPage.m_bOnAuxTab Then
|
If m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
|
||||||
' assegnazione delle info tavola ausiliaria alla dispozione corrente
|
' assegnazione delle info tavola ausiliaria alla dispozione corrente (Spostato nella funzione Refresh)
|
||||||
SetAuxTabInCurrDisposition()
|
SetAuxTabInCurrDisposition()
|
||||||
|
UnloadPartsBtn.Content = "Go to MOVE part"
|
||||||
' altrimenti, aggiorno visualizzazione
|
' altrimenti, aggiorno visualizzazione
|
||||||
Else
|
ElseIf Not m_SplitPage.m_bOnAuxTab And m_SplitPage.m_bEnableOnAuxTab Then
|
||||||
EgtDraw()
|
UnloadPartsBtn.Content = "Go to UNLOAD part"
|
||||||
End If
|
End If
|
||||||
|
'---------------------------- AUX TABLE ----------------------------
|
||||||
|
EgtDraw()
|
||||||
' Carico i parametri di movimento
|
' Carico i parametri di movimento
|
||||||
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
|
m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile())
|
||||||
' Ricavo la lunghezza del baffo di taglio
|
' Ricavo la lunghezza del baffo di taglio
|
||||||
@@ -167,6 +189,30 @@ Public Class MoveRawPartPage
|
|||||||
|
|
||||||
' aggiorno il messaggio del comando per gestire gli sfridi
|
' aggiorno il messaggio del comando per gestire gli sfridi
|
||||||
VerifyIsNewScrap(m_CurrRawOnVacuum)
|
VerifyIsNewScrap(m_CurrRawOnVacuum)
|
||||||
|
' aggiorno la visibilità dei comandi
|
||||||
|
RefreshVisibility()
|
||||||
|
' salvo l'idice della fase corrente
|
||||||
|
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||||
|
' Abilitazione bottone modifica
|
||||||
|
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
|
||||||
|
' gestione abilitazione altri bottoni
|
||||||
|
EnableButtons()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Gestione di visualizzazione dei comandi per il movimento dei pezzi
|
||||||
|
Private Sub RefreshVisibility()
|
||||||
|
' Aggiorno visulizzazione comando per passare alla pagina di scarico
|
||||||
|
If Not m_SplitPage.m_bEnableOnAuxTab Then
|
||||||
|
UnloadPartsBtn.Visibility = Visibility.Hidden
|
||||||
|
Else
|
||||||
|
UnloadPartsBtn.Visibility = Visibility.Visible
|
||||||
|
If m_SplitPage.m_bOnAuxTab Then
|
||||||
|
UnloadPartsBtn.Content = "Go to MOVE part"
|
||||||
|
' altrimenti, aggiorno visualizzazione
|
||||||
|
Else
|
||||||
|
UnloadPartsBtn.Content = "Go to UNLOAD part"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
' Aggiorno interfaccia per taglio perpendicolare
|
' Aggiorno interfaccia per taglio perpendicolare
|
||||||
If m_bByHand Then
|
If m_bByHand Then
|
||||||
UpBtn.Visibility = Windows.Visibility.Visible
|
UpBtn.Visibility = Windows.Visibility.Visible
|
||||||
@@ -222,12 +268,6 @@ Public Class MoveRawPartPage
|
|||||||
ResetBtn.Visibility = Windows.Visibility.Visible
|
ResetBtn.Visibility = Windows.Visibility.Visible
|
||||||
ScrapsBtn.Visibility = Windows.Visibility.Hidden
|
ScrapsBtn.Visibility = Windows.Visibility.Hidden
|
||||||
End If
|
End If
|
||||||
' salvo l'idice della fase corrente
|
|
||||||
m_nCurrDisposition = EgtGetPhaseDisposition(m_nCurrPhase)
|
|
||||||
' Abilitazione bottone modifica
|
|
||||||
ModifyBtn.IsEnabled = m_SplitPage.m_bShow
|
|
||||||
' gestione abilitazione altri bottoni
|
|
||||||
EnableButtons()
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SetAuxTabInCurrDisposition()
|
Private Sub SetAuxTabInCurrDisposition()
|
||||||
@@ -300,7 +340,6 @@ Public Class MoveRawPartPage
|
|||||||
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
|
||||||
' verifico che il pezzo precedente possa essere depositato correttamente
|
' verifico che il pezzo precedente possa essere depositato correttamente
|
||||||
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||||
' mantengo la selezione del pezzo
|
' mantengo la selezione del pezzo
|
||||||
@@ -310,6 +349,15 @@ Public Class MoveRawPartPage
|
|||||||
' esco dal ciclo, prima devo depositare correttamente il pezzo
|
' esco dal ciclo, prima devo depositare correttamente il pezzo
|
||||||
Exit While
|
Exit While
|
||||||
End If
|
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
|
' salvo l'indice del pezzo correntemente attaccato alle ventose
|
||||||
m_CurrRawOnVacuum = nId
|
m_CurrRawOnVacuum = nId
|
||||||
|
|
||||||
@@ -329,9 +377,15 @@ Public Class MoveRawPartPage
|
|||||||
VacuumCups.SetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
|
VacuumCups.SetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
|
||||||
VacuumCups.SetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
VacuumCups.SetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
VacuumCups.SetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
VacuumCups.SetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
' se su scarico frontale allora devo modificare la scelta delle ventose
|
|
||||||
VacuumCups.bUnloadingOnAuxTab = m_SplitPage.m_bOnAuxTab
|
VacuumCups.ResetHeadName()
|
||||||
If PutVacuumCupsOnRaw(nId, rmData) Then
|
Dim bPutVacuum As Boolean = PutVacuumCupsOnRaw(nId, rmData)
|
||||||
|
If Not bPutVacuum Then
|
||||||
|
Dim bTwoHeadVac As Boolean = (EgtGetHeadId(VACUUM_HEAD_2) <> GDB_ID.NULL)
|
||||||
|
If bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(nId, rmData)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If bPutVacuum Then
|
||||||
' Visualizzo le ventose
|
' Visualizzo le ventose
|
||||||
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
||||||
' Aggiorno i dati
|
' Aggiorno i dati
|
||||||
@@ -353,6 +407,8 @@ Public Class MoveRawPartPage
|
|||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -372,7 +428,7 @@ Public Class MoveRawPartPage
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' Veririfica che il grezzo non entri in colliosione con altri pezzi
|
' 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...)
|
' 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 m_SplitPage.m_bOnAuxTab Then Return False
|
||||||
If nIdOnVacumm = GDB_ID.NULL Then Return False
|
If nIdOnVacumm = GDB_ID.NULL Then Return False
|
||||||
@@ -406,6 +462,69 @@ Public Class MoveRawPartPage
|
|||||||
Return False
|
Return False
|
||||||
End Function
|
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
|
Private Function VerifyIsNewScrap(nMyId As Integer) As Boolean
|
||||||
Dim nVal As Integer = 0
|
Dim nVal As Integer = 0
|
||||||
If EgtGetInfo(nMyId, K_ISNEWSCRAPS, nVal) Then
|
If EgtGetInfo(nMyId, K_ISNEWSCRAPS, nVal) Then
|
||||||
@@ -740,6 +859,12 @@ Public Class MoveRawPartPage
|
|||||||
Return bOk
|
Return bOk
|
||||||
End Function
|
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
|
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
|
||||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
@@ -782,6 +907,34 @@ Public Class MoveRawPartPage
|
|||||||
End While
|
End While
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' Passo dalla pagina di movimento dei pezzi alla pagina di scarico
|
||||||
|
Private Sub UnloadPartBtn_Click() Handles UnloadPartsBtn.Click
|
||||||
|
' forzo lo stato di scarico frontale oppure di movimento
|
||||||
|
m_SplitPage.m_bOnAuxTab = Not m_SplitPage.m_bOnAuxTab
|
||||||
|
|
||||||
|
' se rientro nella fase di spostamenti allora nascondo la tavola di scarico
|
||||||
|
If Not m_SplitPage.m_bOnAuxTab Then
|
||||||
|
' se ci sono pezzi sulla tavola di scarico non posso nasconderla
|
||||||
|
Dim LclLstOfUnldPart As New List(Of Integer)
|
||||||
|
If Not PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase) Then
|
||||||
|
EgtDisableModified()
|
||||||
|
' nascondo la tavola di scarico
|
||||||
|
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
|
||||||
|
' Nascondo eventuali pezzi in parcheggio
|
||||||
|
HideParkedParts()
|
||||||
|
EgtEnableModified()
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
' Assegnazione delle info tavola ausiliaria alla dispozione corrente
|
||||||
|
SetAuxTabInCurrDisposition()
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Mantengo la fase che è stata creata e passo a gestire solo la visualizzazione dei bottoni
|
||||||
|
RefreshVisibility()
|
||||||
|
EgtZoom(ZM.ALL, True)
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
|
Private Sub StepMoveTxBx_EgtClosed(sender As Object, e As EventArgs) Handles StepMoveTxBx.EgtClosed
|
||||||
Dim dStep As Double
|
Dim dStep As Double
|
||||||
If StringToLen(StepMoveTxBx.Text, dStep) Then
|
If StringToLen(StepMoveTxBx.Text, dStep) Then
|
||||||
@@ -824,7 +977,7 @@ Public Class MoveRawPartPage
|
|||||||
If Not EgtGetInfo(nRefId, "Pos", ptRef) Then Return
|
If Not EgtGetInfo(nRefId, "Pos", ptRef) Then Return
|
||||||
Dim sCorn As String = ""
|
Dim sCorn As String = ""
|
||||||
EgtGetInfo(nRefId, "COR", sCorn)
|
EgtGetInfo(nRefId, "COR", sCorn)
|
||||||
Select sCorn
|
Select Case sCorn
|
||||||
Case "TL"
|
Case "TL"
|
||||||
nCorn = MCH_CR.TL
|
nCorn = MCH_CR.TL
|
||||||
Case "TR"
|
Case "TR"
|
||||||
@@ -1009,8 +1162,44 @@ Public Class MoveRawPartPage
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
|
Private Sub PauseBtn_Click(sender As Object, e As RoutedEventArgs) Handles PauseBtn.Click
|
||||||
|
' verifico la presenza di eventuali pezzi sulla tavola di scarico
|
||||||
|
Dim LclLstOfUnldPart As New List(Of Integer)
|
||||||
|
PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase)
|
||||||
|
If Not InsertPauseInCurrPhase() Then Return
|
||||||
|
AddNewPhase()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' restituisce la lista dei pezzi che sono sulla tavola di scarico nella fase indicata
|
||||||
|
Private Function PartOnAuxTab(ByRef ListOfUnloadedPatr As List(Of Integer), nPhase As Integer) As Boolean
|
||||||
|
m_IsCurrPhaseUnloaded = False
|
||||||
|
' Area tavolo ausiliario
|
||||||
|
Dim b3AuxTab As New BBox3d
|
||||||
|
EgtGetBBoxGlob(EgtGetFirstNameInGroup(m_nAuxTabId, "A1"), GDB_BB.STANDARD, b3AuxTab)
|
||||||
|
' Area pezzi
|
||||||
|
Dim nOtherRaw As Integer = EgtGetFirstRawPart()
|
||||||
|
While nOtherRaw <> GDB_ID.NULL
|
||||||
|
If EgtVerifyRawPartPhase(nOtherRaw, nPhase) Then
|
||||||
|
Dim b3OtherRaw As New BBox3d
|
||||||
|
' EgtGetRawPartBBox(nOtherRaw, b3OtherRaw)
|
||||||
|
EgtGetBBoxGlob(nOtherRaw, GDB_BB.STANDARD, b3OtherRaw)
|
||||||
|
' se il centro del pezzo è sulla tavola di scarico
|
||||||
|
If b3OtherRaw.Center.y < b3AuxTab.Max().y Then
|
||||||
|
m_IsCurrPhaseUnloaded = True
|
||||||
|
ListOfUnloadedPatr.Add(nOtherRaw)
|
||||||
|
' salvo l'info che indica che il pezzo deve essere scaricato
|
||||||
|
EgtSetInfo(nOtherRaw, "Unloaded", 1)
|
||||||
|
'Exit While
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nOtherRaw = EgtGetNextRawPart(nOtherRaw)
|
||||||
|
End While
|
||||||
|
Return m_IsCurrPhaseUnloaded
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' inserisce una pausa nella fase corrente
|
||||||
|
Private Function InsertPauseInCurrPhase() As Boolean
|
||||||
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
|
' verifico che ci sia almeno un elemto selezionato (dati di aggancio pezzo)
|
||||||
If m_RawMoveDataList.Count = 0 Then Return
|
If m_RawMoveDataList.Count = 0 Then Return False
|
||||||
' verifico che sia stato inseito almeno uno spostamento, altrimenti lo rimuovo
|
' verifico che sia stato inseito almeno uno spostamento, altrimenti lo rimuovo
|
||||||
Dim Index As Integer = 0
|
Dim Index As Integer = 0
|
||||||
For Index = m_RawMoveDataList.Count - 1 To 0 Step -1
|
For Index = m_RawMoveDataList.Count - 1 To 0 Step -1
|
||||||
@@ -1019,8 +1208,9 @@ Public Class MoveRawPartPage
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
' verifico che la lista non sia vuota
|
' verifico che la lista non sia vuota
|
||||||
If m_RawMoveDataList.Count = 0 Then Return
|
If m_RawMoveDataList.Count = 0 Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
' recupero disposizione fase corrente
|
' recupero disposizione fase corrente
|
||||||
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||||
' imposto la pausa nella disposizione corrente
|
' imposto la pausa nella disposizione corrente
|
||||||
@@ -1028,30 +1218,22 @@ Public Class MoveRawPartPage
|
|||||||
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
|
' aggiungo al gruppo disposizione dei sottogruppi con i dati di movimento dei grezzi spostati
|
||||||
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
||||||
' imposto eventuale movimento pezzi su tavola ausiliaria
|
' imposto eventuale movimento pezzi su tavola ausiliaria
|
||||||
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
|
SaveMovePartsOnAuxTable(nDispId, m_IsCurrPhaseUnloaded)
|
||||||
|
' SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
|
||||||
'' Eseguo calcolo speciale dei movimenti: per tavola multicut
|
'' Eseguo calcolo speciale dei movimenti: per tavola multicut
|
||||||
'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
|
'SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
|
||||||
|
SaveRemoveByHandInDisposition(nDispId, False)
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' crea una nuvoa fase/disposizione, la rende corrente, ricalcolo i grezzi e le lavorazioni della nuova fase
|
||||||
|
Private Function AddNewPhase() As Boolean
|
||||||
' Creo nuova fase
|
' Creo nuova fase
|
||||||
Dim nNewPhase As Integer = EgtAddPhase()
|
Dim nNewPhase As Integer = EgtAddPhase()
|
||||||
|
' Carico i grezzi rimasti sulla tavola nella nuova fase
|
||||||
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
|
ChangePhaseRawPart(nNewPhase)
|
||||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
' Sposto le lavorazioni rimaste nella nuova fase
|
||||||
While nRawId <> GDB_ID.NULL
|
ChangeOperationPhase(nNewPhase)
|
||||||
' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
|
|
||||||
If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
|
|
||||||
Dim bKeepRawPart As Boolean = True
|
|
||||||
For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
|
|
||||||
If nRawId = RawOnAuxTabData.m_nId Then
|
|
||||||
bKeepRawPart = False
|
|
||||||
Exit For
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
|
|
||||||
End If
|
|
||||||
' passo al successivo grezzo
|
|
||||||
nRawId = EgtGetNextRawPart(nRawId)
|
|
||||||
End While
|
|
||||||
|
|
||||||
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
|
Dim nCurrDisposition As Integer = EgtGetPhaseDisposition(nNewPhase)
|
||||||
'SetPause(nCurrDisposition)
|
'SetPause(nCurrDisposition)
|
||||||
@@ -1062,8 +1244,43 @@ Public Class MoveRawPartPage
|
|||||||
SetAuxTabInCurrDisposition()
|
SetAuxTabInCurrDisposition()
|
||||||
' ripulisco la lista degli spostamenti
|
' ripulisco la lista degli spostamenti
|
||||||
m_RawMoveDataList.Clear()
|
m_RawMoveDataList.Clear()
|
||||||
|
m_IsCurrPhaseUnloaded = False
|
||||||
' aggiorno la fase corrente
|
' aggiorno la fase corrente
|
||||||
m_nCurrPhase = EgtGetCurrPhase()
|
m_nCurrPhase = EgtGetCurrPhase()
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Copio i grezzi rimasti sulla tavola nella fase successiva
|
||||||
|
Private Sub ChangePhaseRawPart(ByVal nNewPhase As Integer)
|
||||||
|
' recupero l'elenco dei pezzi che sono stati scaricati sulla tavola
|
||||||
|
Dim LocalLstOfUnldPart As New List(Of Integer)
|
||||||
|
PartOnAuxTab(LocalLstOfUnldPart, nNewPhase - 1)
|
||||||
|
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
|
||||||
|
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||||
|
While nRawId <> GDB_ID.NULL
|
||||||
|
' se il grezzo è presente nella fase precedente e non è quello selezionato allora procedo a creare una copia nella nuova fase
|
||||||
|
If EgtVerifyRawPartPhase(nRawId, nNewPhase - 1) Then
|
||||||
|
Dim bKeepRawPart As Boolean = True
|
||||||
|
For Each RawOnAuxTabData As RawMoveData In m_RawMoveDataList
|
||||||
|
If nRawId = RawOnAuxTabData.m_nId Then
|
||||||
|
' se il pezzo è stato scaricato allora non deve essere riportato nella fase successiva
|
||||||
|
For Each UnloadPart As Integer In LocalLstOfUnldPart
|
||||||
|
If nRawId = UnloadPart Then
|
||||||
|
' salvo l'info che indica che il pezzo deve essere scaricato
|
||||||
|
EgtSetInfo(nRawId, "Unloaded", 1)
|
||||||
|
bKeepRawPart = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
'bKeepRawPart = False
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If bKeepRawPart Then EgtKeepRawPart(nRawId, nNewPhase - 1)
|
||||||
|
End If
|
||||||
|
' passo al successivo grezzo
|
||||||
|
nRawId = EgtGetNextRawPart(nRawId)
|
||||||
|
End While
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click
|
Private Sub ResetBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetBtn.Click
|
||||||
@@ -1079,6 +1296,8 @@ Public Class MoveRawPartPage
|
|||||||
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngRaw)
|
EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngRaw)
|
||||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||||
RemoveRawMoveData(nRawId, m_RawMoveDataList)
|
RemoveRawMoveData(nRawId, m_RawMoveDataList)
|
||||||
|
' elimino l'info che indica che il pezzo è scaricato sulla tavola
|
||||||
|
EgtRemoveInfo(nRawId, "Unloaded")
|
||||||
' Disabilito pezzo e nascondo le ventose
|
' Disabilito pezzo e nascondo le ventose
|
||||||
EgtSetStatus(nRawId, GDB_ST.ON_)
|
EgtSetStatus(nRawId, GDB_ST.ON_)
|
||||||
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||||
@@ -1111,6 +1330,14 @@ Public Class MoveRawPartPage
|
|||||||
m_nCurrPhase -= 1
|
m_nCurrPhase -= 1
|
||||||
m_bPrev = False
|
m_bPrev = False
|
||||||
m_SplitPage.m_bShow = True
|
m_SplitPage.m_bShow = True
|
||||||
|
m_SplitPage.m_bOnAuxTab = True
|
||||||
|
' imposto la visibilità della tavola ausiliaria
|
||||||
|
SetAuxTabInCurrDisposition()
|
||||||
|
' carico le info di disposizione dei pezzi
|
||||||
|
m_RawMoveDataList.Clear()
|
||||||
|
m_bRemovedRaw = GetRemoveByHandInDisposition(m_nCurrDisposition)
|
||||||
|
GetMoveInfoInDisposition(m_nCurrDisposition, m_RawMoveDataList)
|
||||||
|
RefreshVisibility()
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
@@ -1141,18 +1368,53 @@ Public Class MoveRawPartPage
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
|
' ------- VISUALIZZAZIONE (navigazione tra le fasi) -------
|
||||||
If IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 Then
|
If m_SplitPage.m_bShow Then
|
||||||
EgtSetCurrPhase(m_nCurrPhase + 1)
|
' verifico se la fase successiva è uno scarico frontale
|
||||||
m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
|
If NextOperationIsUnloading(m_nCurrDisposition) Then
|
||||||
m_nCurrPhase += 1
|
' imposto la nuova fase (che è stata modificata all'interno della funzione di controllo)
|
||||||
m_bToNext = False
|
EgtSetCurrPhase(m_nCurrPhase)
|
||||||
m_SplitPage.m_bShow = True
|
' carico i dati di movimento dei pezzi nella fase corrente
|
||||||
|
m_RawMoveDataList.Clear()
|
||||||
|
m_bRemovedRaw = GetRemoveByHandInDisposition(m_nCurrDisposition)
|
||||||
|
GetMoveInfoInDisposition(m_nCurrDisposition, m_RawMoveDataList)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
EnableButtons()
|
EnableButtons()
|
||||||
Return
|
Return
|
||||||
|
ElseIf IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 AndAlso Not NextOperationIsUnloading(m_nCurrDisposition) Then
|
||||||
|
' imposto la nuova fase, al termine della Sub verrà caricata la pagina Split nella fase indicata ora
|
||||||
|
m_bToNext = True
|
||||||
|
m_nCurrPhase += 1
|
||||||
|
EgtSetCurrPhase(m_nCurrPhase)
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' ------- MODIFICA -------
|
||||||
|
If Not m_SplitPage.m_bShow Then
|
||||||
|
' se la tavola di scarico presente oppure ci sono pezzi sulla tavola di scarico
|
||||||
|
Dim LclLstOfUnldPart As New List(Of Integer)
|
||||||
|
If m_SplitPage.m_bOnAuxTab Or PartOnAuxTab(LclLstOfUnldPart, m_nCurrPhase) Then
|
||||||
|
' se ci sono pezzi sulla tavola di scarico prima di procedere inserisco una pausa e creo una nuoava fase
|
||||||
|
If m_IsCurrPhaseUnloaded AndAlso InsertPauseInCurrPhase() Then AddNewPhase()
|
||||||
|
' nascondo la tavola di scarico
|
||||||
|
EgtDisableModified()
|
||||||
|
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
|
||||||
|
EgtEnableModified()
|
||||||
|
End If
|
||||||
|
m_bToNext = True
|
||||||
|
'' se la disposizione corrente è sulla tavola ausiliaria allora lo sarà anche quella successiva
|
||||||
|
'If IsDispUnloadOnAuxTab(m_nCurrDisposition) <> 0 Then
|
||||||
|
' EgtSetCurrPhase(m_nCurrPhase + 1)
|
||||||
|
' m_nCurrDisposition = EgtGetNextOperation(m_nCurrDisposition)
|
||||||
|
' m_nCurrPhase += 1
|
||||||
|
' m_bToNext = False
|
||||||
|
' m_SplitPage.m_bShow = True
|
||||||
|
' EgtDraw()
|
||||||
|
' EnableButtons()
|
||||||
|
' Return
|
||||||
|
'End If
|
||||||
|
End If
|
||||||
' resetto l'inidice del pezzo da mnovimentare
|
' resetto l'inidice del pezzo da mnovimentare
|
||||||
m_CurrRawOnVacuum = GDB_ID.NULL
|
m_CurrRawOnVacuum = GDB_ID.NULL
|
||||||
' Deseleziono tutto
|
' Deseleziono tutto
|
||||||
@@ -1195,7 +1457,7 @@ Public Class MoveRawPartPage
|
|||||||
' disabilito bottone
|
' disabilito bottone
|
||||||
ModifyBtn.IsEnabled = False
|
ModifyBtn.IsEnabled = False
|
||||||
' gestione abilitazione altri bottoni
|
' gestione abilitazione altri bottoni
|
||||||
EnableButtons()
|
EnableButtons(MachiningList.Count > 0)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
|
' verifica se la disposizione indicata è uno scarico sulla tavola ausiliaria
|
||||||
@@ -1206,6 +1468,20 @@ Public Class MoveRawPartPage
|
|||||||
Return bVal
|
Return bVal
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
' restituisce e attiva la successiva disposizione se è uno scarico frontale
|
||||||
|
Public Function NextOperationIsUnloading(nCurrDispId As Integer) As Boolean
|
||||||
|
' recupero la primo operazione successiva
|
||||||
|
Dim nNextIdOperation As Integer = EgtGetNextOperation(nCurrDispId)
|
||||||
|
' a partire da questa cerco la prima disposizione disponibile
|
||||||
|
Dim nNextIdDips As Integer = GetNextDisposition(nNextIdOperation)
|
||||||
|
If nNextIdDips = nNextIdOperation And IsDispUnloadOnAuxTab(nNextIdOperation) Then
|
||||||
|
m_nCurrPhase += 1
|
||||||
|
m_nCurrDisposition = nNextIdOperation
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
|
' recupero la prima disposizione disponibile tra l'elenco delle operazioni presenti
|
||||||
Public Function GetNextDisposition(nCurrDisposId As Integer) As Integer
|
Public Function GetNextDisposition(nCurrDisposId As Integer) As Integer
|
||||||
Dim nDispId As Integer = nCurrDisposId
|
Dim nDispId As Integer = nCurrDisposId
|
||||||
@@ -1218,7 +1494,7 @@ Public Class MoveRawPartPage
|
|||||||
Return GDB_ID.NULL
|
Return GDB_ID.NULL
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub EnableButtons()
|
Private Sub EnableButtons(Optional bExistsMachining As Boolean = False)
|
||||||
UpBtn.IsEnabled = Not m_SplitPage.m_bShow
|
UpBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
|
LeftBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
RightBtn.IsEnabled = Not m_SplitPage.m_bShow
|
RightBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
@@ -1234,19 +1510,39 @@ Public Class MoveRawPartPage
|
|||||||
BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow
|
BottomRBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
PauseBtn.IsEnabled = Not m_SplitPage.m_bShow
|
PauseBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
|
ResetBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
|
UnloadPartsBtn.IsEnabled = Not m_SplitPage.m_bShow
|
||||||
If m_SplitPage.m_bShow Then
|
If m_SplitPage.m_bShow Then
|
||||||
|
' se ultima fase (e non sacrico su tavola)
|
||||||
|
If m_nCurrPhase = EgtGetPhaseCount() And m_SplitPage.m_bOnAuxTab Then
|
||||||
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
|
NextBtn.IsEnabled = (m_nCurrPhase < EgtGetPhaseCount())
|
||||||
Else
|
Else
|
||||||
|
NextBtn.IsEnabled = (m_nCurrPhase <= EgtGetPhaseCount())
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
' Se esistono delle lavorazioni allora abilito il pulsante per procedere
|
||||||
|
If Not bExistsMachining Then
|
||||||
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
|
NextBtn.IsEnabled = Not m_SplitPage.m_bOnAuxTab
|
||||||
|
Else
|
||||||
|
NextBtn.IsEnabled = True
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' esco dalla pagina di scarico
|
||||||
Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
|
Private Sub MoveRawPartPage_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
|
||||||
' verifico che la fase corrente non sia vuota
|
' verifico che la fase corrente non sia vuota
|
||||||
Dim nLastDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
Dim nLastDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||||
If EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
|
|
||||||
EgtErase(nLastDispId)
|
'' se sono in visualizzazione allora non elimino essuna operazione
|
||||||
End If
|
'If Not m_SplitPage.m_bShow Then
|
||||||
|
' If EgtIsOperationEmpty(nLastDispId) And Not m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
|
||||||
|
' EgtErase(nLastDispId)
|
||||||
|
' ElseIf EgtIsOperationEmpty(nLastDispId) And m_SplitPage.m_bOnAuxTab And m_RawMoveDataList.Count = 0 Then
|
||||||
|
' ' Dichiaro pagina non attiva
|
||||||
|
' m_bActive = False
|
||||||
|
' Return
|
||||||
|
' End If
|
||||||
|
'End If
|
||||||
|
|
||||||
' Se movimento con ventose
|
' Se movimento con ventose
|
||||||
If Not m_bByHand Then
|
If Not m_bByHand Then
|
||||||
@@ -1262,8 +1558,9 @@ Public Class MoveRawPartPage
|
|||||||
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
SaveMoveInfoInDisposition(nDispId, m_RawMoveDataList)
|
||||||
' imposto eventuale presenza rimozioni manuali
|
' imposto eventuale presenza rimozioni manuali
|
||||||
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
|
SaveRemoveByHandInDisposition(nDispId, m_bRemovedRaw)
|
||||||
' imposto eventuale movimento pezzi su tavola ausiliaria
|
' imposto eventuale movimento pezzi su tavola ausiliaria (se è realmente avvenuto)
|
||||||
SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
|
'SaveMovePartsOnAuxTable(nDispId, m_SplitPage.m_bOnAuxTab)
|
||||||
|
SaveMovePartsOnAuxTable(nDispId, m_IsCurrPhaseUnloaded)
|
||||||
' Eseguo calcolo speciale dei movimenti
|
' Eseguo calcolo speciale dei movimenti
|
||||||
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
|
SpecialApplyDisposition(nDispId, True, Not m_SplitPage.m_bOnAuxTab)
|
||||||
End If
|
End If
|
||||||
@@ -1279,13 +1576,18 @@ Public Class MoveRawPartPage
|
|||||||
SpecialApplyDisposition(nDispId, True)
|
SpecialApplyDisposition(nDispId, True)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Nascondo eventuale tavola ausiliaria
|
' Nascondo eventuale tavola ausiliaria
|
||||||
If m_SplitPage.m_bOnAuxTab Then
|
If m_SplitPage.m_bOnAuxTab Then
|
||||||
EgtDisableModified()
|
EgtDisableModified()
|
||||||
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
|
EgtSetStatus(m_nAuxTabId, GDB_ST.OFF)
|
||||||
EgtEnableModified()
|
EgtEnableModified()
|
||||||
EgtZoom(ZM.ALL, False)
|
' se sto uscendo dalla pagina delle spezzature
|
||||||
If Not m_bPrev Then
|
If Not m_bPrev And Not m_bToNext Then
|
||||||
|
Dim nDispId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||||
|
' se sto uscendo dalla pagina split (senza passare dal comando next)
|
||||||
|
Dim lclLstUnlPart As New List(Of Integer)
|
||||||
|
SaveMovePartsOnAuxTable(nDispId, PartOnAuxTab(lclLstUnlPart, m_nCurrPhase))
|
||||||
' Cancello eventuale manipolatore pezzi
|
' Cancello eventuale manipolatore pezzi
|
||||||
EgtDisableModified()
|
EgtDisableModified()
|
||||||
RemoveVacuumCups()
|
RemoveVacuumCups()
|
||||||
@@ -1302,10 +1604,30 @@ Public Class MoveRawPartPage
|
|||||||
m_bPrev = False
|
m_bPrev = False
|
||||||
m_SplitPage.m_bShow = True
|
m_SplitPage.m_bShow = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim Ph As Integer = EgtGetCurrPhase()
|
||||||
|
' aggiorno il disegno
|
||||||
|
EgtZoom(ZM.ALL, False)
|
||||||
' Dichiaro pagina non attiva
|
' Dichiaro pagina non attiva
|
||||||
m_bActive = False
|
m_bActive = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' ----------------- TEST funzione per debug operazioni -----------------
|
||||||
|
Private Sub SaveMyFileTest(sFilename As String)
|
||||||
|
LoadCurrPhaseMachining()
|
||||||
|
' salvo il file corrente per poterlo studiare e capire cosa è successo nella rappresentazione dei grezzi
|
||||||
|
EgtSaveFile("C:\EgtData\OmagCUT\MyProjects\" & sFilename & ".nge", NGE.BIN)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LoadCurrPhaseMachining()
|
||||||
|
Dim m_MachiningList As New List(Of SplitMach)
|
||||||
|
'm_SplitPage.ShowMachiningList()
|
||||||
|
'm_SplitPage.SaveOrderMachinig(m_nCurrPhase)
|
||||||
|
' Preparo la lista delle lavorazioni
|
||||||
|
CalculateSplitMachList(m_nCurrPhase, m_MachiningList)
|
||||||
|
Dim b As Boolean = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,31 @@
|
|||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<!--Comandi attivi solo in madalità REG-->
|
||||||
|
<UniformGrid Name ="UG0_Reg" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="3" Visibility="Hidden">
|
||||||
|
<ToggleButton Name="AddPointRegBtn" Visibility="Hidden"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
|
<ToggleButton Name="ModPointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource Move-Spot-RegImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
|
<ToggleButton Name="RemovePointRegBtn" Visibility="Hidden"
|
||||||
|
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
|
</UniformGrid>
|
||||||
|
|
||||||
|
<!--Comandi attivi solo in madalità REG-->
|
||||||
|
<UniformGrid Name ="UG1_Reg" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" Visibility="Hidden">
|
||||||
|
<Button Name="AdjustPointRegBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
|
<Image Source="{DynamicResource Muovi-grezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
<ToggleButton Name="ActivatePointRegBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource ON_OFF-REGImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
|
</UniformGrid>
|
||||||
|
|
||||||
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3">
|
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3">
|
||||||
<Button Name="InsertPartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
<Button Name="InsertPartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
Imports EgtUILib
|
Imports System.ComponentModel
|
||||||
|
Imports System.Reflection
|
||||||
|
Imports System.Windows.Forms
|
||||||
|
Imports System.Windows.Forms.Integration
|
||||||
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
|
||||||
Public Class NestPageUC
|
Public Class NestPageUC
|
||||||
@@ -26,6 +30,7 @@ Public Class NestPageUC
|
|||||||
' Id della curva e del taglio selezionati per eseguire il test
|
' Id della curva e del taglio selezionati per eseguire il test
|
||||||
Friend m_CurrSelectedCurv As Integer = GDB_ID.NULL
|
Friend m_CurrSelectedCurv As Integer = GDB_ID.NULL
|
||||||
Friend m_CurrSelectedSawCurv 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
|
' Id del rettangolo, del taglio e della curva da modificare tramite Drag
|
||||||
Private m_nIdSelectedOutLoopRettangle As Integer = GDB_ID.NULL
|
Private m_nIdSelectedOutLoopRettangle As Integer = GDB_ID.NULL
|
||||||
@@ -104,12 +109,17 @@ Public Class NestPageUC
|
|||||||
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
|
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
|
||||||
DragRettanleBtn.ToolTip = "Strech"
|
DragRettanleBtn.ToolTip = "Strech"
|
||||||
|
|
||||||
|
' Nascondo i pulsanti in uso quando attivo la modalità REG
|
||||||
|
UG0_Reg.Visibility = Visibility.Hidden
|
||||||
|
|
||||||
Dim nColumsIn_UG1 As Integer = 2
|
Dim nColumsIn_UG1 As Integer = 2
|
||||||
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
|
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
|
||||||
m_bIsVisibleDragRettangle = (GetPrivateProfileInt(S_NEST, K_DRAG_RETTANGLE, 0, m_MainWindow.GetIniFile()) <> 0)
|
m_bIsVisibleDragRettangle = (GetPrivateProfileInt(S_NEST, K_DRAG_RETTANGLE, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||||
If Not m_bIsVisibleDragRettangle Then
|
If Not m_bIsVisibleDragRettangle Then
|
||||||
nColumsIn_UG1 = 1
|
nColumsIn_UG1 = 1
|
||||||
DragRettanleBtn.Visibility = Visibility.Collapsed
|
DragRettanleBtn.Visibility = Visibility.Collapsed
|
||||||
|
Else
|
||||||
|
DragRettanleBtn.Visibility = Visibility.Visible
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' gestisco la visualizzazione del comando Splt (per i tagli waterjet)
|
' gestisco la visualizzazione del comando Splt (per i tagli waterjet)
|
||||||
@@ -186,6 +196,46 @@ Public Class NestPageUC
|
|||||||
ShowParkedParts()
|
ShowParkedParts()
|
||||||
' Garantisco visibilità eventuale contorno da foto
|
' Garantisco visibilità eventuale contorno da foto
|
||||||
m_CurrProjPage.ShowContour(True)
|
m_CurrProjPage.ShowContour(True)
|
||||||
|
|
||||||
|
' Disabilito impostazione modificato
|
||||||
|
Dim bOldEnMod As Boolean = EgtGetEnableModified()
|
||||||
|
If bOldEnMod Then EgtDisableModified()
|
||||||
|
|
||||||
|
' Verifico se esiste il gruppo "REG"
|
||||||
|
Dim nIdRaws As Integer = EgtGetParent(m_CurrProjPage.m_nRawId)
|
||||||
|
Dim nIdReg As Integer = EgtGetFirstNameInGroup(EgtGetParent(nIdRaws), "Reg")
|
||||||
|
' Resetto le variabili di conteggio
|
||||||
|
m_nCountSpot = 0
|
||||||
|
m_nCountSpotCUT = 0
|
||||||
|
If nIdReg <> GDB_ID.NULL Then
|
||||||
|
m_nRegGroupId = nIdReg
|
||||||
|
EgtGetInfo(m_nRegGroupId, COUNTSPOT, m_nCountSpot)
|
||||||
|
EgtGetInfo(m_nRegGroupId, COUNTSPOTCUT, m_nCountSpotCUT)
|
||||||
|
' Lo nascondo
|
||||||
|
EgtSetStatus(m_nRegGroupId, GDB_ST.OFF)
|
||||||
|
Else
|
||||||
|
' Creo layer per definire i punti di REG
|
||||||
|
m_nRegGroupId = EgtCreateGroup(EgtGetParent(nIdRaws))
|
||||||
|
EgtSetName(m_nRegGroupId, REG)
|
||||||
|
m_nCountSpot = 0
|
||||||
|
m_nCountSpotCUT = 0
|
||||||
|
End If
|
||||||
|
' Se nel progetto non sono inseriti punti SpotReg disabilito i comandi
|
||||||
|
If m_nCountSpot < 1 Then
|
||||||
|
UG0_Reg.IsEnabled = False
|
||||||
|
UG1_Reg.IsEnabled = False
|
||||||
|
Else
|
||||||
|
UG0_Reg.IsEnabled = True
|
||||||
|
UG1_Reg.IsEnabled = True
|
||||||
|
End If
|
||||||
|
' Se nel progetto non sono inseriti punti SpotRegCUT provvedo ad aggiungerli
|
||||||
|
If m_nCountSpotCUT < 1 Then
|
||||||
|
InsertSpotRegistration()
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Se necessario riabilito impostazione modificato
|
||||||
|
If bOldEnMod Then EgtEnableModified()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub UpdateStepsOnUI()
|
Public Sub UpdateStepsOnUI()
|
||||||
@@ -209,7 +259,9 @@ Public Class NestPageUC
|
|||||||
End If
|
End If
|
||||||
' Se esiste un elemento selezionato
|
' Se esiste un elemento selezionato
|
||||||
EgtResetMark(m_CurrSelectedSawCurv)
|
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
|
' Verifico se selezionato indicativo di pezzo
|
||||||
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||||
Dim nSelMy As Integer
|
Dim nSelMy As Integer
|
||||||
@@ -234,20 +286,52 @@ Public Class NestPageUC
|
|||||||
' recupero il gruppo della lavorazione associata
|
' recupero il gruppo della lavorazione associata
|
||||||
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
||||||
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
|
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
|
||||||
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
|
|
||||||
If Not EgtGetGroupObjs(nIdSaw) Then
|
Dim nIdMachining As Integer = EgtGetFirstInGroup(nIdPV)
|
||||||
m_CurrSelectedSawCurv = nIdSaw
|
While nIdMachining <> GDB_ID.NULL
|
||||||
m_CurrSelectedCurv = nIdMy
|
Dim sNameMachining As String = String.Empty
|
||||||
EgtSetMark(nIdSaw)
|
EgtGetName(nIdMachining, sNameMachining)
|
||||||
EgtSelectObj(nIdMy)
|
If sNameMachining.Contains(nIdMy.ToString) Then
|
||||||
EgtDraw()
|
|
||||||
Exit While
|
Exit While
|
||||||
End If
|
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
|
||||||
End If
|
End If
|
||||||
nIdMy = EgtGetNextObjInSelWin()
|
nIdMy = EgtGetNextObjInSelWin()
|
||||||
End While
|
End While
|
||||||
|
If nIdMy = GDB_ID.NULL Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetErrorMessage("Select OUTLOOP")
|
||||||
|
End If
|
||||||
Return
|
Return
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -890,7 +974,100 @@ Public Class NestPageUC
|
|||||||
|
|
||||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||||
' Verifico di essere il gestore attivo e non in modalità registrazione
|
' Verifico di essere il gestore attivo e non in modalità registrazione
|
||||||
If Not m_bActive Or m_bRegister Then Return
|
If Not m_bActive Or m_bRegister Then
|
||||||
|
' procedo solo sel il click è avvenuto con il tasto sinistro del mouse
|
||||||
|
If e.Button <> MouseButtons.Left Then Return
|
||||||
|
' se aggiungo SpotReg e numero di Spot inferiore a quelli inseriti in Office
|
||||||
|
If AddPointRegBtn.IsChecked Then
|
||||||
|
If m_nCountSpotCUT < m_nCountSpot Then
|
||||||
|
' Acquisisco punto da disegno
|
||||||
|
EgtUnProjectPoint(e.Location, m_ptPrev)
|
||||||
|
Dim ptRawMax As Point3d = m_b3Raw.Max()
|
||||||
|
m_ptPrev.z = ptRawMax.z
|
||||||
|
' Inserisco un nuovo punto registrazione
|
||||||
|
CreateSpotRegistration(m_nRegGroupId, m_ptPrev, m_nCountSpotCUT + 1)
|
||||||
|
EgtDraw()
|
||||||
|
' disattivo il comando di inserimento
|
||||||
|
AddPointRegBtn.IsChecked = False
|
||||||
|
Else
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("Max spot for reg: " & m_nCountSpot.ToString)
|
||||||
|
End If
|
||||||
|
ElseIf RemovePointRegBtn.IsChecked Then
|
||||||
|
' Verifico se selezionato indicativo di pezzo
|
||||||
|
EgtSetObjFilterForSelWin(True, True, True, True, True)
|
||||||
|
Dim nSelect As Integer
|
||||||
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
|
||||||
|
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
While nSelId <> GDB_ID.NULL
|
||||||
|
sName = String.Empty
|
||||||
|
EgtGetName(nSelId, sName)
|
||||||
|
If sName.StartsWith(SPOTREGCUT_) Then
|
||||||
|
' recupero recupero il centro della prima curva
|
||||||
|
Dim nIdParent As Integer = EgtGetParent(nSelId)
|
||||||
|
RemoveSpotRegistration(nIdParent)
|
||||||
|
EgtDraw()
|
||||||
|
EgtErase(nIdParent)
|
||||||
|
RemovePointRegBtn.IsChecked = False
|
||||||
|
' Esco dal ciclo
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
nSelId = EgtGetNextObjInSelWin()
|
||||||
|
End While
|
||||||
|
ElseIf ModPointRegBtn.IsChecked Then
|
||||||
|
' Verifico se selezionato indicativo di pezzo
|
||||||
|
EgtSetObjFilterForSelWin(True, True, True, True, True)
|
||||||
|
Dim nSelect As Integer
|
||||||
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
|
||||||
|
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
While nSelId <> GDB_ID.NULL
|
||||||
|
sName = String.Empty
|
||||||
|
EgtGetName(nSelId, sName)
|
||||||
|
If sName.StartsWith(SPOTREGCUT_) Then
|
||||||
|
EgtDeselectAll()
|
||||||
|
EgtResetMark(m_nCurrSpotRegId)
|
||||||
|
' recupero l'Id del gruppo di appartenenza
|
||||||
|
Dim nIdParent As Integer = EgtGetParent(nSelId)
|
||||||
|
EgtSelectGroupObjs(nIdParent)
|
||||||
|
EgtSetMark(nIdParent)
|
||||||
|
EgtDraw()
|
||||||
|
' Acquisisco punto da disegno
|
||||||
|
EgtUnProjectPoint(e.Location, m_ptPrev)
|
||||||
|
m_bDrag = True
|
||||||
|
' Salvo l'Id del punto SpotReg da spostare
|
||||||
|
m_nCurrSpotRegId = nIdParent
|
||||||
|
' Esco dal ciclo
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
nSelId = EgtGetNextObjInSelWin()
|
||||||
|
End While
|
||||||
|
ElseIf ActivatePointRegBtn.IsChecked Then
|
||||||
|
' Verifico se selezionato indicativo di pezzo
|
||||||
|
EgtSetObjFilterForSelWin(True, True, True, True, True)
|
||||||
|
Dim nSelect As Integer
|
||||||
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelect)
|
||||||
|
Dim nSelId As Integer = EgtGetFirstObjInSelWin()
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
While nSelId <> GDB_ID.NULL
|
||||||
|
sName = String.Empty
|
||||||
|
EgtGetName(nSelId, sName)
|
||||||
|
' accetto qualsiasi punto di tipo SpotReg (sia da OFFICE che da CUT)
|
||||||
|
If sName.StartsWith(SPOTREG_) Or sName.StartsWith(SPOTREGCUT_) Then
|
||||||
|
Dim nIdParent As Integer = EgtGetParent(nSelId)
|
||||||
|
ActivateSpotRegistration(nIdParent)
|
||||||
|
EgtDraw()
|
||||||
|
' Esco dal ciclo
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
nSelId = EgtGetNextObjInSelWin()
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
' Devo sempre uscire da questa condizione
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
' Si può selezionare solo con il tasto sinistro e se stato NULL
|
' Si può selezionare solo con il tasto sinistro e se stato NULL
|
||||||
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
||||||
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
Not m_CurrProjPage.CurrentProjectScene.IsStatusNull() Then
|
||||||
@@ -902,7 +1079,6 @@ Public Class NestPageUC
|
|||||||
OnMyMouseDownSceneSelCurv(sender, e)
|
OnMyMouseDownSceneSelCurv(sender, e)
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
m_bIsCounterLy = False
|
m_bIsCounterLy = False
|
||||||
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
|
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
|
||||||
If m_bIsCheckedDragRettangle Then
|
If m_bIsCheckedDragRettangle Then
|
||||||
@@ -963,7 +1139,6 @@ Public Class NestPageUC
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not m_bIsCounterLy Then
|
If Not m_bIsCounterLy Then
|
||||||
' Se già selezionato o posizione oggetto incompatibile con flag posizione selezionati
|
' Se già selezionato o posizione oggetto incompatibile con flag posizione selezionati
|
||||||
If nStat = GDB_ST.SEL Then
|
If nStat = GDB_ST.SEL Then
|
||||||
@@ -1022,6 +1197,10 @@ Public Class NestPageUC
|
|||||||
EgtSetCurrPhase(nI)
|
EgtSetCurrPhase(nI)
|
||||||
EgtSetTableAreaOffset(TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
|
EgtSetTableAreaOffset(TAB_OFFS, TAB_OFFS, TAB_OFFS, TAB_OFFS)
|
||||||
Next
|
Next
|
||||||
|
' aggiorno posizionamento ventose per lavorazioni da sotto
|
||||||
|
UpdateVacuumsForDrip()
|
||||||
|
' dichiaro tutto aggiornato
|
||||||
|
m_CurrProjPage.SetOrderMachiningFlag()
|
||||||
EgtSetCurrPhase(1)
|
EgtSetCurrPhase(1)
|
||||||
' Rotazione
|
' Rotazione
|
||||||
Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
|
Dim dAngRot As Double = If(sOtherTab = SECOND_TAB, 180, -180)
|
||||||
@@ -1067,7 +1246,6 @@ Public Class NestPageUC
|
|||||||
m_bKeyLeftShiftPressed = m_bVerify
|
m_bKeyLeftShiftPressed = m_bVerify
|
||||||
m_vtTotMove = Vector3d.NULL()
|
m_vtTotMove = Vector3d.NULL()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
|
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseMoveScene
|
||||||
' Verifico di essere il gestore attivo
|
' Verifico di essere il gestore attivo
|
||||||
If Not m_bActive Then Return
|
If Not m_bActive Then Return
|
||||||
@@ -1087,6 +1265,19 @@ Public Class NestPageUC
|
|||||||
OnMyMouseMoveSawRettangle(sender, e)
|
OnMyMouseMoveSawRettangle(sender, e)
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
If ModPointRegBtn.IsChecked Then
|
||||||
|
' Ricavo il punto corrente in coordinate mondo
|
||||||
|
Dim ptCurr_ As Point3d
|
||||||
|
EgtUnProjectPoint(e.Location, ptCurr_)
|
||||||
|
' Ricavo il vettore di movimento
|
||||||
|
Dim vtMove As Vector3d = ptCurr_ - m_ptPrev
|
||||||
|
MoveSpotRegistration(m_nCurrSpotRegId, vtMove)
|
||||||
|
' Aggiorno il punto precedente
|
||||||
|
m_ptPrev = ptCurr_
|
||||||
|
' Terminata esecuzione di drag
|
||||||
|
m_bDragging = False
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
' Determino cosa muovere
|
' Determino cosa muovere
|
||||||
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
|
Dim nMoveId = If(m_nIdToSel <> GDB_ID.NULL, m_nIdToSel, GDB_ID.SEL)
|
||||||
@@ -1353,8 +1544,8 @@ Public Class NestPageUC
|
|||||||
VeinMatching.OnDeselectPart(m_nIdToDesel)
|
VeinMatching.OnDeselectPart(m_nIdToDesel)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
' Reset
|
' Reset
|
||||||
|
GetFamilyGroupInPark()
|
||||||
m_bDrag = False
|
m_bDrag = False
|
||||||
m_nIdToSel = GDB_ID.NULL
|
m_nIdToSel = GDB_ID.NULL
|
||||||
m_nIdToDesel = GDB_ID.NULL
|
m_nIdToDesel = GDB_ID.NULL
|
||||||
@@ -1650,6 +1841,10 @@ Public Class NestPageUC
|
|||||||
nRevPhase += 1
|
nRevPhase += 1
|
||||||
End While
|
End While
|
||||||
End If
|
End If
|
||||||
|
' Muovo i punti SpotReg generati nel programma OFFICE
|
||||||
|
If bMoveOk Then
|
||||||
|
MoveAllSpotRegistration(vtMove)
|
||||||
|
End If
|
||||||
' Ripristino lo stato iniziale
|
' Ripristino lo stato iniziale
|
||||||
EgtSetCurrPhase(1)
|
EgtSetCurrPhase(1)
|
||||||
HideAllMachinings()
|
HideAllMachinings()
|
||||||
@@ -1909,12 +2104,160 @@ Public Class NestPageUC
|
|||||||
' Dichiaro grezzo per punti
|
' Dichiaro grezzo per punti
|
||||||
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
|
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
|
||||||
End If
|
End If
|
||||||
|
' Ruoto i punti SpotReg disegnati in Office
|
||||||
|
If bMoveOk Then
|
||||||
|
RotateAllSpotRegistration(dAngDeg, ptCen)
|
||||||
|
End If
|
||||||
' Ripristino lo stato iniziale
|
' Ripristino lo stato iniziale
|
||||||
EgtSetCurrPhase(1)
|
EgtSetCurrPhase(1)
|
||||||
HideAllMachinings()
|
HideAllMachinings()
|
||||||
Return bMoveOk
|
Return bMoveOk
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function RotateAllRawParts(dAngDeg As Double, ptCen As Point3d, Optional bIsReg As Boolean = True) As Boolean
|
||||||
|
' Recupero rotazione totale
|
||||||
|
Dim dRegRot As Double = GetRegistrationRotation()
|
||||||
|
' Recupero il centro del grezzo iniziale per usarlo come centro della rotazione
|
||||||
|
'Dim ptCen As New Point3d
|
||||||
|
'GetRawCenter(ptCen)
|
||||||
|
' Provo la rotazione
|
||||||
|
Dim bMoveOk As Boolean = True
|
||||||
|
Dim nPhase As Integer = 1
|
||||||
|
Dim nRawId As Integer = GDB_ID.NULL
|
||||||
|
While nPhase <= EgtGetPhaseCount()
|
||||||
|
EgtSetCurrPhase(nPhase)
|
||||||
|
nRawId = EgtGetFirstRawPart()
|
||||||
|
While nRawId <> GDB_ID.NULL
|
||||||
|
If EgtVerifyRawPartPhase(nRawId, nPhase) Then
|
||||||
|
' Rotazione del centro come spostamento grezzo più rotazione grezzo attorno al suo centro
|
||||||
|
Dim ptRawCen As New Point3d
|
||||||
|
EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||||
|
Dim ptMovCen As New Point3d(ptRawCen)
|
||||||
|
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), dAngDeg)
|
||||||
|
If Not EgtMoveRawPart(nRawId, ptMovCen - ptRawCen) Then
|
||||||
|
bMoveOk = False
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
If Not EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAngDeg) Then
|
||||||
|
EgtMoveRawPart(nRawId, -(ptMovCen - ptRawCen))
|
||||||
|
bMoveOk = False
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nRawId = EgtGetNextRawPart(nRawId)
|
||||||
|
End While
|
||||||
|
If Not bMoveOk Then Exit While
|
||||||
|
nPhase += 1
|
||||||
|
End While
|
||||||
|
' Se rotazione impossibile, ripristino posizione dei grezzi già spostati
|
||||||
|
If Not bMoveOk Then
|
||||||
|
Dim nRevPhase As Integer = 1
|
||||||
|
Dim nRevRawId As Integer = GDB_ID.NULL
|
||||||
|
While nRevPhase <= nPhase
|
||||||
|
EgtSetCurrPhase(nRevPhase)
|
||||||
|
nRevRawId = EgtGetFirstRawPart()
|
||||||
|
While nRevRawId <> GDB_ID.NULL And (nRevPhase < nPhase Or nRevRawId <> nRawId)
|
||||||
|
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
|
||||||
|
' Eseguo al contrario
|
||||||
|
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
|
||||||
|
Dim ptRawCen As New Point3d
|
||||||
|
EgtGetRawPartCenter(nRevRawId, ptRawCen)
|
||||||
|
Dim ptMovCen As New Point3d(ptRawCen)
|
||||||
|
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
|
||||||
|
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
|
||||||
|
End If
|
||||||
|
nRevRawId = EgtGetNextRawPart(nRevRawId)
|
||||||
|
End While
|
||||||
|
nRevPhase += 1
|
||||||
|
End While
|
||||||
|
' Altrimenti eseguo sistemazioni
|
||||||
|
Else
|
||||||
|
' Origine della tavola
|
||||||
|
Dim ptOri As Point3d
|
||||||
|
EgtGetTableRef(1, ptOri)
|
||||||
|
' Annullo rotazioni dei grezzi e le rifaccio sulle parti componenti
|
||||||
|
Dim nRevPhase As Integer = 1
|
||||||
|
Dim nRevRawId As Integer = GDB_ID.NULL
|
||||||
|
While nRevPhase <= EgtGetPhaseCount()
|
||||||
|
EgtSetCurrPhase(nRevPhase)
|
||||||
|
nRevRawId = EgtGetFirstRawPart()
|
||||||
|
While nRevRawId <> GDB_ID.NULL
|
||||||
|
If EgtVerifyRawPartPhase(nRevRawId, nRevPhase) Then
|
||||||
|
' Eseguo al contrario
|
||||||
|
EgtRotateRawPart(nRevRawId, Vector3d.Z_AX(), -dAngDeg)
|
||||||
|
Dim ptRawCen As New Point3d
|
||||||
|
EgtGetRawPartCenter(nRevRawId, ptRawCen)
|
||||||
|
Dim ptMovCen As New Point3d(ptRawCen)
|
||||||
|
ptMovCen.Rotate(ptCen, Vector3d.Z_AX(), -dAngDeg)
|
||||||
|
EgtMoveRawPart(nRevRawId, (ptMovCen - ptRawCen))
|
||||||
|
' Rifaccio sugli oggetti contenuti nel grezzo
|
||||||
|
Dim nId As Integer = EgtGetFirstInGroup(nRevRawId)
|
||||||
|
While nId <> GDB_ID.NULL
|
||||||
|
EgtRotate(nId, ptCen, Vector3d.Z_AX(), dAngDeg, GDB_RT.GLOB)
|
||||||
|
nId = EgtGetNext(nId)
|
||||||
|
End While
|
||||||
|
' Imposto posizione esatta del grezzo dopo rotazione
|
||||||
|
Dim b3Raw As New BBox3d
|
||||||
|
EgtGetRawPartBBox(nRevRawId, b3Raw)
|
||||||
|
EgtMoveToCornerRawPart(nRevRawId, (b3Raw.Min() - ptOri) + Point3d.ORIG(), MCH_CR.BL)
|
||||||
|
End If
|
||||||
|
nRevRawId = EgtGetNextRawPart(nRevRawId)
|
||||||
|
End While
|
||||||
|
nRevPhase += 1
|
||||||
|
End While
|
||||||
|
' Ruoto opportunamente anche i dati di movimento
|
||||||
|
Dim nOpeId As Integer = EgtGetFirstActiveOperation()
|
||||||
|
While nOpeId <> GDB_ID.NULL
|
||||||
|
If EgtGetOperationType(nOpeId) = MCH_OY.DISP Then
|
||||||
|
' Recupero i gruppi con i dati
|
||||||
|
Dim nRpmId As Integer = EgtGetFirstNameInGroup(nOpeId, "Rpm*")
|
||||||
|
While nRpmId <> GDB_ID.NULL
|
||||||
|
' Recupero le informazioni
|
||||||
|
Dim vtRawMove As New Vector3d
|
||||||
|
If EgtGetInfo(nRpmId, "Mv", vtRawMove) Then
|
||||||
|
vtRawMove.Rotate(Vector3d.Z_AX(), dAngDeg)
|
||||||
|
EgtSetInfo(nRpmId, "Mv", vtRawMove)
|
||||||
|
End If
|
||||||
|
Dim vtDelta As New Vector3d
|
||||||
|
If EgtGetInfo(nRpmId, "Dt", vtDelta) Then
|
||||||
|
vtDelta.Rotate(Vector3d.Z_AX(), dAngDeg)
|
||||||
|
EgtSetInfo(nRpmId, "Dt", vtDelta)
|
||||||
|
End If
|
||||||
|
Dim dAngRotDeg As Double = 0
|
||||||
|
If EgtGetInfo(nRpmId, "Ad", dAngRotDeg) Then
|
||||||
|
EgtSetInfo(nRpmId, "Ad", dAngRotDeg + dAngDeg)
|
||||||
|
End If
|
||||||
|
' Cerco un altro gruppo
|
||||||
|
nRpmId = EgtGetNextName(nRpmId, "Rpm*")
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
nOpeId = EgtGetNextActiveOperation(nOpeId)
|
||||||
|
End While
|
||||||
|
' Se non è registrazione, ruoto anche l'eventuale foto della lastra
|
||||||
|
'If Not bIsReg Then
|
||||||
|
' Dim nPhotoId = m_CurrProjPage.GetPhoto()
|
||||||
|
' If nPhotoId <> GDB_ID.NULL then EgtRotatePhoto(nPhotoId, ptCen, Vector3d.Z_AX(), dAngDeg)
|
||||||
|
'End If
|
||||||
|
' Aggiorno rotazione totale
|
||||||
|
If bIsReg Then
|
||||||
|
SetRegistrationRotation(dRegRot + dAngDeg)
|
||||||
|
Else
|
||||||
|
SetRegistrationRotation(0)
|
||||||
|
End If
|
||||||
|
' Dichiaro grezzo per punti
|
||||||
|
EgtSetInfo(GetCurrentRaw(), KEY_RAWBYPOINTS, 1)
|
||||||
|
End If
|
||||||
|
' Ruoto i punti SpotReg disegnati in Office
|
||||||
|
If bMoveOk Then
|
||||||
|
RotateAllSpotRegistration(dAngDeg, ptCen)
|
||||||
|
End If
|
||||||
|
' Ripristino lo stato iniziale
|
||||||
|
EgtSetCurrPhase(1)
|
||||||
|
HideAllMachinings()
|
||||||
|
Return bMoveOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Private Sub InsertPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPartBtn.Click
|
Private Sub InsertPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPartBtn.Click
|
||||||
' Se inserimento automatico
|
' Se inserimento automatico
|
||||||
If GetPrivateProfileInt(S_NEST, K_AUTOMATICOPTIMIZE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
If GetPrivateProfileInt(S_NEST, K_AUTOMATICOPTIMIZE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
||||||
@@ -2482,8 +2825,11 @@ Public Class NestPageUC
|
|||||||
Const STORE_LARGH As Double = 6000
|
Const STORE_LARGH As Double = 6000
|
||||||
Const STORE_DIST As Double = 200
|
Const STORE_DIST As Double = 200
|
||||||
Const STORE_OFFS As Double = 20 + 40 + 20
|
Const STORE_OFFS As Double = 20 + 40 + 20
|
||||||
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (STORE_LARGH - b3Tab.DimX())
|
Dim dStoreLarg As Double = GetPrivateProfileDouble("Store", "StoreLargh", STORE_LARGH, m_MainWindow.GetMachIniFile())
|
||||||
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + STORE_LARGH, b3Tab.Min().y - STORE_DIST, STORE_OFFS, False)
|
Dim dStoreDist As Double = GetPrivateProfileDouble("Store", "StoreDist", STORE_DIST, m_MainWindow.GetMachIniFile())
|
||||||
|
Dim dStoreOffs As Double = GetPrivateProfileDouble("Store", "StoreOffs", STORE_OFFS, m_MainWindow.GetMachIniFile())
|
||||||
|
Dim dStXmin As Double = b3Tab.Min().x - 0.5 * (dStoreLarg - b3Tab.DimX())
|
||||||
|
Return EgtPackBox(nId, dStXmin, -INFINITO, dStXmin + dStoreLarg, b3Tab.Min().y - dStoreDist, dStoreOffs, False)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
|
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
|
||||||
@@ -2755,7 +3101,10 @@ Public Class NestPageUC
|
|||||||
Else
|
Else
|
||||||
m_dRegStep = Math.Max(dVal, 2 * EPS_SMALL)
|
m_dRegStep = Math.Max(dVal, 2 * EPS_SMALL)
|
||||||
End If
|
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 If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -2852,6 +3201,427 @@ Public Class NestPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
#Region "SPOT REG"
|
||||||
|
|
||||||
|
' Layer per crocette dei punti REG (creato in Office)
|
||||||
|
Public m_nRegGroupId As Integer = GDB_ID.NULL
|
||||||
|
' Numero di spot inseriti nel grezzo corrente (da Office)
|
||||||
|
Private m_nCountSpot As Integer = 0
|
||||||
|
' Gruppo Spot attualmente selezionato
|
||||||
|
Private m_nCurrSpotRegId As Integer = GDB_ID.NULL
|
||||||
|
' Nome info nuomero Spot (da Office)
|
||||||
|
Private Const COUNTSPOT As String = "CountSpot"
|
||||||
|
' Nome gruppo
|
||||||
|
Private Const REG As String = "Reg"
|
||||||
|
' Nome del gruppo di ogno Spot (da Office)
|
||||||
|
Private Const SPOTREG_ As String = "SpotReg_"
|
||||||
|
Private Const RADSPOT As Double = 20
|
||||||
|
|
||||||
|
' numero di Spot inseriti (da Cut)
|
||||||
|
Private m_nCountSpotCUT As Integer = 0
|
||||||
|
' Nome del gruppo di ogno Spot (da Cut)
|
||||||
|
Private Const SPOTREGCUT_ As String = "SpotRegCUT_"
|
||||||
|
' Nome info nuomero Spot (da Office)
|
||||||
|
Private Const COUNTSPOTCUT As String = "CountSpotCUT"
|
||||||
|
' Nome della Info per indicare se il punto è da usare
|
||||||
|
Private Const ACTIVATESPOTCUT As String = "ActivateSpotCut"
|
||||||
|
|
||||||
|
Private Sub AddPointReg_Click() Handles AddPointRegBtn.Click
|
||||||
|
DeselectCurSpotReg()
|
||||||
|
ModPointRegBtn.IsChecked = False
|
||||||
|
RemovePointRegBtn.IsChecked = False
|
||||||
|
ActivatePointRegBtn.IsChecked = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ModPointReg_Click() Handles ModPointRegBtn.Click
|
||||||
|
' Deseleziono lo Spotreg selezionato
|
||||||
|
DeselectCurSpotReg()
|
||||||
|
AddPointRegBtn.IsChecked = False
|
||||||
|
RemovePointRegBtn.IsChecked = False
|
||||||
|
ActivatePointRegBtn.IsChecked = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RemovePointReg_Click() Handles RemovePointRegBtn.Click
|
||||||
|
DeselectCurSpotReg()
|
||||||
|
ModPointRegBtn.IsChecked = False
|
||||||
|
AddPointRegBtn.IsChecked = False
|
||||||
|
ActivatePointRegBtn.IsChecked = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub AdjustPointReg_Click() Handles AdjustPointRegBtn.Click
|
||||||
|
PointRegCheckedOff()
|
||||||
|
AdjustRawWithSpotReg()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub ActivatePointRegBtn_Click() Handles ActivatePointRegBtn.Click
|
||||||
|
DeselectCurSpotReg()
|
||||||
|
AddPointRegBtn.IsChecked = False
|
||||||
|
ModPointRegBtn.IsChecked = False
|
||||||
|
RemovePointRegBtn.IsChecked = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub DeselectCurSpotReg()
|
||||||
|
EgtDeselectAll()
|
||||||
|
If m_nCurrSpotRegId <> GDB_ID.NULL Then
|
||||||
|
EgtResetMark(m_nCurrSpotRegId)
|
||||||
|
m_nCurrSpotRegId = GDB_ID.NULL
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' disabilito contemporaneamente tutti i comandi per la gestione punti SpotReg
|
||||||
|
Public Sub PointRegCheckedOff()
|
||||||
|
DeselectCurSpotReg()
|
||||||
|
AddPointRegBtn.IsChecked = False
|
||||||
|
ModPointRegBtn.IsChecked = False
|
||||||
|
RemovePointRegBtn.IsChecked = False
|
||||||
|
ActivatePointRegBtn.IsChecked = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' riceve l'ID del gruppo da muovere
|
||||||
|
Private Function MoveSpotRegistration(nIdGroup As Integer, vtMove As Vector3d) As Boolean
|
||||||
|
If nIdGroup = GDB_ID.NULL Then Return False
|
||||||
|
' Non ci deve essere movimento in Z
|
||||||
|
vtMove.z = 0
|
||||||
|
' Recupero il cercio di riferimento
|
||||||
|
Dim nArcId As Integer = EgtGetFirstInGroup(nIdGroup)
|
||||||
|
Dim b3Crv As New BBox3d
|
||||||
|
EgtGetBBoxGlob(nArcId, GDB_BB.STANDARD, b3Crv)
|
||||||
|
Dim ptMin, ptMax As Point3d
|
||||||
|
If EgtGetTableArea(1, ptMin, ptMax) Then
|
||||||
|
Dim m_ptTableMin As Point3d = ptMin
|
||||||
|
Dim m_dTableLength As Double = ptMax.x - ptMin.x
|
||||||
|
Dim m_dTableWidth As Double = ptMax.y - ptMin.y
|
||||||
|
b3Crv.Move(vtMove)
|
||||||
|
If b3Crv.Min().x < m_ptTableMin.x + 10 * EPS_SMALL Then
|
||||||
|
vtMove.x += m_ptTableMin.x + 10 * EPS_SMALL - b3Crv.Min().x
|
||||||
|
ElseIf b3Crv.Max().x > m_ptTableMin.x + m_dTableLength + 10 * EPS_SMALL Then
|
||||||
|
vtMove.x += m_ptTableMin.x + m_dTableLength - 10 * EPS_SMALL - b3Crv.Max().x
|
||||||
|
End If
|
||||||
|
If b3Crv.Min().y < m_ptTableMin.y + 10 * EPS_SMALL Then
|
||||||
|
vtMove.y += m_ptTableMin.y + 10 * EPS_SMALL - b3Crv.Min().y
|
||||||
|
ElseIf b3Crv.Max().y > m_ptTableMin.y + m_dTableWidth + 10 * EPS_SMALL Then
|
||||||
|
vtMove.y += m_ptTableMin.y + m_dTableWidth - 10 * EPS_SMALL - b3Crv.Max().y
|
||||||
|
End If
|
||||||
|
' muovo il gruppo
|
||||||
|
EgtMove(nIdGroup, vtMove)
|
||||||
|
EgtDraw()
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Muovo solo gli elementi SpotReg creati nel programma OFFICE
|
||||||
|
Private Sub MoveAllSpotRegistration(vtMove As Vector3d, Optional bOnlyOfficeSpot As Boolean = True)
|
||||||
|
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||||
|
While nId <> GDB_ID.NULL
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
EgtGetName(nId, sName)
|
||||||
|
If Not sName.Contains("CUT") Or Not bOnlyOfficeSpot Then
|
||||||
|
EgtMove(nId, vtMove)
|
||||||
|
End If
|
||||||
|
nId = EgtGetNext(nId)
|
||||||
|
End While
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Riposiziono i punti SpotReg (tutti) in funzione dell'altezza del grezzo
|
||||||
|
Public Sub UpdateSpotRegistration()
|
||||||
|
Dim ptCentArc As Point3d
|
||||||
|
If m_nRegGroupId <> GDB_ID.NULL Then Return
|
||||||
|
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||||
|
Dim sNameEnt As String = String.Empty
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
EgtGetName(nId, sName)
|
||||||
|
If sName.Contains("CUT") Then
|
||||||
|
sNameEnt = SPOTREGCUT_ & "Arc"
|
||||||
|
Else
|
||||||
|
sNameEnt = SPOTREG_ & "Arc"
|
||||||
|
End If
|
||||||
|
Dim nIdArc As Integer = EgtGetFirstNameInGroup(nId, sNameEnt)
|
||||||
|
If Not EgtCenterPoint(nIdArc, GDB_ID.ROOT, ptCentArc) Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
Dim dOffsetZ As Double = m_b3Raw.Max().z - ptCentArc.z
|
||||||
|
If Math.Abs(dOffsetZ) > 0.1 Then
|
||||||
|
MoveAllSpotRegistration(New Vector3d(0, 0, dOffsetZ + 0.1), False)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Ruoto solo gli elementi SpotReg creati nel programma OFFICE
|
||||||
|
Private Sub RotateAllSpotRegistration(dAngRot As Double, ptCen As Point3d)
|
||||||
|
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||||
|
While nId <> GDB_ID.NULL
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
EgtGetName(nId, sName)
|
||||||
|
If Not sName.Contains("CUT") Then
|
||||||
|
EgtRotate(nId, ptCen, Vector3d.Z_AX, dAngRot)
|
||||||
|
End If
|
||||||
|
nId = EgtGetNext(nId)
|
||||||
|
End While
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Per ogni SpotReg di OFFICE viene generato (nella stessa posizione) uno SpotRegCUT
|
||||||
|
Private Function InsertSpotRegistration() As Boolean
|
||||||
|
' recupero l'elenco non ordinato degli Id dei punti SpotReg (da Office)
|
||||||
|
Dim SpotRegList As New List(Of Integer)
|
||||||
|
Dim nId As Integer = GDB_ID.NULL
|
||||||
|
' Creo la lista ordinata dei punti SpotReg (da OFFICE)
|
||||||
|
For nIndexSpot As Integer = 1 To m_nCountSpot
|
||||||
|
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREG_ & nIndexSpot.ToString)
|
||||||
|
SpotRegList.Add(nId)
|
||||||
|
Next
|
||||||
|
' Creo i punti SpotRegCUT sovrapposti a quelli inseriti in OFFICE
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
For nIndex As Integer = 0 To SpotRegList.Count - 1
|
||||||
|
Dim ptCent As Point3d
|
||||||
|
GetCenterSpotReg(SpotRegList, SPOTREG_ & "Arc", nIndex + 1, ptCent)
|
||||||
|
bOk = bOk And CreateSpotRegistration(m_nRegGroupId, ptCent, nIndex + 1)
|
||||||
|
Next
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Creo il punto nel gruppo "Reg/SpotRegCUT_"
|
||||||
|
Private Function CreateSpotRegistration(nLayerIdReg As Integer, ptP As Point3d, nIndexSpot As Integer) As Boolean
|
||||||
|
' creo uno specifico layer per ogni spot (definito da una croce inscritta in un cerchio)
|
||||||
|
Dim nIdSpotLay As Integer = EgtCreateGroup(nLayerIdReg)
|
||||||
|
' Aggiungo cerchio
|
||||||
|
Dim nCircId As Integer = EgtCreateCircle(nIdSpotLay, ptP, RADSPOT)
|
||||||
|
' Inserisco una croce all'interno del
|
||||||
|
Dim nLineVId As Integer = EgtCreateLinePVL(nIdSpotLay, ptP, Vector3d.Y_AX, RADSPOT)
|
||||||
|
EgtExtendCurveStartByLen(nLineVId, RADSPOT)
|
||||||
|
Dim nLineHId As Integer = EgtCreateLinePVL(nIdSpotLay, ptP, Vector3d.X_AX, RADSPOT)
|
||||||
|
EgtExtendCurveStartByLen(nLineHId, RADSPOT)
|
||||||
|
Dim nTextId As Integer = EgtCreateText(nIdSpotLay, ptP + New Vector3d(1, 1, 0), nIndexSpot.ToString, 10)
|
||||||
|
' coloro gli oggetti appena creati ed assegno il nome
|
||||||
|
Dim bOk As Boolean = EgtSetColor(nCircId, New Color3d(0, 255, 0))
|
||||||
|
bOk = bOk And EgtSetName(nCircId, SPOTREGCUT_ & "Arc")
|
||||||
|
bOk = bOk And EgtSetColor(nLineVId, New Color3d(0, 255, 0))
|
||||||
|
bOk = bOk And EgtSetName(nLineVId, SPOTREGCUT_ & "LineV")
|
||||||
|
bOk = bOk And EgtSetColor(nLineHId, New Color3d(0, 255, 0))
|
||||||
|
bOk = bOk And EgtSetName(nLineHId, SPOTREGCUT_ & "LineH")
|
||||||
|
bOk = bOk And EgtSetColor(nTextId, New Color3d(255, 0, 0))
|
||||||
|
bOk = bOk And EgtSetName(nTextId, SPOTREGCUT_ & "Text")
|
||||||
|
' assegno il nome del gruppo corrente
|
||||||
|
bOk = bOk And EgtSetName(nIdSpotLay, SPOTREGCUT_ & nIndexSpot.ToString)
|
||||||
|
If bOk Then
|
||||||
|
' Aggiorno il contatore degli Spot
|
||||||
|
EgtSetInfo(nLayerIdReg, COUNTSPOTCUT, nIndexSpot)
|
||||||
|
m_nCountSpotCUT = nIndexSpot
|
||||||
|
End If
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Elimino il punto nel gruppo "Reg/SpotRegCUT_"
|
||||||
|
Private Function RemoveSpotRegistration(nSpotRegId As Integer) As Boolean
|
||||||
|
Dim nIndSpotReg As Integer = GetIndexGroupSpotReg(nSpotRegId)
|
||||||
|
If Not EgtErase(nSpotRegId) Then Return False
|
||||||
|
' faccio scorrere tutti i gruppi ed eventualmente li rinomino
|
||||||
|
Dim n_IdSR As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||||
|
m_nCountSpotCUT -= 1
|
||||||
|
EgtSetInfo(m_nRegGroupId, COUNTSPOTCUT, m_nCountSpotCUT)
|
||||||
|
While n_IdSR <> GDB_ID.NULL
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
EgtGetName(n_IdSR, sName)
|
||||||
|
If sName.Contains("CUT") Then
|
||||||
|
Dim nCurrIndSpotReg As Integer = GetIndexGroupSpotReg(n_IdSR)
|
||||||
|
If nCurrIndSpotReg > nIndSpotReg Then
|
||||||
|
' Recupero il testo
|
||||||
|
Dim nIdtext As Integer = EgtGetFirstNameInGroup(n_IdSR, SPOTREGCUT_ & "Text")
|
||||||
|
nCurrIndSpotReg -= 1
|
||||||
|
EgtModifyText(nIdtext, nCurrIndSpotReg.ToString)
|
||||||
|
EgtSetName(n_IdSR, SPOTREGCUT_ & nCurrIndSpotReg.ToString)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
n_IdSR = EgtGetNext(n_IdSR)
|
||||||
|
|
||||||
|
End While
|
||||||
|
EgtDraw()
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Cambio lo stato dello SpotReg (sia di OFFICE che di CUT)
|
||||||
|
Private Function ActivateSpotRegistration(nSpotRegId As Integer) As Boolean
|
||||||
|
Dim nIndexSpot As Integer = GetIndexGroupSpotReg(nSpotRegId)
|
||||||
|
Dim nParentId As Integer = EgtGetParent(nSpotRegId)
|
||||||
|
Dim nInfo As Integer = 0
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
If Not EgtGetInfo(nSpotRegId, ACTIVATESPOTCUT, nInfo) Then
|
||||||
|
' 1: Attivo, 0: Disbilitato
|
||||||
|
nInfo = 1
|
||||||
|
End If
|
||||||
|
If nInfo = 1 Then
|
||||||
|
' inserisco una Info sullo SpotRegCUT che indica che è disattivo
|
||||||
|
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREGCUT_ & nIndexSpot.ToString)
|
||||||
|
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 0)
|
||||||
|
Dim nEntId As Integer = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Arc")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineV")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineH")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Text")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 255, 0))
|
||||||
|
' inserisco una Info sullo SpotReg (OFFICE) che indica che è disattivo
|
||||||
|
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREG_ & nIndexSpot.ToString)
|
||||||
|
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 0)
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Arc")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineV")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineH")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 255))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Text")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
|
||||||
|
Else
|
||||||
|
' inserisco una Info sul pezzo che indica che è attivo
|
||||||
|
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREGCUT_ & nIndexSpot.ToString)
|
||||||
|
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 1)
|
||||||
|
Dim nEntId As Integer = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Arc")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineV")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "LineH")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 255, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREGCUT_ & "Text")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
|
||||||
|
' inserisco una Info sullo SpotReg (OFFICE) che indica che è disattivo
|
||||||
|
nSpotRegId = EgtGetFirstNameInGroup(nParentId, SPOTREG_ & nIndexSpot.ToString)
|
||||||
|
bOk = EgtSetInfo(nSpotRegId, ACTIVATESPOTCUT, 1)
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Arc")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineV")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "LineH")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(0, 0, 0))
|
||||||
|
nEntId = EgtGetFirstNameInGroup(nSpotRegId, SPOTREG_ & "Text")
|
||||||
|
bOk = bOk And EgtSetColor(nEntId, New Color3d(255, 0, 0))
|
||||||
|
End If
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Restituisce l'indice dello "SpotReg_" oppure "SpotRegCUT_"
|
||||||
|
Private Function GetIndexGroupSpotReg(nSpotRegId As Integer) As Integer
|
||||||
|
Dim sNameParent As String = String.Empty
|
||||||
|
EgtGetName(nSpotRegId, sNameParent)
|
||||||
|
' Ricavo l'indice dal nome
|
||||||
|
Dim sItems As String() = sNameParent.Split("_"c)
|
||||||
|
Dim nCurrIndex As Integer = 0
|
||||||
|
If sItems.Count = 2 Then
|
||||||
|
If Not Integer.TryParse(sItems(1), nCurrIndex) Then
|
||||||
|
nCurrIndex = -1
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return nCurrIndex
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Calcola gli spostamenti del grezzo per posizionare i punti di SpotReg
|
||||||
|
Private Function AdjustRawWithSpotReg() As Boolean
|
||||||
|
' Verifico che almeno un punto sia stato inserito
|
||||||
|
If m_nCountSpotCUT < 1 Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage("Insert one spot reg to start.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
' recupero l'elenco non ordinato degli Id dei punti SpotReg (da Office)
|
||||||
|
Dim SpotRegList As New List(Of Integer)
|
||||||
|
Dim SpotRegCUTList As New List(Of Integer)
|
||||||
|
Dim nId As Integer = EgtGetFirstInGroup(m_nRegGroupId)
|
||||||
|
' Creo la lista ordinata dei punti
|
||||||
|
For nIndexSpot As Integer = 1 To m_nCountSpotCUT
|
||||||
|
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREGCUT_ & nIndexSpot.ToString)
|
||||||
|
Dim nActivate As Integer = 0
|
||||||
|
If Not EgtGetInfo(nId, ACTIVATESPOTCUT, nActivate) Then
|
||||||
|
nActivate = 1
|
||||||
|
End If
|
||||||
|
If nId <> GDB_ID.NULL And nActivate = 1 Then
|
||||||
|
SpotRegCUTList.Add(nId)
|
||||||
|
nId = EgtGetFirstNameInGroup(m_nRegGroupId, SPOTREG_ & nIndexSpot.ToString)
|
||||||
|
SpotRegList.Add(nId)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
' Carico la lista dei centri
|
||||||
|
Dim ptCentCUTList As New List(Of Point3d)
|
||||||
|
Dim ptCentLIst As New List(Of Point3d)
|
||||||
|
If Not GetAllCenterSpotReg(SpotRegCUTList, SpotRegList, ptCentCUTList, ptCentLIst) Then Return False
|
||||||
|
|
||||||
|
' Eseguo il primo posizionamento di massima
|
||||||
|
Dim vtMoveStart As Vector3d = ptCentCUTList(0) - ptCentLIst(0)
|
||||||
|
Dim dAngRotSum As Double = 0.0
|
||||||
|
Dim dScaleSum As Double = 0.0
|
||||||
|
For nIndex As Integer = 1 To ptCentCUTList.Count - 1
|
||||||
|
Dim vtDirCUT As Vector3d = ptCentCUTList(nIndex) - ptCentCUTList(0)
|
||||||
|
Dim vtDir As Vector3d = ptCentLIst(nIndex) - ptCentLIst(0)
|
||||||
|
Dim dLenCUT, dLen, dAngVCUT, dAngV, dAngHCUT, dAngH As Double
|
||||||
|
vtDirCUT.ToSpherical(dLenCUT, dAngVCUT, dAngHCUT)
|
||||||
|
vtDir.ToSpherical(dLen, dAngV, dAngH)
|
||||||
|
dScaleSum += Math.Abs(dLenCUT - dLen) / dLenCUT
|
||||||
|
dAngRotSum += dAngHCUT - dAngH
|
||||||
|
Next
|
||||||
|
vtMoveStart.z = 0
|
||||||
|
' Determino la deformazione media
|
||||||
|
Dim dScaleAvarage As Double = 1 - dScaleSum / (ptCentCUTList.Count - 1)
|
||||||
|
MoveAllRawParts(vtMoveStart)
|
||||||
|
' Ruoto del valor medio delle differenze angolari
|
||||||
|
Dim dAngAvarage As Double = dAngRotSum / (ptCentCUTList.Count - 1)
|
||||||
|
RotateAllRawParts(dAngAvarage, ptCentCUTList(0))
|
||||||
|
Dim sCurrINdexSpot As String = GetIndexGroupSpotReg(SpotRegCUTList(0)).ToString
|
||||||
|
EgtOutLog(" → REG Adjustment datas :")
|
||||||
|
EgtOutLog(" → move SpotReg_" & sCurrINdexSpot & " : " & vtMoveStart.x.ToString & ", " & vtMoveStart.y.ToString)
|
||||||
|
EgtOutLog(" → average rotation around SpotRegCUT_" & sCurrINdexSpot & " : " & dAngAvarage.ToString)
|
||||||
|
EgtOutLog(" → average scale deformation : " & dScaleAvarage.ToString)
|
||||||
|
|
||||||
|
' Correggo lo spostamento in funzione della deformazione misurata
|
||||||
|
Dim vtMoveSum As Vector3d = New Vector3d(0, 0, 0)
|
||||||
|
GetAllCenterSpotReg(SpotRegCUTList, SpotRegList, ptCentCUTList, ptCentLIst)
|
||||||
|
For nIndex As Integer = 1 To ptCentCUTList.Count - 1
|
||||||
|
vtMoveSum += ptCentCUTList(nIndex) - ptCentLIst(nIndex)
|
||||||
|
Next
|
||||||
|
vtMoveSum.z = 0
|
||||||
|
vtMoveSum = vtMoveSum / (ptCentCUTList.Count - 1)
|
||||||
|
MoveAllRawParts(vtMoveSum * dScaleAvarage / 2)
|
||||||
|
EgtDraw()
|
||||||
|
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function GetAllCenterSpotReg(SpotRegCUTList As List(Of Integer), SpotRegList As List(Of Integer),
|
||||||
|
ByRef ptCentCUTList As List(Of Point3d), ByRef ptCentLIst As List(Of Point3d)) As Boolean
|
||||||
|
ptCentCUTList.Clear()
|
||||||
|
ptCentLIst.Clear()
|
||||||
|
For nIndex As Integer = 0 To m_nCountSpotCUT
|
||||||
|
Dim ptCenCUT As Point3d
|
||||||
|
Dim ptCent As Point3d
|
||||||
|
If GetCenterSpotReg(SpotRegCUTList, SPOTREGCUT_ & "Arc", nIndex + 1, ptCenCUT) Then
|
||||||
|
ptCentCUTList.Add(ptCenCUT)
|
||||||
|
GetCenterSpotReg(SpotRegList, SPOTREG_ & "Arc", nIndex + 1, ptCent)
|
||||||
|
ptCentLIst.Add(ptCent)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
If ptCentCUTList.Count > 0 AndAlso ptCentCUTList.Count = ptCentLIst.Count Then
|
||||||
|
Return True
|
||||||
|
Else
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Data la lista di punti Spot e l'indice dello spot da ricercare restituisce il centro del punto indicato
|
||||||
|
Private Function GetCenterSpotReg(ListSR As List(Of Integer), sName As String, nIndex As Integer, ByRef ptCentArc As Point3d) As Boolean
|
||||||
|
For Each ItemSR As Integer In ListSR
|
||||||
|
If GetIndexGroupSpotReg(ItemSR) = nIndex Then
|
||||||
|
Dim nIdArc As Integer = EgtGetFirstNameInGroup(ItemSR, sName)
|
||||||
|
If EgtCenterPoint(nIdArc, GDB_ID.ROOT, ptCentArc) Then
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Imports EgtUILib
|
Imports System.Net
|
||||||
|
Imports System.Windows.Forms.Integration
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Public Module SplitAuto
|
Public Module SplitAuto
|
||||||
|
|
||||||
@@ -36,6 +38,8 @@ Public Module SplitAuto
|
|||||||
Public m_dStartFreeLen As Double
|
Public m_dStartFreeLen As Double
|
||||||
Public m_dEndFreeLen As Double
|
Public m_dEndFreeLen As Double
|
||||||
Public m_vtDir As Vector3d
|
Public m_vtDir As Vector3d
|
||||||
|
' ver 2.6f4: tagli corti gestiti con LeadIn.OUT/LeadOut.OUT
|
||||||
|
Public m_bMngLeadInOnIntCorner As Boolean
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
'-----------------------------------------------------------------------------------------------
|
'-----------------------------------------------------------------------------------------------
|
||||||
@@ -109,15 +113,22 @@ Public Module SplitAuto
|
|||||||
EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
|
EgtMidVector(nEntId, GDB_ID.ROOT, Mach.m_vtDir)
|
||||||
If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
|
If Mach.m_bInvert Then Mach.m_vtDir = -Mach.m_vtDir
|
||||||
Mach.m_nEntId = nEntId
|
Mach.m_nEntId = nEntId
|
||||||
|
EgtGetInfo(nOperId, "ManageLeadInOnIntCorner", Mach.m_bMngLeadInOnIntCorner)
|
||||||
End If
|
End If
|
||||||
' verifico se trasformabile in un taglio di separazione (almeno da un lato)
|
' verifico se trasformabile in un taglio di separazione (almeno da un lato)
|
||||||
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL) And
|
If (dStartAddLen > -EPS_SMALL Or dEndAddLen > -EPS_SMALL Or Mach.m_bMngLeadInOnIntCorner) And
|
||||||
Mach.m_sLay = NAME_OUTLOOP And Mach.m_nInterf = FMI_TYPE.NONE Then
|
Mach.m_sLay = NAME_OUTLOOP And Mach.m_nInterf = FMI_TYPE.NONE Then
|
||||||
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
|
Dim nRes As Integer = EgtVerifyCutAsSplitting(nOperId)
|
||||||
Mach.m_bCanStartAll = (dStartAddLen > -EPS_SMALL And (nRes And CAR_RES.LI_OK) <> 0) And
|
Dim bIn As Boolean = False
|
||||||
Mach.m_dStartFreeLen > FREELEN_INF And Mach.m_bIsLine
|
Dim bOut As Boolean = False
|
||||||
Mach.m_bCanEndAll = (dEndAddLen > -EPS_SMALL And (nRes And CAR_RES.LO_OK) <> 0) And
|
CanExtendSides(Mach, bIn, bOut)
|
||||||
Mach.m_dEndFreeLen > FREELEN_INF And Mach.m_bIsLine
|
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
|
||||||
End If
|
End If
|
||||||
' se trasformabile in taglio di separazione, verifico se lo è
|
' se trasformabile in taglio di separazione, verifico se lo è
|
||||||
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
|
If Mach.m_bCanStartAll Or Mach.m_bCanEndAll Then
|
||||||
@@ -166,6 +177,26 @@ Public Module SplitAuto
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
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
|
' 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)
|
Friend Sub CountMachiningType(MachSplit As SplitMach, ByRef nCountSawing As Integer, ByRef nCountWaterjetting As Integer, ByRef nCountOtherMachining As Integer)
|
||||||
@@ -219,11 +250,11 @@ Public Module SplitAuto
|
|||||||
Next
|
Next
|
||||||
EgtSetColor(nDwnCutId, COL_MCH_DISABLED)
|
EgtSetColor(nDwnCutId, COL_MCH_DISABLED)
|
||||||
Dim bFreeStart As Boolean = (nInterf And FMI_TYPE.LI) <> FMI_TYPE.LI
|
Dim bFreeStart As Boolean = (nInterf And FMI_TYPE.LI) <> FMI_TYPE.LI
|
||||||
EgtSetColor(nPrcId, If(bFreeStart, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
|
EgtSetColor(nPrcId, If(bFreeStart, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
|
||||||
EgtSetColor(nDwnPrcId, If(bFreeStart, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
|
EgtSetColor(nDwnPrcId, If(bFreeStart, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
|
||||||
Dim bFreeEnd As Boolean = (nInterf And FMI_TYPE.LO) <> FMI_TYPE.LO
|
Dim bFreeEnd As Boolean = (nInterf And FMI_TYPE.LO) <> FMI_TYPE.LO
|
||||||
EgtSetColor(nPocId, If(bFreeEnd, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
|
EgtSetColor(nPocId, If(bFreeEnd, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
|
||||||
EgtSetColor(nDwnPocId, If(bFreeEnd, COL_MCH_DISABLED, COL_MCH_DIS_INTERF))
|
EgtSetColor(nDwnPocId, If(bFreeEnd, COL_MCH_DISABLED(), COL_MCH_DIS_INTERF()))
|
||||||
Else
|
Else
|
||||||
Dim colCut As Color3d
|
Dim colCut As Color3d
|
||||||
If bOnMach Then
|
If bOnMach Then
|
||||||
@@ -342,6 +373,7 @@ Public Module SplitAuto
|
|||||||
Dim ptOri As Point3d
|
Dim ptOri As Point3d
|
||||||
EgtGetTableRef(1, ptOri)
|
EgtGetTableRef(1, ptOri)
|
||||||
Dim vtOri As New Vector3d(ptOri.x, ptOri.y, ptOri.z)
|
Dim vtOri As New Vector3d(ptOri.x, ptOri.y, ptOri.z)
|
||||||
|
' ---------------------------------- GREZZI ----------------------------------
|
||||||
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
|
' Eseguo eventuali spezzature dei grezzi e vi sposto i pezzi (i grezzi devono essere sempre copiati per Registrazione con rotazione)
|
||||||
Dim nRawId As Integer = EgtGetFirstRawPart()
|
Dim nRawId As Integer = EgtGetFirstRawPart()
|
||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
@@ -393,10 +425,19 @@ Public Module SplitAuto
|
|||||||
' passo al successivo grezzo
|
' passo al successivo grezzo
|
||||||
nRawId = EgtGetNextRawPart(nRawId)
|
nRawId = EgtGetNextRawPart(nRawId)
|
||||||
End While
|
End While
|
||||||
|
' ---------------------------------- GREZZI ----------------------------------
|
||||||
' Cancello preview dei tagli allungati dalla lavorazione
|
' Cancello preview dei tagli allungati dalla lavorazione
|
||||||
For Each nCut As Integer In vCuts
|
For Each nCut As Integer In vCuts
|
||||||
RemoveMachiningPreview(nCut)
|
RemoveMachiningPreview(nCut)
|
||||||
Next
|
Next
|
||||||
|
' ---------------------------------- LAVORAZIONI ----------------------------------
|
||||||
|
ChangeOperationPhase(nNewPhase)
|
||||||
|
' ---------------------------------- LAVORAZIONI ----------------------------------
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Sposta le lavorzioni della fase precedente a quella indicata
|
||||||
|
Friend Sub ChangeOperationPhase_ERR(nNewPhase As Integer)
|
||||||
' Sposto tutte le lavorazioni disabilitate e le eventuali inglobate nella nuova fase
|
' Sposto tutte le lavorazioni disabilitate e le eventuali inglobate nella nuova fase
|
||||||
Dim nId = EgtGetFirstOperation()
|
Dim nId = EgtGetFirstOperation()
|
||||||
While nId <> GDB_ID.NULL
|
While nId <> GDB_ID.NULL
|
||||||
@@ -417,9 +458,50 @@ Public Module SplitAuto
|
|||||||
End If
|
End If
|
||||||
nId = nNextId
|
nId = nNextId
|
||||||
End While
|
End While
|
||||||
Return True
|
End Sub
|
||||||
End Function
|
|
||||||
|
|
||||||
|
' Miglioramento della gestione delle lavorazioni
|
||||||
|
Friend Sub ChangeOperationPhase(nNewPhase As Integer)
|
||||||
|
' creo l'elenco delle lavorazioni che devono essere sposate
|
||||||
|
Dim MchList As New List(Of Integer)
|
||||||
|
' Recupero le lavorazioni disabilitate e le eventuali inglobate nella nuova fase
|
||||||
|
Dim nId = EgtGetFirstOperation()
|
||||||
|
While nId <> GDB_ID.NULL
|
||||||
|
Dim nNextId = EgtGetNextOperation(nId)
|
||||||
|
If IsValidMachining(nId) And EgtGetOperationPhase(nId) = nNewPhase - 1 And EgtExistsInfo(nId, INFO_MCH_USER_OFF) Then
|
||||||
|
' Provo ad inserire la lavorazione nell'elenco
|
||||||
|
AddMach(MchList, nId)
|
||||||
|
' sposto le inglobate
|
||||||
|
Dim sInfo As String = String.Empty
|
||||||
|
If EgtGetInfo(nId, INFO_MCH_OTHMID, sInfo) Then
|
||||||
|
Dim sItems() As String = sInfo.Split(",".ToCharArray)
|
||||||
|
For Each sId2 As String In sItems
|
||||||
|
Dim nId2 As Integer = 0
|
||||||
|
StringToInt(sId2, nId2)
|
||||||
|
If nId2 > 0 Then
|
||||||
|
' Provo ad inserire la lavorazione nell'elenco
|
||||||
|
AddMach(MchList, nId2)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nId = nNextId
|
||||||
|
End While
|
||||||
|
' Procedo ora a spostare le lavorazioni nella nuova disposizione
|
||||||
|
For Each ItemMchId As Integer In MchList
|
||||||
|
EgtChangeOperationPhase(ItemMchId, nNewPhase)
|
||||||
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Inserisce gli inidici delle lavorazioni evitando di inserire dei doppioni
|
||||||
|
Private Sub AddMach(MchList As List(Of Integer), IdMch As Integer)
|
||||||
|
For Each Item As Integer In MchList
|
||||||
|
If IdMch = Item Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
MchList.Add(IdMch)
|
||||||
|
End Sub
|
||||||
'-----------------------------------------------------------------------------------------------
|
'-----------------------------------------------------------------------------------------------
|
||||||
Friend Function CalculateSplitAuto() As Boolean
|
Friend Function CalculateSplitAuto() As Boolean
|
||||||
' Fase iniziale
|
' Fase iniziale
|
||||||
@@ -743,21 +825,29 @@ Public Module SplitAuto
|
|||||||
|
|
||||||
Private Function ExecMove(nDispId As Integer, vNewRaws As List(Of Integer),
|
Private Function ExecMove(nDispId As Integer, vNewRaws As List(Of Integer),
|
||||||
vtMove As Vector3d, dMinMove As Double) As Boolean
|
vtMove As Vector3d, dMinMove As Double) As Boolean
|
||||||
Dim vtMove2 As Vector3d = -vtMove
|
Dim bTwoHeadVac As Boolean = (EgtGetHeadId(VACUUM_HEAD_2) <> GDB_ID.NULL)
|
||||||
Dim rmData As New RawMoveData
|
Dim rmData As New RawMoveData
|
||||||
If PutVacuumCupsOnRaw(vNewRaws(1), rmData) AndAlso
|
Dim vtMove2 As Vector3d = -vtMove
|
||||||
SafeMoveRawPart(vNewRaws(1), vtMove, dMinMove) Then
|
|
||||||
|
VacuumCups.ResetHeadName()
|
||||||
|
Dim bPutVacuum As Boolean = PutVacuumCupsOnRaw(vNewRaws(1), rmData)
|
||||||
|
If Not bPutVacuum And bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(vNewRaws(1), rmData)
|
||||||
|
If bPutVacuum AndAlso SafeMoveRawPart(vNewRaws(1), vtMove, dMinMove) Then
|
||||||
rmData.m_vtRawMove = vtMove
|
rmData.m_vtRawMove = vtMove
|
||||||
SaveOneMoveInfoInDisposition(nDispId, rmData)
|
SaveOneMoveInfoInDisposition(nDispId, rmData)
|
||||||
Return True
|
Return True
|
||||||
ElseIf PutVacuumCupsOnRaw(vNewRaws(0), rmData) AndAlso
|
End If
|
||||||
SafeMoveRawPart(vNewRaws(0), vtMove2, dMinMove) Then
|
|
||||||
|
VacuumCups.ResetHeadName()
|
||||||
|
Dim bPut2Vacuum As Boolean = PutVacuumCupsOnRaw(vNewRaws(0), rmData)
|
||||||
|
If Not bPut2Vacuum And bTwoHeadVac Then bPutVacuum = PutVacuumCupsOnRaw(vNewRaws(0), rmData)
|
||||||
|
If bPut2Vacuum AndAlso SafeMoveRawPart(vNewRaws(0), vtMove2, dMinMove) Then
|
||||||
rmData.m_vtRawMove = vtMove2
|
rmData.m_vtRawMove = vtMove2
|
||||||
SaveOneMoveInfoInDisposition(nDispId, rmData)
|
SaveOneMoveInfoInDisposition(nDispId, rmData)
|
||||||
Return True
|
Return True
|
||||||
Else
|
|
||||||
Return False
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
|
Private Function SafeMoveRawPart(nRawId As Integer, ByRef vtMove As Vector3d, dMindist As Double) As Boolean
|
||||||
@@ -799,7 +889,7 @@ Public Module SplitAuto
|
|||||||
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
If VerifyRawWithOtherRaws(nRawId, dMindist) Then
|
||||||
vtMove += 0.5 * vtOriMove
|
vtMove += 0.5 * vtOriMove
|
||||||
nMove += 1
|
nMove += 1
|
||||||
If nMoveLevel = nMove Then return True
|
If nMoveLevel = nMove Then Return True
|
||||||
Else
|
Else
|
||||||
EgtMoveRawPart(nRawId, -0.5 * vtOriMove)
|
EgtMoveRawPart(nRawId, -0.5 * vtOriMove)
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Public Class SplitPageUC
|
|||||||
' Tipo movimento dei grezzi (manuale o con testa ventosa)
|
' Tipo movimento dei grezzi (manuale o con testa ventosa)
|
||||||
Private m_bByHand As Boolean = True
|
Private m_bByHand As Boolean = True
|
||||||
' Abilitazione movimento finale pezzi su tavola ausiliaria
|
' Abilitazione movimento finale pezzi su tavola ausiliaria
|
||||||
Private m_bEnableOnAuxTab As Boolean = False
|
Friend m_bEnableOnAuxTab As Boolean = False
|
||||||
' Stato
|
' Stato
|
||||||
Private m_nCurrPhase As Integer = 0
|
Private m_nCurrPhase As Integer = 0
|
||||||
Private m_MachiningList As New List(Of SplitMach)
|
Private m_MachiningList As New List(Of SplitMach)
|
||||||
@@ -49,6 +49,7 @@ Public Class SplitPageUC
|
|||||||
Private m_bModified As Boolean = False
|
Private m_bModified As Boolean = False
|
||||||
Private m_nNbrGrpId As Integer = GDB_ID.NULL
|
Private m_nNbrGrpId As Integer = GDB_ID.NULL
|
||||||
Private m_bToNext As Boolean = False
|
Private m_bToNext As Boolean = False
|
||||||
|
Private m_bToPrev As Boolean = False
|
||||||
Friend m_bOnAuxTab As Boolean = False
|
Friend m_bOnAuxTab As Boolean = False
|
||||||
' Drag
|
' Drag
|
||||||
Private m_nDragInd As Integer = -1
|
Private m_nDragInd As Integer = -1
|
||||||
@@ -60,6 +61,9 @@ Public Class SplitPageUC
|
|||||||
' Abilita la mofica Inizio fine per i tagli interni sugli angoli
|
' Abilita la mofica Inizio fine per i tagli interni sugli angoli
|
||||||
Private m_StartEndModifyOnIntCorner As Boolean = False
|
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)
|
Private Sub SplitPageUC_Initialized(sender As Object, e As EventArgs)
|
||||||
PrevBtn.IsEnabled = False
|
PrevBtn.IsEnabled = False
|
||||||
' Collego lista di oggetti a ListBox
|
' Collego lista di oggetti a ListBox
|
||||||
@@ -167,6 +171,7 @@ Public Class SplitPageUC
|
|||||||
m_bModified = False
|
m_bModified = False
|
||||||
' Reset flag tipo uscita
|
' Reset flag tipo uscita
|
||||||
m_bToNext = False
|
m_bToNext = False
|
||||||
|
m_bToPrev = False
|
||||||
' Abilitazione bottoni
|
' Abilitazione bottoni
|
||||||
EnableButtons()
|
EnableButtons()
|
||||||
' Se sola visualizzazione, segnalazione di eventuale fase di restart
|
' Se sola visualizzazione, segnalazione di eventuale fase di restart
|
||||||
@@ -180,7 +185,8 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ShowMachiningList()
|
' preparo la lista delle lavorazioni da mostrare in interfaccia
|
||||||
|
Public Sub ShowMachiningList()
|
||||||
m_ItemList.Clear()
|
m_ItemList.Clear()
|
||||||
For i As Integer = 1 To m_MachiningList.Count()
|
For i As Integer = 1 To m_MachiningList.Count()
|
||||||
Dim Mach As SplitMach = m_MachiningList(i - 1)
|
Dim Mach As SplitMach = m_MachiningList(i - 1)
|
||||||
@@ -340,7 +346,6 @@ Public Class SplitPageUC
|
|||||||
EgtTrimCurveEndAtLen(nIdBridge, dLen - 10 * EPS_SMALL)
|
EgtTrimCurveEndAtLen(nIdBridge, dLen - 10 * EPS_SMALL)
|
||||||
EgtTrimCurveStartAtLen(nIdBridge, 10 * EPS_SMALL)
|
EgtTrimCurveStartAtLen(nIdBridge, 10 * EPS_SMALL)
|
||||||
End If
|
End If
|
||||||
' EgtSaveFile("c:\EgtData\OmagCUT\Temp\Bridge.nge", NGE.BIN)
|
|
||||||
Dim nIdPart As Integer = GDB_ID.NULL
|
Dim nIdPart As Integer = GDB_ID.NULL
|
||||||
nIdPart = EgtGetFirstPartInRawPart(m_CurrProjPage.m_nRawId)
|
nIdPart = EgtGetFirstPartInRawPart(m_CurrProjPage.m_nRawId)
|
||||||
While nIdPart <> GDB_ID.NULL
|
While nIdPart <> GDB_ID.NULL
|
||||||
@@ -348,7 +353,6 @@ Public Class SplitPageUC
|
|||||||
Dim nIdSurf As Integer = EgtGetFirstInGroup(nIdRegion)
|
Dim nIdSurf As Integer = EgtGetFirstInGroup(nIdRegion)
|
||||||
While nIdSurf <> GDB_ID.NULL
|
While nIdSurf <> GDB_ID.NULL
|
||||||
If EgtGetType(nIdSurf) = GDB_TY.SRF_FRGN Then
|
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
|
' se la linea bridge interseca la superficie allora restitusco false
|
||||||
If EgtCurveWithRegionClassify(nIdBridge, nIdSurf) <> CREGC.OUT Then
|
If EgtCurveWithRegionClassify(nIdBridge, nIdSurf) <> CREGC.OUT Then
|
||||||
EgtExtendCurveStartByLen(nIdBridge, 10 * EPS_SMALL)
|
EgtExtendCurveStartByLen(nIdBridge, 10 * EPS_SMALL)
|
||||||
@@ -452,6 +456,10 @@ Public Class SplitPageUC
|
|||||||
|
|
||||||
#End Region ' Bridge
|
#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
|
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
|
' Verifico di essere il gestore attivo e non in modalità sola visualizzazione
|
||||||
If Not m_bActive OrElse m_bShow Then Return
|
If Not m_bActive OrElse m_bShow Then Return
|
||||||
@@ -563,6 +571,11 @@ Public Class SplitPageUC
|
|||||||
m_nDragInd = -1
|
m_nDragInd = -1
|
||||||
m_nDragType = 0
|
m_nDragType = 0
|
||||||
m_nSelected = GDB_ID.NULL
|
m_nSelected = GDB_ID.NULL
|
||||||
|
If Not IsNothing(MachiningLsBx.SelectedItem) Then
|
||||||
|
MarkMachining(MachiningLsBx.SelectedItem.Ind, False)
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
|
MachiningLsBx.SelectedIndex = -1
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -594,6 +607,7 @@ Public Class SplitPageUC
|
|||||||
Dim dUsal As Double
|
Dim dUsal As Double
|
||||||
' ----------------------- REPEAT -----------------------
|
' ----------------------- REPEAT -----------------------
|
||||||
Do
|
Do
|
||||||
|
If Not m_MachiningList(m_nDragInd).m_bCanStartAll Then Exit Do
|
||||||
dDelta = -dDelta
|
dDelta = -dDelta
|
||||||
' Leggo il valore salvato nella geometria
|
' Leggo il valore salvato nella geometria
|
||||||
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||||
@@ -627,6 +641,7 @@ Public Class SplitPageUC
|
|||||||
Dim dUeal As Double
|
Dim dUeal As Double
|
||||||
dDelta = -dDelta
|
dDelta = -dDelta
|
||||||
Do
|
Do
|
||||||
|
If Not m_MachiningList(m_nDragInd).m_bCanEndAll Then Exit Do
|
||||||
dDelta = -dDelta
|
dDelta = -dDelta
|
||||||
' Leggo il valore salvato nella geometria
|
' Leggo il valore salvato nella geometria
|
||||||
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||||
@@ -690,6 +705,11 @@ Public Class SplitPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub MachiningLsBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MachiningLsBx.SelectionChanged
|
Private Sub MachiningLsBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MachiningLsBx.SelectionChanged
|
||||||
|
' se non attiva la modifica allora esco
|
||||||
|
If m_bShow Then
|
||||||
|
MachiningLsBx.SelectedIndex = -1
|
||||||
|
Return
|
||||||
|
End If
|
||||||
If MachiningLsBx.SelectedItems.Count = 0 Then Return
|
If MachiningLsBx.SelectedItems.Count = 0 Then Return
|
||||||
If MachiningLsBx.SelectedItems.Count = 1 Then m_bAreHomogeneous = True
|
If MachiningLsBx.SelectedItems.Count = 1 Then m_bAreHomogeneous = True
|
||||||
' creo lista ordinata dei selezionati
|
' creo lista ordinata dei selezionati
|
||||||
@@ -710,30 +730,8 @@ Public Class SplitPageUC
|
|||||||
MoveUpBtn.IsEnabled = False
|
MoveUpBtn.IsEnabled = False
|
||||||
MoveDownBtn.IsEnabled = False
|
MoveDownBtn.IsEnabled = False
|
||||||
End If
|
End If
|
||||||
|
' Recupero la selezione dei tagli correnti
|
||||||
GetCurrSelection()
|
GetCurrSelection()
|
||||||
|
|
||||||
'' verifico che siano contigui
|
|
||||||
'Dim bContigus As Boolean = False
|
|
||||||
'Dim OrdIndex = 0
|
|
||||||
'OrdIndex = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1).Ind
|
|
||||||
'' recupero l'indice dell'ultimo elemento selezionato
|
|
||||||
'Dim LastSel As NameIdLsBxItem = MachiningLsBx.SelectedItems(MachiningLsBx.SelectedItems.Count - 1)
|
|
||||||
'If MachiningLsBx.SelectedItems.Count = 1 Then
|
|
||||||
' bContigus = True
|
|
||||||
'Else
|
|
||||||
' For Each Item As NameIdLsBxItem In ItemList
|
|
||||||
' If Item.Ind = LastSel.Ind + 1 Or Item.Ind = LastSel.Ind - 1 Then
|
|
||||||
' bContigus = True
|
|
||||||
' End If
|
|
||||||
' Next
|
|
||||||
'End If
|
|
||||||
'' se non contiguo, elimino dai selezionati il primo(che è l'ultimo ad essere stato selezionato)
|
|
||||||
'If Not bContigus Then
|
|
||||||
' ItemList.Remove(LastSel)
|
|
||||||
' MachiningLsBx.SelectedItems.RemoveAt(MachiningLsBx.SelectedItems.Count - 1)
|
|
||||||
'End If
|
|
||||||
|
|
||||||
' resetto marcatura lavorazioni
|
' resetto marcatura lavorazioni
|
||||||
If m_CurrFirstInd > -1 Then
|
If m_CurrFirstInd > -1 Then
|
||||||
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
|
For Index As Integer = m_CurrFirstInd To m_CurrLastInd
|
||||||
@@ -752,6 +750,13 @@ Public Class SplitPageUC
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
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
|
Private Sub MoveUpBtn_Click(sender As Object, e As RoutedEventArgs) Handles MoveUpBtn.Click
|
||||||
MoveItem(-1)
|
MoveItem(-1)
|
||||||
End Sub
|
End Sub
|
||||||
@@ -827,6 +832,8 @@ Public Class SplitPageUC
|
|||||||
Next
|
Next
|
||||||
|
|
||||||
VerifyHomogenousMachining(ItemList)
|
VerifyHomogenousMachining(ItemList)
|
||||||
|
' Abilitazione bottone Next
|
||||||
|
EnableButtons()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub AllOnBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOnBtn.Click
|
Private Sub AllOnBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOnBtn.Click
|
||||||
@@ -933,11 +940,31 @@ Public Class SplitPageUC
|
|||||||
EnableButtons()
|
EnableButtons()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' ERRORE: questo evento non è eseguito!
|
'' DA FARE: quando seleziono Esc devo togliere deselezionare tutte le enità!
|
||||||
Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs)
|
'Private Sub OnKeyDownScene(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
|
||||||
If e.Key = Key.Escape Then
|
' If e.Key = Key.Escape Then
|
||||||
' se sono in fase di creazione di un ponticello interrompo
|
' ' se sono in fase di creazione di un ponticello interrompo
|
||||||
DeselectWJBridgesPart()
|
' 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 If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1144,6 +1171,12 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
Dim nI As Integer = m_ItemList(Index).Ind
|
Dim nI As Integer = m_ItemList(Index).Ind
|
||||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||||
|
|
||||||
|
' 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)
|
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||||
Dim nLiPrev As Integer
|
Dim nLiPrev As Integer
|
||||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||||
@@ -1175,6 +1208,9 @@ Public Class SplitPageUC
|
|||||||
ColorMachining(m_MachiningList(nI))
|
ColorMachining(m_MachiningList(nI))
|
||||||
ColorNumberArrow(nI)
|
ColorNumberArrow(nI)
|
||||||
bGenModif = True
|
bGenModif = True
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
' Se modificato qualcosa
|
' Se modificato qualcosa
|
||||||
@@ -1212,6 +1248,12 @@ Public Class SplitPageUC
|
|||||||
|
|
||||||
Private Sub AllCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenStartBtn.Click
|
Private Sub AllCenStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenStartBtn.Click
|
||||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||||
|
|
||||||
|
' 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)
|
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||||
Dim nLiPrev As Integer
|
Dim nLiPrev As Integer
|
||||||
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
EgtGetMachiningParam(MCH_MP.LEADINTYPE, nLiPrev)
|
||||||
@@ -1230,6 +1272,9 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
ColorMachining(m_MachiningList(nI))
|
ColorMachining(m_MachiningList(nI))
|
||||||
ColorNumberArrow(nI)
|
ColorNumberArrow(nI)
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
' Imposto flag di modifica
|
' Imposto flag di modifica
|
||||||
@@ -1245,6 +1290,12 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
Dim nI As Integer = m_ItemList(Index).Ind
|
Dim nI As Integer = m_ItemList(Index).Ind
|
||||||
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
If m_MachiningList(nI).m_sLay = NAME_OUTLOOP Then
|
||||||
|
|
||||||
|
' 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)
|
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||||
Dim nLoPrev As Integer
|
Dim nLoPrev As Integer
|
||||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||||
@@ -1276,6 +1327,9 @@ Public Class SplitPageUC
|
|||||||
ColorMachining(m_MachiningList(nI))
|
ColorMachining(m_MachiningList(nI))
|
||||||
ColorNumberArrow(nI)
|
ColorNumberArrow(nI)
|
||||||
bGenModif = True
|
bGenModif = True
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
' Se modificato qualcosa
|
' Se modificato qualcosa
|
||||||
@@ -1313,6 +1367,12 @@ Public Class SplitPageUC
|
|||||||
|
|
||||||
Private Sub AllCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenEndBtn.Click
|
Private Sub AllCenEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllCenEndBtn.Click
|
||||||
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
For nI As Integer = 0 To m_MachiningList.Count() - 1
|
||||||
|
|
||||||
|
' 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)
|
EgtSetCurrMachining(m_MachiningList(nI).m_nId)
|
||||||
Dim nLoPrev As Integer
|
Dim nLoPrev As Integer
|
||||||
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
EgtGetMachiningParam(MCH_MP.LEADOUTTYPE, nLoPrev)
|
||||||
@@ -1331,6 +1391,9 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
ColorMachining(m_MachiningList(nI))
|
ColorMachining(m_MachiningList(nI))
|
||||||
ColorNumberArrow(nI)
|
ColorNumberArrow(nI)
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
' Imposto flag di modifica
|
' Imposto flag di modifica
|
||||||
@@ -1408,6 +1471,12 @@ Public Class SplitPageUC
|
|||||||
' Se taglio con lama
|
' Se taglio con lama
|
||||||
If nMachiningType = MCH_MY.SAWING And
|
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
|
(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
|
' leggo il valore salvato nella geometria
|
||||||
Dim dOrigUsal As Double = 0
|
Dim dOrigUsal As Double = 0
|
||||||
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
EgtGetInfo(nOperId, INFO_MCH_USER_SAL, dOrigUsal)
|
||||||
@@ -1583,6 +1652,11 @@ Public Class SplitPageUC
|
|||||||
If nMachiningType = MCH_MY.SAWING And
|
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
|
(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
|
Dim dOrigUeal As Double = 0
|
||||||
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
EgtGetInfo(nOperId, INFO_MCH_USER_EAL, dOrigUeal)
|
||||||
|
|
||||||
@@ -1717,7 +1791,7 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
Dim nI As Integer = m_ItemList(Index).Ind
|
Dim nI As Integer = m_ItemList(Index).Ind
|
||||||
' Si possono invertire solo i tagli di lama
|
' Si possono invertire solo i tagli di lama
|
||||||
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING Then Continue For
|
If m_MachiningList(nI).m_nType <> MCH_OY.SAWING And m_MachiningList(nI).m_nType <> MCH_OY.WATERJETTING Then Continue For
|
||||||
' Non si possono invertire i tagli di lama inclinati
|
' Non si possono invertire i tagli di lama inclinati
|
||||||
If Math.Abs(m_MachiningList(nI).m_dSideAng) > 0.1 Then Continue For
|
If Math.Abs(m_MachiningList(nI).m_dSideAng) > 0.1 Then Continue For
|
||||||
' Se abilitata inversione automatica e quindi non invertito
|
' Se abilitata inversione automatica e quindi non invertito
|
||||||
@@ -1731,6 +1805,7 @@ Public Class SplitPageUC
|
|||||||
ResetEnableInvert(m_MachiningList(nI).m_nEntId)
|
ResetEnableInvert(m_MachiningList(nI).m_nEntId)
|
||||||
EgtErase(m_MachiningList(nI).m_nArrId)
|
EgtErase(m_MachiningList(nI).m_nArrId)
|
||||||
NumberDirectionMachining(nI, False)
|
NumberDirectionMachining(nI, False)
|
||||||
|
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End If
|
End If
|
||||||
' se altrimenti disabilitata inversione automatica e invertito
|
' se altrimenti disabilitata inversione automatica e invertito
|
||||||
@@ -1742,6 +1817,7 @@ Public Class SplitPageUC
|
|||||||
SwapStartEndData(nI)
|
SwapStartEndData(nI)
|
||||||
EgtErase(m_MachiningList(nI).m_nArrId)
|
EgtErase(m_MachiningList(nI).m_nArrId)
|
||||||
NumberDirectionMachining(nI, False)
|
NumberDirectionMachining(nI, False)
|
||||||
|
UpdateMachiningPreview(m_MachiningList(nI).m_nId, True)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End If
|
End If
|
||||||
' altrimenti disabilitata inversione automatica e non invertito
|
' altrimenti disabilitata inversione automatica e non invertito
|
||||||
@@ -1780,15 +1856,26 @@ Public Class SplitPageUC
|
|||||||
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
||||||
' Dichiaro solo visualizzazione
|
' Dichiaro solo visualizzazione
|
||||||
m_bShow = True
|
m_bShow = True
|
||||||
' Esco
|
'' Esco
|
||||||
ExitSplit(False)
|
'ExitSplit(False)
|
||||||
' Torno alla fase precedente
|
' Torno alla fase precedente
|
||||||
EgtSetCurrPhase(EgtGetCurrPhase() - 1)
|
Dim nCurrPhase As Integer = EgtGetCurrPhase()
|
||||||
|
' se questa è la prima fase, non possono tornare più indietro di così
|
||||||
|
If nCurrPhase = 1 Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
EgtSetCurrPhase(nCurrPhase - 1)
|
||||||
|
m_bToPrev = True
|
||||||
' Reimposto la precedente
|
' Reimposto la precedente
|
||||||
SplitPageUC_Loaded(Nothing, Nothing)
|
'SplitPageUC_Loaded(Nothing, Nothing)
|
||||||
|
' torno alla disposizione della fase corrente
|
||||||
|
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_SplitPage)
|
||||||
|
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage)
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.MoveRawPart
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
||||||
|
' ------- VISUALIZZAZIONE (navigazione tra le fasi) -------
|
||||||
If m_bShow Then
|
If m_bShow Then
|
||||||
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
Dim CurrDisposition As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
||||||
' recupero l'operazione successiva
|
' recupero l'operazione successiva
|
||||||
@@ -1871,22 +1958,22 @@ Public Class SplitPageUC
|
|||||||
NumberDirectionMachining(nI)
|
NumberDirectionMachining(nI)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
' -------------------- Recupero le lavorazioni indicate come attive --------------------
|
' -------------------- Recupero le lavorazioni indicate come attive -- INIZIO --------------------
|
||||||
Dim ActiveMachLst As New List(Of Integer)
|
Dim ActiveMachLst As New List(Of Integer)
|
||||||
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
||||||
ActiveMachLst.Add(ItemSplitMach.Ind)
|
If ItemSplitMach.bIsActive Then ActiveMachLst.Add(ItemSplitMach.Ind)
|
||||||
Next
|
Next
|
||||||
' -------------------- Recupero le lavorazioni indicate come attive --------------------
|
' -------------------- Recupero le lavorazioni indicate come attive -- FINE --------------------
|
||||||
|
|
||||||
' Preparo la lista degli Item
|
' Preparo la lista degli Item
|
||||||
ShowMachiningList()
|
ShowMachiningList()
|
||||||
|
|
||||||
' -------------------- Riattivo le lavorazioni precedenti --------------------
|
' -------------------- Riattivo le lavorazioni precedenti -- INIZIO --------------------
|
||||||
|
|
||||||
For Each Item As SplitMach In m_MachiningList
|
For Each Item As SplitMach In m_MachiningList
|
||||||
|
' spengo tutte le lavorazioni disponibili
|
||||||
EgtSetInfo(Item.m_nId, INFO_MCH_USER_OFF, True)
|
EgtSetInfo(Item.m_nId, INFO_MCH_USER_OFF, True)
|
||||||
Next
|
Next
|
||||||
|
' riattivo solo quelle indicate come attive
|
||||||
For nIndex As Integer = 0 To ActiveMachLst.Count - 1
|
For nIndex As Integer = 0 To ActiveMachLst.Count - 1
|
||||||
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
||||||
If ItemSplitMach.Ind = ActiveMachLst(nIndex) Then
|
If ItemSplitMach.Ind = ActiveMachLst(nIndex) Then
|
||||||
@@ -1899,7 +1986,7 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Next
|
Next
|
||||||
' -------------------- Riattivo le lavorazioni precedenti --------------------
|
' -------------------- Riattivo le lavorazioni precedenti -- FINE --------------------
|
||||||
|
|
||||||
' Aggiorno visualizzazione
|
' Aggiorno visualizzazione
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -1910,7 +1997,7 @@ Public Class SplitPageUC
|
|||||||
Private Sub SplitPageUC_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
|
Private Sub SplitPageUC_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
|
||||||
m_bActive = False
|
m_bActive = False
|
||||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
ExitSplit(Not m_bToNext)
|
ExitSplit(Not m_bToNext And Not m_bToPrev)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1929,22 +2016,7 @@ Public Class SplitPageUC
|
|||||||
EgtEnableModified()
|
EgtEnableModified()
|
||||||
' se modificato salvo ordine e stato delle lavorazioni
|
' se modificato salvo ordine e stato delle lavorazioni
|
||||||
If m_bModified Then
|
If m_bModified Then
|
||||||
' Al primo posto deve rimanere la disposizione della fase
|
SaveOrderMachinig(m_nCurrPhase)
|
||||||
Dim nFirstOperId As Integer = EgtGetPhaseDisposition(m_nCurrPhase)
|
|
||||||
For i As Integer = m_ItemList.Count() - 1 To 0 Step -1
|
|
||||||
Dim nI As Integer = m_ItemList(i).Ind
|
|
||||||
Dim nMchId As Integer = m_MachiningList(nI).m_nId
|
|
||||||
EgtRelocate(nMchId, nFirstOperId, GDB_POS.AFTER)
|
|
||||||
If m_MachiningList(nI).m_bEnabled Then
|
|
||||||
EgtSetOperationMode(m_MachiningList(nI).m_nId, True)
|
|
||||||
EgtRemoveInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF)
|
|
||||||
Else
|
|
||||||
EgtSetOperationMode(m_MachiningList(nI).m_nId, False)
|
|
||||||
EgtSetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF, True)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
' dichiaro ordine salvato
|
|
||||||
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
|
|
||||||
End If
|
End If
|
||||||
' Affondamento ridotto
|
' Affondamento ridotto
|
||||||
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
|
Dim dReducedDepth As Double = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_REDUCEDDEPTH, 1, m_MainWindow.GetMachIniFile())
|
||||||
@@ -1968,6 +2040,25 @@ Public Class SplitPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub SaveOrderMachinig(CurrPhase As Integer)
|
||||||
|
' Al primo posto deve rimanere la disposizione della fase
|
||||||
|
Dim nFirstOperId As Integer = EgtGetPhaseDisposition(CurrPhase)
|
||||||
|
For i As Integer = m_ItemList.Count() - 1 To 0 Step -1
|
||||||
|
Dim nI As Integer = m_ItemList(i).Ind
|
||||||
|
Dim nMchId As Integer = m_MachiningList(nI).m_nId
|
||||||
|
EgtRelocate(nMchId, nFirstOperId, GDB_POS.AFTER)
|
||||||
|
If m_MachiningList(nI).m_bEnabled Then
|
||||||
|
EgtSetOperationMode(m_MachiningList(nI).m_nId, True)
|
||||||
|
EgtRemoveInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF)
|
||||||
|
Else
|
||||||
|
EgtSetOperationMode(m_MachiningList(nI).m_nId, False)
|
||||||
|
EgtSetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF, True)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
' dichiaro ordine salvato
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Function GetDisabledCutsCount() As Integer
|
Friend Function GetDisabledCutsCount() As Integer
|
||||||
' Determino il numero di tagli disabilitati
|
' Determino il numero di tagli disabilitati
|
||||||
Dim nCount As Integer = 0
|
Dim nCount As Integer = 0
|
||||||
@@ -2032,7 +2123,7 @@ Public Class SplitPageUC
|
|||||||
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
|
NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() = 1)
|
||||||
' Altrimenti
|
' Altrimenti
|
||||||
Else
|
Else
|
||||||
' movimento standard sulla tavola (almeno un taglio disabilitato)
|
' movimento standard sulla tavola (almeno un taglio disabilitato allora False)
|
||||||
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
|
Dim bStdTab As Boolean = (GetDisabledCutsCount() > 0)
|
||||||
' movimento su tavola di scarico
|
' movimento su tavola di scarico
|
||||||
m_bOnAuxTab = Not bStdTab AndAlso (m_nCurrPhase = EgtGetPhaseCount() And m_bEnableOnAuxTab)
|
m_bOnAuxTab = Not bStdTab AndAlso (m_nCurrPhase = EgtGetPhaseCount() And m_bEnableOnAuxTab)
|
||||||
@@ -2093,6 +2184,35 @@ Public Class SplitPageUC
|
|||||||
|
|
||||||
End Sub
|
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()
|
||||||
|
Else
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub VerifyHomogenousMachining(ItemList As List(Of NameIdLsBxItem))
|
Private Sub VerifyHomogenousMachining(ItemList As List(Of NameIdLsBxItem))
|
||||||
If IsNothing(ItemList) OrElse ItemList.Count = 0 Then
|
If IsNothing(ItemList) OrElse ItemList.Count = 0 Then
|
||||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
@@ -2198,6 +2318,7 @@ Public Class SplitPageUC
|
|||||||
|
|
||||||
' gestione bottone per generazione ponticelli
|
' gestione bottone per generazione ponticelli
|
||||||
If Type = MCH_OY.WATERJETTING Then
|
If Type = MCH_OY.WATERJETTING Then
|
||||||
|
InvertBtn.Visibility = Visibility.Visible
|
||||||
' siccome la stessa posizione è occupata da due comandi sovrapposti
|
' siccome la stessa posizione è occupata da due comandi sovrapposti
|
||||||
If CutStartBtn.Visibility = Visibility.Hidden Then
|
If CutStartBtn.Visibility = Visibility.Hidden Then
|
||||||
BridgesWJBtn.Visibility = Visibility.Visible
|
BridgesWJBtn.Visibility = Visibility.Visible
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports System.Text.RegularExpressions
|
Imports System.Text.RegularExpressions
|
||||||
|
Imports System.Threading
|
||||||
|
|
||||||
Module VacuumCups
|
Module VacuumCups
|
||||||
' Tipo manipolatore con ventosa (0=assente, 1=dietro, 2=laterale)
|
' Tipo manipolatore con ventosa (0=assente, 1=dietro, 2=laterale)
|
||||||
@@ -31,6 +32,19 @@ Module VacuumCups
|
|||||||
' Nome del gruppo temporaneo per le ventose
|
' Nome del gruppo temporaneo per le ventose
|
||||||
Private Const VACTMP_GRP As String = "VacTmp"
|
Private Const VACTMP_GRP As String = "VacTmp"
|
||||||
|
|
||||||
|
Private m_sHeadName As String = VACUUM_HEAD
|
||||||
|
Public Sub ResetHeadName()
|
||||||
|
Dim bReload As Boolean = (m_sHeadName <> VACUUM_HEAD)
|
||||||
|
m_sHeadName = VACUUM_HEAD
|
||||||
|
If bReload Then LoadVacuumCups()
|
||||||
|
End Sub
|
||||||
|
Public Function ChangeHeadName() As Boolean
|
||||||
|
If EgtGetHeadId( VACUUM_HEAD_2) = GDB_ID.NULL Then Return False
|
||||||
|
m_sHeadName = If( m_sHeadName = VACUUM_HEAD, VACUUM_HEAD_2, VACUUM_HEAD)
|
||||||
|
LoadVacuumCups()
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
'-----------------------------------------------------------------------------------------------
|
'-----------------------------------------------------------------------------------------------
|
||||||
Friend Class RawMoveData
|
Friend Class RawMoveData
|
||||||
|
|
||||||
@@ -87,17 +101,17 @@ Module VacuumCups
|
|||||||
Friend Function LoadVacuumCups() As Boolean
|
Friend Function LoadVacuumCups() As Boolean
|
||||||
' Leggo tipo manipolatore con ventosa
|
' Leggo tipo manipolatore con ventosa
|
||||||
m_nVacType = 0
|
m_nVacType = 0
|
||||||
EgtGetInfo(EgtGetHeadId(VACUUM_HEAD), KEY_VAC_TYPE, m_nVacType)
|
EgtGetInfo(EgtGetHeadId(m_sHeadName), KEY_VAC_TYPE, m_nVacType)
|
||||||
' Cancello eventuali vecchie ventose
|
' Cancello eventuali vecchie ventose
|
||||||
RemoveVacuumCups()
|
RemoveVacuumCups()
|
||||||
' Identificativo ventose nella macchina
|
' Identificativo ventose nella macchina
|
||||||
Dim nLayId As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), VACUUM_HEAD_LAYOUT)
|
Dim nLayId As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), VACUUM_HEAD_LAYOUT)
|
||||||
If nLayId = GDB_ID.NULL Then Return False
|
If nLayId = GDB_ID.NULL Then Return False
|
||||||
' Identificativo riferimento della testa nella macchina
|
' Identificativo riferimento della testa nella macchina
|
||||||
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
|
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), HEAD_FIRST_EXIT)
|
||||||
If nT1Id = GDB_ID.NULL Then Return False
|
If nT1Id = GDB_ID.NULL Then Return False
|
||||||
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
|
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
|
||||||
EgtSetCalcTool("", "H4", 1)
|
EgtSetCalcTool("", m_sHeadName, 1)
|
||||||
' Creo gruppo temporaneo in cui copiarli
|
' Creo gruppo temporaneo in cui copiarli
|
||||||
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
|
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
If m_nTempId = GDB_ID.NULL Then Return False
|
If m_nTempId = GDB_ID.NULL Then Return False
|
||||||
@@ -152,7 +166,7 @@ Module VacuumCups
|
|||||||
Friend Function ResetVacuumCups() As Boolean
|
Friend Function ResetVacuumCups() As Boolean
|
||||||
' Ripristino posizione e rotazione originali
|
' Ripristino posizione e rotazione originali
|
||||||
Dim frOriRef As New Frame3d
|
Dim frOriRef As New Frame3d
|
||||||
EgtFrame(EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT), GDB_ID.ROOT, frOriRef)
|
EgtFrame(EgtGetFirstNameInGroup(EgtGetHeadId(m_sHeadName), HEAD_FIRST_EXIT), GDB_ID.ROOT, frOriRef)
|
||||||
Dim frCurrRef As New Frame3d
|
Dim frCurrRef As New Frame3d
|
||||||
EgtFrame(m_nRefId, GDB_ID.ROOT, frCurrRef)
|
EgtFrame(m_nRefId, GDB_ID.ROOT, frCurrRef)
|
||||||
EgtMove(m_nVacId, frOriRef.Orig() - frCurrRef.Orig(), GDB_RT.GLOB)
|
EgtMove(m_nVacId, frOriRef.Orig() - frCurrRef.Orig(), GDB_RT.GLOB)
|
||||||
@@ -207,14 +221,17 @@ Module VacuumCups
|
|||||||
EgtSurfFrGrossArea(nRKerfId, RawArea)
|
EgtSurfFrGrossArea(nRKerfId, RawArea)
|
||||||
' volume calcolato in mmc
|
' volume calcolato in mmc
|
||||||
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
|
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
|
||||||
' peso calolato in kg
|
' peso calcolato in kg
|
||||||
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
|
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
|
||||||
'-------------------- FINE CALCOLO PESO --------------------
|
'-------------------- FINE CALCOLO PESO --------------------
|
||||||
|
|
||||||
' Eseguo ricerca
|
' Eseguo ricerca
|
||||||
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
|
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
|
||||||
Return True
|
Return True
|
||||||
|
Else
|
||||||
|
If ChangeHeadName() Then Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' In caso di fallimento, provo riducendo con offset la regione di kerf
|
' In caso di fallimento, provo riducendo con offset la regione di kerf
|
||||||
' (così si simula la proiezione del centro sul MAT - medial axis transform)
|
' (così si simula la proiezione del centro sul MAT - medial axis transform)
|
||||||
Dim bOkFind As Boolean = False
|
Dim bOkFind As Boolean = False
|
||||||
@@ -250,7 +267,7 @@ Module VacuumCups
|
|||||||
nDripLineId = EgtGetNext(nDripLineId)
|
nDripLineId = EgtGetNext(nDripLineId)
|
||||||
End While
|
End While
|
||||||
Dim vtDir As New Vector3d
|
Dim vtDir As New Vector3d
|
||||||
if EgtStartVector( nDripLineId, GDB_ID.ROOT, vtDir) Then
|
If EgtStartVector(nDripLineId, GDB_ID.ROOT, vtDir) Then
|
||||||
Dim dLen, dAngV, dAngH As Double
|
Dim dLen, dAngV, dAngH As Double
|
||||||
vtDir.ToSpherical(dLen, dAngV, dAngH)
|
vtDir.ToSpherical(dLen, dAngV, dAngH)
|
||||||
Dim dOffsAng = dAngH - m_dDripRefAng
|
Dim dOffsAng = dAngH - m_dDripRefAng
|
||||||
@@ -388,7 +405,7 @@ Module VacuumCups
|
|||||||
|
|
||||||
Private Function GetVacRotAxisSteps(ByRef vAngRot As List(Of Double)) As Boolean
|
Private Function GetVacRotAxisSteps(ByRef vAngRot As List(Of Double)) As Boolean
|
||||||
' Recupero l'asse rotante della testa ventosa
|
' Recupero l'asse rotante della testa ventosa
|
||||||
Dim nRotAxId As Integer = EgtGetParent(EgtGetHeadId(VACUUM_HEAD))
|
Dim nRotAxId As Integer = EgtGetParent(EgtGetHeadId(m_sHeadName))
|
||||||
' Verifico se contiene info con STEPS
|
' Verifico se contiene info con STEPS
|
||||||
Dim sSteps As String = ""
|
Dim sSteps As String = ""
|
||||||
If Not EgtGetInfo(nRotAxId, KEY_ROTVAC_STEPS, sSteps) Then Return False
|
If Not EgtGetInfo(nRotAxId, KEY_ROTVAC_STEPS, sSteps) Then Return False
|
||||||
@@ -546,16 +563,45 @@ Module VacuumCups
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
|
' assegnate le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
|
||||||
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
|
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
|
||||||
|
Dim sAxisName As String = "C"
|
||||||
|
' verifico che il nome dell'asse impostato sia corretto
|
||||||
|
If EgtGetAxisId(sAxisName) = GDB_ID.NULL Then
|
||||||
|
If m_sHeadName = VACUUM_HEAD Then
|
||||||
|
sAxisName = "C1"
|
||||||
|
Else
|
||||||
|
sAxisName = "C2"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
' Posizione Home dell'asse rotante
|
||||||
|
Dim dCHome As Double
|
||||||
|
EgtGetAxisHomePos(sAxisName, dCHome)
|
||||||
|
' Corse dell'asse
|
||||||
|
Dim dCMin As Double
|
||||||
|
EgtGetAxisMin(sAxisName, dCMin)
|
||||||
|
Dim dCMax As Double
|
||||||
|
EgtGetAxisMax(sAxisName, dCMax)
|
||||||
|
' Porto l'angolo nel range
|
||||||
|
Dim dRotAngMachDeg As Double = dRotAngDeg + dCHome
|
||||||
|
AdjustAngleInRange(dRotAngMachDeg, dCMin, dCMax)
|
||||||
|
' Imposto la ventosa come fosse un utensile
|
||||||
|
EgtSetCalcTool("", m_sHeadName, 1)
|
||||||
|
' Calcolo gli assi macchina
|
||||||
Dim dX, dY, dZ As Double
|
Dim dX, dY, dZ As Double
|
||||||
Dim nStat As Integer
|
Dim nStat As Integer
|
||||||
Dim dCHome As Double
|
If EgtGetAxisId("A") <> GDB_ID.NULL Then
|
||||||
EgtGetAxisHomePos("C", dCHome)
|
' Asse tavola rotante (movimenti solo con A0)
|
||||||
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
|
EgtGetCalcPositions(ptRef, 0, dRotAngMachDeg, nStat, dX, dY, dZ)
|
||||||
EgtSetCalcTool("", "H4", 1)
|
' Verifico le corse
|
||||||
EgtGetCalcPositions(ptRef, dRotAngDeg + dCHome, 0, nStat, dX, dY, dZ)
|
EgtVerifyOutstroke(dX, dY, dZ, 0, dRotAngMachDeg, nStat)
|
||||||
EgtVerifyOutstroke(dX, dY, dZ, dRotAngDeg + dCHome, 0, nStat)
|
Else
|
||||||
|
EgtGetCalcPositions(ptRef, dRotAngMachDeg, 0, nStat, dX, dY, dZ)
|
||||||
|
' Verifico le corse
|
||||||
|
EgtVerifyOutstroke(dX, dY, dZ, dRotAngMachDeg, 0, nStat)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Return nStat
|
Return nStat
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,11 @@ Module ConstGen
|
|||||||
|
|
||||||
' Nome testa con ventose per spostamento pezzi
|
' Nome testa con ventose per spostamento pezzi
|
||||||
Public Const VACUUM_HEAD As String = "H4"
|
Public Const VACUUM_HEAD As String = "H4"
|
||||||
|
Public Const VACUUM_HEAD_2 As String = "H104"
|
||||||
|
' Nome teste laser
|
||||||
|
Public Const LASER_HEAD As String = "H3"
|
||||||
|
Public Const LASER_HEAD_2 As String = "H103"
|
||||||
|
|
||||||
' Info tipo ventosa
|
' Info tipo ventosa
|
||||||
Public Const KEY_VAC_TYPE As String = "VacType"
|
Public Const KEY_VAC_TYPE As String = "VacType"
|
||||||
' Nome gruppo layout in testa con ventose
|
' Nome gruppo layout in testa con ventose
|
||||||
@@ -189,6 +194,8 @@ Module ConstGen
|
|||||||
Public Const INFO_TOPRODAREA As String = "ToProdArea"
|
Public Const INFO_TOPRODAREA As String = "ToProdArea"
|
||||||
' Info per nome progetti
|
' Info per nome progetti
|
||||||
Public Const INFO_PROJNAME As String = "ProjName"
|
Public Const INFO_PROJNAME As String = "ProjName"
|
||||||
|
' Info per parcheggio asse C
|
||||||
|
Public Const INFO_CAXESHOME As String = "CAxesHome"
|
||||||
|
|
||||||
' Nome layer delle regioni
|
' Nome layer delle regioni
|
||||||
Public Const NAME_REGION As String = "Region"
|
Public Const NAME_REGION As String = "Region"
|
||||||
@@ -216,6 +223,8 @@ Module ConstGen
|
|||||||
Public Const INFO_DEPTH2 As String = "Depth2"
|
Public Const INFO_DEPTH2 As String = "Depth2"
|
||||||
Public Const INFO_AGG2 As String = "Agg2"
|
Public Const INFO_AGG2 As String = "Agg2"
|
||||||
Public Const INFO_ROUNDOFF As String = "RoundOff"
|
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
|
' Info in entità da tagliare per taglio ristretto
|
||||||
Public Const INFO_STRICT As String = "Strict"
|
Public Const INFO_STRICT As String = "Strict"
|
||||||
' Info in entità da tagliare per angolo di lato e tallone
|
' Info in entità da tagliare per angolo di lato e tallone
|
||||||
@@ -311,6 +320,8 @@ Module ConstGen
|
|||||||
Public Const INFO_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
|
Public Const INFO_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
|
||||||
' Info in OutLoop per punto inzio lavorazione WaterJet
|
' Info in OutLoop per punto inzio lavorazione WaterJet
|
||||||
Public Const INFO_START As String = "Start"
|
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
|
' Nome di pezzo che è una cornice
|
||||||
Public Const NAME_FRAME As String = "Frame"
|
Public Const NAME_FRAME As String = "Frame"
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ Module ConstIni
|
|||||||
Public Const K_DEBUG As String = "Debug"
|
Public Const K_DEBUG As String = "Debug"
|
||||||
Public Const K_LICENCE As String = "Licence"
|
Public Const K_LICENCE As String = "Licence"
|
||||||
Public Const K_NETKEY As String = "NetKey"
|
Public Const K_NETKEY As String = "NetKey"
|
||||||
|
Public Const K_LOCKID As String = "LockId"
|
||||||
Public Const K_MESSAGESDIR As String = "MessagesDir"
|
Public Const K_MESSAGESDIR As String = "MessagesDir"
|
||||||
Public Const K_MESSAGES As String = "Messages"
|
Public Const K_MESSAGES As String = "Messages"
|
||||||
Public Const K_SUPPORT As String = "Support"
|
Public Const K_SUPPORT As String = "Support"
|
||||||
@@ -52,7 +53,7 @@ Module ConstIni
|
|||||||
Public Const K_GENERATECN As String = "GenerateCN"
|
Public Const K_GENERATECN As String = "GenerateCN"
|
||||||
Public Const K_FRACTIONPATTERN As String = "FractionPattern"
|
Public Const K_FRACTIONPATTERN As String = "FractionPattern"
|
||||||
Public Const K_PRECISION As String = "Precision"
|
Public Const K_PRECISION As String = "Precision"
|
||||||
|
Public Const K_QUITDRAWPAGE As String = "QuitDrawPage"
|
||||||
|
|
||||||
Public Const S_LANGUAGES As String = "Languages"
|
Public Const S_LANGUAGES As String = "Languages"
|
||||||
Public Const K_LANGUAGE As String = "Language"
|
Public Const K_LANGUAGE As String = "Language"
|
||||||
@@ -116,6 +117,8 @@ Module ConstIni
|
|||||||
Public Const K_LASTCOLOR As String = "LastColor"
|
Public Const K_LASTCOLOR As String = "LastColor"
|
||||||
Public Const K_COLOR As String = "Color"
|
Public Const K_COLOR As String = "Color"
|
||||||
|
|
||||||
|
Public Const S_FRAMECOMPO As String = "FrameCompo"
|
||||||
|
|
||||||
Public Const S_EXTCOMPO As String = "Compo"
|
Public Const S_EXTCOMPO As String = "Compo"
|
||||||
|
|
||||||
Public Const S_INTCOMPO As String = "InternalCompo"
|
Public Const S_INTCOMPO As String = "InternalCompo"
|
||||||
@@ -204,6 +207,7 @@ Module ConstIni
|
|||||||
Public Const K_OFFSZ As String = "OffsZ"
|
Public Const K_OFFSZ As String = "OffsZ"
|
||||||
Public Const K_OFFSXY As String = "OffsXY"
|
Public Const K_OFFSXY As String = "OffsXY"
|
||||||
Public Const K_OFFSYY As String = "OffsYY"
|
Public Const K_OFFSYY As String = "OffsYY"
|
||||||
|
Public Const K_OFFSXINTERY As String = "OffsYInterY"
|
||||||
Public Const K_STARTTRIM As String = "StartTrim"
|
Public Const K_STARTTRIM As String = "StartTrim"
|
||||||
Public Const K_ENDTRIM As String = "EndTrim"
|
Public Const K_ENDTRIM As String = "EndTrim"
|
||||||
Public Const K_OTHERSIDE As String = "OtherSide"
|
Public Const K_OTHERSIDE As String = "OtherSide"
|
||||||
@@ -223,6 +227,12 @@ Module ConstIni
|
|||||||
Public Const K_RAWOFFSX As String = "OffsX"
|
Public Const K_RAWOFFSX As String = "OffsX"
|
||||||
Public Const K_RAWOFFSY As String = "OffsY"
|
Public Const K_RAWOFFSY As String = "OffsY"
|
||||||
Public Const K_RAWKERF As String = "Kerf"
|
Public Const K_RAWKERF As String = "Kerf"
|
||||||
|
Public Const K_ENABLEOTHERREFTAB As String = "EnableOtherRefTab"
|
||||||
|
Public Const K_OTHERREFTAB As String = "OtherRefTab"
|
||||||
|
Public Const K_OTHERREFTABX As String = "OtherRefTabX"
|
||||||
|
Public Const K_OTHERREFTABY As String = "OtherRefTabY"
|
||||||
|
Public Const K_OTHERREFTABPOS As String = "OtherRefTabPos"
|
||||||
|
|
||||||
|
|
||||||
Public Const S_RAWMOVE As String = "RawMove"
|
Public Const S_RAWMOVE As String = "RawMove"
|
||||||
Public Const K_RAWSTEP As String = "Step"
|
Public Const K_RAWSTEP As String = "Step"
|
||||||
@@ -277,6 +287,8 @@ Module ConstIni
|
|||||||
Public Const S_VEINMATCHING As String = "VeinMatching"
|
Public Const S_VEINMATCHING As String = "VeinMatching"
|
||||||
Public Const K_VEINMA_ENABLE As String = "Enable"
|
Public Const K_VEINMA_ENABLE As String = "Enable"
|
||||||
Public Const K_VEINMA_PLACE As String = "WinPlace"
|
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 S_FASTGRID As String = "FastGrid"
|
||||||
Public Const K_FG_ENABLE As String = "FGEnable"
|
Public Const K_FG_ENABLE As String = "FGEnable"
|
||||||
@@ -323,6 +335,7 @@ Module ConstIni
|
|||||||
Public Const K_DC_FLATT_HEADSIDE As String = "FlattHeadSide"
|
Public Const K_DC_FLATT_HEADSIDE As String = "FlattHeadSide"
|
||||||
Public Const K_DC_FLATT_MACHTYPE As String = "FlattMachType"
|
Public Const K_DC_FLATT_MACHTYPE As String = "FlattMachType"
|
||||||
Public Const K_DC_FLATT_ROTLOCK As String = "FlattRotLock"
|
Public Const K_DC_FLATT_ROTLOCK As String = "FlattRotLock"
|
||||||
|
Public Const K_DC_FLAT_CHAINEDPATH As String = "ChainedPath"
|
||||||
Public Const K_DC_FLATT_POSX As String = "FlattPosX"
|
Public Const K_DC_FLATT_POSX As String = "FlattPosX"
|
||||||
Public Const K_DC_FLATT_POSY As String = "FlattPosY"
|
Public Const K_DC_FLATT_POSY As String = "FlattPosY"
|
||||||
Public Const K_DC_POLISH_NAME As String = "PolishName"
|
Public Const K_DC_POLISH_NAME As String = "PolishName"
|
||||||
@@ -332,6 +345,7 @@ Module ConstIni
|
|||||||
Public Const K_DC_TEST_OFFSET As String = "TestOffset"
|
Public Const K_DC_TEST_OFFSET As String = "TestOffset"
|
||||||
Public Const K_DC_OFFSET_SQUARING As String = "OffsetSquaring"
|
Public Const K_DC_OFFSET_SQUARING As String = "OffsetSquaring"
|
||||||
Public Const K_DC_EXTRA_LEN_SQUARING As String = "ExtraLenSquaring"
|
Public Const K_DC_EXTRA_LEN_SQUARING As String = "ExtraLenSquaring"
|
||||||
|
Public Const K_ENABLEINVERT As String = "EnableInvert"
|
||||||
|
|
||||||
Public Const S_STATDATA As String = "StatData"
|
Public Const S_STATDATA As String = "StatData"
|
||||||
Public Const K_SD_DAY As String = "Day"
|
Public Const K_SD_DAY As String = "Day"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
Public Const S_PARTPROGRAM As String = "PartProgram"
|
Public Const S_PARTPROGRAM As String = "PartProgram"
|
||||||
Public Const K_EXTENSION As String = "Extension"
|
Public Const K_EXTENSION As String = "Extension"
|
||||||
|
Public Const K_EXTFILECN As String = "ExtFileCN"
|
||||||
|
|
||||||
Public Const S_AXES As String = "Axes"
|
Public Const S_AXES As String = "Axes"
|
||||||
Public Const K_AXESNUM As String = "AxesNum"
|
Public Const K_AXESNUM As String = "AxesNum"
|
||||||
@@ -46,9 +47,20 @@
|
|||||||
Public Const K_THREADSLEEP As String = "ThreadSleep"
|
Public Const K_THREADSLEEP As String = "ThreadSleep"
|
||||||
Public Const K_PHOTODELEY As String = "PhotoDeley"
|
Public Const K_PHOTODELEY As String = "PhotoDeley"
|
||||||
|
|
||||||
|
Public Const S_NCFANUC As String = "NcFanuc"
|
||||||
|
Public Const K_SETNCMODE As String = "SetNcMode"
|
||||||
|
Public Const K_BASEADDRINT As String = "BaseAddrInt"
|
||||||
|
Public Const K_BASEADDRBIT As String = "BaseAddrBit"
|
||||||
|
Public Const K_NUMVARINT As String = "NumVarInt"
|
||||||
|
Public Const K_NUMVARBIT As String = "NumVarBit"
|
||||||
|
|
||||||
Public Const S_EXECLUA As String = "ExecLua"
|
Public Const S_EXECLUA As String = "ExecLua"
|
||||||
Public Const K_FILESCRIPT_LUA As String = "FileScript"
|
Public Const K_FILESCRIPT_LUA As String = "FileScript"
|
||||||
|
|
||||||
|
Public Const S_CAMERAHQ As String = "CameraHQ"
|
||||||
|
Public Const K_CAMERAHQ_ENABLE As String = "EnableHQ"
|
||||||
|
Public Const K_CAMERAHQ_ACTIVATE As String = "ActivateHQ"
|
||||||
|
|
||||||
Public Const S_NCDATA As String = "NcData"
|
Public Const S_NCDATA As String = "NcData"
|
||||||
Public Const K_NEWVARIABLE As String = "NewVariable"
|
Public Const K_NEWVARIABLE As String = "NewVariable"
|
||||||
Public Const K_NEWCONSOLE As String = "NewConsole"
|
Public Const K_NEWCONSOLE As String = "NewConsole"
|
||||||
@@ -78,12 +90,16 @@
|
|||||||
Public Const K_TABLEDOWN As String = "TableDown"
|
Public Const K_TABLEDOWN As String = "TableDown"
|
||||||
Public Const K_MANUAL As String = "Manual"
|
Public Const K_MANUAL As String = "Manual"
|
||||||
Public Const K_DOORCLOSED As String = "DoorClosed"
|
Public Const K_DOORCLOSED As String = "DoorClosed"
|
||||||
|
Public Const K_DOOROPENDED As String = "DoorOpened"
|
||||||
Public Const K_LIMITZ As String = "LimitZ"
|
Public Const K_LIMITZ As String = "LimitZ"
|
||||||
Public Const K_POWEROVR As String = "PowerOvr"
|
Public Const K_POWEROVR As String = "PowerOvr"
|
||||||
Public Const K_PARKING As String = "Parking"
|
Public Const K_PARKING As String = "Parking"
|
||||||
Public Const K_ENABLEZONE As String = "EnableZone"
|
Public Const K_ENABLEZONE As String = "EnableZone"
|
||||||
Public Const K_ENABLEPC As String = "EnablePC"
|
Public Const K_ENABLEPC As String = "EnablePC"
|
||||||
Public Const K_HSM As String = "Hsm"
|
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_VACUUMUP As String = "VacuumUp"
|
||||||
Public Const K_VACUUMDOWN As String = "VacuumDown"
|
Public Const K_VACUUMDOWN As String = "VacuumDown"
|
||||||
Public Const K_VACUUM2UP As String = "Vacuum2Up"
|
Public Const K_VACUUM2UP As String = "Vacuum2Up"
|
||||||
@@ -112,6 +128,8 @@
|
|||||||
Public Const K_FEEDHOLD As String = "FeedHold"
|
Public Const K_FEEDHOLD As String = "FeedHold"
|
||||||
Public Const K_SPOTLIGHT1 As String = "SpotLight1"
|
Public Const K_SPOTLIGHT1 As String = "SpotLight1"
|
||||||
Public Const K_SPOTLIGHT2 As String = "SpotLight2"
|
Public Const K_SPOTLIGHT2 As String = "SpotLight2"
|
||||||
|
Public Const K_NAXES As String = "nAxes"
|
||||||
|
Public Const K_RESETSTATUS As String = "ResetStatus"
|
||||||
' Nuove variabili
|
' Nuove variabili
|
||||||
Public Const K_SPEEDHOLD As String = "SpeedHold"
|
Public Const K_SPEEDHOLD As String = "SpeedHold"
|
||||||
Public Const K_XYJOG As String = "XYJog"
|
Public Const K_XYJOG As String = "XYJog"
|
||||||
@@ -142,6 +160,10 @@
|
|||||||
Public Const K_PRODLIPROBINGTCPOS2VAR As String = "ProbingTcPos2Var"
|
Public Const K_PRODLIPROBINGTCPOS2VAR As String = "ProbingTcPos2Var"
|
||||||
Public Const K_PRODLISAWDIAMETER2VAR As String = "SawDiameter2Var"
|
Public Const K_PRODLISAWDIAMETER2VAR As String = "SawDiameter2Var"
|
||||||
|
|
||||||
|
Public Const S_POLISHLINE As String = "PolishLine"
|
||||||
|
Public Const K_CLICKSTATE As String = "ClickState"
|
||||||
|
Public Const k_CLICKDIR As String = "ClickDir"
|
||||||
|
|
||||||
Public Const S_STATISTICS As String = "Stats"
|
Public Const S_STATISTICS As String = "Stats"
|
||||||
Public Const K_DATADIR As String = "DataDir"
|
Public Const K_DATADIR As String = "DataDir"
|
||||||
Public Const K_SHOWAREAS As String = "ShowAreas"
|
Public Const K_SHOWAREAS As String = "ShowAreas"
|
||||||
@@ -158,6 +180,8 @@
|
|||||||
Public Const K_PHOTO_OFFSETY As String = "OffsetY"
|
Public Const K_PHOTO_OFFSETY As String = "OffsetY"
|
||||||
Public Const K_PHOTO_TAB2_OFFSETX As String = "Tab2OffsetX"
|
Public Const K_PHOTO_TAB2_OFFSETX As String = "Tab2OffsetX"
|
||||||
Public Const K_PHOTO_TAB2_OFFSETY As String = "Tab2OffsetY"
|
Public Const K_PHOTO_TAB2_OFFSETY As String = "Tab2OffsetY"
|
||||||
|
Public Const K_PHOTO_HQ_OFFSETX As String = "HQOffsetX"
|
||||||
|
Public Const K_PHOTO_HQ_OFFSETY As String = "HQOffsetY"
|
||||||
|
|
||||||
Public Const S_TOOLS As String = "Tools"
|
Public Const S_TOOLS As String = "Tools"
|
||||||
Public Const K_DRILLBIT As String = "Drillbit"
|
Public Const K_DRILLBIT As String = "Drillbit"
|
||||||
@@ -207,6 +231,7 @@
|
|||||||
Public Const K_MACH_MILLING_ON_SINKS As String = "MillingOnSinks"
|
Public Const K_MACH_MILLING_ON_SINKS As String = "MillingOnSinks"
|
||||||
Public Const K_MACH_MILLING_SHORTENING As String = "MillingShortening"
|
Public Const K_MACH_MILLING_SHORTENING As String = "MillingShortening"
|
||||||
Public Const K_MACH_ENGRAVING_WITHMILL As String = "EngravingWithMill"
|
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_DEPTH As String = "EngravingDepth"
|
||||||
Public Const K_MACH_ENGRAVING_WIDTH As String = "EngravingWidth"
|
Public Const K_MACH_ENGRAVING_WIDTH As String = "EngravingWidth"
|
||||||
Public Const K_MACH_NEST_ALIGNED As String = "Aligned"
|
Public Const K_MACH_NEST_ALIGNED As String = "Aligned"
|
||||||
@@ -223,7 +248,8 @@
|
|||||||
Public Const K_HOLES_OFFSETWJ As String = "HolesOffsetWJ"
|
Public Const K_HOLES_OFFSETWJ As String = "HolesOffsetWJ"
|
||||||
Public Const K_MIN_RADIUSWJ As String = "MinRadiusWJ"
|
Public Const K_MIN_RADIUSWJ As String = "MinRadiusWJ"
|
||||||
Public Const K_MACH_DRILLINGWJ_ON_CORNERS As String = "DrillingWJOnCorners"
|
Public Const K_MACH_DRILLINGWJ_ON_CORNERS As String = "DrillingWJOnCorners"
|
||||||
' DrillMillC90
|
Public Const K_MACH_RECTIFICATION_ON_SUBSQUARE As String = "RectificationSubSqWJ"
|
||||||
|
Public Const K_MACH_DRILL_MILL_C90 As String = "DrillMillC90"
|
||||||
' CutLongDxSx
|
' CutLongDxSx
|
||||||
' AngRotMultiCut
|
' AngRotMultiCut
|
||||||
' MinDistHeadsMultiCut
|
' MinDistHeadsMultiCut
|
||||||
@@ -270,6 +296,7 @@
|
|||||||
Public Const S_MACH_PROBING As String = "Probing"
|
Public Const S_MACH_PROBING As String = "Probing"
|
||||||
Public Const K_PROBINGSTATEVAR As String = "ProbingStateVar"
|
Public Const K_PROBINGSTATEVAR As String = "ProbingStateVar"
|
||||||
Public Const K_SAWDIAMETER As String = "SawDiameter"
|
Public Const K_SAWDIAMETER As String = "SawDiameter"
|
||||||
|
Public Const K_TOOLLENGTH As String = "ToolLength"
|
||||||
Public Const K_RAWTHICKNESS As String = "RawThickness"
|
Public Const K_RAWTHICKNESS As String = "RawThickness"
|
||||||
Public Const K_ENABLERAWPROBE As String = "EnableRawProbe"
|
Public Const K_ENABLERAWPROBE As String = "EnableRawProbe"
|
||||||
|
|
||||||
|
|||||||
@@ -140,8 +140,11 @@ Public Class ControlsDirectCutUC
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If m_MainWindow.m_DirectCutPageUC.m_ActiveControl <> DirectCutPageUC.Controls.MachineButtonUC Or
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_ActiveControl <> DirectCutPageUC.Controls.VacuumButtonUC Then
|
||||||
' Caso standard
|
' Caso standard
|
||||||
m_ActiveDirectCutPage = DirectCutPages.DirectCut
|
m_ActiveDirectCutPage = DirectCutPages.DirectCut
|
||||||
|
End If
|
||||||
|
|
||||||
' Attivo le lavorazioni solo se esiste il grezzo e se presente testa H1
|
' Attivo le lavorazioni solo se esiste il grezzo e se presente testa H1
|
||||||
Dim bRawOk As Boolean = (GetRawHeight() > EPS_SMALL)
|
Dim bRawOk As Boolean = (GetRawHeight() > EPS_SMALL)
|
||||||
@@ -180,6 +183,9 @@ Public Class ControlsDirectCutUC
|
|||||||
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
||||||
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
||||||
End If
|
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_SingleCut.SetEnableParam(bSaw)
|
||||||
m_MultipleCut.SetEnableParam(bSaw)
|
m_MultipleCut.SetEnableParam(bSaw)
|
||||||
m_GridCut.SetEnableParam(bSaw)
|
m_GridCut.SetEnableParam(bSaw)
|
||||||
|
|||||||
@@ -99,6 +99,9 @@ Public Class ControlsDirectCutUC1
|
|||||||
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
||||||
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
||||||
End If
|
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_SingleCut.SetEnableParam(bSaw)
|
||||||
'm_MultipleCut.SetEnableParam(bSaw)
|
'm_MultipleCut.SetEnableParam(bSaw)
|
||||||
'm_GridCut.SetEnableParam(bSaw)
|
'm_GridCut.SetEnableParam(bSaw)
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ Public Class ControlsMachineButtonUC
|
|||||||
Friend m_CN As CN_generico
|
Friend m_CN As CN_generico
|
||||||
Private m_bFirst As Boolean = True
|
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
|
' Creazione converter da String a ImageSource
|
||||||
Dim ImageConverter As New ImageSourceConverter
|
Dim ImageConverter As New ImageSourceConverter
|
||||||
|
|
||||||
@@ -72,10 +75,37 @@ Public Class ControlsMachineButtonUC
|
|||||||
If Not IsNothing(ButtonToAdd) Then m_ButtonList.Add(ButtonToAdd)
|
If Not IsNothing(ButtonToAdd) Then m_ButtonList.Add(ButtonToAdd)
|
||||||
End If
|
End If
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
For Each MachineButton As MachineButton In m_ButtonList
|
||||||
|
GetTypeButton(MachineButton)
|
||||||
|
Next
|
||||||
|
m_OutLogTypeButton = False
|
||||||
|
|
||||||
NotifyPropertyChanged("ButtonList")
|
NotifyPropertyChanged("ButtonList")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
#Region "STATE CHANGED"
|
||||||
|
' ------------------------------------------------------------------------------
|
||||||
|
' 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)
|
Friend Sub SpindleStateChanged(SpindleState As Boolean)
|
||||||
Dim SpindleButton As TwoStateButton = Nothing
|
Dim SpindleButton As TwoStateButton = Nothing
|
||||||
For Each MachineButton As MachineButton In m_ButtonList
|
For Each MachineButton As MachineButton In m_ButtonList
|
||||||
@@ -255,38 +285,34 @@ Public Class ControlsMachineButtonUC
|
|||||||
Dim DoorOpenedButton As ThreeStateButton = Nothing
|
Dim DoorOpenedButton As ThreeStateButton = Nothing
|
||||||
For Each MachineButton As MachineButton In m_ButtonList
|
For Each MachineButton As MachineButton In m_ButtonList
|
||||||
If MachineButton.StateFlag = K_DOORCLOSED Then
|
If MachineButton.StateFlag = K_DOORCLOSED Then
|
||||||
'If TypeOf MachineButton Is NoStateButton Then
|
|
||||||
' DoorClosedButton = DirectCast(MachineButton, NoStateButton)
|
|
||||||
'ElseIf TypeOf MachineButton Is TwoStateButton Then
|
|
||||||
' DoorClosedButton = DirectCast(MachineButton, TwoStateButton)
|
|
||||||
'ElseIf TypeOf MachineButton Is ThreeStateButton Then
|
|
||||||
' DoorClosedButton = DirectCast(MachineButton, ThreeStateButton)
|
|
||||||
'ElseIf TypeOf MachineButton Is DoubleCommandButton Then
|
|
||||||
' DoorClosedButton = DirectCast(MachineButton, DoubleCommandButton)
|
|
||||||
'ElseIf TypeOf MachineButton Is PressedCommandButton Then
|
|
||||||
' DoorClosedButton = DirectCast(MachineButton, PressedCommandButton)
|
|
||||||
'End If
|
|
||||||
DoorClosedButton = MachineButton
|
DoorClosedButton = MachineButton
|
||||||
End If
|
End If
|
||||||
If MachineButton.StateFlag = "DoorOpened" Then
|
If MachineButton.StateFlag = K_DOOROPENDED Then
|
||||||
DoorOpenedButton = MachineButton
|
DoorOpenedButton = MachineButton
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
' Chiusura porte (gesrtione comando Three/Two state
|
||||||
If Not IsNothing(DoorClosedButton) Then
|
If Not IsNothing(DoorClosedButton) Then
|
||||||
Select Case DoorClosedState
|
Select Case DoorClosedState
|
||||||
Case 0
|
Case 0
|
||||||
|
' porta aperta
|
||||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
|
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_Red")
|
||||||
Case 1, 2
|
Case 1, 2
|
||||||
|
' porta in movimento/aperta
|
||||||
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
DoorClosedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
|
' Chiusura porte (gesrtione comando Three/Two state
|
||||||
If Not IsNothing(DoorOpenedButton) Then
|
If Not IsNothing(DoorOpenedButton) Then
|
||||||
Select Case DoorClosedState
|
Select Case DoorClosedState
|
||||||
Case 0
|
Case 0
|
||||||
|
' porta aperta
|
||||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_LightGray")
|
||||||
Case 1
|
Case 1
|
||||||
|
' porta in movimento
|
||||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Yellow")
|
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Yellow")
|
||||||
Case 2
|
Case 2
|
||||||
|
' porta chiusa
|
||||||
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Green")
|
DoorOpenedButton.Background = Application.Current.FindResource("OmagCut_Green")
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
@@ -343,35 +369,64 @@ Public Class ControlsMachineButtonUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub ZoneStateChanged(ZoneState As Integer)
|
Friend Sub ZoneStateChanged(ZoneState As Integer)
|
||||||
'Dim sFlag As String = String.Empty
|
Dim bEnableZone1 As Boolean = False
|
||||||
'If ZoneState = 1 Then
|
If ZoneState = 1 Then
|
||||||
' sFlag = BTN_ENABLE_ZONE_1
|
bEnableZone1 = True
|
||||||
'ElseIf ZoneState = 2 Then
|
ElseIf ZoneState = 2 Then
|
||||||
' sFlag = BTN_ENABLE_ZONE_2
|
bEnableZone1 = False
|
||||||
'End If
|
End If
|
||||||
'Dim EnableZoneButton As TwoStateButton = Nothing
|
' attivo il comando associato
|
||||||
'For Each MachineButton As MachineButton In m_ButtonList
|
Dim EnableZoneButton As TwoStateButton = Nothing
|
||||||
' If MachineButton.StateFlag = K_ENABLEZONE Then
|
For Each MachineButton As MachineButton In m_ButtonList
|
||||||
' EnableZoneButton = MachineButton
|
If MachineButton.StateFlag = BTN_ENABLE_ZONE_1 Then
|
||||||
' End If
|
EnableZoneButton = MachineButton
|
||||||
'Next
|
End If
|
||||||
'If Not IsNothing(EnableZoneButton) Then
|
Next
|
||||||
' EnableZoneButton.SetIsChecked(EnableZone)
|
If Not IsNothing(EnableZoneButton) Then
|
||||||
'End If
|
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
|
End Sub
|
||||||
|
|
||||||
Friend Sub PcStateChanged(EnablePC As Boolean)
|
Friend Sub PcStateChanged(EnablePC As Integer)
|
||||||
'Dim EnablePCButton As TwoStateButton = Nothing
|
Dim bEnablePC1 As Boolean = False
|
||||||
'For Each MachineButton As MachineButton In m_ButtonList
|
If EnablePC = 1 Then
|
||||||
' If MachineButton.StateFlag = K_ENABLEPC Then
|
bEnablePC1 = True
|
||||||
' EnablePCButton = MachineButton
|
ElseIf EnablePC = 2 Then
|
||||||
' End If
|
bEnablePC1 = False
|
||||||
'Next
|
End If
|
||||||
'If Not IsNothing(EnablePCButton) Then
|
' attivo/disattivo il comando associato
|
||||||
' EnablePCButton.SetIsChecked(EnablePC)
|
Dim EnablePCButton As TwoStateButton = Nothing
|
||||||
'End If
|
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 Sub
|
||||||
|
|
||||||
|
#End Region ' State Range
|
||||||
|
|
||||||
Public Function GetPrivateProfileMachineButtons(
|
Public Function GetPrivateProfileMachineButtons(
|
||||||
ByVal lpAppName As String,
|
ByVal lpAppName As String,
|
||||||
@@ -569,13 +624,64 @@ Public MustInherit Class MachineButton
|
|||||||
EgtOutLog("dopo scrittura seconda variabile")
|
EgtOutLog("dopo scrittura seconda variabile")
|
||||||
End If
|
End If
|
||||||
Return
|
Return
|
||||||
|
Case 4
|
||||||
|
' ------------------------------------ FANUC ------------------------------------
|
||||||
|
' eventuale scrittura di linea di comando MDI
|
||||||
|
If Not String.IsNullOrEmpty(CmdString) Then
|
||||||
|
' attivo mpdalità MDI
|
||||||
|
m_CN.DGeneralFunctions_WriteCncMode(2)
|
||||||
|
System.Threading.Thread.Sleep(100)
|
||||||
|
' salvo la stringa di comando ricevuta dal file lua
|
||||||
|
m_CN.sz_ManualDataInput = CmdString
|
||||||
|
' esguo la funzione che ha il compito di scrivere il comando MDI
|
||||||
|
m_CN.MDI_command()
|
||||||
|
End If
|
||||||
|
' attivo modalità AUTO
|
||||||
|
m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||||
|
System.Threading.Thread.Sleep(100)
|
||||||
|
If String.IsNullOrEmpty(EValue) Then
|
||||||
|
' EActive: impulsivo "D#####"
|
||||||
|
m_CN.NC_pulse_bit(ENumber)
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber)
|
||||||
|
Else
|
||||||
|
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||||
|
If ENumber.Contains(".") Then
|
||||||
|
' D#####.#
|
||||||
|
Dim bEValue As Boolean
|
||||||
|
If EValue.Trim = "1" Then bEValue = True
|
||||||
|
m_CN.NC_write_var_bit(ENumber, CBool(EValue))
|
||||||
|
Else
|
||||||
|
' D#####
|
||||||
|
m_CN.NC_write_var_short(ENumber, CShort(EValue))
|
||||||
|
End If
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber & " DValue= " & EValue)
|
||||||
|
End If
|
||||||
|
' eventale caricamento seconda variabile
|
||||||
|
If String.IsNullOrEmpty(EValue2) Then
|
||||||
|
' EActive: impulsivo "D#####"
|
||||||
|
m_CN.NC_pulse_bit(ENumber2)
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber2)
|
||||||
|
Else
|
||||||
|
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||||
|
If ENumber2.Contains(".") Then
|
||||||
|
' D#####.#
|
||||||
|
Dim bEValue2 As Boolean
|
||||||
|
If EValue2.Trim = "1" Then bEValue2 = True
|
||||||
|
m_CN.NC_write_var_bit(ENumber2, CBool(EValue2))
|
||||||
|
Else
|
||||||
|
' D#####
|
||||||
|
m_CN.NC_write_var_short(ENumber2, CShort(EValue2))
|
||||||
|
End If
|
||||||
|
EgtOutLog("Fanuc_DNumber2= " & ENumber2 & " DValue2= " & EValue2)
|
||||||
|
End If
|
||||||
|
Return
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
'--------------------------------------------------------- MDI ---------------------------------------------------------
|
'--------------------------------------------------------- MDI ---------------------------------------------------------
|
||||||
Dim nResult As Short
|
Dim nResult As Short
|
||||||
' assegno la modalità di funzionamento
|
' assegno la modalità di funzionamento
|
||||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||||
Case 1, 2
|
Case 1, 2, 4
|
||||||
nResult = m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI per controlli num
|
nResult = m_CN.DGeneralFunctions_WriteCncMode(2) ' Modalità MDI per controlli num
|
||||||
Case 3
|
Case 3
|
||||||
'Per il siemens non devo fare nulla
|
'Per il siemens non devo fare nulla
|
||||||
@@ -599,7 +705,7 @@ Public MustInherit Class MachineButton
|
|||||||
m_CN.DGeneralFunctions_CycleStart()
|
m_CN.DGeneralFunctions_CycleStart()
|
||||||
End If
|
End If
|
||||||
System.Threading.Thread.Sleep(300)
|
System.Threading.Thread.Sleep(300)
|
||||||
' riprostino la modalità manuale
|
' ripristino la modalità manuale..?? siucuri ??
|
||||||
nResult = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
nResult = m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -620,6 +726,7 @@ Public MustInherit Class MachineButton
|
|||||||
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
|
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
|
||||||
End If
|
End If
|
||||||
EgtLuaSetGlobNumVar("CMD.F", dFeed)
|
EgtLuaSetGlobNumVar("CMD.F", dFeed)
|
||||||
|
|
||||||
Dim dSpeed As Double = 0
|
Dim dSpeed As Double = 0
|
||||||
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text) Then
|
If Not String.IsNullOrWhiteSpace(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text) Then
|
||||||
StringToDouble(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text, dSpeed)
|
StringToDouble(m_DirectCutPage.m_ManualAxesMove.SpeedTxBx.Text, dSpeed)
|
||||||
@@ -628,6 +735,18 @@ Public MustInherit Class MachineButton
|
|||||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||||
End If
|
End If
|
||||||
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
||||||
|
|
||||||
|
' versione 2.5e1
|
||||||
|
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||||
|
Dim sToolPos As String = String.Empty
|
||||||
|
If EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) Then
|
||||||
|
EgtLuaGetGlobStringVar("CMD.TCPOS", sToolPos)
|
||||||
|
End If
|
||||||
|
Dim dToolDiam As Double = 0
|
||||||
|
If EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam) Then
|
||||||
|
EgtLuaSetGlobNumVar("CMD.DIAM", dToolDiam * 1000)
|
||||||
|
End If
|
||||||
|
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||||
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
||||||
@@ -636,8 +755,17 @@ Public MustInherit Class MachineButton
|
|||||||
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
||||||
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
||||||
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
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")
|
EgtLuaCallFunction("CmdString")
|
||||||
' Leggo variabili
|
|
||||||
|
' Leggo variabili da file Lua
|
||||||
CmdString = String.Empty
|
CmdString = String.Empty
|
||||||
EgtLuaGetGlobStringVar("CMD.CMDSTRING", CmdString)
|
EgtLuaGetGlobStringVar("CMD.CMDSTRING", CmdString)
|
||||||
b2Start = False
|
b2Start = False
|
||||||
@@ -694,11 +822,26 @@ Public Class TwoStateButton
|
|||||||
Set(value As Boolean)
|
Set(value As Boolean)
|
||||||
' accendo il comando, anche se dovrei aspettare di leggere lo stato da PLC
|
' accendo il comando, anche se dovrei aspettare di leggere lo stato da PLC
|
||||||
m_IsChecked = value
|
m_IsChecked = value
|
||||||
|
Dim sLuaScriptFile As String = m_MainWindow.m_CurrentMachine.sMachDir & "\DirectCmd\"
|
||||||
If value Then
|
If value Then
|
||||||
|
sLuaScriptFile &= TLuaScriptName
|
||||||
ExecuteMDICommand(TLuaScriptName)
|
ExecuteMDICommand(TLuaScriptName)
|
||||||
Else
|
Else
|
||||||
|
sLuaScriptFile &= FLuaScriptName
|
||||||
ExecuteMDICommand(FLuaScriptName)
|
ExecuteMDICommand(FLuaScriptName)
|
||||||
End If
|
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 Set
|
||||||
End Property
|
End Property
|
||||||
Friend Sub SetIsChecked(value As Boolean)
|
Friend Sub SetIsChecked(value As Boolean)
|
||||||
@@ -789,6 +932,7 @@ Public Class NoStateButton
|
|||||||
ExecuteMDICommand(TLuaScriptName)
|
ExecuteMDICommand(TLuaScriptName)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
' FANUC, SIEMENS
|
||||||
ExecuteMDICommand(TLuaScriptName)
|
ExecuteMDICommand(TLuaScriptName)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -166,6 +166,15 @@ Public Class CopyTemplateUC
|
|||||||
Private Sub Point1Btn_Click(sender As Object, e As RoutedEventArgs) Handles Point1Btn.Click
|
Private Sub Point1Btn_Click(sender As Object, e As RoutedEventArgs) Handles Point1Btn.Click
|
||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bTabOk Then Return
|
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
|
' Se acquisizione lama o laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
@@ -173,14 +182,19 @@ Public Class CopyTemplateUC
|
|||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then
|
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' Ricavo dati lama corrente
|
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
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
|
' Se punto da laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Ora imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||||
' Altrimenti da lama
|
' Altrimenti da lama
|
||||||
@@ -188,7 +202,7 @@ Public Class CopyTemplateUC
|
|||||||
' Imposto la lama corrente
|
' Imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Porto il tip nell'origine tavola
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
@@ -196,8 +210,6 @@ Public Class CopyTemplateUC
|
|||||||
Else
|
Else
|
||||||
' Verifico presenza punto da mouse
|
' Verifico presenza punto da mouse
|
||||||
If Not m_bMouseOk Then Return
|
If Not m_bMouseOk Then Return
|
||||||
' Ricavo dati lama corrente
|
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
|
||||||
' Imposto la lama corrente
|
' Imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||||
' Assegno punto selezionato nel disegno a m_ptTipP1
|
' Assegno punto selezionato nel disegno a m_ptTipP1
|
||||||
|
|||||||
@@ -219,7 +219,10 @@
|
|||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="4*"/>
|
<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>
|
</Grid.ColumnDefinitions>
|
||||||
@@ -264,8 +267,10 @@
|
|||||||
<Image Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
<Image Source="{DynamicResource ParkingImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--Comando Manula/MDI-->
|
<!--Comando Manula/MDI-->
|
||||||
<Button Name="ManualModeBtn" Grid.Column="8"
|
<Button Name="ManualModeBtn" Grid.Column="11"
|
||||||
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
<Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
<Image Source="{DynamicResource ManualImg}" Style="{StaticResource OmagCut_ScaleButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Public Class DirectCutPageUC
|
|||||||
|
|
||||||
'Posizionemento nella griglia delle Page UserControl
|
'Posizionemento nella griglia delle Page UserControl
|
||||||
m_MachineButtons.SetValue(Grid.RowProperty, 2)
|
m_MachineButtons.SetValue(Grid.RowProperty, 2)
|
||||||
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, 7)
|
m_MachineButtons.SetValue(Grid.ColumnSpanProperty, m_MachineButtons.nCountButton)
|
||||||
m_ManualAxesMove.SetValue(Grid.RowProperty, 1)
|
m_ManualAxesMove.SetValue(Grid.RowProperty, 1)
|
||||||
|
|
||||||
m_ControlsDirectCutUC.SetValue(Grid.RowProperty, 1)
|
m_ControlsDirectCutUC.SetValue(Grid.RowProperty, 1)
|
||||||
@@ -64,12 +64,18 @@ Public Class DirectCutPageUC
|
|||||||
' verifico che sia presente almeno uno dei bottoni della nuova console (SOLO PER MACCHINA CON paragrafo [ControlMachButtons])
|
' verifico che sia presente almeno uno dei bottoni della nuova console (SOLO PER MACCHINA CON paragrafo [ControlMachButtons])
|
||||||
Dim bCollapsedNewBottonsConsole As Boolean = Not m_ControlsMachineButton.GetPrivateProfileMachineButtons("JogButtons", "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
Dim bCollapsedNewBottonsConsole As Boolean = Not m_ControlsMachineButton.GetPrivateProfileMachineButtons("JogButtons", "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
||||||
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
||||||
|
' verifico che sia presente almeno uno dei bottoni della nuova console (SOLO PER MACCHINA CON paragrafo [VacuumMachButtons])
|
||||||
|
Dim bCollapsedVacuumButton As Boolean = Not m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_VACUUMMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
||||||
If Not m_NewMachineButtonsType Then
|
If Not m_NewMachineButtonsType Then
|
||||||
'Assegno MachineButtons alla pagina
|
'Assegno MachineButtons alla pagina
|
||||||
LowerButtonGrid.Children.Add(m_MachineButtons)
|
LowerButtonGrid.Children.Add(m_MachineButtons)
|
||||||
ControlsMachineBtn.Visibility = Windows.Visibility.Collapsed
|
ControlsMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
|
' se non sono configurate le ventose allora nascondo il comando
|
||||||
|
If m_NewMachineButtonsType AndAlso bCollapsedVacuumButton Then
|
||||||
|
VacuumMachineBtn.Visibility = Windows.Visibility.Collapsed
|
||||||
|
End If
|
||||||
|
|
||||||
' nuovi bottoni 20/05/2021 - modifica specifiche 04/08/2021
|
' nuovi bottoni 20/05/2021 - modifica specifiche 04/08/2021
|
||||||
' leggo il numero di assi attivi nella macchina
|
' leggo il numero di assi attivi nella macchina
|
||||||
@@ -140,6 +146,9 @@ Public Class DirectCutPageUC
|
|||||||
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
If Not String.IsNullOrEmpty(sCurrSaw) And Not String.IsNullOrEmpty(sCurrSawing) Then
|
||||||
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
bSaw = EgtSetCalcTool(sCurrSaw, "H1", 1)
|
||||||
End If
|
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_SingleCut.SetEnableParam(bSaw)
|
||||||
m_ControlsDirectCutUC.m_MultipleCut.SetEnableParam(bSaw)
|
m_ControlsDirectCutUC.m_MultipleCut.SetEnableParam(bSaw)
|
||||||
m_ControlsDirectCutUC.m_GridCut.SetEnableParam(bSaw)
|
m_ControlsDirectCutUC.m_GridCut.SetEnableParam(bSaw)
|
||||||
@@ -209,6 +218,7 @@ Public Class DirectCutPageUC
|
|||||||
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
m_ControlsMachineButton.SetValue(Grid.RowProperty, 1)
|
||||||
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
m_NewMachineButtonsType = m_ControlsMachineButton.GetPrivateProfileMachineButtons(S_CONTROLMACHBUTTONS, "Button1", Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, m_MainWindow.GetMachIniFile())
|
||||||
MachineButtonGrid.Children.Add(m_ControlsMachineButton)
|
MachineButtonGrid.Children.Add(m_ControlsMachineButton)
|
||||||
|
m_ActiveControl = Controls.MachineButtonUC
|
||||||
If VacuumMachineBtn.IsChecked Then
|
If VacuumMachineBtn.IsChecked Then
|
||||||
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
||||||
VacuumMachineBtn.IsChecked = False
|
VacuumMachineBtn.IsChecked = False
|
||||||
@@ -221,6 +231,7 @@ Public Class DirectCutPageUC
|
|||||||
Private Sub VacuumMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles VacuumMachineBtn.Click
|
Private Sub VacuumMachineBtn_Click(sender As Object, e As RoutedEventArgs) Handles VacuumMachineBtn.Click
|
||||||
If VacuumMachineBtn.IsChecked Then
|
If VacuumMachineBtn.IsChecked Then
|
||||||
MachineButtonGrid.Children.Add(m_VacuumMachineButton)
|
MachineButtonGrid.Children.Add(m_VacuumMachineButton)
|
||||||
|
m_ActiveControl = Controls.VacuumButtonUC
|
||||||
If ControlsMachineBtn.IsChecked Then
|
If ControlsMachineBtn.IsChecked Then
|
||||||
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||||
ControlsMachineBtn.IsChecked = False
|
ControlsMachineBtn.IsChecked = False
|
||||||
@@ -421,6 +432,8 @@ Public Class DirectCutPageUC
|
|||||||
m_nMachLook = MCH_LOOK.TAB_HEAD
|
m_nMachLook = MCH_LOOK.TAB_HEAD
|
||||||
Case MCH_LOOK.TAB_HEAD
|
Case MCH_LOOK.TAB_HEAD
|
||||||
m_nMachLook = MCH_LOOK.TAB_TOOL
|
m_nMachLook = MCH_LOOK.TAB_TOOL
|
||||||
|
Case MCH_LOOK.TAB_TOOL
|
||||||
|
m_nMachLook = MCH_LOOK.TAB
|
||||||
Case Else
|
Case Else
|
||||||
m_nMachLook = MCH_LOOK.ALL
|
m_nMachLook = MCH_LOOK.ALL
|
||||||
End Select
|
End Select
|
||||||
@@ -444,8 +457,12 @@ Public Class DirectCutPageUC
|
|||||||
m_ControlsDirectCutUC1.DirectCutPage_Unloaded(Nothing, Nothing)
|
m_ControlsDirectCutUC1.DirectCutPage_Unloaded(Nothing, Nothing)
|
||||||
Case Controls.MachineButtonUC
|
Case Controls.MachineButtonUC
|
||||||
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||||
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
|
||||||
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC1)
|
||||||
ControlsMachineBtn.IsChecked = False
|
ControlsMachineBtn.IsChecked = False
|
||||||
Case Controls.VacuumButtonUC
|
Case Controls.VacuumButtonUC
|
||||||
|
MachineButtonGrid.Children.Remove(m_ControlsMachineButton)
|
||||||
|
MachineButtonGrid.Children.Remove(m_ControlsDirectCutUC)
|
||||||
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
MachineButtonGrid.Children.Remove(m_VacuumMachineButton)
|
||||||
VacuumMachineBtn.IsChecked = False
|
VacuumMachineBtn.IsChecked = False
|
||||||
End Select
|
End Select
|
||||||
|
|||||||
@@ -50,6 +50,33 @@
|
|||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
||||||
|
<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 Name="PointModeCmBx" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}" Margin="6,0,6,0">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
@@ -106,7 +133,20 @@
|
|||||||
<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"/>
|
HorizontalAlignment="Right" Margin="0,0,6,0"/>
|
||||||
|
|
||||||
<Grid Grid.Row="11" Grid.ColumnSpan="2">
|
<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"/>
|
||||||
|
|
||||||
|
<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>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="0.5*"/>
|
<ColumnDefinition Width="0.5*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
@@ -123,6 +163,9 @@
|
|||||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
|
||||||
<Grid Grid.Row="12" Grid.ColumnSpan="2">
|
<Grid Grid.Row="12" Grid.ColumnSpan="2">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Imports EgtUILib
|
Imports System.Reflection
|
||||||
|
Imports EgtUILib
|
||||||
|
Imports EgtUILib.EgtInterface
|
||||||
|
|
||||||
Public Class FlatteningCut
|
Public Class FlatteningCut
|
||||||
|
|
||||||
@@ -35,14 +37,18 @@ Public Class FlatteningCut
|
|||||||
Private m_bHeadSide As Boolean = False
|
Private m_bHeadSide As Boolean = False
|
||||||
Private m_nMachType As Integer = 1
|
Private m_nMachType As Integer = 1
|
||||||
Private m_bRotLock As Boolean = False
|
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
|
' Array delle modalità di acquisizione dei punti
|
||||||
Private m_PointsModeArray(2) As String
|
Private m_PointsModeArray(2) As String
|
||||||
' Array delle tipologia di lavorazione della spianatura
|
' Array delle tipologia di lavorazione della spianatura
|
||||||
Private m_TypeArray(1) As String
|
Private m_TypeArray(2) As String
|
||||||
' Punto selezionato nel disegno
|
' Punto selezionato nel disegno
|
||||||
Private m_ptPrev As Point3d
|
Private m_ptPrev As Point3d
|
||||||
' Layer per crocette temporanee
|
' Layer per crocette temporanee
|
||||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||||
|
' Array degliutensili disponibili (lama e fresa)
|
||||||
|
Private m_ToolsArray(1) As String
|
||||||
|
|
||||||
' Costanti
|
' Costanti
|
||||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||||
@@ -57,8 +63,9 @@ Public Class FlatteningCut
|
|||||||
End Enum
|
End Enum
|
||||||
' Costanti che indicano la tipologia di lavorazione della spianatura
|
' Costanti che indicano la tipologia di lavorazione della spianatura
|
||||||
Private Enum MACH_TYPE As Integer
|
Private Enum MACH_TYPE As Integer
|
||||||
ONEWAY = 0
|
ZIGZAG = 0
|
||||||
ZIGZAG = 1
|
ONEWAY = 1
|
||||||
|
SPIRAL = 2
|
||||||
End Enum
|
End Enum
|
||||||
'Costante che indica il lato in cui posizionare i tagli
|
'Costante che indica il lato in cui posizionare i tagli
|
||||||
Private Enum CutSide As Integer
|
Private Enum CutSide As Integer
|
||||||
@@ -66,6 +73,11 @@ Public Class FlatteningCut
|
|||||||
Right
|
Right
|
||||||
End Enum
|
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)
|
' 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
|
Private Sub FlatteningCut_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
' Creo lista modalità di acquisizione punto
|
' Creo lista modalità di acquisizione punto
|
||||||
@@ -75,8 +87,9 @@ Public Class FlatteningCut
|
|||||||
' la associo alla combobox
|
' la associo alla combobox
|
||||||
PointModeCmBx.ItemsSource = m_PointsModeArray
|
PointModeCmBx.ItemsSource = m_PointsModeArray
|
||||||
' Creo lista tipo lavorazione
|
' 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.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
|
' la associo alla combobox
|
||||||
TypeCmBx.ItemsSource = m_TypeArray
|
TypeCmBx.ItemsSource = m_TypeArray
|
||||||
' assegno messaggi
|
' assegno messaggi
|
||||||
@@ -90,8 +103,13 @@ Public Class FlatteningCut
|
|||||||
ZReleasedTxBl.Text = "Z Svincolo"
|
ZReleasedTxBl.Text = "Z Svincolo"
|
||||||
SideTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 23)
|
SideTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 23)
|
||||||
RotLockTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 29)
|
RotLockTxBl.Text = EgtMsg(MSG_DIRECTCUTPAGEUC + 29)
|
||||||
|
ChainedPathTxBl.Text = "Chained path"
|
||||||
SimulBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
SimulBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 1)
|
||||||
OkBtn.ToolTip = EgtMsg(MSG_DIRECTCUTPAGEUC + 30)
|
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
|
' Carico i dati dell'ultimo taglio
|
||||||
m_dDepth = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_DEPTH, m_dDepth, 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_dAngO = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_ANGH, m_dAngO, m_MainWindow.GetIniFile())
|
||||||
@@ -102,6 +120,8 @@ Public Class FlatteningCut
|
|||||||
m_bHeadSide = (GetPrivateProfileInt(S_DIRECTCUTS, K_DC_FLATT_HEADSIDE, 0, m_MainWindow.GetIniFile()) <> 0)
|
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_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_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.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())
|
m_ptTipP1.y = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_FLATT_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
|
||||||
End Sub
|
End Sub
|
||||||
@@ -163,6 +183,9 @@ Public Class FlatteningCut
|
|||||||
SideChBx.IsChecked = m_bHeadSide
|
SideChBx.IsChecked = m_bHeadSide
|
||||||
TypeCmBx.SelectedIndex = m_nMachType
|
TypeCmBx.SelectedIndex = m_nMachType
|
||||||
RotLockChBx.IsChecked = m_bRotLock
|
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
|
' Reset taglio e disabilito bottone esecuzione
|
||||||
m_bCutOk = False
|
m_bCutOk = False
|
||||||
UpdateSimulOkBtn()
|
UpdateSimulOkBtn()
|
||||||
@@ -189,6 +212,9 @@ Public Class FlatteningCut
|
|||||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_DIRECTCUTS, K_DC_FLATT_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
|
||||||
' Se non vado in simulazione
|
' Se non vado in simulazione
|
||||||
If Not m_bSimul Then
|
If Not m_bSimul Then
|
||||||
|
' imposto la Z di sicurezza corretta
|
||||||
|
EgtMdbSetGeneralParam(MCH_GP.SAFEZ, DirectCutPageUC.m_dZSafe)
|
||||||
|
EgtMdbSave()
|
||||||
' Dichiaro sottopagina da non riattivare
|
' Dichiaro sottopagina da non riattivare
|
||||||
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC.DirectCutPages.DirectCut
|
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_ActiveDirectCutPage = ControlsDirectCutUC.DirectCutPages.DirectCut
|
||||||
' Rimuovo layer temporaneo per crocette
|
' Rimuovo layer temporaneo per crocette
|
||||||
@@ -265,19 +291,32 @@ Public Class FlatteningCut
|
|||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bRawOk Then Return
|
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
|
' Se acquisizone lama o laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||||
' Ricavo dati lama corrente
|
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
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
|
' Se punto da laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Ora imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||||
' Altrimenti da lama
|
' Altrimenti da lama
|
||||||
@@ -285,10 +324,10 @@ Public Class FlatteningCut
|
|||||||
' Imposto la lama corrente
|
' Imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Calcolo direzione asse lama
|
' 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
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP1Ok = True
|
m_bPointP1Ok = True
|
||||||
@@ -305,8 +344,6 @@ Public Class FlatteningCut
|
|||||||
' Porto il tip nell'origine tavola
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP1Ok = True
|
m_bPointP1Ok = True
|
||||||
' Ricavo dati lama corrente
|
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
|
||||||
' Imposto la lama corrente
|
' Imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||||
End If
|
End If
|
||||||
@@ -336,19 +373,32 @@ Public Class FlatteningCut
|
|||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bRawOk Then Return
|
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
|
' Se acquisizone lama o laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
||||||
' Ricavo dati lama corrente
|
' Se macchina multicut il primo asse rotante restituito è quello della tavola
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
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
|
' Se punto da laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Ora imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||||
' Altrimenti da lama
|
' Altrimenti da lama
|
||||||
@@ -356,7 +406,7 @@ Public Class FlatteningCut
|
|||||||
' Imposto la lama corrente
|
' Imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Calcolo direzione asse lama
|
' Calcolo direzione asse lama
|
||||||
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP2) Then Return
|
If Not EgtGetCalcToolDirFromAngles(dR1, dR2, m_vtToolP2) Then Return
|
||||||
@@ -371,8 +421,6 @@ Public Class FlatteningCut
|
|||||||
' Porto il tip nell'origine tavola
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP2Ok = True
|
m_bPointP2Ok = True
|
||||||
' Ricavo dati lama corrente
|
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
|
||||||
' Imposto la lama corrente
|
' Imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(sSaw, "H1", 1) Then Return
|
||||||
End If
|
End If
|
||||||
@@ -406,7 +454,7 @@ Public Class FlatteningCut
|
|||||||
|
|
||||||
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
||||||
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
||||||
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
|
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
|
||||||
Dim dDepth As Double = 0
|
Dim dDepth As Double = 0
|
||||||
StringToLen(DepthTxBx.Text, dDepth)
|
StringToLen(DepthTxBx.Text, dDepth)
|
||||||
If dDepth < 0 Then
|
If dDepth < 0 Then
|
||||||
@@ -521,6 +569,16 @@ Public Class FlatteningCut
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
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
|
Private Sub RotLockChBx_Click(sender As Object, e As EventArgs) Handles RotLockChBx.Click
|
||||||
m_bRotLock = RotLockChBx.IsChecked
|
m_bRotLock = RotLockChBx.IsChecked
|
||||||
' Disegno il taglio
|
' Disegno il taglio
|
||||||
@@ -529,6 +587,14 @@ Public Class FlatteningCut
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
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
|
Private Sub XcoordTxBx_EgtClosed(sender As Object, e As EventArgs) Handles XcoordTxBx.EgtClosed
|
||||||
' Recupero il valore della coordinata (in 0 Tab)
|
' Recupero il valore della coordinata (in 0 Tab)
|
||||||
Dim dXcoord As Double = 0
|
Dim dXcoord As Double = 0
|
||||||
@@ -597,8 +663,10 @@ Public Class FlatteningCut
|
|||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
Dim sNameProg As Integer = 900
|
||||||
|
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
' 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
|
' copio il progetto corrente come progetto in lavorazione
|
||||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
@@ -617,10 +685,12 @@ Public Class FlatteningCut
|
|||||||
' ricavo l'ingombro di lavorazione in funzione dell'utensile selezionato
|
' ricavo l'ingombro di lavorazione in funzione dell'utensile selezionato
|
||||||
Private Function GetFootPrintTool() As Double
|
Private Function GetFootPrintTool() As Double
|
||||||
' vedere nella pagina Allarm il capito "Incisioni"
|
' 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
|
Dim dFootPrint As Double = 0
|
||||||
' verifico quale lavorazione è attiva
|
' verifico quale lavorazione è attiva
|
||||||
If Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrSawing) AndAlso Not bForceUseMill Then
|
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)
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, dFootPrint)
|
||||||
ElseIf Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrMilling) Then
|
ElseIf Not String.IsNullOrEmpty(m_MainWindow.m_CurrentMachine.sCurrMilling) Then
|
||||||
Dim sCurrMill = m_MainWindow.m_CurrentMachine.sCurrMill
|
Dim sCurrMill = m_MainWindow.m_CurrentMachine.sCurrMill
|
||||||
@@ -655,18 +725,24 @@ Public Class FlatteningCut
|
|||||||
Dim ptStart As Point3d = m_ptTipP1
|
Dim ptStart As Point3d = m_ptTipP1
|
||||||
ptStart.z = 0
|
ptStart.z = 0
|
||||||
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
||||||
|
EgtSetInfo(nCutId, INFO_DIRECTCUT, 1)
|
||||||
' Imposto affondamento e angolo di fianco sul taglio
|
' Imposto affondamento e angolo di fianco sul taglio
|
||||||
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
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)
|
EgtSetInfo(nCutId, INFO_WIDTH, GetFootPrintTool)
|
||||||
End If
|
End If
|
||||||
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, 0)
|
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, 0)
|
||||||
' Imposto prima direzione
|
' Imposto prima direzione
|
||||||
EgtSetInfo(nCutId, INFO_DIR, 1)
|
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
|
' Eventuale bloccaggio rotazione asse C tra le passate
|
||||||
If RotLockChBx.IsChecked Then
|
If RotLockChBx.IsChecked Then
|
||||||
EgtSetInfo(nCutId, INFO_ENABLE_INVERT, False)
|
EgtSetInfo(nCutId, INFO_ENABLE_INVERT, False)
|
||||||
End If
|
End If
|
||||||
|
EgtSetInfo(nCutId, INFO_STEP_TYPE, m_nMachType)
|
||||||
' Funzione che crea i tagli successivi al primo
|
' Funzione che crea i tagli successivi al primo
|
||||||
MultiplyCut(nLayerId, nCutId)
|
MultiplyCut(nLayerId, nCutId)
|
||||||
' Creo layer per crocetta di riferimento
|
' Creo layer per crocetta di riferimento
|
||||||
@@ -699,10 +775,17 @@ Public Class FlatteningCut
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function MultiplyCut(nLayerId As Integer, nCutId As Integer) As Boolean
|
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
|
' Recupero spessore della lama (utensile) correntemente attiva
|
||||||
Dim dThick As Double = GetFootPrintTool()
|
Dim dThick As Double = GetFootPrintTool()
|
||||||
If dThick = 0 Then Return False
|
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
|
' Imposto angolo di rotazione a seconda del lato dei tagli
|
||||||
Dim dRotAngO As Double = If(SideChBx.IsChecked(), -90, 90)
|
Dim dRotAngO As Double = If(SideChBx.IsChecked(), -90, 90)
|
||||||
' Definisco vettore di spostamento
|
' Definisco vettore di spostamento
|
||||||
@@ -720,6 +803,10 @@ Public Class FlatteningCut
|
|||||||
If nStepNum > 1 Then
|
If nStepNum > 1 Then
|
||||||
dDelta = dWidth / (nStepNum - 1)
|
dDelta = dWidth / (nStepNum - 1)
|
||||||
End If
|
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
|
' Creo vettore delta
|
||||||
vtDelta *= dDelta
|
vtDelta *= dDelta
|
||||||
' Creo indice per impostare info che indica tipologia di spianatura
|
' Creo indice per impostare info che indica tipologia di spianatura
|
||||||
@@ -728,6 +815,8 @@ Public Class FlatteningCut
|
|||||||
Dim vtPerpMove As Vector3d = Index * vtDelta
|
Dim vtPerpMove As Vector3d = Index * vtDelta
|
||||||
' Creo copie
|
' Creo copie
|
||||||
Dim nCut2Id = EgtCopyGlob(nCutId, nLayerId)
|
Dim nCut2Id = EgtCopyGlob(nCutId, nLayerId)
|
||||||
|
EgtSetInfo(nCut2Id, INFO_WIDTH, dThick)
|
||||||
|
EgtSetInfo(nCutId, "EngravingWithMill", m_nTool)
|
||||||
' Assegno info direzione a seconda del tipo di spianatura
|
' Assegno info direzione a seconda del tipo di spianatura
|
||||||
If TypeCmBx.SelectedIndex = MACH_TYPE.ZIGZAG Then
|
If TypeCmBx.SelectedIndex = MACH_TYPE.ZIGZAG Then
|
||||||
If nTypeIndex = 1 Then
|
If nTypeIndex = 1 Then
|
||||||
@@ -741,10 +830,77 @@ Public Class FlatteningCut
|
|||||||
EgtSetInfo(nCut2Id, INFO_DIR, 1)
|
EgtSetInfo(nCut2Id, INFO_DIR, 1)
|
||||||
End If
|
End If
|
||||||
EgtMove(nCut2Id, vtPerpMove, GDB_RT.GLOB)
|
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
|
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
|
Return True
|
||||||
End Function
|
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
|
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||||
' Aggiungo crocette
|
' Aggiungo crocette
|
||||||
Dim vtCrossX As New Vector3d(20, 0, 0)
|
Dim vtCrossX As New Vector3d(20, 0, 0)
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ Public Class GridCut
|
|||||||
Private m_ptPrev As Point3d
|
Private m_ptPrev As Point3d
|
||||||
' Layer per crocette temporanee
|
' Layer per crocette temporanee
|
||||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||||
|
' Gestione spessore lama
|
||||||
|
Private m_bSawTh As Boolean = False
|
||||||
|
|
||||||
' Costanti
|
' Costanti
|
||||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||||
@@ -83,6 +85,11 @@ Public Class GridCut
|
|||||||
m_dDimX = GetPrivateProfileDouble( S_DIRECTCUTS, K_DC_GRID_DIMX, m_dDimX, 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_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_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.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())
|
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()
|
NumPzYTxBx.Text = m_nNumY.ToString()
|
||||||
DimPzYTxBx.Text = LenToString( m_dDimY, 1)
|
DimPzYTxBx.Text = LenToString( m_dDimY, 1)
|
||||||
SideChBx.IsChecked = m_bHeadSide
|
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
|
' Reset taglio e disabilito bottone esecuzione
|
||||||
m_bCutOk = False
|
m_bCutOk = False
|
||||||
UpdateSimulOkBtn()
|
UpdateSimulOkBtn()
|
||||||
@@ -248,6 +260,12 @@ Public Class GridCut
|
|||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bRawOk Then Return
|
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
|
' Recupero dati utensile e testa corrente
|
||||||
Dim sTool As String = ""
|
Dim sTool As String = ""
|
||||||
Dim sHead As String = ""
|
Dim sHead As String = ""
|
||||||
@@ -260,6 +278,13 @@ Public Class GridCut
|
|||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
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
|
' Ricavo dati lama corrente
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
' Se punto da laser
|
' Se punto da laser
|
||||||
@@ -267,7 +292,7 @@ Public Class GridCut
|
|||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
' Altrimenti da lama
|
' Altrimenti da lama
|
||||||
@@ -275,10 +300,10 @@ Public Class GridCut
|
|||||||
' Reimposto eventuale precedente utensile
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Calcolo direzione asse lama
|
' 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
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP1Ok = True
|
m_bPointP1Ok = True
|
||||||
@@ -327,6 +352,12 @@ Public Class GridCut
|
|||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bRawOk Then Return
|
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
|
' Recupero dati utensile e testa corrente
|
||||||
Dim sTool As String = ""
|
Dim sTool As String = ""
|
||||||
Dim sHead As String = ""
|
Dim sHead As String = ""
|
||||||
@@ -339,6 +370,13 @@ Public Class GridCut
|
|||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
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
|
' Ricavo dati lama corrente
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
' Se punto da laser
|
' Se punto da laser
|
||||||
@@ -346,7 +384,7 @@ Public Class GridCut
|
|||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
' Altrimenti da lama
|
' Altrimenti da lama
|
||||||
@@ -354,10 +392,10 @@ Public Class GridCut
|
|||||||
' Reimposto eventuale precedente utensile
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Calcolo direzione asse lama
|
' 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
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP2Ok = True
|
m_bPointP2Ok = True
|
||||||
@@ -405,7 +443,7 @@ Public Class GridCut
|
|||||||
|
|
||||||
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
||||||
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
||||||
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
|
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
|
||||||
Dim dDepth As Double = 0
|
Dim dDepth As Double = 0
|
||||||
StringToLen(DepthTxBx.Text, dDepth)
|
StringToLen(DepthTxBx.Text, dDepth)
|
||||||
If dDepth < 0 Then
|
If dDepth < 0 Then
|
||||||
@@ -523,8 +561,10 @@ Public Class GridCut
|
|||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
Dim sNameProg As Integer = 900
|
||||||
|
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
' 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
|
' copio il progetto corrente come progetto in lavorazione
|
||||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
@@ -616,6 +656,15 @@ Public Class GridCut
|
|||||||
If dDimPzY <> 0 And nNumPzY > 0 And dDimPzX <> 0 And nNumPzX > 0 Then
|
If dDimPzY <> 0 And nNumPzY > 0 And dDimPzX <> 0 And nNumPzX > 0 Then
|
||||||
Dim dLenX As Double = dThick + (dDimPzX + dThick) * nNumPzX
|
Dim dLenX As Double = dThick + (dDimPzX + dThick) * nNumPzX
|
||||||
Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX + 0.1)
|
Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX + 0.1)
|
||||||
|
|
||||||
|
' --- 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
|
' Imposto affondamento e angolo di fianco sul taglio
|
||||||
EgtSetInfo(nCutParaId, INFO_DEPTH, m_dDepth)
|
EgtSetInfo(nCutParaId, INFO_DEPTH, m_dDepth)
|
||||||
EgtSetInfo(nCutParaId, INFO_SIDE_ANGLE, m_dAngV)
|
EgtSetInfo(nCutParaId, INFO_SIDE_ANGLE, m_dAngV)
|
||||||
@@ -634,6 +683,13 @@ Public Class GridCut
|
|||||||
' Arretro il punto di partenza di uno spessore lama
|
' Arretro il punto di partenza di uno spessore lama
|
||||||
Dim vtDeltaPos As Vector3d = Vector3d.FromPolar(dThick + 0.1, m_dAngO - 90)
|
Dim vtDeltaPos As Vector3d = Vector3d.FromPolar(dThick + 0.1, m_dAngO - 90)
|
||||||
Dim nCutPerpId = EgtCreateLinePDL(nLayerId, ptStart + vtDeltaPos, m_dAngO + 90, dLenY + 0.2)
|
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
|
' Specchio se è attivo il flag che cambia lato di disegno
|
||||||
If SideChBx.IsChecked() Then
|
If SideChBx.IsChecked() Then
|
||||||
Dim vtRot As Vector3d = Vector3d.FromPolar(1, m_dAngO + 90)
|
Dim vtRot As Vector3d = Vector3d.FromPolar(1, m_dAngO + 90)
|
||||||
@@ -656,6 +712,7 @@ Public Class GridCut
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||||
|
ptP += New Vector3d(0, 0, 0.15)
|
||||||
' Aggiungo crocette
|
' Aggiungo crocette
|
||||||
Dim vtCrossX As New Vector3d(20, 0, 0)
|
Dim vtCrossX As New Vector3d(20, 0, 0)
|
||||||
Dim vtCrossY As New Vector3d(0, 20, 0)
|
Dim vtCrossY As New Vector3d(0, 20, 0)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ Public Class MachineButtonsUC
|
|||||||
Private m_DirectCutPage As DirectCutPageUC
|
Private m_DirectCutPage As DirectCutPageUC
|
||||||
Friend m_CN As CN_generico
|
Friend m_CN As CN_generico
|
||||||
|
|
||||||
|
Public nCountButton As Integer = 11
|
||||||
|
|
||||||
Private m_bOnlyLaser As Boolean = False
|
Private m_bOnlyLaser As Boolean = False
|
||||||
Private m_bFirst As Boolean = True
|
Private m_bFirst As Boolean = True
|
||||||
|
|
||||||
@@ -33,6 +35,7 @@ Public Class MachineButtonsUC
|
|||||||
Private Const BTN_STATE_DOOR_OPENED As String = "DoorOpened"
|
Private Const BTN_STATE_DOOR_OPENED As String = "DoorOpened"
|
||||||
Private Const BTN_STATE_DOOR_CLOSED As String = "DoorClosed"
|
Private Const BTN_STATE_DOOR_CLOSED As String = "DoorClosed"
|
||||||
Private Const BTN_STATE_PARKING As String = "Parking"
|
Private Const BTN_STATE_PARKING As String = "Parking"
|
||||||
|
Private Const BTN_STATE_HOME As String = "Home"
|
||||||
Private Const BTN_ENABLE_ZONE_1 As String = "EnableZone1"
|
Private Const BTN_ENABLE_ZONE_1 As String = "EnableZone1"
|
||||||
Private Const BTN_ENABLE_ZONE_2 As String = "EnableZone2"
|
Private Const BTN_ENABLE_ZONE_2 As String = "EnableZone2"
|
||||||
Private Const BTN_ENABLE_PC As String = "EnablePC"
|
Private Const BTN_ENABLE_PC As String = "EnablePC"
|
||||||
@@ -76,6 +79,9 @@ Public Class MachineButtonsUC
|
|||||||
GetToggleButton(nIndex + 1).Visibility = Windows.Visibility.Hidden
|
GetToggleButton(nIndex + 1).Visibility = Windows.Visibility.Hidden
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
' notifico nella variabile pubblica il numero di pulsanti inseriti nella barra
|
||||||
|
nCountButton = m_nCount
|
||||||
|
|
||||||
' Se variabile di stato "Nothing"/"DoorOpened"/"DoorClosed" imposto immagine fissa
|
' Se variabile di stato "Nothing"/"DoorOpened"/"DoorClosed" imposto immagine fissa
|
||||||
For nIndex As Integer = 0 To m_nCount - 1
|
For nIndex As Integer = 0 To m_nCount - 1
|
||||||
If StateFlagArray(nIndex) = BTN_STATE_NOTHING OrElse
|
If StateFlagArray(nIndex) = BTN_STATE_NOTHING OrElse
|
||||||
@@ -267,9 +273,62 @@ Public Class MachineButtonsUC
|
|||||||
End If
|
End If
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
' CONTROLLO FANUC
|
||||||
|
Case 4
|
||||||
|
' ------------------------------------ FANUC ------------------------------------
|
||||||
|
' eventuale scrittura di linea di comando MDI
|
||||||
|
If Not String.IsNullOrEmpty(CmdString) Then
|
||||||
|
' attivo mpdalità MDI
|
||||||
|
m_CN.DGeneralFunctions_WriteCncMode(2)
|
||||||
|
System.Threading.Thread.Sleep(100)
|
||||||
|
' salvo la stringa di comando ricevuta dal file lua
|
||||||
|
m_CN.sz_ManualDataInput = CmdString
|
||||||
|
' esguo la funzione che ha il compito di scrivere il comando MDI
|
||||||
|
m_CN.MDI_command()
|
||||||
|
End If
|
||||||
|
' attivo modalità AUTO
|
||||||
|
m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||||
|
System.Threading.Thread.Sleep(100)
|
||||||
|
If String.IsNullOrEmpty(EValue) Then
|
||||||
|
' EActive: impulsivo "D#####"
|
||||||
|
m_CN.NC_pulse_bit(ENumber)
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber)
|
||||||
|
Else
|
||||||
|
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||||
|
If ENumber.Contains(".") Then
|
||||||
|
' D#####.#
|
||||||
|
Dim bEValue As Boolean
|
||||||
|
If EValue.Trim = "1" Then bEValue = True
|
||||||
|
m_CN.NC_write_var_bit(ENumber, CBool(EValue))
|
||||||
|
Else
|
||||||
|
' D#####
|
||||||
|
m_CN.NC_write_var_short(ENumber, CShort(EValue))
|
||||||
|
End If
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber & " DValue= " & EValue)
|
||||||
|
End If
|
||||||
|
' eventale caricamento seconda variabile
|
||||||
|
If String.IsNullOrEmpty(EValue2) Then
|
||||||
|
' EActive: impulsivo "D#####"
|
||||||
|
m_CN.NC_pulse_bit(ENumber2)
|
||||||
|
EgtOutLog("Fanuc_DNumber= " & ENumber2)
|
||||||
|
Else
|
||||||
|
' EActive + EValue: scrittura comando invariabile Short oppure Bit
|
||||||
|
If ENumber2.Contains(".") Then
|
||||||
|
' D#####.#
|
||||||
|
Dim bEValue2 As Boolean
|
||||||
|
If EValue2.Trim = "1" Then bEValue2 = True
|
||||||
|
m_CN.NC_write_var_bit(ENumber2, CBool(EValue2))
|
||||||
|
Else
|
||||||
|
' D#####
|
||||||
|
m_CN.NC_write_var_short(ENumber2, CShort(EValue2))
|
||||||
|
End If
|
||||||
|
EgtOutLog("Fanuc_DNumber2= " & ENumber2 & " DValue2= " & EValue2)
|
||||||
|
End If
|
||||||
|
Return
|
||||||
End Select
|
End Select
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim nResult As Short
|
Dim nResult As Short
|
||||||
' Imposto modalità MDI per controlli num
|
' Imposto modalità MDI per controlli num
|
||||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||||
@@ -286,6 +345,8 @@ Public Class MachineButtonsUC
|
|||||||
m_CN.DGeneralFunctions_CycleStart()
|
m_CN.DGeneralFunctions_CycleStart()
|
||||||
Case 3
|
Case 3
|
||||||
'Per il siemens non devo fare nulla
|
'Per il siemens non devo fare nulla
|
||||||
|
Case 4
|
||||||
|
' Nicola: 27/03/2023 attivazione della funzione M# indicata?
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
If b2Start Then
|
If b2Start Then
|
||||||
@@ -320,6 +381,17 @@ Public Class MachineButtonsUC
|
|||||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||||
End If
|
End If
|
||||||
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
EgtLuaSetGlobNumVar("CMD.S", dSpeed)
|
||||||
|
' versione 2.5e1
|
||||||
|
EgtTdbSetCurrTool(m_MainWindow.m_CurrentProjectPageUC.ToolTxBx.Text)
|
||||||
|
Dim sToolPos As String = String.Empty
|
||||||
|
If EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sToolPos) Then
|
||||||
|
EgtLuaGetGlobStringVar("CMD.TCPOS", sToolPos)
|
||||||
|
End If
|
||||||
|
Dim dToolDiam As Double = 0
|
||||||
|
If EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam) Then
|
||||||
|
EgtLuaSetGlobNumVar("CMD.DIAM", dToolDiam * 1000)
|
||||||
|
End If
|
||||||
|
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
||||||
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
EgtLuaSetGlobNumVar("CMD.L1", dL1)
|
||||||
@@ -640,6 +712,40 @@ Public Class MachineButtonsUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Friend Sub HomeStateChanged(HomeState As Boolean)
|
||||||
|
Dim nIndex As Integer = Array.IndexOf(StateFlagArray, BTN_STATE_HOME)
|
||||||
|
If nIndex = -1 Then Return
|
||||||
|
If HomeState Then
|
||||||
|
GetToggleButton(nIndex + 1).IsChecked = True
|
||||||
|
Try
|
||||||
|
Dim s As String
|
||||||
|
If (m_MainWindow.m_OptionsPageUC.ThemesCmBx.SelectedIndex = 0) Then
|
||||||
|
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & ImageArrayY(nIndex)
|
||||||
|
Else
|
||||||
|
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\" & ImageArrayY(nIndex)
|
||||||
|
End If
|
||||||
|
Dim sButtonImageSource As ImageSource = ImageConverter.ConvertFromString(s)
|
||||||
|
GetImage(nIndex + 1).Source = sButtonImageSource
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog("Error loading image " & ImageArrayY(nIndex + 1))
|
||||||
|
End Try
|
||||||
|
Else
|
||||||
|
GetToggleButton(nIndex + 1).IsChecked = False
|
||||||
|
Try
|
||||||
|
Dim s As String
|
||||||
|
If (m_MainWindow.m_OptionsPageUC.ThemesCmBx.SelectedIndex = 0) Then
|
||||||
|
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\" & ImageArrayY(nIndex)
|
||||||
|
Else
|
||||||
|
s = m_MainWindow.GetResourcesDir() & "\MachineButtonsImage\NewIcons\" & ImageArrayY(nIndex)
|
||||||
|
End If
|
||||||
|
Dim sButtonImageSource As ImageSource = ImageConverter.ConvertFromString(s)
|
||||||
|
GetImage(nIndex + 1).Source = sButtonImageSource
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog("Error loading image " & ImageArrayN(nIndex + 1))
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Sub EnableZoneStateChanged(ZoneState As Integer)
|
Friend Sub EnableZoneStateChanged(ZoneState As Integer)
|
||||||
Dim sFlag As String = String.Empty
|
Dim sFlag As String = String.Empty
|
||||||
If ZoneState = 1 Then
|
If ZoneState = 1 Then
|
||||||
|
|||||||
@@ -53,14 +53,43 @@ Public Class ManualAxesMoveUC
|
|||||||
' Imposto check per considerare spessore lama
|
' Imposto check per considerare spessore lama
|
||||||
L1SawThChBx.IsChecked = m_MainWindow.m_CurrentMachine.bAddSawThTo5AxMove
|
L1SawThChBx.IsChecked = m_MainWindow.m_CurrentMachine.bAddSawThTo5AxMove
|
||||||
L2SawThChBx.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
|
End Sub
|
||||||
|
|
||||||
Private Sub ManualAxesMove_UnLoaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
Private Sub ManualAxesMove_UnLoaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
m_Timer.Stop()
|
m_Timer.Stop()
|
||||||
m_MainWindow.m_CurrentMachine.bAddSawThTo5AxMove = (L1SawThChBx.IsEnabled And L1SawThChBx.IsChecked) Or
|
m_MainWindow.m_CurrentMachine.bAddSawThTo5AxMove = (L1SawThChBx.IsEnabled And L1SawThChBx.IsChecked) Or
|
||||||
(L2SawThChBx.IsEnabled And L2SawThChBx.IsChecked)
|
(L2SawThChBx.IsEnabled And L2SawThChBx.IsChecked)
|
||||||
|
' Nascondo la macchina
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = False
|
||||||
|
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||||
|
EgtDraw()
|
||||||
End Sub
|
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()
|
Private Sub UpdateAxesNames()
|
||||||
Dim sL1 As String = String.Empty
|
Dim sL1 As String = String.Empty
|
||||||
Dim sL2 As String = String.Empty
|
Dim sL2 As String = String.Empty
|
||||||
@@ -125,11 +154,16 @@ Public Class ManualAxesMoveUC
|
|||||||
Private Sub Timer_tick()
|
Private Sub Timer_tick()
|
||||||
UpdateAxesNames()
|
UpdateAxesNames()
|
||||||
UpdateUseSawThickness()
|
UpdateUseSawThickness()
|
||||||
|
' Aggiorno posizione macchina in disegno
|
||||||
|
SetMachineInCurrPos()
|
||||||
|
' Aggiorno il disegno
|
||||||
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private m_MoveClicked As Boolean = False
|
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
|
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
|
If e.ClickCount > 1 OrElse m_MoveClicked Then
|
||||||
|
EgtOutLog(" → Hold on! Do not click compulsively.")
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
m_MoveClicked = True
|
m_MoveClicked = True
|
||||||
@@ -209,13 +243,14 @@ Public Class ManualAxesMoveUC
|
|||||||
System.Threading.Thread.Sleep(150)
|
System.Threading.Thread.Sleep(150)
|
||||||
m_CN.DGeneralFunctions_CycleStart()
|
m_CN.DGeneralFunctions_CycleStart()
|
||||||
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
System.Threading.Thread.Sleep(m_MainWindow.m_CurrentMachine.nThreadSleep)
|
||||||
m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
' m_CN.DGeneralFunctions_WriteCncMode(7) ' Modalità manuale
|
||||||
m_MoveClicked = False
|
m_MoveClicked = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SiemensMoveAxis(CurrentBtn As Button)
|
Private Sub SiemensMoveAxis(CurrentBtn As Button)
|
||||||
' leggo se stato reset
|
' leggo se stato reset
|
||||||
If Not m_CN.bResetState Then
|
If Not m_CN.bResetState Then
|
||||||
|
EgtOutLog("Reset status is 'False', is denied to execute file '\DirectCmd\AxesMove.lua'.")
|
||||||
m_MoveClicked = False
|
m_MoveClicked = False
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ Public Class MultipleCut
|
|||||||
Private m_ptPrev As Point3d
|
Private m_ptPrev As Point3d
|
||||||
' Layer per crocette temporanee
|
' Layer per crocette temporanee
|
||||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||||
|
' Gestione spessore lama
|
||||||
|
Private m_bSawTh As Boolean = False
|
||||||
' Costanti
|
' Costanti
|
||||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||||
Private Const MIN_CUT_LEN As Double = 10.0
|
Private Const MIN_CUT_LEN As Double = 10.0
|
||||||
@@ -93,6 +94,11 @@ Public Class MultipleCut
|
|||||||
m_nNum(nI) = GetPrivateProfileInt(S_DIRECTCUTS, K_DC_MULT_NUM & (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())
|
m_dDim(nI) = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_MULT_DIM & (nI + 1).ToString(), 0, m_MainWindow.GetIniFile())
|
||||||
Next
|
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_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.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())
|
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()
|
NumPz10TxBx.Text = m_nNum(9).ToString()
|
||||||
DimPz10TxBx.Text = LenToString( m_dDim(9), 1)
|
DimPz10TxBx.Text = LenToString( m_dDim(9), 1)
|
||||||
SideChBx.IsChecked = m_bHeadSide
|
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
|
' Reset taglio e disabilito bottone esecuzione
|
||||||
m_bCutOk = False
|
m_bCutOk = False
|
||||||
UpdateSimulOkBtn()
|
UpdateSimulOkBtn()
|
||||||
@@ -274,6 +285,12 @@ Public Class MultipleCut
|
|||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bRawOk Then Return
|
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
|
' Recupero dati utensile e testa corrente
|
||||||
Dim sTool As String = ""
|
Dim sTool As String = ""
|
||||||
Dim sHead As String = ""
|
Dim sHead As String = ""
|
||||||
@@ -286,6 +303,13 @@ Public Class MultipleCut
|
|||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
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
|
' Ricavo dati lama corrente
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
' Se punto da laser
|
' Se punto da laser
|
||||||
@@ -293,7 +317,7 @@ Public Class MultipleCut
|
|||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
|
|
||||||
@@ -303,10 +327,10 @@ Public Class MultipleCut
|
|||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
|
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Calcolo direzione asse lama
|
' 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
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP1Ok = True
|
m_bPointP1Ok = True
|
||||||
@@ -354,6 +378,12 @@ Public Class MultipleCut
|
|||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bRawOk Then Return
|
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
|
' Recupero dati utensile e testa corrente
|
||||||
Dim sTool As String = ""
|
Dim sTool As String = ""
|
||||||
Dim sHead As String = ""
|
Dim sHead As String = ""
|
||||||
@@ -366,6 +396,13 @@ Public Class MultipleCut
|
|||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
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
|
' Ricavo dati lama corrente
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
' Se punto da laser
|
' Se punto da laser
|
||||||
@@ -373,7 +410,7 @@ Public Class MultipleCut
|
|||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
' Altrimenti da lama
|
' Altrimenti da lama
|
||||||
@@ -381,10 +418,10 @@ Public Class MultipleCut
|
|||||||
' Reimposto eventuale precedente utensile
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Calcolo direzione asse lama
|
' 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
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP2Ok = True
|
m_bPointP2Ok = True
|
||||||
@@ -435,7 +472,7 @@ Public Class MultipleCut
|
|||||||
|
|
||||||
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
||||||
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
||||||
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
|
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
|
||||||
Dim dDepth As Double = 0
|
Dim dDepth As Double = 0
|
||||||
StringToLen(DepthTxBx.Text, dDepth)
|
StringToLen(DepthTxBx.Text, dDepth)
|
||||||
If dDepth < 0 Then
|
If dDepth < 0 Then
|
||||||
@@ -569,8 +606,10 @@ Public Class MultipleCut
|
|||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
Dim sNameProg As Integer = 900
|
||||||
|
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
' 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
|
' copio il progetto corrente come progetto in lavorazione
|
||||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
@@ -606,6 +645,22 @@ Public Class MultipleCut
|
|||||||
Dim ptStart As Point3d = m_ptTipP1
|
Dim ptStart As Point3d = m_ptTipP1
|
||||||
ptStart.z = 0
|
ptStart.z = 0
|
||||||
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
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
|
' Imposto affondamento e angolo di fianco sul taglio
|
||||||
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
||||||
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
|
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
|
||||||
@@ -698,6 +753,7 @@ Public Class MultipleCut
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||||
|
ptP += New Vector3d(0, 0, 0.15)
|
||||||
' Aggiungo crocette
|
' Aggiungo crocette
|
||||||
Dim vtCrossX As New Vector3d(20, 0, 0)
|
Dim vtCrossX As New Vector3d(20, 0, 0)
|
||||||
Dim vtCrossY As New Vector3d(0, 20, 0)
|
Dim vtCrossY As New Vector3d(0, 20, 0)
|
||||||
|
|||||||
@@ -180,8 +180,10 @@ Public Class Polishing
|
|||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
Dim sNameProg As Integer = 900
|
||||||
|
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
' 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
|
' copio il progetto corrente come progetto in lavorazione
|
||||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
|
|||||||
@@ -210,17 +210,30 @@ Public Class SawTestUC
|
|||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bRawOk Then Return
|
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
|
' Se acquisizone lama o laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
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
|
' Se punto da laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Ora imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
||||||
' Altrimenti da lama
|
' Altrimenti da lama
|
||||||
@@ -228,10 +241,10 @@ Public Class SawTestUC
|
|||||||
' Imposto la lama corrente
|
' Imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Calcolo direzione asse lama
|
' 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
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP1Ok = True
|
m_bPointP1Ok = True
|
||||||
@@ -280,17 +293,30 @@ Public Class SawTestUC
|
|||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bRawOk Then Return
|
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
|
' Se acquisizone lama o laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.SAW Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
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
|
' Se punto da laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Ora imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
||||||
' Altrimenti da lama
|
' Altrimenti da lama
|
||||||
@@ -298,10 +324,10 @@ Public Class SawTestUC
|
|||||||
' Imposto la lama corrente
|
' Imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
If Not EgtSetCalcTool(m_sSaw, "H1", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Calcolo direzione asse lama
|
' 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
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP2Ok = True
|
m_bPointP2Ok = True
|
||||||
@@ -351,7 +377,7 @@ Public Class SawTestUC
|
|||||||
|
|
||||||
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
||||||
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
||||||
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
|
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
|
||||||
Dim dDepth As Double = 0
|
Dim dDepth As Double = 0
|
||||||
StringToLen(DepthTxBx.Text, dDepth)
|
StringToLen(DepthTxBx.Text, dDepth)
|
||||||
If dDepth < 0 Then
|
If dDepth < 0 Then
|
||||||
@@ -450,8 +476,10 @@ Public Class SawTestUC
|
|||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
Dim sNameProg As Integer = 900
|
||||||
|
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
' 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
|
' copio il progetto corrente come progetto in lavorazione
|
||||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
@@ -502,6 +530,10 @@ Public Class SawTestUC
|
|||||||
ElseIf nWSide = MCH_SAW_WS.LEFT Then
|
ElseIf nWSide = MCH_SAW_WS.LEFT Then
|
||||||
vtPerp = vtDir
|
vtPerp = vtDir
|
||||||
vtPerp.Rotate(Vector3d.Z_AX, +90)
|
vtPerp.Rotate(Vector3d.Z_AX, +90)
|
||||||
|
Else
|
||||||
|
m_CurrProjPage.ClearMessage()
|
||||||
|
' 91144 = Set machining side: right or left.
|
||||||
|
m_CurrProjPage.SetInfoMessage(EgtMsg(91144))
|
||||||
End If
|
End If
|
||||||
Dim ptEnd As Point3d = ptStart + vtDir * m_dLen + vtPerp * dThick
|
Dim ptEnd As Point3d = ptStart + vtDir * m_dLen + vtPerp * dThick
|
||||||
Dim dLen2 As Double = m_dLen / 2
|
Dim dLen2 As Double = m_dLen / 2
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtUILib
|
Imports System.Windows.Threading
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Public Class SingleCutUC
|
Public Class SingleCutUC
|
||||||
|
|
||||||
@@ -39,10 +40,14 @@ Public Class SingleCutUC
|
|||||||
Private m_nTempLay As Integer = GDB_ID.NULL
|
Private m_nTempLay As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
' Costanti
|
' Costanti
|
||||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
Private Const MAX_TAB_DEPTH As Double = 10.0 ' sostituita da un m_MaxTabDepth letto da file ini macchina
|
||||||
Private Const MIN_CUT_LEN As Double = 10.0
|
Private Const MIN_CUT_LEN As Double = 10.0
|
||||||
Private Const MAX_SIDE_ANG As Double = 60.0
|
Private Const MAX_SIDE_ANG As Double = 60.0
|
||||||
' Costanti che indicano la modalità di acquisizione dei punti
|
' Costanti che indicano la modalità di acquisizione dei punti
|
||||||
|
|
||||||
|
' Utilizzato per aggiornare la posizione della macchina
|
||||||
|
Private m_RefreshTimer As New DispatcherTimer
|
||||||
|
|
||||||
Private Enum PT_MODE As Integer
|
Private Enum PT_MODE As Integer
|
||||||
SAW = 0
|
SAW = 0
|
||||||
LASER = 1
|
LASER = 1
|
||||||
@@ -92,6 +97,10 @@ Public Class SingleCutUC
|
|||||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
||||||
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
' riavvio il timer per visualizzare la poszione della macchina
|
||||||
|
If Not IsNothing(m_RefreshTimer) Then
|
||||||
|
m_RefreshTimer.Start()
|
||||||
|
End If
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' Disabilito registrazione progetto modificato
|
' Disabilito registrazione progetto modificato
|
||||||
@@ -138,10 +147,29 @@ Public Class SingleCutUC
|
|||||||
' Deseleziono bottone primo punto
|
' Deseleziono bottone primo punto
|
||||||
Point1Btn.IsChecked = False
|
Point1Btn.IsChecked = False
|
||||||
|
|
||||||
' la visualizzazione dei comandi è gestira dalla DirectCutPageUC richiamando la funzione ReloadParam
|
' la visualizzazione dei comandi è gestita dalla DirectCutPageUC richiamando la funzione ReloadParam
|
||||||
|
|
||||||
|
' forzo la macchina ad essere visibile fin da subito
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
||||||
|
m_MainWindow.m_DirectCutPageUC.m_nMachLook = MCH_LOOK.TAB
|
||||||
|
' Creo il timer il timer per aggiornare il posizionamento della macchina
|
||||||
|
AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_tick
|
||||||
|
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(1000)
|
||||||
|
|
||||||
' Aggiorno visualizzazione
|
' Aggiorno visualizzazione
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
|
||||||
|
' Avvi il timer
|
||||||
|
m_RefreshTimer.Start()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefreshTimer_tick()
|
||||||
|
' se è impostata la visualizzazione della sola tavola allora non aggiorno il disegno
|
||||||
|
If m_MainWindow.m_DirectCutPageUC.m_nMachLook = MCH_LOOK.TAB Then Return
|
||||||
|
' Aggiorno visualizzazione
|
||||||
|
SetMachineInCurrPos()
|
||||||
|
' Aggiorno il disegno
|
||||||
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub SingleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
Friend Sub SingleCut_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||||
@@ -171,6 +199,8 @@ Public Class SingleCutUC
|
|||||||
EgtSetMachineLook(MCH_LOOK.TAB)
|
EgtSetMachineLook(MCH_LOOK.TAB)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End If
|
End If
|
||||||
|
' interrompo il Timer per aggiornare la visualizzazione del posizionamento macchina
|
||||||
|
m_RefreshTimer.Stop()
|
||||||
' Dichiaro pagina non attiva
|
' Dichiaro pagina non attiva
|
||||||
m_bActive = False
|
m_bActive = False
|
||||||
End Sub
|
End Sub
|
||||||
@@ -238,6 +268,12 @@ Public Class SingleCutUC
|
|||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bRawOk Then Return
|
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
|
' Recupero dati utensile e testa corrente
|
||||||
Dim sTool As String = ""
|
Dim sTool As String = ""
|
||||||
Dim sHead As String = ""
|
Dim sHead As String = ""
|
||||||
@@ -249,6 +285,13 @@ Public Class SingleCutUC
|
|||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
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
|
' Ricavo dati lama corrente
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
' Se punto da laser
|
' Se punto da laser
|
||||||
@@ -256,7 +299,8 @@ Public Class SingleCutUC
|
|||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
' Altrimenti da lama
|
' Altrimenti da lama
|
||||||
@@ -264,10 +308,11 @@ Public Class SingleCutUC
|
|||||||
' Reimposto eventuale precedente utensile
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Calcolo direzione asse lama
|
' 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
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP1Ok = True
|
m_bPointP1Ok = True
|
||||||
@@ -288,7 +333,6 @@ Public Class SingleCutUC
|
|||||||
m_bPointP1Ok = True
|
m_bPointP1Ok = True
|
||||||
' Reimposto eventuale precedente utensile
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Disegno il taglio
|
' Disegno il taglio
|
||||||
@@ -298,6 +342,7 @@ Public Class SingleCutUC
|
|||||||
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
m_MainWindow.m_DirectCutPageUC.m_bShowMachine = True
|
||||||
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
EgtSetMachineLook(m_MainWindow.m_DirectCutPageUC.m_nMachLook)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
|
||||||
' Seleziono il bottone per indicare che il primo punto è stato acquisito
|
' Seleziono il bottone per indicare che il primo punto è stato acquisito
|
||||||
Point1Btn.IsChecked = True
|
Point1Btn.IsChecked = True
|
||||||
' Abilito e deseleziono secondo punto
|
' Abilito e deseleziono secondo punto
|
||||||
@@ -317,6 +362,12 @@ Public Class SingleCutUC
|
|||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bRawOk Then Return
|
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
|
' Recupero dati utensile e testa corrente
|
||||||
Dim sTool As String = ""
|
Dim sTool As String = ""
|
||||||
Dim sHead As String = ""
|
Dim sHead As String = ""
|
||||||
@@ -328,6 +379,13 @@ Public Class SingleCutUC
|
|||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
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
|
' Ricavo dati lama corrente
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
' Se punto da laser
|
' Se punto da laser
|
||||||
@@ -335,20 +393,20 @@ Public Class SingleCutUC
|
|||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
|
|
||||||
' Altrimenti da lama
|
' Altrimenti da lama
|
||||||
Else
|
Else
|
||||||
' Reimposto eventuale precedente utensile
|
' Reimposto eventuale precedente utensile
|
||||||
EgtSetCalcTool(sTool, sHead, nExit)
|
EgtSetCalcTool(sTool, sHead, nExit)
|
||||||
|
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Calcolo direzione asse lama
|
' 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
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP2.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP2Ok = True
|
m_bPointP2Ok = True
|
||||||
@@ -381,6 +439,7 @@ Public Class SingleCutUC
|
|||||||
m_dAngO = dAngOrizzDeg
|
m_dAngO = dAngOrizzDeg
|
||||||
LenghtTxBx.Text = LenToString(m_dLen, 1)
|
LenghtTxBx.Text = LenToString(m_dLen, 1)
|
||||||
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
||||||
|
EgtOutLog("Lunghezza taglio: " & dLen.ToString & "Angolo: " & dAngOrizzDeg.ToString)
|
||||||
CreateSingleCut()
|
CreateSingleCut()
|
||||||
' Disegno la macchina nella sua posizione reale
|
' Disegno la macchina nella sua posizione reale
|
||||||
SetMachineInCurrPos()
|
SetMachineInCurrPos()
|
||||||
@@ -398,7 +457,7 @@ Public Class SingleCutUC
|
|||||||
|
|
||||||
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
Private Sub DepthTxBx_EgtClosed(sender As Object, e As EventArgs) Handles DepthTxBx.EgtClosed
|
||||||
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
' Verifico che l'affondamento impostato non sia superiore a quello massimo
|
||||||
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + MAX_TAB_DEPTH
|
Dim dMaxDepth = m_ptRawMax.z - m_ptRawMin.z + m_MainWindow.m_CurrentMachine.MaxTabDepth
|
||||||
Dim dDepth As Double = 0
|
Dim dDepth As Double = 0
|
||||||
StringToLen(DepthTxBx.Text, dDepth)
|
StringToLen(DepthTxBx.Text, dDepth)
|
||||||
If dDepth < 0 Then
|
If dDepth < 0 Then
|
||||||
@@ -553,8 +612,10 @@ Public Class SingleCutUC
|
|||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
Dim sNameProg As Integer = 900
|
||||||
|
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
' 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
|
' copio il progetto corrente come progetto in lavorazione
|
||||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
@@ -571,6 +632,7 @@ Public Class SingleCutUC
|
|||||||
Private Function CreateSingleCut() As Boolean
|
Private Function CreateSingleCut() As Boolean
|
||||||
' Verifico sia definito il punto iniziale e il grezzo
|
' Verifico sia definito il punto iniziale e il grezzo
|
||||||
If Not m_bPointP1Ok Or Not m_bRawOk Then
|
If Not m_bPointP1Ok Or Not m_bRawOk Then
|
||||||
|
EgtOutLog("Primo punto non valido")
|
||||||
m_bCutOk = False
|
m_bCutOk = False
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
@@ -583,7 +645,7 @@ Public Class SingleCutUC
|
|||||||
Dim sSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
Dim sSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||||
EgtTdbSetCurrTool(sSaw)
|
EgtTdbSetCurrTool(sSaw)
|
||||||
Dim dThick As Double = 0
|
Dim dThick As Double = 0
|
||||||
' se è impostata una lavorazione di lama
|
' Se è impostata una lavorazione di lama
|
||||||
If Not String.IsNullOrEmpty(sSawing) Then
|
If Not String.IsNullOrEmpty(sSawing) Then
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||||
End If
|
End If
|
||||||
@@ -599,14 +661,19 @@ Public Class SingleCutUC
|
|||||||
Dim ptStart As Point3d = m_ptTipP1
|
Dim ptStart As Point3d = m_ptTipP1
|
||||||
ptStart.z = 0
|
ptStart.z = 0
|
||||||
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
Dim nCutId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, m_dLen)
|
||||||
If Math.Abs(m_dOffset) > 10 * EPS_SMALL Then
|
' Applico la correzione di spessore lama -> anche se Offset=0! ver_2.5b1
|
||||||
Dim dTotOffset = m_dOffset
|
Dim dTotOffset = m_dOffset
|
||||||
If m_bSawTh Then dTotOffset += If( m_dOffset > 0, dThick, -dThick)
|
If m_bSawTh Then
|
||||||
|
dTotOffset += If(m_dOffset > 0, dThick, -dThick)
|
||||||
|
EgtOffsetCurve(nCutId, dTotOffset, OFF_TYPE.EXTEND)
|
||||||
|
Else
|
||||||
EgtOffsetCurve(nCutId, dTotOffset, OFF_TYPE.EXTEND)
|
EgtOffsetCurve(nCutId, dTotOffset, OFF_TYPE.EXTEND)
|
||||||
End If
|
End If
|
||||||
' Imposto affondamento e angolo di fianco sul taglio
|
' Imposto affondamento e angolo di fianco sul taglio
|
||||||
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
EgtSetInfo(nCutId, INFO_DEPTH, m_dDepth)
|
||||||
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
|
EgtSetInfo(nCutId, INFO_SIDE_ANGLE, m_dAngV)
|
||||||
|
' Imposto se disabilitare l'inversine di direzione del taglio
|
||||||
|
If Not m_MainWindow.m_CurrentMachine.bEnableInvert Then EgtSetInfo(nCutId, INFO_ENABLE_INVERT, 0)
|
||||||
' Creo layer per crocetta di riferimento
|
' Creo layer per crocetta di riferimento
|
||||||
Dim nCrossLayerId = EgtCreateGroup(nPartId)
|
Dim nCrossLayerId = EgtCreateGroup(nPartId)
|
||||||
' Aggiungo crocetta/e
|
' Aggiungo crocetta/e
|
||||||
|
|||||||
@@ -72,7 +72,10 @@ Public Class SingleDrillUC
|
|||||||
Private Sub SingleDrill_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub SingleDrill_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
m_sCurrDrill = m_CurrentMachine.sCurrDrill
|
m_sCurrDrill = m_CurrentMachine.sCurrDrill
|
||||||
GetDrillFromDrilling(m_sCurrDrill, m_CurrentMachine.sCurrDrilling)
|
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
|
' recupero informazioni del foretto usato
|
||||||
EgtTdbSetCurrTool(m_sCurrDrill)
|
EgtTdbSetCurrTool(m_sCurrDrill)
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_dDiameter)
|
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_dDiameter)
|
||||||
@@ -213,21 +216,33 @@ Public Class SingleDrillUC
|
|||||||
' Verifico configurazione tavola e grezzo
|
' Verifico configurazione tavola e grezzo
|
||||||
If Not m_bRawOk Then Return
|
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
|
' Se acquisizione lama o laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.DRILL Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.DRILL Or PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
|
|
||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
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
|
||||||
' Ricavo dati Foretto corrente
|
Dim vAng() As Double = {dR1, dR2, 0}
|
||||||
Dim sDrill As String = m_sCurrDrill
|
If bIsMultiCut Then
|
||||||
|
vAng(0) = 0
|
||||||
|
vAng(1) = dR1
|
||||||
|
vAng(2) = dR2
|
||||||
|
End If
|
||||||
' Se punto da laser
|
' Se punto da laser
|
||||||
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
If PointModeCmBx.SelectedIndex = PT_MODE.LASER Then
|
||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
If Not EgtSetCalcTool("", "H3", 1) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
' Ora imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sDrill, "H1", 2) Then Return
|
If Not EgtSetCalcTool(sDrill, "H1", 2) Then Return
|
||||||
' Altrimenti da lama
|
' Altrimenti da lama
|
||||||
@@ -235,10 +250,10 @@ Public Class SingleDrillUC
|
|||||||
' Imposto la lama corrente
|
' Imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sDrill, "H1", 2) Then Return
|
If Not EgtSetCalcTool(sDrill, "H1", 2) Then Return
|
||||||
' Trasformo in posizione punta utensile in basso
|
' 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
|
End If
|
||||||
' Calcolo direzione asse lama
|
' 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
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP1Ok = True
|
m_bPointP1Ok = True
|
||||||
@@ -250,10 +265,8 @@ Public Class SingleDrillUC
|
|||||||
' Porto il tip nell'origine tavola
|
' Porto il tip nell'origine tavola
|
||||||
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
m_ptTipP1.ToLoc(New Frame3d(m_ptTabOri))
|
||||||
m_bPointP1Ok = True
|
m_bPointP1Ok = True
|
||||||
' Ricavo dati lama corrente
|
|
||||||
Dim sDrill As String = m_sCurrDrill
|
|
||||||
' Imposto la lama corrente
|
' Imposto la lama corrente
|
||||||
If Not EgtSetCalcTool(sDrill, "H1", 1) Then Return
|
If Not EgtSetCalcTool(sDrill, "H1", 2) Then Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Disegno il taglio
|
' Disegno il taglio
|
||||||
@@ -371,8 +384,10 @@ Public Class SingleDrillUC
|
|||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
Dim sNameProg As Integer = 900
|
||||||
|
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
' 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
|
' copio il progetto corrente come progetto in lavorazione
|
||||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
@@ -431,9 +446,9 @@ Public Class SingleDrillUC
|
|||||||
ptIns.z = dRawHeight
|
ptIns.z = dRawHeight
|
||||||
' Inserisco il pezzo nel grezzo
|
' Inserisco il pezzo nel grezzo
|
||||||
EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId)
|
EgtAddPartToRawPart(nPartId, ptIns, m_MainWindow.m_CurrentProjectPageUC.m_nRawId)
|
||||||
|
EgtSetCurrPhase(1)
|
||||||
' Inserisco la lavorazione
|
' Inserisco la lavorazione
|
||||||
m_bCutOk = AddMachinings(nPartId) AndAlso UpdateAllMachiningsToolpaths()
|
m_bCutOk = AddMachinings(nPartId) AndAlso UpdateAllMachiningsToolpaths()
|
||||||
EgtSetCurrPhase(1)
|
|
||||||
' Eventuale eliminazione Home finale
|
' Eventuale eliminazione Home finale
|
||||||
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
If Not m_MainWindow.m_CurrentMachine.bDirectCutsFinalHome Then
|
||||||
RemoveFinalHome()
|
RemoveFinalHome()
|
||||||
|
|||||||
@@ -287,8 +287,10 @@ Public Class SquaringUC
|
|||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
Dim sNameProg As Integer = 900
|
||||||
|
sNameProg = GetPrivateProfileInt(S_PARTPROGRAM, "NameProg", sNameProg, m_MainWindow.GetMachIniFile)
|
||||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
' 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
|
' copio il progetto corrente come progetto in lavorazione
|
||||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ Public Class VacuumMachineButtonUC
|
|||||||
Friend m_CN As CN_generico
|
Friend m_CN As CN_generico
|
||||||
Private m_bFirst As Boolean = True
|
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
|
' Creazione converter da String a ImageSource
|
||||||
Dim ImageConverter As New ImageSourceConverter
|
Dim ImageConverter As New ImageSourceConverter
|
||||||
|
|
||||||
@@ -71,10 +74,37 @@ Public Class VacuumMachineButtonUC
|
|||||||
If Not IsNothing(ButtonToAdd) Then m_ButtonList.Add(ButtonToAdd)
|
If Not IsNothing(ButtonToAdd) Then m_ButtonList.Add(ButtonToAdd)
|
||||||
End If
|
End If
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
For Each MachineButton As MachineButton In m_ButtonList
|
||||||
|
OutLogTypeButton(MachineButton)
|
||||||
|
Next
|
||||||
|
m_OutLogTypeButton = False
|
||||||
|
|
||||||
NotifyPropertyChanged("ButtonList")
|
NotifyPropertyChanged("ButtonList")
|
||||||
End If
|
End If
|
||||||
End Sub
|
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)
|
Friend Sub VacuumUpChanged(VacuumUpState As Boolean)
|
||||||
Dim VacuumUpButton As TwoStateButton = Nothing
|
Dim VacuumUpButton As TwoStateButton = Nothing
|
||||||
For Each MachineButton As MachineButton In m_ButtonList
|
For Each MachineButton As MachineButton In m_ButtonList
|
||||||
@@ -371,6 +401,8 @@ Public Class VacuumMachineButtonUC
|
|||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' State Range
|
||||||
|
|
||||||
Public Function GetPrivateProfileMachineButtons(
|
Public Function GetPrivateProfileMachineButtons(
|
||||||
ByVal lpAppName As String,
|
ByVal lpAppName As String,
|
||||||
ByVal lpKeyName As String,
|
ByVal lpKeyName As String,
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ Public Class CompoDimensionUC
|
|||||||
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
|
InternComponentBtn.Content = EgtMsg(MSG_COMPONENTPAGEUC + 47) ' Componenti interni
|
||||||
If Not String.IsNullOrEmpty(sCompoDir) Then
|
If Not String.IsNullOrEmpty(sCompoDir) Then
|
||||||
bEnableAlzFront = True
|
bEnableAlzFront = True
|
||||||
AlzFrontBtn.Content = "Alzatine & Frontalini"
|
AlzFrontBtn.Content = EgtMsg(91137)
|
||||||
Else
|
Else
|
||||||
AlzFrontBtn.Visibility = Visibility.Collapsed
|
AlzFrontBtn.Visibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
@@ -107,8 +107,10 @@ Public Class CompoDimensionUC
|
|||||||
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
|
Friend Sub ShowAlzFrontBtn(ByVal value As Boolean)
|
||||||
If value Then
|
If value Then
|
||||||
AlzFrontBtn.Visibility = Visibility.Visible
|
AlzFrontBtn.Visibility = Visibility.Visible
|
||||||
|
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Hidden
|
||||||
Else
|
Else
|
||||||
AlzFrontBtn.Visibility = Visibility.Hidden
|
AlzFrontBtn.Visibility = Visibility.Hidden
|
||||||
|
m_MainWindow.m_DrawPageUC.MessageGrid.Visibility = Visibility.Visible
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -283,6 +283,19 @@ Public Class DrawPageUC
|
|||||||
m_sCsvOrder = ""
|
m_sCsvOrder = ""
|
||||||
m_sCsvList = ""
|
m_sCsvList = ""
|
||||||
m_sCsvName = ""
|
m_sCsvName = ""
|
||||||
|
|
||||||
|
' Visuliazzazione dei bottoni per modifica dei componenti
|
||||||
|
If m_MainWindow.FrameCutBtn.IsChecked Then
|
||||||
|
SideAngleBtn.Visibility = Visibility.Hidden
|
||||||
|
FiloTopBtn.Visibility = Visibility.Hidden
|
||||||
|
EngraveBtn.Visibility = Visibility.Hidden
|
||||||
|
DripCutBtn.Visibility = Visibility.Hidden
|
||||||
|
Else
|
||||||
|
SideAngleBtn.Visibility = Visibility.Visible
|
||||||
|
FiloTopBtn.Visibility = Visibility.Visible
|
||||||
|
EngraveBtn.Visibility = Visibility.Visible
|
||||||
|
DripCutBtn.Visibility = Visibility.Visible
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' recupero il click sulla scena ed assegno il metodo a secondo della pagina aperta
|
' recupero il click sulla scena ed assegno il metodo a secondo della pagina aperta
|
||||||
@@ -553,6 +566,7 @@ Public Class DrawPageUC
|
|||||||
OkBtn.IsEnabled = True
|
OkBtn.IsEnabled = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' Navigazione nelle due pagine per la selezione dei componenti da disegnare
|
||||||
Friend Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
|
Friend Sub BackBtn_Click(sender As Object, e As RoutedEventArgs) Handles BackBtn.Click
|
||||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
DrawPage_Unloaded(sender, e)
|
DrawPage_Unloaded(sender, e)
|
||||||
@@ -1124,6 +1138,33 @@ Public Class DrawPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function MakeSectionFrameInsert(ByVal nNbr As Integer) As Boolean
|
||||||
|
' m_MainWindow.m_ImportPageUC.LoadFrame()
|
||||||
|
' recupero il primo layer del primo pezzo
|
||||||
|
Dim nLayerId As Integer = EgtGetFirstLayer(EgtGetFirstPart())
|
||||||
|
If nLayerId = GDB_ID.NULL Then Return False
|
||||||
|
' percorso in cui salvare tempora
|
||||||
|
Dim sTmpFile As String = m_MainWindow.GetTempDir() & "\Frame.Nge"
|
||||||
|
If Not EgtSaveObjToFile(nLayerId, sTmpFile, NGE.BIN) Then Return False
|
||||||
|
' Passo al contesto principale
|
||||||
|
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||||
|
' Inserisco il pezzo
|
||||||
|
If Not My.Computer.FileSystem.FileExists(sTmpFile) Then Return False
|
||||||
|
' eseguo inserimento
|
||||||
|
For i As Integer = 1 To nNbr
|
||||||
|
EgtInsertFile(sTmpFile)
|
||||||
|
' Ne recupero l'Id
|
||||||
|
Dim nPartId As Integer = EgtGetLastPart()
|
||||||
|
' Creo la cornice
|
||||||
|
m_MainWindow.m_FrameCutPageUC.CreateFrame(nPartId)
|
||||||
|
' Ricalcolo lavorazioni
|
||||||
|
AddFrameMachinings(m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dStartTrim, m_MainWindow.m_FrameCutPageUC.m_FrameMachiningUC.m_dEndTrim)
|
||||||
|
Next
|
||||||
|
' Cancello il file
|
||||||
|
My.Computer.FileSystem.DeleteFile(sTmpFile)
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||||
m_bBackFromInternalCompo = False
|
m_bBackFromInternalCompo = False
|
||||||
m_bInternalCompo = False
|
m_bInternalCompo = False
|
||||||
@@ -1139,7 +1180,17 @@ Public Class DrawPageUC
|
|||||||
Dim InsNbr As Integer = Int32.Parse(PartNumTxBx.Text)
|
Dim InsNbr As Integer = Int32.Parse(PartNumTxBx.Text)
|
||||||
' Passo al contesto principale
|
' Passo al contesto principale
|
||||||
'MakeInsert(InsNbr, sPartName)
|
'MakeInsert(InsNbr, sPartName)
|
||||||
|
If m_MainWindow.FrameCutBtn.IsChecked Then
|
||||||
|
MakeSectionFrameInsert(InsNbr)
|
||||||
|
Else
|
||||||
MakeMultipleInsert(InsNbr, sPartName)
|
MakeMultipleInsert(InsNbr, sPartName)
|
||||||
|
End If
|
||||||
|
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
|
' Aggiorno ambiente principale
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
' Elimino nome del componente precedente
|
' Elimino nome del componente precedente
|
||||||
@@ -1153,8 +1204,21 @@ Public Class DrawPageUC
|
|||||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
|
||||||
|
Else
|
||||||
|
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
|
DrawPage_Unloaded(sender, e)
|
||||||
|
' Elimino nome del componente precedente
|
||||||
|
m_sCompoName = String.Empty
|
||||||
|
' Reset inclinazioni
|
||||||
|
m_SideAngleUC.DeleteSideAngle()
|
||||||
|
If String.IsNullOrEmpty(m_MainComponentPage.m_SecondaryComponentPage.m_sCurrCompo) Then
|
||||||
|
DrawPage_Loaded(sender, e)
|
||||||
|
Else
|
||||||
|
LoadSecondaryPage()
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' esco dalla pagina corrente
|
' esco dalla pagina corrente
|
||||||
@@ -1174,7 +1238,7 @@ Public Class DrawPageUC
|
|||||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_DrawPageUC)
|
||||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
m_MainWindow.m_ActivePage = If(m_MainWindow.FrameCutBtn.IsChecked, MainWindow.Pages.FrameCut, MainWindow.Pages.CadCut)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
|
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
|
||||||
@@ -1447,16 +1511,38 @@ Public Class DrawPageUC
|
|||||||
Select Case m_ActiveComponentPage
|
Select Case m_ActiveComponentPage
|
||||||
Case Pages.MainComponent
|
Case Pages.MainComponent
|
||||||
LeftButtonGrd.Children.Remove(m_MainComponentPage)
|
LeftButtonGrd.Children.Remove(m_MainComponentPage)
|
||||||
|
|
||||||
Case Pages.SecondaryComponent
|
Case Pages.SecondaryComponent
|
||||||
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
|
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
|
||||||
|
|
||||||
Case Pages.InternalComponent
|
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
|
Case Pages.CompoDimension
|
||||||
VariablesGrd.Children.Remove(m_CompoDimension)
|
VariablesGrd.Children.Remove(m_CompoDimension)
|
||||||
|
|
||||||
Case Pages.SideAngle
|
Case Pages.SideAngle
|
||||||
|
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)
|
VariablesGrd.Children.Remove(m_SideAngleUC)
|
||||||
|
|
||||||
Case Pages.FiloTop
|
Case Pages.FiloTop
|
||||||
|
FiloTopBtn.IsChecked = False
|
||||||
|
FiloTopBtn_Click(Nothing, Nothing)
|
||||||
VariablesGrd.Children.Remove(m_FiloTopUC)
|
VariablesGrd.Children.Remove(m_FiloTopUC)
|
||||||
|
|
||||||
|
Case Pages.AlzFront
|
||||||
|
LeftButtonGrd.Children.Remove(m_CompoDimension.m_AlzFrontPage)
|
||||||
|
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
' Pulisco l'ambiente lua
|
' Pulisco l'ambiente lua
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ Public Class FiloTopUC
|
|||||||
' Imposto messaggi
|
' Imposto messaggi
|
||||||
ParameterTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
|
ParameterTxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
|
||||||
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
|
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
|
||||||
|
Parameter3TxBl.Text = EgtMsg(91138)
|
||||||
|
|
||||||
If m_CallingPage = MainWindow.Pages.Draw Then
|
If m_CallingPage = MainWindow.Pages.Draw Then
|
||||||
' Imposto questa come pagina correntemente visualizzata nella drawpage
|
' Imposto questa come pagina correntemente visualizzata nella drawpage
|
||||||
@@ -214,6 +215,9 @@ Public Class FiloTopUC
|
|||||||
EgtErase(nLayFiloTop)
|
EgtErase(nLayFiloTop)
|
||||||
EgtRemoveInfo(nLayId, "FiloTopRef")
|
EgtRemoveInfo(nLayId, "FiloTopRef")
|
||||||
EgtOutLog("Error in generation OffsetPreView in TopEgde ")
|
EgtOutLog("Error in generation OffsetPreView in TopEgde ")
|
||||||
|
Else
|
||||||
|
m_MainWindow.m_DrawPageUC.MessageTxBx.Text = ""
|
||||||
|
m_MainWindow.m_DrawPageUC.MessageBrd.Background = Brushes.Transparent
|
||||||
End If
|
End If
|
||||||
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
|
' ---------------------- Fine GESTIONE PREVIEW percorso -------------------------------
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
<ToggleButton Name="FiloTopBtn" Grid.Column="1"
|
<ToggleButton Name="FiloTopBtn" Grid.Column="1"
|
||||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||||
<ToggleButton Name="DripCutBtn" Grid.Column="2" Padding="0"
|
<ToggleButton Name="DripCutBtn" Grid.Column="2" Padding="0"
|
||||||
|
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||||
|
<ToggleButton Name="EngraveBtn" Grid.Column="2"
|
||||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||||
<ToggleButton Name="DripDrillBtn" Grid.Column="3" Padding="0"
|
<ToggleButton Name="DripDrillBtn" Grid.Column="3" Padding="0"
|
||||||
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
Style="{DynamicResource OmagCut_RightGrayYellowTextToggleButton}"/>
|
||||||
@@ -58,7 +60,7 @@
|
|||||||
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
|
<ListBox Name="FileListBox" Grid.Row="1" Grid.RowSpan="2" ItemTemplate="{DynamicResource DataTemplateItem}"
|
||||||
ItemsSource="{Binding ItemList}"/>
|
ItemsSource="{Binding ItemList}"/>
|
||||||
|
|
||||||
<Grid Grid.Row="3" Margin="0,0,8,0">
|
<Grid Name="FinderGrd" Grid.Row="3" Margin="0,0,8,0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="4*"/>
|
<ColumnDefinition Width="4*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ Public Class ImportPageUC
|
|||||||
Friend WithEvents ImportScene As New Scene
|
Friend WithEvents ImportScene As New Scene
|
||||||
Private ImportSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
Private ImportSceneHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
||||||
|
|
||||||
|
Private m_SelListHole As New List(Of Integer)
|
||||||
|
Private m_DeselectListHole As New List(Of Integer)
|
||||||
|
|
||||||
' Properties
|
' Properties
|
||||||
Private m_sCurrDir As String = String.Empty
|
Private m_sCurrDir As String = String.Empty
|
||||||
Private m_sCurrFile As String = String.Empty
|
Private m_sCurrFile As String = String.Empty
|
||||||
@@ -85,6 +88,7 @@ Public Class ImportPageUC
|
|||||||
SideAngleBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 7) 'Inclina lati
|
SideAngleBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 7) 'Inclina lati
|
||||||
FiloTopBtn.Content = EgtMsg( 90400) 'Filo Top
|
FiloTopBtn.Content = EgtMsg( 90400) 'Filo Top
|
||||||
DripCutBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 8) 'Incidi da sotto
|
DripCutBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 8) 'Incidi da sotto
|
||||||
|
EngraveBtn.Content = "Engrave"
|
||||||
DripDrillBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 14) 'Foro da sotto
|
DripDrillBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 14) 'Foro da sotto
|
||||||
Cad2dBtn.Content = "Cad 2d"
|
Cad2dBtn.Content = "Cad 2d"
|
||||||
|
|
||||||
@@ -101,6 +105,8 @@ Public Class ImportPageUC
|
|||||||
' abilitazione Ordine e Distinta per importazione DXF
|
' abilitazione Ordine e Distinta per importazione DXF
|
||||||
m_bEnableOrderList = (m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut And
|
m_bEnableOrderList = (m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut And
|
||||||
GetPrivateProfileInt(S_COMPO, K_CSVDATA, 0, m_MainWindow.GetIniFile()) <> 0)
|
GetPrivateProfileInt(S_COMPO, K_CSVDATA, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||||
|
' rendo visibilie il pulsante di ricerca file
|
||||||
|
FinderGrd.Visibility = Visibility.Visible
|
||||||
|
|
||||||
If m_bFirst Then
|
If m_bFirst Then
|
||||||
' imposto colore di default
|
' imposto colore di default
|
||||||
@@ -158,6 +164,10 @@ Public Class ImportPageUC
|
|||||||
|
|
||||||
' Pulisco tutto
|
' Pulisco tutto
|
||||||
ClearView()
|
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()
|
FileListBox.UnselectAll()
|
||||||
' inibisco selezione diretta da Scene
|
' inibisco selezione diretta da Scene
|
||||||
ImportScene.SetStatusNull()
|
ImportScene.SetStatusNull()
|
||||||
@@ -196,7 +206,6 @@ Public Class ImportPageUC
|
|||||||
PartNumTxBx.Text = "1"
|
PartNumTxBx.Text = "1"
|
||||||
' disabilito ok
|
' disabilito ok
|
||||||
OkBtn.IsEnabled = False
|
OkBtn.IsEnabled = False
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub LoadGridData()
|
Private Sub LoadGridData()
|
||||||
@@ -339,7 +348,12 @@ Public Class ImportPageUC
|
|||||||
ResetBtn.IsEnabled = False
|
ResetBtn.IsEnabled = False
|
||||||
SideAngleBtn.IsEnabled = False
|
SideAngleBtn.IsEnabled = False
|
||||||
FiloTopBtn.IsEnabled = False
|
FiloTopBtn.IsEnabled = False
|
||||||
|
' Evito di settare le proprietà di oggeti che sono con visibilità Hidden
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = False
|
DripCutBtn.IsEnabled = False
|
||||||
|
Else
|
||||||
|
EngraveBtn.IsEnabled = False
|
||||||
|
End If
|
||||||
DripDrillBtn.IsEnabled = False
|
DripDrillBtn.IsEnabled = False
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
@@ -357,6 +371,10 @@ Public Class ImportPageUC
|
|||||||
Dim dScale As Double = If(m_bMM, ONEMM, ONEINCH)
|
Dim dScale As Double = If(m_bMM, ONEMM, ONEINCH)
|
||||||
' Importo file DXF
|
' Importo file DXF
|
||||||
bOk = bOk AndAlso EgtImportDxf(sPath, dScale)
|
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
|
ElseIf m_nFileType = FT.NGE Then
|
||||||
' Carico Nge
|
' Carico Nge
|
||||||
bOk = bOk AndAlso EgtOpenFile(sPath)
|
bOk = bOk AndAlso EgtOpenFile(sPath)
|
||||||
@@ -396,7 +414,11 @@ Public Class ImportPageUC
|
|||||||
OkBtn.IsEnabled = False
|
OkBtn.IsEnabled = False
|
||||||
SideAngleBtn.IsEnabled = False
|
SideAngleBtn.IsEnabled = False
|
||||||
FiloTopBtn.IsEnabled = False
|
FiloTopBtn.IsEnabled = False
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = False
|
DripCutBtn.IsEnabled = False
|
||||||
|
Else
|
||||||
|
EngraveBtn.IsEnabled = False
|
||||||
|
End If
|
||||||
DripDrillBtn.IsEnabled = False
|
DripDrillBtn.IsEnabled = False
|
||||||
ElseIf m_nFileType = FT_TRF Or m_nFileType = FT_CUT Then
|
ElseIf m_nFileType = FT_TRF Or m_nFileType = FT_CUT Then
|
||||||
' abilito bottone Insert, disabilito bottoni UseLayer, UseClosedCurve, UseRegion e Reset
|
' abilito bottone Insert, disabilito bottoni UseLayer, UseClosedCurve, UseRegion e Reset
|
||||||
@@ -412,7 +434,11 @@ Public Class ImportPageUC
|
|||||||
OkBtn.IsEnabled = True
|
OkBtn.IsEnabled = True
|
||||||
SideAngleBtn.IsEnabled = False
|
SideAngleBtn.IsEnabled = False
|
||||||
FiloTopBtn.IsEnabled = False
|
FiloTopBtn.IsEnabled = False
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = False
|
DripCutBtn.IsEnabled = False
|
||||||
|
Else
|
||||||
|
EngraveBtn.IsEnabled = False
|
||||||
|
End If
|
||||||
DripDrillBtn.IsEnabled = False
|
DripDrillBtn.IsEnabled = False
|
||||||
End If
|
End If
|
||||||
' altrimenti import per cornici
|
' altrimenti import per cornici
|
||||||
@@ -425,7 +451,7 @@ Public Class ImportPageUC
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ImportScene.OnMouseDownScene
|
Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles ImportScene.OnMouseDownScene
|
||||||
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Then
|
If SideAngleBtn.IsChecked() Or DripCutBtn.IsChecked() Or EngraveBtn.IsChecked Then
|
||||||
OnMouseDownSceneSideAngle(e)
|
OnMouseDownSceneSideAngle(e)
|
||||||
ElseIf DripDrillBtn.IsChecked() Then
|
ElseIf DripDrillBtn.IsChecked() Then
|
||||||
OnMouseDownSceneUnderDrill(e)
|
OnMouseDownSceneUnderDrill(e)
|
||||||
@@ -569,6 +595,8 @@ Public Class ImportPageUC
|
|||||||
EgtSetColor(nEntId, New Color3d(127, 63, 0))
|
EgtSetColor(nEntId, New Color3d(127, 63, 0))
|
||||||
nEntId = EgtGetNext( nEntId)
|
nEntId = EgtGetNext( nEntId)
|
||||||
End While
|
End While
|
||||||
|
m_DeselectListHole.Add(nLayId)
|
||||||
|
m_SelListHole.Remove(nLayId)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Dim nLayId As Integer = GDB_ID.NULL
|
Dim nLayId As Integer = GDB_ID.NULL
|
||||||
@@ -585,6 +613,8 @@ Public Class ImportPageUC
|
|||||||
EgtSetColor(nEntId, New Color3d(255, 255, 255))
|
EgtSetColor(nEntId, New Color3d(255, 255, 255))
|
||||||
nEntId = EgtGetNext( nEntId)
|
nEntId = EgtGetNext( nEntId)
|
||||||
End While
|
End While
|
||||||
|
m_SelListHole.Add(nLayId)
|
||||||
|
m_DeselectListHole.Remove(nLayId)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -592,6 +622,12 @@ Public Class ImportPageUC
|
|||||||
End If
|
End If
|
||||||
nId = EgtGetNextObjInSelWin()
|
nId = EgtGetNextObjInSelWin()
|
||||||
End While
|
End While
|
||||||
|
m_FiloTopUC.CreateFiloTopPreView(m_SelListHole)
|
||||||
|
m_FiloTopUC.EraseFiloTopPreview(m_DeselectListHole)
|
||||||
|
If m_SelListHole.Count > 0 Then
|
||||||
|
MessageTxBx.Text = ""
|
||||||
|
MessageBrd.Background = Brushes.Transparent
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OnShowDistanceVector(sender As Object, vtDist As Vector3d) Handles ImportScene.OnShowDistanceVector
|
Private Sub OnShowDistanceVector(sender As Object, vtDist As Vector3d) Handles ImportScene.OnShowDistanceVector
|
||||||
@@ -601,7 +637,7 @@ Public Class ImportPageUC
|
|||||||
|
|
||||||
Private Sub SelectedPartChanged()
|
Private Sub SelectedPartChanged()
|
||||||
' Se sono in modalità inclinazioni o gocciolatoio calcolo lati inclinabili e creo testi
|
' 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()
|
m_SideAngleUC.ReLoadSideAnglePage()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -662,8 +698,12 @@ Public Class ImportPageUC
|
|||||||
' abilito bottone angoli su lati esterni
|
' abilito bottone angoli su lati esterni
|
||||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
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
|
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||||
End Sub
|
End Sub
|
||||||
@@ -694,8 +734,12 @@ Public Class ImportPageUC
|
|||||||
' abilito bottone angoli su lati esterni
|
' abilito bottone angoli su lati esterni
|
||||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
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
|
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||||
End Sub
|
End Sub
|
||||||
@@ -726,8 +770,12 @@ Public Class ImportPageUC
|
|||||||
' abilito bottone angoli su lati esterni
|
' abilito bottone angoli su lati esterni
|
||||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
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
|
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1011,12 +1059,14 @@ Public Class ImportPageUC
|
|||||||
' Salvo direttorio corrente
|
' Salvo direttorio corrente
|
||||||
WritePrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, m_sCurrDir, m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, m_sCurrDir, m_MainWindow.GetIniFile())
|
||||||
' Tolgo pagina inclinazioni/gocciolatoi se attiva
|
' 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
|
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||||
FileListBox.Visibility = Windows.Visibility.Visible
|
FileListBox.Visibility = Windows.Visibility.Visible
|
||||||
LeftGrid.Children.Remove(m_SideAngleUC)
|
LeftGrid.Children.Remove(m_SideAngleUC)
|
||||||
If SideAngleBtn.IsChecked() Then
|
If SideAngleBtn.IsChecked() Then
|
||||||
SideAngleBtn.IsChecked = False
|
SideAngleBtn.IsChecked = False
|
||||||
|
ElseIf EngraveBtn.IsChecked() Then
|
||||||
|
EngraveBtn.IsChecked = False
|
||||||
Else
|
Else
|
||||||
DripCutBtn.IsChecked() = False
|
DripCutBtn.IsChecked() = False
|
||||||
End If
|
End If
|
||||||
@@ -1040,6 +1090,7 @@ Public Class ImportPageUC
|
|||||||
|
|
||||||
Private Sub SideAngleBtn_Click(sender As Object, e As RoutedEventArgs) Handles SideAngleBtn.Click
|
Private Sub SideAngleBtn_Click(sender As Object, e As RoutedEventArgs) Handles SideAngleBtn.Click
|
||||||
If SideAngleBtn.IsChecked() Then
|
If SideAngleBtn.IsChecked() Then
|
||||||
|
FinderGrd.Visibility = Visibility.Hidden
|
||||||
' Aggiungo regioni per percorsi interni
|
' Aggiungo regioni per percorsi interni
|
||||||
AdjustSelectRegions()
|
AdjustSelectRegions()
|
||||||
' Dichiaro nessuna selezione
|
' Dichiaro nessuna selezione
|
||||||
@@ -1052,7 +1103,11 @@ Public Class ImportPageUC
|
|||||||
FileListBox.Visibility = Windows.Visibility.Hidden
|
FileListBox.Visibility = Windows.Visibility.Hidden
|
||||||
' Disabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
|
' Disabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
|
||||||
FiloTopBtn.IsEnabled = False
|
FiloTopBtn.IsEnabled = False
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = False
|
DripCutBtn.IsEnabled = False
|
||||||
|
Else
|
||||||
|
EngraveBtn.IsEnabled = False
|
||||||
|
End If
|
||||||
DripDrillBtn.IsEnabled = False
|
DripDrillBtn.IsEnabled = False
|
||||||
mmBtn.IsEnabled = False
|
mmBtn.IsEnabled = False
|
||||||
inchBtn.IsEnabled = False
|
inchBtn.IsEnabled = False
|
||||||
@@ -1062,6 +1117,7 @@ Public Class ImportPageUC
|
|||||||
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
|
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
|
||||||
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
||||||
Else
|
Else
|
||||||
|
FinderGrd.Visibility = Visibility.Visible
|
||||||
' Rimuovo regioni per percorsi interni
|
' Rimuovo regioni per percorsi interni
|
||||||
RemoveSelectRegions()
|
RemoveSelectRegions()
|
||||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||||
@@ -1073,8 +1129,72 @@ Public Class ImportPageUC
|
|||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
' Riabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
|
' Riabilito FiloTopBtn, DripCutBtn, DripDrillBtn e unità di misura
|
||||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
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
|
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||||
mmBtn.IsEnabled = True
|
mmBtn.IsEnabled = True
|
||||||
@@ -1092,6 +1212,7 @@ Public Class ImportPageUC
|
|||||||
|
|
||||||
Private Sub DripCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles DripCutBtn.Click
|
Private Sub DripCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles DripCutBtn.Click
|
||||||
If DripCutBtn.IsChecked() Then
|
If DripCutBtn.IsChecked() Then
|
||||||
|
FinderGrd.Visibility = Visibility.Hidden
|
||||||
' Dichiaro nessuna selezione
|
' Dichiaro nessuna selezione
|
||||||
m_nSelectedPart = GDB_ID.NULL
|
m_nSelectedPart = GDB_ID.NULL
|
||||||
m_nSelectedLayer = GDB_ID.NULL
|
m_nSelectedLayer = GDB_ID.NULL
|
||||||
@@ -1103,6 +1224,9 @@ Public Class ImportPageUC
|
|||||||
' Disabilito SideAngleBtn,FiloTop, DripDrillBtn e unità di misura
|
' Disabilito SideAngleBtn,FiloTop, DripDrillBtn e unità di misura
|
||||||
SideAngleBtn.IsEnabled = False
|
SideAngleBtn.IsEnabled = False
|
||||||
FiloTopBtn.IsEnabled = False
|
FiloTopBtn.IsEnabled = False
|
||||||
|
If DripCutBtn.Visibility <> Visibility.Visible Then
|
||||||
|
EngraveBtn.IsEnabled = False
|
||||||
|
End If
|
||||||
DripDrillBtn.IsEnabled = False
|
DripDrillBtn.IsEnabled = False
|
||||||
mmBtn.IsEnabled = False
|
mmBtn.IsEnabled = False
|
||||||
inchBtn.IsEnabled = False
|
inchBtn.IsEnabled = False
|
||||||
@@ -1112,6 +1236,7 @@ Public Class ImportPageUC
|
|||||||
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
|
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno
|
||||||
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
||||||
Else
|
Else
|
||||||
|
FinderGrd.Visibility = Visibility.Visible
|
||||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||||
FileListBox.Visibility = Windows.Visibility.Visible
|
FileListBox.Visibility = Windows.Visibility.Visible
|
||||||
LeftGrid.Children.Remove(m_SideAngleUC)
|
LeftGrid.Children.Remove(m_SideAngleUC)
|
||||||
@@ -1122,8 +1247,9 @@ Public Class ImportPageUC
|
|||||||
' Riabilito SideAngleBtn, FiloTop, DripDrillBtn e unità di misura
|
' Riabilito SideAngleBtn, FiloTop, DripDrillBtn e unità di misura
|
||||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||||
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
If DripCutBtn.Visibility <> Visibility.Visible Then
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||||
|
End If
|
||||||
mmBtn.IsEnabled = True
|
mmBtn.IsEnabled = True
|
||||||
inchBtn.IsEnabled = True
|
inchBtn.IsEnabled = True
|
||||||
' Elimino scritte angoli per input e inserisco quelle definitive
|
' Elimino scritte angoli per input e inserisco quelle definitive
|
||||||
@@ -1142,6 +1268,7 @@ Public Class ImportPageUC
|
|||||||
|
|
||||||
Private Sub DripDrillBtn_Click(sender As Object, e As RoutedEventArgs) Handles DripDrillBtn.Click
|
Private Sub DripDrillBtn_Click(sender As Object, e As RoutedEventArgs) Handles DripDrillBtn.Click
|
||||||
If DripDrillBtn.IsChecked() Then
|
If DripDrillBtn.IsChecked() Then
|
||||||
|
FinderGrd.Visibility = Visibility.Hidden
|
||||||
' Aggiungo regioni di selezione per percorsi interni
|
' Aggiungo regioni di selezione per percorsi interni
|
||||||
AdjustSelectRegions()
|
AdjustSelectRegions()
|
||||||
' Imposto modalità fori da sotto
|
' Imposto modalità fori da sotto
|
||||||
@@ -1151,7 +1278,11 @@ Public Class ImportPageUC
|
|||||||
' Disabilito SideAngleBtn, FiloTop, DripCutBtn e unità di misura
|
' Disabilito SideAngleBtn, FiloTop, DripCutBtn e unità di misura
|
||||||
SideAngleBtn.IsEnabled = False
|
SideAngleBtn.IsEnabled = False
|
||||||
FiloTopBtn.IsEnabled = False
|
FiloTopBtn.IsEnabled = False
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = False
|
DripCutBtn.IsEnabled = False
|
||||||
|
Else
|
||||||
|
EngraveBtn.IsEnabled = False
|
||||||
|
End If
|
||||||
mmBtn.IsEnabled = False
|
mmBtn.IsEnabled = False
|
||||||
inchBtn.IsEnabled = False
|
inchBtn.IsEnabled = False
|
||||||
' Disabilito bottone reset
|
' Disabilito bottone reset
|
||||||
@@ -1160,6 +1291,7 @@ Public Class ImportPageUC
|
|||||||
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 15) ' Selezionare uno o più fori
|
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 15) ' Selezionare uno o più fori
|
||||||
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
||||||
Else
|
Else
|
||||||
|
FinderGrd.Visibility = Visibility.Visible
|
||||||
' Rimuovo regioni per percorsi interni
|
' Rimuovo regioni per percorsi interni
|
||||||
RemoveSelectRegions()
|
RemoveSelectRegions()
|
||||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||||
@@ -1172,8 +1304,12 @@ Public Class ImportPageUC
|
|||||||
' Riabilito SideAngleBtn, FiloTop, DripCutBtn e unità di misura
|
' Riabilito SideAngleBtn, FiloTop, DripCutBtn e unità di misura
|
||||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||||
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
FiloTopBtn.IsEnabled = m_MainWindow.m_CurrentMachine.bMilling
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
||||||
|
Else
|
||||||
|
EngraveBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||||
|
End If
|
||||||
mmBtn.IsEnabled = True
|
mmBtn.IsEnabled = True
|
||||||
inchBtn.IsEnabled = True
|
inchBtn.IsEnabled = True
|
||||||
' Riabilito bottone reset
|
' Riabilito bottone reset
|
||||||
@@ -1187,6 +1323,7 @@ Public Class ImportPageUC
|
|||||||
|
|
||||||
Private Sub FiloTopBtn_Click(sender As Object, e As RoutedEventArgs) Handles FiloTopBtn.Click
|
Private Sub FiloTopBtn_Click(sender As Object, e As RoutedEventArgs) Handles FiloTopBtn.Click
|
||||||
If FiloTopBtn.IsChecked() Then
|
If FiloTopBtn.IsChecked() Then
|
||||||
|
FinderGrd.Visibility = Visibility.Hidden
|
||||||
' Aggiungo regioni per percorsi interni
|
' Aggiungo regioni per percorsi interni
|
||||||
AdjustSelectRegions()
|
AdjustSelectRegions()
|
||||||
' Dichiaro nessuna selezione
|
' Dichiaro nessuna selezione
|
||||||
@@ -1198,7 +1335,11 @@ Public Class ImportPageUC
|
|||||||
FileListBox.Visibility = Windows.Visibility.Hidden
|
FileListBox.Visibility = Windows.Visibility.Hidden
|
||||||
' Disabilito SideAngleBtn, DripCutBtn, DripDrillBtn e unità di misura
|
' Disabilito SideAngleBtn, DripCutBtn, DripDrillBtn e unità di misura
|
||||||
SideAngleBtn.IsEnabled = False
|
SideAngleBtn.IsEnabled = False
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = False
|
DripCutBtn.IsEnabled = False
|
||||||
|
Else
|
||||||
|
EngraveBtn.IsEnabled = False
|
||||||
|
End If
|
||||||
DripDrillBtn.IsEnabled = False
|
DripDrillBtn.IsEnabled = False
|
||||||
mmBtn.IsEnabled = False
|
mmBtn.IsEnabled = False
|
||||||
inchBtn.IsEnabled = False
|
inchBtn.IsEnabled = False
|
||||||
@@ -1208,6 +1349,7 @@ Public Class ImportPageUC
|
|||||||
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno interno
|
MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 6) ' Selezionare un contorno interno
|
||||||
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
MessageBrd.Background = Application.Current.FindResource("OmagCut_Green")
|
||||||
Else
|
Else
|
||||||
|
FinderGrd.Visibility = Visibility.Visible
|
||||||
' Rimuovo regioni per percorsi interni
|
' Rimuovo regioni per percorsi interni
|
||||||
RemoveSelectRegions()
|
RemoveSelectRegions()
|
||||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||||
@@ -1219,8 +1361,12 @@ Public Class ImportPageUC
|
|||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
' Riabilito SideAngleBtn, DripCutBtn, DripDrillBtn e unità di misura
|
' Riabilito SideAngleBtn, DripCutBtn, DripDrillBtn e unità di misura
|
||||||
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
SideAngleBtn.IsEnabled = m_MainWindow.m_DrawPageUC.bEnableSideAngle
|
||||||
|
If DripCutBtn.Visibility = Visibility.Visible Then
|
||||||
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
DripCutBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripSaw)
|
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
|
DripDrillBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT) And
|
||||||
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
Not String.IsNullOrWhiteSpace(m_MainWindow.m_CurrentMachine.sCurrDripDrill)
|
||||||
mmBtn.IsEnabled = True
|
mmBtn.IsEnabled = True
|
||||||
|
|||||||
@@ -33,14 +33,31 @@ Public Class MainComponentPageUC
|
|||||||
m_bIsFirstPage = True
|
m_bIsFirstPage = True
|
||||||
LoadPage()
|
LoadPage()
|
||||||
CurrentBtn = Nothing
|
CurrentBtn = Nothing
|
||||||
|
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.ColumnProperty, 0)
|
||||||
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
||||||
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
||||||
LabelCompo9.Visibility = Windows.Visibility.Visible
|
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.SideAngleBtn.IsEnabled = False
|
||||||
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
|
m_MainWindow.m_DrawPageUC.FiloTopBtn.IsEnabled = False
|
||||||
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
|
m_MainWindow.m_DrawPageUC.EngraveBtn.IsEnabled = False
|
||||||
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
|
m_MainWindow.m_DrawPageUC.DripCutBtn.IsEnabled = False
|
||||||
|
m_MainWindow.m_DrawPageUC.m_bBackFromInternalCompo = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GetButton(ByVal nInd As Integer) As Button
|
Private Function GetButton(ByVal nInd As Integer) As Button
|
||||||
@@ -167,7 +184,7 @@ Public Class MainComponentPageUC
|
|||||||
|
|
||||||
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click
|
Private Sub Compo_Click(sender As Object, e As RoutedEventArgs) Handles Compo1.Click, Compo2.Click, Compo3.Click, Compo4.Click, Compo5.Click, Compo6.Click, Compo7.Click, Compo8.Click
|
||||||
CurrentBtn = DirectCast(e.Source, Button)
|
CurrentBtn = DirectCast(e.Source, Button)
|
||||||
Dim CompoName As String = S_COMPO & GetIndexFromButton(CurrentBtn).ToString
|
Dim CompoName As String = If(m_MainWindow.FrameCutBtn.IsChecked, S_FRAMECOMPO, S_COMPO) & GetIndexFromButton(CurrentBtn).ToString
|
||||||
m_sCurrCompoFam = CompoName
|
m_sCurrCompoFam = CompoName
|
||||||
m_SecondaryComponentPage.m_sCurrCompo = String.Empty
|
m_SecondaryComponentPage.m_sCurrCompo = String.Empty
|
||||||
Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
Dim nCount As Integer = GetPrivateProfileInt(CompoName, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
||||||
@@ -251,6 +268,11 @@ Public Class MainComponentPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub LoadPage()
|
Private Sub LoadPage()
|
||||||
|
If m_MainWindow.FrameCutBtn.IsChecked Then
|
||||||
|
LoadFramePage()
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
Dim nDeltaSecondPage As Integer = 8
|
Dim nDeltaSecondPage As Integer = 8
|
||||||
' Leggo numero di componenti presenti
|
' Leggo numero di componenti presenti
|
||||||
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_COMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_COMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
||||||
@@ -325,16 +347,86 @@ Public Class MainComponentPageUC
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LoadFramePage()
|
||||||
|
Dim nDeltaSecondPage As Integer = 8
|
||||||
|
' Leggo numero di componenti presenti
|
||||||
|
Dim nCompoNumber As Integer = GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile())
|
||||||
|
' Calcolo indici a seconda della pagina in cui sono
|
||||||
|
If m_bIsFirstPage Then
|
||||||
|
ClearButton(nCompoNumber)
|
||||||
|
nDeltaSecondPage = 0
|
||||||
|
Else
|
||||||
|
ClearButton(nCompoNumber)
|
||||||
|
nDeltaSecondPage = 8
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Creazione converter da String a ImageSource
|
||||||
|
Dim ImageConverter As New ImageSourceConverter
|
||||||
|
Dim ThicknessConverter As New ThicknessConverter
|
||||||
|
|
||||||
|
'Assegnazione immagine e testo ai Button
|
||||||
|
For index As Integer = 1 To 8
|
||||||
|
Dim CustomThickness As New Thickness(0)
|
||||||
|
Dim nCompoName As Integer = GetPrivateProfileInt(S_FRAMECOMPO & index + nDeltaSecondPage, "Name", 0, m_MainWindow.GetIniFile())
|
||||||
|
Dim sCompoImage As String = ""
|
||||||
|
Dim sCompoImageSource As ImageSource
|
||||||
|
|
||||||
|
'verifico presenza immagine e la aggiungo
|
||||||
|
If GetPrivateProfileString(S_FRAMECOMPO & index + nDeltaSecondPage, "Image", "", sCompoImage, m_MainWindow.GetIniFile()) <> 0 Then
|
||||||
|
Try
|
||||||
|
sCompoImageSource = ImageConverter.ConvertFromString(m_MainWindow.GetResourcesDir() & "\" & sCompoImage)
|
||||||
|
GetImage(index).Height = 65
|
||||||
|
GetImage(index).Width = 65
|
||||||
|
GetImage(index).Source = sCompoImageSource
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog("Error loading image " & sCompoImage)
|
||||||
|
sCompoImage = String.Empty
|
||||||
|
GetImage(index).Height = 0
|
||||||
|
GetImage(index).Width = 0
|
||||||
|
CustomThickness.Right = 0
|
||||||
|
GetImage(index).Margin = CustomThickness
|
||||||
|
End Try
|
||||||
|
Else
|
||||||
|
'Se non c'è l'immagine azzero la distanza tra testo e immagine
|
||||||
|
CustomThickness.Right = 0
|
||||||
|
GetImage(index).Margin = CustomThickness
|
||||||
|
End If
|
||||||
|
|
||||||
|
'verifico presenza testo
|
||||||
|
If nCompoName > 0 Then
|
||||||
|
Dim sCompoName As String = EgtMsg(MSG_COMPONENTPAGEUC + nCompoName)
|
||||||
|
'verifico presenza immagine
|
||||||
|
If sCompoImage.Length > 0 Then
|
||||||
|
'se la lunghezza del testo è maggiore di 15 lo taglio
|
||||||
|
If sCompoName.Length > 15 Then
|
||||||
|
sCompoName = sCompoName.Substring(0, 15)
|
||||||
|
End If
|
||||||
|
GetLabel(index).Text = sCompoName
|
||||||
|
'Se ci sono sia testo che immagine imposto un margine di 10
|
||||||
|
CustomThickness.Right = 10
|
||||||
|
GetImage(index).Margin = CustomThickness
|
||||||
|
Else
|
||||||
|
'se l'immagine non c'è e il testo è maggiore di 20 lo taglio
|
||||||
|
If sCompoName.Length > 20 Then
|
||||||
|
sCompoName = sCompoName.Substring(0, 20)
|
||||||
|
End If
|
||||||
|
GetLabel(index).Text = sCompoName
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
'Se non c'è testo azzero la distanza tra testo e immagine
|
||||||
|
CustomThickness.Right = 0
|
||||||
|
GetImage(index).Margin = CustomThickness
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
' Gestione bottone altri componenti
|
' Gestione bottone altri componenti
|
||||||
Private Sub Compo9_Click(sender As Object, e As RoutedEventArgs) Handles Compo9.Click
|
Private Sub Compo9_Click(sender As Object, e As RoutedEventArgs) Handles Compo9.Click
|
||||||
If m_bIsFirstPage Then
|
If m_bIsFirstPage Then
|
||||||
m_bIsFirstPage = False
|
m_bIsFirstPage = False
|
||||||
LoadPage()
|
LoadPage()
|
||||||
'Compo9.SetValue(Grid.ColumnProperty, 1)
|
|
||||||
'Compo9.SetValue(Grid.ColumnSpanProperty, 1)
|
|
||||||
'ImageCompo9.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NumericKeyboardArrow.png", UriKind.Relative))
|
|
||||||
'ImageCompo9.Visibility = Windows.Visibility.Visible
|
|
||||||
'LabelCompo9.Visibility = Windows.Visibility.Hidden
|
|
||||||
Compo9.SetValue(Grid.ColumnProperty, 0)
|
Compo9.SetValue(Grid.ColumnProperty, 0)
|
||||||
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
Compo9.SetValue(Grid.ColumnSpanProperty, 2)
|
||||||
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
ImageCompo9.Visibility = Windows.Visibility.Hidden
|
||||||
|
|||||||
@@ -39,6 +39,15 @@
|
|||||||
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
<Button Name="RawPartBtn" Grid.Column="1" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<Button Name="CompoBtn" Grid.Column="2" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
|
<Image Source="{DynamicResource DrawImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Name="SelSectionBtn" Grid.Column="3" Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
|
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
|
<ToggleButton Name="MachiningBtn" Grid.Column="4" Style="{DynamicResource OmagCut_RightGrayYellowIconToggleButton}">
|
||||||
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource FrameMachiningImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
@@ -63,8 +72,10 @@
|
|||||||
<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.8*"/>
|
<RowDefinition Height="0.8*"/>
|
||||||
<RowDefinition Height="2.5*"/>
|
<RowDefinition Height="0.8*"/>
|
||||||
|
<RowDefinition Height="1.7*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
<ComboBox Name="AlongAxCmBx" Grid.Row="0" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_ComboBox}"
|
||||||
@@ -77,14 +88,13 @@
|
|||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
|
||||||
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
<UniformGrid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
||||||
<Button Name="SelSectionBtn"
|
<!--<Button Name="SelSectionBtn"
|
||||||
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource Sezione-corniceImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>-->
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Button Name="SelGuideBtn"
|
<Button Name="SelGuideBtn" Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
|
||||||
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
<UniformGrid Name="ArcGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" Columns="2" >
|
||||||
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
<TextBlock Name="ArcRadTxBl" Grid.Row="2" Grid.ColumnSpan="2"
|
||||||
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
@@ -113,7 +123,12 @@
|
|||||||
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
|
<EgtWPFLib:EgtTextBox Name="OffsYyTxBx" Grid.Column="2" Grid.Row="4" Width="50"
|
||||||
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
|
<TextBlock Name="OffsXInteryTxBl" Grid.Row="5" Grid.ColumnSpan="2"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="OffsXInteryTxBx" Grid.Column="2" Grid.Row="5" Width="50"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
|
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
|
||||||
<Button Name="MirrorPartBtn"
|
<Button Name="MirrorPartBtn"
|
||||||
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
<Image Source="{DynamicResource SpecchiaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource SpecchiaImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
@@ -124,6 +139,13 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
|
<!--<UniformGrid Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
|
||||||
|
<Button Name="CompoBtn"
|
||||||
|
Style="{DynamicResource OmagCut_RightGrayGradientYellowButton}">
|
||||||
|
<Image Source="{DynamicResource DrawImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
</UniformGrid>-->
|
||||||
|
|
||||||
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
|
<!--<TextBlock Name="SawRoughingTxBl" Grid.Row="4" Grid.ColumnSpan="3"
|
||||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ Public Class FrameCutPageUC
|
|||||||
OffsXyTxBx.Text = LenToString(dOffsXY, 3)
|
OffsXyTxBx.Text = LenToString(dOffsXY, 3)
|
||||||
Dim dOffsYY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSYY, 5, m_MainWindow.GetIniFile())
|
Dim dOffsYY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSYY, 5, m_MainWindow.GetIniFile())
|
||||||
OffsYyTxBx.Text = LenToString(dOffsYY, 3)
|
OffsYyTxBx.Text = LenToString(dOffsYY, 3)
|
||||||
|
Dim dOffsXInterY As Double = GetPrivateProfileDouble(S_FRAME, K_OFFSXINTERY, 5, m_MainWindow.GetIniFile())
|
||||||
|
OffsXInteryTxBx.Text = LenToString(dOffsXInterY, 3)
|
||||||
|
|
||||||
' Imposto i messaggi letti dal file dei messaggi
|
' Imposto i messaggi letti dal file dei messaggi
|
||||||
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
|
m_AlongAx.Add(EgtMsg(MSG_FRAMECUTPAGEUC + 1)) 'Lungo X
|
||||||
@@ -70,6 +72,7 @@ Public Class FrameCutPageUC
|
|||||||
OffsZTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 8) 'Distanza sopra
|
OffsZTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 8) 'Distanza sopra
|
||||||
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
OffsXyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 9) 'Distanza inizio
|
||||||
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
|
OffsYyTxBl.Text = EgtMsg(MSG_FRAMECUTPAGEUC + 22) 'Distanza Y
|
||||||
|
OffsXInteryTxBl.Text = EgtMsg(90645) 'Interasse
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub FrameCutPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
@@ -81,6 +84,12 @@ Public Class FrameCutPageUC
|
|||||||
m_ProjectMgr.CSVBtn.Visibility = Windows.Visibility.Hidden
|
m_ProjectMgr.CSVBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
|
m_ProjectMgr.VeinMatchingBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_ProjectMgr.RegisterBtn.Visibility = Windows.Visibility.Hidden
|
m_ProjectMgr.RegisterBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
' Visualizzo il bottone per l'importazione dei compo frame
|
||||||
|
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.COMPOFRAME) AndAlso GetPrivateProfileInt(S_FRAMECOMPO, K_CMP_COUNT, 0, m_MainWindow.GetIniFile()) > 0 Then
|
||||||
|
CompoBtn.Visibility = Visibility.Visible
|
||||||
|
Else
|
||||||
|
CompoBtn.Visibility = Visibility.Hidden
|
||||||
|
End If
|
||||||
' Recupero dimensioni e kerf del grezzo
|
' Recupero dimensioni e kerf del grezzo
|
||||||
m_nRawId = EgtGetFirstRawPart()
|
m_nRawId = EgtGetFirstRawPart()
|
||||||
GetRawBox(m_RawBox)
|
GetRawBox(m_RawBox)
|
||||||
@@ -271,7 +280,7 @@ Public Class FrameCutPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed
|
Private Sub OffsXXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsZTxBx.EgtClosed, OffsXyTxBx.EgtClosed, OffsYyTxBx.EgtClosed, OffsXInteryTxBx.EgtClosed
|
||||||
' Forzo aggiornamento grezzo nella pagina di Nesting
|
' Forzo aggiornamento grezzo nella pagina di Nesting
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
m_MainWindow.m_CadCutPageUC.m_NestPage.CalcRawPart()
|
||||||
' Parcheggio pezzi presenti nel grezzo
|
' Parcheggio pezzi presenti nel grezzo
|
||||||
@@ -296,9 +305,13 @@ Public Class FrameCutPageUC
|
|||||||
WritePrivateProfileString(S_FRAME, K_OFFSXY, DoubleToString(dOffsXy, 3), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_FRAME, K_OFFSXY, DoubleToString(dOffsXy, 3), m_MainWindow.GetIniFile())
|
||||||
End If
|
End If
|
||||||
Dim dOffsYy As Double = 0
|
Dim dOffsYy As Double = 0
|
||||||
If StringToLen(OffsYyTxBx.Text, dOffsYY) Then
|
If StringToLen(OffsYyTxBx.Text, dOffsYy) Then
|
||||||
WritePrivateProfileString(S_FRAME, K_OFFSYY, DoubleToString(dOffsYy, 3), m_MainWindow.GetIniFile())
|
WritePrivateProfileString(S_FRAME, K_OFFSYY, DoubleToString(dOffsYy, 3), m_MainWindow.GetIniFile())
|
||||||
End If
|
End If
|
||||||
|
Dim dOffsXIntery As Double = 0
|
||||||
|
If StringToLen(OffsXInteryTxBx.Text, dOffsXIntery) Then
|
||||||
|
WritePrivateProfileString(S_FRAME, K_OFFSXINTERY, DoubleToString(dOffsXIntery, 3), m_MainWindow.GetIniFile())
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub MirrorPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles MirrorPartBtn.Click
|
Private Sub MirrorPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles MirrorPartBtn.Click
|
||||||
@@ -436,6 +449,16 @@ Public Class FrameCutPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CompoBtn_Click(sender As Object, e As RoutedEventArgs) Handles CompoBtn.Click
|
||||||
|
m_MainWindow.TestOff()
|
||||||
|
m_MainWindow.DragRettangleOff()
|
||||||
|
m_MainWindow.SplitCurvWJOff()
|
||||||
|
m_MainWindow.StartCurvWJOff()
|
||||||
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_DrawPageUC)
|
||||||
|
m_MainWindow.m_ActivePage = MainWindow.Pages.Draw
|
||||||
|
End Sub
|
||||||
|
|
||||||
Friend Function CreateFrame(nPartId As Integer) As Boolean
|
Friend Function CreateFrame(nPartId As Integer) As Boolean
|
||||||
If Not MyCreateFrame( nPartId) Then
|
If Not MyCreateFrame( nPartId) Then
|
||||||
EgtErase( nPartId)
|
EgtErase( nPartId)
|
||||||
@@ -936,12 +959,18 @@ Public Class FrameCutPageUC
|
|||||||
' Determino distanza da spessore lama
|
' Determino distanza da spessore lama
|
||||||
Dim dMinDist As Double = 0
|
Dim dMinDist As Double = 0
|
||||||
Dim dSawThick As Double = 0
|
Dim dSawThick As Double = 0
|
||||||
|
Dim dOffsXIntery As Double = 0
|
||||||
|
StringToLen(OffsXInteryTxBx.Text, dOffsXIntery)
|
||||||
If EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw) AndAlso
|
If EgtTdbSetCurrTool(m_MainWindow.m_CurrentMachine.sCurrSaw) AndAlso
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dSawThick) Then
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, dSawThick) Then
|
||||||
|
If dOffsXIntery <= dSawThick Then
|
||||||
dMinDist = dSawThick + 5 * EPS_SMALL
|
dMinDist = dSawThick + 5 * EPS_SMALL
|
||||||
|
Else
|
||||||
|
dMinDist = dOffsXIntery + 5 * EPS_SMALL
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
EgtOutLog("Not found current saw for frames mindist")
|
EgtOutLog("Not found current saw for frames mindist")
|
||||||
dMinDist = 0
|
dMinDist = dOffsXIntery
|
||||||
End If
|
End If
|
||||||
' Inserisco il pezzo nel grezzo
|
' Inserisco il pezzo nel grezzo
|
||||||
Dim ptIns As Point3d
|
Dim ptIns As Point3d
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<Window x:Class="LicenseWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||||
|
FontFamily="{DynamicResource OmagCut_Font}"
|
||||||
|
Title="OpenFile" Height="500.6" Width="426.6" WindowStyle="None"
|
||||||
|
ResizeMode="NoResize" ShowInTaskbar="False" AllowsTransparency="True"
|
||||||
|
Background="Transparent">
|
||||||
|
<Border Style="{DynamicResource OmagCut_Border}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
<ColumnDefinition Width="4*"/>
|
||||||
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="1.5*"/>
|
||||||
|
<RowDefinition Height="5.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="1.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<StackPanel Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
HorizontalAlignment="Center">
|
||||||
|
<TextBlock Name="IconTxBl" Foreground="White" FontSize="32"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Name="LicenseTxBl"
|
||||||
|
Foreground="White" FontSize="20"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
|
TextWrapping="Wrap"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal"
|
||||||
|
HorizontalAlignment="Center">
|
||||||
|
<ScrollViewer Name="MyScrollViewer" VerticalScrollBarVisibility="Auto">
|
||||||
|
<TextBlock Name="LicenseMsgTxBl" MaxWidth="340"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Foreground="{DynamicResource Omag_White}" FontSize="20" VerticalAlignment="Center"
|
||||||
|
TextWrapping="Wrap"/>
|
||||||
|
</ScrollViewer>
|
||||||
|
</StackPanel>
|
||||||
|
<Grid Grid.Column="1" Grid.Row="4">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="0.5*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}" IsCancel="True">
|
||||||
|
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Border>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
Public Class LicenseWindow
|
||||||
|
|
||||||
|
Private m_sMessage As String = String.Empty
|
||||||
|
Private m_sTitle As String = String.Empty
|
||||||
|
|
||||||
|
Public Sub New(Owner As Window, sMsg As String, sTitle As String)
|
||||||
|
Me.Owner = Owner
|
||||||
|
m_sMessage = sMsg
|
||||||
|
m_sTitle = sTitle
|
||||||
|
|
||||||
|
' La chiamata è richiesta dalla finestra di progettazione.
|
||||||
|
InitializeComponent()
|
||||||
|
|
||||||
|
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub Init() Handles Me.Initialized
|
||||||
|
IconTxBl.Text = "⚠️"
|
||||||
|
LicenseTxBl.Text = "Warning" & vbCrLf & m_sTitle
|
||||||
|
m_sMessage = m_sMessage.Replace("/n", "£")
|
||||||
|
Dim sItems As String() = m_sMessage.Split("£")
|
||||||
|
For Index As Integer = 0 To sItems.Count - 1
|
||||||
|
If Index = 0 Then
|
||||||
|
m_sMessage = sItems(Index)
|
||||||
|
Else
|
||||||
|
m_sMessage &= vbCrLf & sItems(Index)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
LicenseMsgTxBl.Text = m_sMessage
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub Exit_Click() Handles ExitBtn.Click
|
||||||
|
Me.Close()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -184,6 +184,31 @@
|
|||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
|
<!--Parametri rettifica tagli sottosquadra: 1 Parametro -->
|
||||||
|
<GroupBox Name="RectificationWJParamGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0" Grid.Row="4" Grid.ColumnSpan="2" >
|
||||||
|
<Grid Grid.Column="3" Grid.Row="2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Name="EnableRectificationTxBl" Grid.Row="0" Grid.ColumnSpan="2"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}" />
|
||||||
|
<CheckBox Name="EnableRectificationChBx" Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||||
|
HorizontalAlignment="Right" Margin="0,0,10,0"/>
|
||||||
|
|
||||||
|
<!--<TextBlock Name="OffsetRectificationTxBl" Grid.Row="1" Grid.Column="0"
|
||||||
|
Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="OffsetRectificationTxBx" Grid.Row="1" Grid.Column="1" Margin="10,0,10,0"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>-->
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</GroupBox>
|
||||||
|
|
||||||
<!--Parametri WaterJet: 5 Parametro (se questo GroupBox attivo allora nascondo Fori/Fresatura)-->
|
<!--Parametri WaterJet: 5 Parametro (se questo GroupBox attivo allora nascondo Fori/Fresatura)-->
|
||||||
<GroupBox Name="WjsParamGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="4"
|
<GroupBox Name="WjsParamGpBx" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="4"
|
||||||
Style="{DynamicResource OmagCut_GroupBox}">
|
Style="{DynamicResource OmagCut_GroupBox}">
|
||||||
|
|||||||
@@ -97,7 +97,10 @@ Public Class AlarmsPageUC
|
|||||||
HolesOffsetWJTxBl.Text = "Offset"
|
HolesOffsetWJTxBl.Text = "Offset"
|
||||||
MinRadiusWJTxBl.Text = "Min Radius"
|
MinRadiusWJTxBl.Text = "Min Radius"
|
||||||
OneHoleInCornerWJTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 26)
|
OneHoleInCornerWJTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 26)
|
||||||
'-- FINE -- nuovi parametri per preforo lavello
|
'-- INIZIO -- nuovi parametro Rettifica tagli sottosquadra WJ
|
||||||
|
REctificationWJParamGpBx.Header = "Rectification"
|
||||||
|
EnableRectificationTxBl.Text = "Enable (on subsquare angle)"
|
||||||
|
'-- FINE -- nuovi parametro Rettifica tagli sottosquadra WJ
|
||||||
NestingParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 31) ' Nesting
|
NestingParamGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 31) ' Nesting
|
||||||
AlignTxBl.Text = EgtMsg(90932) ' Allineato
|
AlignTxBl.Text = EgtMsg(90932) ' Allineato
|
||||||
GhigliottinaTxBl.Text = EgtMsg(91066) ' Ghigliottina
|
GhigliottinaTxBl.Text = EgtMsg(91066) ' Ghigliottina
|
||||||
@@ -175,6 +178,7 @@ Public Class AlarmsPageUC
|
|||||||
' Se non previsti tagli waterjet, disabilito relativo box
|
' Se non previsti tagli waterjet, disabilito relativo box
|
||||||
If Not m_CurrentMachine.bWaterJetting Then
|
If Not m_CurrentMachine.bWaterJetting Then
|
||||||
WjsParamGpBx.Visibility = Visibility.Hidden
|
WjsParamGpBx.Visibility = Visibility.Hidden
|
||||||
|
RectificationWJParamGpBx.Visibility = Visibility.Hidden
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Abilitazione box per contorni grezzo da foto
|
' Abilitazione box per contorni grezzo da foto
|
||||||
@@ -354,7 +358,9 @@ Public Class AlarmsPageUC
|
|||||||
MinRadiusWJTxBx.Text = LenToString(dVal, 2)
|
MinRadiusWJTxBx.Text = LenToString(dVal, 2)
|
||||||
OneHoleInCornerWJChBx.IsChecked =
|
OneHoleInCornerWJChBx.IsChecked =
|
||||||
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, 1, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
|
' leggo se attiva la rettifica degli angoli per WaterJet
|
||||||
|
EnableRectificationChBx.IsChecked =
|
||||||
|
(GetPrivateProfileInt(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, 0, m_MainWindow.GetMachIniFile()) <> 0)
|
||||||
' Leggo accorciamento angoli con fresa
|
' Leggo accorciamento angoli con fresa
|
||||||
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
|
dVal = GetPrivateProfileDouble(S_MACH_NEST, K_MACH_MILLING_SHORTENING, 0, m_MainWindow.GetMachIniFile())
|
||||||
ShortTxBx.Text = LenToString(dVal, 2)
|
ShortTxBx.Text = LenToString(dVal, 2)
|
||||||
@@ -970,9 +976,18 @@ Public Class AlarmsPageUC
|
|||||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, "0", m_MainWindow.GetMachIniFile())
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_DRILLINGWJ_ON_CORNERS, "0", m_MainWindow.GetMachIniFile())
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' -- FINE -- nuovi parametri per prefori WaterJet
|
' -- FINE -- nuovi parametri per prefori WaterJet
|
||||||
|
|
||||||
|
' -- INIZIO -- nuovi parametri per Rettifica angoli in sottosquadra WaterJet
|
||||||
|
Private Sub EnableRectificationChBx_Click(sender As Object, e As EventArgs) Handles EnableRectificationChBx.Click
|
||||||
|
If EnableRectificationChBx.IsChecked() Then
|
||||||
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, "1", m_MainWindow.GetMachIniFile)
|
||||||
|
Else
|
||||||
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_RECTIFICATION_ON_SUBSQUARE, "0", m_MainWindow.GetMachIniFile)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
' -- FINE -- nuovi parametri per Rettifica angoli in sottosquadra WaterJet
|
||||||
|
|
||||||
Private Sub TmEnableChBx_Click(sender As Object, e As RoutedEventArgs) Handles TmEnableChBx.Click
|
Private Sub TmEnableChBx_Click(sender As Object, e As RoutedEventArgs) Handles TmEnableChBx.Click
|
||||||
If TmEnableChBx.IsChecked() Then
|
If TmEnableChBx.IsChecked() Then
|
||||||
WritePrivateProfileString(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, "1", m_MainWindow.GetMachIniFile())
|
WritePrivateProfileString(S_MACH_NEST, K_MACH_ENGRAVING_WITHMILL, "1", m_MainWindow.GetMachIniFile())
|
||||||
@@ -1163,6 +1178,10 @@ Public Class AlarmsPageUC
|
|||||||
Case 3
|
Case 3
|
||||||
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(0)
|
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(0)
|
||||||
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
||||||
|
Case 4
|
||||||
|
' FANUC - Manual:7, Edit:1
|
||||||
|
Dim nResult As Short = m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||||
|
EgtOutLog("Impostata modalità manuale: esito " & nResult.ToString)
|
||||||
End Select
|
End Select
|
||||||
' Recupero file LUA
|
' Recupero file LUA
|
||||||
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua")
|
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\SawProbing.lua")
|
||||||
@@ -1174,6 +1193,7 @@ Public Class AlarmsPageUC
|
|||||||
Dim dToolDiam As Double = 0
|
Dim dToolDiam As Double = 0
|
||||||
Dim dToolThick As Double = 0
|
Dim dToolThick As Double = 0
|
||||||
Dim dToolLen As Double = 0
|
Dim dToolLen As Double = 0
|
||||||
|
Dim dCore As Double = 0
|
||||||
Dim sToolParam As String = String.Empty
|
Dim sToolParam As String = String.Empty
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.HEAD, sToolParam)
|
EgtTdbGetCurrToolParam(MCH_TP.HEAD, sToolParam)
|
||||||
EgtLuaSetGlobStringVar("CMD.HEAD", sToolParam)
|
EgtLuaSetGlobStringVar("CMD.HEAD", sToolParam)
|
||||||
@@ -1185,6 +1205,14 @@ Public Class AlarmsPageUC
|
|||||||
EgtLuaSetGlobNumVar("CMD.THICK", dToolThick * 1000)
|
EgtLuaSetGlobNumVar("CMD.THICK", dToolThick * 1000)
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.LEN, dToolLen)
|
EgtTdbGetCurrToolParam(MCH_TP.LEN, dToolLen)
|
||||||
EgtLuaSetGlobNumVar("CMD.LENGTH", dToolLen * 1000)
|
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)
|
||||||
|
If m_CurrentMachine.bPolishingWheel AndAlso nType = MCH_TY.MILL_POLISHING Then
|
||||||
|
EgtLuaSetGlobStringVar("CMD.POLISHING", "1")
|
||||||
|
End If
|
||||||
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
EgtLuaSetGlobBoolVar("CMD.INCHES", m_MainWindow.m_CNCommunication.GetMachineInInches())
|
||||||
EgtLuaCallFunction("CMD.CmdString")
|
EgtLuaCallFunction("CMD.CmdString")
|
||||||
' Leggo variabili
|
' Leggo variabili
|
||||||
@@ -1228,11 +1256,16 @@ Public Class AlarmsPageUC
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
' Se fanuc passo in modalità AUTO e attivo
|
||||||
|
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||||
|
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(0)
|
||||||
|
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
||||||
|
End If
|
||||||
' Aspetto e lo avvio
|
' Aspetto e lo avvio
|
||||||
System.Threading.Thread.Sleep(300)
|
System.Threading.Thread.Sleep(300)
|
||||||
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
||||||
' Creo MsgBox di attesa
|
' 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
|
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||||
' Definisco flag tastatura
|
' Definisco flag tastatura
|
||||||
Dim bProbingOk As Boolean = False
|
Dim bProbingOk As Boolean = False
|
||||||
@@ -1277,6 +1310,10 @@ Public Class AlarmsPageUC
|
|||||||
Dim bRead As Boolean = False
|
Dim bRead As Boolean = False
|
||||||
Dim SawDiameterNameVar As String = String.Empty
|
Dim SawDiameterNameVar As String = String.Empty
|
||||||
GetPrivateProfileString(S_MACH_PROBING, K_SAWDIAMETER, "", SawDiameterNameVar, m_MainWindow.GetMachIniFile())
|
GetPrivateProfileString(S_MACH_PROBING, K_SAWDIAMETER, "", SawDiameterNameVar, m_MainWindow.GetMachIniFile())
|
||||||
|
' Se utensile non lama, allora la variabile in cui leggo il dato potrebbe essere differente
|
||||||
|
If Not ToolForProbing.m_IsSaw Then
|
||||||
|
GetPrivateProfileString(S_MACH_PROBING, K_TOOLLENGTH, SawDiameterNameVar, SawDiameterNameVar, m_MainWindow.GetMachIniFile())
|
||||||
|
End If
|
||||||
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||||
For I As Integer = 0 To 20
|
For I As Integer = 0 To 20
|
||||||
' Devo rileggere la variabile ad ogni ciclo
|
' Devo rileggere la variabile ad ogni ciclo
|
||||||
@@ -1285,7 +1322,10 @@ Public Class AlarmsPageUC
|
|||||||
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
||||||
bRead = True
|
bRead = True
|
||||||
Dim dVal As Double = m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value
|
Dim dVal As Double = m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value
|
||||||
|
' Se fanuc il dato è in mm (NON MICRON)
|
||||||
|
If m_MainWindow.m_CNCommunication.m_nNCType <> 4 Then
|
||||||
dVal = dVal / 1000
|
dVal = dVal / 1000
|
||||||
|
End If
|
||||||
MsgBoxStateInfo.LoadingPrBr_Value = 100
|
MsgBoxStateInfo.LoadingPrBr_Value = 100
|
||||||
' Tastatura conclusa con successo
|
' Tastatura conclusa con successo
|
||||||
Dim sOut As String = EgtMsg(MSG_DIRECTCUTPAGEUC + 43) & " : " & DoubleToString(dVal, 1)
|
Dim sOut As String = EgtMsg(MSG_DIRECTCUTPAGEUC + 43) & " : " & DoubleToString(dVal, 1)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports EgtWPFLib5
|
Imports EgtWPFLib5
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports System.IO
|
||||||
|
|
||||||
Public Class CurrentMachine
|
Public Class CurrentMachine
|
||||||
|
|
||||||
@@ -51,6 +52,10 @@ Public Class CurrentMachine
|
|||||||
Private m_sProdLiProbingState2Var As String = ""
|
Private m_sProdLiProbingState2Var As String = ""
|
||||||
Private m_sProdLiProbingTcPos2Var As String = ""
|
Private m_sProdLiProbingTcPos2Var As String = ""
|
||||||
Private m_sProdLiSawDiameter2Var As String = ""
|
Private m_sProdLiSawDiameter2Var As String = ""
|
||||||
|
Private m_sClickState As String = "E80028"
|
||||||
|
Private m_sClickDir As String = ""
|
||||||
|
' Gestione speciale per canali CN
|
||||||
|
Private m_sExtFileCN As String = ".0"
|
||||||
|
|
||||||
' Numero e tipo di utensili correntemente disponibili sulla macchina
|
' Numero e tipo di utensili correntemente disponibili sulla macchina
|
||||||
Private m_MountedToolConfig As MountedToolConfigs = MountedToolConfigs.SAW
|
Private m_MountedToolConfig As MountedToolConfigs = MountedToolConfigs.SAW
|
||||||
@@ -77,6 +82,9 @@ Public Class CurrentMachine
|
|||||||
Private m_bPolishingWheel As Boolean = False
|
Private m_bPolishingWheel As Boolean = False
|
||||||
Private m_bWaterJet As Boolean = False
|
Private m_bWaterJet As Boolean = False
|
||||||
|
|
||||||
|
' Flag che indica se gesire l'inversione del taglio nei tagli singoli
|
||||||
|
Private m_bEnableInvetrt As Boolean = True
|
||||||
|
|
||||||
' Abilitazione DB WaterJet
|
' Abilitazione DB WaterJet
|
||||||
Private m_bFromDBWaterJet As Boolean = False
|
Private m_bFromDBWaterJet As Boolean = False
|
||||||
|
|
||||||
@@ -131,6 +139,8 @@ Public Class CurrentMachine
|
|||||||
Private m_dPhotoOffsetY As Double = 0
|
Private m_dPhotoOffsetY As Double = 0
|
||||||
Private m_dTab2PhotoOffsetX As Double = 0
|
Private m_dTab2PhotoOffsetX As Double = 0
|
||||||
Private m_dTab2PhotoOffsetY As Double = 0
|
Private m_dTab2PhotoOffsetY As Double = 0
|
||||||
|
Private m_dHQPhotoOffsetX As Double = 0
|
||||||
|
Private m_dHQPhotoOffsetY As Double = 0
|
||||||
|
|
||||||
' Abilitazione scelta restart
|
' Abilitazione scelta restart
|
||||||
Private m_bEnableRestart As Boolean = False
|
Private m_bEnableRestart As Boolean = False
|
||||||
@@ -191,8 +201,15 @@ Public Class CurrentMachine
|
|||||||
' Massimo numero di utensili su Tc manuale
|
' Massimo numero di utensili su Tc manuale
|
||||||
Friend MAX_TCMAN_TOOLS As Integer = 60
|
Friend MAX_TCMAN_TOOLS As Integer = 60
|
||||||
|
|
||||||
|
' Massima profondità lavorabile nei tagli diretti
|
||||||
|
Private m_MaxTabDepth As Double = 10.0
|
||||||
|
|
||||||
#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
|
#Region "Proprietà che leggono e scrivono i valori anche da o su file ini"
|
||||||
|
Friend ReadOnly Property MaxTabDepth As Double
|
||||||
|
Get
|
||||||
|
Return m_MaxTabDepth
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Friend ReadOnly Property sMachineName As String
|
Friend ReadOnly Property sMachineName As String
|
||||||
Get
|
Get
|
||||||
@@ -321,6 +338,24 @@ Public Class CurrentMachine
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Friend ReadOnly Property sClickState As String
|
||||||
|
Get
|
||||||
|
Return m_sClickState
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Friend ReadOnly Property sClickDir As String
|
||||||
|
Get
|
||||||
|
Return m_sClickDir
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Friend ReadOnly Property sExtFileCN As String
|
||||||
|
Get
|
||||||
|
Return m_sExtFileCN
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Friend Function sProdLiProbingStateVar(nI As Integer) As String
|
Friend Function sProdLiProbingStateVar(nI As Integer) As String
|
||||||
If nI = 1 Then Return m_sProdLiProbingStateVar
|
If nI = 1 Then Return m_sProdLiProbingStateVar
|
||||||
If nI = 2 Then Return m_sProdLiProbingState2Var
|
If nI = 2 Then Return m_sProdLiProbingState2Var
|
||||||
@@ -731,6 +766,10 @@ Public Class CurrentMachine
|
|||||||
Set(value As String)
|
Set(value As String)
|
||||||
If WritePrivateProfileString(S_MACH_MACH, K_CURRWATERJETTING, value, sMachIniFile) Then
|
If WritePrivateProfileString(S_MACH_MACH, K_CURRWATERJETTING, value, sMachIniFile) Then
|
||||||
m_sCurrWaterJetting = value
|
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 If
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
@@ -752,6 +791,12 @@ Public Class CurrentMachine
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Friend ReadOnly Property bEnableInvert As Boolean
|
||||||
|
Get
|
||||||
|
Return m_bEnableInvetrt
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
Friend Property dAdditionalTable As Double
|
Friend Property dAdditionalTable As Double
|
||||||
Get
|
Get
|
||||||
Select Case GetCurrentTable()
|
Select Case GetCurrentTable()
|
||||||
@@ -821,6 +866,10 @@ Public Class CurrentMachine
|
|||||||
Case 2
|
Case 2
|
||||||
Return New Vector3d(m_dTab2PhotoOffsetX, m_dTab2PhotoOffsetY, 0)
|
Return New Vector3d(m_dTab2PhotoOffsetX, m_dTab2PhotoOffsetY, 0)
|
||||||
Case Else
|
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)
|
Return New Vector3d(m_dPhotoOffsetX, m_dPhotoOffsetY, 0)
|
||||||
End Select
|
End Select
|
||||||
End Get
|
End Get
|
||||||
@@ -1111,6 +1160,8 @@ Public Class CurrentMachine
|
|||||||
m_sMachIniFile = m_MainWindow.GetMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
|
m_sMachIniFile = m_MainWindow.GetMachinesRootDir & "\" & sMachineName & "\" & sMachineName & ".ini"
|
||||||
' Leggo estensione del file programma pezzo
|
' Leggo estensione del file programma pezzo
|
||||||
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "xpi", m_sIsoFileExt, sMachIniFile)
|
GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "xpi", m_sIsoFileExt, sMachIniFile)
|
||||||
|
' per gestione canali separati (macchina NUM con più di 5 Assi) ver. 2.5g1
|
||||||
|
GetPrivateProfileString(S_PARTPROGRAM, K_EXTFILECN, ".0", m_sExtFileCN, sMachIniFile)
|
||||||
If m_sIsoFileExt(0) <> "." Then m_sIsoFileExt = "." & m_sIsoFileExt
|
If m_sIsoFileExt(0) <> "." Then m_sIsoFileExt = "." & m_sIsoFileExt
|
||||||
' Leggo flag incremento asse C
|
' Leggo flag incremento asse C
|
||||||
m_dDeltaC = GetPrivateProfileDouble(S_AXES, K_DELTA_C, 0.0, sMachIniFile)
|
m_dDeltaC = GetPrivateProfileDouble(S_AXES, K_DELTA_C, 0.0, sMachIniFile)
|
||||||
@@ -1144,6 +1195,13 @@ Public Class CurrentMachine
|
|||||||
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLIPROBINGTCPOS2VAR, "0", m_sProdLiProbingTcPos2Var, sMachIniFile)
|
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLIPROBINGTCPOS2VAR, "0", m_sProdLiProbingTcPos2Var, sMachIniFile)
|
||||||
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLISAWDIAMETER2VAR, "", m_sProdLiSawDiameter2Var, sMachIniFile)
|
GetPrivateProfileString(S_PRODUCTIONLINE, K_PRODLISAWDIAMETER2VAR, "", m_sProdLiSawDiameter2Var, sMachIniFile)
|
||||||
|
|
||||||
|
GetPrivateProfileString(S_POLISHLINE, K_CLICKSTATE, "", m_sClickState, sMachIniFile)
|
||||||
|
GetPrivateProfileString(S_POLISHLINE, k_CLICKDIR, "", m_sClickDir, sMachIniFile)
|
||||||
|
If Not Directory.Exists(m_sClickDir) Then
|
||||||
|
m_sClickState = ""
|
||||||
|
EgtOutLog("Directory " & m_sClickDir & " does not exist")
|
||||||
|
End If
|
||||||
|
|
||||||
' Leggo configurazione degli utensili in macchina
|
' Leggo configurazione degli utensili in macchina
|
||||||
m_MountedToolConfig = GetPrivateProfileInt(S_TOOLS, K_MOUNTEDTOOLCONFIG, 0, sMachIniFile)
|
m_MountedToolConfig = GetPrivateProfileInt(S_TOOLS, K_MOUNTEDTOOLCONFIG, 0, sMachIniFile)
|
||||||
' Leggo flag presenza tipologie utensili
|
' Leggo flag presenza tipologie utensili
|
||||||
@@ -1200,6 +1258,8 @@ Public Class CurrentMachine
|
|||||||
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.ENABLE_WJ)
|
m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.ENABLE_WJ)
|
||||||
' possibilità di definire attacco speciale per materiali ceramici
|
' possibilità di definire attacco speciale per materiali ceramici
|
||||||
m_bSawingSpecialLeadIn = (GetPrivateProfileInt(S_MACHININGS, K_SAWINGSPECIALLEADIN, 0, sMachIniFile) > 0)
|
m_bSawingSpecialLeadIn = (GetPrivateProfileInt(S_MACHININGS, K_SAWINGSPECIALLEADIN, 0, sMachIniFile) > 0)
|
||||||
|
' mantengo la direzione del taglio definita nel taglio diretto
|
||||||
|
m_bEnableInvetrt = (GetPrivateProfileInt(S_DIRECTCUTS, K_ENABLEINVERT, 1, sMachIniFile) <> 0)
|
||||||
|
|
||||||
' Leggo utensili correnti
|
' Leggo utensili correnti
|
||||||
' lama
|
' lama
|
||||||
@@ -1282,6 +1342,8 @@ Public Class CurrentMachine
|
|||||||
m_dPhotoOffsetY = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_OFFSETY, 0, sMachIniFile)
|
m_dPhotoOffsetY = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_OFFSETY, 0, sMachIniFile)
|
||||||
m_dTab2PhotoOffsetX = GetPrivateProfileDouble(S_PHOTO, K_PHOTO_TAB2_OFFSETX, 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_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
|
' Leggo abilitazione per restart
|
||||||
m_bEnableRestart = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENABLERESTART, 0, sMachIniFile) <> 0)
|
m_bEnableRestart = (GetPrivateProfileInt(S_MACH_NEST, K_MACH_ENABLERESTART, 0, sMachIniFile) <> 0)
|
||||||
@@ -1349,6 +1411,35 @@ Public Class CurrentMachine
|
|||||||
m_HasRawProbe = (GetPrivateProfileInt(S_MACH_PROBING, K_ENABLERAWPROBE, 1, sMachIniFile) <> 0)
|
m_HasRawProbe = (GetPrivateProfileInt(S_MACH_PROBING, K_ENABLERAWPROBE, 1, sMachIniFile) <> 0)
|
||||||
' leggo se la macchina ha il lettore di codice a barre della lastra
|
' leggo se la macchina ha il lettore di codice a barre della lastra
|
||||||
m_nEnableBarCodeReader = GetPrivateProfileInt(S_MACH_BARCODEREADER, K_ENABLEBCR, 0, sMachIniFile)
|
m_nEnableBarCodeReader = GetPrivateProfileInt(S_MACH_BARCODEREADER, K_ENABLEBCR, 0, sMachIniFile)
|
||||||
|
|
||||||
|
' affonadamento massimo oltre la tavola (inidicata in positivo!)
|
||||||
|
m_MaxTabDepth = GetPrivateProfileDouble(S_MACH_NEST, "MaxTabDepth", 10.0, m_MainWindow.GetMachIniFile())
|
||||||
|
If m_MaxTabDepth < 0 Then
|
||||||
|
m_MaxTabDepth = 10.0
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' Per il controllo FANUC al momento dell'inizializzazione del CN devono essere lette alcune variabili
|
||||||
|
Public Sub InitFANUC(CN_Generic As CN_generico)
|
||||||
|
' Leggo ritardo tra reset e send per NUM
|
||||||
|
m_nResetSendDelay = GetPrivateProfileInt(S_NCFANUC, K_RESETSENDDELAY, 1000, sMachIniFile)
|
||||||
|
' Leggo ritardo tra reset e send per NUM
|
||||||
|
m_nThreadSleep = GetPrivateProfileInt(S_NCFANUC, K_THREADSLEEP, 150, sMachIniFile)
|
||||||
|
' Leggo i dati strettamente correlati alla comunicazione NC-PC
|
||||||
|
Dim CN As CN_generico = CN_Generic
|
||||||
|
' Leggo l'indirizzo in cui scrivere lo stato macchina
|
||||||
|
Dim dAddNcMode As String = CN.s_addr_set_nc_mode
|
||||||
|
GetPrivateProfileString(S_NCFANUC, K_SETNCMODE, CN.s_addr_set_nc_mode, CN.s_addr_set_nc_mode, sMachIniFile)
|
||||||
|
' Leggo primo indirizzo libero delle variabili di tipo intero
|
||||||
|
CN.n_Base_addr_int_vars = GetPrivateProfileInt(S_NCFANUC, K_BASEADDRINT, CN.n_Base_addr_int_vars, sMachIniFile)
|
||||||
|
' Leggo primo indirizzo libero delle variabili di tipo bit
|
||||||
|
CN.n_Base_addr_byte_for_bits_vars = GetPrivateProfileInt(S_NCFANUC, K_BASEADDRBIT, CN.n_Base_addr_byte_for_bits_vars, sMachIniFile)
|
||||||
|
' Leggo numero di variabili di tipo intero
|
||||||
|
CN.n_num_var_int_to_read = CShort(GetPrivateProfileInt(S_NCFANUC, K_NUMVARINT, CInt(CN.n_num_var_int_to_read), sMachIniFile))
|
||||||
|
' Leggo numero di varibili di tipo bit
|
||||||
|
CN.n_num_var_byte_for_bits_to_read = CShort(GetPrivateProfileInt(S_NCFANUC, K_NUMVARBIT, CInt(CN.n_num_var_byte_for_bits_to_read), sMachIniFile))
|
||||||
|
' Leggo variabile abilitata alla gestione di FeedHold
|
||||||
|
GetPrivateProfileString(S_NCFANUC, K_SETNCMODE, CN.s_addr_feedhold, CN.s_addr_feedhold, sMachIniFile)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False)
|
Public Sub LoadWJMaterial(Optional bIsStart As Boolean = False)
|
||||||
@@ -1571,7 +1662,9 @@ Public Class CurrentMachine
|
|||||||
Dim dToolDiam As Double = 0
|
Dim dToolDiam As Double = 0
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam)
|
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dToolDiam)
|
||||||
' Confronto con massimo ammesso
|
' 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
|
End Function
|
||||||
|
|
||||||
Friend Function GetPrivateProfileMaterial(
|
Friend Function GetPrivateProfileMaterial(
|
||||||
|
|||||||
@@ -87,6 +87,19 @@
|
|||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
|
<GroupBox Name="CameraHQ" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ToggleButton Name="CameraHQBtn" Grid.Column="2"
|
||||||
|
Style="{DynamicResource OmagCut_GradientYellowIconToggleButton}"
|
||||||
|
Foreground="White"/>
|
||||||
|
</Grid>
|
||||||
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Name="PartProgTransferGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
<GroupBox Name="PartProgTransferGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Row="2"
|
||||||
Grid.ColumnSpan="3">
|
Grid.ColumnSpan="3">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ Public Class MachineCNPageUC
|
|||||||
MDICommandGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 16)
|
MDICommandGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 16)
|
||||||
PartProgTransferGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 17)
|
PartProgTransferGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 17)
|
||||||
ErrorLstGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 12)
|
ErrorLstGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 12)
|
||||||
|
|
||||||
' Attivo gruppo PartProgTransferGpBx leggendo la variabile nel file ini
|
' Attivo gruppo PartProgTransferGpBx leggendo la variabile nel file ini
|
||||||
If GetPrivateProfileInt(S_GENERAL, K_TESTINGPAGE, 0, m_MainWindow.GetIniFile()) = 1 Then
|
If GetPrivateProfileInt(S_GENERAL, K_TESTINGPAGE, 0, m_MainWindow.GetIniFile()) = 1 Then
|
||||||
PartProgTransferGpBx.Visibility = Windows.Visibility.Visible
|
PartProgTransferGpBx.Visibility = Windows.Visibility.Visible
|
||||||
@@ -44,6 +45,28 @@ Public Class MachineCNPageUC
|
|||||||
Else
|
Else
|
||||||
PowerGpBx.Visibility = Visibility.Collapsed
|
PowerGpBx.Visibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' verifico che sia attiva la modalità per l'uso di due fotocamere
|
||||||
|
If GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ENABLE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
|
||||||
|
CameraHQ.Visibility = Visibility.Visible
|
||||||
|
CameraHQ.Header = "Photo on table"
|
||||||
|
CameraHQBtn.Content = "HQ"
|
||||||
|
' verifico quale camera è impostata
|
||||||
|
If GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, 0, m_MainWindow.GetMachIniFile()) = 1 Then
|
||||||
|
CameraHQBtn.IsChecked = True
|
||||||
|
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1HQ.png", UriKind.Relative))
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
CameraHQBtn.IsChecked = False
|
||||||
|
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1.png", UriKind.Relative))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
CameraHQ.Visibility = Visibility.Collapsed
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub TestingPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub TestingPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
@@ -203,6 +226,20 @@ Public Class MachineCNPageUC
|
|||||||
m_CN.DGeneralFunctions_WriteCncMode(8)
|
m_CN.DGeneralFunctions_WriteCncMode(8)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CameraHQBtn_Click(sender As Object, e As RoutedEventArgs) Handles CameraHQBtn.Click
|
||||||
|
Dim sEnableHQ As String = If(CameraHQBtn.IsChecked, "1", "0")
|
||||||
|
WritePrivateProfileString(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, sEnableHQ, m_MainWindow.GetMachIniFile())
|
||||||
|
If CameraHQBtn.IsChecked Then
|
||||||
|
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1HQ.png", UriKind.Relative))
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
If Not IsNothing(m_MainWindow.m_CadCutPageUC.PhotoIMG) Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.PhotoIMG.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/NewIcons/icone-tagli-1.png", UriKind.Relative))
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub MDITxBx_KeyDown(sender As Object, e As KeyEventArgs) Handles MDITxBx.KeyDown
|
Private Sub MDITxBx_KeyDown(sender As Object, e As KeyEventArgs) Handles MDITxBx.KeyDown
|
||||||
If e.Key = Key.Return Then
|
If e.Key = Key.Return Then
|
||||||
' leggo se stato reset
|
' leggo se stato reset
|
||||||
|
|||||||
@@ -248,16 +248,16 @@ Public Class MachineStatusUC
|
|||||||
dL3 = ptTip.z
|
dL3 = ptTip.z
|
||||||
End If
|
End If
|
||||||
' Visualizzazione
|
' Visualizzazione
|
||||||
Axis1TxBx.Text = LenToString(dL1, -3)
|
Axis1TxBx.Text = LenToString(dL1, -3, True)
|
||||||
Axis2TxBx.Text = LenToString(dL2, -3)
|
Axis2TxBx.Text = LenToString(dL2, -3, True)
|
||||||
Axis3TxBx.Text = LenToString(dL3, -3)
|
Axis3TxBx.Text = LenToString(dL3, -3, True)
|
||||||
Axis4TxBx.Text = DoubleToString(dR1, -3)
|
Axis4TxBx.Text = DoubleToString(dR1, -3)
|
||||||
Axis5TxBx.Text = DoubleToString(dR2, -3)
|
Axis5TxBx.Text = DoubleToString(dR2, -3)
|
||||||
If m_AxesNumber >= 6 Then Axis6TxBx.Text = DoubleToString(dA6, -3)
|
If m_AxesNumber >= 6 Then Axis6TxBx.Text = DoubleToString(dA6, -3)
|
||||||
If m_AxesNumber >= 7 Then Axis7TxBx.Text = LenToString(dA7, -3)
|
If m_AxesNumber >= 7 Then Axis7TxBx.Text = LenToString(dA7, -3, True)
|
||||||
If m_AxesNumber >= 8 Then Axis8TxBx.Text = LenToString(dA8, -3)
|
If m_AxesNumber >= 8 Then Axis8TxBx.Text = LenToString(dA8, -3, True)
|
||||||
If m_AxesNumber >= 9 Then Axis9TxBx.Text = LenToString(dA9, -3)
|
If m_AxesNumber >= 9 Then Axis9TxBx.Text = LenToString(dA9, -3, True)
|
||||||
If m_AxesNumber >= 10 Then Axis10TxBx.Text = LenToString(dA10, -3)
|
If m_AxesNumber >= 10 Then Axis10TxBx.Text = LenToString(dA10, -3, True)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub DisplayPositionDelta()
|
Sub DisplayPositionDelta()
|
||||||
@@ -265,22 +265,28 @@ Public Class MachineStatusUC
|
|||||||
Dim dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10 As Double
|
Dim dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10 As Double
|
||||||
m_MainWindow.m_CNCommunication.GetAxesDeltas(dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10)
|
m_MainWindow.m_CNCommunication.GetAxesDeltas(dL1, dL2, dL3, dR1, dR2, dA6, dA7, dA8, dA9, dA10)
|
||||||
' Visualizzazione
|
' Visualizzazione
|
||||||
DeltaAxis1TxBx.Text = LenToString(dL1, -3)
|
DeltaAxis1TxBx.Text = LenToString(dL1, -3, True)
|
||||||
DeltaAxis2TxBx.Text = LenToString(dL2, -3)
|
DeltaAxis2TxBx.Text = LenToString(dL2, -3, True)
|
||||||
DeltaAxis3TxBx.Text = LenToString(dL3, -3)
|
DeltaAxis3TxBx.Text = LenToString(dL3, -3, True)
|
||||||
DeltaAxis4TxBx.Text = DoubleToString(dR1, -3)
|
DeltaAxis4TxBx.Text = DoubleToString(dR1, -3)
|
||||||
DeltaAxis5TxBx.Text = DoubleToString(dR2, -3)
|
DeltaAxis5TxBx.Text = DoubleToString(dR2, -3)
|
||||||
If m_AxesNumber >= 6 Then DeltaAxis6TxBx.Text = DoubleToString(dA6, -3)
|
If m_AxesNumber >= 6 Then DeltaAxis6TxBx.Text = DoubleToString(dA6, -3)
|
||||||
If m_AxesNumber >= 7 Then DeltaAxis7TxBx.Text = LenToString(dA7, -3)
|
If m_AxesNumber >= 7 Then DeltaAxis7TxBx.Text = LenToString(dA7, -3, True)
|
||||||
If m_AxesNumber >= 8 Then DeltaAxis8TxBx.Text = LenToString(dA8, -3)
|
If m_AxesNumber >= 8 Then DeltaAxis8TxBx.Text = LenToString(dA8, -3, True)
|
||||||
If m_AxesNumber >= 9 Then DeltaAxis9TxBx.Text = LenToString(dA9, -3)
|
If m_AxesNumber >= 9 Then DeltaAxis9TxBx.Text = LenToString(dA9, -3, True)
|
||||||
If m_AxesNumber >= 10 Then DeltaAxis10TxBx.Text = LenToString(dA10, -3)
|
If m_AxesNumber >= 10 Then DeltaAxis10TxBx.Text = LenToString(dA10, -3, True)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub DisplayFeed()
|
Sub DisplayFeed()
|
||||||
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
|
Dim dRealFeed As Double = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
|
||||||
|
' modifica richiesta 26/05/2023 da Rosario per cliente Lanzetta
|
||||||
|
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||||
|
dRealFeed = m_CN.d_DInterpo_Prog_Feed
|
||||||
|
Else
|
||||||
|
dRealFeed = m_CN.d_DInterpo_Prog_Feed * m_CN.d_DInterpo_Feed_override / 100
|
||||||
|
End If
|
||||||
'Feed = DoubleToString(dRealFeed, 0)
|
'Feed = DoubleToString(dRealFeed, 0)
|
||||||
FeedTxBx.Text = LenToString(dRealFeed, 0)
|
FeedTxBx.Text = LenToString(dRealFeed, 0, True)
|
||||||
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
|
'FeedOverride = DoubleToString(m_CN.d_DInterpo_Feed_override, 0) & "%"
|
||||||
Dim dFeedOverride As Double = m_CN.d_DInterpo_Feed_override
|
Dim dFeedOverride As Double = m_CN.d_DInterpo_Feed_override
|
||||||
FeedOverrideTxBx.Text = DoubleToString(dFeedOverride, 0) & "%"
|
FeedOverrideTxBx.Text = DoubleToString(dFeedOverride, 0) & "%"
|
||||||
@@ -302,8 +308,18 @@ Public Class MachineStatusUC
|
|||||||
Dim dSpindleOvr As Double
|
Dim dSpindleOvr As Double
|
||||||
' se attivi nuovi comandi MDI su siemens
|
' 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
|
If m_MainWindow.m_CNCommunication.m_nNCType = 3 AndAlso m_MainWindow.m_CNCommunication.m_CN.m_IsSiemensOne Then
|
||||||
|
|
||||||
|
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)
|
dSpindlePower = m_CN.d_data(0)
|
||||||
dSpindleOvr = m_CN.d_data(1)
|
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
|
Else
|
||||||
dSpindlePower = m_CN.d_spindle_power
|
dSpindlePower = m_CN.d_spindle_power
|
||||||
dSpindleOvr = If(m_CN.bPowerOvr > 0, m_CN.d_spindle_power / m_CN.bPowerOvr * 100, 0)
|
dSpindleOvr = If(m_CN.bPowerOvr > 0, m_CN.d_spindle_power / m_CN.bPowerOvr * 100, 0)
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ Public Class MachiningDbPageUC
|
|||||||
StepType = {EgtMsg(MSG_COMBOBOXPARAM + 38), EgtMsg(MSG_COMBOBOXPARAM + 39), EgtMsg(MSG_COMBOBOXPARAM + 40)}
|
StepType = {EgtMsg(MSG_COMBOBOXPARAM + 38), EgtMsg(MSG_COMBOBOXPARAM + 39), EgtMsg(MSG_COMBOBOXPARAM + 40)}
|
||||||
RouFinStepType = {EgtMsg(MSG_COMBOBOXPARAM + 38), EgtMsg(MSG_COMBOBOXPARAM + 39)}
|
RouFinStepType = {EgtMsg(MSG_COMBOBOXPARAM + 38), EgtMsg(MSG_COMBOBOXPARAM + 39)}
|
||||||
ExtCornType = {EgtMsg(MSG_COMBOBOXPARAM + 43), EgtMsg(MSG_COMBOBOXPARAM + 44), EgtMsg(MSG_COMBOBOXPARAM + 45)}
|
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
|
' Assegno array a combobox
|
||||||
WorkSideCmBx.ItemsSource = WorkSide
|
WorkSideCmBx.ItemsSource = WorkSide
|
||||||
@@ -208,7 +208,7 @@ Public Class MachiningDbPageUC
|
|||||||
MillTool.Clear()
|
MillTool.Clear()
|
||||||
bFound = EgtTdbGetFirstTool(MCH_TF.MILL, sToolName, nType)
|
bFound = EgtTdbGetFirstTool(MCH_TF.MILL, sToolName, nType)
|
||||||
While bFound
|
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)
|
bFound = EgtTdbGetNextTool(MCH_TF.MILL, sToolName, nType)
|
||||||
End While
|
End While
|
||||||
PocketTool.Clear()
|
PocketTool.Clear()
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ Public Class PolishingsPageUC
|
|||||||
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
|
RepeatTxBl.Text = EgtMsg(91093) ' Ripetizioni
|
||||||
StepTxBl.Text = EgtMsg(90787) ' Passo
|
StepTxBl.Text = EgtMsg(90787) ' Passo
|
||||||
OffSetTxBl.Text = EgtMsg(91089) ' Offset
|
OffSetTxBl.Text = EgtMsg(91089) ' Offset
|
||||||
RadiusTxBl.Text = "Raggio"
|
RadiusTxBl.Text = EgtMsg(91139) ' Raggio
|
||||||
DistanceTxBl.Text = "Distanza"
|
DistanceTxBl.Text = EgtMsg(91140) ' Distanza
|
||||||
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
|
LiLoGpBx.Header = EgtMsg(91094) ' Attacco/Uscita
|
||||||
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
|
LiLenTxBl.Text = EgtMsg(91097) ' Lunghezza
|
||||||
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
|
LiHeightTxBl.Text = EgtMsg(91095) ' Altezza
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<!-- Definizione del ToolHolderUc -->
|
<!-- Definizione del ToolHolderUc -->
|
||||||
<Grid>
|
<Grid>
|
||||||
<Image Source="/Resources/ToolChangerPos.png"/>
|
<Image Source="/Resources/ToolChangerPos.png"/>
|
||||||
<ToggleButton Name="Tool" Width="50" Height="50" Margin="22,40,26,8" Background="#7FB4B4B4">
|
<ToggleButton Name="Tool" Width="50" Height="50" Margin="62,10,16,10" Background="#7FB4B4B4">
|
||||||
<ToggleButton.Template>
|
<ToggleButton.Template>
|
||||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
</ToggleButton.Template>
|
</ToggleButton.Template>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
<TextBlock Name="PositionNameTxBl" Height="22" Width="68" FontSize="16" Margin="12,16,41,61"/>
|
<TextBlock Name="PositionNameTxBl" Height="22" Width="50" FontSize="16" Margin="20,40,70,53"/>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -695,7 +695,16 @@ Public Class ToolsDbPageUC
|
|||||||
Dim ToolName As String = String.Empty
|
Dim ToolName As String = String.Empty
|
||||||
Dim bFound As Boolean = EgtTdbGetFirstTool(nTType, ToolName, nType)
|
Dim bFound As Boolean = EgtTdbGetFirstTool(nTType, ToolName, nType)
|
||||||
While bFound
|
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)
|
bFound = EgtTdbGetNextTool(nTType, ToolName, nType)
|
||||||
End While
|
End While
|
||||||
ToolsList.Add(ToolCathegory)
|
ToolsList.Add(ToolCathegory)
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Button Grid.Column="2" Style="{DynamicResource OmagCut_BlueIconButton}" Click="ExitBtn_Click">
|
<Button Name="ExitBtn" Grid.Column="2" Style="{DynamicResource OmagCut_BlueIconButton}" Click="ExitBtn_Click">
|
||||||
<Image Source="{DynamicResource XImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource XImg}" Style="{DynamicResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ Class MainWindow
|
|||||||
' Coefficiente di scalatura della finestra rispetto a standard
|
' Coefficiente di scalatura della finestra rispetto a standard
|
||||||
Friend m_dMWinScale As Double = 1
|
Friend m_dMWinScale As Double = 1
|
||||||
|
|
||||||
|
' Variabile che definisce l'avvio forzato in modalità FRAME
|
||||||
|
Friend m_OnlyFrame As Boolean = False
|
||||||
|
|
||||||
' Dichiarazione delle Page UserControl
|
' Dichiarazione delle Page UserControl
|
||||||
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
|
Friend m_WorkInProgressPageUC As WorkInProgressPageUC
|
||||||
Friend m_CurrentProjectPageUC As CurrentProjectPageUC
|
Friend m_CurrentProjectPageUC As CurrentProjectPageUC
|
||||||
@@ -38,6 +41,8 @@ Class MainWindow
|
|||||||
Friend m_MachinePageUC As MachinePageUC
|
Friend m_MachinePageUC As MachinePageUC
|
||||||
Friend m_OptionsPageUC As OptionsPageUC
|
Friend m_OptionsPageUC As OptionsPageUC
|
||||||
|
|
||||||
|
Friend m_IsClosingApplication As Integer = 0
|
||||||
|
|
||||||
' Dichiarazione variabili direttori
|
' Dichiarazione variabili direttori
|
||||||
Private m_sExeRoot As String = String.Empty
|
Private m_sExeRoot As String = String.Empty
|
||||||
Private m_sDataRoot As String = String.Empty
|
Private m_sDataRoot As String = String.Empty
|
||||||
@@ -98,6 +103,8 @@ Class MainWindow
|
|||||||
OFFICE_TYPE = 2 ^ 19 ' 524288
|
OFFICE_TYPE = 2 ^ 19 ' 524288
|
||||||
REGISTRATION = 2 ^ 20 ' 1048576
|
REGISTRATION = 2 ^ 20 ' 1048576
|
||||||
SIMPLESTATISTICS = 2 ^ 21 ' 2097152
|
SIMPLESTATISTICS = 2 ^ 21 ' 2097152
|
||||||
|
COMPOFRAME = 2 ^ 22 ' 4194304
|
||||||
|
CUT_LIGHT = 2 ^ 23 ' 8388608
|
||||||
End Enum
|
End Enum
|
||||||
' Opzione nesting automatico
|
' Opzione nesting automatico
|
||||||
Private m_bAutoNest As Boolean = False
|
Private m_bAutoNest As Boolean = False
|
||||||
@@ -323,13 +330,28 @@ Class MainWindow
|
|||||||
EgtSetNestKey(sNestKey)
|
EgtSetNestKey(sNestKey)
|
||||||
Dim bNetHwKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
Dim bNetHwKey As Boolean = (GetPrivateProfileInt(S_GENERAL, K_NETKEY, 0, m_sIniFile) = 1)
|
||||||
EgtSetNetHwKey(bNetHwKey)
|
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
|
' Verifico abilitazione nesting automatico
|
||||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||||
' Recupero opzioni della chiave
|
' Recupero opzioni della chiave
|
||||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2501, 1, m_nKeyLevel) And
|
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2610, 1, m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(9423, 2501, 1, m_nKeyOptions)
|
EgtGetKeyOptions(9423, 2610, 1, m_nKeyOptions)
|
||||||
' Verifico abilitazione prodotto
|
' Verifico abilitazione prodotto
|
||||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||||
|
' Impostazione per programma OnlyFrame: solo se CUT_BASE non attivo
|
||||||
|
If Not bProd Then
|
||||||
|
m_OnlyFrame = GetKeyOption(KEY_OPT.CUT_LIGHT)
|
||||||
|
End If
|
||||||
|
|
||||||
' Inizializzazione generale di EgtInterface
|
' Inizializzazione generale di EgtInterface
|
||||||
m_nDebug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_sIniFile)
|
m_nDebug = GetPrivateProfileInt(S_GENERAL, K_DEBUG, 0, m_sIniFile)
|
||||||
m_sVersion = My.Application.Info.Version.Major.ToString() & "." &
|
m_sVersion = My.Application.Info.Version.Major.ToString() & "." &
|
||||||
@@ -439,6 +461,7 @@ Class MainWindow
|
|||||||
If GetPrivateProfileInt(S_GENERAL, "Test", "0", m_sIniFile) = 0 OrElse
|
If GetPrivateProfileInt(S_GENERAL, "Test", "0", m_sIniFile) = 0 OrElse
|
||||||
Not File.Exists(m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
|
Not File.Exists(m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
|
||||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Collapsed
|
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Collapsed
|
||||||
|
EgtOutLog("Warning: Missing file 'TestWork.lua' in folder 'DirectCmd', buttun 'TEST' collapsed!")
|
||||||
Else
|
Else
|
||||||
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Visible
|
m_CadCutPageUC.m_ProjectMgr.TestBtn.Visibility = Visibility.Visible
|
||||||
End If
|
End If
|
||||||
@@ -558,7 +581,7 @@ Class MainWindow
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
' --------------------------------- SLAB DB -------------------------------------------------------
|
' --------------------------------- SLAB DB -------------------------------------------------------
|
||||||
|
ExitBtn.ToolTip = "Exit" & vbCrLf & "Minimize (Shift)"
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ManageSingleIstance()
|
Private Sub ManageSingleIstance()
|
||||||
@@ -631,6 +654,31 @@ Class MainWindow
|
|||||||
m_IdleTimer.Interval = TimeSpan.FromMilliseconds(100)
|
m_IdleTimer.Interval = TimeSpan.FromMilliseconds(100)
|
||||||
m_IdleTimer.Start()
|
m_IdleTimer.Start()
|
||||||
|
|
||||||
|
Dim sAssStatus As String = " discontinued"
|
||||||
|
Dim nAssLeftDays As Integer
|
||||||
|
If EgtGetKeyAssLeftDays(nAssLeftDays) And nAssLeftDays >= 0 Then
|
||||||
|
If nAssLeftDays > 30 Then
|
||||||
|
sAssStatus = "expires within " & nAssLeftDays.ToString() & " days"
|
||||||
|
ElseIf nAssLeftDays > 0 Then
|
||||||
|
sAssStatus = "to be renewed within " & nAssLeftDays.ToString() & " days"
|
||||||
|
Else
|
||||||
|
sAssStatus = "to be renewed by today"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Or nAssLeftDays = 358
|
||||||
|
If (nAssLeftDays <= 7 And nAssLeftDays >= 0) Or nAssLeftDays = 14 Or nAssLeftDays = 21 Or nAssLeftDays = 28 Then
|
||||||
|
Dim sMsg As String = EgtMsg(91141) ' Assistenza in scadenza /nContattare assistenza:/n
|
||||||
|
Dim sAssistance As String = String.Empty
|
||||||
|
GetPrivateProfileString(S_GENERAL, "Assistances", "", sAssistance, GetIniFile)
|
||||||
|
Dim sItems As String() = sAssistance.Split(","c)
|
||||||
|
For Each Item As String In sItems
|
||||||
|
sMsg &= " → " & Item.Trim & " /n"
|
||||||
|
Next
|
||||||
|
Dim MyLicWn As New LicenseWindow(Me, sMsg, "Assistance " & sAssStatus)
|
||||||
|
MyLicWn.Show()
|
||||||
|
End If
|
||||||
|
|
||||||
' inizilizzo
|
' inizilizzo
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -995,6 +1043,16 @@ Class MainWindow
|
|||||||
' Se già visualizzato errore, lo nascondo
|
' Se già visualizzato errore, lo nascondo
|
||||||
If m_CurrentProjectPageUC.OutMessageBrd.IsMouseOver Then
|
If m_CurrentProjectPageUC.OutMessageBrd.IsMouseOver Then
|
||||||
m_CurrentProjectPageUC.ClearMessage()
|
m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
' se è premuto il pulsante Shift allora provvedo ad aprire il file di Log
|
||||||
|
If Keyboard.Modifiers And ModifierKeys.Shift Then
|
||||||
|
' Genero file CNC (lancio anche se errore in precedenza)
|
||||||
|
Dim sTemoDirect As String = GetTempDir() & "\OmagCUTLog.txt"
|
||||||
|
Try
|
||||||
|
Process.Start("Notepad.exe", sTemoDirect)
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog(ex.ToString)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
' Condizioni che impediscono di clickare fuori dalla calcolatrice o tastiera quando una di queste è aperta
|
' Condizioni che impediscono di clickare fuori dalla calcolatrice o tastiera quando una di queste è aperta
|
||||||
If EgtWPFLib.EgtCalculator.GetbIsActive Then
|
If EgtWPFLib.EgtCalculator.GetbIsActive Then
|
||||||
@@ -1085,6 +1143,19 @@ Class MainWindow
|
|||||||
m_CurrentProjectPageUC.SaveNamedProject()
|
m_CurrentProjectPageUC.SaveNamedProject()
|
||||||
m_CurrentProjectPageUC.SaveProject()
|
m_CurrentProjectPageUC.SaveProject()
|
||||||
End If
|
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)
|
||||||
|
Dim nCount As Integer = 0
|
||||||
|
While m_IsClosingApplication <> 2
|
||||||
|
If nCount > 5 Then
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
' verifico che il processo DripFeed sia terminato
|
||||||
|
EgtOutLog("Stato chiusura programma: " & m_IsClosingApplication.ToString)
|
||||||
|
Thread.Sleep(100)
|
||||||
|
nCount += 1
|
||||||
|
End While
|
||||||
' Uscita
|
' Uscita
|
||||||
MainWindowExit()
|
MainWindowExit()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1211,11 +1282,17 @@ Class MainWindow
|
|||||||
m_ProdLineTimer.Interval = TimeSpan.FromMilliseconds(2000)
|
m_ProdLineTimer.Interval = TimeSpan.FromMilliseconds(2000)
|
||||||
m_ProdLineTimer.Start()
|
m_ProdLineTimer.Start()
|
||||||
End If
|
End If
|
||||||
|
' di default attivo la pagina CadCut
|
||||||
|
If m_OnlyFrame Then
|
||||||
|
m_ActivePage = MainWindow.Pages.FrameCut
|
||||||
|
Else
|
||||||
|
m_ActivePage = MainWindow.Pages.CadCut
|
||||||
|
End If
|
||||||
' seleziono il tipo di avvio
|
' seleziono il tipo di avvio
|
||||||
m_CurrentProjectPageUC.StartProgram()
|
m_CurrentProjectPageUC.StartProgram()
|
||||||
' aggiorno la grafica
|
' aggiorno la grafica
|
||||||
EgtZoom(ZM.ALL, True)
|
EgtZoom(ZM.ALL, True)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub EgtWPFInit()
|
Friend Sub EgtWPFInit()
|
||||||
@@ -1247,8 +1324,34 @@ Class MainWindow
|
|||||||
Dim bHeadH1 As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
Dim bHeadH1 As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
||||||
EgtSetCurrentContext(nCurrCtx)
|
EgtSetCurrentContext(nCurrCtx)
|
||||||
' Aggiorno interfaccia
|
' Aggiorno interfaccia
|
||||||
|
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(91142), EgtMsg(91143), 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)
|
CadCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FRAMES)
|
||||||
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso bHeadH1
|
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso bHeadH1
|
||||||
|
End If
|
||||||
|
|
||||||
' DirectCutBtn.IsEnabled = bHeadH1
|
' DirectCutBtn.IsEnabled = bHeadH1
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1277,7 +1380,9 @@ Class MainWindow
|
|||||||
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjFinished, 1)
|
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjFinished, 1)
|
||||||
Dim nVarFin As Integer = 0
|
Dim nVarFin As Integer = 0
|
||||||
For I As Integer = 1 To 4
|
For I As Integer = 1 To 4
|
||||||
|
If Not m_CurrentMachine.bDemo Then
|
||||||
System.Threading.Thread.Sleep(50)
|
System.Threading.Thread.Sleep(50)
|
||||||
|
End If
|
||||||
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
|
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
|
||||||
nVarFin = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
|
nVarFin = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
|
||||||
Exit For
|
Exit For
|
||||||
@@ -1339,7 +1444,9 @@ Class MainWindow
|
|||||||
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjCopy, 1)
|
m_CNCommunication.m_CN.ReadEls_Add_Parameter(m_CurrentMachine.sVarProjCopy, 1)
|
||||||
Dim nVarCopy As Integer = 0
|
Dim nVarCopy As Integer = 0
|
||||||
For I As Integer = 1 To 10
|
For I As Integer = 1 To 10
|
||||||
|
If Not m_CurrentMachine.bDemo Then
|
||||||
System.Threading.Thread.Sleep(50)
|
System.Threading.Thread.Sleep(50)
|
||||||
|
End If
|
||||||
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
|
If m_CNCommunication.m_CN.n_DReadELS_handle = 1 Then
|
||||||
nVarCopy = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
|
nVarCopy = CInt(m_CNCommunication.m_CN.d_DReadELS_value)
|
||||||
Exit For
|
Exit For
|
||||||
@@ -1997,6 +2104,7 @@ Class MainWindow
|
|||||||
EgtDeselectObj(m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv)
|
EgtDeselectObj(m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv)
|
||||||
EgtDeselectObj(m_CadCutPageUC.m_NestPage.m_CurrSelectedSawCurv)
|
EgtDeselectObj(m_CadCutPageUC.m_NestPage.m_CurrSelectedSawCurv)
|
||||||
EgtResetMark(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
|
m_CadCutPageUC.m_ProjectMgr.TestBtn.IsChecked = False
|
||||||
Me.m_CadCutPageUC.m_NestPage.m_bSelectCurv = False
|
Me.m_CadCutPageUC.m_NestPage.m_bSelectCurv = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Imports System.Windows
|
|||||||
#End If
|
#End If
|
||||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyProduct("OmagCUT")>
|
<Assembly: AssemblyProduct("OmagCUT")>
|
||||||
<Assembly: AssemblyCopyright("Copyright © 2015-2023 by Egalware s.r.l.")>
|
<Assembly: AssemblyCopyright("Copyright © 2015-2024 by Egalware s.r.l.")>
|
||||||
<Assembly: AssemblyTrademark("")>
|
<Assembly: AssemblyTrademark("")>
|
||||||
<Assembly: ComVisible(False)>
|
<Assembly: ComVisible(False)>
|
||||||
|
|
||||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.5.1.2")>
|
<Assembly: AssemblyVersion("2.6.10.1")>
|
||||||
<Assembly: AssemblyFileVersion("2.5.1.2")>
|
<Assembly: AssemblyFileVersion("2.6.10.1")>
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ Public Class CN_Siemens
|
|||||||
Case 8 ' Modalita Ref Point
|
Case 8 ' Modalita Ref Point
|
||||||
sDBVarPath &= "REF_POINT"
|
sDBVarPath &= "REF_POINT"
|
||||||
End Select
|
End Select
|
||||||
|
' /plc/"OmagCUT_DB".CTRL.AUTO
|
||||||
DVariables_WriteVariables3(sDBVarPath, 1, 1, 0, 0, "")
|
DVariables_WriteVariables3(sDBVarPath, 1, 1, 0, 0, "")
|
||||||
Return 0
|
Return 0
|
||||||
Else
|
Else
|
||||||
@@ -132,7 +133,7 @@ Public Class CN_Siemens
|
|||||||
Public Overrides Function read_active_mode() As Short
|
Public Overrides Function read_active_mode() As Short
|
||||||
'EgtOutLog("Modo attivo: " & M_MMFiles.SiemensRet.n_param2)
|
'EgtOutLog("Modo attivo: " & M_MMFiles.SiemensRet.n_param2)
|
||||||
If m_IsSiemensOne Or m_IsActiveModeSubscription Then
|
If m_IsSiemensOne Or m_IsActiveModeSubscription Then
|
||||||
Select Case n_data(3)
|
Select Case n_data(n_index_mode)
|
||||||
Case 1
|
Case 1
|
||||||
Return 0
|
Return 0
|
||||||
Case 2
|
Case 2
|
||||||
@@ -144,7 +145,7 @@ Public Class CN_Siemens
|
|||||||
End Select
|
End Select
|
||||||
Else
|
Else
|
||||||
' per verificare che la comunicazione funzioni correttamente
|
' per verificare che la comunicazione funzioni correttamente
|
||||||
EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
|
' EgtOutLog("Modo -read_active_mode-: " & M_MMFiles.SiemensRet.n_param2.ToString)
|
||||||
Return M_MMFiles.read_active_mode()
|
Return M_MMFiles.read_active_mode()
|
||||||
'Return CShort(M_MMFiles.SiemensRet.n_param2)
|
'Return CShort(M_MMFiles.SiemensRet.n_param2)
|
||||||
End If
|
End If
|
||||||
@@ -152,7 +153,12 @@ Public Class CN_Siemens
|
|||||||
|
|
||||||
Public Overrides Function Is_G24_active() As Boolean
|
Public Overrides Function Is_G24_active() As Boolean
|
||||||
|
|
||||||
|
If m_IsSiemensOne Or m_IsActiveModeSubscription Then
|
||||||
|
Return b_data(n_index_is_G24_active)
|
||||||
|
|
||||||
|
Else
|
||||||
Return M_MMFiles.SiemensRet.b_interf_G24
|
Return M_MMFiles.SiemensRet.b_interf_G24
|
||||||
|
End If
|
||||||
|
|
||||||
End Function
|
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)
|
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)
|
Dim n_ret As Short = Write_var(VarAddr, ParType, nVarValue, lVarValue, dVarValue, sVarValue)
|
||||||
'EgtOutLog("CN SIEMENS Dopo scrittura variabile")
|
'EgtOutLog("CN SIEMENS Dopo scrittura variabile")
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Overrides Sub DVariables_Read_Subscription(VarAddr As String, ParType As Short, Index As Integer)
|
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)
|
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
|
End Sub
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Public MustInherit Class CN_generico
|
|||||||
Public Const MAX_VAR As Short = 100
|
Public Const MAX_VAR As Short = 100
|
||||||
Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
|
Public Const MAX_VALUES As Short = 9 ' Max. index to read the data from the FXServer array
|
||||||
Public Const MAX_TOOLS As Short = 100
|
Public Const MAX_TOOLS As Short = 100
|
||||||
Public Const NUM_DATA = 55 ' Numero di dati del CN (Speed,Feed,...)
|
Public Const NUM_DATA = 57 ' Numero di dati del CN (Speed,Feed,...)
|
||||||
|
|
||||||
Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC
|
Public m_NewVariable As Boolean = False ' per scrittura delle vairbaili Apllication del PLC
|
||||||
|
|
||||||
@@ -70,8 +70,20 @@ Public MustInherit Class CN_generico
|
|||||||
Parking = 52
|
Parking = 52
|
||||||
EnableZone = 53
|
EnableZone = 53
|
||||||
EnablePC = 54
|
EnablePC = 54
|
||||||
|
|
||||||
|
nAxes = 55
|
||||||
|
|
||||||
|
ResetStatus = 56
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
|
Public Enum Type As Short
|
||||||
|
TBoolean = 0
|
||||||
|
TInteger = 1
|
||||||
|
TLong = 2
|
||||||
|
TDouble = 3
|
||||||
|
TString = 4
|
||||||
|
|
||||||
|
End Enum
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " Struct"
|
#Region " Struct"
|
||||||
@@ -128,6 +140,9 @@ Public MustInherit Class CN_generico
|
|||||||
Public d_param1 As Double
|
Public d_param1 As Double
|
||||||
Public sz_string As String ' ( MAX 200 caratteri )
|
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 b_data(14) As Boolean
|
||||||
Public n_data(14) As Int16
|
Public n_data(14) As Int16
|
||||||
Public l_data(14) As Long
|
Public l_data(14) As Long
|
||||||
@@ -218,10 +233,27 @@ Public MustInherit Class CN_generico
|
|||||||
Public bRemote As Boolean
|
Public bRemote As Boolean
|
||||||
' Nuovi di bottoni -------------------------------------------
|
' Nuovi di bottoni -------------------------------------------
|
||||||
|
|
||||||
|
' solo per NumOld
|
||||||
|
Public bIsDripFeed As Boolean = False
|
||||||
|
|
||||||
|
' usato nel FANUC per leggere lo stato macchina se 5 assi attivo
|
||||||
|
Public b5AxesActive As Boolean
|
||||||
|
|
||||||
Public nMachineMode As Integer
|
Public nMachineMode As Integer
|
||||||
|
|
||||||
Public m_szCnDataVar(NUM_DATA - 1) As String
|
Public m_szCnDataVar(NUM_DATA - 1) As String
|
||||||
|
'
|
||||||
|
' nuovi dal 29-III-2023 per Fanuc
|
||||||
|
'
|
||||||
|
Public n_Base_addr_int_vars As Integer = 59800
|
||||||
|
Public n_Base_addr_byte_for_bits_vars As Integer = 59820
|
||||||
|
Public n_num_var_int_to_read As Short = 10
|
||||||
|
Public n_num_var_byte_for_bits_to_read As Short = 30
|
||||||
|
Public s_addr_set_nc_mode As String = "D59825"
|
||||||
|
Public s_addr_feedhold As String = "D59850.6"
|
||||||
|
'
|
||||||
|
' Eventi
|
||||||
|
'
|
||||||
Public Event NewPositionData(ByVal sender As Object)
|
Public Event NewPositionData(ByVal sender As Object)
|
||||||
Public Event NewPosDeltaData(ByVal sender As Object)
|
Public Event NewPosDeltaData(ByVal sender As Object)
|
||||||
Public Event NewVarChanged(ByVal sender As Object)
|
Public Event NewVarChanged(ByVal sender As Object)
|
||||||
@@ -294,8 +326,8 @@ Public MustInherit Class CN_generico
|
|||||||
|
|
||||||
Public MustOverride Function DTool_set_read_range(n_start As Short, n_stop As Short) As Short
|
Public MustOverride Function DTool_set_read_range(n_start As Short, n_stop As Short) As Short
|
||||||
|
|
||||||
Public MustOverride Function DTool_write_tool(n_tool_number As Short, Length_X As Double, Radius As Double, TipRadius_Z As Double, _
|
Public MustOverride Function DTool_write_tool(n_tool_number As Short, Length_X As Double, Radius As Double, TipRadius_Z As Double,
|
||||||
DLength_X As Double, DTipRadius_Z As Double, _
|
DLength_X As Double, DTipRadius_Z As Double,
|
||||||
nDirection As Short, nType As Short, nH As Integer) As Short
|
nDirection As Short, nType As Short, nH As Integer) As Short
|
||||||
|
|
||||||
Public Overridable Function SetProgramMainOrSub(bMain As Boolean) As Boolean
|
Public Overridable Function SetProgramMainOrSub(bMain As Boolean) As Boolean
|
||||||
@@ -341,4 +373,36 @@ Public MustInherit Class CN_generico
|
|||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
#Region " Nuovi metodi pubblici"
|
||||||
|
|
||||||
|
Public Overridable Function NC_read_var_short(VarAddr As String, ByRef value As Short) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overridable Function NC_read_var_short_range(VarStartAddr As String, VarEndAddr As String, ByRef values() As Short) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overridable Function NC_write_var_short(VarAddr As String, ByRef value As Short) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overridable Function NC_read_var_bit(VarAddr As String, ByRef value As Boolean) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overridable Function NC_write_var_bit(VarAddr As String, ByRef value As Boolean) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Overridable Function NC_pulse_bit(VarAddr As String) As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
Public Overridable Function Geppo() As Boolean
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
#End Region
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ Module M_MMFiles
|
|||||||
|
|
||||||
#Region " Structures"
|
#Region " Structures"
|
||||||
|
|
||||||
|
' Struttura per spedire un "comando" al Siemens
|
||||||
<StructLayout(LayoutKind.Sequential)> _
|
<StructLayout(LayoutKind.Sequential)>
|
||||||
Structure SiemensSendStruct
|
Structure SiemensSendStruct
|
||||||
|
|
||||||
Public n_Flag As Integer
|
Public n_Flag As Integer
|
||||||
@@ -46,7 +46,7 @@ Module M_MMFiles
|
|||||||
|
|
||||||
Private SiemensSend As SiemensSendStruct
|
Private SiemensSend As SiemensSendStruct
|
||||||
|
|
||||||
|
' Struttura per leggere l'esito di un "comando" al Siemens
|
||||||
<StructLayout(LayoutKind.Sequential)> _
|
<StructLayout(LayoutKind.Sequential)> _
|
||||||
Structure SiemensRetStruct
|
Structure SiemensRetStruct
|
||||||
|
|
||||||
@@ -75,6 +75,7 @@ Module M_MMFiles
|
|||||||
Public b_is_laser_ON As Boolean
|
Public b_is_laser_ON As Boolean
|
||||||
Public b_is_spindle_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)> _
|
<MarshalAs(UnmanagedType.ByValArray, ArraySubType:=UnmanagedType.R8, SizeConst:=16)> _
|
||||||
Public d_interf_axis_position() As Double
|
Public d_interf_axis_position() As Double
|
||||||
|
|
||||||
@@ -176,7 +177,7 @@ Module M_MMFiles
|
|||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " Commands constants"
|
#Region " Commands constants"
|
||||||
|
' Elenco codici comandi per spedire programma a SiemensComm.exe
|
||||||
Enum CMD As Short
|
Enum CMD As Short
|
||||||
|
|
||||||
CMD_Download_NC_prog = 1
|
CMD_Download_NC_prog = 1
|
||||||
@@ -205,6 +206,7 @@ Module M_MMFiles
|
|||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
Friend Enum VarType As Short
|
Friend Enum VarType As Short
|
||||||
|
TBoolean = 0
|
||||||
TInteger = 1
|
TInteger = 1
|
||||||
TLong = 2
|
TLong = 2
|
||||||
TDouble = 3
|
TDouble = 3
|
||||||
@@ -343,6 +345,9 @@ Module M_MMFiles
|
|||||||
Function ActivateProgram(ByVal sz_part_program As String) As Short
|
Function ActivateProgram(ByVal sz_part_program As String) As Short
|
||||||
'EgtOutLog("ActivateProgram start dell'm_mmFiles")
|
'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.n_Command = CMD.CMD_ActivateProgram
|
||||||
SiemensSend.sz_string = sz_part_program
|
SiemensSend.sz_string = sz_part_program
|
||||||
|
|
||||||
@@ -370,7 +375,8 @@ Module M_MMFiles
|
|||||||
SiemensSend.n_Command = CMD.CMD_CycleStart
|
SiemensSend.n_Command = CMD.CMD_CycleStart
|
||||||
|
|
||||||
execute_command()
|
execute_command()
|
||||||
'EgtOutLog("CycleStart end dell'm_mmFiles")
|
' Rimango in attesa
|
||||||
|
EgtOutLog(" → CycleStart")
|
||||||
Return SiemensRet.n_result
|
Return SiemensRet.n_result
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
@@ -597,14 +603,13 @@ Module M_MMFiles
|
|||||||
'EgtOutLog("Write_Nc_var start dell'm_mmFiles")
|
'EgtOutLog("Write_Nc_var start dell'm_mmFiles")
|
||||||
SiemensSend.n_Command = CMD.CMD_Read_NC_subscription
|
SiemensSend.n_Command = CMD.CMD_Read_NC_subscription
|
||||||
SiemensSend.sz_string_2 = VarAddr ' indirizzo su CN dell' oggetto da scrivere
|
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
|
SiemensSend.n_param1 = Index ' tipo di dato da scrivere
|
||||||
|
EgtOutLog(" Indice del vettore associato '" & Index & "'")
|
||||||
SiemensSend.n_param2 = ParType ' tipo di dato da scrivere
|
SiemensSend.n_param2 = ParType ' tipo di dato da scrivere
|
||||||
|
EgtOutLog(" Indice tipo di variabile '" & ParType & "'")
|
||||||
execute_command()
|
execute_command()
|
||||||
m_MainWindow.m_CNCommunication.m_CN.sz_interf_error_message = SiemensRet.sz_interf_error_message
|
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(" sz_interf_error_message: " & m_MainWindow.m_CNCommunication.m_CN.sz_interf_error_message)
|
||||||
EgtOutLog(" n_result: " & SiemensRet.n_result)
|
EgtOutLog(" n_result: " & SiemensRet.n_result)
|
||||||
Return SiemensRet.n_result
|
Return SiemensRet.n_result
|
||||||
@@ -765,7 +770,7 @@ Module M_MMFiles
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
' copio variabili in abbonamento
|
' 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.b_data(Index) = SiemensRet.b_data(Index)
|
||||||
CurrCN.n_data(Index) = SiemensRet.n_data(Index)
|
CurrCN.n_data(Index) = SiemensRet.n_data(Index)
|
||||||
CurrCN.l_data(Index) = SiemensRet.l_data(Index)
|
CurrCN.l_data(Index) = SiemensRet.l_data(Index)
|
||||||
|
|||||||
@@ -9,12 +9,50 @@ Imports System.Text
|
|||||||
Imports System.Windows.Forms
|
Imports System.Windows.Forms
|
||||||
Imports System.Runtime.InteropServices
|
Imports System.Runtime.InteropServices
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Threading
|
||||||
|
Imports System.Windows.Threading
|
||||||
|
|
||||||
Namespace Num
|
Namespace Num
|
||||||
|
|
||||||
Public Class NumNCOld
|
Public Class NumNCOld
|
||||||
Inherits CN_generico
|
Inherits CN_generico
|
||||||
|
|
||||||
|
'Public bIsDripFeed As Boolean = False
|
||||||
|
' costruisco il riferimento alla pagina principale
|
||||||
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
|
' costruisco il riferimento alla barra ProjectMng
|
||||||
|
Private m_ProjectMng As ProjectMgrUC
|
||||||
|
|
||||||
|
' Messaggi ricevuti direttamente dal Thread che gestisce la comunicazione DripFeed
|
||||||
|
Private m_nMsg As Integer = 0
|
||||||
|
' Colore originale del bottone WorkBtn
|
||||||
|
Private m_BackgroundOrig As SolidColorBrush
|
||||||
|
' Timer per la lettura aggiornata dei messaggi in fase di comunicazione DriFeed
|
||||||
|
Private m_RefreshTimer As New DispatcherTimer
|
||||||
|
' funzione richiamata ad ogni clik
|
||||||
|
Private Sub RefreshTimer_tick()
|
||||||
|
' verifico se ci sono messaggi da stampare (Se n_Msg > 0 è una info, Se n_Msg < 0 è un errore)
|
||||||
|
If m_nMsg > 0 Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage(EgtMsg(m_nMsg))
|
||||||
|
ElseIf m_nMsg < 0 Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(Math.Abs(m_nMsg)))
|
||||||
|
End If
|
||||||
|
' dopo la stampa del messaggio resetto l'indice
|
||||||
|
m_nMsg = 0
|
||||||
|
' se ha terminato la trasmissione DripFeed fermo il timer
|
||||||
|
If Not bIsDripFeed Then
|
||||||
|
m_RefreshTimer.Stop()
|
||||||
|
' reimposto il colore originale del bottone WorkBtn della pagina ProjectMng
|
||||||
|
If Not IsNothing(m_ProjectMng) Then
|
||||||
|
m_ProjectMng.WorkBtn.Background = m_BackgroundOrig
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
#Region " Classes"
|
#Region " Classes"
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
@@ -79,6 +117,10 @@ Public Class NumNCOld
|
|||||||
Const TSi = 1, TFi = 2, SPi = 3, THi = 4, INI = 5, TABSYMB = 10, ALLMODULE = 16, CMODULE = 65, TXTFILE = 97
|
Const TSi = 1, TFi = 2, SPi = 3, THi = 4, INI = 5, TABSYMB = 10, ALLMODULE = 16, CMODULE = 65, TXTFILE = 97
|
||||||
Const IHMFNT = 98, IHMBMP = 99, IHMRSC = 100, IHMINI = 101, IHMTXT = 102, IHMICO = 103, IHMCOD = 104
|
Const IHMFNT = 98, IHMBMP = 99, IHMRSC = 100, IHMINI = 101, IHMTXT = 102, IHMICO = 103, IHMCOD = 104
|
||||||
|
|
||||||
|
' Const DNC_MODE_FIRST = &H3A00, DNC_MODE_CONTINUE = &H3B00, DNC_MODE_ABORT = &H3C00
|
||||||
|
Const DNC_MODE_FIRST = 0, DNC_MODE_CONTINUE = 1, DNC_MODE_ABORT = 2
|
||||||
|
Const DNC_IN_PROGRES = &HC8, DNC_RING_BUFFER_FULL = &H7
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region " Structures"
|
#Region " Structures"
|
||||||
@@ -115,7 +157,7 @@ Public Class NumNCOld
|
|||||||
Dim Type As Long
|
Dim Type As Long
|
||||||
End Structure
|
End Structure
|
||||||
|
|
||||||
<StructLayout(LayoutKind.Explicit)> _
|
<StructLayout(LayoutKind.Explicit)>
|
||||||
Public Structure tDNC20_ObjectList
|
Public Structure tDNC20_ObjectList
|
||||||
<FieldOffset(0)> Public ElemNum As UInt16
|
<FieldOffset(0)> Public ElemNum As UInt16
|
||||||
<FieldOffset(2)> Public First As UInt16
|
<FieldOffset(2)> Public First As UInt16
|
||||||
@@ -123,7 +165,7 @@ Public Class NumNCOld
|
|||||||
End Structure
|
End Structure
|
||||||
|
|
||||||
Public Structure My_data_struct
|
Public Structure My_data_struct
|
||||||
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> _
|
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)>
|
||||||
Public data As Byte()
|
Public data As Byte()
|
||||||
End Structure
|
End Structure
|
||||||
|
|
||||||
@@ -149,6 +191,7 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
Private iFirstVar As UInt16
|
Private iFirstVar As UInt16
|
||||||
Private n_portNC As Int16
|
Private n_portNC As Int16
|
||||||
|
Private n_PPport As Int16
|
||||||
|
|
||||||
Private Vmminch As Long = 1000
|
Private Vmminch As Long = 1000
|
||||||
Private NumCifreDecP4 As Long = 1000
|
Private NumCifreDecP4 As Long = 1000
|
||||||
@@ -209,6 +252,9 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
Declare Function UpLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
Declare Function UpLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
||||||
Declare Function DownLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
Declare Function DownLoadFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal filename As String) As Int16
|
||||||
|
Declare Function DownLoadFileAsyn Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal ringsize As Int32, ByVal filename As String, ByVal Mode As UInt16, ByRef Index As UInt16) As Int16
|
||||||
|
Declare Function DownLoadPPPFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal ringsize As Int32, ByVal filename As String) As Int16
|
||||||
|
Declare Function DownLoadPPPFile2 Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32, ByVal ringsize As Int32, ByVal filename As String, ByVal Offset As Int16, ByVal Mode As UInt16, ByRef Index As UInt16) As Int16
|
||||||
Declare Function DncDeleteFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32) As Int16
|
Declare Function DncDeleteFile Lib "dnc2.dll" (ByVal Port As Int16, ByVal prog As Int32) As Int16
|
||||||
|
|
||||||
Declare Function DNC20_Position_OM Lib "dnc20_2.dll" (ByVal Port As Int16, ByVal Groupe As Int16, ByRef d As My_data_struct, ByVal Mode As UInt16) As Int16
|
Declare Function DNC20_Position_OM Lib "dnc20_2.dll" (ByVal Port As Int16, ByVal Groupe As Int16, ByRef d As My_data_struct, ByVal Mode As UInt16) As Int16
|
||||||
@@ -243,6 +289,7 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
' Stringhe valide : "COM" o "XIP01, 0, 10, 0, 0, 0"
|
' Stringhe valide : "COM" o "XIP01, 0, 10, 0, 0, 0"
|
||||||
Dim nret As Integer = NC_connect(m_szCnDataVar(CnData.Comm))
|
Dim nret As Integer = NC_connect(m_szCnDataVar(CnData.Comm))
|
||||||
|
EgtOutLog(" → Risultatao apertura connessiione: " & nret)
|
||||||
If nret <> 0 Then Return False
|
If nret <> 0 Then Return False
|
||||||
|
|
||||||
n_state = 2
|
n_state = 2
|
||||||
@@ -316,6 +363,14 @@ Public Class NumNCOld
|
|||||||
EgtOutLog(msga)
|
EgtOutLog(msga)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
nret = Get_Port(n_PPport)
|
||||||
|
If nret <> 0 Then
|
||||||
|
msga = " PP Port not available (Get_Port) : " & nret.ToString
|
||||||
|
EgtOutLog(msga)
|
||||||
|
Else
|
||||||
|
EgtOutLog("PP Port available: " & n_PPport.ToString)
|
||||||
|
End If
|
||||||
|
|
||||||
' eventualmente aggiungere apertura porta per PPP
|
' eventualmente aggiungere apertura porta per PPP
|
||||||
'iport3 = 3
|
'iport3 = 3
|
||||||
'nret = Get_Port(iport3)
|
'nret = Get_Port(iport3)
|
||||||
@@ -333,6 +388,7 @@ Public Class NumNCOld
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim nret As Int16 = Free_Port(n_portNC)
|
Dim nret As Int16 = Free_Port(n_portNC)
|
||||||
|
nret = Free_Port(n_PPport)
|
||||||
|
|
||||||
global_state = eStateType.NOT_INIT
|
global_state = eStateType.NOT_INIT
|
||||||
|
|
||||||
@@ -481,6 +537,8 @@ Public Class NumNCOld
|
|||||||
|
|
||||||
If nret <> 0 Then
|
If nret <> 0 Then
|
||||||
EgtOutLog("Error in set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString())
|
EgtOutLog("Error in set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString())
|
||||||
|
Else
|
||||||
|
EgtOutLog("set_NC_mode(" & n_mode.ToString() & ") : " & nret.ToString() & " → ok")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
global_state = eStateType.READY
|
global_state = eStateType.READY
|
||||||
@@ -526,7 +584,6 @@ Public Class NumNCOld
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Function Read_machine_pos() As Int16
|
Function Read_machine_pos() As Int16
|
||||||
|
|
||||||
Dim nret As Int16
|
Dim nret As Int16
|
||||||
Dim i, n As Integer
|
Dim i, n As Integer
|
||||||
|
|
||||||
@@ -792,33 +849,133 @@ Public Class NumNCOld
|
|||||||
Return nret
|
Return nret
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
'
|
'
|
||||||
' da PC a CN
|
' da PC a CN (sincrono)
|
||||||
'
|
'
|
||||||
Public Overrides Function Download_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
Public Overrides Function Download_NC_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||||
|
|
||||||
' Verifico accessibilità CN
|
' Verifico accessibilità CN
|
||||||
If VerifyBusy() <> eStateType.READY Then
|
If VerifyBusy() <> eStateType.READY Then
|
||||||
|
EgtOutLog("Stato CN " & global_state.ToString)
|
||||||
Return global_state
|
Return global_state
|
||||||
End If
|
End If
|
||||||
' Dichiaro CN occupato
|
|
||||||
global_state = eStateType.BUSY
|
|
||||||
|
|
||||||
' Determino numero programma ( %900.0 -> 9000)
|
' Determino numero programma ( %900.0 -> 9000)
|
||||||
Dim l As Int32 = get_Num_prog_number(sz_NC_filename)
|
Dim l As Int32 = get_Num_prog_number(sz_NC_filename)
|
||||||
' Trasmetto il programma
|
' verifico la dimensione del file
|
||||||
Dim nRet As Int16 = DownLoadFile(n_portNC, l, sz_PC_filename)
|
Dim myFile As New FileInfo(sz_PC_filename)
|
||||||
|
' determino dimensione file
|
||||||
|
Dim sizeInBytes As Long = myFile.Length
|
||||||
|
|
||||||
|
EgtOutLog(" --- Dimensione file CadCut " & sizeInBytes.ToString)
|
||||||
|
' Verifico se dimensione file è maggiore del Buffer
|
||||||
|
If sizeInBytes > 32000 Then
|
||||||
|
' Trasmetto il programma (PPPFile2)
|
||||||
|
EgtOutLog(" --- START DOWNLOAD PPP FILE --- ")
|
||||||
|
' Imposto la modalità AUTO
|
||||||
|
set_NC_mode(0)
|
||||||
|
' Dichiaro CN occupato
|
||||||
|
global_state = eStateType.BUSY
|
||||||
|
' Attesa opportuna
|
||||||
|
System.Threading.Thread.Sleep(1000)
|
||||||
|
' 90969=Drip feed has been started
|
||||||
|
m_nMsg = 90969
|
||||||
|
bIsDripFeed = True
|
||||||
|
' cambio lo sfondo del pulsante WorkBtn
|
||||||
|
If Not IsNothing(m_MainWindow.m_FrameCutPageUC) AndAlso Not IsNothing(m_MainWindow.m_FrameCutPageUC.m_ProjectMgr) Then
|
||||||
|
m_ProjectMng = m_MainWindow.m_FrameCutPageUC.m_ProjectMgr
|
||||||
|
ElseIf Not IsNothing(m_MainWindow.m_CadCutPageUC) AndAlso Not IsNothing(m_MainWindow.m_CadCutPageUC.m_ProjectMgr) Then
|
||||||
|
m_ProjectMng = m_MainWindow.m_CadCutPageUC.m_ProjectMgr
|
||||||
|
End If
|
||||||
|
If Not IsNothing(m_ProjectMng) Then
|
||||||
|
m_BackgroundOrig = m_ProjectMng.WorkBtn.Background
|
||||||
|
Dim MyLinearGradientBrush As LinearGradientBrush = Application.Current.FindResource("OmagCut_GradientYellow")
|
||||||
|
m_ProjectMng.WorkBtn.Background = MyLinearGradientBrush
|
||||||
|
End If
|
||||||
|
' avvio il timer per la lettura dei messaggi, imposto il clock a 1s
|
||||||
|
AddHandler m_RefreshTimer.Tick, AddressOf RefreshTimer_tick
|
||||||
|
m_RefreshTimer.Interval = TimeSpan.FromMilliseconds(1000)
|
||||||
|
m_RefreshTimer.Start()
|
||||||
|
Dim thread As New Thread(Sub()
|
||||||
|
Download_Drip_CN_prog(sz_PC_filename, sz_NC_filename)
|
||||||
|
End Sub)
|
||||||
|
thread.Start()
|
||||||
|
Return 1
|
||||||
|
Else
|
||||||
|
' Dichiaro CN occupato
|
||||||
|
global_state = eStateType.BUSY
|
||||||
|
' Trasmetto il programma (interamente)
|
||||||
|
Dim nRet As Int16 = DownLoadFile(n_portNC, l, sz_PC_filename)
|
||||||
If nRet <> 0 Then
|
If nRet <> 0 Then
|
||||||
EgtOutLog("Error in Download_NC_prog : " & nRet.ToString())
|
EgtOutLog("Error in Download_NC_prog : " & nRet.ToString())
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Dichiaro CN libero
|
' Dichiaro CN libero
|
||||||
global_state = eStateType.READY
|
global_state = eStateType.READY
|
||||||
|
Return nRet
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Function
|
||||||
|
'
|
||||||
|
' da PC a CN (asincrono)
|
||||||
|
'
|
||||||
|
|
||||||
|
Private Function Download_Drip_CN_prog(sz_PC_filename As String, sz_NC_filename As String) As Int16
|
||||||
|
' Determino numero programma ( %900.0 -> 9000)
|
||||||
|
Dim l As Int32 = get_Num_prog_number(sz_NC_filename)
|
||||||
|
' Ultimo numero di segmento invaito
|
||||||
|
Dim i As UInt16
|
||||||
|
' Invia il primo segmento (dati comunicazione)
|
||||||
|
EgtOutLog(" -> Invia il primo segmento " & " → PPport: " & n_PPport & " → NC file name: " & sz_PC_filename & " → Dnc Mode: " & DNC_MODE_FIRST)
|
||||||
|
Dim nRet As Int16 = DownLoadPPPFile2(n_PPport, l, 32768, sz_PC_filename, Nothing, DNC_MODE_FIRST, i)
|
||||||
|
' Inserisco un tempo di attesa di sicurezza
|
||||||
|
Thread.Sleep(100)
|
||||||
|
' Verifico che il primo invio sia andato a buon fine (il CN deve esser in modalità IN_PROGRESS oppure RING_BUFFER_FULL)
|
||||||
|
If nRet <> DNC_IN_PROGRES And nRet <> DNC_RING_BUFFER_FULL And m_MainWindow.m_IsClosingApplication <> 1 Then
|
||||||
|
' 90970=Drip feed has been failed (Error)
|
||||||
|
m_nMsg = -90970
|
||||||
|
EgtOutLog("Error in Download_NC_prog/DownLoadPPPFile : " & nRet.ToString())
|
||||||
|
Else
|
||||||
|
' 90969=Drip feed has been started (Info)
|
||||||
|
m_nMsg = 90969
|
||||||
|
' Se il primo invio è andato a buon fine allora invio i segmenti seguenti
|
||||||
|
While (nRet = DNC_IN_PROGRES Or nRet = DNC_RING_BUFFER_FULL) And m_MainWindow.m_IsClosingApplication <> 1
|
||||||
|
nRet = DownLoadPPPFile2(n_portNC, l, 32768, sz_PC_filename, Nothing, DNC_MODE_CONTINUE, i)
|
||||||
|
Thread.Sleep(10)
|
||||||
|
End While
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Verifico che il processo sia terminato correttamente
|
||||||
|
If nRet <> 0 Then
|
||||||
|
' 90971=Drip feed hes been aborted (Error)
|
||||||
|
If m_nMsg > 0 Then
|
||||||
|
' se in precedenza non è stato generato un messaggio di errore (m_nMsg = -90970) comunico che il processo è stato interrotto
|
||||||
|
m_nMsg = -90971
|
||||||
|
End If
|
||||||
|
EgtOutLog("Error in Download_NC_prog/DownLoadPPPFile : " & nRet.ToString() & ", DownLoadPPPFile is aborted")
|
||||||
|
Else
|
||||||
|
' 90972=Drip feed has been ended (Info)
|
||||||
|
m_nMsg = 90972
|
||||||
|
End If
|
||||||
|
|
||||||
|
' prima di terminare (a prescinere dall'esito della comunicazione) forzo la terminazione
|
||||||
|
nRet = DownLoadPPPFile2(n_PPport, l, 32768, sz_PC_filename, Nothing, DNC_MODE_ABORT, i)
|
||||||
|
' Dichiaro CN libero
|
||||||
|
global_state = eStateType.READY
|
||||||
|
bIsDripFeed = False
|
||||||
|
EgtOutLog("IsDripFeed : " & bIsDripFeed.ToString)
|
||||||
|
EgtOutLog(" --- END DOWNLOAD PPP FILE --- ")
|
||||||
|
' se richiesta chiusura del programma, notifico che è stata chiusa correttmanete la comunicazione DripFeed
|
||||||
|
If m_MainWindow.m_IsClosingApplication = 1 Then
|
||||||
|
m_MainWindow.m_IsClosingApplication = 2
|
||||||
|
End If
|
||||||
|
' chiudo il thread aperto
|
||||||
Return nRet
|
Return nRet
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
'
|
'
|
||||||
' da CN a pc
|
' da CN a pc
|
||||||
'
|
'
|
||||||
|
|||||||
@@ -115,6 +115,9 @@
|
|||||||
<Reference Include="AxInterop.FXLib">
|
<Reference Include="AxInterop.FXLib">
|
||||||
<HintPath>..\..\EgtProg\OmagCUT\AxInterop.FXLib.dll</HintPath>
|
<HintPath>..\..\EgtProg\OmagCUT\AxInterop.FXLib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="DotNetZip">
|
||||||
|
<HintPath>..\..\EgtProg\OmagCUT\DotNetZip.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="EgtPHOTOLib">
|
<Reference Include="EgtPHOTOLib">
|
||||||
<HintPath>..\..\EgtProg\Dll32\EgtPHOTOLib.dll</HintPath>
|
<HintPath>..\..\EgtProg\Dll32\EgtPHOTOLib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -122,11 +125,13 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
|
<HintPath>..\..\EgtProg\DllD32\EgtUILib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EgtWPFLib">
|
<Reference Include="EgtWPFLib, Version=2.5.2.2, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\EgtProg\DllD32\EgtWPFLib.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\EgtProg\Dll32\EgtWPFLib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="EgtWPFLib5">
|
<Reference Include="EgtWPFLib5, Version=2.5.2.2, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\EgtProg\OmagCUT\EgtWPFLib5.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\EgtProg\Dll32\EgtWPFLib5.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Interop.FXLib">
|
<Reference Include="Interop.FXLib">
|
||||||
<HintPath>..\..\EgtProg\OmagCUT\Interop.FXLib.dll</HintPath>
|
<HintPath>..\..\EgtProg\OmagCUT\Interop.FXLib.dll</HintPath>
|
||||||
@@ -140,9 +145,6 @@
|
|||||||
<HintPath>..\..\EgtProg\OmagCUT\Interop.FXServer.dll</HintPath>
|
<HintPath>..\..\EgtProg\OmagCUT\Interop.FXServer.dll</HintPath>
|
||||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Ionic.Zip">
|
|
||||||
<HintPath>..\..\EgtProg\OmagCUT\Ionic.Zip.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PresentationFramework.Aero" />
|
<Reference Include="PresentationFramework.Aero" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Data.SQLite, Version=1.0.112.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">
|
<Reference Include="System.Data.SQLite, Version=1.0.112.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86">
|
||||||
@@ -172,6 +174,9 @@
|
|||||||
<Compile Include="AboutBox\AboutBoxWD.xaml.vb">
|
<Compile Include="AboutBox\AboutBoxWD.xaml.vb">
|
||||||
<DependentUpon>AboutBoxWD.xaml</DependentUpon>
|
<DependentUpon>AboutBoxWD.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="CadCuts\ChooseTestToolWD.xaml.vb">
|
||||||
|
<DependentUpon>ChooseTestToolWD.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="CadCuts\SelectPartFromFamilyWD.xaml.vb">
|
<Compile Include="CadCuts\SelectPartFromFamilyWD.xaml.vb">
|
||||||
<DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon>
|
<DependentUpon>SelectPartFromFamilyWD.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -207,6 +212,9 @@
|
|||||||
<Compile Include="DrawImport\UnderDrillUC.xaml.vb">
|
<Compile Include="DrawImport\UnderDrillUC.xaml.vb">
|
||||||
<DependentUpon>UnderDrillUC.xaml</DependentUpon>
|
<DependentUpon>UnderDrillUC.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="LicenseWindow.xaml.vb">
|
||||||
|
<DependentUpon>LicenseWindow.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Machine\AlarmsPageUC.xaml.vb">
|
<Compile Include="Machine\AlarmsPageUC.xaml.vb">
|
||||||
<DependentUpon>AlarmsPageUC.xaml</DependentUpon>
|
<DependentUpon>AlarmsPageUC.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -225,6 +233,9 @@
|
|||||||
<Compile Include="Machine\WaterJetPageUC.xaml.vb">
|
<Compile Include="Machine\WaterJetPageUC.xaml.vb">
|
||||||
<DependentUpon>WaterJetPageUC.xaml</DependentUpon>
|
<DependentUpon>WaterJetPageUC.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="NcComm\fwlib32.vb" />
|
||||||
|
<Compile Include="NcComm\M_Fanuc.vb" />
|
||||||
|
<Compile Include="NcComm\M_Fanuc_hi.vb" />
|
||||||
<Compile Include="Project\AddToDataBaseUC.xaml.vb">
|
<Compile Include="Project\AddToDataBaseUC.xaml.vb">
|
||||||
<DependentUpon>AddToDataBaseUC.xaml</DependentUpon>
|
<DependentUpon>AddToDataBaseUC.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -240,6 +251,9 @@
|
|||||||
<Compile Include="Project\CicloStartWD.xaml.vb">
|
<Compile Include="Project\CicloStartWD.xaml.vb">
|
||||||
<DependentUpon>CicloStartWD.xaml</DependentUpon>
|
<DependentUpon>CicloStartWD.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="RawPhoto\OtherRefTabWD.xaml.vb">
|
||||||
|
<DependentUpon>OtherRefTabWD.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="RawPhoto\SlabIdWD.xaml.vb">
|
<Compile Include="RawPhoto\SlabIdWD.xaml.vb">
|
||||||
<DependentUpon>SlabIdWD.xaml</DependentUpon>
|
<DependentUpon>SlabIdWD.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -433,6 +447,10 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="CadCuts\ChooseTestToolWD.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="CadCuts\SelectPartFromFamilyWD.xaml">
|
<Page Include="CadCuts\SelectPartFromFamilyWD.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -477,6 +495,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>XamlIntelliSenseFileGenerator</Generator>
|
<Generator>XamlIntelliSenseFileGenerator</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="LicenseWindow.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="Machine\AlarmsPageUC.xaml">
|
<Page Include="Machine\AlarmsPageUC.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -514,6 +536,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="RawPhoto\OtherRefTabWD.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="RawPhoto\SlabIdWD.xaml">
|
<Page Include="RawPhoto\SlabIdWD.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@@ -896,7 +922,7 @@
|
|||||||
<Resource Include="Resources\MachineStatusImage\Single.png" />
|
<Resource Include="Resources\MachineStatusImage\Single.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\ToolChangerPos.png" />
|
<Resource Include="Resources\ToolChangerPos_OLD.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\Manual.png" />
|
<Resource Include="Resources\Manual.png" />
|
||||||
@@ -1322,6 +1348,36 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\NewIcons\Quality.png" />
|
<Resource Include="Resources\NewIcons\Quality.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\ToolChangerPos.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\RefTab.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\PhotoHQ.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\icone-tagli-1HQ.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\ImportPageListBoxImages\4.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\ImportPageListBoxImages\5.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\Muovi-grezzo.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\ON_OFF-REG.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\Move-Spot-Reg.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\RawHeight.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/NewIcons/ruota-oggetto-inclinato.png"></BitmapImage>
|
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/NewIcons/ruota-oggetto-inclinato.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/NewIcons/BarCode.png"></BitmapImage>
|
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/NewIcons/BarCode.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/NewIcons/SlabId.png"></BitmapImage>
|
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/NewIcons/SlabId.png"></BitmapImage>
|
||||||
|
<BitmapImage x:Key="RefTabImg" UriSource="Resources/NewIcons/RefTab.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/NewIcons/1-BottomLeft.png"></BitmapImage>
|
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/NewIcons/1-BottomLeft.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/NewIcons/2-BottomRight.png"></BitmapImage>
|
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/NewIcons/2-BottomRight.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/NewIcons/PartRotOn.png"></BitmapImage>
|
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/NewIcons/PartRotOn.png"></BitmapImage>
|
||||||
@@ -62,6 +63,7 @@
|
|||||||
<BitmapImage x:Key="PhotoImg" UriSource="Resources/NewIcons/icone-tagli-1.png"></BitmapImage>
|
<BitmapImage x:Key="PhotoImg" UriSource="Resources/NewIcons/icone-tagli-1.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="RawPartImg" UriSource="Resources/NewIcons/icone-tagli-5.png"></BitmapImage>
|
<BitmapImage x:Key="RawPartImg" UriSource="Resources/NewIcons/icone-tagli-5.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="RawProbeImg" UriSource="Resources/NewIcons/RawProbe.png"></BitmapImage>
|
<BitmapImage x:Key="RawProbeImg" UriSource="Resources/NewIcons/RawProbe.png"></BitmapImage>
|
||||||
|
<BitmapImage x:Key="RawHeightImg" UriSource="Resources/NewIcons/RawHeight.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="RightArrowImg" UriSource="Resources/NewIcons/RightArrow.png"></BitmapImage>
|
<BitmapImage x:Key="RightArrowImg" UriSource="Resources/NewIcons/RightArrow.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="SawProbeImg" UriSource="Resources/NewIcons/SawProbe.png"></BitmapImage>
|
<BitmapImage x:Key="SawProbeImg" UriSource="Resources/NewIcons/SawProbe.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="SendImg" UriSource="Resources/NewIcons/Send.png"></BitmapImage>
|
<BitmapImage x:Key="SendImg" UriSource="Resources/NewIcons/Send.png"></BitmapImage>
|
||||||
@@ -236,7 +238,10 @@
|
|||||||
<Setter Property="Foreground" Value="White"/>
|
<Setter Property="Foreground" Value="White"/>
|
||||||
<Setter Property="IsReadOnly" Value="True"/>
|
<Setter Property="IsReadOnly" Value="True"/>
|
||||||
<Setter Property="IsEnabled" Value="False"/>
|
<Setter Property="IsEnabled" Value="False"/>
|
||||||
|
<Setter Property="TextAlignment" Value="Center"/>
|
||||||
<Setter Property="Template" Value="{StaticResource FixedTextBoxTemplate}" />
|
<Setter Property="Template" Value="{StaticResource FixedTextBoxTemplate}" />
|
||||||
|
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
|
||||||
|
<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="OmagCut_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
<Style x:Key="OmagCut_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
|
||||||
|
|||||||
@@ -102,6 +102,7 @@
|
|||||||
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/AlignPieces.png"></BitmapImage>
|
<BitmapImage x:Key="AlignPiecesImg" UriSource="Resources/AlignPieces.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/BarCode.png"></BitmapImage>
|
<BitmapImage x:Key="BarCodeImg" UriSource="Resources/BarCode.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/SlabId.png"></BitmapImage>
|
<BitmapImage x:Key="SlabIdImg" UriSource="Resources/SlabId.png"></BitmapImage>
|
||||||
|
<BitmapImage x:Key="RefTabImg" UriSource="Resources/NewIcons/RefTab.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/BottomLeft.png"></BitmapImage>
|
<BitmapImage x:Key="BottomLeftImg" UriSource="Resources/BottomLeft.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/BottomRight.png"></BitmapImage>
|
<BitmapImage x:Key="BottomRightImg" UriSource="Resources/BottomRight.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/PartRotOn.png"></BitmapImage>
|
<BitmapImage x:Key="PartRotOnImg" UriSource="Resources/PartRotOn.png"></BitmapImage>
|
||||||
@@ -132,6 +133,7 @@
|
|||||||
<BitmapImage x:Key="PhotoImg" UriSource="Resources/Photo.png"></BitmapImage>
|
<BitmapImage x:Key="PhotoImg" UriSource="Resources/Photo.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="RawPartImg" UriSource="Resources/RawPart.png"></BitmapImage>
|
<BitmapImage x:Key="RawPartImg" UriSource="Resources/RawPart.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="RawProbeImg" UriSource="Resources/RawProbe.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="RightArrowImg" UriSource="Resources/RightArrow.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="SawProbeImg" UriSource="Resources/SawProbe.png"></BitmapImage>
|
<BitmapImage x:Key="SawProbeImg" UriSource="Resources/SawProbe.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="SendImg" UriSource="Resources/Send.png"></BitmapImage>
|
<BitmapImage x:Key="SendImg" UriSource="Resources/Send.png"></BitmapImage>
|
||||||
@@ -170,6 +172,7 @@
|
|||||||
<BitmapImage x:Key="Vein-matchImg" UriSource="Resources/NewIcons/Vein-match.png"></BitmapImage>
|
<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="Test-lamaImg" UriSource="Resources/NewIcons/Test-lama.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="Parcheggia-pezzoImg" UriSource="Resources/NewIcons/Parcheggia-pezzo.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="Inserisci-pezzoImg" UriSource="Resources/NewIcons/Inserisci-pezzo.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="Elimina-pezzoImg" UriSource="Resources/NewIcons/Elimina-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>
|
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
|
||||||
@@ -224,6 +227,7 @@
|
|||||||
<BitmapImage x:Key="QualityWJImg" UriSource="Resources/NewIcons/Quality.png"></BitmapImage>
|
<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="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-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-ONImg" UriSource="Resources/NewIcons/Tutti-ON.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="Tutti-OFFImg" UriSource="Resources/NewIcons/Tutti-OFF.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>
|
<BitmapImage x:Key="Inizio-Centro-FuoriImg" UriSource="Resources/NewIcons/Inizio-centro-fuori.png"></BitmapImage>
|
||||||
@@ -239,6 +243,7 @@
|
|||||||
<BitmapImage x:Key="Tutti-allungaImg" UriSource="Resources/NewIcons/Tutti-allunga.png"></BitmapImage>
|
<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="Tutti-accorciaImg" UriSource="Resources/NewIcons/Tutti-accorcia.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="LastProjImg" UriSource="Resources/NewIcons/PlayStep.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>
|
<FontFamily x:Key="OmagCut_Font">./Resources/Fonts/#Century Gothic</FontFamily>
|
||||||
|
|
||||||
@@ -790,6 +795,12 @@
|
|||||||
<Setter Property="Margin" Value="0,8,6,4"/>
|
<Setter Property="Margin" Value="0,8,6,4"/>
|
||||||
</Style>
|
</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) -->
|
<!-- ScrollBar & it's component (RepeatButton, Thumb) -->
|
||||||
@@ -1265,7 +1276,10 @@
|
|||||||
<Setter Property="Background" Value="White"/>
|
<Setter Property="Background" Value="White"/>
|
||||||
<Setter Property="IsReadOnly" Value="True"/>
|
<Setter Property="IsReadOnly" Value="True"/>
|
||||||
<Setter Property="IsEnabled" Value="False"/>
|
<Setter Property="IsEnabled" Value="False"/>
|
||||||
|
<Setter Property="TextAlignment" Value="Center"/>
|
||||||
<Setter Property="Template" Value="{StaticResource FixedTextBoxTemplate}" />
|
<Setter Property="Template" Value="{StaticResource FixedTextBoxTemplate}" />
|
||||||
|
<Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
|
||||||
|
<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- ______________________________________________________________________________________________________________________ -->
|
<!-- ______________________________________________________________________________________________________________________ -->
|
||||||
|
|||||||
@@ -1304,6 +1304,8 @@ Public Class OptionsPageUC
|
|||||||
End If
|
End If
|
||||||
Try
|
Try
|
||||||
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
|
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
|
||||||
|
zip.AlternateEncodingUsage = Ionic.Zip.ZipOption.Always
|
||||||
|
zip.AlternateEncoding = Text.Encoding.UTF8
|
||||||
' aggiungo file macchine
|
' aggiungo file macchine
|
||||||
For Each sMachineName As String In Machines
|
For Each sMachineName As String In Machines
|
||||||
Dim sMachineDir As String = m_MainWindow.GetMachinesRootDir() & "\" & sMachineName
|
Dim sMachineDir As String = m_MainWindow.GetMachinesRootDir() & "\" & sMachineName
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<Border Name="CurrProjGrid" Style="{DynamicResource OmagCut_MachiningBorder}" Grid.Row="0" >
|
<Border Name="CurrProjGrid" Style="{DynamicResource OmagCut_MachiningBorder}" Grid.Row="0" >
|
||||||
<Grid >
|
<Grid >
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="0.2*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -51,21 +51,22 @@
|
|||||||
<RowDefinition Height="0.5*"/>
|
<RowDefinition Height="0.5*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBlock Name="MaterialTxBl" Grid.Row="0"
|
<Image Name="MaterialTxBl"
|
||||||
Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Source="{DynamicResource RawPartImg}" Style="{StaticResource OmagCut_TextIcon}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="MaterialTxBx" Grid.Column="1" Grid.Row="0" Width="100"
|
<EgtWPFLib:EgtTextBox Name="MaterialTxBx" Grid.Column="1" Grid.Row="0" Margin="0,0,10,0"
|
||||||
Style="{DynamicResource OmagCut_FixedTextBox}"/>
|
TextAlignment="Right" Style="{DynamicResource OmagCut_FixedTextBox}"/>
|
||||||
<TextBlock Name="HeightTxBl" Grid.Row="1"
|
<Image Name="HeightTxBl" Grid.Row="1"
|
||||||
Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
Source="{DynamicResource RawHeightImg}" Style="{StaticResource OmagCut_TextIcon}"/>
|
||||||
<EgtWPFLib:EgtTextBox Name="HeightTxBx" Grid.Column="1" Grid.Row="1" Width="100"
|
<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"/>
|
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>
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ Imports EgtWPFLib5
|
|||||||
Public Class CurrentProjectPageUC
|
Public Class CurrentProjectPageUC
|
||||||
' Dichiarazione eventi
|
' Dichiarazione eventi
|
||||||
Friend Event OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
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 OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||||
Friend Event OnMouseUpScene(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
|
' Riferimento alla MainWindow
|
||||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
' Dichiarazione delle Page UserControl
|
' Dichiarazione delle Page UserControl
|
||||||
@@ -58,10 +60,10 @@ Public Class CurrentProjectPageUC
|
|||||||
Me.CurrentProjectPageGrid.Children.Add(CurrentProjectSceneHost)
|
Me.CurrentProjectPageGrid.Children.Add(CurrentProjectSceneHost)
|
||||||
|
|
||||||
'Imposto i messaggi letti dal file dei messaggi
|
'Imposto i messaggi letti dal file dei messaggi
|
||||||
MaterialTxBl.Text = EgtMsg(MSG_RAWPARTPAGEUC + 9) 'Material - Materiale
|
MaterialTxBl.ToolTip = EgtMsg(MSG_RAWPARTPAGEUC + 9) 'Material - Materiale
|
||||||
HeightTxBl.Text = EgtMsg(MSG_RAWPARTPAGEUC + 5) 'Height - Spessore
|
HeightTxBl.ToolTip = EgtMsg(MSG_RAWPARTPAGEUC + 5) 'Height - Spessore
|
||||||
ToolTxBl.Text = EgtMsg(MSG_CADCUTPAGEUC + 11) 'Tool - Utensile
|
ToolTxBl.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 11) 'Tool - Utensile
|
||||||
MachiningTxBl.Text = EgtMsg(MSG_CADCUTPAGEUC + 12) 'Machining - Lavorazione
|
MachiningTxBl.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 12) 'Machining - Lavorazione
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -107,7 +109,7 @@ Public Class CurrentProjectPageUC
|
|||||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
||||||
CurrentProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
CurrentProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||||
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
|
' 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
|
If Not CurrentProjectScene.Init() Or Not bProd Then
|
||||||
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
||||||
Me.CurrentProjectPageGrid.Children.Remove(CurrentProjectSceneHost)
|
Me.CurrentProjectPageGrid.Children.Remove(CurrentProjectSceneHost)
|
||||||
@@ -118,11 +120,25 @@ Public Class CurrentProjectPageUC
|
|||||||
#Else
|
#Else
|
||||||
' Se manca la chiave
|
' Se manca la chiave
|
||||||
If m_MainWindow.GetKeyLevel() = -1 Or m_MainWindow.GetKeyLevel() = -2 Then
|
If m_MainWindow.GetKeyLevel() = -1 Or m_MainWindow.GetKeyLevel() = -2 Then
|
||||||
|
If Not EgtGetNetHwKey() Then
|
||||||
EgtOutLog("Missing Dongle")
|
EgtOutLog("Missing Dongle")
|
||||||
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
|
' 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 sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
|
||||||
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
|
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)
|
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
|
' Altrimenti manca la licenza
|
||||||
Else
|
Else
|
||||||
EgtOutLog("Problems with Licence")
|
EgtOutLog("Problems with Licence")
|
||||||
@@ -196,9 +212,17 @@ Public Class CurrentProjectPageUC
|
|||||||
Else
|
Else
|
||||||
MaterialTxBx.Text = "-----"
|
MaterialTxBx.Text = "-----"
|
||||||
End If
|
End If
|
||||||
' Visualizzo lama e lavorazione correnti
|
|
||||||
|
' 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
|
ToolTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSawing
|
MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub StartProgram()
|
Public Sub StartProgram()
|
||||||
@@ -276,7 +300,7 @@ Public Class CurrentProjectPageUC
|
|||||||
' se apro la finestra "OpenFolder" l'assegnazione dei Children è fatta direttamente nella classe ProjectMgrUC
|
' se apro la finestra "OpenFolder" l'assegnazione dei Children è fatta direttamente nella classe ProjectMgrUC
|
||||||
If MyStartLancherWD.CurrSelection <> MODE_LAUNCHER.OpenFolder Then
|
If MyStartLancherWD.CurrSelection <> MODE_LAUNCHER.OpenFolder Then
|
||||||
' Carico sottopagina opportuna
|
' 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)
|
CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
|
||||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||||
m_MainWindow.CadCutBtn.IsChecked = True
|
m_MainWindow.CadCutBtn.IsChecked = True
|
||||||
@@ -314,6 +338,10 @@ Public Class CurrentProjectPageUC
|
|||||||
RaiseEvent OnMouseDownScene(sender, e)
|
RaiseEvent OnMouseDownScene(sender, e)
|
||||||
End Sub
|
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
|
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles CurrentProjectScene.OnMouseMoveScene
|
||||||
RaiseEvent OnMouseMoveScene(sender, e)
|
RaiseEvent OnMouseMoveScene(sender, e)
|
||||||
End Sub
|
End Sub
|
||||||
@@ -326,6 +354,10 @@ Public Class CurrentProjectPageUC
|
|||||||
SetInfoMessage(DistToString(vtDist))
|
SetInfoMessage(DistToString(vtDist))
|
||||||
End Sub
|
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
|
' Gestione progetto
|
||||||
|
|
||||||
Friend Sub SetNextProjectIndex()
|
Friend Sub SetNextProjectIndex()
|
||||||
@@ -412,6 +444,11 @@ Public Class CurrentProjectPageUC
|
|||||||
SetTotalArea(dTotArea)
|
SetTotalArea(dTotArea)
|
||||||
UpdateToProduceArea()
|
UpdateToProduceArea()
|
||||||
ShowAreas()
|
ShowAreas()
|
||||||
|
' Salvo info di C home
|
||||||
|
Dim dCHome As Double
|
||||||
|
EgtGetAxisHomePos("C", dCHome)
|
||||||
|
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHome, 0))
|
||||||
|
EgtZoom(ZM.ALL)
|
||||||
' Dichiaro progetto non modificato
|
' Dichiaro progetto non modificato
|
||||||
EgtResetModified()
|
EgtResetModified()
|
||||||
Return True
|
Return True
|
||||||
@@ -429,7 +466,10 @@ Public Class CurrentProjectPageUC
|
|||||||
End If
|
End If
|
||||||
' Se valore cambiato, aggiorno...
|
' Se valore cambiato, aggiorno...
|
||||||
Dim dDeltaZ As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable - dCurrAddTab
|
Dim dDeltaZ As Double = m_MainWindow.m_CurrentMachine.dAdditionalTable - dCurrAddTab
|
||||||
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()
|
AddAdditionalTable()
|
||||||
UpdateAllRawsZ(dDeltaZ)
|
UpdateAllRawsZ(dDeltaZ)
|
||||||
If GetPhoto() <> GDB_ID.NULL Then
|
If GetPhoto() <> GDB_ID.NULL Then
|
||||||
@@ -445,6 +485,7 @@ Public Class CurrentProjectPageUC
|
|||||||
End While
|
End While
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
If Not bChanged AndAlso bOldEnMod Then EgtEnableModified()
|
||||||
End If
|
End If
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
@@ -464,7 +505,9 @@ Public Class CurrentProjectPageUC
|
|||||||
' Nuova geometria
|
' Nuova geometria
|
||||||
Dim nAddTabId As Integer = GDB_ID.NULL
|
Dim nAddTabId As Integer = GDB_ID.NULL
|
||||||
' Se esiste geometria di riferimento
|
' 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
|
If nRefAddTabId <> GDB_ID.NULL Then
|
||||||
nAddTabId = EgtCopyGlob( nRefAddTabId, nFixtId)
|
nAddTabId = EgtCopyGlob( nRefAddTabId, nFixtId)
|
||||||
EgtSetStatus( nAddTabId, GDB_ST.ON_)
|
EgtSetStatus( nAddTabId, GDB_ST.ON_)
|
||||||
@@ -480,7 +523,7 @@ Public Class CurrentProjectPageUC
|
|||||||
' Sistemazioni finali
|
' Sistemazioni finali
|
||||||
If nAddTabId = GDB_ID.NULL Then Return False
|
If nAddTabId = GDB_ID.NULL Then Return False
|
||||||
EgtSetName(nAddTabId, MACH_ADD_TABLE)
|
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)
|
EgtSetInfo(nAddTabId, KEY_ADD_TABLE, dAddTable)
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
@@ -523,6 +566,20 @@ Public Class CurrentProjectPageUC
|
|||||||
End If
|
End If
|
||||||
' forzo visualizzazione eventuali dati su aree
|
' forzo visualizzazione eventuali dati su aree
|
||||||
SetAreasStatus(True)
|
SetAreasStatus(True)
|
||||||
|
' Recupero info C Home
|
||||||
|
Dim dCHomeCurrMach As Double
|
||||||
|
Dim dCHomeCurrproj As Double
|
||||||
|
EgtGetAxisHomePos("C", dCHomeCurrMach)
|
||||||
|
' Verifico che esista l'info del progetto
|
||||||
|
If EgtExistsInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME) Then
|
||||||
|
EgtGetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, dCHomeCurrproj)
|
||||||
|
' Se la macchina indicata ha C Home differente allora comunico un errore del progetto
|
||||||
|
If Math.Abs(dCHomeCurrproj - dCHomeCurrMach) > EPS_ANG_SMALL Then
|
||||||
|
EgtOutLog(" WARNING -> C axes home project is different from current machine, delta ang C home:" & DoubleToString(dCHomeCurrproj - dCHomeCurrMach, 2))
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHomeCurrMach, 0))
|
||||||
|
End If
|
||||||
' Dichiaro progetto non modificato
|
' Dichiaro progetto non modificato
|
||||||
EgtResetModified()
|
EgtResetModified()
|
||||||
Return True
|
Return True
|
||||||
@@ -977,7 +1034,13 @@ Public Class CurrentProjectPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Sub UpdateMachiningTxBx()
|
Friend Sub UpdateMachiningTxBx()
|
||||||
|
' 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
|
MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' Gestione fotografia della lastra (compreso riconoscimento contorno)
|
' Gestione fotografia della lastra (compreso riconoscimento contorno)
|
||||||
@@ -1354,7 +1417,14 @@ Public Class CurrentProjectPageUC
|
|||||||
Friend Sub SetAreasStatus( bShow As Boolean)
|
Friend Sub SetAreasStatus( bShow As Boolean)
|
||||||
Dim nMarkId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK)
|
Dim nMarkId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK)
|
||||||
If nMarkId = GDB_ID.NULL Then Return
|
If nMarkId = GDB_ID.NULL Then Return
|
||||||
|
|
||||||
|
' 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))
|
EgtSetStatus( nMarkId, If( bShow, GDB_ST.ON_, GDB_ST.OFF))
|
||||||
|
' Se necessario riabilito impostazione modificato
|
||||||
|
If bOldEnMod Then EgtEnableModified()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' Gestione messaggi in interfaccia
|
' Gestione messaggi in interfaccia
|
||||||
@@ -1381,7 +1451,8 @@ Public Class CurrentProjectPageUC
|
|||||||
|
|
||||||
Friend Sub ClearMessage()
|
Friend Sub ClearMessage()
|
||||||
OutMessageBrd.Background = Brushes.Transparent
|
OutMessageBrd.Background = Brushes.Transparent
|
||||||
OutMessageBrd.Visibility = Windows.Visibility.Hidden
|
OutMessageTxBl.Text = ""
|
||||||
|
'OutMessageBrd.Visibility = Windows.Visibility.Hidden
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -100,6 +100,10 @@ Public Class OpenPageUC
|
|||||||
LoadCurrDir()
|
LoadCurrDir()
|
||||||
m_bFirst = False
|
m_bFirst = False
|
||||||
Else
|
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())
|
EgtSetCurrentContext(OpenScene.GetCtx())
|
||||||
End If
|
End If
|
||||||
' Pulisco tutto
|
' Pulisco tutto
|
||||||
@@ -491,7 +495,19 @@ Public Class OpenPageUC
|
|||||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
' Istruzioni per chiudere OpenPageUC e aprire currentproject e cadcut page
|
' Istruzioni per chiudere OpenPageUC e aprire currentproject e cadcut page
|
||||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage)
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OpenPage)
|
||||||
|
If m_MainWindow.m_PrevActivePage = MainWindow.Pages.CadCut Then
|
||||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
|
If Not m_MainWindow.CadCutBtn.IsChecked Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC)
|
||||||
|
m_MainWindow.CadCutBtn.IsChecked = True
|
||||||
|
End If
|
||||||
|
ElseIf m_MainWindow.m_PrevActivePage = MainWindow.Pages.FrameCut Then
|
||||||
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
|
If Not m_MainWindow.FrameCutBtn.IsChecked Then
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_FrameCutPageUC)
|
||||||
|
m_MainWindow.FrameCutBtn.IsChecked = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
' Non modifico progetto corrente
|
' Non modifico progetto corrente
|
||||||
m_MainWindow.m_ActivePage = m_MainWindow.m_PrevActivePage
|
m_MainWindow.m_ActivePage = m_MainWindow.m_PrevActivePage
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
Imports System.IO
|
Imports System.ComponentModel
|
||||||
|
Imports System.Drawing
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Windows.Forms.Integration
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
|
||||||
@@ -30,6 +33,7 @@ Public Class ProjectMgrUC
|
|||||||
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 2) 'Work - Lavora
|
WorkBtn.ToolTip = EgtMsg(MSG_CADCUTPAGEUC + 2) 'Work - Lavora
|
||||||
End If
|
End If
|
||||||
TestBtn.ToolTip = EgtMsg(90255) 'Test
|
TestBtn.ToolTip = EgtMsg(90255) 'Test
|
||||||
|
ResetCutBtn.ToolTip = "Reset Cuts" & vbCrLf & "Reset Feed (Shift)"
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
Private Sub ProjectMgrUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||||
@@ -99,7 +103,6 @@ Public Class ProjectMgrUC
|
|||||||
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
|
m_CurrProjPage.NewProject(nTabInd, bRetainParkedParts)
|
||||||
' Gestione stato FastGrid
|
' Gestione stato FastGrid
|
||||||
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
|
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.OnPostNewProject()
|
||||||
EgtZoom(ZM.ALL)
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Friend Function ChooseTable() As Integer
|
Friend Function ChooseTable() As Integer
|
||||||
@@ -249,6 +252,11 @@ Public Class ProjectMgrUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
|
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
|
||||||
|
If (Keyboard.Modifiers And ModifierKeys.Shift) Then
|
||||||
|
' eseguo il ricalcolo delle sole FEED di lavorazione
|
||||||
|
UpdateFeedAllMachining()
|
||||||
|
Return
|
||||||
|
End If
|
||||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
' Cancello eventuali messaggi
|
' Cancello eventuali messaggi
|
||||||
m_CurrProjPage.ClearMessage()
|
m_CurrProjPage.ClearMessage()
|
||||||
@@ -258,10 +266,18 @@ Public Class ProjectMgrUC
|
|||||||
ResetAllStartCurv()
|
ResetAllStartCurv()
|
||||||
' cancello tutti i ponticelli disegnati
|
' cancello tutti i ponticelli disegnati
|
||||||
ResetAllBRidges()
|
ResetAllBRidges()
|
||||||
|
' cancella tutti i tagli di separazione inseriti in OFFICE
|
||||||
|
ResetAllSplitCut()
|
||||||
' Ricalcolo tutte le lavorazioni
|
' Ricalcolo tutte le lavorazioni
|
||||||
Dim nWarn As Integer = 0
|
Dim nWarn As Integer = 0
|
||||||
ResetAllMachinings(nWarn)
|
ResetAllMachinings(nWarn)
|
||||||
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
|
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
|
||||||
|
' Se eistono elimino i grezzi delle fasi che non contengono lavorazioni
|
||||||
|
ResetAllRawPart()
|
||||||
|
' Aggiorno Info C Home
|
||||||
|
Dim dCHome As Double
|
||||||
|
EgtGetAxisHomePos("C", dCHome)
|
||||||
|
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_CAXESHOME, DoubleToString(dCHome, 0))
|
||||||
' Aggiorno visualizzazione
|
' Aggiorno visualizzazione
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -298,47 +314,117 @@ Public Class ProjectMgrUC
|
|||||||
Dim m_ptRawMax, m_ptRawMin As Point3d
|
Dim m_ptRawMax, m_ptRawMin As Point3d
|
||||||
If Not GetRawBox(m_ptRawMin, m_ptRawMax) Then Return
|
If Not GetRawBox(m_ptRawMin, m_ptRawMax) Then Return
|
||||||
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
|
Dim dRawHeight As Double = m_ptRawMax.z - m_ptRawMin.z
|
||||||
|
|
||||||
' Recupero spessore lama corrente
|
' Recupero spessore lama corrente
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
Dim TestToolWD As New ChooseTestToolWD(m_MainWindow)
|
||||||
EgtTdbSetCurrTool(sSaw)
|
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
|
Dim dThick As Double = 0
|
||||||
|
Dim dHeight As Double = 0
|
||||||
|
If CurrTestTool.ToolIsSaw Then
|
||||||
|
' Spessore LAMA
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||||
Dim dDiam As Double = 0
|
' Diametro
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dDiam)
|
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
|
'recupero il lato selezionato
|
||||||
Dim nIdSelected As Integer = m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv
|
Dim nIdSelected As Integer = m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv
|
||||||
If nIdSelected = -1 Then Return
|
If nIdSelected = -1 Then Return
|
||||||
' recupero gli estremi del latovda tagliare
|
' recupero il vettore nel punto medio dell'entità
|
||||||
Dim ptStart As Point3d
|
Dim vtDirLine As Vector3d
|
||||||
EgtStartPoint(nIdSelected, GDB_ID.ROOT, ptStart)
|
EgtMidVector(nIdSelected, GDB_ID.ROOT, vtDirLine)
|
||||||
Dim ptEnd As Point3d
|
|
||||||
EgtEndPoint(nIdSelected, GDB_ID.ROOT, ptEnd)
|
' calcolo il versore della linea di taglio
|
||||||
Dim vtDirLine As Vector3d = ptEnd - ptStart
|
|
||||||
' calcolo il versore perpendicolare alla linea di taglio (diretto verso l'interno del pezzo)
|
|
||||||
Dim vtDirT As Vector3d = vtDirLine
|
Dim vtDirT As Vector3d = vtDirLine
|
||||||
vtDirT.Normalize()
|
vtDirT.Normalize()
|
||||||
|
' 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)
|
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)
|
' Calcolo punto di posizionamemto (punto medio)
|
||||||
Dim ptMid, m_ptTabOri As Point3d
|
Dim ptMid, m_ptTabOri As Point3d
|
||||||
|
|
||||||
If Not EgtGetTableRef(1, m_ptTabOri) Then Return
|
If Not EgtGetTableRef(1, m_ptTabOri) Then Return
|
||||||
ptMid.x = (ptEnd.x + ptStart.x) / 2
|
' recupero il punto medio della curva
|
||||||
ptMid.y = (ptEnd.y + ptStart.y) / 2
|
EgtMidPoint(nIdSelected, GDB_ID.ROOT, ptMid)
|
||||||
ptMid.z = (ptEnd.z + ptStart.z) / 2 + dDiam / 2
|
ptMid.z = m_ptTabOri.z + CamAuto.GetRawHeight() + dHeight
|
||||||
ptMid -= vtDirT * dThick
|
' Offset dovuto allo spessore Utensile
|
||||||
|
ptMid -= vtOffset * dThick
|
||||||
|
|
||||||
'--------------------------- Imposto la posizione della macchina ----------------------------
|
'--------------------------- Imposto la posizione della macchina ----------------------------
|
||||||
' Recupero la posizione macchina
|
' Recupero la posizione macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
If Not m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2) Then Return
|
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
|
' calcolo la posizione degli assi rotanti C, B
|
||||||
Dim nStat As Integer
|
Dim nStat As Integer
|
||||||
Dim dC1, dB1, dC2, dB2 As Double
|
Dim dC1, dB1, dC2, dB2 As Double
|
||||||
|
If CurrTestTool.ToolIsSaw Then
|
||||||
|
' Se LAMA
|
||||||
EgtGetCalcAngles(vtDirT, Vector3d.Z_AX(), nStat, dC1, dB1, dC2, dB2)
|
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
|
' calcolo la posizione degli assi lineari X, Y, Z
|
||||||
Dim dX, dY, dZ As Double
|
Dim dX, dY, dZ As Double
|
||||||
EgtGetCalcPositions(ptMid, dC1, dB1, nStat, dX, dY, dZ)
|
EgtGetCalcPositions(ptMid, dC1, dB1, nStat, dX, dY, dZ)
|
||||||
@@ -346,16 +432,49 @@ Public Class ProjectMgrUC
|
|||||||
' verifica assi lineari
|
' verifica assi lineari
|
||||||
EgtVerifyOutstroke(dX, dY, dZ, dC1, dB1, nStat)
|
EgtVerifyOutstroke(dX, dY, dZ, dC1, dB1, nStat)
|
||||||
If nStat <> 0 Then
|
If nStat <> 0 Then
|
||||||
|
EgtOutLog("Out of stroke: " & nStat)
|
||||||
vtDirT = -vtDirT
|
vtDirT = -vtDirT
|
||||||
ptMid -= vtDirT * dThick
|
ptMid -= vtDirT * dThick
|
||||||
|
If CurrTestTool.ToolIsSaw Then
|
||||||
EgtGetCalcAngles(vtDirT, Vector3d.Z_AX(), nStat, dC1, dB1, dC2, dB2)
|
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)
|
' 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)
|
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
|
End If
|
||||||
|
|
||||||
'--------------------------- Comunico i movimenti in origine macchina al CN ----------------------------------------
|
'--------------------------- Comunico i movimenti in origine macchina al CN ----------------------------------------
|
||||||
Dim ptMachine As Point3d = New Point3d(dX, dY, dZ)
|
Dim ptMachine As Point3d = New Point3d(dX, dY, If(CurrTestTool.ToolIsLaser, 0, dZ))
|
||||||
ExecuteCommandCNC(ptMachine, dC1, dB1)
|
ExecuteCommandCNC(ptMachine, dC1, dB1, CurrTestTool)
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' ---------------------------- Fine modalità test --------------------------------------------
|
' ---------------------------- Fine modalità test --------------------------------------------
|
||||||
@@ -478,7 +597,6 @@ Public Class ProjectMgrUC
|
|||||||
If Not (m_CurrMachine.bProdLine Or m_CurrMachine.bDemo) Then
|
If Not (m_CurrMachine.bProdLine Or m_CurrMachine.bDemo) Then
|
||||||
' Download programma (eventuali errori sono segnalati dalla funzione)
|
' Download programma (eventuali errori sono segnalati dalla funzione)
|
||||||
If m_CurrNcComm.SendProgram(sCncPath, 900) Then
|
If m_CurrNcComm.SendProgram(sCncPath, 900) Then
|
||||||
' copio il progetto corrente come progetto in lavorazione
|
|
||||||
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
Dim sWrkPath As String = m_MainWindow.GetTempDir() & "\" & "WorkProj.nge"
|
||||||
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
My.Computer.FileSystem.CopyFile(sMchPath, sWrkPath, True)
|
||||||
' se abilitato e non è restart, lancio eventuale lua post-trasmissione
|
' se abilitato e non è restart, lancio eventuale lua post-trasmissione
|
||||||
@@ -504,7 +622,6 @@ Public Class ProjectMgrUC
|
|||||||
' apro la finestra con l'elenco degli sfridi
|
' apro la finestra con l'elenco degli sfridi
|
||||||
Dim MyScrapsWD As New ScrapsWD(m_MainWindow, Me, NewScrapsList)
|
Dim MyScrapsWD As New ScrapsWD(m_MainWindow, Me, NewScrapsList)
|
||||||
MyScrapsWD.ShowDialog()
|
MyScrapsWD.ShowDialog()
|
||||||
|
|
||||||
End If
|
End If
|
||||||
' ------------------ FINE gestione SCRAPS -----------------------------
|
' ------------------ FINE gestione SCRAPS -----------------------------
|
||||||
|
|
||||||
@@ -574,6 +691,13 @@ Public Class ProjectMgrUC
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
' Dichiaro che il progetto è nuovo
|
' Dichiaro che il progetto è nuovo
|
||||||
bAlreadySent = False
|
bAlreadySent = False
|
||||||
|
' reimposto tutti gli sfridi come nuovi sfridi
|
||||||
|
Dim CurrScrapsList As New List(Of Scrap)
|
||||||
|
' procedo all'aggiornamento della lista degli sfridi
|
||||||
|
UpDateScrapList(CurrScrapsList)
|
||||||
|
For Each ItemScrap As Scrap In CurrScrapsList
|
||||||
|
ItemScrap.ResetState()
|
||||||
|
Next
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
If bAlreadySent Then
|
If bAlreadySent Then
|
||||||
@@ -584,6 +708,18 @@ Public Class ProjectMgrUC
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' ------------------ INIZIO gestione SCRAPS ---------------------------
|
||||||
|
Dim NewScrapsList As New List(Of Scrap)
|
||||||
|
' procedo all'aggiornamento della lista degli sfridi
|
||||||
|
UpDateScrapList(NewScrapsList)
|
||||||
|
' se esiste almeno uno sfrido da inserire come nuovo grezzo
|
||||||
|
If NewScrapsList.Count > 0 Then
|
||||||
|
' apro la finestra con l'elenco degli sfridi
|
||||||
|
Dim MyScrapsWD As New ScrapsWD(m_MainWindow, Me, NewScrapsList)
|
||||||
|
MyScrapsWD.ShowDialog()
|
||||||
|
End If
|
||||||
|
' ------------------ FINE gestione SCRAPS -----------------------------
|
||||||
|
|
||||||
' Se non collegato alla macchina
|
' Se non collegato alla macchina
|
||||||
If Not m_MainWindow.m_bNCLink Then
|
If Not m_MainWindow.m_bNCLink Then
|
||||||
' salvo il progetto corrente incrementando il valore del progetto
|
' salvo il progetto corrente incrementando il valore del progetto
|
||||||
@@ -623,6 +759,12 @@ Public Class ProjectMgrUC
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
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)
|
' Leggo eventuale variabile per lavorazione con 2 tavole in parallelo (standard E80027)
|
||||||
Dim nVarProgTwins As Integer = 1
|
Dim nVarProgTwins As Integer = 1
|
||||||
If Not String.IsNullOrWhiteSpace(m_CurrMachine.sVarProgTwins) Then
|
If Not String.IsNullOrWhiteSpace(m_CurrMachine.sVarProgTwins) Then
|
||||||
@@ -636,8 +778,26 @@ Public Class ProjectMgrUC
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Verifico se posso scrivere nell'area 1
|
' 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)
|
m_CurrNcComm.SetProgramMainOrSub(False)
|
||||||
If m_CurrNcComm.SendProgram(sCncPath, m_CurrMachine.nProg1, False) Then
|
If m_CurrNcComm.SendProgram(sCncPath, m_CurrMachine.nProg1, False) Then
|
||||||
' Dichiaro part program inviato
|
' Dichiaro part program inviato
|
||||||
@@ -654,7 +814,7 @@ Public Class ProjectMgrUC
|
|||||||
End If
|
End If
|
||||||
m_CurrNcComm.SetProgramMainOrSub(True)
|
m_CurrNcComm.SetProgramMainOrSub(True)
|
||||||
' Altrimenti verifico se posso scrivere nell'area 2
|
' 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)
|
m_CurrNcComm.SetProgramMainOrSub(False)
|
||||||
If m_CurrNcComm.SendProgram(sCncPath, m_CurrMachine.nProg2, False) Then
|
If m_CurrNcComm.SendProgram(sCncPath, m_CurrMachine.nProg2, False) Then
|
||||||
' Dichiaro part program inviato
|
' Dichiaro part program inviato
|
||||||
@@ -674,6 +834,12 @@ Public Class ProjectMgrUC
|
|||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90318)) 'La macchina non accetta il programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90318)) 'La macchina non accetta il programma CN
|
||||||
End If
|
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
|
||||||
#End If
|
#End If
|
||||||
@@ -705,8 +871,114 @@ Public Class ProjectMgrUC
|
|||||||
End While
|
End While
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Sub UpdateFeedAllMachining()
|
||||||
|
' recupero il valore di Feed della lavorazione corrente
|
||||||
|
Dim sMachiningName As String = String.Empty
|
||||||
|
If Not EgtMdbGetCurrMachiningParam(MCH_MP.NAME, sMachiningName) Then
|
||||||
|
' errore: lavorazione non trovata
|
||||||
|
EgtOutLog(" - Prima di 'Reset Feed' accedere alla pagina MACCHINA!")
|
||||||
|
'm_MainWindow.m_CurrentProjectPageUC.SetErrorMessage("Salvare la lavorazione corrente")
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
Dim dFeed As Double = 0
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.FEED, dFeed)
|
||||||
|
Dim dFeedStarted As Double = 0
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
|
||||||
|
Dim dFeedEnded As Double = 0
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
|
||||||
|
Dim dFeedTipped As Double = 0
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
|
||||||
|
Dim dFeedBack As Double = 0
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.BACKFEED, dFeedBack)
|
||||||
|
Dim dFeedSideAng As Double = 0
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
|
||||||
|
Dim MachiningList As New List(Of SplitMach)
|
||||||
|
|
||||||
|
' Recupero l'indice della fase corrente
|
||||||
|
Dim nCurrPhase As Integer = 1
|
||||||
|
' recupero in numero di fasi presenti nel progetto
|
||||||
|
Dim nCountPhase As Integer = EgtGetPhaseCount()
|
||||||
|
' ciclo su tutte le fasi di lavorazione
|
||||||
|
Dim nMach As Integer = 0
|
||||||
|
Dim nMachUpdated As Integer = 0
|
||||||
|
For IndexPhase As Integer = 1 To nCountPhase
|
||||||
|
' imposto la fase corrente
|
||||||
|
nCurrPhase = IndexPhase
|
||||||
|
' Preparo la lista delle lavorazioni
|
||||||
|
CalculateSplitMachList(nCurrPhase, MachiningList)
|
||||||
|
' per ogni lavorazione corrente procedo ad aggiornare la feed
|
||||||
|
For IndexMachining As Integer = 0 To MachiningList.Count - 1
|
||||||
|
nMach += 1
|
||||||
|
Dim nOperId As Integer = MachiningList(IndexMachining).m_nId
|
||||||
|
' setto la lavorazione come corrente
|
||||||
|
If EgtSetCurrMachining(nOperId) Then
|
||||||
|
Dim bUpdate As Boolean = False
|
||||||
|
' STANDARD
|
||||||
|
Dim dOrigFeed As Double
|
||||||
|
EgtGetMachiningParam(MCH_MP.FEED, dOrigFeed)
|
||||||
|
' imposto il valore di Feed solo se differente da quello nuovo
|
||||||
|
If Math.Abs(dOrigFeed - dFeed) > 0.1 Then
|
||||||
|
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.FEED, dFeed)
|
||||||
|
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
|
||||||
|
EgtApplyMachining(True)
|
||||||
|
End If
|
||||||
|
' STARTED
|
||||||
|
Dim dOrigFeedStarted As Double
|
||||||
|
EgtGetMachiningParam(MCH_MP.STARTFEED, dOrigFeedStarted)
|
||||||
|
' imposto il valore di Feed solo se differente da quello nuovo
|
||||||
|
If Math.Abs(dOrigFeedStarted - dFeedStarted) > 0.1 Then
|
||||||
|
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.STARTFEED, dFeedStarted)
|
||||||
|
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
|
||||||
|
EgtApplyMachining(True)
|
||||||
|
End If
|
||||||
|
' ENDED
|
||||||
|
Dim dOrigFeedEnded As Double
|
||||||
|
EgtGetMachiningParam(MCH_MP.ENDFEED, dOrigFeedEnded)
|
||||||
|
' imposto il valore di Feed solo se differente da quello nuovo
|
||||||
|
If Math.Abs(dOrigFeedEnded - dFeedEnded) > 0.1 Then
|
||||||
|
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.ENDFEED, dFeedEnded)
|
||||||
|
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
|
||||||
|
EgtApplyMachining(True)
|
||||||
|
End If
|
||||||
|
' TIPPED
|
||||||
|
Dim dOrigFeedTipped As Double
|
||||||
|
EgtGetMachiningParam(MCH_MP.TIPFEED, dOrigFeedTipped)
|
||||||
|
' imposto il valore di Feed solo se differente da quello nuovo
|
||||||
|
If Math.Abs(dOrigFeedTipped - dFeedTipped) > 0.1 Then
|
||||||
|
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.TIPFEED, dFeedTipped)
|
||||||
|
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
|
||||||
|
EgtApplyMachining(True)
|
||||||
|
End If
|
||||||
|
' BACK
|
||||||
|
Dim dOrigFeedBack As Double
|
||||||
|
EgtGetMachiningParam(MCH_MP.BACKFEED, dOrigFeedBack)
|
||||||
|
' imposto il valore di Feed solo se differente da quello nuovo
|
||||||
|
If Math.Abs(dOrigFeedBack - dFeedBack) > 0.1 Then
|
||||||
|
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.BACKFEED, dFeedBack)
|
||||||
|
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
|
||||||
|
EgtApplyMachining(True)
|
||||||
|
End If
|
||||||
|
' SIDEANG
|
||||||
|
Dim dOrigFeedSideAng As Double
|
||||||
|
EgtMdbGetCurrMachiningParam(MCH_MP.SIDEANGFEED, dOrigFeedSideAng)
|
||||||
|
' imposto il valore di Feed solo se differente da quello nuovo
|
||||||
|
If Math.Abs(dOrigFeedBack - dFeedSideAng) > 0.1 Then
|
||||||
|
bUpdate = bUpdate Or EgtSetMachiningParam(MCH_MP.SIDEANGFEED, dFeedSideAng)
|
||||||
|
' aggiorno la lavorazione (senza il ricalcolo dell'intera lavorazione)
|
||||||
|
EgtApplyMachining(True)
|
||||||
|
End If
|
||||||
|
' conto il numero di lavorazioni aggiornate
|
||||||
|
If bUpdate Then
|
||||||
|
nMachUpdated += 1
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
m_MainWindow.m_CurrentProjectPageUC.SetInfoMessage("Lavorazione aggiornate: " & nMachUpdated & "/ " & nMach)
|
||||||
|
End Sub
|
||||||
|
|
||||||
' ------------------------------------------------ GENERA COMANDI CNC MOVIMENTO ------------------------------------------------
|
' ------------------------------------------------ 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
|
Dim CmdString As String = String.Empty
|
||||||
If Not EgtLuaExecFile(m_MainWindow.m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
|
If Not EgtLuaExecFile(m_MainWindow.m_CurrentMachine.sMachDir() & "\DirectCmd\TestWork.lua") Then
|
||||||
@@ -732,12 +1004,23 @@ Public Class ProjectMgrUC
|
|||||||
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
EgtLuaSetGlobNumVar("CMD.R1", dR1)
|
||||||
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
EgtLuaSetGlobNumVar("CMD.R2", dR2)
|
||||||
|
|
||||||
' Recupero spessore lama corrente
|
'' Recupero spessore lama corrente
|
||||||
Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
'Dim sSaw As String = m_MainWindow.m_CurrentMachine.sCurrSaw
|
||||||
EgtTdbSetCurrTool(sSaw)
|
'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
|
Dim dThick As Double = 0
|
||||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||||
EgtLuaSetGlobNumVar("CMD.SAWTH", 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 POSIZIONE DI ARRIVO MACCHINA -----------
|
||||||
' Assegno valore ad ogni asse da muovere (in zero macchina)
|
' Assegno valore ad ogni asse da muovere (in zero macchina)
|
||||||
@@ -796,6 +1079,7 @@ Public Class ProjectMgrUC
|
|||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.m_bSelectCurv = False
|
m_MainWindow.m_CadCutPageUC.m_NestPage.m_bSelectCurv = False
|
||||||
EgtDeselectObj(m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv)
|
EgtDeselectObj(m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedCurv)
|
||||||
EgtResetMark(m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedSawCurv)
|
EgtResetMark(m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrSelectedSawCurv)
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.m_CurrToolFromSelectedSawCurv = String.Empty
|
||||||
End If
|
End If
|
||||||
' aggiorno il disegno
|
' aggiorno il disegno
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -845,6 +1129,7 @@ Public Class ProjectMgrUC
|
|||||||
ResetCutBtn.Visibility = Windows.Visibility.Hidden
|
ResetCutBtn.Visibility = Windows.Visibility.Hidden
|
||||||
SimulateBtn.Visibility = Windows.Visibility.Hidden
|
SimulateBtn.Visibility = Windows.Visibility.Hidden
|
||||||
WorkBtn.Visibility = Windows.Visibility.Hidden
|
WorkBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If TestBtn.Visibility = Windows.Visibility.Visible Then TestBtn.Visibility = Windows.Visibility.Hidden
|
||||||
' Nascondo bottoni CadCutPageUC
|
' Nascondo bottoni CadCutPageUC
|
||||||
m_MainWindow.m_CadCutPageUC.PhotoBtn.Visibility = Windows.Visibility.Hidden
|
m_MainWindow.m_CadCutPageUC.PhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_MainWindow.m_CadCutPageUC.RawPartBtn.Visibility = Windows.Visibility.Hidden
|
m_MainWindow.m_CadCutPageUC.RawPartBtn.Visibility = Windows.Visibility.Hidden
|
||||||
@@ -860,6 +1145,19 @@ Public Class ProjectMgrUC
|
|||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Hidden
|
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Hidden
|
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Hidden
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Hidden
|
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
' nuovi bottoni pagina di Nesting
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRettanleBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Visible Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
End If
|
||||||
|
' Nascondo bottoni rawpage
|
||||||
|
m_MainWindow.m_RawPartPage.OtherRefTabBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
' Deseleziono tutto
|
' Deseleziono tutto
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
' Se c'è la foto devo sistemare
|
' Se c'è la foto devo sistemare
|
||||||
@@ -891,8 +1189,15 @@ Public Class ProjectMgrUC
|
|||||||
End If
|
End If
|
||||||
' Visualizzo step adatti alla scelta fatta
|
' Visualizzo step adatti alla scelta fatta
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
|
||||||
|
|
||||||
' Cancello eventuali messaggi di errore/avvertimento
|
' Cancello eventuali messaggi di errore/avvertimento
|
||||||
m_CurrProjPage.ClearMessage()
|
m_CurrProjPage.ClearMessage()
|
||||||
|
|
||||||
|
' visualizzo i punti di SpotReg
|
||||||
|
EgtSetStatus(m_MainWindow.m_CadCutPageUC.m_NestPage.m_nRegGroupId, GDB_ST.ON_)
|
||||||
|
' eventualmente risistemo tutti i punti Spotreg in funzione dell'altezza del grezzo
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateSpotRegistration()
|
||||||
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub RegisterBtn_Unchecked(sender As Object, e As RoutedEventArgs) Handles RegisterBtn.Unchecked
|
Private Sub RegisterBtn_Unchecked(sender As Object, e As RoutedEventArgs) Handles RegisterBtn.Unchecked
|
||||||
@@ -920,6 +1225,7 @@ Public Class ProjectMgrUC
|
|||||||
m_MainWindow.m_CadCutPageUC.DrawBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.DrawBtn.Visibility = Windows.Visibility.Visible
|
||||||
m_MainWindow.m_CadCutPageUC.ImportBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.ImportBtn.Visibility = Windows.Visibility.Visible
|
||||||
m_MainWindow.m_CadCutPageUC.SplitBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.SplitBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
If TestBtn.Visibility = Windows.Visibility.Hidden Then TestBtn.Visibility = Windows.Visibility.Visible
|
||||||
' Visualizzo bottoni nesting
|
' Visualizzo bottoni nesting
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.m_bRegister = False
|
m_MainWindow.m_CadCutPageUC.m_NestPage.m_bRegister = False
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.MaximizeMoveBtn.IsEnabled = True
|
m_MainWindow.m_CadCutPageUC.m_NestPage.MaximizeMoveBtn.IsEnabled = True
|
||||||
@@ -929,6 +1235,22 @@ Public Class ProjectMgrUC
|
|||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.m_NestPage.RemovePartBtn.Visibility = Windows.Visibility.Visible
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.m_NestPage.SelectAllBtn.Visibility = Windows.Visibility.Visible
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Visible
|
m_MainWindow.m_CadCutPageUC.m_NestPage.DeselectAllBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
' nuovi bottoni pagina di Nesting
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.DragRettanleBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
If m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Hidden Then
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
End If
|
||||||
|
' disabilito i comandi per gestioen SpotReg
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.PointRegCheckedOff()
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Hidden
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UG1_Reg.Visibility = Visibility.Hidden
|
||||||
|
|
||||||
|
' Nascondo bottoni rawpage
|
||||||
|
m_MainWindow.m_RawPartPage.OtherRefTabBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
|
||||||
|
' Nascondo i bottoni per la definizione degli Spotreg
|
||||||
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UG0_Reg.Visibility = Visibility.Hidden
|
||||||
|
|
||||||
' Se c'è la foto devo sistemare
|
' Se c'è la foto devo sistemare
|
||||||
If m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then
|
If m_CurrProjPage.GetPhoto() <> GDB_ID.NULL Then
|
||||||
' Recupero il riferimento originale del primo grezzo
|
' Recupero il riferimento originale del primo grezzo
|
||||||
@@ -973,6 +1295,11 @@ Public Class ProjectMgrUC
|
|||||||
End If
|
End If
|
||||||
' Visualizzo step adatti alla scelta fatta
|
' Visualizzo step adatti alla scelta fatta
|
||||||
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
|
m_MainWindow.m_CadCutPageUC.m_NestPage.UpdateStepsOnUI()
|
||||||
|
|
||||||
|
' nascondi i punti di SpotReg
|
||||||
|
EgtSetStatus(m_MainWindow.m_CadCutPageUC.m_NestPage.m_nRegGroupId, GDB_ST.OFF)
|
||||||
|
EgtDraw()
|
||||||
|
|
||||||
' Cancello eventuali messaggi di errore/avvertimento
|
' Cancello eventuali messaggi di errore/avvertimento
|
||||||
m_CurrProjPage.ClearMessage()
|
m_CurrProjPage.ClearMessage()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -984,6 +1311,7 @@ Public Class Scrap
|
|||||||
Private m_iPictureID As Integer
|
Private m_iPictureID As Integer
|
||||||
Private m_sName As String
|
Private m_sName As String
|
||||||
Private m_IdRaw As Integer
|
Private m_IdRaw As Integer
|
||||||
|
' nState=1 -> da inserire in DB, nState=2 -> già inserito in DB
|
||||||
Private m_nState As Integer
|
Private m_nState As Integer
|
||||||
|
|
||||||
Public Property PictureID() As Integer
|
Public Property PictureID() As Integer
|
||||||
@@ -1016,9 +1344,16 @@ Public Class Scrap
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public ReadOnly Property PictureString() As String
|
Public Sub ResetState(Optional nNewState As Integer = 1)
|
||||||
|
m_nState = nNewState
|
||||||
|
EgtSetInfo(m_IdRaw, K_ISNEWSCRAPS, nNewState)
|
||||||
|
EgtRemoveInfo(m_IdRaw, K_DATABASEID)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public ReadOnly Property PreviewState As System.Windows.Media.Imaging.BitmapImage
|
||||||
Get
|
Get
|
||||||
Return "/Resources/ImportPageListBoxImages/" + PictureID.ToString() + ".png"
|
Dim sPath As String = "/Resources/ImportPageListBoxImages/" & PictureID.ToString() & ".png"
|
||||||
|
Return New System.Windows.Media.Imaging.BitmapImage(New Uri(sPath, UriKind.Relative))
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,24 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Label Name="TitleTxBl" Grid.Column="1" Grid.Row="1" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
|
<Label Name="TitleTxBl" Grid.Column="1" Grid.Row="1" Foreground="White" FontSize="20" VerticalAlignment="Center"/>
|
||||||
<ListBox Name="ScrapsListBox" Grid.Column="1" Grid.Row="2" ItemTemplate="{DynamicResource DataTemplateItem}"
|
<ListBox Name="ScrapsListBox" Grid.Column="1" Grid.Row="2">
|
||||||
ItemsSource="{Binding ItemList, NotifyOnSourceUpdated=True}"/>
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid Margin="0,2">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.5*" />
|
||||||
|
<ColumnDefinition Width="1*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="{Binding PreviewState}" VerticalAlignment="Center"
|
||||||
|
MaxWidth="50" MaxHeight="50"
|
||||||
|
Stretch="Uniform" Grid.Column="0" />
|
||||||
|
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"
|
||||||
|
Grid.Column="1"/>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
|
||||||
<Grid Grid.Column="1" Grid.Row="4">
|
<Grid Grid.Column="1" Grid.Row="4">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
|
|||||||
@@ -96,16 +96,22 @@ Public Class StartLauncherWD
|
|||||||
Dim ItemFile As String = String.Empty
|
Dim ItemFile As String = String.Empty
|
||||||
'carico la liste dei file recenti
|
'carico la liste dei file recenti
|
||||||
Dim sFileName As String = String.Empty
|
Dim sFileName As String = String.Empty
|
||||||
|
Dim MruFileListRemove As New List(Of String)
|
||||||
For Each ItemFile In m_MainWindow.m_CurrentProjectPageUC.m_MruFiles.FileNames
|
For Each ItemFile In m_MainWindow.m_CurrentProjectPageUC.m_MruFiles.FileNames
|
||||||
sFileName = ItemFile.Replace("__", "_")
|
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)))
|
||||||
m_RecentFileList.Add(New FileNameLsBxItem(sFileName, File.GetLastAccessTime(sFileName)))
|
m_RecentFileList.Add(New FileNameLsBxItem(sFileName, File.GetLastAccessTime(sFileName)))
|
||||||
Else
|
Else
|
||||||
m_MainWindow.m_CurrentProjectPageUC.m_MruFiles.Remove(ItemFile)
|
MruFileListRemove.Add(ItemFile)
|
||||||
End If
|
End If
|
||||||
Next
|
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
|
' posiziono la fistra in centro alla pagina
|
||||||
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
|
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
|
||||||
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||||
|
|||||||
@@ -205,6 +205,12 @@ Public Class Camera
|
|||||||
Dim nInd As Integer = 1
|
Dim nInd As Integer = 1
|
||||||
If m_nCameraCount = 2 Then
|
If m_nCameraCount = 2 Then
|
||||||
nInd = GetCurrentTable()
|
nInd = GetCurrentTable()
|
||||||
|
' verifico se la macchina è configurata per fotocamera sulla tavola di lavoro
|
||||||
|
If (GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ENABLE, 0, m_MainWindow.GetMachIniFile()) <> 0) AndAlso
|
||||||
|
(GetPrivateProfileInt(S_CAMERAHQ, K_CAMERAHQ_ACTIVATE, 0, m_MainWindow.GetMachIniFile()) <> 0) Then
|
||||||
|
' forzo l'utilizzo della seconda camera (sopra alla tavola di lavoro)
|
||||||
|
nInd = 2
|
||||||
|
End If
|
||||||
If nInd <> 1 And nInd <> 2 Then Return 0
|
If nInd <> 1 And nInd <> 2 Then Return 0
|
||||||
End If
|
End If
|
||||||
' Se gestore macchina non attivo, lo lancio in modo cieco
|
' Se gestore macchina non attivo, lo lancio in modo cieco
|
||||||
@@ -315,6 +321,16 @@ Public Class Camera
|
|||||||
GetPrivateProfileString(S_NCDATA, K_SPOTLIGHT2, "", sPLCVarSpotLight2, m_MainWindow.GetMachIniFile())
|
GetPrivateProfileString(S_NCDATA, K_SPOTLIGHT2, "", sPLCVarSpotLight2, m_MainWindow.GetMachIniFile())
|
||||||
Dim nPhotoDeley As Integer = GetPrivateProfileInt(S_NCNUM, K_PHOTODELEY, "100", m_MainWindow.GetMachIniFile())
|
Dim nPhotoDeley As Integer = GetPrivateProfileInt(S_NCNUM, K_PHOTODELEY, "100", m_MainWindow.GetMachIniFile())
|
||||||
|
|
||||||
|
' eventualmente rimuovo inizio stringa: "PLC, ___"
|
||||||
|
Dim sItemString1() As String = Split(sPLCVarSpotLight1, ","c)
|
||||||
|
If sItemString1.Count > 1 Then
|
||||||
|
sPLCVarSpotLight1 = sItemString1(1).Trim
|
||||||
|
End If
|
||||||
|
Dim sItemString2() As String = Split(sPLCVarSpotLight2, ","c)
|
||||||
|
If sItemString2.Count > 1 Then
|
||||||
|
sPLCVarSpotLight2 = sItemString2(1).Trim
|
||||||
|
End If
|
||||||
|
|
||||||
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||||
Case 1, 2
|
Case 1, 2
|
||||||
If m_MainWindow.m_CNCommunication.m_nNCType = 2 Then
|
If m_MainWindow.m_CNCommunication.m_nNCType = 2 Then
|
||||||
|
|||||||
@@ -175,6 +175,9 @@ Public Class ChooseMachining
|
|||||||
|
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
|
If m_CurrentMachine.bWaterJet And EgtGetHeadId("H1") = GDB_ID.NULL Then
|
||||||
|
|
||||||
|
Else
|
||||||
' verifico che lista delle lavorazioni di lama non sia vuoto
|
' verifico che lista delle lavorazioni di lama non sia vuoto
|
||||||
If m_SawingList.Count > 0 Then
|
If m_SawingList.Count > 0 Then
|
||||||
' provo ad assegnare la lama corrente (se l'associazione fallisce corrispoende ad impostare un campo vuoto)
|
' provo ad assegnare la lama corrente (se l'associazione fallisce corrispoende ad impostare un campo vuoto)
|
||||||
@@ -190,6 +193,7 @@ Public Class ChooseMachining
|
|||||||
End If
|
End If
|
||||||
m_MainWindow.m_CurrentMachine.sCurrSawing = String.Empty
|
m_MainWindow.m_CurrentMachine.sCurrSawing = String.Empty
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
' definizione della lista delle lavorazioni secondarie -- DA RIMUOVERE COMPLETAMENTE --
|
' definizione della lista delle lavorazioni secondarie -- DA RIMUOVERE COMPLETAMENTE --
|
||||||
If m_bNotShowAuxilaryCmBx Then
|
If m_bNotShowAuxilaryCmBx Then
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
<Window x:Class="OtherRefTabWD"
|
||||||
|
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}"
|
||||||
|
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
|
||||||
|
Title="ModifStartEndWD" Height="250" Width="320" ShowInTaskbar="False">
|
||||||
|
|
||||||
|
<!--Definizione della pagina di scelta del nome con cui salvare il progetto-->
|
||||||
|
<Border Style="{DynamicResource OmagCut_Border}">
|
||||||
|
<Grid x:Name="SaveNameGrid">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="0.2*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
|
<ColumnDefinition Width="0.2*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<!--<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="0.5*"/>-->
|
||||||
|
<RowDefinition Height="0.2*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="0.2*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="0.2*"/>
|
||||||
|
<RowDefinition Height="1*"/>
|
||||||
|
<RowDefinition Height="0.2*"/>
|
||||||
|
<RowDefinition Height="1.5*"/>
|
||||||
|
<RowDefinition Height="0.2*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<TextBlock Name="RefRawTxbl" Grid.Column="1" Grid.Row="1"
|
||||||
|
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
|
||||||
|
<ComboBox Name="RefTabModeCmBx" Grid.Column="2" Grid.Row="1" Style="{StaticResource OmagCut_ComboBox}"
|
||||||
|
MaxDropDownHeight="300" Margin="0,0,0,0">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
|
||||||
|
<TextBlock Name="RefTabXTxbl" Grid.Column="1" Grid.Row="3"
|
||||||
|
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="RefTabXTxBx" Grid.Column="2" Grid.Row="3"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
|
<TextBlock Name="RefTabYTxbl" Grid.Column="1" Grid.Row="5"
|
||||||
|
Style="{DynamicResource OmagCut_CenteredLowerCaseCharacterTextBlock}"/>
|
||||||
|
<EgtWPFLib:EgtTextBox Name="RefTabYTxBx" Grid.Column="2" Grid.Row="5"
|
||||||
|
Style="{DynamicResource OmagCut_CalculatorTextBox}"/>
|
||||||
|
|
||||||
|
<Grid Name="ButtonsGrid" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="7" Grid.RowSpan="1">
|
||||||
|
<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"
|
||||||
|
IsCancel="True"
|
||||||
|
Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||||
|
<Image Source="{DynamicResource XImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Border>
|
||||||
|
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
Imports System.IO
|
||||||
|
Imports EgtUILib
|
||||||
|
Imports EgtWPFLib
|
||||||
|
|
||||||
|
Public Class OtherRefTabWD
|
||||||
|
Dim m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||||
|
Dim m_RawPartPage As RawPartPageUC
|
||||||
|
|
||||||
|
Private m_sPosX As String = "0"
|
||||||
|
Private m_sPosY As String = "0"
|
||||||
|
|
||||||
|
Private m_dPrevOffsetX As Double = 0
|
||||||
|
Private m_dPrevOffsetY As Double = 0
|
||||||
|
|
||||||
|
Private m_SelIndex As Integer = 0
|
||||||
|
|
||||||
|
Sub New(Owner As Window, PosX As String, PosY As String, OffsetX As Double, OffsetY As Double, OtherRefMode As Integer)
|
||||||
|
Me.Owner = Owner
|
||||||
|
' La chiamata è richiesta dalla finestra di progettazione.
|
||||||
|
InitializeComponent()
|
||||||
|
|
||||||
|
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
|
||||||
|
m_sPosX = PosX
|
||||||
|
m_sPosY = PosY
|
||||||
|
m_dPrevOffsetX = OffsetX
|
||||||
|
m_dPrevOffsetY = OffsetY
|
||||||
|
m_SelIndex = OtherRefMode
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OtherRrefTabWD_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
|
' costruisco il riferimento alla pagina Raw
|
||||||
|
m_RawPartPage = m_MainWindow.m_RawPartPage
|
||||||
|
' posiziono la finestra
|
||||||
|
Me.Top = Owner.Top + Owner.Height / 4 - Me.Height / 2
|
||||||
|
Me.Left = Owner.Left + Owner.Width / 6 - Me.Width / 2
|
||||||
|
RefRawTxbl.Text = "Raw reference"
|
||||||
|
RefTabXTxbl.Text = "Position X"
|
||||||
|
RefTabYTxbl.Text = "Position Y"
|
||||||
|
RefTabModeCmBx.ItemsSource = m_RawPartPage.m_OtherRefTabList
|
||||||
|
RefTabModeCmBx.SelectedIndex = m_RawPartPage.m_OtherRefTabPos
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OtherRrefTabWD_Load(sender As Object, e As EventArgs) Handles Me.Loaded
|
||||||
|
RefTabXTxBx.Text = m_sPosX
|
||||||
|
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())
|
||||||
|
m_RawPartPage.RefTabModeChange()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefTabXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles RefTabXTxBx.EgtClosed
|
||||||
|
Dim ptMin, ptMax As Point3d
|
||||||
|
If EgtGetTableArea(1, ptMin, ptMax) Then
|
||||||
|
Dim dX As Double = 0
|
||||||
|
StringToLen(RefTabXTxBx.Text, dX)
|
||||||
|
If Not (dX > 0 And dX < ptMax.x - ptMin.x) Then
|
||||||
|
If dX > 0 Then
|
||||||
|
dX = ptMax.x - ptMin.x
|
||||||
|
Else
|
||||||
|
dX = 0
|
||||||
|
End If
|
||||||
|
RefTabXTxBx.Text = LenToString(dX, 2)
|
||||||
|
' errore, posizione fuori dalla tavola
|
||||||
|
End If
|
||||||
|
m_RawPartPage.m_OtherRefTabX = dX
|
||||||
|
m_RawPartPage.RefTabModeChange()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub RefTabYTxBx_EgtClosed(sender As Object, e As EventArgs) Handles RefTabYTxBx.EgtClosed
|
||||||
|
Dim ptMin, ptMax As Point3d
|
||||||
|
If EgtGetTableArea(1, ptMin, ptMax) Then
|
||||||
|
Dim dY As Double = 0
|
||||||
|
StringToLen(RefTabYTxBx.Text, dY)
|
||||||
|
If Not (dY > 0 And dY < ptMax.y - ptMin.y) Then
|
||||||
|
If dY > 0 Then
|
||||||
|
dY = ptMax.y - ptMin.y
|
||||||
|
Else
|
||||||
|
dY = 0
|
||||||
|
End If
|
||||||
|
RefTabYTxBx.Text = LenToString(dY, 2)
|
||||||
|
' errore, posizione fuori dalla tavola
|
||||||
|
End If
|
||||||
|
m_RawPartPage.m_OtherRefTabY = dY
|
||||||
|
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())
|
||||||
|
Me.Close()
|
||||||
|
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
|
||||||
|
m_RawPartPage.RefTabModeChange()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -136,7 +136,9 @@
|
|||||||
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
||||||
<ToggleButton Name="RemoveBtn" Grid.Column="1"
|
<ToggleButton Name="RemoveBtn" Grid.Column="1"
|
||||||
Style="{DynamicResource OmagCut_YellowToggleButton}"/>
|
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}"/>
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
@@ -157,6 +159,10 @@
|
|||||||
|
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
|
<TextBlock Name="OtherRefTabTxBl" Grid.Row="5" Grid.ColumnSpan="2" Style="{DynamicResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||||
|
<CheckBox Name="OtherRefTabChBx" Grid.Row="5" Grid.Column="1" Style="{StaticResource OmagCut_CheckBox}"
|
||||||
|
HorizontalAlignment="Right" Margin="0,0,6,0"/>
|
||||||
|
|
||||||
<Button Name="ConfirmPhotoBtn" Grid.Row="4" Grid.ColumnSpan="2" Visibility="Hidden"
|
<Button Name="ConfirmPhotoBtn" Grid.Row="4" Grid.ColumnSpan="2" Visibility="Hidden"
|
||||||
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
Style="{DynamicResource OmagCut_YellowTextButton}"/>
|
||||||
|
|
||||||
@@ -169,7 +175,8 @@
|
|||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="6*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
|
<ColumnDefinition Width="5*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
@@ -186,7 +193,11 @@
|
|||||||
<Image Source="{DynamicResource SlabIdImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
<Image Source="{DynamicResource SlabIdImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button Name="OkBtn" Grid.Column="5" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
<Button Name="OtherRefTabBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowIconButton}">
|
||||||
|
<Image Source="{DynamicResource RefTabImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button Name="OkBtn" Grid.Column="6" Style="{DynamicResource OmagCut_GradientBlueIconButton}">
|
||||||
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
<Image Source="{DynamicResource VImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Windows.Media.Animation
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
Imports Microsoft.VisualBasic.Devices
|
||||||
|
|
||||||
Public Class RawPartPageUC
|
Public Class RawPartPageUC
|
||||||
|
|
||||||
@@ -78,6 +81,16 @@ Public Class RawPartPageUC
|
|||||||
' Costante raggio cerchietto
|
' Costante raggio cerchietto
|
||||||
Private Const RAD_CIRCLE As Double = 30
|
Private Const RAD_CIRCLE As Double = 30
|
||||||
|
|
||||||
|
' 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
|
||||||
|
Private m_nOtherRefTabLay As Integer = GDB_ID.NULL
|
||||||
|
Private m_OtherRefTabPoint As Point3d
|
||||||
|
|
||||||
' mostra la pagina delle lavorazioni
|
' mostra la pagina delle lavorazioni
|
||||||
Private m_SmartMachiningPage As Boolean = False
|
Private m_SmartMachiningPage As Boolean = False
|
||||||
|
|
||||||
@@ -105,6 +118,13 @@ Public Class RawPartPageUC
|
|||||||
FROM_SAW = 7
|
FROM_SAW = 7
|
||||||
End Enum
|
End Enum
|
||||||
|
|
||||||
|
Private Enum OTHERREFMODE As Integer
|
||||||
|
BL = 0
|
||||||
|
BR = 1
|
||||||
|
TR = 2
|
||||||
|
TL = 3
|
||||||
|
End Enum
|
||||||
|
|
||||||
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
|
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
'Creazione della Page UserControl e relative impostazioni
|
'Creazione della Page UserControl e relative impostazioni
|
||||||
@@ -145,6 +165,13 @@ Public Class RawPartPageUC
|
|||||||
ReDim Preserve m_RawModeListEx(3)
|
ReDim Preserve m_RawModeListEx(3)
|
||||||
End If
|
End If
|
||||||
RawModeCmBx.ItemsSource = m_RawModeList
|
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"
|
||||||
|
|
||||||
' lista per selezione RawModeDamaged
|
' lista per selezione RawModeDamaged
|
||||||
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
|
m_RawModeDamagedList(0) = EgtMsg(MSG_RAWPARTPAGEUC + 2) 'Per Punti
|
||||||
m_RawModeDamagedList(1) = EgtMsg(MSG_RAWPARTPAGEUC + 30) 'Da Laser
|
m_RawModeDamagedList(1) = EgtMsg(MSG_RAWPARTPAGEUC + 30) 'Da Laser
|
||||||
@@ -183,7 +210,10 @@ Public Class RawPartPageUC
|
|||||||
AddBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 14) 'Add - Aggiungi
|
AddBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 14) 'Add - Aggiungi
|
||||||
RemoveBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 15) 'Remove - Rimuovi
|
RemoveBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 15) 'Remove - Rimuovi
|
||||||
CloseBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 31) 'Close - Chiudi
|
CloseBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 31) 'Close - Chiudi
|
||||||
|
RectangleBtn.Content = "Rectangle"
|
||||||
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
|
ConfirmPhotoBtn.Content = EgtMsg(MSG_RAWPARTPAGEUC + 24) 'Conferma
|
||||||
|
|
||||||
|
OtherRefTabTxBl.Text = "New Ref On Tab"
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
|
Private Sub RawPartPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||||
@@ -277,6 +307,12 @@ Public Class RawPartPageUC
|
|||||||
Utility.SetBlockAndSlabNbr(sBlock, sSlabNbr)
|
Utility.SetBlockAndSlabNbr(sBlock, sSlabNbr)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' Carico le info del riferimento alternativo della tavola
|
||||||
|
m_nOtherRefTabLay = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
|
EgtSetLevel(m_nTempLay, GDB_LV.TEMP)
|
||||||
|
LoadOtherRefTab()
|
||||||
|
|
||||||
' Assegno dati grezzo rettangolare ai textbox
|
' Assegno dati grezzo rettangolare ai textbox
|
||||||
LengthTxBx.Text = LenToString(m_RawLength, 2)
|
LengthTxBx.Text = LenToString(m_RawLength, 2)
|
||||||
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
||||||
@@ -293,6 +329,7 @@ Public Class RawPartPageUC
|
|||||||
RawModeCmBx.SelectedIndex = RAWMODE.BY_POINTS
|
RawModeCmBx.SelectedIndex = RAWMODE.BY_POINTS
|
||||||
PointsGpBx.Visibility = Windows.Visibility.Visible
|
PointsGpBx.Visibility = Windows.Visibility.Visible
|
||||||
CloseBtn.Visibility = Windows.Visibility.Hidden
|
CloseBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
RectangleBtn.Visibility = Windows.Visibility.Hidden
|
||||||
' Visualizzo crocette
|
' Visualizzo crocette
|
||||||
UpdateCircles()
|
UpdateCircles()
|
||||||
EgtZoom(ZM.ALL)
|
EgtZoom(ZM.ALL)
|
||||||
@@ -320,6 +357,38 @@ Public Class RawPartPageUC
|
|||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LoadOtherRefTab()
|
||||||
|
m_bEnableOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_ENABLEOTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||||
|
If Not m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabBtn.Visibility = Visibility.Collapsed
|
||||||
|
OtherRefTabChBx.Visibility = Visibility.Collapsed
|
||||||
|
OtherRefTabTxBl.Visibility = Visibility.Collapsed
|
||||||
|
Return
|
||||||
|
Else
|
||||||
|
OtherRefTabBtn.Visibility = Visibility.Visible
|
||||||
|
End If
|
||||||
|
m_bOtherRefTab = (GetPrivateProfileInt(S_RAWPART, K_OTHERREFTAB, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||||
|
m_OtherRefTabX = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABX, 0, m_MainWindow.GetIniFile())
|
||||||
|
m_OtherRefTabY = GetPrivateProfileDouble(S_RAWPART, K_OTHERREFTABY, 0, m_MainWindow.GetIniFile())
|
||||||
|
m_OtherRefTabPos = GetPrivateProfileInt(S_RAWPART, K_OTHERREFTABPOS, 0, m_MainWindow.GetIniFile())
|
||||||
|
' RefTabPosCmbx.SelectedIndex = m_OtherRefTabPos
|
||||||
|
OtherRefTabChBx.IsChecked = m_bOtherRefTab
|
||||||
|
' se riferimento tavola differente da quello atteso
|
||||||
|
If m_bOtherRefTab Then
|
||||||
|
' dasibilito la modifica dei parametri di Offset
|
||||||
|
OffsetXTxBx.IsEnabled = False
|
||||||
|
OffsetYTxBx.IsEnabled = False
|
||||||
|
UpdateOffsetText()
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
' Acquisisco punto da disegno
|
||||||
|
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15 + m_CurrentMachine.dAdditionalTable)
|
||||||
|
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
|
||||||
|
' EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||||
' Verifico di essere il gestore attivo
|
' Verifico di essere il gestore attivo
|
||||||
If Not m_bActive Then Return
|
If Not m_bActive Then Return
|
||||||
@@ -689,6 +758,8 @@ Public Class RawPartPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||||
|
CloseBtn.IsEnabled = False
|
||||||
|
RectangleBtn.IsEnabled = False
|
||||||
' Non è possibile uscire con tastatura in corso
|
' Non è possibile uscire con tastatura in corso
|
||||||
If m_bProbingOn Then Return
|
If m_bProbingOn Then Return
|
||||||
' reimposto il comando OutLine
|
' reimposto il comando OutLine
|
||||||
@@ -854,6 +925,7 @@ Public Class RawPartPageUC
|
|||||||
RawModeView()
|
RawModeView()
|
||||||
' Disattivo il bottone
|
' Disattivo il bottone
|
||||||
CloseBtn.IsEnabled = False
|
CloseBtn.IsEnabled = False
|
||||||
|
RectangleBtn.IsEnabled = False
|
||||||
OkBtn.IsEnabled = False
|
OkBtn.IsEnabled = False
|
||||||
Case 3 ' Da Lama
|
Case 3 ' Da Lama
|
||||||
If Not m_MainWindow.m_CurrentMachine.bSaw Then ' Da fotografia
|
If Not m_MainWindow.m_CurrentMachine.bSaw Then ' Da fotografia
|
||||||
@@ -886,6 +958,7 @@ Public Class RawPartPageUC
|
|||||||
RawModeView()
|
RawModeView()
|
||||||
' Disattivo il bottone
|
' Disattivo il bottone
|
||||||
CloseBtn.IsEnabled = False
|
CloseBtn.IsEnabled = False
|
||||||
|
RectangleBtn.IsEnabled = False
|
||||||
OkBtn.IsEnabled = False
|
OkBtn.IsEnabled = False
|
||||||
Case 4 ' Da fotografia
|
Case 4 ' Da fotografia
|
||||||
' Se ero in modalità da laser
|
' Se ero in modalità da laser
|
||||||
@@ -930,6 +1003,13 @@ Public Class RawPartPageUC
|
|||||||
' Disattivo bottoni zone rovinate
|
' Disattivo bottoni zone rovinate
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = True
|
||||||
|
OtherRefTabBtn.IsEnabled = True
|
||||||
|
' disegno il riferimento
|
||||||
|
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15 + m_CurrentMachine.dAdditionalTable)
|
||||||
|
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
|
||||||
|
End If
|
||||||
Case RAWMODE.BY_POINTS
|
Case RAWMODE.BY_POINTS
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -943,9 +1023,16 @@ Public Class RawPartPageUC
|
|||||||
AddBtn.SetValue(Grid.RowSpanProperty, 2)
|
AddBtn.SetValue(Grid.RowSpanProperty, 2)
|
||||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 2)
|
RemoveBtn.SetValue(Grid.RowSpanProperty, 2)
|
||||||
CloseBtn.Visibility = Windows.Visibility.Hidden
|
CloseBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
RectangleBtn.Visibility = Windows.Visibility.Hidden
|
||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
' disettivo la possibilità di modificare il riferimento
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.FROM_LASER
|
Case RAWMODE.FROM_LASER
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -959,9 +1046,15 @@ Public Class RawPartPageUC
|
|||||||
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||||
CloseBtn.Visibility = Windows.Visibility.Visible
|
CloseBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
RectangleBtn.Visibility = Windows.Visibility.Visible
|
||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.DAMAGED
|
Case RAWMODE.DAMAGED
|
||||||
RawModeCmBx.IsEnabled = False
|
RawModeCmBx.IsEnabled = False
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
||||||
@@ -976,10 +1069,16 @@ Public Class RawPartPageUC
|
|||||||
AddBtn.SetValue(Grid.RowSpanProperty, 2)
|
AddBtn.SetValue(Grid.RowSpanProperty, 2)
|
||||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 2)
|
RemoveBtn.SetValue(Grid.RowSpanProperty, 2)
|
||||||
CloseBtn.Visibility = Windows.Visibility.Hidden
|
CloseBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
RectangleBtn.Visibility = Windows.Visibility.Hidden
|
||||||
' Attivo bottoni zone rovinate
|
' Attivo bottoni zone rovinate
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Visible
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Visible
|
||||||
' Disattivo bottoni foto
|
' Disattivo bottoni foto
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.FROM_PHOTO
|
Case RAWMODE.FROM_PHOTO
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -992,6 +1091,11 @@ Public Class RawPartPageUC
|
|||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
' Visualizzo bottoni foto
|
' Visualizzo bottoni foto
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Visible
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.DAMAGED_BY_LASER
|
Case RAWMODE.DAMAGED_BY_LASER
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
||||||
@@ -1005,9 +1109,15 @@ Public Class RawPartPageUC
|
|||||||
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||||
CloseBtn.Visibility = Windows.Visibility.Visible
|
CloseBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
RectangleBtn.Visibility = Windows.Visibility.Visible
|
||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.DAMAGED_BY_SAW
|
Case RAWMODE.DAMAGED_BY_SAW
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
RawModeDamagedCmBx.Visibility = Visibility.Visible
|
||||||
@@ -1021,9 +1131,15 @@ Public Class RawPartPageUC
|
|||||||
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||||
CloseBtn.Visibility = Windows.Visibility.Visible
|
CloseBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
RectangleBtn.Visibility = Windows.Visibility.Visible
|
||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
Case RAWMODE.FROM_SAW
|
Case RAWMODE.FROM_SAW
|
||||||
RawModeCmBx.IsEnabled = True
|
RawModeCmBx.IsEnabled = True
|
||||||
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
RawModeDamagedCmBx.Visibility = Visibility.Collapsed
|
||||||
@@ -1037,14 +1153,30 @@ Public Class RawPartPageUC
|
|||||||
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
AddBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||||
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
RemoveBtn.SetValue(Grid.RowSpanProperty, 1)
|
||||||
CloseBtn.Visibility = Windows.Visibility.Visible
|
CloseBtn.Visibility = Windows.Visibility.Visible
|
||||||
|
RectangleBtn.Visibility = Windows.Visibility.Visible
|
||||||
' Disattivo bottoni zone rovinate e foto
|
' Disattivo bottoni zone rovinate e foto
|
||||||
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
DamagedAreaGpBx.Visibility = Windows.Visibility.Hidden
|
||||||
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
ConfirmPhotoBtn.Visibility = Windows.Visibility.Hidden
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabChBx.IsEnabled = False
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
End If
|
||||||
End Select
|
End Select
|
||||||
|
' se abilitato nuovo riferimento del grezzo disabilito le text per offset
|
||||||
|
If OtherRefTabChBx.IsChecked Then
|
||||||
|
OffsetXTxBx.IsEnabled = False
|
||||||
|
OffsetYTxBx.IsEnabled = False
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OutlineBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutlineBtn.Click
|
Private Sub OutlineBtn_Click(sender As Object, e As RoutedEventArgs) Handles OutlineBtn.Click
|
||||||
If m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW Then
|
If m_ActiveRawMode = RAWMODE.DAMAGED Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER Or m_ActiveRawMode = RAWMODE.DAMAGED_BY_SAW Then
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabTxBl.Visibility = Visibility.Visible
|
||||||
|
OtherRefTabBtn.Visibility = Visibility.Visible
|
||||||
|
OtherRefTabChBx.Visibility = Visibility.Visible
|
||||||
|
End If
|
||||||
' m_ActiveRawMode = RAWMODE.BY_POINTS
|
' m_ActiveRawMode = RAWMODE.BY_POINTS
|
||||||
m_ActiveRawMode = m_PrecActiveRawMode
|
m_ActiveRawMode = m_PrecActiveRawMode
|
||||||
RawModeCmBx.SelectedIndex = m_ActiveRawMode
|
RawModeCmBx.SelectedIndex = m_ActiveRawMode
|
||||||
@@ -1055,6 +1187,12 @@ Public Class RawPartPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub DamagedBtn_Click(sender As Object, e As RoutedEventArgs) Handles DamagedBtn.Click
|
Private Sub DamagedBtn_Click(sender As Object, e As RoutedEventArgs) Handles DamagedBtn.Click
|
||||||
|
If m_bEnableOtherRefTab Then
|
||||||
|
OtherRefTabTxBl.Visibility = Visibility.Hidden
|
||||||
|
OtherRefTabBtn.Visibility = Visibility.Hidden
|
||||||
|
OtherRefTabChBx.Visibility = Visibility.Hidden
|
||||||
|
OtherRefTabBtn.IsEnabled = False
|
||||||
|
End If
|
||||||
m_PrecActiveRawMode = m_ActiveRawMode
|
m_PrecActiveRawMode = m_ActiveRawMode
|
||||||
If m_PrecActiveRawMode = RAWMODE.FROM_LASER Then
|
If m_PrecActiveRawMode = RAWMODE.FROM_LASER Then
|
||||||
m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER
|
m_ActiveRawMode = RAWMODE.DAMAGED_BY_LASER
|
||||||
@@ -1072,6 +1210,9 @@ Public Class RawPartPageUC
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub AddBtn_Click(sender As Object, e As RoutedEventArgs) Handles AddBtn.Click
|
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
|
Select Case m_ActiveRawMode
|
||||||
Case RAWMODE.RECTANGLE
|
Case RAWMODE.RECTANGLE
|
||||||
AddBtn.IsChecked = False
|
AddBtn.IsChecked = False
|
||||||
@@ -1120,9 +1261,15 @@ Public Class RawPartPageUC
|
|||||||
m_bptLast = True
|
m_bptLast = True
|
||||||
End If
|
End If
|
||||||
m_ptLast = ptAcquired
|
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
|
If m_CurveXKerfList.Count > 1 Then
|
||||||
OkBtn.IsEnabled = True
|
OkBtn.IsEnabled = True
|
||||||
CloseBtn.IsEnabled = True
|
CloseBtn.IsEnabled = True
|
||||||
|
RectangleBtn.IsEnabled = False
|
||||||
End If
|
End If
|
||||||
AddBtn.IsChecked = False
|
AddBtn.IsChecked = False
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -1168,9 +1315,14 @@ Public Class RawPartPageUC
|
|||||||
m_bptLast = True
|
m_bptLast = True
|
||||||
End If
|
End If
|
||||||
m_ptLast = ptAcquired
|
m_ptLast = ptAcquired
|
||||||
|
If m_CurveXKerfList.Count = 1 Then
|
||||||
|
OkBtn.IsEnabled = True
|
||||||
|
RectangleBtn.IsEnabled = True
|
||||||
|
End If
|
||||||
If m_CurveXKerfList.Count > 1 Then
|
If m_CurveXKerfList.Count > 1 Then
|
||||||
OkBtn.IsEnabled = True
|
OkBtn.IsEnabled = True
|
||||||
CloseBtn.IsEnabled = True
|
CloseBtn.IsEnabled = True
|
||||||
|
RectangleBtn.IsEnabled = False
|
||||||
End If
|
End If
|
||||||
AddBtn.IsChecked = False
|
AddBtn.IsChecked = False
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -1226,9 +1378,14 @@ Public Class RawPartPageUC
|
|||||||
m_bptLast = True
|
m_bptLast = True
|
||||||
End If
|
End If
|
||||||
m_ptLast = ptAcquired
|
m_ptLast = ptAcquired
|
||||||
|
If m_CurveXDamagedAreaList.Count = 1 Then
|
||||||
|
OkBtn.IsEnabled = True
|
||||||
|
RectangleBtn.IsEnabled = True
|
||||||
|
End If
|
||||||
If m_CurveXDamagedAreaList.Count > 1 Then
|
If m_CurveXDamagedAreaList.Count > 1 Then
|
||||||
OkBtn.IsEnabled = True
|
OkBtn.IsEnabled = True
|
||||||
CloseBtn.IsEnabled = True
|
CloseBtn.IsEnabled = True
|
||||||
|
RectangleBtn.IsEnabled = False
|
||||||
End If
|
End If
|
||||||
AddBtn.IsChecked = False
|
AddBtn.IsChecked = False
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -1274,9 +1431,14 @@ Public Class RawPartPageUC
|
|||||||
m_bptLast = True
|
m_bptLast = True
|
||||||
End If
|
End If
|
||||||
m_ptLast = ptAcquired
|
m_ptLast = ptAcquired
|
||||||
|
If m_CurveXDamagedAreaList.Count = 1 Then
|
||||||
|
OkBtn.IsEnabled = True
|
||||||
|
RectangleBtn.IsEnabled = True
|
||||||
|
End If
|
||||||
If m_CurveXDamagedAreaList.Count > 1 Then
|
If m_CurveXDamagedAreaList.Count > 1 Then
|
||||||
OkBtn.IsEnabled = True
|
OkBtn.IsEnabled = True
|
||||||
CloseBtn.IsEnabled = True
|
CloseBtn.IsEnabled = True
|
||||||
|
RectangleBtn.IsEnabled = False
|
||||||
End If
|
End If
|
||||||
AddBtn.IsChecked = False
|
AddBtn.IsChecked = False
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
@@ -1296,7 +1458,7 @@ Public Class RawPartPageUC
|
|||||||
Dim nExit As Integer = 0
|
Dim nExit As Integer = 0
|
||||||
EgtGetCalcTool(sTool, sHead, nExit)
|
EgtGetCalcTool(sTool, sHead, nExit)
|
||||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||||
If Not EgtSetCalcTool("", "H3", 1) Then
|
If Not EgtSetCalcTool("", LASER_HEAD, 1) Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
' Trasformo in posizione punta utensile in basso
|
' Trasformo in posizione punta utensile in basso
|
||||||
@@ -1308,6 +1470,10 @@ Public Class RawPartPageUC
|
|||||||
' Porto il tip nell'origine tavola
|
' Porto il tip nell'origine tavola
|
||||||
ptAcquired = ptTipP1
|
ptAcquired = ptTipP1
|
||||||
ptAcquired.ToLoc(New Frame3d(m_ptTableMin))
|
ptAcquired.ToLoc(New Frame3d(m_ptTableMin))
|
||||||
|
EgtOutLog("Actual axis laser H3: L1=" & dL1.ToString & ", L2=" & dL2.ToString & ", L3=" & dL3.ToString &
|
||||||
|
", R1=" & dR1.ToString & ", R2=" & dR2.ToString)
|
||||||
|
EgtOutLog("Actual pos laser H3: " & ptTipP1.x.ToString & "," & ptTipP1.y.ToString & "," & ptTipP1.z.ToString &
|
||||||
|
"; on table: " & ptAcquired.x.ToString & "," & ptAcquired.y.ToString & "," & ptAcquired.z.ToString)
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -1325,6 +1491,8 @@ Public Class RawPartPageUC
|
|||||||
EgtGetCalcTool(sTool, sHead, nExit)
|
EgtGetCalcTool(sTool, sHead, nExit)
|
||||||
' Trasformo in posizione punta utensile in basso
|
' Trasformo in posizione punta utensile in basso
|
||||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, ptTipP1) Then
|
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, ptTipP1) Then
|
||||||
|
EgtOutLog("Actual pos " & sHead & ": L1=" & dL1.ToString & ", L2=" & dL2.ToString & ", L3=" & dL3.ToString &
|
||||||
|
", R1=" & dR1.ToString & ", R2=" & dR2.ToString)
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
' Porto il tip nell'origine tavola
|
' Porto il tip nell'origine tavola
|
||||||
@@ -1355,6 +1523,17 @@ Public Class RawPartPageUC
|
|||||||
' Aggiorno ptLast
|
' Aggiorno ptLast
|
||||||
EgtEndPoint(m_CurveXKerfList(m_CurveXKerfList.Count - 1), m_ptLast)
|
EgtEndPoint(m_CurveXKerfList(m_CurveXKerfList.Count - 1), m_ptLast)
|
||||||
End If
|
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
|
Else
|
||||||
m_bptLast = False
|
m_bptLast = False
|
||||||
End If
|
End If
|
||||||
@@ -1375,6 +1554,17 @@ Public Class RawPartPageUC
|
|||||||
' Aggiorno ptLast
|
' Aggiorno ptLast
|
||||||
EgtEndPoint(m_CurveXKerfList(m_CurveXKerfList.Count - 1), m_ptLast)
|
EgtEndPoint(m_CurveXKerfList(m_CurveXKerfList.Count - 1), m_ptLast)
|
||||||
End If
|
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
|
Else
|
||||||
m_bptLast = False
|
m_bptLast = False
|
||||||
End If
|
End If
|
||||||
@@ -1405,6 +1595,17 @@ Public Class RawPartPageUC
|
|||||||
' Aggiorno ptLast
|
' Aggiorno ptLast
|
||||||
EgtEndPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
|
EgtEndPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
|
||||||
End If
|
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
|
Else
|
||||||
m_bptLast = False
|
m_bptLast = False
|
||||||
End If
|
End If
|
||||||
@@ -1425,6 +1626,17 @@ Public Class RawPartPageUC
|
|||||||
' Aggiorno ptLast
|
' Aggiorno ptLast
|
||||||
EgtEndPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
|
EgtEndPoint(m_CurveXDamagedAreaList(m_CurveXDamagedAreaList.Count - 1), m_ptLast)
|
||||||
End If
|
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
|
Else
|
||||||
m_bptLast = False
|
m_bptLast = False
|
||||||
End If
|
End If
|
||||||
@@ -1843,6 +2055,7 @@ Public Class RawPartPageUC
|
|||||||
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
WidthTxBx.Text = LenToString(m_RawWidth, 2)
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 17) & " " & LenToString(dMaxWidth, 2)) 'Massima larghezza =
|
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 17) & " " & LenToString(dMaxWidth, 2)) 'Massima larghezza =
|
||||||
End If
|
End If
|
||||||
|
RefTabModeChange()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub HeightTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HeightTxBx.EgtClosed
|
Private Sub HeightTxBx_EgtClosed(sender As Object, e As EventArgs) Handles HeightTxBx.EgtClosed
|
||||||
@@ -1872,6 +2085,7 @@ Public Class RawPartPageUC
|
|||||||
HeightTxBx.Text = LenToString(m_RawHeight, 3)
|
HeightTxBx.Text = LenToString(m_RawHeight, 3)
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 18)) 'Non sono ammessi spessori negativi
|
m_CurrProjPage.SetErrorMessage(EgtMsg(MSG_RAWPARTPAGEUC + 18)) 'Non sono ammessi spessori negativi
|
||||||
End If
|
End If
|
||||||
|
RefTabModeChange()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub OffsetXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsetXTxBx.EgtClosed
|
Private Sub OffsetXTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OffsetXTxBx.EgtClosed
|
||||||
@@ -1918,6 +2132,109 @@ Public Class RawPartPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
#Region "OTHERREFTAB"
|
||||||
|
|
||||||
|
Private Sub OtherRefTabChBx_Click(sender As Object, e As EventArgs) Handles OtherRefTabChBx.Click
|
||||||
|
If OtherRefTabChBx.IsChecked Then
|
||||||
|
m_bOtherRefTab = True
|
||||||
|
MoveRawToOtherRefTab()
|
||||||
|
Else
|
||||||
|
m_bOtherRefTab = False
|
||||||
|
'MoveRawToMaiRefTab()
|
||||||
|
End If
|
||||||
|
UpdateOffsetText()
|
||||||
|
RawModeView()
|
||||||
|
WritePrivateProfileString(S_RAWPART, K_OTHERREFTAB, If(m_bOtherRefTab, "1", "0"), m_MainWindow.GetIniFile())
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub RefTabModeChange()
|
||||||
|
If Not m_bOtherRefTab Then Return
|
||||||
|
MoveRawToMaiRefTab()
|
||||||
|
MoveRawToOtherRefTab()
|
||||||
|
UpdateRefTabDraw()
|
||||||
|
UpdateOffsetText()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub UpdateRefTabDraw()
|
||||||
|
' Rimuovo eventuali crocette create acquisendo i punti nel disegno
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
' Acquisisco punto da disegno
|
||||||
|
m_OtherRefTabPoint = New Point3d(m_ptTableMin.x + m_OtherRefTabX, m_ptTableMin.y + m_OtherRefTabY, m_ptTableMin.z + 0.15)
|
||||||
|
CreateOtherRefTab(m_nOtherRefTabLay, m_OtherRefTabPoint)
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub UpdateOffsetText()
|
||||||
|
Dim ptRawMin, ptRawMax As Point3d
|
||||||
|
Dim dInvertKerf As Double = 1
|
||||||
|
If GetRawBox(ptRawMin, ptRawMax) Then
|
||||||
|
' kerf
|
||||||
|
EgtGetInfo(EgtGetFirstRawPart(), KEY_KERF, m_RawKerf)
|
||||||
|
' verifico se il kerf è negativo
|
||||||
|
EgtGetInfo(EgtGetFirstRawPart(), KEY_INVERT_KERF, dInvertKerf)
|
||||||
|
' aggiorno dati grezzo
|
||||||
|
If dInvertKerf < 0 Then
|
||||||
|
m_RawOffsX = ptRawMin.x - m_ptTableMin.x
|
||||||
|
m_RawOffsY = ptRawMin.y - m_ptTableMin.y
|
||||||
|
Else
|
||||||
|
m_RawOffsX = ptRawMin.x - m_ptTableMin.x + m_RawKerf * dInvertKerf
|
||||||
|
m_RawOffsY = ptRawMin.y - m_ptTableMin.y + m_RawKerf * dInvertKerf
|
||||||
|
End If
|
||||||
|
OffsetXTxBx.Text = LenToString(m_RawOffsX, 2)
|
||||||
|
OffsetYTxBx.Text = LenToString(m_RawOffsY, 2)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub MoveRawToOtherRefTab()
|
||||||
|
Dim dKerf As Double = 0
|
||||||
|
StringToLen(KerfTxBx.Text, dKerf)
|
||||||
|
Select Case m_OtherRefTabPos
|
||||||
|
Case OTHERREFMODE.BL
|
||||||
|
m_RawOffsX = m_OtherRefTabX + If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
m_RawOffsY = m_OtherRefTabY + If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
Case OTHERREFMODE.BR
|
||||||
|
m_RawOffsX = m_OtherRefTabX - m_RawLength - If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
m_RawOffsY = m_OtherRefTabY + If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
Case OTHERREFMODE.TR
|
||||||
|
m_RawOffsX = m_OtherRefTabX - m_RawLength - If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
m_RawOffsY = m_OtherRefTabY - m_RawWidth - If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
Case OTHERREFMODE.TL
|
||||||
|
m_RawOffsX = m_OtherRefTabX + If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
m_RawOffsY = m_OtherRefTabY - m_RawWidth - If((dKerf < 0), -dKerf, dKerf)
|
||||||
|
Case Else
|
||||||
|
End Select
|
||||||
|
UpdateRawPart()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub MoveRawToMaiRefTab()
|
||||||
|
Dim dKerf As Double = 0
|
||||||
|
StringToLen(KerfTxBx.Text, dKerf)
|
||||||
|
Select Case m_OtherRefTabPos
|
||||||
|
Case OTHERREFMODE.BR
|
||||||
|
m_RawOffsX = If((dKerf < 0), 0, dKerf)
|
||||||
|
m_RawOffsY = If((dKerf < 0), 0, dKerf)
|
||||||
|
Case OTHERREFMODE.BL
|
||||||
|
m_RawOffsX = If((dKerf < 0), 0, dKerf)
|
||||||
|
m_RawOffsY = If((dKerf < 0), 0, dKerf)
|
||||||
|
Case OTHERREFMODE.TL
|
||||||
|
m_RawOffsX = If((dKerf < 0), 0, dKerf)
|
||||||
|
m_RawOffsY = If((dKerf < 0), 0, dKerf)
|
||||||
|
Case OTHERREFMODE.TR
|
||||||
|
m_RawOffsX = If((dKerf < 0), 0, dKerf)
|
||||||
|
m_RawOffsY = If((dKerf < 0), 0, dKerf)
|
||||||
|
Case Else
|
||||||
|
End Select
|
||||||
|
UpdateRawPart()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub OtherRefTabBtn_Click(sender As Object, e As EventArgs) Handles OtherRefTabBtn.Click
|
||||||
|
' 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)
|
||||||
|
OthWD.ShowDialog()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' OtherRefTab
|
||||||
|
|
||||||
Private Sub KerfTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KerfTxBx.EgtClosed
|
Private Sub KerfTxBx_EgtClosed(sender As Object, e As EventArgs) Handles KerfTxBx.EgtClosed
|
||||||
Dim dKerf As Double
|
Dim dKerf As Double
|
||||||
If Not StringToLen(KerfTxBx.Text, dKerf) Then
|
If Not StringToLen(KerfTxBx.Text, dKerf) Then
|
||||||
@@ -1960,6 +2277,8 @@ Public Class RawPartPageUC
|
|||||||
Else
|
Else
|
||||||
CreateRawFromPhotoContour()
|
CreateRawFromPhotoContour()
|
||||||
End If
|
End If
|
||||||
|
' Forzo il riposizionamento del grezzo
|
||||||
|
RefTabModeChange()
|
||||||
' Ridisegno
|
' Ridisegno
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
ElseIf dKerf >= dMinKerf And dKerf < 0 Then
|
ElseIf dKerf >= dMinKerf And dKerf < 0 Then
|
||||||
@@ -2022,6 +2341,8 @@ Public Class RawPartPageUC
|
|||||||
Else
|
Else
|
||||||
CreateRawFromPhotoContour()
|
CreateRawFromPhotoContour()
|
||||||
End If
|
End If
|
||||||
|
' Forzo il riposizionamento del grezzo
|
||||||
|
RefTabModeChange()
|
||||||
' Ridisegno
|
' Ridisegno
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
ElseIf dKerf < dMinKerf Then
|
ElseIf dKerf < dMinKerf Then
|
||||||
@@ -2052,6 +2373,18 @@ Public Class RawPartPageUC
|
|||||||
' Recupero origine tavola rispetto allo 0 macchina
|
' Recupero origine tavola rispetto allo 0 macchina
|
||||||
Dim TableRef As Point3d
|
Dim TableRef As Point3d
|
||||||
EgtGetTableRef(1, TableRef)
|
EgtGetTableRef(1, TableRef)
|
||||||
|
' imposto modo automatico
|
||||||
|
Select Case m_MainWindow.m_CNCommunication.m_nNCType
|
||||||
|
Case 1, 2
|
||||||
|
' in attesa di verifica
|
||||||
|
Case 3
|
||||||
|
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(0)
|
||||||
|
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
||||||
|
Case 4
|
||||||
|
' FANUC - Manual:7, Edit:1
|
||||||
|
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(7)
|
||||||
|
EgtOutLog("Impostata modalità manuale: esito " & nResult.ToString)
|
||||||
|
End Select
|
||||||
' Recupero file LUA
|
' Recupero file LUA
|
||||||
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\RawProbing.lua")
|
EgtLuaExecFile(m_CurrentMachine.sMachDir() & "\DirectCmd\RawProbing.lua")
|
||||||
' Imposto parametri
|
' Imposto parametri
|
||||||
@@ -2089,6 +2422,11 @@ Public Class RawPartPageUC
|
|||||||
End If
|
End If
|
||||||
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
m_MainWindow.m_CurrentProjectPageUC.ClearMessage()
|
||||||
EgtOutLog("RawProbing : sent NC program")
|
EgtOutLog("RawProbing : sent NC program")
|
||||||
|
' Se fanuc passo in modalità AUTO e attivo
|
||||||
|
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||||
|
Dim nResult As Short = m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_WriteCncMode(0)
|
||||||
|
EgtOutLog("Impostata modalità automatica: esito " & nResult.ToString)
|
||||||
|
End If
|
||||||
' Aspetto e lo avvio
|
' Aspetto e lo avvio
|
||||||
System.Threading.Thread.Sleep(300)
|
System.Threading.Thread.Sleep(300)
|
||||||
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
m_MainWindow.m_CNCommunication.m_CN.DGeneralFunctions_CycleStart()
|
||||||
@@ -2154,6 +2492,10 @@ Public Class RawPartPageUC
|
|||||||
Else
|
Else
|
||||||
RawThickness *= ONEMM / 1000
|
RawThickness *= ONEMM / 1000
|
||||||
End If
|
End If
|
||||||
|
' Se fanuc il dato è in mm (NON MICRON)
|
||||||
|
If m_MainWindow.m_CNCommunication.m_nNCType = 4 Then
|
||||||
|
RawThickness *= 1000
|
||||||
|
End If
|
||||||
' Sottraggo eventuale spessore sovratavola
|
' Sottraggo eventuale spessore sovratavola
|
||||||
RawThickness -= m_CurrentMachine.dAdditionalTable
|
RawThickness -= m_CurrentMachine.dAdditionalTable
|
||||||
' Imposto spessore misurato come altezza grezzo
|
' Imposto spessore misurato come altezza grezzo
|
||||||
@@ -2246,6 +2588,7 @@ Public Class RawPartPageUC
|
|||||||
Private Sub RawPartPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
Private Sub RawPartPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||||
' Rimuovo layer temporaneo per crocette
|
' Rimuovo layer temporaneo per crocette
|
||||||
EgtErase(m_nTempLay)
|
EgtErase(m_nTempLay)
|
||||||
|
EgtErase(m_nOtherRefTabLay)
|
||||||
' Dichiaro pagina non attiva
|
' Dichiaro pagina non attiva
|
||||||
m_bActive = False
|
m_bActive = False
|
||||||
End Sub
|
End Sub
|
||||||
@@ -2318,6 +2661,21 @@ Public Class RawPartPageUC
|
|||||||
EgtEmptyGroup(m_nTempLay)
|
EgtEmptyGroup(m_nTempLay)
|
||||||
End Sub
|
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()
|
Private Sub CloseRawByLaser()
|
||||||
' Verifico ci siano punti
|
' Verifico ci siano punti
|
||||||
If m_CurveXKerfList.Count() = 0 Then Return
|
If m_CurveXKerfList.Count() = 0 Then Return
|
||||||
@@ -2352,6 +2710,33 @@ Public Class RawPartPageUC
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
' Disattivo il bottone chiudi grezzo
|
' Disattivo il bottone chiudi grezzo
|
||||||
CloseBtn.IsEnabled = False
|
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
|
End Sub
|
||||||
|
|
||||||
Private Sub CloseRawBySaw()
|
Private Sub CloseRawBySaw()
|
||||||
@@ -2388,6 +2773,33 @@ Public Class RawPartPageUC
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
' Disattivo il bottone chiudi grezzo
|
' Disattivo il bottone chiudi grezzo
|
||||||
CloseBtn.IsEnabled = False
|
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
|
End Sub
|
||||||
|
|
||||||
#Region "Damaged Area"
|
#Region "Damaged Area"
|
||||||
@@ -2444,6 +2856,32 @@ Public Class RawPartPageUC
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
' Disattivo il bottone chiudi grezzo
|
' Disattivo il bottone chiudi grezzo
|
||||||
CloseBtn.IsEnabled = False
|
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
|
End Sub
|
||||||
|
|
||||||
Private Sub CloseDamagedAreaBySaw()
|
Private Sub CloseDamagedAreaBySaw()
|
||||||
@@ -2470,6 +2908,32 @@ Public Class RawPartPageUC
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
' Disattivo il bottone chiudi grezzo
|
' Disattivo il bottone chiudi grezzo
|
||||||
CloseBtn.IsEnabled = False
|
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
|
End Sub
|
||||||
|
|
||||||
Private Sub RemoveDamagedArea()
|
Private Sub RemoveDamagedArea()
|
||||||
@@ -2561,4 +3025,43 @@ Public Class RawPartPageUC
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function CreateOtherRefTab(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||||
|
EgtEmptyGroup(m_nOtherRefTabLay)
|
||||||
|
If Not m_bOtherRefTab Or Not OtherRefTabChBx.IsEnabled Then
|
||||||
|
EgtDraw()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
If File.Exists(m_MainWindow.GetResourcesDir() & "\" & "RefTabBL.nge") Then
|
||||||
|
' Aggiungo disegno staffa fermo pezzo
|
||||||
|
EgtInsertFile(m_MainWindow.GetResourcesDir() & "\" & "RefTabBL.nge")
|
||||||
|
Dim nLastPart As Integer = EgtGetLastPart()
|
||||||
|
Dim Lay As Integer = EgtGetFirstInGroup(nLastPart)
|
||||||
|
Dim Ent As Integer = EgtGetFirstInGroup(Lay)
|
||||||
|
While Ent <> -1
|
||||||
|
Dim NextEnt As Integer = EgtGetNext(Ent)
|
||||||
|
EgtRelocate(Ent, nLayerId)
|
||||||
|
EgtMove(Ent, ptP - Point3d.ORIG)
|
||||||
|
EgtRotate(Ent, ptP, Vector3d.Z_AX, 90 * m_OtherRefTabPos)
|
||||||
|
Ent = NextEnt
|
||||||
|
End While
|
||||||
|
EgtErase(nLastPart)
|
||||||
|
Else
|
||||||
|
' Aggiungo crocette
|
||||||
|
ptP += New Vector3d(0, 0, 0.15)
|
||||||
|
Dim vtCrossX As New Vector3d(100, 0, 0)
|
||||||
|
Dim vtCrossY As New Vector3d(0, 100, 0)
|
||||||
|
Dim vtCrossZ As New Vector3d(0, 0, 100)
|
||||||
|
Dim nCrossId1 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossX)
|
||||||
|
EgtSetColor(nCrossId1, New Color3d(245, 0, 0))
|
||||||
|
Dim nCrossId2 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossY)
|
||||||
|
EgtSetColor(nCrossId2, New Color3d(0, 245, 0))
|
||||||
|
Dim nCrossId3 = EgtCreateLine(nLayerId, ptP, ptP + vtCrossZ)
|
||||||
|
EgtSetColor(nCrossId3, New Color3d(0, 0, 245))
|
||||||
|
End If
|
||||||
|
|
||||||
|
EgtDraw()
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1018 B |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 857 B After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 857 B |
@@ -240,10 +240,10 @@
|
|||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Button Name="GenerateCN_Btn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="GenerateXPIUC_Click">
|
<Button Name="GenerateCN_Btn" Grid.Column="1" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="GenerateCN_Click">
|
||||||
<Image Source="{DynamicResource GenerateCNImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
|
<Image Source="{DynamicResource GenerateCNImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="ExitBtnUC_Click">
|
<Button Grid.Column="2" Style="{DynamicResource OmagCut_GradientBlueIconButton}" Click="ExitBtn_Click">
|
||||||
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
|
<Image Source="{DynamicResource VImg}" Style="{StaticResource OmagCut_ButtonIcon}" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ Public Class SimulationPageUC
|
|||||||
End If
|
End If
|
||||||
' Pulsante Play
|
' Pulsante Play
|
||||||
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Play.png", UriKind.Relative))
|
PlayPauseImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Play.png", UriKind.Relative))
|
||||||
' abilito la visualizzazione del pulsante per la sola generazione del codice CN
|
' abilito la visualizzazione del pulsante per la generazione del codice CN (se previsto)
|
||||||
If GetPrivateProfileInt(S_GENERAL, K_GENERATECN, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
If GetPrivateProfileInt(S_GENERAL, K_GENERATECN, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||||
GenerateCN_Btn.Visibility = Visibility.Visible
|
GenerateCN_Btn.Visibility = Visibility.Visible
|
||||||
Else
|
Else
|
||||||
@@ -535,7 +535,7 @@ Public Class SimulationPageUC
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ExitBtnUC_Click(sender As Object, e As RoutedEventArgs)
|
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs)
|
||||||
' Mi assicuro di terminare la simulazione
|
' Mi assicuro di terminare la simulazione
|
||||||
ResetSimulation()
|
ResetSimulation()
|
||||||
' Nascondo tutte le lavorazioni
|
' Nascondo tutte le lavorazioni
|
||||||
@@ -566,52 +566,23 @@ Public Class SimulationPageUC
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub GenerateXPIUC_Click(sender As Object, e As RoutedEventArgs)
|
Private Sub GenerateCN_Click(sender As Object, e As RoutedEventArgs)
|
||||||
Dim bOk As Boolean = True
|
' Se il bottone Shift è premuto apro il file CadCut1 nel programma NotePad
|
||||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
Dim IsPressedShiftKey As Boolean = False
|
||||||
' Elimino eventuale attrezzaggio da OmagOFFICE
|
If Keyboard.Modifiers And ModifierKeys.Shift Then IsPressedShiftKey = True
|
||||||
EgtEraseCurrSetup()
|
|
||||||
' Verifico l'attrezzaggio degli utensili utilizzati
|
' Eventualmente fermo la simulazione
|
||||||
Dim sMissingTools As String = String.Empty
|
m_nStatus = MCH_SIM_ST.UI_STOP
|
||||||
If Not VerifySetup(sMissingTools) Then
|
m_bPlay = False
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90322) & " " & sMissingTools) 'Mancano gli utensili : ...
|
PlayPauseBtn_Click(Nothing, Nothing)
|
||||||
|
|
||||||
|
' Se versione ufficio non genero
|
||||||
|
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
||||||
|
m_CurrProjPage.SetWarningMessage("Office Version")
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' Costringo ad aggiornare UI
|
|
||||||
UpdateUI()
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
' Aggiorno flag per lavaggio
|
|
||||||
m_CurrProjPage.UpdateWashingFlag()
|
|
||||||
' Aggiorno flag per tastatura per tagli con angolo di fianco
|
|
||||||
m_CurrProjPage.UpdateSideAngCutProbeFlag()
|
|
||||||
' Se pezzi piani e non c'è ordine delle lavorazioni, ricalcolo tutto e ne faccio uno automatico
|
|
||||||
Dim nPrjType As Integer = m_CurrProjPage.GetCurrentProjectType()
|
|
||||||
Dim bDirectCut As Boolean = (GetDirectCutPart() <> GDB_ID.NULL)
|
|
||||||
If nPrjType = CurrentProjectPageUC.PRJ_TYPE.FLATS And
|
|
||||||
Not bDirectCut And
|
|
||||||
Not m_CurrProjPage.GetOrderMachiningFlag() Then
|
|
||||||
ResetAllMachinings()
|
|
||||||
bOk = SortAllMachinings()
|
|
||||||
If bOk Then
|
|
||||||
m_CurrProjPage.SetOrderMachiningFlag()
|
|
||||||
Dim bModif As Boolean = TestAllMachiningsForStrict()
|
|
||||||
If bModif Then
|
|
||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
|
|
||||||
Else
|
|
||||||
m_CurrProjPage.SetInfoMessage(EgtMsg(90399)) 'Aggiornate tutte le lavorazioni
|
|
||||||
End If
|
|
||||||
EgtDraw()
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
' Costringo ad aggiornare UI
|
|
||||||
UpdateUI()
|
|
||||||
' Disabilito impostazione modificato
|
|
||||||
EgtDisableModified()
|
|
||||||
' Aggiorno le lavorazioni
|
|
||||||
bOk = UpdateAllMachiningsToolpaths() And bOk
|
|
||||||
' Aggiorno posizionamento ventose sui pezzi per eventuali tagli da sotto con lama
|
|
||||||
bOk = UpdateVacuumsForDrip() And bOk
|
|
||||||
' Costringo ad aggiornare UI
|
|
||||||
UpdateUI()
|
|
||||||
' Inserisco indice di progetto
|
' Inserisco indice di progetto
|
||||||
m_CurrProjPage.SetProjectIndexFlag()
|
m_CurrProjPage.SetProjectIndexFlag()
|
||||||
' Inserisco il materiale
|
' Inserisco il materiale
|
||||||
@@ -621,45 +592,22 @@ Public Class SimulationPageUC
|
|||||||
m_CurrProjPage.SaveFile(sMchPath)
|
m_CurrProjPage.SaveFile(sMchPath)
|
||||||
' Costringo ad aggiornare UI
|
' Costringo ad aggiornare UI
|
||||||
UpdateUI()
|
UpdateUI()
|
||||||
' Se modalità Ufficio, copio il progetto ed esco
|
|
||||||
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.OFFICE_TYPE) Then
|
' Nome e path del file CN da generare
|
||||||
' Ripristino come fase corrente quella iniziale
|
Dim sFileName As String = ""
|
||||||
EgtSetCurrPhase(1)
|
' Se in Tagli Diretti
|
||||||
' Chiedo il nome del file esportato
|
If m_MainWindow.DirectCutBtn.IsChecked And Not m_MainWindow.CadCutBtn.IsChecked Then
|
||||||
Dim MySaveNameWD As New SaveNameWD(m_MainWindow, SaveNameWD.SAVE_TYPE.PRJ_COPY)
|
sFileName = "DirectCut"
|
||||||
MySaveNameWD.ShowDialog()
|
' Altrimenti in Tagli Cad
|
||||||
Return
|
Else
|
||||||
End If
|
|
||||||
' Se presente ripartenza, ne chiedo conferma
|
|
||||||
Dim nPhaseRestart As Integer = m_CurrProjPage.GetProjectNcRestart()
|
|
||||||
If nPhaseRestart <> 0 Then
|
|
||||||
' Confermi ripartenza dalla fase NNN ?
|
|
||||||
Dim AskNcRestart As New EgtMsgBox(m_MainWindow, "", String.Format(EgtMsg(90326), nPhaseRestart),
|
|
||||||
EgtMsgBox.Buttons.YES_NO_CANCEL, EgtMsgBox.Icons.NULL, 2)
|
|
||||||
Select Case AskNcRestart.m_nPressedBtn
|
|
||||||
Case 1 ' YES
|
|
||||||
Case 2 ' NO
|
|
||||||
EgtEnableModified()
|
|
||||||
m_CurrProjPage.ResetProjectNcRestart()
|
|
||||||
nPhaseRestart = 0
|
|
||||||
EgtDisableModified()
|
|
||||||
Case Else ' CANCEL
|
|
||||||
Return
|
|
||||||
End Select
|
|
||||||
End If
|
|
||||||
' Se abilitate, eseguo le stime
|
|
||||||
If GetPrivateProfileInt(S_MACH_ESTIMATIONS, K_ENABLEEST, 0, m_MainWindow.GetMachIniFile()) <> 0 Then
|
|
||||||
EgtEstimate(m_MainWindow.GetTempDir() & "\MachProj.html", "OmagCut ver." & m_MainWindow.GetVersion())
|
|
||||||
End If
|
|
||||||
' Genero file CNC (lancio anche se errore in precedenza) -> recupero la tavola corrente! CamAuto.GetCurrentTable()
|
|
||||||
Dim nIndexTab As Integer = CamAuto.GetCurrentTable()
|
Dim nIndexTab As Integer = CamAuto.GetCurrentTable()
|
||||||
Dim sIndexTab As String = String.Empty
|
Dim sIndexTab As String = If( nIndexTab > 0, nIndexTab.ToString, "")
|
||||||
If nIndexTab > 0 Then
|
sFileName = "CadCut" & sIndexTab
|
||||||
sIndexTab = nIndexTab.ToString
|
|
||||||
End If
|
End If
|
||||||
Dim sFileName As String = "CadCut" & sIndexTab
|
|
||||||
Dim sCncPath As String = m_MainWindow.GetCncDir() & "\" & sFileName & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
Dim sCncPath As String = m_MainWindow.GetCncDir() & "\" & sFileName & m_MainWindow.m_CurrentMachine.sIsoFileExt
|
||||||
bOk = EgtGenerate(sCncPath, "OmagCut ver." & m_MainWindow.GetVersion()) And bOk
|
|
||||||
|
' Genero file CNC
|
||||||
|
Dim bOk As Boolean = EgtGenerate(sCncPath, "OmagCut ver." & m_MainWindow.GetVersion())
|
||||||
' Costringo ad aggiornare UI
|
' Costringo ad aggiornare UI
|
||||||
UpdateUI()
|
UpdateUI()
|
||||||
' Ripristino come fase corrente quella iniziale
|
' Ripristino come fase corrente quella iniziale
|
||||||
@@ -669,6 +617,26 @@ Public Class SimulationPageUC
|
|||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
m_CurrProjPage.SetErrorMessage(EgtMsg(90314)) 'Errore nella generazione del programma CN
|
||||||
End If
|
End If
|
||||||
|
' procedo all'apertura del file CadCut1 appena generato (solo se generazione corretta)
|
||||||
|
If bOk And IsPressedShiftKey Then
|
||||||
|
Try
|
||||||
|
Process.Start("Notepad.exe", sCncPath)
|
||||||
|
Catch ex As Exception
|
||||||
|
EgtOutLog(ex.ToString)
|
||||||
|
End Try
|
||||||
|
End If
|
||||||
|
' ricarico la pagina di simulazione
|
||||||
|
EgtSetCurrPhase(1)
|
||||||
|
' nascondo i pezzi in parcheggio
|
||||||
|
HideParkedParts(True)
|
||||||
|
' Avvio ambiente di simulazione
|
||||||
|
EgtSimInit()
|
||||||
|
EgtSimStart()
|
||||||
|
' Imposto stato corrente
|
||||||
|
SetStatus(MCH_SIM_ST.UI_STOP)
|
||||||
|
m_bPlay = True
|
||||||
|
' Costringo ad aggiornare UI
|
||||||
|
UpdateUI()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ProcessEvents(nProg As Integer, nPause As Integer) As Integer
|
Private Function ProcessEvents(nProg As Integer, nPause As Integer) As Integer
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
|
Imports System.Diagnostics
|
||||||
Imports System.Collections.ObjectModel
|
Imports System.Collections.ObjectModel
|
||||||
Imports System.Text.RegularExpressions
|
Imports System.Text.RegularExpressions
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
@@ -17,6 +18,23 @@ Module Utility
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Friend StopWatch As Stopwatch
|
||||||
|
|
||||||
|
Friend Sub TimeSpanInit()
|
||||||
|
StopWatch = New Stopwatch
|
||||||
|
StopWatch.Start()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
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
|
' Costringo ad aggiornare UI
|
||||||
@@ -187,10 +205,10 @@ Module Utility
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
' conerte il dato (in mm) in stringa nell'unità corrente
|
' conerte il dato (in mm) in stringa nell'unità corrente
|
||||||
Friend Function LenToString(dVal As Double, nNumDec As Integer) As String
|
Friend Function LenToString(dVal As Double, nNumDec As Integer, Optional ByVal bForceToDecimal As Boolean = False) As String
|
||||||
Dim sVal As String = DoubleToString(EgtToUiUnits(dVal), nNumDec)
|
Dim sVal As String = DoubleToString(EgtToUiUnits(dVal), nNumDec)
|
||||||
' se richiesta scrittura in frazione (solo se unità corrente INCHES)
|
' se richiesta scrittura in frazione (solo se unità corrente INCHES)
|
||||||
If nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM() Then
|
If (nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM()) And Not bForceToDecimal Then
|
||||||
' conevrto il dato corrente in decimale
|
' conevrto il dato corrente in decimale
|
||||||
Dim dCurrVal As Double = dVal
|
Dim dCurrVal As Double = dVal
|
||||||
StringToDouble(sVal, dCurrVal)
|
StringToDouble(sVal, dCurrVal)
|
||||||
@@ -199,10 +217,10 @@ Module Utility
|
|||||||
Return sVal
|
Return sVal
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function StringToLen(sVal As String, ByRef dVal As Double) As Boolean
|
Friend Function StringToLen(sVal As String, ByRef dVal As Double, Optional ByVal bForceToDecimal As Boolean = False) As Boolean
|
||||||
If String.IsNullOrEmpty(sVal) Then Return False
|
If String.IsNullOrEmpty(sVal) Then Return False
|
||||||
|
|
||||||
If nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM() Then
|
If (nCurrFractionPattern <> FractionPattern.None And Not EgtUiUnitsAreMM()) And Not bForceToDecimal Then
|
||||||
Dim sValSource As String = sVal
|
Dim sValSource As String = sVal
|
||||||
' conevrto la stringa in formato decimale (sempre in stringa)
|
' conevrto la stringa in formato decimale (sempre in stringa)
|
||||||
StringFractionToStringDecimal(sValSource, sVal)
|
StringFractionToStringDecimal(sValSource, sVal)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ Imports System.Collections.ObjectModel
|
|||||||
Imports System.Runtime.InteropServices
|
Imports System.Runtime.InteropServices
|
||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
Imports EgtWPFLib
|
Imports EgtWPFLib
|
||||||
|
Imports OmagCUT.VeinMatchingWindow
|
||||||
|
|
||||||
Public Class VeinMatchingWindow
|
Public Class VeinMatchingWindow
|
||||||
|
|
||||||
@@ -19,13 +20,20 @@ Public Class VeinMatchingWindow
|
|||||||
Private m_nIdToSel As Integer = GDB_ID.NULL
|
Private m_nIdToSel As Integer = GDB_ID.NULL
|
||||||
Private m_nIdToDesel As Integer = GDB_ID.NULL
|
Private m_nIdToDesel As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
|
Enum ALETTE
|
||||||
|
F = 2
|
||||||
|
A = 1
|
||||||
|
End Enum
|
||||||
|
|
||||||
Private Sub Window_Initialized(sender As Object, e As EventArgs)
|
Private Sub Window_Initialized(sender As Object, e As EventArgs)
|
||||||
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
' Assegnazione scena all'host e posizionamento nella PlacePageGrid
|
||||||
VeinMatchingSceneHost.Child = VeinMatchingScene
|
VeinMatchingSceneHost.Child = VeinMatchingScene
|
||||||
VeinMatchingSceneHost.SetValue(Grid.ColumnProperty, 1)
|
VeinMatchingSceneHost.SetValue(Grid.ColumnProperty, 1)
|
||||||
Me.VeinMatchingGrid.Children.Add(VeinMatchingSceneHost)
|
Me.VeinMatchingGrid.Children.Add(VeinMatchingSceneHost)
|
||||||
' Per non farla visualizzare alla creazione
|
' Per non farla visualizzare alla creazione
|
||||||
|
If GetPrivateProfileInt(S_VEINMATCHING, K_VEINMA_ENABLE, 0, m_MainWindow.GetIniFile()) = 1 Then
|
||||||
Me.Left = 32000
|
Me.Left = 32000
|
||||||
|
End If
|
||||||
' Assegno messaggi
|
' Assegno messaggi
|
||||||
NewBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 3)
|
NewBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 3)
|
||||||
ExportBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 10)
|
ExportBtn.Content = EgtMsg(MSG_CADCUTPAGEUC + 10)
|
||||||
@@ -1039,37 +1047,44 @@ Friend Module VeinMatching
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
Friend Function MoveAlettaSolid(ByRef Item As Aletta, ByRef ThicknessRaw As Double) As Boolean
|
||||||
|
' A: alzatina, F: frontalino
|
||||||
Dim nType As Integer
|
Dim nType As Integer
|
||||||
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
|
If Not EgtGetInfo(Item.IdSideRef, "AF", nType) Then Return False
|
||||||
|
|
||||||
Dim ptSRef, ptERef, ptE As Point3d
|
Dim ptSRef, ptERef, ptS, ptE As Point3d
|
||||||
|
' Piano cucina
|
||||||
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
|
If Not EgtStartPoint(Item.IdSideRef, GDB_ID.ROOT, ptSRef) Then Return False
|
||||||
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
|
If Not EgtEndPoint(Item.IdSideRef, GDB_ID.ROOT, ptERef) Then Return False
|
||||||
|
' AlzFront
|
||||||
|
If Not EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptS) Then Return False
|
||||||
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
|
If Not EgtEndPoint(Item.SideId, GDB_ID.ROOT, ptE) Then Return False
|
||||||
|
|
||||||
|
' vettore lato cucina
|
||||||
|
Dim vtRotRef As Vector3d = ptERef - ptSRef
|
||||||
|
' vettore lato AlzFront
|
||||||
|
Dim vtRot As Vector3d = ptE - ptS
|
||||||
|
|
||||||
' ruoto il solido intorno al lato di riferimento
|
' ruoto il solido intorno al lato di riferimento
|
||||||
Dim vtRot As Vector3d = ptERef - ptSRef
|
If nType = ALETTE.A Then
|
||||||
If nType = 1 Then
|
|
||||||
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
|
|
||||||
ElseIf nType = 2 Then
|
|
||||||
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
|
EgtRotate(Item.PartId, ptE, vtRot, 90, GDB_RT.GLOB)
|
||||||
|
ElseIf nType = ALETTE.F Then
|
||||||
|
EgtRotate(Item.PartId, ptE, vtRot, -90, GDB_RT.GLOB)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' punto di riferimento per la traslazione sul solido
|
' punto di riferimento per la traslazione sul solido
|
||||||
Dim ptSolid As Point3d
|
Dim ptSolid As Point3d
|
||||||
If nType = 1 Then
|
If nType = ALETTE.A Then
|
||||||
' cerco id della curva che definisce la front face
|
' cerco id della curva che definisce la front face
|
||||||
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
|
Dim nSolidGrp As Integer = EgtGetFirstNameInGroup(Item.PartId, NAME_VM_SOLID)
|
||||||
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
|
Dim nFrontCrvId As Integer = EgtGetFirstInGroup(nSolidGrp)
|
||||||
EgtStartPoint(nFrontCrvId, ptSolid)
|
EgtStartPoint(nFrontCrvId, GDB_ID.ROOT, ptSolid)
|
||||||
ElseIf nType = 2 Then
|
ElseIf nType = ALETTE.F Then
|
||||||
EgtStartPoint(Item.SideId, ptSolid)
|
EgtStartPoint(Item.SideId, GDB_ID.ROOT, ptSolid)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim ItemFrame As New Frame3d
|
' Dim ItemFrame As New Frame3d
|
||||||
If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
|
' If Not EgtGetGroupGlobFrame(Item.PartId, ItemFrame) Then Return False
|
||||||
ptSolid.ToGlob(ItemFrame)
|
' ptSolid.ToGlob(ItemFrame)
|
||||||
|
|
||||||
'punto di riferimento per la traslazione sul piano cucina
|
'punto di riferimento per la traslazione sul piano cucina
|
||||||
Dim ptKitchen As Point3d = ptERef
|
Dim ptKitchen As Point3d = ptERef
|
||||||
@@ -1077,6 +1092,16 @@ Friend Module VeinMatching
|
|||||||
Dim vtMove As Vector3d = ptKitchen - ptSolid
|
Dim vtMove As Vector3d = ptKitchen - ptSolid
|
||||||
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
|
EgtMove(Item.PartId, vtMove, GDB_RT.GLOB)
|
||||||
|
|
||||||
|
' eventualmente ruoto per allineare l'alzatina al piano cucina
|
||||||
|
Dim dLRef, dAngVRef, dAngHRef As Double
|
||||||
|
vtRotRef.ToSpherical(dLRef, dAngVRef, dAngHRef)
|
||||||
|
Dim dL, dAngV, dAngH As Double
|
||||||
|
vtRot.Rotate(Vector3d.Z_AX, 180)
|
||||||
|
vtRot.ToSpherical(dL, dAngV, dAngH)
|
||||||
|
Dim dDelta As Double = dAngHRef - dAngH
|
||||||
|
If Math.Abs(dDelta) < EPS_ANG_SMALL Then Return True
|
||||||
|
EgtRotate(Item.PartId, ptKitchen, Vector3d.Z_AX, dDelta, GDB_RT.GLOB)
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@@ -1151,6 +1176,8 @@ Friend Module VeinMatching
|
|||||||
' Esporto il file come immagine
|
' Esporto il file come immagine
|
||||||
EgtSetCurrentContext(m_nVeinCtx)
|
EgtSetCurrentContext(m_nVeinCtx)
|
||||||
Dim bOk As Boolean = (EgtGetFileType(sFilePath) = FT.IMG)
|
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),
|
bOk = bOk AndAlso EgtGetImage(EgtGetShowMode(), New Color3d(255, 255, 255), New Color3d(255, 255, 255),
|
||||||
m_nImgWidth, m_nImgHeight, sFilePath)
|
m_nImgWidth, m_nImgHeight, sFilePath)
|
||||||
' Ripristino il contesto originale
|
' Ripristino il contesto originale
|
||||||
|
|||||||
@@ -189,25 +189,33 @@ Public Class WorkInProgressPageUC
|
|||||||
' Valori precedenti degli assi macchina
|
' Valori precedenti degli assi macchina
|
||||||
Dim dL1p, dL2p, dL3p, dR1p, dR2p As Double
|
Dim dL1p, dL2p, dL3p, dR1p, dR2p As Double
|
||||||
Dim bFirst As Boolean = True
|
Dim bFirst As Boolean = True
|
||||||
|
|
||||||
' Gestione fase di lavoro
|
' Gestione fase di lavoro
|
||||||
Dim sPhaseVar As String = String.Empty
|
Dim sPhaseVar As String = String.Empty
|
||||||
GetPrivateProfileString(S_MACH_INPROGRESS, K_PHASEVAR, "E80020", sPhaseVar, m_MainWindow.GetMachIniFile())
|
Dim nCurrPhase = 1
|
||||||
|
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.n_DReadELS_handle = 0
|
||||||
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
|
m_MainWindow.m_CNCommunication.m_CN.ReadEls_Add_Parameter(sPhaseVar, 3)
|
||||||
System.Threading.Thread.Sleep(100)
|
System.Threading.Thread.Sleep(100)
|
||||||
Dim nCurrPhase = 1
|
|
||||||
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
If m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 3 Then
|
||||||
nCurrPhase = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
|
nCurrPhase = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
|
||||||
End If
|
End If
|
||||||
EgtSetCurrPhase(nCurrPhase, True)
|
EgtSetCurrPhase(nCurrPhase, True)
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
|
Else
|
||||||
|
EgtOutLog("Variabile 'PhaseVar' mancante! In CurrentMachine non sarà aggiornata la fase del grezzo")
|
||||||
|
End If
|
||||||
|
|
||||||
' Tempo di ritardo nel ciclo
|
' Tempo di ritardo nel ciclo
|
||||||
Dim nTimeStep As Integer = 50
|
Dim nTimeStep As Integer = 50
|
||||||
nTimeStep = GetPrivateProfileInt(S_MACH_INPROGRESS, K_WP_STEPTIME, nTimeStep, m_MainWindow.GetMachIniFile())
|
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
|
' Ciclo
|
||||||
While m_bContinue
|
While m_bContinue
|
||||||
' Rileggo la variabile di fase
|
' 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
|
' Recupero la posizione degli assi macchina
|
||||||
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
Dim dL1, dL2, dL3, dR1, dR2 As Double
|
||||||
m_MainWindow.m_CNCommunication.GetAxesPositions(dL1, dL2, dL3, dR1, dR2)
|
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
|
' Per evitare di ciclare rapidissimamente e consumare inutilmente CPU
|
||||||
System.Threading.Thread.Sleep(nTimeStep)
|
System.Threading.Thread.Sleep(nTimeStep)
|
||||||
' Leggo la fase
|
' 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
|
m_MainWindow.m_CNCommunication.m_CN.n_DReadELS_handle = 0
|
||||||
Dim nNextPhase As Integer = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
|
Dim nNextPhase As Integer = CInt(m_MainWindow.m_CNCommunication.m_CN.d_DReadELS_value)
|
||||||
If nNextPhase > nCurrPhase Then
|
If nNextPhase > nCurrPhase Then
|
||||||
@@ -309,7 +317,7 @@ Public Class WorkInProgressPageUC
|
|||||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, m_MainWindow.GetIniFile())
|
||||||
WorkInProgressScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
WorkInProgressScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||||
' inizializzo la scena (DB geometrico + visualizzazione) e verifico presenza chiave
|
' 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
|
If Not WorkInProgressScene.Init() Or Not bProd Then
|
||||||
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
' Rimuovo l'host della scena perchè altrimenti rimarrebbe il buco!!
|
||||||
Me.WorkInProgressPageGrid.Children.Remove(WorkInProgressSceneHost)
|
Me.WorkInProgressPageGrid.Children.Remove(WorkInProgressSceneHost)
|
||||||
@@ -320,11 +328,25 @@ Public Class WorkInProgressPageUC
|
|||||||
#Else
|
#Else
|
||||||
' Se manca la chiave
|
' Se manca la chiave
|
||||||
If m_MainWindow.GetKeyLevel() = -1 Or m_MainWindow.GetKeyLevel() = -2 Then
|
If m_MainWindow.GetKeyLevel() = -1 Or m_MainWindow.GetKeyLevel() = -2 Then
|
||||||
|
If Not EgtGetNetHwKey() Then
|
||||||
EgtOutLog("Missing Dongle")
|
EgtOutLog("Missing Dongle")
|
||||||
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
|
' 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 sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
|
||||||
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
|
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)
|
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
|
' Altrimenti manca la licenza
|
||||||
Else
|
Else
|
||||||
EgtOutLog("Problems with Licence")
|
EgtOutLog("Problems with Licence")
|
||||||
|
|||||||