OmagCUT :
- Aggiunta modalità FastGrid che permette di avere delle dimensioni preimpostate di rettangoli da creare in automatico.
This commit is contained in:
+75
-48
@@ -15,6 +15,7 @@ Public Class CadCutPageUC
|
||||
Friend m_MoveRawPartPage As MoveRawPartPage
|
||||
Friend m_CSVPage As CSVPage
|
||||
Friend m_ProjectMgr As ProjectMgrUC
|
||||
Friend m_FastGridSlabManager As FastGridSlabManager
|
||||
|
||||
' Variabile che indica la modalità
|
||||
Friend m_CadCutMode As CadCutModes
|
||||
@@ -24,6 +25,7 @@ Public Class CadCutPageUC
|
||||
Nest
|
||||
Split
|
||||
MoveRawPart
|
||||
FastGrid
|
||||
End Enum
|
||||
|
||||
Private Sub CadCutPage_Initialized(sender As Object, e As EventArgs)
|
||||
@@ -34,6 +36,7 @@ Public Class CadCutPageUC
|
||||
m_MoveRawPartPage = New MoveRawPartPage
|
||||
m_CSVPage = New CSVPage
|
||||
m_ProjectMgr = New ProjectMgrUC
|
||||
m_FastGridSlabManager = New FastGridSlabManager
|
||||
|
||||
' Posizionamento nella griglia delle Page UserControl
|
||||
m_NestPage.SetValue(Grid.RowSpanProperty, 3)
|
||||
@@ -46,6 +49,8 @@ Public Class CadCutPageUC
|
||||
m_CSVPage.SetValue(Grid.ColumnSpanProperty, 3)
|
||||
m_ProjectMgr.SetValue(Grid.RowProperty, 2)
|
||||
m_ProjectMgr.SetValue(Grid.ColumnProperty, 1)
|
||||
m_FastGridSlabManager.SetValue(Grid.RowSpanProperty, 3)
|
||||
m_FastGridSlabManager.SetValue(Grid.ColumnSpanProperty, 2)
|
||||
|
||||
' Assegno UC a questa pagina
|
||||
CadCutPageGrid.Children.Add(m_ProjectMgr)
|
||||
@@ -74,9 +79,19 @@ Public Class CadCutPageUC
|
||||
Else
|
||||
m_ProjectMgr.RegisterBtn.Visibility = Windows.Visibility.Hidden
|
||||
End If
|
||||
' Seleziono UserControl di apertura
|
||||
CadCutPageGrid.Children.Add(m_NestPage)
|
||||
m_CadCutMode = CadCutModes.Nest
|
||||
' Leggo se la modalità fastgrid è attiva
|
||||
If GetPrivateProfileInt(S_FASTGRID, K_FG_ENABLE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
||||
GetPrivateProfileInt(S_FASTGRID, K_FG_ACTIVE, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||
' Seleziono UserControl di apertura
|
||||
CadCutPageGrid.Children.Add(m_FastGridSlabManager)
|
||||
m_CadCutMode = CadCutModes.FastGrid
|
||||
Else
|
||||
' Seleziono UserControl di apertura
|
||||
CadCutPageGrid.Children.Add(m_NestPage)
|
||||
m_CadCutMode = CadCutModes.Nest
|
||||
DrawBtn.IsEnabled = True
|
||||
ImportBtn.IsEnabled = True
|
||||
End If
|
||||
SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Split.png", UriKind.Relative))
|
||||
' Se macchina fotografica abilitata
|
||||
If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_PHOTO) Then
|
||||
@@ -147,6 +162,8 @@ Public Class CadCutPageUC
|
||||
Select Case m_CadCutMode
|
||||
Case CadCutModes.Nest
|
||||
CadCutPageGrid.Children.Remove(m_NestPage)
|
||||
Case CadCutModes.FastGrid
|
||||
CadCutPageGrid.Children.Remove(m_FastGridSlabManager)
|
||||
Case CadCutModes.Split
|
||||
CadCutPageGrid.Children.Remove(m_SplitPage)
|
||||
Case CadCutModes.MoveRawPart
|
||||
@@ -157,51 +174,61 @@ Public Class CadCutPageUC
|
||||
Private Sub SplitBtn_Click(sender As Object, e As RoutedEventArgs) Handles SplitBtn.Click
|
||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
Select Case m_CadCutMode
|
||||
Case CadCutModes.Nest
|
||||
' Passo alla pagina Split
|
||||
SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Nest.png", UriKind.Relative))
|
||||
CadCutPageGrid.Children.Remove(m_NestPage)
|
||||
CadCutPageGrid.Children.Add(m_SplitPage)
|
||||
m_CadCutMode = CadCutModes.Split
|
||||
' Carico eventuale manipolatore pezzi
|
||||
EgtDisableModified()
|
||||
LoadVacuumCups()
|
||||
EgtEnableModified()
|
||||
' Se nessuna modifica, entro in modalità visualizzazione
|
||||
If m_CurrProjPage.GetOrderMachiningFlag() Then
|
||||
' Imposto flag di visualizzazione
|
||||
m_SplitPage.m_bShow = True
|
||||
' altrimenti riparto da capo
|
||||
Else
|
||||
' Cancello tutto
|
||||
EraseMachinings(GDB_ID.NULL)
|
||||
' Reinserisco tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
AddMachinings(GDB_ID.NULL, nWarn)
|
||||
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
|
||||
' Imposto flag di modifica
|
||||
m_SplitPage.m_bShow = False
|
||||
End If
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
Case CadCutModes.Split
|
||||
' Cancello eventuale manipolatore pezzi
|
||||
EgtDisableModified()
|
||||
RemoveVacuumCups()
|
||||
EgtEnableModified()
|
||||
' Passo alla pagina Nest
|
||||
SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Split.png", UriKind.Relative))
|
||||
CadCutPageGrid.Children.Remove(m_SplitPage)
|
||||
CadCutPageGrid.Children.Add(m_NestPage)
|
||||
m_CadCutMode = CadCutModes.Nest
|
||||
Case CadCutModes.MoveRawPart
|
||||
' consentito solo se in spostamento finale pezzi
|
||||
If Not m_SplitPage.m_bOnAuxTab Then Return
|
||||
' Passo alla pagina Nest
|
||||
SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Split.png", UriKind.Relative))
|
||||
CadCutPageGrid.Children.Remove(m_MoveRawPartPage)
|
||||
CadCutPageGrid.Children.Add(m_NestPage)
|
||||
m_CadCutMode = CadCutModes.Nest
|
||||
Case CadCutModes.Nest, CadCutModes.FastGrid
|
||||
' Passo alla pagina Split
|
||||
SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Nest.png", UriKind.Relative))
|
||||
If m_CadCutMode = CadCutModes.Nest Then
|
||||
CadCutPageGrid.Children.Remove(m_NestPage)
|
||||
Else
|
||||
CadCutPageGrid.Children.Remove(m_FastGridSlabManager)
|
||||
End If
|
||||
CadCutPageGrid.Children.Add(m_SplitPage)
|
||||
m_CadCutMode = CadCutModes.Split
|
||||
' Carico eventuale manipolatore pezzi
|
||||
EgtDisableModified()
|
||||
LoadVacuumCups()
|
||||
EgtEnableModified()
|
||||
' Se nessuna modifica, entro in modalità visualizzazione
|
||||
If m_CurrProjPage.GetOrderMachiningFlag() Then
|
||||
' Imposto flag di visualizzazione
|
||||
m_SplitPage.m_bShow = True
|
||||
' altrimenti riparto da capo
|
||||
Else
|
||||
' Cancello tutto
|
||||
EraseMachinings(GDB_ID.NULL)
|
||||
' Reinserisco tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
AddMachinings(GDB_ID.NULL, nWarn)
|
||||
If nWarn = 1 Then m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SPLITPAGEUC + 11)) ' Lama troppo grande per utilizzo ventosa
|
||||
' Imposto flag di modifica
|
||||
m_SplitPage.m_bShow = False
|
||||
End If
|
||||
' Aggiorno visualizzazione
|
||||
EgtDraw()
|
||||
Case CadCutModes.Split
|
||||
' Cancello eventuale manipolatore pezzi
|
||||
EgtDisableModified()
|
||||
RemoveVacuumCups()
|
||||
EgtEnableModified()
|
||||
' Passo alla pagina Nest
|
||||
SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Split.png", UriKind.Relative))
|
||||
CadCutPageGrid.Children.Remove(m_SplitPage)
|
||||
If GetPrivateProfileInt(S_FASTGRID, K_FG_ENABLE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
||||
GetPrivateProfileInt(S_FASTGRID, K_FG_ACTIVE, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||
CadCutPageGrid.Children.Add(m_FastGridSlabManager)
|
||||
m_CadCutMode = CadCutModes.FastGrid
|
||||
Else
|
||||
CadCutPageGrid.Children.Add(m_NestPage)
|
||||
m_CadCutMode = CadCutModes.Nest
|
||||
End If
|
||||
Case CadCutModes.MoveRawPart
|
||||
' consentito solo se in spostamento finale pezzi
|
||||
If Not m_SplitPage.m_bOnAuxTab Then Return
|
||||
' Passo alla pagina Nest
|
||||
SplitImage.Source = New System.Windows.Media.Imaging.BitmapImage(New Uri("/Resources/Split.png", UriKind.Relative))
|
||||
CadCutPageGrid.Children.Remove(m_MoveRawPartPage)
|
||||
CadCutPageGrid.Children.Add(m_NestPage)
|
||||
m_CadCutMode = CadCutModes.Nest
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -134,6 +134,10 @@ Module ConstGen
|
||||
Public Const INFO_PROJINDEX As String = "ProjIndex"
|
||||
' Info per materiale progetto
|
||||
Public Const INFO_PROJMAT As String = "ProjMat"
|
||||
' Info per codice ordine progetto
|
||||
Public Const INFO_PROJORD As String = "ProjOrd"
|
||||
' Info per flag ultima lastra dell'ordine
|
||||
Public Const INFO_LASTSLAB As String = "LastSlab"
|
||||
' Info per programma di linea inviato
|
||||
Public Const INFO_NCPROGSENT As String = "NcProgSent"
|
||||
' Info per riavvio programma da fase successiva alla prima
|
||||
|
||||
@@ -185,4 +185,13 @@ Module ConstIni
|
||||
Public Const K_VEINMA_ENABLE As String = "Enable"
|
||||
Public Const K_VEINMA_PLACE As String = "WinPlace"
|
||||
|
||||
Public Const S_FASTGRID As String = "FastGrid"
|
||||
Public Const K_FG_ENABLE As String = "FGEnable"
|
||||
Public Const K_FG_ACTIVE As String = "FGActive"
|
||||
Public Const K_FG_ORDER As String = "Order"
|
||||
Public Const K_FG_CURRSLAB As String = "CurrSlab"
|
||||
Public Const K_FG_TOTSLAB As String = "TotSlab"
|
||||
Public Const K_FG_PIECETYPE As String = "PieceType"
|
||||
|
||||
|
||||
End Module
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
Public Const MSG_DRAWPAGEUC As Integer = MSG_OMAGCUT + 380
|
||||
Public Const MSG_COMPONENTPAGEUC As Integer = MSG_OMAGCUT + 400
|
||||
Public Const MSG_IMPORTPAGEUC As Integer = MSG_OMAGCUT + 450
|
||||
Public Const MSG_FASTGRIDPAGEUC As Integer = MSG_OMAGCUT + 480
|
||||
Public Const MSG_OPENPAGEUC As Integer = MSG_OMAGCUT + 490
|
||||
Public Const MSG_RAWPARTPAGEUC As Integer = MSG_OMAGCUT + 500
|
||||
Public Const MSG_CHOOSEMACHININGPAGEUC As Integer = MSG_OMAGCUT + 535
|
||||
|
||||
@@ -651,6 +651,31 @@ Public Class CurrentProjectPageUC
|
||||
Return EgtSetInfo(nMarkId, INFO_PROJINDEX, Math.Abs(m_nCurrProj))
|
||||
End Function
|
||||
|
||||
Friend Function SetProjectOrder(sOrder As String) As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtSetInfo(nMarkId, INFO_PROJORD, sOrder)
|
||||
End Function
|
||||
|
||||
Friend Function GetProjectOrder(ByRef sOrder As String) As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtGetInfo(nMarkId, INFO_PROJORD, sOrder)
|
||||
End Function
|
||||
|
||||
Friend Function SetLastSlab(bIsLastSlab As Boolean) As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtSetInfo(nMarkId, INFO_LASTSLAB, bIsLastSlab)
|
||||
End Function
|
||||
|
||||
Friend Function GetLastSlab(ByRef bIsLastSlab As Boolean) As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtGetInfo(nMarkId, INFO_LASTSLAB, bIsLastSlab)
|
||||
End Function
|
||||
|
||||
Friend Function ResetLastSlab() As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtSetInfo(nMarkId, INFO_LASTSLAB, "")
|
||||
End Function
|
||||
|
||||
Friend Function SetProjectMaterial() As Boolean
|
||||
Dim nMarkId As Integer = AddProjectMark()
|
||||
Return EgtSetInfo(nMarkId, INFO_PROJMAT, m_MainWindow.m_CurrentMachine.CurrMat.sName)
|
||||
|
||||
+2
-2
@@ -364,11 +364,11 @@
|
||||
<Setter Property="Background" TargetName="border" Value="#FFBCDDEE"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
|
||||
</Trigger>-->
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<!--<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Background" TargetName="border" Value="#FFF4F4F4"/>
|
||||
<Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
|
||||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="#FF838383"/>
|
||||
</Trigger>
|
||||
</Trigger>-->
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
<UserControl x:Class="FastGridSlabManager"
|
||||
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="853.3" d:DesignWidth="1280">
|
||||
|
||||
|
||||
<!-- Definizione della NestPage -->
|
||||
<Grid Name="FastGridSlabGrid" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="12*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="8*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<Grid Grid.RowSpan="3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="2.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid Name="ParametersGrd" Grid.Row="1" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="OrderTxBl"
|
||||
Grid.Row="0" Grid.Column="0"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="OrderTxBx"
|
||||
Grid.Row="0" Grid.Column="1"
|
||||
Margin="13,0,6,0"
|
||||
Style="{StaticResource OmagCut_KeyboardTextBox}"/>
|
||||
|
||||
<TextBlock Name="CurrSlabTxBl"
|
||||
Grid.Row="1" Grid.Column="0"
|
||||
Style="{StaticResource OmagCut_CurrProjSummeryTextBlock}"/>
|
||||
<EgtWPFLib:EgtTextBox Name="CurrSlabTxBx"
|
||||
Grid.Row="1" Grid.Column="1"
|
||||
Margin="13,0,6,0"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
<GroupBox Name="PieceTypeGpBx"
|
||||
Grid.Row="2"
|
||||
Style="{StaticResource OmagCut_GroupBox}">
|
||||
<UniformGrid Rows="2">
|
||||
|
||||
<UniformGrid Columns="3" >
|
||||
<ToggleButton Name="Type1Btn"
|
||||
Style="{StaticResource OmagCut_DisabledYellowToggleButton}"/>
|
||||
<ToggleButton Name="Type2Btn"
|
||||
Style="{StaticResource OmagCut_DisabledYellowToggleButton}" />
|
||||
<ToggleButton Name="Type3Btn"
|
||||
Style="{StaticResource OmagCut_DisabledYellowToggleButton}" />
|
||||
</UniformGrid>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ToggleButton Name="Type4Btn"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource OmagCut_DisabledYellowToggleButton}"/>
|
||||
<ToggleButton Name="Type5Btn"
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource OmagCut_DisabledYellowToggleButton}"/>
|
||||
</Grid>
|
||||
|
||||
</UniformGrid>
|
||||
</GroupBox>
|
||||
|
||||
<Button Name="ConfirmOrderBtn"
|
||||
Grid.Row="3"
|
||||
Style="{StaticResource OmagCut_YellowTextButton}" />
|
||||
|
||||
<UniformGrid Grid.Row="4" Columns="2" >
|
||||
<Button Name="InsertPiecesBtn"
|
||||
Style="{StaticResource OmagCut_YellowTextButton}" />
|
||||
<ToggleButton Name="LastSlabBtn"
|
||||
Style="{StaticResource OmagCut_YellowToggleButton}" />
|
||||
</UniformGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,272 @@
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class FastGridSlabManager
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
Private WithEvents m_CurrProjPage As CurrentProjectPageUC
|
||||
|
||||
' Flag tipologia
|
||||
Private m_bFull As Boolean = False
|
||||
' Flag prima apertura
|
||||
Private m_bFirst As Boolean = True
|
||||
' Dati ordine
|
||||
Private m_nCurrSlab As Integer = 0
|
||||
Private m_nPieceType As Integer = 0
|
||||
Private m_PieceDimensionsX(4) As Integer
|
||||
Private m_PieceDimensionsY(4) As Integer
|
||||
Private m_sCompoDir As String = String.Empty
|
||||
'' Dati del grezzo
|
||||
'Private m_nRawId As Integer = GDB_ID.NULL
|
||||
'Private m_ptRawMin As Point3d
|
||||
'Private m_ptRawMax As Point3d
|
||||
|
||||
Private Sub NestPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
' Imposto i messaggi letti dal file dei messaggi
|
||||
OrderTxBl.Text = EgtMsg(MSG_FASTGRIDPAGEUC) 'Order name - Nome ordine
|
||||
CurrSlabTxBl.Text = EgtMsg(MSG_FASTGRIDPAGEUC + 1) 'Curr slab - Lastra corrente
|
||||
PieceTypeGpBx.Header = EgtMsg(MSG_FASTGRIDPAGEUC + 3) 'Piece type - Tipo pezzo
|
||||
ConfirmOrderBtn.Content = EgtMsg(MSG_FASTGRIDPAGEUC + 5) 'Confirm order - Conferma ordine
|
||||
InsertPiecesBtn.Content = EgtMsg(MSG_FASTGRIDPAGEUC + 4) 'Insert pieces - Inserisci pezzi
|
||||
LastSlabBtn.Content = EgtMsg(MSG_FASTGRIDPAGEUC + 2) 'Last slab - Ultima lastra
|
||||
|
||||
' Determino se versione semplificata
|
||||
m_bFull = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.AUTO_NESTING) And
|
||||
(GetPrivateProfileInt(S_CSV, K_FULL, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
' Leggo dati da ini
|
||||
GetPrivateProfileString(S_FASTGRID, K_FG_ORDER, "", OrderTxBx.Text, m_MainWindow.GetIniFile())
|
||||
m_nCurrSlab = GetPrivateProfileInt(S_FASTGRID, K_FG_CURRSLAB, 0, m_MainWindow.GetIniFile())
|
||||
m_nPieceType = GetPrivateProfileInt(S_FASTGRID, K_FG_PIECETYPE, 0, m_MainWindow.GetIniFile())
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
||||
' Impostazioni
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
' Se prima esecuzione
|
||||
If m_bFirst Then
|
||||
' Leggo direttorio componenti
|
||||
GetPrivateProfileString(S_COMPO, K_COMPODIR, "", m_sCompoDir, m_MainWindow.GetIniFile())
|
||||
m_bFirst = False
|
||||
End If
|
||||
' recupero dimensioni del grezzo e kerf
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.LoadParams()
|
||||
' Recupero dimensioni pezzi da ini
|
||||
For Index = 1 To 5
|
||||
GetPieceDimensions(Index)
|
||||
Next
|
||||
' Ne imposto i valori
|
||||
CurrSlabTxBx.Text = m_nCurrSlab
|
||||
Type1Btn.IsChecked = False
|
||||
Type2Btn.IsChecked = False
|
||||
Type3Btn.IsChecked = False
|
||||
Type4Btn.IsChecked = False
|
||||
Type5Btn.IsChecked = False
|
||||
Select Case m_nPieceType
|
||||
Case 1
|
||||
Type1Btn.IsChecked = True
|
||||
Case 2
|
||||
Type2Btn.IsChecked = True
|
||||
Case 3
|
||||
Type3Btn.IsChecked = True
|
||||
Case 4
|
||||
Type4Btn.IsChecked = True
|
||||
Case 5
|
||||
Type5Btn.IsChecked = True
|
||||
End Select
|
||||
' Verifico se c'e' un ordine in corso
|
||||
CurrSlabTxBx.IsEnabled = False
|
||||
If m_nCurrSlab > 0 Then
|
||||
OrderTxBx.IsEnabled = False
|
||||
PieceTypeGpBx.IsEnabled = False
|
||||
ConfirmOrderBtn.IsEnabled = False
|
||||
InsertPiecesBtn.IsEnabled = True
|
||||
LastSlabBtn.IsEnabled = True
|
||||
Else
|
||||
OrderTxBx.IsEnabled = True
|
||||
PieceTypeGpBx.IsEnabled = True
|
||||
ConfirmOrderBtn.IsEnabled = True
|
||||
InsertPiecesBtn.IsEnabled = False
|
||||
LastSlabBtn.IsEnabled = False
|
||||
End If
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
Private Sub InsertPiecesBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPiecesBtn.Click
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetProjectOrder(OrderTxBx.Text)
|
||||
' Lancio l'inserimento dei pezzi
|
||||
ExecInsert()
|
||||
' Aggiorno visualizzazione
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
Private Sub LastSlabBtn_Click(sender As Object, e As RoutedEventArgs) Handles LastSlabBtn.Click
|
||||
CheckLastSlab()
|
||||
End Sub
|
||||
|
||||
Friend Sub CheckLastSlab()
|
||||
If LastSlabBtn.IsChecked Then
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetLastSlab(True)
|
||||
Else
|
||||
m_MainWindow.m_CurrentProjectPageUC.SetLastSlab(False)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function ExecInsert() As Boolean
|
||||
' Creo o svuoto gruppo temporaneo per i pezzi
|
||||
Dim nIpGrp As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, "FASTGRID")
|
||||
If nIpGrp = GDB_ID.NULL Then
|
||||
nIpGrp = EgtCreateGroup(GDB_ID.ROOT)
|
||||
If nIpGrp = GDB_ID.NULL Then Return False
|
||||
EgtSetName(nIpGrp, "FASTGRID")
|
||||
Else
|
||||
EgtEmptyGroup(nIpGrp)
|
||||
End If
|
||||
EgtSetLevel(nIpGrp, GDB_LV.TEMP)
|
||||
EgtSetStatus(nIpGrp, GDB_ST.OFF)
|
||||
' Carico lua per creare rettangoli
|
||||
Dim sLuaPath = m_sCompoDir & "\Rettangolo.lua"
|
||||
If Not EgtLuaExecFile(sLuaPath) Then Return False
|
||||
' Inserisco nel gruppo un nuovo componente per ogni pezzo da inserire
|
||||
Dim PartIdList As New List(Of Integer)
|
||||
For i As Integer = 1 To 100
|
||||
EgtLuaSetGlobNumVar("CMP.V1", m_PieceDimensionsX(m_nPieceType - 1))
|
||||
EgtLuaSetGlobNumVar("CMP.V2", m_PieceDimensionsY(m_nPieceType - 1))
|
||||
' Esecuzione componente
|
||||
If Not EgtLuaExecLine("CMP_Draw(false)") Then Continue For
|
||||
' Recupero Id del nuovo componente
|
||||
Dim nId As Integer = EgtGetLastPart()
|
||||
If nId = GDB_ID.NULL Then Continue For
|
||||
PartIdList.Add(nId)
|
||||
' Muovo la regione in Z per evitare problemi in visualizzazione
|
||||
Dim nRegId = EgtGetFirstNameInGroup(nId, NAME_REGION)
|
||||
EgtMove(nRegId, New Vector3d(0, 0, DELTAZ_REG), GDB_RT.GLOB)
|
||||
' Aggiusto per lavorazioni
|
||||
AdjustFlatPart(nId)
|
||||
' Lo sposto nel gruppo speciale
|
||||
EgtRelocate(nId, nIpGrp)
|
||||
Next
|
||||
EgtLuaResetGlobVar("CMP")
|
||||
EgtLuaResetGlobVar("CMP_Draw")
|
||||
' Provo ad inserire i pezzi
|
||||
For i As Integer = 1 To PartIdList.Count
|
||||
If Not NestOnePart(PartIdList(i - 1)) Then Exit For
|
||||
Next
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function NestOnePart(nId As Integer) As Boolean
|
||||
' Inserisco una copia del pezzo nel grezzo
|
||||
Dim nId2 As Integer = EgtCopyGlob(nId, GDB_ID.ROOT)
|
||||
If Not m_MainWindow.m_CadCutPageUC.m_NestPage.InsertOnePart(nId2) Then
|
||||
EgtErase(nId2)
|
||||
Return False
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Sub OrderTxBx_EgtClosed(sender As Object, e As EventArgs) Handles OrderTxBx.EgtClosed
|
||||
WritePrivateProfileString(S_FASTGRID, K_FG_ORDER, OrderTxBx.Text, m_MainWindow.GetIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub PiecesTypeBtn_Click(sender As Object, e As RoutedEventArgs) Handles Type1Btn.Click, Type2Btn.Click, Type3Btn.Click, Type4Btn.Click, Type5Btn.Click
|
||||
If sender Is Type1Btn Then
|
||||
m_nPieceType = 1
|
||||
Type1Btn.IsChecked = True
|
||||
Type2Btn.IsChecked = False
|
||||
Type3Btn.IsChecked = False
|
||||
Type4Btn.IsChecked = False
|
||||
Type5Btn.IsChecked = False
|
||||
ElseIf sender Is Type2Btn Then
|
||||
m_nPieceType = 2
|
||||
Type1Btn.IsChecked = False
|
||||
Type2Btn.IsChecked = True
|
||||
Type3Btn.IsChecked = False
|
||||
Type4Btn.IsChecked = False
|
||||
Type5Btn.IsChecked = False
|
||||
ElseIf sender Is Type3Btn Then
|
||||
m_nPieceType = 3
|
||||
Type1Btn.IsChecked = False
|
||||
Type2Btn.IsChecked = False
|
||||
Type3Btn.IsChecked = True
|
||||
Type4Btn.IsChecked = False
|
||||
Type5Btn.IsChecked = False
|
||||
ElseIf sender Is Type4Btn Then
|
||||
m_nPieceType = 4
|
||||
Type1Btn.IsChecked = False
|
||||
Type2Btn.IsChecked = False
|
||||
Type3Btn.IsChecked = False
|
||||
Type4Btn.IsChecked = True
|
||||
Type5Btn.IsChecked = False
|
||||
ElseIf sender Is Type5Btn Then
|
||||
m_nPieceType = 5
|
||||
Type1Btn.IsChecked = False
|
||||
Type2Btn.IsChecked = False
|
||||
Type3Btn.IsChecked = False
|
||||
Type4Btn.IsChecked = False
|
||||
Type5Btn.IsChecked = True
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
WritePrivateProfileString(S_FASTGRID, K_FG_PIECETYPE, m_nPieceType, m_MainWindow.GetIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub ConfirmOrderBtn_Click(sender As Object, e As RoutedEventArgs) Handles ConfirmOrderBtn.Click
|
||||
If Not String.IsNullOrEmpty(OrderTxBx.Text) And m_nPieceType > 0 And m_nPieceType <= 5 Then
|
||||
m_nCurrSlab = 1
|
||||
CurrSlabTxBx.Text = 1
|
||||
WritePrivateProfileString(S_FASTGRID, K_FG_CURRSLAB, m_nCurrSlab, m_MainWindow.GetIniFile())
|
||||
OrderTxBx.IsEnabled = False
|
||||
PieceTypeGpBx.IsEnabled = False
|
||||
ConfirmOrderBtn.IsEnabled = False
|
||||
InsertPiecesBtn.IsEnabled = True
|
||||
LastSlabBtn.IsEnabled = True
|
||||
Else
|
||||
' segnalare che i dati ordine non sono accettabili
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GetPieceDimensions(Index As Integer)
|
||||
Dim DimensionString As String = ""
|
||||
GetPrivateProfileString(S_FASTGRID, Index, "", DimensionString, m_MainWindow.GetIniFile())
|
||||
Dim DimensionSplit() As String = DimensionString.Split(","c)
|
||||
If DimensionSplit.Count = 3 Then
|
||||
m_PieceDimensionsX(Index - 1) = DimensionSplit(0)
|
||||
m_PieceDimensionsY(Index - 1) = DimensionSplit(1)
|
||||
Select Case Index
|
||||
Case 1
|
||||
Type1Btn.Content = DimensionSplit(2)
|
||||
Case 2
|
||||
Type2Btn.Content = DimensionSplit(2)
|
||||
Case 3
|
||||
Type3Btn.Content = DimensionSplit(2)
|
||||
Case 4
|
||||
Type4Btn.Content = DimensionSplit(2)
|
||||
Case 5
|
||||
Type5Btn.Content = DimensionSplit(2)
|
||||
End Select
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Sub CurrSlabIncrement()
|
||||
' verifico se è attiva l'opzione ultima lastra
|
||||
If LastSlabBtn.IsChecked Then
|
||||
' l'ordine è finito
|
||||
m_nCurrSlab = 0
|
||||
OrderTxBx.Text = ""
|
||||
OrderTxBx.IsEnabled = True
|
||||
PieceTypeGpBx.IsEnabled = True
|
||||
ConfirmOrderBtn.IsEnabled = True
|
||||
InsertPiecesBtn.IsEnabled = False
|
||||
LastSlabBtn.IsEnabled = False
|
||||
Else
|
||||
' incremento il contatore lastra
|
||||
m_nCurrSlab += 1
|
||||
WritePrivateProfileString(S_FASTGRID, K_FG_CURRSLAB, m_nCurrSlab, m_MainWindow.GetIniFile())
|
||||
End If
|
||||
CurrSlabTxBx.Text = m_nCurrSlab
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
+4
-4
@@ -499,7 +499,7 @@ Class MainWindow
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_WorkInProgressPageUC)
|
||||
m_ActivePage = Pages.WorkInProgress
|
||||
Case Pages.CadCut And m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Nest And Not m_CadCutPageUC.m_NestPage.m_bRegister
|
||||
Case Pages.CadCut And (m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Nest Or m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.FastGrid) And Not m_CadCutPageUC.m_NestPage.m_bRegister
|
||||
WorkInProgressBtn.IsChecked = True
|
||||
CadCutBtn.IsChecked = False
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_CadCutPageUC)
|
||||
@@ -550,7 +550,7 @@ Class MainWindow
|
||||
m_ActivePage = Pages.DirectCut
|
||||
Case Pages.DirectCut
|
||||
DirectCutBtn.IsChecked = True
|
||||
Case Pages.CadCut And m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Nest And Not m_CadCutPageUC.m_NestPage.m_bRegister
|
||||
Case Pages.CadCut And (m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Nest Or m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.FastGrid) And Not m_CadCutPageUC.m_NestPage.m_bRegister
|
||||
DirectCutBtn.IsChecked = True
|
||||
CadCutBtn.IsChecked = False
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_CadCutPageUC)
|
||||
@@ -704,7 +704,7 @@ Class MainWindow
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_MachinePageUC)
|
||||
m_ActivePage = Pages.Machine
|
||||
Case Pages.CadCut And m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Nest And Not m_CadCutPageUC.m_NestPage.m_bRegister
|
||||
Case Pages.CadCut And (m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Nest Or m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.FastGrid) And Not m_CadCutPageUC.m_NestPage.m_bRegister
|
||||
CadCutBtn.IsChecked = False
|
||||
MachineBtn.IsChecked = True
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_CadCutPageUC)
|
||||
@@ -749,7 +749,7 @@ Class MainWindow
|
||||
MainWindowGrid.Children.Remove(m_CurrentProjectPageUC)
|
||||
MainWindowGrid.Children.Add(m_OptionsPageUC)
|
||||
m_ActivePage = Pages.Options
|
||||
Case Pages.CadCut And m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Nest And Not m_CadCutPageUC.m_NestPage.m_bRegister
|
||||
Case Pages.CadCut And (m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.Nest Or m_CadCutPageUC.m_CadCutMode = CadCutPageUC.CadCutModes.FastGrid) And Not m_CadCutPageUC.m_NestPage.m_bRegister
|
||||
CadCutBtn.IsChecked = False
|
||||
OptionsBtn.IsChecked = True
|
||||
m_CurrentProjectPageUC.CurrentProjectPageGrid.Children.Remove(m_CadCutPageUC)
|
||||
|
||||
+19
-13
@@ -60,8 +60,24 @@ Public Class NestPageUC
|
||||
End Sub
|
||||
|
||||
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
m_bActive = True
|
||||
LoadParams()
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
Public Sub CalcRawPart()
|
||||
' determino il grezzo (è il primo con fase 1)
|
||||
m_nRawId = GetCurrentRaw()
|
||||
' recupero dimensioni del grezzo e kerf
|
||||
If Not EgtGetRawPartBBox(m_nRawId, m_b3Raw) Then
|
||||
m_nRawId = GDB_ID.NULL
|
||||
m_b3Raw.Setup()
|
||||
End If
|
||||
If Not EgtGetInfo(m_nRawId, KEY_KERF, m_dKerf) Then m_dKerf = 0
|
||||
End Sub
|
||||
|
||||
Friend Sub LoadParams()
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
' recupero dimensioni del grezzo e kerf
|
||||
CalcRawPart()
|
||||
' calcolo valore di minima distanza (da spessore lama corrente)
|
||||
@@ -92,18 +108,6 @@ Public Class NestPageUC
|
||||
ShowParkedParts()
|
||||
' Garantisco visibilità eventuale contorno da foto
|
||||
m_CurrProjPage.ShowContour(True)
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
Public Sub CalcRawPart()
|
||||
' determino il grezzo (è il primo con fase 1)
|
||||
m_nRawId = GetCurrentRaw()
|
||||
' recupero dimensioni del grezzo e kerf
|
||||
If Not EgtGetRawPartBBox(m_nRawId, m_b3Raw) Then
|
||||
m_nRawId = GDB_ID.NULL
|
||||
m_b3Raw.Setup()
|
||||
End If
|
||||
If Not EgtGetInfo(m_nRawId, KEY_KERF, m_dKerf) Then m_dKerf = 0
|
||||
End Sub
|
||||
|
||||
Public Sub UpdateStepsOnUI()
|
||||
@@ -1163,6 +1167,7 @@ Public Class NestPageUC
|
||||
End Function
|
||||
|
||||
Friend Function UpdateNestRegions() As Boolean
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
' Se necessario, creo la regione fuori kerf
|
||||
Dim nKerfId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_KERF)
|
||||
EgtCreateOutRegion(m_CurrProjPage.m_nRawId, nKerfId)
|
||||
@@ -1178,6 +1183,7 @@ Public Class NestPageUC
|
||||
End Function
|
||||
|
||||
Friend Function EnableReferenceRegion(bEnable As Boolean) As Boolean
|
||||
m_CurrProjPage = m_MainWindow.m_CurrentProjectPageUC
|
||||
' Recupero identificativo della regione di riferimento
|
||||
Dim nRegId As Integer = EgtGetFirstNameInGroup(m_CurrProjPage.m_nRawId, NAME_REF_REG)
|
||||
If nRegId = GDB_ID.NULL Then Return False
|
||||
|
||||
@@ -204,6 +204,9 @@
|
||||
<Compile Include="DrawPageUC.xaml.vb">
|
||||
<DependentUpon>DrawPageUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FastGridSlabManager.xaml.vb">
|
||||
<DependentUpon>FastGridSlabManager.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EditValueWD.xaml.vb">
|
||||
<DependentUpon>EditValueWD.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -377,6 +380,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="FastGridSlabManager.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="EditValueWD.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -1045,6 +1045,13 @@
|
||||
<Setter Property="Margin" Value="{StaticResource Button_MarginThickness}"/>
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="ToggleButton.Background" Value="#FFF4F4F4"/>
|
||||
<Setter Property="ToggleButton.BorderBrush" Value="#FFADB2B5"/>
|
||||
<Setter Property="ToggleButton.Foreground" Value="#FF838383"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OmagCut_ToggleButton_Wrap" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource OmagCut_ToggleButton}">
|
||||
@@ -1142,6 +1149,45 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OmagCut_DisabledYellowToggleButton" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="BorderThickness" Value="{StaticResource BorderThickness}"/>
|
||||
<Setter Property="ControlExtensions:ToggleButtonExtensions.CornerRadius" Value="{StaticResource Button_CornerRadius}"/>
|
||||
<Setter Property="Margin" Value="{StaticResource Button_MarginThickness}"/>
|
||||
<Setter Property="Padding" Value="5"/>
|
||||
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||
<Setter Property="ContentTemplate" Value="{StaticResource ToggleButton_DataTemplate_Wrap}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource OmagCut_Yellow}"/>
|
||||
<Setter Property="Background" Value="{StaticResource OmagCut_LightGray}"/>
|
||||
<Setter Property="FontSize" Value="{DynamicResource FontSize_LowerCaseCharacter}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="ToggleButton.Background" Value="{StaticResource OmagCut_Blue}" />
|
||||
<Setter Property="ToggleButton.Foreground" Value="{StaticResource OmagCut_Yellow}"/>
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsChecked" Value="True" />
|
||||
<Condition Property="IsEnabled" Value="False" />
|
||||
</MultiTrigger.Conditions>
|
||||
<MultiTrigger.Setters>
|
||||
<Setter Property="ToggleButton.Background" Value="{StaticResource OmagCut_LightGray}"/>
|
||||
<Setter Property="ToggleButton.Foreground" Value="{StaticResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
</MultiTrigger.Setters>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsChecked" Value="False" />
|
||||
<Condition Property="IsEnabled" Value="False" />
|
||||
</MultiTrigger.Conditions>
|
||||
<MultiTrigger.Setters>
|
||||
<Setter Property="ToggleButton.Background" Value="#FFF4F4F4"/>
|
||||
<Setter Property="ToggleButton.BorderBrush" Value="#FFADB2B5"/>
|
||||
<Setter Property="ToggleButton.Foreground" Value="#FF838383"/>
|
||||
</MultiTrigger.Setters>
|
||||
</MultiTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- ______________________________________________________________________________________________________________________ -->
|
||||
|
||||
<!--TreeView-->
|
||||
|
||||
+40
-5
@@ -11,15 +11,17 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="5*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
<ColumnDefinition Width="7*"/>
|
||||
<ColumnDefinition Width="4*"/>
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1.5*"/>
|
||||
<RowDefinition Height="0.75*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="7.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<GroupBox Name="LanguageGpBx" Grid.RowSpan="2" Style="{StaticResource OmagCut_GroupBox}">
|
||||
<GroupBox Name="LanguageGpBx" Grid.RowSpan="3" Style="{StaticResource OmagCut_GroupBox}">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
@@ -32,7 +34,10 @@
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ComboBox Name="LanguageCmBx" Grid.Column="1" Grid.Row="1" MinWidth="49" Style="{StaticResource OmagCut_ComboBox}">
|
||||
<ComboBox Name="LanguageCmBx"
|
||||
Grid.Column="1" Grid.Row="1"
|
||||
MinWidth="49"
|
||||
Style="{StaticResource OmagCut_ComboBox}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding LanguageName}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
|
||||
@@ -46,7 +51,9 @@
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="UnitsOfMeasureGpBx" Grid.Column="1" Style="{StaticResource OmagCut_GroupBox}">
|
||||
<GroupBox Name="UnitsOfMeasureGpBx"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource OmagCut_GroupBox}">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.5*"/>
|
||||
@@ -71,6 +78,34 @@
|
||||
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Name="FastGridGpBx"
|
||||
Grid.Column="2" Grid.RowSpan="2"
|
||||
Style="{StaticResource OmagCut_GroupBox}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.25*"/>
|
||||
<ColumnDefinition Width="2.5*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.25*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ToggleButton Name="EnableFastGridBtn"
|
||||
Grid.Row="1" Grid.Column="2"
|
||||
Style="{StaticResource OmagCut_YellowToggleButton}" />
|
||||
|
||||
<TextBlock Name="FastGridTxBl"
|
||||
Grid.Column="1" Grid.Row="1"
|
||||
Margin="0,0,5,0"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" HorizontalAlignment="Left" />
|
||||
</Grid>
|
||||
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
|
||||
@@ -19,10 +19,41 @@ Public Class OptionsPageUC
|
||||
' Imposto l'unità di misura corrente
|
||||
UnitsOfMeasureCmBx.SelectedIndex = If(EgtUiUnitsAreMM(), 1, 0)
|
||||
|
||||
' Leggo se la modalità fastgrid è abilitata, e controllo bit su chiave
|
||||
If GetPrivateProfileInt(S_FASTGRID, K_FG_ENABLE, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||
FastGridGpBx.Visibility = Windows.Visibility.Visible
|
||||
' Leggo se la modalità fastgrid è attiva
|
||||
If GetPrivateProfileInt(S_FASTGRID, K_FG_ACTIVE, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||
EnableFastGridBtn.IsChecked = True
|
||||
Else
|
||||
EnableFastGridBtn.IsChecked = False
|
||||
End If
|
||||
' Disattivo importazione Dxf e pezzi parametrici
|
||||
m_MainWindow.m_CadCutPageUC.DrawBtn.IsEnabled = False
|
||||
m_MainWindow.m_CadCutPageUC.ImportBtn.IsEnabled = False
|
||||
' Disattivo Csv, Vein Matching e Registrazione
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.CSVBtn.IsEnabled = False
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.VeinMatchingBtn.IsEnabled = False
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.RegisterBtn.IsEnabled = False
|
||||
Else
|
||||
FastGridGpBx.Visibility = Windows.Visibility.Collapsed
|
||||
' Attivo importazione Dxf e pezzi parametrici
|
||||
m_MainWindow.m_CadCutPageUC.DrawBtn.IsEnabled = True
|
||||
m_MainWindow.m_CadCutPageUC.ImportBtn.IsEnabled = True
|
||||
' Attivo Csv, Vein Matching e Registrazione
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.CSVBtn.IsEnabled = True
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.VeinMatchingBtn.IsEnabled = True
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.RegisterBtn.IsEnabled = True
|
||||
End If
|
||||
|
||||
' Messaggi
|
||||
LanguageGpBx.Header = EgtMsg(MSG_OPTIONSPAGEUC + 1)
|
||||
LanguageMsgTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 2)
|
||||
UnitsOfMeasureGpBx.Header = EgtMsg(MSG_OPTIONSPAGEUC + 3)
|
||||
FastGridGpBx.Header = EgtMsg(MSG_OPTIONSPAGEUC + 11)
|
||||
EnableFastGridBtn.Content = EgtMsg(MSG_OPTIONSPAGEUC + 12)
|
||||
FastGridTxBl.Text = EgtMsg(MSG_OPTIONSPAGEUC + 13)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub LanguageCmBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles LanguageCmBx.SelectionChanged
|
||||
@@ -37,4 +68,26 @@ Public Class OptionsPageUC
|
||||
WritePrivateProfileString(S_GENERAL, K_MMUNITS, If(bMM, "1", "0"), m_MainWindow.GetIniFile())
|
||||
End Sub
|
||||
|
||||
Private Sub EnableFastGridBtn_Checked(sender As Object, e As RoutedEventArgs) Handles EnableFastGridBtn.Checked
|
||||
WritePrivateProfileString(S_FASTGRID, K_FG_ACTIVE, 1, m_MainWindow.GetIniFile())
|
||||
' Disattivo importazione Dxf e pezzi parametrici
|
||||
m_MainWindow.m_CadCutPageUC.DrawBtn.IsEnabled = False
|
||||
m_MainWindow.m_CadCutPageUC.ImportBtn.IsEnabled = False
|
||||
' Disattivo Csv, Vein Matching e Registrazione
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.CSVBtn.IsEnabled = False
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.VeinMatchingBtn.IsEnabled = False
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.RegisterBtn.IsEnabled = False
|
||||
End Sub
|
||||
|
||||
Private Sub EnableFastGridBtn_Unchecked(sender As Object, e As RoutedEventArgs) Handles EnableFastGridBtn.Unchecked
|
||||
WritePrivateProfileString(S_FASTGRID, K_FG_ACTIVE, 0, m_MainWindow.GetIniFile())
|
||||
' Attivo importazione Dxf e pezzi parametrici
|
||||
m_MainWindow.m_CadCutPageUC.DrawBtn.IsEnabled = True
|
||||
m_MainWindow.m_CadCutPageUC.ImportBtn.IsEnabled = True
|
||||
' Attivo Csv, Vein Matching e Registrazione
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.CSVBtn.IsEnabled = True
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.VeinMatchingBtn.IsEnabled = True
|
||||
m_MainWindow.m_CadCutPageUC.m_ProjectMgr.RegisterBtn.IsEnabled = True
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -56,9 +56,11 @@ Public Class ProjectMgrUC
|
||||
Case 0 ' Annulla
|
||||
Return
|
||||
Case 1 ' Si
|
||||
ManageFastGridMode()
|
||||
m_CurrProjPage.SaveNamedProject()
|
||||
m_CurrProjPage.SaveProject()
|
||||
Case 2 ' No
|
||||
ManageFastGridMode()
|
||||
' Non devo fare alcunchè
|
||||
End Select
|
||||
End If
|
||||
@@ -85,6 +87,19 @@ Public Class ProjectMgrUC
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
Private Sub ManageFastGridMode()
|
||||
' Gestione modalità FastGrid
|
||||
If GetPrivateProfileInt(S_FASTGRID, K_FG_ENABLE, 0, m_MainWindow.GetIniFile()) <> 0 And
|
||||
GetPrivateProfileInt(S_FASTGRID, K_FG_ACTIVE, 0, m_MainWindow.GetIniFile()) <> 0 Then
|
||||
' Verifico se il progetto precedente è stato esegiuto ed inviato alla macchina
|
||||
If m_CurrProjPage.GetProjectNcProgSent() <> 0 Then
|
||||
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.CurrSlabIncrement()
|
||||
Else
|
||||
m_MainWindow.m_CadCutPageUC.m_FastGridSlabManager.CheckLastSlab()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Friend Function ChooseTable() As Integer
|
||||
Dim nTabInd As Integer = 0
|
||||
Select Case GetTableCount()
|
||||
|
||||
Reference in New Issue
Block a user