OmagCUT :
- Migliorata pagina macchina. - Introdotto grezzo acquisito con laser.
This commit is contained in:
@@ -182,17 +182,6 @@
|
||||
<RowDefinition Height="4*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Name="ErrorLstGpBx" Style="{StaticResource OmagCut_GroupBox}" Grid.Row="1">
|
||||
<ListBox Name="ErrorLstBx">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="2">
|
||||
|
||||
@@ -44,7 +44,6 @@ Public Class AlarmsPageUC
|
||||
AngleCutExtraLenTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 7)
|
||||
CompleteCutsTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 8)
|
||||
SafeZTxBl.Text = EgtMsg(MSG_ALARMSPAGEUC + 5)
|
||||
ErrorLstGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 12)
|
||||
MaterialsGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 13)
|
||||
NewMatBtn.Content = EgtMsg(MSG_ALARMSPAGEUC + 14)
|
||||
RemoveMatBtn.Content = EgtMsg(MSG_ALARMSPAGEUC + 15)
|
||||
|
||||
+2
-2
@@ -187,7 +187,7 @@ Public Class CNCommunication
|
||||
' Assegno riferimento al CN alle diverse pagine
|
||||
m_MainWindow.m_MachineStatusUC.m_CN = Me.m_CN
|
||||
m_MainWindow.m_MachinePageUC.m_AlarmsPageUC.m_CN = Me.m_CN
|
||||
m_MainWindow.m_MachinePageUC.m_TestingPage.m_CN = Me.m_CN
|
||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.m_CN = Me.m_CN
|
||||
m_MainWindow.m_DirectCutPageUC.m_MachineButtons.m_CN = Me.m_CN
|
||||
m_MainWindow.m_DirectCutPageUC.m_ManualAxesMove.m_CN = Me.m_CN
|
||||
m_MainWindow.m_DirectCutPageUC.m_CN = Me.m_CN
|
||||
@@ -271,7 +271,7 @@ Public Class CNCommunication
|
||||
For Each Item In m_CN.sz_NC_error_messages
|
||||
ErrorList.Add(Item)
|
||||
Next
|
||||
m_AlarmsPage.ErrorLstBx.ItemsSource = ErrorList
|
||||
m_MainWindow.m_MachinePageUC.m_MachineCNPageUC.ErrorLstBx.ItemsSource = ErrorList
|
||||
End If
|
||||
m_CN.b_NC_error = False
|
||||
m_AlarmsPage.NcError()
|
||||
|
||||
@@ -79,6 +79,7 @@ Public Class CadCutPageUC
|
||||
Else
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_PhotoPage)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Photo
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
Public Const MSG_MACHININGSDBPAGEUC As Integer = MSG_OMAGCUT + 760
|
||||
Public Const MSG_COMBOBOXPARAM As Integer = MSG_OMAGCUT + 800
|
||||
Public Const MSG_ALARMSPAGEUC As Integer = MSG_OMAGCUT + 900
|
||||
Public Const MSG_MACHINECNPAGEUC As Integer = MSG_OMAGCUT + 930
|
||||
Public Const MSG_OPTIONSPAGEUC As Integer = MSG_OMAGCUT + 950
|
||||
Public Const MSG_EGTMSGBOX As Integer = MSG_OMAGCUT + 1100
|
||||
|
||||
|
||||
+13
-4
@@ -357,16 +357,25 @@ Public Class DrawPageUC
|
||||
' Ne recupero l'Id
|
||||
Dim nId2 As Integer = EgtGetLastPart()
|
||||
' Ne recupero il layer OutLoop
|
||||
Dim nOutLoopLayer As Integer = EgtGetFirstNameInGroup(nId2, "OutLoop")
|
||||
Dim nOutLoopLayer As Integer = EgtGetFirstNameInGroup(nId2, SideAngleUC.OUTLOOP_LAYER)
|
||||
' Calcolo dimensione ingombro OutLoop
|
||||
Dim ptMin, ptMax As Point3d
|
||||
EgtGetBBoxGlob(nOutLoopLayer, GDB_BB.STANDARD, ptMin, ptMax)
|
||||
Dim dBBoxRad As Double = 0.5 * Point3d.DistXY(ptMin, ptMax)
|
||||
' Creo layer per testi nesting
|
||||
Dim TextLayer As Integer = EgtCreateGroup(nId2)
|
||||
EgtSetName(TextLayer, SideAngleUC.NEST_SIDE_ANGLE_LAYER)
|
||||
' Modifico inclinazione lati
|
||||
For Each Entity In m_SideAngle.m_SideAngleEntityList
|
||||
Dim nCurrEntityName As Integer = EgtGetFirstNameInGroup(nOutLoopLayer, Entity.sEntityName)
|
||||
If Entity.dSideAngle <> 0 Then
|
||||
If Math.Abs(Entity.dSideAngle) > EPS_ANG_SMALL Then
|
||||
' Scrivo nuovo angolo nelle info
|
||||
EgtSetInfo(nCurrEntityName, "SideAng", Entity.dSideAngle)
|
||||
EgtSetInfo(nCurrEntityName, SideAngleUC.SIDE_ANGLE_INFO, Entity.dSideAngle)
|
||||
' Creo testo con angolo di inclinazione per nesting
|
||||
SideAngleUC.AddTextToLine(Entity.dSideAngle & "°", TextLayer, nCurrEntityName, 10, dBBoxRad, False)
|
||||
Else
|
||||
' Cancello inclinazione nell'apposito campo info
|
||||
EgtRemoveInfo(nCurrEntityName, "SideAng")
|
||||
EgtRemoveInfo(nCurrEntityName, SideAngleUC.SIDE_ANGLE_INFO)
|
||||
End If
|
||||
Next
|
||||
' Muovo la regione in Z per evitare problemi in visualizzazione
|
||||
|
||||
@@ -444,6 +444,11 @@ Public Class ImportPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
' Ricavo nome pezzo selezionato per cancellarne i testi
|
||||
Dim Part1 As Integer = m_MainWindow.m_ImportPageUC.m_nSelectedPart
|
||||
EgtErase(EgtGetFirstNameInGroup(Part1, SideAngleUC.SIDE_ANGLE_LAYER))
|
||||
' Scrivo testi per nesting
|
||||
m_SideAngleUC.WriteSideAngleForNest()
|
||||
' Vettore nomi file temporanei
|
||||
Dim sTmpFiles As New ArrayList()
|
||||
' Ciclo di salvataggio dei pezzi
|
||||
@@ -520,11 +525,9 @@ Public Class ImportPageUC
|
||||
FilePathTxBl.Visibility = Windows.Visibility.Visible
|
||||
FileListBox.Visibility = Windows.Visibility.Visible
|
||||
LeftGrid.Children.Remove(m_SideAngleUC)
|
||||
' Ricavo nome primo pezzo
|
||||
Dim Part1 As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
|
||||
' Ricavo nome pezzo precedentemente selezionato
|
||||
Part1 = m_MainWindow.m_ImportPageUC.m_nSelectedPart
|
||||
EgtErase(EgtGetFirstNameInGroup(Part1, "SideAngle"))
|
||||
' Ricavo nome pezzo selezionato
|
||||
Dim Part1 As Integer = m_MainWindow.m_ImportPageUC.m_nSelectedPart
|
||||
EgtErase(EgtGetFirstNameInGroup(Part1, SideAngleUC.SIDE_ANGLE_LAYER))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
<UserControl x:Class="MachineCNPageUC"
|
||||
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"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="768" d:DesignWidth="1280">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della ImportPage -->
|
||||
<Border Background="{StaticResource OmagCut_Gray}" >
|
||||
|
||||
<Grid Name="ImportPageGrid">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="7.5*"/>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="4.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Name="CNModeGpBx" Style="{StaticResource OmagCut_GroupBox}" Grid.ColumnSpan="2" Margin="0,0,4,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="AutoBtn" Grid.Column="0"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="ManualBtn" Grid.Column="1"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="MDIBtn" Grid.Column="2"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="SingleBtn" Grid.Column="3"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="HomeBtn" Grid.Column="4"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="CommandsGpBx" Style="{StaticResource OmagCut_GroupBox}" Grid.Column="2" Grid.ColumnSpan="2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="StartBtn" Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="StopBtn" Grid.Column="1"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="ResetBtn" Grid.Column="2"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="MDICommandGpBx" Style="{StaticResource OmagCut_GroupBox}" Grid.Row="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="6*"/>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<EgtWPFLib:EgtTextBox Name="MDITxBx" Width="470" Style="{StaticResource OmagCut_KeyboardTextBox}"/>
|
||||
<Button Name="MDIConfirmBtn" Grid.Column="1"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="PartProgTransferGpBx" Style="{StaticResource OmagCut_GroupBox}" Grid.Row="2"
|
||||
Grid.ColumnSpan="3">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="DownloadBtn" Grid.Column="0"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="UploadBtn" Grid.Column="1"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="ActivateBtn" Grid.Column="2"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<Button Name="DeleteBtn" Grid.Column="3"
|
||||
Style="{StaticResource OmagCut_RightGrayGradientYellowTextButton}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="DULoadTxBx" Grid.Column="4" Width="100" Text="900.0"
|
||||
Style="{StaticResource OmagCut_KeyboardTextBox}"/>
|
||||
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="ErrorLstGpBx" Style="{StaticResource OmagCut_GroupBox}" Grid.Row="3" Grid.ColumnSpan="4">
|
||||
<ListBox Name="ErrorLstBx">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
@@ -1,10 +1,33 @@
|
||||
Public Class TestingPageUC
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class MachineCNPageUC
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
Friend m_CN As CN_generico
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
Private Sub TestingPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
StartBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 1)
|
||||
StopBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 2)
|
||||
ResetBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 3)
|
||||
AutoBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 4)
|
||||
SingleBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 5)
|
||||
MDIBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 6)
|
||||
ManualBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 7)
|
||||
HomeBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 8)
|
||||
DownloadBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 9)
|
||||
UploadBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 10)
|
||||
ActivateBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 11)
|
||||
DeleteBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 12)
|
||||
MDIConfirmBtn.Content = EgtMsg(MSG_MACHINECNPAGEUC + 13)
|
||||
CNModeGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 14)
|
||||
CommandsGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 15)
|
||||
MDICommandGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 16)
|
||||
PartProgTransferGpBx.Header = EgtMsg(MSG_MACHINECNPAGEUC + 17)
|
||||
ErrorLstGpBx.Header = EgtMsg(MSG_ALARMSPAGEUC + 12)
|
||||
End Sub
|
||||
|
||||
Private Sub TestingPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
'If m_bFirst Then
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="853.3" d:DesignWidth="1280" Loaded="MachinePage_Loaded" Initialized="MachinePage_Initialized" Unloaded="MachinePage_Unloaded">
|
||||
d:DesignHeight="853.3" d:DesignWidth="1280">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
|
||||
+25
-27
@@ -9,7 +9,7 @@ Public Class MachinePageUC
|
||||
Friend m_AlarmsPageUC As AlarmsPageUC
|
||||
Friend m_ToolsDbPageUC As ToolsDbPageUC
|
||||
Friend m_MachiningDbPageUC As MachiningDbPageUC
|
||||
Friend m_TestingPage As TestingPageUC
|
||||
Friend m_MachineCNPageUC As MachineCNPageUC
|
||||
|
||||
' Riferimento alla pagina correntemente attiva
|
||||
Friend m_ActiveMachinePage As MachinePages
|
||||
@@ -18,27 +18,22 @@ Public Class MachinePageUC
|
||||
Alarms
|
||||
ToolsDb
|
||||
MachiningDb
|
||||
Testing
|
||||
MachineCN
|
||||
End Enum
|
||||
|
||||
Private Sub MachinePage_Initialized(sender As Object, e As EventArgs)
|
||||
Private Sub MachinePage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
|
||||
'Creazione delle Page UserControl
|
||||
m_AlarmsPageUC = New AlarmsPageUC
|
||||
m_ToolsDbPageUC = New ToolsDbPageUC
|
||||
m_MachiningDbPageUC = New MachiningDbPageUC
|
||||
m_TestingPage = New TestingPageUC
|
||||
m_MachineCNPageUC = New MachineCNPageUC
|
||||
|
||||
'Posizionemento nella griglia delle Page UserControl
|
||||
m_AlarmsPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_ToolsDbPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_MachiningDbPageUC.SetValue(Grid.RowProperty, 1)
|
||||
m_TestingPage.SetValue(Grid.RowProperty, 1)
|
||||
|
||||
'Inizializzazione della pagina di apertura all'apertura della pagina MachinePage
|
||||
MachinePageGrid.Children.Add(m_AlarmsPageUC)
|
||||
AlarmsBtn.IsChecked = True
|
||||
m_ActiveMachinePage = MachinePages.Alarms
|
||||
m_MachineCNPageUC.SetValue(Grid.RowProperty, 1)
|
||||
|
||||
AlarmsBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 5)
|
||||
ToolsDBBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 6)
|
||||
@@ -46,13 +41,16 @@ Public Class MachinePageUC
|
||||
TestingPageBtn.Content = EgtMsg(MSG_MACHINEPAGEUC + 8)
|
||||
End Sub
|
||||
|
||||
Private Sub MachinePage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
Private Sub MachinePage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
|
||||
Dim Test As Integer = GetPrivateProfileInt(S_GENERAL, K_TESTINGPAGE, 0, m_MainWindow.GetIniFile())
|
||||
If Test = 1 Then
|
||||
TestingPageBtn.Visibility = Windows.Visibility.Visible
|
||||
'Inizializzazione della pagina di apertura all'apertura della pagina MachinePage
|
||||
If Not m_MainWindow.m_MachineStatusUC.m_bIsClicked Then
|
||||
AlarmsBtn.IsChecked = True
|
||||
m_ActiveMachinePage = MachinePages.Alarms
|
||||
Else
|
||||
TestingPageBtn.Visibility = Windows.Visibility.Hidden
|
||||
TestingPageBtn.IsChecked = True
|
||||
m_ActiveMachinePage = MachinePages.MachineCN
|
||||
m_MainWindow.m_MachineStatusUC.m_bIsClicked = False
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -67,10 +65,10 @@ Public Class MachinePageUC
|
||||
Case MachinePages.MachiningDb
|
||||
AlarmsBtn.IsChecked = False
|
||||
MachiningDBBtn.IsChecked = True
|
||||
Case MachinePages.Testing
|
||||
Case MachinePages.MachineCN
|
||||
AlarmsBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_TestingPage)
|
||||
MachinePageGrid.Children.Remove(m_MachineCNPageUC)
|
||||
MachinePageGrid.Children.Add(m_AlarmsPageUC)
|
||||
m_ActiveMachinePage = MachinePages.Alarms
|
||||
End Select
|
||||
@@ -89,10 +87,10 @@ Public Class MachinePageUC
|
||||
Case MachinePages.MachiningDb
|
||||
ToolsDBBtn.IsChecked = False
|
||||
MachiningDBBtn.IsChecked = True
|
||||
Case MachinePages.Testing
|
||||
Case MachinePages.MachineCN
|
||||
ToolsDBBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_TestingPage)
|
||||
MachinePageGrid.Children.Remove(m_MachineCNPageUC)
|
||||
MachinePageGrid.Children.Add(m_ToolsDbPageUC)
|
||||
m_ActiveMachinePage = MachinePages.ToolsDb
|
||||
End Select
|
||||
@@ -111,10 +109,10 @@ Public Class MachinePageUC
|
||||
MachiningDBBtn.IsChecked = False
|
||||
Case MachinePages.MachiningDb
|
||||
MachiningDBBtn.IsChecked = True
|
||||
Case MachinePages.Testing
|
||||
Case MachinePages.MachineCN
|
||||
MachiningDBBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_TestingPage)
|
||||
MachinePageGrid.Children.Remove(m_MachineCNPageUC)
|
||||
MachinePageGrid.Children.Add(m_MachiningDbPageUC)
|
||||
m_ActiveMachinePage = MachinePages.MachiningDb
|
||||
End Select
|
||||
@@ -126,19 +124,19 @@ Public Class MachinePageUC
|
||||
AlarmsBtn.IsChecked = False
|
||||
TestingPageBtn.IsChecked = True
|
||||
MachinePageGrid.Children.Remove(m_AlarmsPageUC)
|
||||
MachinePageGrid.Children.Add(m_TestingPage)
|
||||
m_ActiveMachinePage = MachinePages.Testing
|
||||
MachinePageGrid.Children.Add(m_MachineCNPageUC)
|
||||
m_ActiveMachinePage = MachinePages.MachineCN
|
||||
Case MachinePages.ToolsDb
|
||||
ToolsDBBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
Case MachinePages.MachiningDb
|
||||
TestingPageBtn.IsChecked = False
|
||||
Case MachinePages.Testing
|
||||
Case MachinePages.MachineCN
|
||||
TestingPageBtn.IsChecked = True
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub MachinePage_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
Private Sub MachinePage_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
||||
Select Case m_ActiveMachinePage
|
||||
Case MachinePages.Alarms
|
||||
If Not IsNothing(m_AlarmsPageUC.m_SetUpPage) And MachinePageGrid.Children.Contains(m_AlarmsPageUC.m_SetUpPage) Then
|
||||
@@ -157,10 +155,10 @@ Public Class MachinePageUC
|
||||
MachinePageGrid.Children.Remove(m_MachiningDbPageUC)
|
||||
MachinePageGrid.Children.Add(m_AlarmsPageUC)
|
||||
m_ActiveMachinePage = MachinePages.Alarms
|
||||
Case MachinePages.Testing
|
||||
Case MachinePages.MachineCN
|
||||
AlarmsBtn.IsChecked = True
|
||||
TestingPageBtn.IsChecked = False
|
||||
MachinePageGrid.Children.Remove(m_TestingPage)
|
||||
MachinePageGrid.Children.Remove(m_MachineCNPageUC)
|
||||
MachinePageGrid.Children.Add(m_AlarmsPageUC)
|
||||
m_ActiveMachinePage = MachinePages.Alarms
|
||||
End Select
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="85.3" d:DesignWidth="1280" Initialized="MachineStatus_Initialized" PreviewMouseDown="MachineStatus_PreviewMouseDown" Loaded="MachineStatus_Loaded">
|
||||
d:DesignHeight="85.3" d:DesignWidth="1280" Initialized="MachineStatus_Initialized" Loaded="MachineStatus_Loaded">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
|
||||
+9
-27
@@ -6,6 +6,8 @@ Public Class MachineStatusUC
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
Private m_MachinePage As MachinePageUC
|
||||
|
||||
' Flag che indica se è stato premuto questo controllo per chiamare la paginacon lista errori
|
||||
Friend m_bIsClicked As Boolean = False
|
||||
Friend m_CN As CN_generico
|
||||
|
||||
Private Sub MachineStatus_Initialized(sender As Object, e As EventArgs)
|
||||
@@ -16,7 +18,7 @@ Public Class MachineStatusUC
|
||||
m_MachinePage = m_MainWindow.m_MachinePageUC
|
||||
End Sub
|
||||
|
||||
Private Sub MachineStatus_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
|
||||
Private Sub MachineStatus_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) Handles Me.PreviewMouseDown
|
||||
MachinePageClick()
|
||||
End Sub
|
||||
|
||||
@@ -29,7 +31,7 @@ Public Class MachineStatusUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_WorkInProgressPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_MachinePageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Machine
|
||||
AlarmsPageClick()
|
||||
m_bIsClicked = True
|
||||
Case MainWindow.Pages.DirectCut
|
||||
m_MainWindow.DirectCutBtn.IsChecked = False
|
||||
m_MainWindow.MachineBtn.IsChecked = True
|
||||
@@ -37,7 +39,7 @@ Public Class MachineStatusUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_MachinePageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Machine
|
||||
AlarmsPageClick()
|
||||
m_bIsClicked = True
|
||||
Case MainWindow.Pages.CadCut
|
||||
m_MainWindow.CadCutBtn.IsChecked = False
|
||||
m_MainWindow.MachineBtn.IsChecked = True
|
||||
@@ -45,7 +47,7 @@ Public Class MachineStatusUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_MachinePageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Machine
|
||||
AlarmsPageClick()
|
||||
m_bIsClicked = True
|
||||
Case MainWindow.Pages.RawPart
|
||||
m_MainWindow.CadCutBtn.IsChecked = True
|
||||
m_MainWindow.MachineBtn.IsChecked = False
|
||||
@@ -65,37 +67,17 @@ Public Class MachineStatusUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_MachinePageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Machine
|
||||
AlarmsPageClick()
|
||||
m_bIsClicked = True
|
||||
Case MainWindow.Pages.Machine
|
||||
m_MainWindow.MachineBtn.IsChecked = True
|
||||
AlarmsPageClick()
|
||||
m_bIsClicked = True
|
||||
Case MainWindow.Pages.Options
|
||||
m_MainWindow.MachineBtn.IsChecked = True
|
||||
m_MainWindow.OptionsBtn.IsChecked = False
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_OptionsPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_MachinePageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Machine
|
||||
AlarmsPageClick()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Sub AlarmsPageClick()
|
||||
'Emulo il click della pagina allarmi dopo il click della pagina macchina
|
||||
Select Case m_MachinePage.m_ActiveMachinePage
|
||||
Case MachinePageUC.MachinePages.Alarms
|
||||
m_MachinePage.AlarmsBtn.IsChecked = True
|
||||
Case MachinePageUC.MachinePages.ToolsDb
|
||||
m_MachinePage.AlarmsBtn.IsChecked = False
|
||||
m_MachinePage.ToolsDBBtn.IsChecked = True
|
||||
Case MachinePageUC.MachinePages.MachiningDb
|
||||
m_MachinePage.AlarmsBtn.IsChecked = False
|
||||
m_MachinePage.MachiningDBBtn.IsChecked = True
|
||||
Case MachinePageUC.MachinePages.Testing
|
||||
m_MachinePage.AlarmsBtn.IsChecked = True
|
||||
m_MachinePage.TestingPageBtn.IsChecked = False
|
||||
m_MachinePage.MachinePageGrid.Children.Remove(m_MachinePage.m_TestingPage)
|
||||
m_MachinePage.MachinePageGrid.Children.Add(m_MachinePage.m_AlarmsPageUC)
|
||||
m_MachinePage.m_ActiveMachinePage = MachinePageUC.MachinePages.Alarms
|
||||
m_bIsClicked = True
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
+7
-6
@@ -71,6 +71,7 @@ Class MainWindow
|
||||
WorkInProgress
|
||||
DirectCut
|
||||
CadCut
|
||||
Photo
|
||||
Open
|
||||
RawPart
|
||||
Draw
|
||||
@@ -351,7 +352,7 @@ Class MainWindow
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_WorkInProgressPageUC)
|
||||
m_ActivePage = Pages.WorkInProgress
|
||||
Case Pages.RawPart, Pages.Draw, Pages.Import, Pages.Simulation
|
||||
Case Pages.Photo, Pages.RawPart, Pages.Draw, Pages.Import, Pages.Simulation
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
CadCutBtn.IsChecked = True
|
||||
Case Pages.FrameCut
|
||||
@@ -399,7 +400,7 @@ Class MainWindow
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_CadCutPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_DirectCutPageUC)
|
||||
m_ActivePage = Pages.DirectCut
|
||||
Case Pages.RawPart, Pages.Draw, Pages.Import, Pages.Simulation
|
||||
Case Pages.Photo, Pages.RawPart, Pages.Draw, Pages.Import, Pages.Simulation
|
||||
DirectCutBtn.IsChecked = False
|
||||
CadCutBtn.IsChecked = True
|
||||
Case Pages.FrameCut
|
||||
@@ -448,7 +449,7 @@ Class MainWindow
|
||||
m_ActivePage = Pages.CadCut
|
||||
Case Pages.CadCut
|
||||
CadCutBtn.IsChecked = True
|
||||
Case Pages.RawPart, Pages.Draw, Pages.Import, Pages.Simulation
|
||||
Case Pages.Photo, Pages.RawPart, Pages.Draw, Pages.Import, Pages.Simulation
|
||||
CadCutBtn.IsChecked = True
|
||||
Case Pages.FrameCut
|
||||
CadCutBtn.IsChecked = True
|
||||
@@ -500,7 +501,7 @@ Class MainWindow
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_CadCutPageUC)
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Add(m_FrameCutPageUC)
|
||||
m_ActivePage = Pages.FrameCut
|
||||
Case Pages.RawPart, Pages.Draw, Pages.Import, Pages.Simulation
|
||||
Case Pages.Photo, Pages.RawPart, Pages.Draw, Pages.Import, Pages.Simulation
|
||||
CadCutBtn.IsChecked = True
|
||||
FrameCutBtn.IsChecked = False
|
||||
Case Pages.FrameCut
|
||||
@@ -550,7 +551,7 @@ Class MainWindow
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_MachinePageUC)
|
||||
m_ActivePage = Pages.Machine
|
||||
Case Pages.RawPart, Pages.Draw, Pages.Import, Pages.Simulation
|
||||
Case Pages.Photo, Pages.RawPart, Pages.Draw, Pages.Import, Pages.Simulation
|
||||
CadCutBtn.IsChecked = True
|
||||
MachineBtn.IsChecked = False
|
||||
Case Pages.FrameCut
|
||||
@@ -593,7 +594,7 @@ Class MainWindow
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_OptionsPageUC)
|
||||
m_ActivePage = Pages.Options
|
||||
Case Pages.RawPart
|
||||
Case Pages.Photo, Pages.RawPart
|
||||
CadCutBtn.IsChecked = True
|
||||
OptionsBtn.IsChecked = False
|
||||
Case Pages.Simulation
|
||||
|
||||
+3
-3
@@ -239,8 +239,8 @@
|
||||
<Compile Include="SplitPageUC.xaml.vb">
|
||||
<DependentUpon>SplitPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TestingPageUC.xaml.vb">
|
||||
<DependentUpon>TestingPageUC.xaml</DependentUpon>
|
||||
<Compile Include="MachineCNPageUC.xaml.vb">
|
||||
<DependentUpon>MachineCNPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ToolChangerPosUC.xaml.vb">
|
||||
<DependentUpon>ToolChangerPosUC.xaml</DependentUpon>
|
||||
@@ -410,7 +410,7 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="TestingPageUC.xaml">
|
||||
<Page Include="MachineCNPageUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
||||
@@ -136,6 +136,7 @@ Public Class PhotoPageUC
|
||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_PhotoPage)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||
' Lancio caricamento nuova foto
|
||||
If m_bFileOk Then
|
||||
m_MainWindow.m_CadCutPageUC.PostPhoto(m_sCurrDir & "\" & m_sCurrFile)
|
||||
@@ -146,6 +147,7 @@ Public Class PhotoPageUC
|
||||
' Istruzioni per chiudere ImportPageUC e aprire CadCutPageUC
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_PhotoPage)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||
End Sub
|
||||
|
||||
Private Sub PhotoPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
|
||||
+28
-8
@@ -45,8 +45,8 @@
|
||||
<RowDefinition Height="4*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
<TextBlock Name="KerfTxBl" Grid.Row="6" Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="KerfTxBx" Grid.Column="1" Grid.Row="6" Width="90"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- Definizione della Grid per il materiale -->
|
||||
@@ -119,17 +120,36 @@
|
||||
</GroupBox>
|
||||
|
||||
<!-- Definizione della Grid per Punti -->
|
||||
<GroupBox Name="PointsGpBx" Grid.Row="4" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_GroupBox}" >
|
||||
<GroupBox Name="PointsGpBx" Grid.Row="3" Grid.ColumnSpan="3" Style="{StaticResource OmagCut_GroupBox}" >
|
||||
|
||||
<Grid>
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ToggleButton Name="AddBtn" Style="{StaticResource OmagCut_YellowToggleButton}"/>
|
||||
<ToggleButton Name="RemoveBtn" Grid.Column="1"
|
||||
<ComboBox Name="ByPointsCmbx" Grid.ColumnSpan="6" Height="38" Width="200">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Label Content="{Binding sName}" FontSize="20" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<ToggleButton Name="AddBtn" Grid.Row="1" Grid.ColumnSpan="2" Margin="0,10,0,0"
|
||||
Style="{StaticResource OmagCut_YellowToggleButton}"/>
|
||||
<ToggleButton Name="RemoveBtn" Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="2" Margin="0,10,0,0"
|
||||
Style="{StaticResource OmagCut_YellowToggleButton}"/>
|
||||
<Button Name="CloseBtn" Grid.Column="4" Grid.Row="1" Grid.ColumnSpan="2" Margin="0,10,0,0"
|
||||
Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
+209
-11
@@ -45,10 +45,29 @@ Public Class RawPartPageUC
|
||||
REMOVE = 2
|
||||
End Enum
|
||||
|
||||
' Variabile che indica la modalità di acquisizione punti(se presi dal disegno o dal laser)
|
||||
Private m_bPointsFromDraw As Boolean = True
|
||||
' Array per modalità per punti
|
||||
Private ByPointsModeArray As New List(Of StringIdCmBx)
|
||||
' Id della curva composita Kerf definita con il laser
|
||||
Private m_nKerfId As Integer = GDB_ID.NULL
|
||||
' Primo punto acquisito
|
||||
Private m_bptLast As Boolean = False
|
||||
Private m_ptLast As Point3d = Point3d.ORIG
|
||||
' Lista di linee che creeranno la curva composita Kerf
|
||||
Private m_CurveXKerfList As New List(Of Integer)
|
||||
' Flag che indica se è in corso la definizione tramite laser o se il grezzo è già chiuso
|
||||
Private m_bIsRawDefiningByLaser As Boolean = False
|
||||
|
||||
Private Sub RawPartPage_Initialized(sender As Object, e As EventArgs)
|
||||
' Definizione dei campi per modalità per punti
|
||||
ByPointsModeArray.Add(New StringIdCmBx(0, EgtMsg(MSG_RAWPARTPAGEUC + 29))) 'From Draw
|
||||
ByPointsModeArray.Add(New StringIdCmBx(1, EgtMsg(MSG_RAWPARTPAGEUC + 30))) 'From Laser
|
||||
|
||||
'Associazione della lista materiali alla combobox
|
||||
MaterialsCmbx.ItemsSource = m_MainWindow.m_CurrentMachine.Materials
|
||||
' Associazione della lista modalità per punti alla CmBx
|
||||
ByPointsCmbx.ItemsSource = ByPointsModeArray
|
||||
|
||||
'Associazione tag textbox e label per visualizzare nome nella calcolatrice
|
||||
LengthTxBx.Tag = LengthTxBl
|
||||
@@ -89,6 +108,12 @@ Public Class RawPartPageUC
|
||||
m_dTableLength = ptMax.x - ptMin.x
|
||||
m_dTableWidth = ptMax.y - ptMin.y
|
||||
End If
|
||||
' Parcheggio pezzi presenti nel grezzo
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(m_CurrProjPage.m_nRawId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nPartId)
|
||||
nPartId = EgtGetFirstPartInRawPart(m_CurrProjPage.m_nRawId)
|
||||
End While
|
||||
' Nascondo eventuali pezzi in parcheggio
|
||||
HideParkedParts()
|
||||
' Deseleziono pezzi
|
||||
@@ -109,7 +134,7 @@ Public Class RawPartPageUC
|
||||
m_RawOffsY = ptRawMin.y - m_ptTableMin.y + m_RawKerf
|
||||
' aggiorno l'apparenza del grezzo
|
||||
AdjustRawPartOnStart()
|
||||
' Altrimenti lo definisco
|
||||
' Altrimenti lo definisco
|
||||
Else
|
||||
' Leggo da Ini gli ultimi valori
|
||||
m_RawLength = GetPrivateProfileDouble(S_RAWPART, K_RAWLENGTH, 2500, m_MainWindow.GetIniFile())
|
||||
@@ -134,10 +159,19 @@ Public Class RawPartPageUC
|
||||
If EgtExistsInfo(m_CurrProjPage.m_nRawId, KEY_RAWBYPOINTS) Then
|
||||
m_bRectangle = False
|
||||
ByPointsBtn.IsChecked = True
|
||||
PointsGpBx.Visibility = Windows.Visibility.Visible
|
||||
ByPointsCmbx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(0, ByPointsModeArray)
|
||||
' Visualizzo bottoni da disegno
|
||||
AddBtn.SetValue(Grid.ColumnSpanProperty, 3)
|
||||
RemoveBtn.SetValue(Grid.ColumnProperty, 3)
|
||||
RemoveBtn.SetValue(Grid.ColumnSpanProperty, 3)
|
||||
CloseBtn.Visibility = Windows.Visibility.Hidden
|
||||
m_bPointsFromDraw = True
|
||||
EgtZoom(ZM.ALL)
|
||||
Else
|
||||
m_bRectangle = True
|
||||
RectangleBtn.IsChecked = True
|
||||
PointsGpBx.Visibility = Windows.Visibility.Hidden
|
||||
UpdateRawPart(bHeightModified)
|
||||
End If
|
||||
' Imposto il materiale corrente nella combobox
|
||||
@@ -187,7 +221,7 @@ Public Class RawPartPageUC
|
||||
' il grezzo non è cambiato, perchè il nuovo punto è sulla vecchia linea
|
||||
AddBtn.IsChecked = False
|
||||
m_nPtMode = PTMODE.MOVE
|
||||
' se rimuovi
|
||||
' se rimuovi
|
||||
ElseIf m_nPtMode = PTMODE.REMOVE Then
|
||||
' ci devono essere almeno 4 punti
|
||||
If EgtGetCurveCompoJointCount(nKerfId) >= 4 Then
|
||||
@@ -321,7 +355,7 @@ Public Class RawPartPageUC
|
||||
Dim nKerfId = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||
' Identifico il punto
|
||||
Dim nU = CInt(m_dDragPar)
|
||||
' Aggiusto Z punto movimentato
|
||||
' Aggiusto Z punto movimentato (è in globale)
|
||||
ptCurr.z = m_ptTableMin.z + m_CurrProjPage.m_dAddTable + m_RawHeight
|
||||
' Sposto il punto
|
||||
If Not EgtModifyCurveCompoJoint(nKerfId, nU, ptCurr, GDB_RT.GLOB) Then Return
|
||||
@@ -358,6 +392,11 @@ Public Class RawPartPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
If Not m_bRectangle And Not m_bPointsFromDraw Then
|
||||
If m_bIsRawDefiningByLaser Then
|
||||
CloseRawByLaser()
|
||||
End If
|
||||
End If
|
||||
' Apro pagina di selezione della lavorazione prima di chiudere il grezzo
|
||||
m_ChooseMachiningPage = New ChooseMachining(m_MainWindow)
|
||||
If m_ChooseMachiningPage.DialogResult Then
|
||||
@@ -385,11 +424,16 @@ Public Class RawPartPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub RectangleBtn_Click(sender As Object, e As RoutedEventArgs) Handles RectangleBtn.Click
|
||||
' Se ero in modalità da laser
|
||||
If m_bPointsFromDraw Then
|
||||
VerifyLaserDefining()
|
||||
End If
|
||||
m_bRectangle = True
|
||||
LengthTxBx.IsEnabled = True
|
||||
WidthTxBx.IsEnabled = True
|
||||
OffsetXTxBx.IsEnabled = True
|
||||
OffsetYTxBx.IsEnabled = True
|
||||
PointsGpBx.Visibility = Windows.Visibility.Hidden
|
||||
UpdateRawPart()
|
||||
End Sub
|
||||
|
||||
@@ -399,22 +443,86 @@ Public Class RawPartPageUC
|
||||
WidthTxBx.IsEnabled = False
|
||||
OffsetXTxBx.IsEnabled = False
|
||||
OffsetYTxBx.IsEnabled = False
|
||||
PointsGpBx.Visibility = Windows.Visibility.Visible
|
||||
ByPointsCmbx.SelectedItem = StringIdCmBx.FromIdToStringIdCmBx(0, ByPointsModeArray)
|
||||
m_bPointsFromDraw = True
|
||||
End Sub
|
||||
|
||||
Private Sub AddBtn_Click(sender As Object, e As RoutedEventArgs) Handles AddBtn.Click
|
||||
If m_bRectangle Then
|
||||
AddBtn.IsChecked = False
|
||||
End If
|
||||
RemoveBtn.IsChecked = False
|
||||
m_nPtMode = If(AddBtn.IsChecked, PTMODE.ADD, PTMODE.MOVE)
|
||||
If m_bPointsFromDraw Then
|
||||
RemoveBtn.IsChecked = False
|
||||
m_nPtMode = If(AddBtn.IsChecked, PTMODE.ADD, PTMODE.MOVE)
|
||||
Else
|
||||
Dim ptAcquired As Point3d
|
||||
AcquireLaserPoint(ptAcquired)
|
||||
' Aggiusto Z punto movimentato (è in locale al tavolo)
|
||||
ptAcquired.z = m_CurrProjPage.m_dAddTable + m_RawHeight
|
||||
If m_bptLast Then
|
||||
Dim NewLine As Integer = EgtCreateLine(m_CurrProjPage.m_nRawId, m_ptLast, ptAcquired)
|
||||
EgtSetColor(NewLine, m_KerfCol)
|
||||
m_CurveXKerfList.Add(NewLine)
|
||||
Else
|
||||
m_bptLast = True
|
||||
End If
|
||||
m_ptLast = ptAcquired
|
||||
If m_CurveXKerfList.Count > 1 Then
|
||||
OkBtn.IsEnabled = True
|
||||
End If
|
||||
AddBtn.IsChecked = False
|
||||
EgtDraw()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AcquireLaserPoint(ByRef ptAcquired As Point3d)
|
||||
Dim ptTipP1 As Point3d
|
||||
' 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
|
||||
End If
|
||||
' Ricavo dati lama corrente
|
||||
Dim sSaw As String = String.Empty
|
||||
GetPrivateProfileString(S_MACH_MACH, K_CURRSAW, "", sSaw, m_MainWindow.GetMachIniFile())
|
||||
' Imposto come testa corrente il laser (senza utensile ovviamente)
|
||||
If Not EgtSetCalcTool("", "H3", 1) Then
|
||||
Return
|
||||
End If
|
||||
' Trasformo in posizione punta utensile in basso
|
||||
If Not EgtGetCalcTipFromPositions(dL1, dL2, dL3, dR1, dR2, True, ptTipP1) Then
|
||||
Return
|
||||
End If
|
||||
' Ora imposto la lama corrente
|
||||
If Not EgtSetCalcTool(sSaw, "H1", 1) Then
|
||||
Return
|
||||
End If
|
||||
' Porto il tip nell'origine tavola
|
||||
ptAcquired = ptTipP1
|
||||
ptAcquired.ToLoc(New Frame3d(m_ptTableMin))
|
||||
End Sub
|
||||
|
||||
Private Sub RemoveBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemoveBtn.Click
|
||||
If m_bRectangle Then
|
||||
RemoveBtn.IsChecked = False
|
||||
End If
|
||||
AddBtn.IsChecked = False
|
||||
m_nPtMode = If(RemoveBtn.IsChecked, PTMODE.REMOVE, PTMODE.MOVE)
|
||||
If m_bPointsFromDraw Then
|
||||
AddBtn.IsChecked = False
|
||||
m_nPtMode = If(RemoveBtn.IsChecked, PTMODE.REMOVE, PTMODE.MOVE)
|
||||
Else
|
||||
If m_CurveXKerfList.Count > 0 Then
|
||||
' Cancello ultima linea
|
||||
EgtErase(m_CurveXKerfList(m_CurveXKerfList.Count - 1))
|
||||
m_CurveXKerfList.RemoveAt(m_CurveXKerfList.Count - 1)
|
||||
' Aggiorno ptLast
|
||||
EgtEndPoint(m_CurveXKerfList(m_CurveXKerfList.Count - 1), m_ptLast)
|
||||
Else
|
||||
m_bptLast = False
|
||||
End If
|
||||
RemoveBtn.IsChecked = False
|
||||
EgtDraw()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateRawPart(Optional bHeightModified As Boolean = False)
|
||||
@@ -435,11 +543,11 @@ Public Class RawPartPageUC
|
||||
If nRawId = GDB_ID.NULL And m_RawHeight > EPS_SMALL Then
|
||||
m_CurrProjPage.m_nRawId = EgtAddRawPart(Point3d.ORIG(), m_RawLength + 2 * m_RawKerf,
|
||||
m_RawWidth + 2 * m_RawKerf, m_RawHeight, Col)
|
||||
' se esiste e da cancellare
|
||||
' se esiste e da cancellare
|
||||
ElseIf m_RawHeight < EPS_SMALL Then
|
||||
EgtRemoveRawPart(nRawId)
|
||||
m_CurrProjPage.m_nRawId = GDB_ID.NULL
|
||||
' Altrimenti lo modifico
|
||||
' Altrimenti lo modifico
|
||||
Else
|
||||
m_CurrProjPage.m_nRawId = nRawId
|
||||
EgtModifyRawPart(nRawId, Point3d.ORIG(), m_RawLength + 2 * m_RawKerf,
|
||||
@@ -495,11 +603,11 @@ Public Class RawPartPageUC
|
||||
If m_CurrProjPage.m_nRawId = GDB_ID.NULL Then
|
||||
UpdateRawPart(True)
|
||||
Return
|
||||
' se da cancellare
|
||||
' se da cancellare
|
||||
ElseIf m_RawHeight < EPS_SMALL Then
|
||||
EgtRemoveRawPart(m_CurrProjPage.m_nRawId)
|
||||
m_CurrProjPage.m_nRawId = GDB_ID.NULL
|
||||
' altrimenti da aggiornare
|
||||
' altrimenti da aggiornare
|
||||
Else
|
||||
' Aggiorno solido
|
||||
EgtModifyRawPartHeight(m_CurrProjPage.m_nRawId, m_RawHeight)
|
||||
@@ -833,4 +941,94 @@ Public Class RawPartPageUC
|
||||
Private Sub RawPartPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
End Sub
|
||||
|
||||
Private Sub VerifyLaserDefining()
|
||||
If m_bIsRawDefiningByLaser Then
|
||||
If m_CurveXKerfList.Count > 1 Then
|
||||
CloseRawByLaser()
|
||||
Else
|
||||
' Elimino tutti i segmenti disegnati
|
||||
For Each nEntityId In m_CurveXKerfList
|
||||
If EgtGetType(nEntityId) = GDB_TY.CRV_LINE Then
|
||||
EgtErase(nEntityId)
|
||||
End If
|
||||
Next
|
||||
' Azzero lista e punto di partenza
|
||||
m_CurveXKerfList.Clear()
|
||||
'Creo rettangolo
|
||||
UpdateRawPart()
|
||||
End If
|
||||
m_bIsRawDefiningByLaser = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ByPointsMode_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles ByPointsCmbx.SelectionChanged
|
||||
Dim SelectedItem As StringIdCmBx = ByPointsCmbx.SelectedItem
|
||||
Select Case SelectedItem.nId
|
||||
Case 0
|
||||
m_bPointsFromDraw = True
|
||||
AddBtn.SetValue(Grid.ColumnSpanProperty, 3)
|
||||
VerifyLaserDefining()
|
||||
' Visualizzo bottoni per disegno
|
||||
RemoveBtn.SetValue(Grid.ColumnProperty, 3)
|
||||
RemoveBtn.SetValue(Grid.ColumnSpanProperty, 3)
|
||||
CloseBtn.Visibility = Windows.Visibility.Hidden
|
||||
Case 1
|
||||
m_bPointsFromDraw = False
|
||||
LoadFromMachine()
|
||||
' Azzero lista e punto di partenza
|
||||
m_CurveXKerfList.Clear()
|
||||
m_bptLast = False
|
||||
' Segno flag che indica definizione grezzo con laser in corso
|
||||
m_bIsRawDefiningByLaser = True
|
||||
' Visualizzo bottoni per laser
|
||||
AddBtn.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
RemoveBtn.SetValue(Grid.ColumnProperty, 2)
|
||||
RemoveBtn.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
CloseBtn.Visibility = Windows.Visibility.Visible
|
||||
OkBtn.IsEnabled = False
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub LoadFromMachine()
|
||||
' Elimino grezzo già presente
|
||||
EgtErase(EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_SOLID))
|
||||
EgtErase(EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF))
|
||||
EgtErase(EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_RAW_OUTLINE))
|
||||
EgtErase(EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_OUTKERF))
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub CloseBtn_Checked(sender As Object, e As RoutedEventArgs) Handles CloseBtn.Click
|
||||
CloseRawByLaser()
|
||||
End Sub
|
||||
|
||||
Private Sub CloseRawByLaser()
|
||||
' Recupero punto iniziale prima linea del grezzo
|
||||
Dim ptStart As Point3d
|
||||
EgtStartPoint(m_CurveXKerfList(0), ptStart)
|
||||
m_CurveXKerfList.Add(EgtCreateLine(m_CurrProjPage.m_nRawId, m_ptLast, ptStart))
|
||||
' Trasformo lista di curve in un array
|
||||
Dim CurveXKerfArray As Integer() = m_CurveXKerfList.ToArray
|
||||
' Creo contorno kerf
|
||||
Dim nKerfId As Integer = EgtCreateCurveCompoByChain(m_CurrProjPage.m_nRawId, m_CurveXKerfList.Count, CurveXKerfArray, ptStart, True)
|
||||
EgtSetName(nKerfId, NAME_KERF)
|
||||
EgtSetColor(nKerfId, m_KerfCol)
|
||||
' Pulisco lista entità del grezzo
|
||||
m_CurveXKerfList.Clear()
|
||||
' Aggiorno il grezzo
|
||||
UpdateRawPartKerf()
|
||||
' Aggiorno dimensioni grezzo
|
||||
UpdateRawXYData()
|
||||
' Salvo il valore del kerf (sempre in mm)
|
||||
EgtSetInfo(m_CurrProjPage.m_nRawId, KEY_KERF, DoubleToString(m_RawKerf, 4))
|
||||
' Segno flag che indica fine della definizione
|
||||
m_bIsRawDefiningByLaser = False
|
||||
' Elimino primo punto per prossimo grezzo
|
||||
m_bptLast = False
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
' Disattivo il bottone
|
||||
CloseBtn.IsEnabled = False
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
+94
-30
@@ -2,6 +2,18 @@
|
||||
|
||||
Public Class SideAngleUC
|
||||
|
||||
' Costanti layer componenti
|
||||
Friend Const COMPO_LAYER_AUX As String = "LayAux"
|
||||
Friend Const COMPO_LAYER_QUOTATURE As String = "Quotature"
|
||||
Friend Const COMPO_LAYER_ETICHETTE As String = "Etichette"
|
||||
' Costanti testi angoli inclinati
|
||||
Friend Const SIDE_ANGLE_LAYER As String = "SideAngle"
|
||||
Friend Const NEST_SIDE_ANGLE_LAYER As String = "NestSideAngle"
|
||||
' Costante info angolo inclinato
|
||||
Friend Const SIDE_ANGLE_INFO As String = "SideAng"
|
||||
' Costante layer contorno esterno pezzo
|
||||
Friend Const OUTLOOP_LAYER As String = "OutLoop"
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = Application.Current.MainWindow
|
||||
Private m_DrawPage As DrawPageUC
|
||||
@@ -52,9 +64,9 @@ Public Class SideAngleUC
|
||||
' Ricavo nome primo pezzo
|
||||
Dim Part1 As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
|
||||
' Nascondo layer delle misure
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "LayAux"), GDB_ST.OFF)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "Quotature"), GDB_ST.OFF)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "Etichette"), GDB_ST.OFF)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, COMPO_LAYER_AUX), GDB_ST.OFF)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, COMPO_LAYER_QUOTATURE), GDB_ST.OFF)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, COMPO_LAYER_ETICHETTE), GDB_ST.OFF)
|
||||
EgtZoom(ZM.ALL)
|
||||
EgtDraw()
|
||||
End Sub
|
||||
@@ -68,7 +80,7 @@ Public Class SideAngleUC
|
||||
Dim TxBlIndex As Integer = 1
|
||||
For Index As Integer = 10 - m_SideAngleEntityList.Count + 1 To 10
|
||||
GetChBxFromIndex(Index).Visibility = Windows.Visibility.Visible
|
||||
GetTxBlFromIndex(Index).Text = "A " & TxBlIndex
|
||||
GetTxBlFromIndex(Index).Text = "A" & TxBlIndex
|
||||
GetTxBlFromIndex(Index).Visibility = Windows.Visibility.Visible
|
||||
TxBlIndex += 1
|
||||
Next
|
||||
@@ -130,16 +142,16 @@ Public Class SideAngleUC
|
||||
' Ricavo nome primo pezzo
|
||||
Part1 = EgtGetFirstInGroup(GDB_ID.ROOT)
|
||||
' Attivo layer delle misure
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "LayAux"), GDB_ST.ON_)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "Quotature"), GDB_ST.ON_)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, "Etichette"), GDB_ST.ON_)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, COMPO_LAYER_AUX), GDB_ST.ON_)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, COMPO_LAYER_QUOTATURE), GDB_ST.ON_)
|
||||
EgtSetStatus(EgtGetFirstNameInGroup(Part1, COMPO_LAYER_ETICHETTE), GDB_ST.ON_)
|
||||
' Svuoto layer in cui sono presenti i testi con le inclinazioni dei lati
|
||||
EgtEmptyGroup(EgtGetFirstNameInGroup(Part1, "SideAngle"))
|
||||
EgtEmptyGroup(EgtGetFirstNameInGroup(Part1, SIDE_ANGLE_LAYER))
|
||||
|
||||
ElseIf m_CallingPage = MainWindow.Pages.Import Then
|
||||
' Ricavo nome pezzo precedentemente selezionato
|
||||
Part1 = m_MainWindow.m_ImportPageUC.m_PrevSelPart
|
||||
EgtErase(EgtGetFirstNameInGroup(Part1, "SideAngle"))
|
||||
EgtErase(EgtGetFirstNameInGroup(Part1, SIDE_ANGLE_LAYER))
|
||||
End If
|
||||
EgtDraw()
|
||||
End Sub
|
||||
@@ -148,7 +160,7 @@ Public Class SideAngleUC
|
||||
' Ricavo nome primo pezzo
|
||||
Dim Part1 As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
|
||||
' Ricavo nome layer con geometria esterna pezzo
|
||||
Dim OutLoop As Integer = EgtGetFirstNameInGroup(Part1, "OutLoop")
|
||||
Dim OutLoop As Integer = EgtGetFirstNameInGroup(Part1, OUTLOOP_LAYER)
|
||||
For Each Entity In m_SideAngleEntityList
|
||||
Entity.nGeomId = EgtGetFirstNameInGroup(OutLoop, Entity.sEntityName)
|
||||
Next
|
||||
@@ -171,26 +183,26 @@ Public Class SideAngleUC
|
||||
|
||||
' Cancello testi già presenti
|
||||
' Ricavo nome layer con geometria esterna pezzo
|
||||
Dim OutLoop As Integer = EgtGetFirstNameInGroup(Part1, "OutLoop")
|
||||
Dim OutLoop As Integer = EgtGetFirstNameInGroup(Part1, OUTLOOP_LAYER)
|
||||
' Calcolo dimensione ingombro OutLoop
|
||||
Dim ptMin, ptMax As Point3d
|
||||
EgtGetBBoxGlob(OutLoop, GDB_BB.STANDARD, ptMin, ptMax)
|
||||
Dim dBBoxRad As Double = 0.5 * Point3d.DistXY(ptMin, ptMax)
|
||||
' Ricavo nome layer con testi inclinazioni
|
||||
Dim TextLayer As Integer = EgtGetFirstNameInGroup(Part1, "SideAngle")
|
||||
Dim TextLayer As Integer = EgtGetFirstNameInGroup(Part1, SIDE_ANGLE_LAYER)
|
||||
' Se presente lo svuoto
|
||||
If TextLayer <> GDB_ID.NULL Then
|
||||
EgtEmptyGroup(TextLayer)
|
||||
Else
|
||||
' altrimenti lo creo
|
||||
TextLayer = EgtCreateGroup(Part1)
|
||||
EgtSetName(TextLayer, "SideAngle")
|
||||
EgtSetName(TextLayer, SIDE_ANGLE_LAYER)
|
||||
End If
|
||||
' Lo svuoto
|
||||
|
||||
For Each Entity In m_SideAngleEntityList
|
||||
' Creo testo con angolo di inclinazione
|
||||
AddTextToLine(Entity.sEntityName & " = " & DoubleToString(Entity.dSideAngle, 1) & "°", Entity.nTextId, Entity.nGeomId, 10, dBBoxRad)
|
||||
AddTextToLine(Entity.sEntityName & " = " & DoubleToString(Entity.dSideAngle, 1) & "°", Entity.nTextId, Entity.nGeomId, 10, dBBoxRad, True)
|
||||
Next
|
||||
|
||||
'Aggiorno visualizzazione
|
||||
@@ -214,14 +226,14 @@ Public Class SideAngleUC
|
||||
|
||||
AdjustFlatPart(Part1)
|
||||
' Ricavo nome layer con geometria esterna pezzo
|
||||
Dim OutLoop As Integer = EgtGetFirstNameInGroup(Part1, "OutLoop")
|
||||
Dim OutLoop As Integer = EgtGetFirstNameInGroup(Part1, OUTLOOP_LAYER)
|
||||
' Calcolo dimensione ingombro OutLoop
|
||||
Dim ptMin, ptMax As Point3d
|
||||
EgtGetBBoxGlob(OutLoop, GDB_BB.STANDARD, ptMin, ptMax)
|
||||
Dim dBBoxRad As Double = 0.5 * Point3d.DistXY(ptMin, ptMax)
|
||||
' Creo layer per testi
|
||||
Dim TextLayer As Integer = EgtCreateGroup(Part1)
|
||||
EgtSetName(TextLayer, "SideAngle")
|
||||
EgtSetName(TextLayer, SIDE_ANGLE_LAYER)
|
||||
|
||||
Dim LastLine As Integer = EgtGetLastInGroup(OutLoop)
|
||||
Dim CurrLine As Integer = EgtGetFirstInGroup(OutLoop)
|
||||
@@ -312,13 +324,13 @@ Public Class SideAngleUC
|
||||
EgtGetName(CurrLine, sEntityName)
|
||||
m_SideAngleEntityList.Add(New SideAngleEntity(CurrLine, sEntityName, TextLayer, 0))
|
||||
' Cancello inclinazione nell'apposito campo info
|
||||
EgtRemoveInfo(CurrLine, "SideAng")
|
||||
EgtRemoveInfo(CurrLine, SIDE_ANGLE_INFO)
|
||||
' Creo testo con angolo di inclinazione 0
|
||||
AddTextToLine(sEntityName & " = 0°", TextLayer, CurrLine, 10, dBBoxRad)
|
||||
AddTextToLine(sEntityName & " = 0°", TextLayer, CurrLine, 10, dBBoxRad, True)
|
||||
End Sub
|
||||
|
||||
' Funzione che dato un segmento e una distanz, scrive il testo centrato alla sua destra
|
||||
Private Sub AddTextToLine(sText As String, TextLayer As Integer, CurrLine As Integer, dDistance As Double, dBBoxRad As Double)
|
||||
Friend Shared Sub AddTextToLine(sText As String, TextLayer As Integer, CurrLine As Integer, dDistance As Double, dBBoxRad As Double, bTextExt As Boolean)
|
||||
' Calcolo altezza testo
|
||||
Dim dH As Double = 0.1 * dBBoxRad
|
||||
' Creo testo
|
||||
@@ -339,23 +351,44 @@ Public Class SideAngleUC
|
||||
Dim vtCurrLine As Vector3d = ptLineEnd - ptLineStart
|
||||
' lo normalizzo per ottenerne il versore
|
||||
vtCurrLine.Normalize()
|
||||
' calcolo vettore dal centro del BBox all'estremo più vicino
|
||||
' calcolo vettore dal centro del BBox all'estremo più vicino se testo esterno alla figura
|
||||
Dim vtptExtptMC As Vector3d
|
||||
If vtCurrLine.x > 0 Then
|
||||
If vtCurrLine.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMinBBox.x, ptMaxBBox.y, 0)
|
||||
If bTextExt Then
|
||||
If vtCurrLine.x > 0 Then
|
||||
If vtCurrLine.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMinBBox.x, ptMaxBBox.y, 0)
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - ptMaxBBox
|
||||
End If
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - ptMaxBBox
|
||||
If vtCurrLine.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - ptMinBBox
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMaxBBox.x, ptMinBBox.y, 0)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If vtCurrLine.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - ptMinBBox
|
||||
If vtCurrLine.x > 0 Then
|
||||
If vtCurrLine.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMaxBBox.x, ptMinBBox.y, 0)
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - ptMinBBox
|
||||
End If
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMaxBBox.x, ptMinBBox.y, 0)
|
||||
If vtCurrLine.y > 0 Then
|
||||
vtptExtptMC = ptMidBBox - ptMaxBBox
|
||||
Else
|
||||
vtptExtptMC = ptMidBBox - New Point3d(ptMinBBox.x, ptMaxBBox.y, 0)
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
' ruoto il vettore della CurrLine per ottenerne il perpendicolare
|
||||
vtCurrLine.Rotate(Vector3d.Z_AX, -90)
|
||||
If bTextExt Then
|
||||
vtCurrLine.Rotate(Vector3d.Z_AX, -90)
|
||||
Else
|
||||
vtCurrLine.Rotate(Vector3d.Z_AX, 90)
|
||||
End If
|
||||
' Calcolo il centro del testo
|
||||
Dim ptTextMC As Point3d = Point3d.Media(ptLineStart, ptLineEnd) + vtCurrLine * (dDistance + (vtCurrLine * vtptExtptMC))
|
||||
EgtMove(nText, (ptTextMC - Point3d.ORIG))
|
||||
@@ -390,10 +423,10 @@ Public Class SideAngleUC
|
||||
End If
|
||||
' Scrivo nuovo angolo nelle info
|
||||
If dSideAngle <> 0 Then
|
||||
EgtSetInfo(CurrEntity.nGeomId, "SideAng", dSideAngle)
|
||||
EgtSetInfo(CurrEntity.nGeomId, SIDE_ANGLE_INFO, dSideAngle)
|
||||
Else
|
||||
' Cancello inclinazione nell'apposito campo info
|
||||
EgtRemoveInfo(CurrEntity.nGeomId, "SideAng")
|
||||
EgtRemoveInfo(CurrEntity.nGeomId, SIDE_ANGLE_INFO)
|
||||
End If
|
||||
' Aggiorno lista entità con nuova inclinazione
|
||||
CurrEntity.dSideAngle = dSideAngle
|
||||
@@ -439,6 +472,37 @@ Public Class SideAngleUC
|
||||
|
||||
End Sub
|
||||
|
||||
Friend Sub WriteSideAngleForNest()
|
||||
' Imposto contesto corrente
|
||||
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
|
||||
Dim CurrPart As Integer
|
||||
CurrPart = EgtGetFirstInGroup(GDB_ID.ROOT)
|
||||
While CurrPart <> GDB_ID.NULL
|
||||
' Ricavo nome layer con geometria esterna pezzo
|
||||
Dim OutLoop As Integer = EgtGetFirstNameInGroup(CurrPart, OUTLOOP_LAYER)
|
||||
' Calcolo dimensione ingombro OutLoop
|
||||
Dim ptMin, ptMax As Point3d
|
||||
EgtGetBBoxGlob(OutLoop, GDB_BB.STANDARD, ptMin, ptMax)
|
||||
Dim dBBoxRad As Double = 0.5 * Point3d.DistXY(ptMin, ptMax)
|
||||
' Creo layer per testi nesting
|
||||
Dim TextLayer As Integer = EgtCreateGroup(CurrPart)
|
||||
EgtSetName(TextLayer, NEST_SIDE_ANGLE_LAYER)
|
||||
|
||||
Dim CurrLine As Integer = EgtGetFirstInGroup(OutLoop)
|
||||
' Ciclo che verifica se possibile inclinare la linea corrente fino alla penultima
|
||||
While CurrLine <> GDB_ID.NULL
|
||||
Dim dSideAngle As Double = 0
|
||||
EgtGetInfo(CurrLine, SIDE_ANGLE_INFO, dSideAngle)
|
||||
If Math.Abs(dSideAngle) > EPS_ANG_SMALL Then
|
||||
' Creo testo con angolo di inclinazione
|
||||
AddTextToLine(dSideAngle & "°", TextLayer, CurrLine, 10, dBBoxRad, False)
|
||||
End If
|
||||
CurrLine = EgtGetNext(CurrLine)
|
||||
End While
|
||||
CurrPart = EgtGetNext(CurrPart)
|
||||
End While
|
||||
End Sub
|
||||
|
||||
Friend Sub ReLoadSideAnglePage()
|
||||
SideAngleUC_Unloaded(Me, New RoutedEventArgs)
|
||||
SideAngleUC_Loaded(Me, New RoutedEventArgs)
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
<UserControl x:Class="TestingPageUC"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="768" d:DesignWidth="1280" Loaded="TestingPage_Loaded">
|
||||
|
||||
<!-- Chiamata al Dictionary -->
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="OmagCutDictionary.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<!-- Definizione della ImportPage -->
|
||||
<Border Style="{StaticResource CustomBorder}" >
|
||||
|
||||
<Grid Name="ImportPageGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Definizione della grid inferiore -->
|
||||
<Grid Name="LowerButtonGrid" Grid.Row="2" Grid.ColumnSpan="3">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="StartBtn" Content="Start" />
|
||||
<Button Name="StopBtn" Grid.Column="1" Content="Stop" />
|
||||
<Button Name="ResetBtn" Grid.Column="2" Content="Reset" />
|
||||
|
||||
<Button Name="AutoBtn" Grid.Column="3" Content="Auto" />
|
||||
<Button Name="SingleBtn" Grid.Column="4" Content="Single" />
|
||||
<Button Name="MDIBtn" Grid.Column="5" Content="MDI" />
|
||||
<Button Name="ManualBtn" Grid.Column="6" Content="Manual" />
|
||||
<Button Name="HomeBtn" Grid.Column="7" Content="Home" />
|
||||
|
||||
<Button Name="DownloadBtn" Grid.Column="8" Content="Download" />
|
||||
<Button Name="UploadBtn" Grid.Column="9" Content="Upload" />
|
||||
<Button Name="ActivateBtn" Grid.Column="10" Content="Activate" />
|
||||
<Button Name="DeleteBtn" Grid.Column="11" Content="Delete" />
|
||||
<Button Name="MDIConfirmBtn" Grid.Column="12" Content="ConfirmMDI" />
|
||||
|
||||
<UniformGrid Grid.Column="13" Rows="2">
|
||||
<TextBox Name="MDITxBx" TextWrapping="Wrap" Text="G24+ XYZ P1/0/0 Q0/1/0 R0/0/1"
|
||||
/>
|
||||
<TextBox Name="DULoadTxBx" Text="900.0" />
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
Reference in New Issue
Block a user