Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 60570863a3 | |||
| 9c8971f52b | |||
| 8d020eeea8 | |||
| a74e6a0f8b |
+135
-80
@@ -7,32 +7,32 @@
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="597.3" d:DesignWidth="256">
|
||||
|
||||
<!--<Border CornerRadius="{StaticResource Page_CornerRadius}" Background="{StaticResource OmagCut_LightGray}">-->
|
||||
<Border Style="{DynamicResource OmagCut_DirectCutPageBorder}">
|
||||
<!--<Border CornerRadius="{StaticResource Page_CornerRadius}" Background="{StaticResource OmagCut_LightGray}">-->
|
||||
<Border Style="{DynamicResource OmagCut_DirectCutPageBorder}">
|
||||
|
||||
<!-- Definizione della Grid MultipleCut -->
|
||||
<Grid Name="SingleCutGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Grid.ColumnSpan="2">
|
||||
<!-- Definizione della Grid MultipleCut -->
|
||||
<Grid Name="SingleCutGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="2*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ToggleButton Name="Point1Btn" Grid.Column="0"
|
||||
Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
@@ -45,95 +45,150 @@
|
||||
</ToggleButton>
|
||||
</Grid>
|
||||
|
||||
<ComboBox Name="PointModeCmBx" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
|
||||
<ComboBox Name="PointModeCmBx" Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_ComboBox}"
|
||||
Margin="6,0,6,0">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock Name="DepthTxBl" Grid.Column="0" Grid.Row="2"
|
||||
<TextBlock Name="DepthTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="DepthTxBx" Grid.Column="1" Grid.Row="2" Margin="0,0,6,0"
|
||||
<EgtWPFLib:EgtTextBox Name="DepthTxBx" Grid.Column="1" Grid.Row="2" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="3"
|
||||
<TextBlock Name="DirectionTxBl" Grid.Column="0" Grid.Row="3"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0" IsLength="False"
|
||||
<EgtWPFLib:EgtTextBox Name="DirectionTxBx" Grid.Column="1" Grid.Row="3" Margin="0,0,6,0" IsLength="False"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<TextBlock Name="SideAngleTxBl" Grid.Column="0" Grid.Row="4"
|
||||
<TextBlock Name="SideAngleTxBl" Grid.Column="0" Grid.Row="4"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0" IsLength="False"
|
||||
<EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="1" Grid.Row="4" Margin="0,0,6,0" IsLength="False"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<Grid Grid.Row="5" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<ColumnDefinition Width="2"/>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<!-- STANDARD -->
|
||||
<Grid Name ="StandardGrid" Grid.Row="5" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
<ColumnDefinition Width="2"/>
|
||||
<ColumnDefinition Width="1.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Column="1" Grid.Row="0" Grid.RowSpan="4" Background="Black" />
|
||||
<Border Grid.Column="1" Grid.Row="0" Grid.RowSpan="4" Background="Black" />
|
||||
|
||||
<TextBlock Name="NumPzXTxBl" Grid.Column="0" Grid.Row="0"
|
||||
<TextBlock Name="NumPzXTxBl" Grid.Column="0" Grid.Row="0"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<TextBlock Name="DimPzXTxBl" Grid.Column="2" Grid.Row="0"
|
||||
<TextBlock Name="DimPzXTxBl" Grid.Column="2" Grid.Row="0"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
|
||||
<EgtWPFLib:EgtTextBox Name="NumPzXTxBx" Grid.Column="0" Grid.Row="1" Width="75" IsLength="False"
|
||||
<EgtWPFLib:EgtTextBox Name="NumPzXTxBx" Grid.Column="0" Grid.Row="1" Width="75" IsLength="False"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="DimPzXTxBx" Grid.Column="2" Grid.Row="1" Width="75"
|
||||
<EgtWPFLib:EgtTextBox Name="DimPzXTxBx" Grid.Column="2" Grid.Row="1" Width="75"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
<TextBlock Name="NumPzYTxBl" Grid.Column="0" Grid.Row="2"
|
||||
<TextBlock Name="NumPzYTxBl" Grid.Column="0" Grid.Row="2"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<TextBlock Name="DimPzYTxBl" Grid.Column="2" Grid.Row="2"
|
||||
<TextBlock Name="DimPzYTxBl" Grid.Column="2" Grid.Row="2"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
|
||||
<EgtWPFLib:EgtTextBox Name="NumPzYTxBx" Grid.Column="0" Grid.Row="3" Width="75" IsLength="False"
|
||||
<EgtWPFLib:EgtTextBox Name="NumPzYTxBx" Grid.Column="0" Grid.Row="3" Width="75" IsLength="False"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="DimPzYTxBx" Grid.Column="2" Grid.Row="3" Width="75"
|
||||
<EgtWPFLib:EgtTextBox Name="DimPzYTxBx" Grid.Column="2" Grid.Row="3" Width="75"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}" />
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<TextBlock Name="SideTxBl" Grid.Row="6" Grid.ColumnSpan="2"
|
||||
<!-- SPECIALE -->
|
||||
<Grid Name ="CustomGrid" Grid.Row="5" Grid.ColumnSpan="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="2.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0">
|
||||
<Button Name="AddCutBtn" Content="+"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Width="35" Height="35" HorizontalAlignment="Left"/>
|
||||
<Button Name="RemoveCutBtn" Content="-"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Width="35" Height="35" HorizontalAlignment="Left" Margin="2,0,0,0"/>
|
||||
<ToggleButton Name="Cut_XTgBtn" Content="X"
|
||||
Style="{DynamicResource OmagCut_YellowToggleButton}"
|
||||
Width="35" Height="35" HorizontalAlignment="Left" Margin="2,0,0,0"/>
|
||||
<ToggleButton Name="Cut_YTgBtn" Content="Y"
|
||||
Style="{DynamicResource OmagCut_YellowToggleButton}"
|
||||
Width="35" Height="35" HorizontalAlignment="Left" Margin="2,0,0,0"/>
|
||||
<Button Name="UpdateBtn" Content="Update"
|
||||
Style="{DynamicResource OmagCut_YellowTextButton}"
|
||||
Width="85" Height="35" HorizontalAlignment="Left" Margin="2,0,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<ScrollViewer Background="Transparent" Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden">
|
||||
<ListBox Name="CustomGridLstBx" ScrollViewer.CanContentScroll="False">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Width="210">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<EgtWPFLib:EgtTextBox Text="{Binding sNumber}" Grid.Column="0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<EgtWPFLib:EgtTextBox Text="{Binding sInteraxis}" Grid.Column="2"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ListBox>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
|
||||
|
||||
<TextBlock Name="SideTxBl" Grid.Row="6" Grid.ColumnSpan="2"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<CheckBox Name="SideChBx" Grid.Row="6" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
<CheckBox Name="SideChBx" Grid.Row="6" Grid.ColumnSpan="2" Style="{StaticResource OmagCut_CheckBox_Single}"
|
||||
HorizontalAlignment="Right" Margin="0,0,6,0"/>
|
||||
|
||||
<Grid Grid.Row="7" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="XcoordTxBl" Grid.Column="0" Text="X"
|
||||
<Grid Grid.Row="7" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Name="XcoordTxBl" Grid.Column="0" Text="X"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||
<EgtWPFLib:EgtTextBox Name="XcoordTxBx" Grid.Column="1" Margin="0,0,6,0"
|
||||
<EgtWPFLib:EgtTextBox Name="XcoordTxBx" Grid.Column="1" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
<TextBlock Name="YcoordTxBl" Grid.Column="2" Text="Y"
|
||||
<TextBlock Name="YcoordTxBl" Grid.Column="2" Text="Y"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}" HorizontalAlignment="Center"/>
|
||||
<EgtWPFLib:EgtTextBox Name="YcoordTxBx" Grid.Column="3" Margin="0,0,6,0"
|
||||
<EgtWPFLib:EgtTextBox Name="YcoordTxBx" Grid.Column="3" Margin="0,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="11" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Row="11" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="SimulBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource SimulaImg}" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
@@ -146,8 +201,8 @@
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
|
||||
+294
-1
@@ -1,5 +1,5 @@
|
||||
Imports EgtUILib
|
||||
Imports OmagCUT.MainWindow
|
||||
Imports System.Collections.ObjectModel
|
||||
|
||||
Public Class GridCut
|
||||
' Riferimenti a pagine
|
||||
@@ -42,6 +42,11 @@ Public Class GridCut
|
||||
' Gestione spessore lama
|
||||
Private m_bSawTh As Boolean = False
|
||||
|
||||
' Gestione griglia Custom
|
||||
Dim m_bCustomGrid As Boolean = False
|
||||
Dim m_ListOfCut_X As New ObservableCollection(Of Cut_Axis)
|
||||
Dim m_ListOfCut_Y As New ObservableCollection(Of Cut_Axis)
|
||||
|
||||
' Costanti
|
||||
Private Const MAX_TAB_DEPTH As Double = 10.0
|
||||
Private Const MIN_CUT_LEN As Double = 10.0
|
||||
@@ -85,8 +90,21 @@ Public Class GridCut
|
||||
m_nNumX = GetPrivateProfileInt(S_DIRECTCUTS, K_DC_GRID_NUMX, m_nNumX, m_MainWindow.GetIniFile())
|
||||
m_dDimX = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_DIMX, m_dDimX, m_MainWindow.GetIniFile())
|
||||
m_nNumY = GetPrivateProfileInt(S_DIRECTCUTS, K_DC_GRID_NUMY, m_nNumY, m_MainWindow.GetIniFile())
|
||||
m_dDepth = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_DEPTH, m_dDepth, m_MainWindow.GetIniFile())
|
||||
m_dAngO = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_ANGH, m_dAngO, m_MainWindow.GetIniFile())
|
||||
m_dAngV = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_ANGV, m_dAngV, m_MainWindow.GetIniFile())
|
||||
m_nNumX = GetPrivateProfileInt(S_DIRECTCUTS, K_DC_GRID_NUMX, m_nNumX, m_MainWindow.GetIniFile())
|
||||
m_dDimX = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_DIMX, m_dDimX, m_MainWindow.GetIniFile())
|
||||
m_nNumY = GetPrivateProfileInt(S_DIRECTCUTS, K_DC_GRID_NUMY, m_nNumY, m_MainWindow.GetIniFile())
|
||||
m_dDimY = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_DIMY, m_dDimY, m_MainWindow.GetIniFile())
|
||||
|
||||
' Carico i dati per i tagli di griglia Custom
|
||||
m_bCustomGrid = (GetPrivateProfileInt(S_DIRECTCUTS, "EnambleCustomGrid", 0, m_MainWindow.GetIniFile()) <> 0)
|
||||
If m_bCustomGrid Then
|
||||
LoadCustomData("GridNumDimXCustom", m_ListOfCut_X)
|
||||
LoadCustomData("GridNumDimYCustom", m_ListOfCut_Y)
|
||||
End If
|
||||
|
||||
' --- 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
|
||||
@@ -96,6 +114,28 @@ Public Class GridCut
|
||||
m_ptTipP1.y = GetPrivateProfileDouble(S_DIRECTCUTS, K_DC_GRID_POSY, m_ptTipP1.y, m_MainWindow.GetIniFile())
|
||||
End Sub
|
||||
|
||||
' Lettura dei dati della griglia Custom
|
||||
Private Sub LoadCustomData(sIpKeyName As String, LocalList As ObservableCollection(Of Cut_Axis))
|
||||
Dim dVal As Double = 0
|
||||
Dim nVal As Integer = 0
|
||||
Dim sVal As String = String.Empty
|
||||
GetPrivateProfileString(S_DIRECTCUTS, sIpKeyName, sVal, sVal, m_MainWindow.GetIniFile())
|
||||
Dim sItems As String() = sVal.Split(";"c)
|
||||
If sItems.Count > 0 Then
|
||||
For Each Item As String In sItems
|
||||
Dim sSubItems As String() = Item.Split(",")
|
||||
If sSubItems.Count = 2 Then
|
||||
If IsNumeric(sSubItems(0)) And IsNumeric(sSubItems(1)) Then
|
||||
nVal = CInt(sSubItems(0))
|
||||
StringToDouble(sSubItems(1), dVal)
|
||||
LocalList.Add(New Cut_Axis(nVal, dVal))
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GridCut_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
' Attivo la pagina
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
@@ -133,6 +173,7 @@ Public Class GridCut
|
||||
m_bPointP2Ok = False
|
||||
' Inizializzo primo punto acquisito dal disegno
|
||||
m_ptPrev = m_ptTipP1 + (m_ptTabOri - Point3d.ORIG())
|
||||
m_ptPrev = m_ptTipP1 + (m_ptTabOri - Point3d.ORIG())
|
||||
m_ptPrev.z = m_ptRawMax.z
|
||||
' Disegno crocetta che indica il punto acquisito
|
||||
CreateCross(m_nTempLay, m_ptPrev)
|
||||
@@ -144,10 +185,15 @@ Public Class GridCut
|
||||
DepthTxBx.Text = LenToString(m_dDepth, 1)
|
||||
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
||||
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
|
||||
DepthTxBx.Text = LenToString(m_dDepth, 1)
|
||||
DirectionTxBx.Text = DoubleToString(m_dAngO - m_MainWindow.m_CurrentMachine.dDeltaC, 2)
|
||||
SideAngleTxBx.Text = DoubleToString(m_dAngV, 2)
|
||||
NumPzXTxBx.Text = m_nNumX.ToString()
|
||||
DimPzXTxBx.Text = LenToString(m_dDimX, 1)
|
||||
DimPzXTxBx.Text = LenToString(m_dDimX, 1)
|
||||
NumPzYTxBx.Text = m_nNumY.ToString()
|
||||
DimPzYTxBx.Text = LenToString(m_dDimY, 1)
|
||||
DimPzYTxBx.Text = LenToString(m_dDimY, 1)
|
||||
SideChBx.IsChecked = m_bHeadSide
|
||||
|
||||
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
@@ -163,6 +209,17 @@ Public Class GridCut
|
||||
Point1Btn.IsChecked = False
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
|
||||
If m_bCustomGrid Then
|
||||
StandardGrid.Visibility = Visibility.Hidden
|
||||
CustomGrid.Visibility = Visibility.Visible
|
||||
Cut_XTgBtn.IsChecked = True
|
||||
CustomGridLstBx.ItemsSource = m_ListOfCut_X
|
||||
Else
|
||||
StandardGrid.Visibility = Visibility.Visible
|
||||
CustomGrid.Visibility = Visibility.Hidden
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -178,6 +235,22 @@ Public Class GridCut
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_GRID_HEADSIDE, If(m_bHeadSide, "1", "0"), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_GRID_POSX, DoubleToString(m_ptTipP1.x, 2), m_MainWindow.GetIniFile())
|
||||
WritePrivateProfileString(S_DIRECTCUTS, K_DC_GRID_POSY, DoubleToString(m_ptTipP1.y, 2), m_MainWindow.GetIniFile())
|
||||
|
||||
If m_bCustomGrid Then
|
||||
Dim sGridNumDimXCustom As String = ""
|
||||
For Index_X As Integer = 0 To m_ListOfCut_X.Count - 1
|
||||
sGridNumDimXCustom &= m_ListOfCut_X(Index_X).sNumber & "," & DoubleToString(m_ListOfCut_X(Index_X).dInteraxis, 2) & ";"
|
||||
Next
|
||||
If sGridNumDimXCustom <> "" Then sGridNumDimXCustom = sGridNumDimXCustom.Remove(sGridNumDimXCustom.Count - 1)
|
||||
WritePrivateProfileString(S_DIRECTCUTS, "GridNumDimXCustom", sGridNumDimXCustom, m_MainWindow.GetIniFile())
|
||||
Dim sGridNumDimYCustom As String = ""
|
||||
For Index_Y As Integer = 0 To m_ListOfCut_Y.Count - 1
|
||||
sGridNumDimYCustom &= m_ListOfCut_Y(Index_Y).sNumber & "," & DoubleToString(m_ListOfCut_Y(Index_Y).dInteraxis, 2) & ";"
|
||||
Next
|
||||
If sGridNumDimYCustom <> "" Then sGridNumDimYCustom = sGridNumDimYCustom.Remove(sGridNumDimYCustom.Count - 1)
|
||||
WritePrivateProfileString(S_DIRECTCUTS, "GridNumDimYCustom", sGridNumDimYCustom, m_MainWindow.GetIniFile())
|
||||
End If
|
||||
|
||||
' Se non vado in simulazione
|
||||
If Not m_bSimul Then
|
||||
' Dichiaro sottopagina da non riattivare
|
||||
@@ -522,6 +595,57 @@ Public Class GridCut
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#Region "CUSTOM LIST GRID"
|
||||
|
||||
Private Sub CutX_Selected() Handles Cut_XTgBtn.Click
|
||||
If Cut_XTgBtn.IsChecked Then
|
||||
Cut_YTgBtn.IsChecked = False
|
||||
CustomGridLstBx.ItemsSource = m_ListOfCut_X
|
||||
CustomGridLstBx.UpdateLayout()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CutY_Selected() Handles Cut_YTgBtn.Click
|
||||
If Cut_YTgBtn.IsChecked Then
|
||||
Cut_XTgBtn.IsChecked = False
|
||||
CustomGridLstBx.ItemsSource = m_ListOfCut_Y
|
||||
CustomGridLstBx.UpdateLayout()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub AddCut_Click(sender As Object, e As EventArgs) Handles AddCutBtn.Click
|
||||
If Cut_XTgBtn.IsChecked Then
|
||||
m_ListOfCut_X.Add(New Cut_Axis(0, 0))
|
||||
ElseIf Cut_YTgBtn.IsChecked Then
|
||||
m_ListOfCut_Y.Add(New Cut_Axis(0, 0))
|
||||
End If
|
||||
CustomGridLstBx.UpdateLayout()
|
||||
End Sub
|
||||
|
||||
Private Sub RemoveCut_Click(sender As Object, e As EventArgs) Handles RemoveCutBtn.Click
|
||||
Dim CurrIndexListSelected As Integer = -1
|
||||
CurrIndexListSelected = CustomGridLstBx.SelectedIndex
|
||||
If Cut_XTgBtn.IsChecked Then
|
||||
If CurrIndexListSelected < 0 Or CurrIndexListSelected > m_ListOfCut_X.Count - 1 Then
|
||||
CurrIndexListSelected = m_ListOfCut_X.Count - 1
|
||||
End If
|
||||
m_ListOfCut_X.RemoveAt(CurrIndexListSelected)
|
||||
ElseIf Cut_YTgBtn.IsChecked Then
|
||||
If CurrIndexListSelected < 0 Or CurrIndexListSelected > m_ListOfCut_Y.Count - 1 Then
|
||||
CurrIndexListSelected = m_ListOfCut_Y.Count - 1
|
||||
End If
|
||||
m_ListOfCut_Y.RemoveAt(CurrIndexListSelected)
|
||||
End If
|
||||
CustomGridLstBx.UpdateLayout()
|
||||
End Sub
|
||||
|
||||
Public Sub Update_Click() Handles UpdateBtn.Click
|
||||
CreateGridCut()
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
#End Region ' Custom Grid
|
||||
|
||||
Private Sub SimulBtn_Click(sender As Object, e As RoutedEventArgs) Handles SimulBtn.Click
|
||||
' Verifico ci sia un taglio valido
|
||||
If Not m_bCutOk Then Return
|
||||
@@ -631,6 +755,13 @@ Public Class GridCut
|
||||
End Function
|
||||
|
||||
Private Function MultiplyCut(nLayerId As Integer) As Boolean
|
||||
If m_bCustomGrid Then
|
||||
Return MultiplyCut_1(nLayerId)
|
||||
End If
|
||||
Return MultiplyCut_0(nLayerId)
|
||||
End Function
|
||||
|
||||
Private Function MultiplyCut_0(nLayerId As Integer) As Boolean
|
||||
' Recupero lo spessore del taglio della lama o del waterjet correntemente attiva
|
||||
Dim nType As Integer = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
|
||||
@@ -714,6 +845,116 @@ Public Class GridCut
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function MultiplyCut_1(nLayerId As Integer) As Boolean
|
||||
' Recupero lo spessore del taglio della lama o del waterjet correntemente attiva
|
||||
Dim nType As Integer = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nType)
|
||||
Dim dThick As Double = 0
|
||||
EgtTdbGetCurrToolParam(If(nType = MCH_TY.SAW_STD, MCH_TP.THICK, MCH_TP.DIAM), dThick)
|
||||
' Ricalcolo lo spessore in base all'inclinazione
|
||||
dThick = dThick / Math.Cos(m_dAngV * Math.PI / 180)
|
||||
' Imposto angolo di rotazione a seconda del lato dei tagli paralleli
|
||||
Dim dRotAngOX As Double = If(SideChBx.IsChecked(), -90, 90)
|
||||
|
||||
' Recupero dati da interfaccia
|
||||
Dim dDimPzX As Double = m_ListOfCut_X(0).dInteraxis
|
||||
Dim nNumPzX As Integer = m_ListOfCut_X(0).nNumber
|
||||
|
||||
Dim dDimPzY As Double = m_ListOfCut_Y(0).dInteraxis
|
||||
Dim nNumPzY As Integer = m_ListOfCut_Y(0).nNumber
|
||||
|
||||
Dim TotLenX As Double = 0
|
||||
For Ind_X As Integer = 0 To m_ListOfCut_X.Count - 1
|
||||
TotLenX = TotLenX + (m_ListOfCut_X(Ind_X).dInteraxis + dThick) * m_ListOfCut_X(Ind_X).nNumber
|
||||
Next
|
||||
|
||||
Dim TotLenY As Double = 0
|
||||
For Ind_Y As Integer = 0 To m_ListOfCut_Y.Count - 1
|
||||
TotLenY = TotLenY + (m_ListOfCut_Y(Ind_Y).dInteraxis + dThick) * m_ListOfCut_Y(Ind_Y).nNumber
|
||||
Next
|
||||
|
||||
' Definisco vettore di spostamento
|
||||
Dim vtDelta As Vector3d
|
||||
' Calcolo primo taglio parallelo
|
||||
Dim ptStart As Point3d = m_ptTipP1
|
||||
ptStart.z = 0
|
||||
If dDimPzY <> 0 And nNumPzY > 0 And dDimPzX <> 0 And nNumPzX > 0 Then
|
||||
' -------------- TAGLI PARALLELI ASSE Y --------------
|
||||
Dim dLenX As Double = dThick + TotLenX
|
||||
Dim nCutParaId = EgtCreateLinePDL(nLayerId, ptStart, m_dAngO, dLenX + 0.1)
|
||||
|
||||
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
' Recupero spessore lama corrente
|
||||
Dim sSawing As String = m_MainWindow.m_CurrentMachine.sCurrSawing
|
||||
If m_bSawTh And Not String.IsNullOrEmpty(sSawing) Then
|
||||
EgtOffsetCurve(nCutParaId, -dThick, OFF_TYPE.EXTEND)
|
||||
End If
|
||||
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
|
||||
' Imposto affondamento e angolo di fianco sul taglio
|
||||
EgtSetInfo(nCutParaId, INFO_DEPTH, m_dDepth)
|
||||
EgtSetInfo(nCutParaId, INFO_SIDE_ANGLE, m_dAngV)
|
||||
|
||||
For IndexList_Y As Integer = 0 To m_ListOfCut_Y.Count - 1
|
||||
Dim nCut2Id As Integer = GDB_ID.NULL
|
||||
dDimPzY = m_ListOfCut_Y(IndexList_Y).dInteraxis
|
||||
nNumPzY = m_ListOfCut_Y(IndexList_Y).nNumber
|
||||
' Calcolo vettore di spostamento
|
||||
vtDelta = Vector3d.FromPolar((dDimPzY + dThick), m_dAngO)
|
||||
' Ruoto il vettore di traslazione
|
||||
vtDelta.Rotate(Vector3d.Z_AX, dRotAngOX)
|
||||
For Index As Integer = 1 To nNumPzY
|
||||
Dim vtPerpMove As Vector3d = Index * vtDelta
|
||||
' Creo copie
|
||||
nCut2Id = EgtCopyGlob(nCutParaId, nLayerId)
|
||||
EgtMove(nCut2Id, vtPerpMove, GDB_RT.GLOB)
|
||||
Next
|
||||
nCutParaId = nCut2Id
|
||||
Next
|
||||
|
||||
' -------------- TAGLI PARALLELI ASSE X --------------
|
||||
' Calcolo primo taglio perpendicolare
|
||||
Dim dLenY As Double = dThick + TotLenY
|
||||
' Arretro il punto di partenza di uno spessore lama
|
||||
Dim vtDeltaPos As Vector3d = Vector3d.FromPolar(dThick + 0.1, m_dAngO - 90)
|
||||
Dim nCutPerpId = EgtCreateLinePDL(nLayerId, ptStart + vtDeltaPos, m_dAngO + 90, dLenY + 0.2)
|
||||
|
||||
' --- INIZIO GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
If m_bSawTh And Not String.IsNullOrEmpty(sSawing) Then
|
||||
EgtOffsetCurve(nCutPerpId, -dThick, OFF_TYPE.EXTEND)
|
||||
End If
|
||||
' --- FINE GESTIONE SPECIALE --- per macchina sinistrorsa
|
||||
|
||||
' Specchio se è attivo il flag che cambia lato di disegno
|
||||
If SideChBx.IsChecked() Then
|
||||
Dim vtRot As Vector3d = Vector3d.FromPolar(1, m_dAngO + 90)
|
||||
EgtMirror(nCutPerpId, ptStart + Vector3d.FromPolar(dThick / 2, m_dAngO - 90), vtRot, GDB_RT.GLOB)
|
||||
EgtInvertCurve(nCutPerpId)
|
||||
End If
|
||||
|
||||
' Imposto affondamento e angolo di fianco sul taglio
|
||||
EgtSetInfo(nCutPerpId, INFO_DEPTH, m_dDepth)
|
||||
EgtSetInfo(nCutPerpId, INFO_SIDE_ANGLE, m_dAngV)
|
||||
|
||||
For IndexList_X As Integer = 0 To m_ListOfCut_X.Count - 1
|
||||
Dim nCut3Id As Integer = GDB_ID.NULL
|
||||
dDimPzX = m_ListOfCut_X(IndexList_X).dInteraxis
|
||||
nNumPzX = m_ListOfCut_X(IndexList_X).nNumber
|
||||
' Calcolo secondo vettore di spostamento
|
||||
vtDelta = Vector3d.FromPolar((dDimPzX + dThick), m_dAngO)
|
||||
For Index As Integer = 1 To nNumPzX
|
||||
Dim vtPerpMove As Vector3d = vtDelta * Index
|
||||
' Creo copie
|
||||
nCut3Id = EgtCopyGlob(nCutPerpId, nLayerId)
|
||||
EgtMove(nCut3Id, vtPerpMove, GDB_RT.GLOB)
|
||||
Next
|
||||
nCutPerpId = nCut3Id
|
||||
Next
|
||||
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function CreateCross(nLayerId As Integer, ptP As Point3d) As Boolean
|
||||
ptP += New Vector3d(0, 0, 0.15)
|
||||
' Aggiungo crocette
|
||||
@@ -773,4 +1014,56 @@ Public Class GridCut
|
||||
Return True
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Cut_Axis
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
' Numero di tagli con questo interasse
|
||||
Private m_nNumber As Integer = 0
|
||||
Public Property sNumber As String
|
||||
Get
|
||||
Return m_nNumber.ToString
|
||||
End Get
|
||||
Set(value As String)
|
||||
If IsNumeric(value) Then
|
||||
m_nNumber = CInt(value)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property nNumber As Double
|
||||
Get
|
||||
Return m_nNumber
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Distanza dal taglio precedente
|
||||
Private m_dInteraxis As Double = 0.0
|
||||
Public Property sInteraxis As String
|
||||
Get
|
||||
Return LenToString(m_dInteraxis, 2)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim PrevValue As Double = m_dInteraxis
|
||||
If Not StringToLen(value, m_dInteraxis) Then m_dInteraxis = PrevValue
|
||||
End Set
|
||||
End Property
|
||||
Public ReadOnly Property dInteraxis As Double
|
||||
Get
|
||||
Return m_dInteraxis
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property UpdateSub As Boolean
|
||||
Get
|
||||
m_MainWindow.m_DirectCutPageUC.m_ControlsDirectCutUC.m_GridCut.Update_Click()
|
||||
Return True
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(nNumb As Integer, dInter As Double)
|
||||
m_nNumber = nNumb
|
||||
m_dInteraxis = dInter
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.7.6.1")>
|
||||
<Assembly: AssemblyFileVersion("2.7.6.1")>
|
||||
<Assembly: AssemblyVersion("2.7.6.2")>
|
||||
<Assembly: AssemblyFileVersion("2.7.6.2")>
|
||||
|
||||
+14
-2
@@ -1651,6 +1651,11 @@ Namespace Num
|
||||
|
||||
n_ret = objDGeneralFunctions.ActivateProgram(l_glbPartProgramNumber, 0)
|
||||
|
||||
If n_ret <> 0 Then
|
||||
EgtOutLog("Error: ActivateProgram error : " + n_ret.ToString())
|
||||
Return n_ret
|
||||
End If
|
||||
|
||||
Return n_ret
|
||||
|
||||
End Function
|
||||
@@ -1698,17 +1703,24 @@ Namespace Num
|
||||
Dim ngroup0 As Short = 0
|
||||
Dim nTimeOut As Integer = 0
|
||||
bSetModeDone = False
|
||||
|
||||
' ' Per prima versione FLEXIUM (3.5.040 - 2013)
|
||||
' EgtOutLog("Scrittura modalità (" & nmode.ToString & ")")
|
||||
' objDGeneralFunctions.WriteCncMode(nmode, ngroup0)
|
||||
' Return 0
|
||||
|
||||
' Per ultime versioni FLEXIUM
|
||||
objDGeneralFunctions.WriteCncMode2(nHandle, nmode, ngroup0)
|
||||
While Not bSetModeDone And nTimeOut < SHORTSLEEPCOUNT
|
||||
System.Threading.Thread.Sleep(SHORTSLEEPTIME)
|
||||
nTimeOut += 1
|
||||
End While
|
||||
If Not bSetModeDone Then
|
||||
EgtOutLog("Errore cambio modalit� in MDI: " & TIMEOUT)
|
||||
EgtOutLog("Errore cambio modalità in MDI: " & TIMEOUT)
|
||||
Return TIMEOUT 'Errore di timeout
|
||||
End If
|
||||
If nSetModeResult <> 0 Then
|
||||
EgtOutLog("Errore 2 cambio modalit� in MDI: " & nSetModeResult)
|
||||
EgtOutLog("Errore 2 cambio modalità in MDI: " & nSetModeResult)
|
||||
End If
|
||||
Return nSetModeResult
|
||||
|
||||
|
||||
Reference in New Issue
Block a user