OmagCUT 1.6l10 :

- migliorie varie.
This commit is contained in:
Dario Sassi
2016-01-29 19:57:05 +00:00
parent 3eff31c521
commit edd79b8d93
10 changed files with 632 additions and 240 deletions
+6
View File
@@ -36,7 +36,9 @@ Public Class CadCutPageUC
' Posizionamento nella griglia delle Page UserControl
m_NestPage.SetValue(Grid.RowSpanProperty, 3)
m_NestPage.SetValue(Grid.ColumnSpanProperty, 2)
m_SplitPage.SetValue(Grid.RowSpanProperty, 3)
m_SplitPage.SetValue(Grid.ColumnSpanProperty, 3)
m_MoveRawPartPage.SetValue(Grid.RowSpanProperty, 3)
' Nascondo progress e label per messaggi
@@ -192,6 +194,10 @@ Public Class CadCutPageUC
bOk = SortAllMachinings()
If bOk Then
m_CurrProjPage.SetOrderMachiningFlag()
Dim bModif As Boolean = TestAllMachiningsForStrict()
If bModif Then
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
End If
End If
End If
' Disabilito impostazione modificato
+124
View File
@@ -77,6 +77,130 @@ Public Module CamAuto
Return EgtSetAllOperationsMode(True)
End Function
Public Function TestAllMachiningsForStrict() As Boolean
Dim bModified As Boolean = False
' Identificativo grezzo corrente
Dim nRawId As Integer = EgtGetFirstRawPart()
' Ciclo sulle lavorazioni
Dim nOperId As Integer = EgtGetFirstOperation()
While nOperId <> GDB_ID.NULL
' verifico sia una lavorazione valida
If IsValidMachining(nOperId) Then
' eventuali lavorazioni inglobate
Dim vOthId As New List(Of Integer)
Dim sInfo As String = String.Empty
If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then
Dim sItems() As String = sInfo.Split(",".ToCharArray)
For Each sId In sItems
vOthId.Add(CInt(sId))
Next
End If
' layer di origine
Dim sLay As String = String.Empty
EgtGetInfo(nOperId, "Lay", sLay)
' verifica interferenza
Dim bFree As Boolean = True
If sLay = "OutLoop" Then
bFree = EgtVerifyMachining(nOperId, False, nRawId)
For Each nId As Integer In vOthId
If Not EgtVerifyMachining(nId, False, nRawId) Then
bFree = False
End If
Next
Else
bFree = True
End If
' abilitazione
Dim bEnabled As Boolean = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF)
' Restringo lavorazione abilitata ma con interferenza
If bEnabled And Not bFree Then
SetStrictMachining(nOperId, True, True)
bModified = True
End If
End If
nOperId = EgtGetNextOperation(nOperId)
End While
Return bModified
End Function
Public Function SetStrictMachining(nMchId As Integer, bStart As Boolean, bEnd As Boolean) As Boolean
' Imposto la lavorazione corrente
If Not EgtSetCurrMachining(nMchId) Then Return False
Dim bModif As Boolean = False
' Se richiesto, restringo l'attacco
If bStart Then
' Recupero tipo attacco originale e lo salvo se non già fatto
Dim nOriLeadIn As Integer = MCH_SAW_LI.CENT
EgtGetMachiningParamInt(MCH_MP.LEADINTYPE, nOriLeadIn)
If Not EgtExistsInfo(nMchId, INFO_MCH_ORILEADIN) Then
EgtSetInfo(nMchId, INFO_MCH_ORILEADIN, nOriLeadIn)
End If
' Se attacco cambiato, aggiorno
If nOriLeadIn <> MCH_SAW_LI.STRICT Then
EgtSetMachiningParamInt(MCH_MP.LEADINTYPE, MCH_SAW_LI.STRICT)
bModif = True
End If
End If
' Se richiesto, restringo l'uscita
If bEnd Then
' Recupero tipo uscita originale e lo salvo se non già fatto
Dim nOriLeadOut As Integer = MCH_SAW_LO.CENT
EgtGetMachiningParamInt(MCH_MP.LEADOUTTYPE, nOriLeadOut)
If Not EgtExistsInfo(nMchId, INFO_MCH_ORILEADOUT) Then
EgtSetInfo(nMchId, INFO_MCH_ORILEADOUT, nOriLeadOut)
End If
' Se uscita cambiata, aggiorno
If nOriLeadOut <> MCH_SAW_LO.STRICT Then
EgtSetMachiningParamInt(MCH_MP.LEADOUTTYPE, MCH_SAW_LO.STRICT)
bModif = True
End If
End If
' Se modificato, ricalcolo il preview
If bModif Then
' Indice gruppo di preview nella lavorazione
Dim nMchPvId As Integer = EgtGetFirstNameInGroup(nMchId, NAME_PREVIEW)
' Indice gruppo di preview nel pezzo
Dim nPartPvId As Integer = GDB_ID.NULL
EgtGetInfo(nMchPvId, INFO_PV_ONPART_ID, nPartPvId)
' Svuoto il preview nel pezzo
EgtEmptyGroup(nPartPvId)
' Rimuovo anche il preview di lavorazioni inglobate
Dim sInfo As String = String.Empty
If EgtGetInfo(nMchId, INFO_MCH_OTHMID, sInfo) Then
Dim sItems() As String = sInfo.Split(",".ToCharArray)
For Each sId In sItems
' Indice gruppo di preview nella lavorazione
Dim nMchPvId2 As Integer = EgtGetFirstNameInGroup(CInt(sId), NAME_PREVIEW)
' Indice gruppo di preview nel pezzo
Dim nPartPvId2 As Integer = GDB_ID.NULL
EgtGetInfo(nMchPvId2, INFO_PV_ONPART_ID, nPartPvId2)
' Svuoto il preview nel pezzo
EgtEmptyGroup(nPartPvId2)
Next
End If
' Ricalcolo il preview
EgtPreviewMachining(False)
' Lo sposto dalla lavorazione al pezzo
Dim nId As Integer = EgtGetFirstInGroup(nMchPvId)
While nId <> GDB_ID.NULL
EgtRelocateGlob(nId, nPartPvId)
nId = EgtGetFirstInGroup(nMchPvId)
End While
End If
Return True
End Function
Public Function IsValidMachining(nOperId As Integer) As Boolean
' Deve essere una lavorazione
If Not EgtSetCurrMachining(nOperId) Then Return False
' Deve contenere qualcosa
If Not EgtIsMachiningNotEmpty() Then Return False
' Deve essere abilitata oppure disabilitata direttamente dall'utente
If Not EgtGetOperationMode(nOperId) And Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF) Then Return False
' E' valida
Return True
End Function
Private Function SetLuaStandardCamParams() As Boolean
Dim sSawMch As String = String.Empty
GetPrivateProfileString(S_MACH, K_CURRSAWING, "", sSawMch, m_MainWindow.GetIniFile())
+31 -1
View File
@@ -81,8 +81,38 @@ Module ConstGen
Public Const NAME_ONPATH As String = "OnPath"
' Nome layer preview
Public Const NAME_PREVIEW As String = "PV"
' Info in preview lavorazione con identificativo layer preview spostato nel pezzo
Public Const INFO_PV_ONPART_ID As String = "PvId"
' Info in lavorazione con identificativo lavorazioni inglobate
Public Const INFO_MCH_OTHMID As String = "OthMIds"
' Info lavorazione disabilitata dall'utente
Public Const INFO_MCH_USER_OFF As String = "UserOff"
' Nome contorno taglio
Public Const NAME_PV_CUT As String = "CUT"
' Nome contorno pre-taglio
Public Const NAME_PV_PRECUT As String = "PRC"
' Nome contorno post-taglio
Public Const NAME_PV_POSTCUT As String = "POC"
' Info in lavorazione taglio per attacco originale
Public Const INFO_MCH_ORILEADIN As String = "OriLI"
' Info in lavorazione taglio per uscita originale
Public Const INFO_MCH_ORILEADOUT As String = "OriLO"
' Costante per flag di BBox
Dim BBFLAG As Integer = GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM
Public Const BBFLAG As Integer = GDB_BB.ONLY_VISIBLE + GDB_BB.IGNORE_TEXT + GDB_BB.IGNORE_DIM
' Colori per lavorazioni
Public Function COL_MCH_CUT() As Color3d
Return New Color3d(0, 255, 0)
End Function
Public Function COL_MCH_DISABLED() As Color3d
Return New Color3d(128, 128, 128)
End Function
Public Function COL_MCH_FREE() As Color3d
Return New Color3d(0, 0, 255)
End Function
Public Function COL_MCH_INTERF() As Color3d
Return New Color3d(255, 0, 0)
End Function
End Module
+1 -1
View File
@@ -679,7 +679,7 @@ Class MainWindow
Return True
End If
' Mi assicuro di terminare correttamente lo split
m_CadCutPageUC.m_SplitPage.ResetSplit()
m_CadCutPageUC.m_SplitPage.ExitSplit()
Return True
End Function
+2 -2
View File
@@ -55,5 +55,5 @@ Imports System.Windows
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.6.12.9")>
<Assembly: AssemblyFileVersion("1.6.12.9")>
<Assembly: AssemblyVersion("1.6.12.10")>
<Assembly: AssemblyFileVersion("1.6.12.10")>
+105 -77
View File
@@ -5,7 +5,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="256" Initialized="NestPage_Initialized" Loaded="NestPage_Loaded" Unloaded="NestPage_Unloaded">
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="NestPage_Initialized" Loaded="NestPage_Loaded" Unloaded="NestPage_Unloaded">
<!-- Chiamata al Dictionary -->
<UserControl.Resources>
@@ -13,95 +13,123 @@
</UserControl.Resources>
<!-- Definizione della NestPage -->
<Grid Grid.Column="0" Grid.Row="0">
<Grid Name="NestPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Label Name="PositioningLbl" Grid.ColumnSpan="3" VerticalAlignment="Center"
HorizontalAlignment="Center" FontSize="15" />
<Button Name="UpBtn" Grid.Column="1" Grid.Row="1"
Style="{StaticResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="Resources/UpArrow.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<Button Name="LeftBtn" Grid.Column="0" Grid.Row="2"
Style="{StaticResource OmagCut_LeftGrayGradientYellowButton}">
<Image Source="Resources/LeftArrow.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<ToggleButton Name="MaximizeMoveBtn" Grid.Column="1" Grid.Row="2"
Style="{StaticResource OmagCut_YellowIconToggleButton}">
<Image Source="Resources/MaxMove.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</ToggleButton>
<Button Name="RightBtn" Grid.Column="2" Grid.Row="2"
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/RightArrow.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<EgtWPFLib:EgtTextBox Name="StepMoveTxBx" Grid.Column="0" Grid.Row="3" Width="50"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<Button Name="DownBtn" Grid.Column="1" Grid.Row="3"
Style="{StaticResource OmagCut_BottomGrayGradientYellowButton}">
<Image Source="Resources/DownArrow.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<Grid Grid.Column="2" Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid Grid.RowSpan="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="RotationAngleTxBx" Width="50"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Grid.Column="1" FontSize="30" Margin="2,-5,0,0"
Text="°"/>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Label Name="PositioningLbl" Grid.ColumnSpan="3" VerticalAlignment="Center"
HorizontalAlignment="Center" FontSize="15" />
<Button Name="UpBtn" Grid.Column="1" Grid.Row="1"
Style="{StaticResource OmagCut_TopGrayGradientYellowButton}">
<Image Source="Resources/UpArrow.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<Button Name="LeftBtn" Grid.Column="0" Grid.Row="2"
Style="{StaticResource OmagCut_LeftGrayGradientYellowButton}">
<Image Source="Resources/LeftArrow.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<ToggleButton Name="MaximizeMoveBtn" Grid.Column="1" Grid.Row="2"
Style="{StaticResource OmagCut_YellowIconToggleButton}">
<Image Source="Resources/MaxMove.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</ToggleButton>
<Button Name="RightBtn" Grid.Column="2" Grid.Row="2"
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/RightArrow.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<EgtWPFLib:EgtTextBox Name="StepMoveTxBx" Grid.Column="0" Grid.Row="3" Width="50"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<Button Name="DownBtn" Grid.Column="1" Grid.Row="3"
Style="{StaticResource OmagCut_BottomGrayGradientYellowButton}">
<Image Source="Resources/DownArrow.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<Grid Grid.Column="2" Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<EgtWPFLib:EgtTextBox Name="RotationAngleTxBx" Width="50"
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
<TextBlock Grid.Column="1" FontSize="30" Margin="2,-5,0,0"
Text="°"/>
</Grid>
<Button Name="RotateCounterClockwiseBtn" Grid.Column="0" Grid.Row="4"
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/CounterClockwiseRotate.png" Width="64" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<ToggleButton Name="MagneticPiecesBtn" Grid.Column="1" Grid.Row="4"
Style="{StaticResource OmagCut_RightGrayYellowIconToggleButton}">
<Image Source="Resources/AlignPieces.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</ToggleButton>
<Button Name="RotateClockwiseBtn" Grid.Column="2" Grid.Row="4"
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/ClockwiseRotate.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<Button Name="InsertPartBtn" Style="{StaticResource OmagCut_YellowTextButton}"/>
<Button Name="StorePartBtn" Style="{StaticResource OmagCut_YellowTextButton}" Padding="1"/>
</UniformGrid>
<Button Name="RemovePartBtn" Grid.ColumnSpan="3" Grid.Row="6"
Style="{StaticResource OmagCut_YellowTextButton}"/>
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelectAllBtn" Style="{StaticResource OmagCut_YellowTextButton}"/>
<Button Name="DeselectAllBtn" Style="{StaticResource OmagCut_YellowTextButton}" Padding="1"/>
</UniformGrid>
</Grid>
<Button Name="RotateCounterClockwiseBtn" Grid.Column="0" Grid.Row="4"
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/CounterClockwiseRotate.png" Width="64" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<ToggleButton Name="MagneticPiecesBtn" Grid.Column="1" Grid.Row="4"
Style="{StaticResource OmagCut_RightGrayYellowIconToggleButton}">
<Image Source="Resources/AlignPieces.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</ToggleButton>
<Button Name="RotateClockwiseBtn" Grid.Column="2" Grid.Row="4"
Style="{StaticResource OmagCut_RightGrayGradientYellowButton}">
<Image Source="Resources/ClockwiseRotate.png" Width="65" Height="65" HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button>
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
<Button Name="InsertPartBtn" Style="{StaticResource OmagCut_YellowTextButton}"/>
<Button Name="StorePartBtn" Style="{StaticResource OmagCut_YellowTextButton}" Padding="1"/>
</UniformGrid>
<!--LowerButtonGrid-->
<Grid Grid.Column="2" Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<Button Name="RemovePartBtn" Grid.ColumnSpan="3" Grid.Row="6"
Style="{StaticResource OmagCut_YellowTextButton}"/>
<Button Name="ResetCutBtn" Grid.Column="2"
Style="{StaticResource OmagCut_YellowTextButton}"/>
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
<Button Name="SelectAllBtn" Style="{StaticResource OmagCut_YellowTextButton}"/>
<Button Name="DeselectAllBtn" Style="{StaticResource OmagCut_YellowTextButton}" Padding="1"/>
</UniformGrid>
</Grid>
</Grid>
+12
View File
@@ -45,6 +45,7 @@ Public Class NestPageUC
RemovePartBtn.Content = EgtMsg(MSG_NESTPAGEUC + 3) 'Remove part - Elimina pezzo
SelectAllBtn.Content = EgtMsg(MSG_NESTPAGEUC + 4) 'Select All - Seleziona Tutto
DeselectAllBtn.Content = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
ResetCutBtn.Content = EgtMsg(MSG_NESTPAGEUC + 6)
End Sub
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs)
@@ -533,6 +534,17 @@ Public Class NestPageUC
End If
End Sub
Private Sub ResetCutBtn_Click(sender As Object, e As RoutedEventArgs) Handles ResetCutBtn.Click
' Cancello eventuali messaggi
m_CurrProjPage.ClearMessage()
' Cancello tutte le lavorazioni
EraseMachinings(GDB_ID.NULL)
' Reinserisco tutte le lavorazioni
AddMachinings(GDB_ID.NULL, True, False)
' Aggiorno visualizzazione
EgtDraw()
End Sub
Friend Function VerifyPartsNesting(bReducedCut As Boolean) As Boolean
' Ciclo su tutti i pezzi in tavola
Dim nPartId As Integer = EgtGetFirstGroupInGroup(m_nRawId)
+4
View File
@@ -46,6 +46,10 @@ Public Class SimulationPageUC
bOk = SortAllMachinings()
If bOk Then
m_CurrProjPage.SetOrderMachiningFlag()
Dim bModif As Boolean = TestAllMachiningsForStrict()
If bModif Then
m_CurrProjPage.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
End If
End If
End If
' Disabilito impostazione modificato
+83 -51
View File
@@ -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="256" Initialized="SplitPageUC_Initialized">
d:DesignHeight="853.3" d:DesignWidth="1280" Initialized="SplitPageUC_Initialized">
<!-- Chiamata al Dictionary -->
<UserControl.Resources>
@@ -12,68 +12,100 @@
</UserControl.Resources>
<!-- Definizione della SplitPage -->
<Grid>
<Grid Name="SplitPageGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="12*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ListBox Name="MachiningLsBx" Grid.Row="1" ItemTemplate="{DynamicResource NameIdLsBxItem}"
SelectionMode="Single"/>
<Grid Grid.Row="2">
<!--Upper button grid-->
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="8*"/>
</Grid.ColumnDefinitions>
<Button Name="MoveUpBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowIconButton}">
<Image Source="Resources/UpArrow.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="MoveDownBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}">
<Image Source="Resources/DownArrow.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<!--Griglia per oscurare i bottoni della pagina sottostante-->
<Grid Background="{StaticResource OmagCut_Gray}" />
</Grid>
<!--Left Button Grid-->
<Grid Grid.RowSpan="3">
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="4*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ListBox Name="MachiningLsBx" Grid.Row="1" ItemTemplate="{DynamicResource NameIdLsBxItem}"
SelectionMode="Single"/>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Button Name="MoveUpBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowIconButton}">
<Image Source="Resources/UpArrow.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="MoveDownBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}">
<Image Source="Resources/DownArrow.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
</Grid>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="CutBtn" Grid.Column="0" Style="{StaticResource OmagCut_YellowTextButton}"/>
<Button Name="OnOffBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowTextButton}"/>
</Grid>
<Grid Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Button Name="PrevBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowIconButton}">
<Image Source="Resources/NumericKeyboardArrow.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="NextBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}">
<Image Source="Resources/NumericKeyboardArrow.png" Style="{StaticResource OmagCut_ButtonIcon}" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<TransformGroup>
<RotateTransform Angle="180"/>
</TransformGroup>
</Image.RenderTransform>
</Image>
</Button>
</Grid>
</Grid>
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Button Name="CutBtn" Grid.Column="0" Style="{StaticResource OmagCut_YellowTextButton}"/>
<Button Name="MoveBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowTextButton}"/>
</Grid>
<Grid Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Button Name="BeforeBtn" Grid.Column="1" Style="{StaticResource OmagCut_YellowIconButton}">
<Image Source="Resources/NumericKeyboardArrow.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
</Button>
<Button Name="LaterBtn" Grid.Column="2" Style="{StaticResource OmagCut_YellowIconButton}">
<Image Source="Resources/NumericKeyboardArrow.png" Style="{StaticResource OmagCut_ButtonIcon}" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<TransformGroup>
<RotateTransform Angle="180"/>
</TransformGroup>
</Image.RenderTransform>
</Image>
</Button>
<!--Lower button grid-->
<Grid Grid.Column="1" Grid.Row="2">
<!--Griglia per oscurare i bottoni della pagina sottostante-->
<Grid Background="{StaticResource OmagCut_Gray}" />
</Grid>
</Grid>
+264 -108
View File
@@ -1,4 +1,5 @@
Imports System.Collections.ObjectModel
Imports System.ComponentModel
Imports EgtUILib
Public Class SplitPageUC
@@ -6,73 +7,112 @@ Public Class SplitPageUC
' Riferimento alla MainWindow
Private m_MainWindow As MainWindow = Application.Current.MainWindow
Private m_MachiningList As New ObservableCollection(Of NameIdLsBxItem)
Private m_CurrOperId As Integer = GDB_ID.NULL
Private m_MachiningList As New List(Of Machining)
Private m_ItemList As New ObservableCollection(Of NameIdLsBxItem)
Private m_CurrInd As Integer = -1
Private m_bModified As Boolean = False
Private m_nNbrGrpId As Integer = GDB_ID.NULL
Private Sub SplitPageUC_Initialized(sender As Object, e As EventArgs)
' Collego lista di oggetti a ListBox
MachiningLsBx.ItemsSource = m_MachiningList
MachiningLsBx.ItemsSource = m_ItemList
CutBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 1)
MoveBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 2)
OnOffBtn.Content = EgtMsg(MSG_SPLITPAGEUC + 2)
End Sub
Private Sub SplitPageUC_Loaded(sender As Object, e As EventArgs) Handles Me.Loaded
' Se non c'è ordine delle lavorazioni, ne faccio uno automatico
If Not m_MainWindow.m_CurrentProjectPageUC.GetOrderMachiningFlag() Then
Dim bOk As Boolean = SortAllMachinings()
If bOk Then
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
End If
End If
' Pulisco la lista
m_MachiningList.Clear()
' Identificativo grezzo corrente
Dim nRawId As Integer = EgtGetFirstRawPart()
' Disabilito impostazione modificato
EgtDisableModified()
' Creo gruppo per numeri identificativi di lavorazione
' Creo gruppo per numeri identificativi di lavorazione (colore default grigio)
m_nNbrGrpId = EgtCreateGroup(GDB_ID.ROOT)
EgtSetColor(m_nNbrGrpId, New Color3d(192, 0, 0))
EgtSetColor(m_nNbrGrpId, COL_MCH_DISABLED)
EgtSetStatus(m_nNbrGrpId, GDB_ST.SEL)
EgtSetLevel(m_nNbrGrpId, GDB_LV.TEMP)
' Inserisco le lavorazioni e le identifico
Dim nCount As Integer = 0
' Preparo la lista delle lavorazioni
m_MachiningList.Clear()
Dim nOperId As Integer = EgtGetFirstOperation()
While nOperId <> GDB_ID.NULL
Dim nOperType As Integer = EgtGetOperationType(nOperId)
Dim bActive As Boolean = EgtGetOperationMode(nOperId)
If nOperType = MCH_OY.SAWING And bActive Then
EgtSetCurrMachining(nOperId)
If EgtIsMachiningNotEmpty() Then
nCount += 1
m_MachiningList.Add(New NameIdLsBxItem("Taglio" & nCount.ToString(), nOperId))
NumberMachining(nOperId, nCount)
' verifico sia una lavorazione valida
If IsValidMachining(nOperId) Then
Dim Mach As New Machining
' identificativo
Mach.m_nId = nOperId
' eventuali lavorazioni inglobate
Dim sInfo As String = String.Empty
If EgtGetInfo(nOperId, INFO_MCH_OTHMID, sInfo) Then
Dim sItems() As String = sInfo.Split(",".ToCharArray)
For Each sId In sItems
Mach.m_vOthId.Add(CInt(sId))
Next
End If
ElseIf nOperType = MCH_OY.DRILLING And bActive Then
EgtSetCurrMachining(nOperId)
If EgtIsMachiningNotEmpty() Then
nCount += 1
m_MachiningList.Add(New NameIdLsBxItem("Foratura" & nCount.ToString(), nOperId))
NumberMachining(nOperId, nCount)
' tipo
Mach.m_nType = EgtGetOperationType(nOperId)
' layer di origine
EgtGetInfo(nOperId, "Lay", Mach.m_sLay)
' verifica interferenza
If Mach.m_sLay = "OutLoop" Then
Mach.m_bFree = EgtVerifyMachining(nOperId, False, nRawId)
For Each nId As Integer In Mach.m_vOthId
If Not EgtVerifyMachining(nId, False, nRawId) Then
Mach.m_bFree = False
End If
Next
Else
Mach.m_bFree = True
End If
' abilitazione
Mach.m_bEnabled = Not EgtExistsInfo(nOperId, INFO_MCH_USER_OFF)
' inserisco in lista
m_MachiningList.Add(Mach)
' sistemo colore
ColorMachining(m_MachiningList.Count() - 1)
' assegno numerazione
NumberMachining(m_MachiningList.Count() - 1)
End If
nOperId = EgtGetNextOperation(nOperId)
End While
' Preparo la lista degli Item
m_ItemList.Clear()
For i As Integer = 1 To m_MachiningList.Count()
Dim Mach As Machining = m_MachiningList(i - 1)
If Mach.m_nType = MCH_OY.SAWING Then ' Taglio
Dim sText As String = If(Mach.m_bEnabled, "[X] ", "[_] ") & EgtMsg(90791) & i.ToString()
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1))
ElseIf Mach.m_nType = MCH_OY.DRILLING Then ' Foratura
Dim sText As String = If(Mach.m_bEnabled, "[X] ", "[_] ") & EgtMsg(90792) & i.ToString()
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1))
ElseIf Mach.m_nType = MCH_OY.MILLING Then ' Fresatura
Dim sText As String = If(Mach.m_bEnabled, "[X] ", "[_] ") & EgtMsg(90793) & i.ToString()
m_ItemList.Add(New NameIdLsBxItem(sText, i - 1))
End If
Next
EgtDraw()
' Abilito impostazione modificato
EgtEnableModified()
' Nessun item corrente
m_CurrInd = -1
' Reset flag di modifica
m_bModified = False
End Sub
Private Sub MachiningLsBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MachiningLsBx.SelectionChanged
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
If IsNothing(SelItem) Then
Return
End If
Dim nOperId As Integer = SelItem.ID
If nOperId <> m_CurrOperId Then
MarkMachining(m_CurrOperId, False)
MarkMachining(nOperId, True)
m_CurrOperId = nOperId
If IsNothing(SelItem) Then Return
Dim nInd As Integer = SelItem.Ind
If nInd <> m_CurrInd Then
MarkMachining(m_CurrInd, False)
MarkMachining(nInd, True)
m_CurrInd = nInd
EgtDraw()
End If
@@ -103,9 +143,9 @@ Public Class SplitPageUC
Dim selected As Object = MachiningLsBx.SelectedItem
' Removing removable element
m_MachiningList.Remove(selected)
m_ItemList.Remove(selected)
' Insert it in new position
m_MachiningList.Insert(newIndex, selected)
m_ItemList.Insert(newIndex, selected)
' Restore selection
MachiningLsBx.SelectedItem = selected
@@ -113,99 +153,147 @@ Public Class SplitPageUC
m_bModified = True
End Sub
Private Sub OnOffBtn_Click(sender As Object, e As RoutedEventArgs) Handles OnOffBtn.Click
Dim SelItem As NameIdLsBxItem = MachiningLsBx.SelectedItem
If IsNothing(SelItem) Then
Return
End If
Dim nI As Integer = SelItem.Ind
If m_MachiningList(nI).m_bEnabled Then
m_MachiningList(nI).m_bEnabled = False
SelItem.Name = SelItem.Name.Replace("[X]", "[_]")
Else
m_MachiningList(nI).m_bEnabled = True
SelItem.Name = SelItem.Name.Replace("[_]", "[X]")
End If
ColorMachining(nI)
ColorNumber(nI)
EgtDraw()
' Imposto flag di modifica
m_bModified = True
End Sub
Private Sub SplitPageUC_Unloaded(sender As Object, e As EventArgs) Handles Me.Unloaded
ResetSplit()
ExitSplit()
EgtDraw()
End Sub
Friend Sub ResetSplit()
Friend Sub ExitSplit()
' cancello evidenziazione
If m_CurrOperId <> GDB_ID.NULL Then
MarkMachining(m_CurrOperId, False)
m_CurrOperId = GDB_ID.NULL
If m_CurrInd >= 0 Then
MarkMachining(m_CurrInd, False)
m_CurrInd = -1
EgtDraw()
End If
' cancello gruppo di numerazione
' cancello gruppo di numerazione e ripristino colori lavorazioni
EgtDisableModified()
EgtErase(m_nNbrGrpId)
For i As Integer = 1 To m_MachiningList.Count()
ColorMachining(i - 1, True)
Next
EgtEnableModified()
' se modificato salvo ordine delle lavorazioni
' Restringo lavorazioni abilitate ma con interferenza
Dim bStrict As Boolean = False
For Each Mach As Machining In m_MachiningList
If Mach.m_bEnabled And Not Mach.m_bFree Then
bStrict = True
SetStrictMachining(Mach.m_nId, True, True)
End If
Next
If bStrict Then
m_MainWindow.m_CurrentProjectPageUC.SetWarningMessage(EgtMsg(90321)) 'Ridotte alcune lavorazioni per evitare interferenze
End If
' se modificato salvo ordine e stato delle lavorazioni
If m_bModified Then
' Al primo posto deve rimanere la prima disposizione
Dim nFirstOperId As Integer = EgtGetFirstOperation()
For i = m_MachiningList.Count() - 1 To 0 Step -1
Dim nMchId As Integer = m_MachiningList(i).ID
For i = m_ItemList.Count() - 1 To 0 Step -1
Dim nI As Integer = m_ItemList(i).Ind
Dim nMchId As Integer = m_MachiningList(nI).m_nId
EgtRelocate(nMchId, nFirstOperId, GDB_POS.AFTER)
If m_MachiningList(nI).m_bEnabled Then
EgtSetOperationMode(m_MachiningList(nI).m_nId, True)
EgtRemoveInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF)
Else
EgtSetOperationMode(m_MachiningList(nI).m_nId, False)
EgtSetInfo(m_MachiningList(nI).m_nId, INFO_MCH_USER_OFF, 1)
End If
Next
' dichiaro ordine salvato
m_MainWindow.m_CurrentProjectPageUC.SetOrderMachiningFlag()
End If
End Sub
Private Sub NumberMachining(nOperId As Integer, nNumber As Integer)
Private Sub NumberMachining(nI As Integer)
' Ingombro complessivo della lavorazione
Dim ptMin, ptMax As Point3d
' Lavorazione principale
BoxFromSingleMachining(nOperId, ptMin, ptMax)
' Eventuali lavorazioni inglobate
Dim sInfo As String = String.Empty
If EgtGetInfo(nOperId, "OthMIds", sInfo) Then
Dim sItems() As String = sInfo.Split(",".ToCharArray)
For Each sId In sItems
UpdateBoxFromSingleMachining(CInt(sId), ptMin, ptMax)
Next
End If
If Not BoxFromMachining(nI, ptMin, ptMax) Then Return
' Metto il numero nel centro
Dim ptCen As Point3d = ptMin + 0.5 * (ptMax - ptMin)
ptCen.z = ptMax.z + 1
Dim nNbrId As Integer = EgtCreateTextAdv(m_nNbrGrpId, ptCen, 0, nNumber.ToString(), "",
300, False, 75, 1, 0, INS_POS.MC)
' Aggiungo a lavorazione info con identificativo del numero
EgtSetInfo(nOperId, "NbrId", nNbrId)
Dim dRadXY = Point3d.DistXY(ptMin, ptMax)
Dim dHtxt As Double = 75
Dim dRat As Double = 1
If dRadXY < 200 Then
dHtxt = 50
dRat = 0.75
ElseIf dRadXY < 25 Then
dHtxt = 25
dRat = 0.5
End If
Dim nNbrId As Integer = EgtCreateTextAdv(m_nNbrGrpId, ptCen, 0, (nI + 1).ToString(), "",
300, False, dHtxt, dRat, 0, INS_POS.MC)
m_MachiningList(nI).m_nNbrId = nNbrId
ColorNumber(nI)
EgtSetInfo(nNbrId, "MId", m_MachiningList(nI).m_nId)
' Aggiungo a lavorazione info con identificativo del numero e viceversa
EgtSetInfo(m_MachiningList(nI).m_nId, "NbrId", nNbrId)
End Sub
Private Function BoxFromMachining(nI As Integer, ByRef ptMin As Point3d, ByRef ptMax As Point3d) As Boolean
If nI < 0 Then Return False
' Lavorazione principale
If Not BoxFromSingleMachining(m_MachiningList(nI).m_nId, ptMin, ptMax) Then
Return False
End If
' Eventuali lavorazioni inglobate
For Each nId As Integer In m_MachiningList(nI).m_vOthId
Dim ptMchMin, ptMchMax As Point3d
If BoxFromSingleMachining(nId, ptMchMin, ptMchMax) Then
ptMin.x = Math.Min(ptMin.x, ptMchMin.x)
ptMin.y = Math.Min(ptMin.y, ptMchMin.y)
ptMin.z = Math.Min(ptMin.z, ptMchMin.z)
ptMax.x = Math.Max(ptMax.x, ptMchMax.x)
ptMax.y = Math.Max(ptMax.y, ptMchMax.y)
ptMax.z = Math.Max(ptMax.z, ptMchMax.z)
End If
Next
Return True
End Function
Private Function BoxFromSingleMachining(nOperId As Integer, ByRef ptMin As Point3d, ByRef ptMax As Point3d) As Boolean
' Recupero il preview della lavorazione
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, "PV"), "PvId", nPvId)
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
Return EgtGetBBoxGlob(nPvId, GDB_BB.STANDARD, ptMin, ptMax)
End Function
Private Function UpdateBoxFromSingleMachining(nOperId As Integer, ByRef ptMin As Point3d, ByRef ptMax As Point3d) As Boolean
' Aggiorno con ingombro della lavorazione
Dim ptMchMin, ptMchMax As Point3d
If BoxFromSingleMachining(nOperId, ptMchMin, ptMchMax) Then
ptMin.x = Math.Min(ptMin.x, ptMchMin.x)
ptMin.y = Math.Min(ptMin.y, ptMchMin.y)
ptMin.z = Math.Min(ptMin.z, ptMchMin.z)
ptMax.x = Math.Max(ptMax.x, ptMchMax.x)
ptMax.y = Math.Max(ptMax.y, ptMchMax.y)
ptMax.z = Math.Max(ptMax.z, ptMchMax.z)
Return True
Else
Return False
End If
End Function
Private Sub MarkMachining(nOperId As Integer, bMark As Boolean)
Private Sub MarkMachining(nI As Integer, bMark As Boolean)
If nI < 0 Then Return
Dim nOperId As Integer = m_MachiningList(nI).m_nId
' Evidenzio la lavorazione principale
MarkSingleMachining(nOperId, bMark)
' Evidenzio l'eventuale numero della lavorazione
MarkNumber(nOperId, bMark)
' Se ci sono lavorazioni inglobate, evidenzio anch'esse
Dim sInfo As String = String.Empty
If Not EgtGetInfo(nOperId, "OthMIds", sInfo) Then
Return
End If
Dim sItems() As String = sInfo.Split(",".ToCharArray)
For Each sId In sItems
MarkSingleMachining(CInt(sId), bMark)
MarkNumber(nI, bMark)
' Marco anche le lavorazioni inglobate
For Each nId As Integer In m_MachiningList(nI).m_vOthId
MarkSingleMachining(nId, bMark)
Next
End Sub
Private Sub MarkSingleMachining(nOperId As Integer, bMark As Boolean)
Dim nPvId As Integer = GDB_ID.NULL
If EgtGetInfo(EgtGetFirstNameInGroup(nOperId, "PV"), "PvId", nPvId) Then
If EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId) Then
If bMark Then
EgtSetMark(nPvId)
Else
@@ -214,18 +302,71 @@ Public Class SplitPageUC
End If
End Sub
Private Sub MarkNumber(nOperId As Integer, bMark As Boolean)
Dim nNbrId As Integer = GDB_ID.NULL
If EgtGetInfo(nOperId, "NbrId", nNbrId) Then
If bMark Then
EgtSetMark(nNbrId)
Else
EgtResetMark(nNbrId)
End If
Private Sub MarkNumber(nI As Integer, bMark As Boolean)
If nI < 0 Then Return
Dim nNbrId As Integer = m_MachiningList(nI).m_nNbrId
If bMark Then
EgtSetMark(nNbrId)
Else
EgtResetMark(nNbrId)
End If
End Sub
Private Sub LaterBtn_Click(sender As Object, e As RoutedEventArgs) Handles LaterBtn.Click
Private Sub ColorMachining(nI As Integer, Optional bReset As Boolean = False)
If nI < 0 Then Return
' Assegno stato
'Dim bEnabled As Boolean = If(bReset, True, m_MachiningList(nI).m_bEnabled)
Dim bEnabled As Boolean = m_MachiningList(nI).m_bEnabled
Dim bFree As Boolean = If(bReset, True, m_MachiningList(nI).m_bFree)
' Colore della lavorazione principale
ColorSingleMachining(m_MachiningList(nI).m_nId, bEnabled, bFree)
' Colore delle lavorazioni inglobate
For Each nId As Integer In m_MachiningList(nI).m_vOthId
ColorSingleMachining(nId, bEnabled, bFree)
Next
End Sub
Private Sub ColorSingleMachining(nOperId As Integer, bEnabled As Boolean, bFree As Boolean)
' Recupero il preview della lavorazione
Dim nPvId As Integer = GDB_ID.NULL
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
' Cambio il colore
Dim nGrpId As Integer = EgtGetFirstGroupInGroup(nPvId)
While nGrpId <> GDB_ID.NULL
Dim nCutId As Integer = EgtGetFirstNameInGroup(nGrpId, NAME_PV_CUT)
Dim nPrcId As Integer = EgtGetFirstNameInGroup(nGrpId, NAME_PV_PRECUT)
Dim nPocId As Integer = EgtGetFirstNameInGroup(nGrpId, NAME_PV_POSTCUT)
If Not bEnabled Then
EgtSetColor(nCutId, COL_MCH_DISABLED)
EgtSetColor(nPrcId, COL_MCH_DISABLED)
EgtSetColor(nPocId, COL_MCH_DISABLED)
ElseIf bFree Then
EgtSetColor(nCutId, COL_MCH_CUT)
EgtSetColor(nPrcId, COL_MCH_FREE)
EgtSetColor(nPocId, COL_MCH_FREE)
Else
EgtSetColor(nCutId, COL_MCH_CUT)
EgtSetColor(nPrcId, COL_MCH_INTERF)
EgtSetColor(nPocId, COL_MCH_INTERF)
End If
nGrpId = EgtGetNextGroup(nGrpId)
End While
End Sub
Private Sub ColorNumber(nI As Integer)
If nI < 0 Then Return
If Not m_MachiningList(nI).m_bEnabled Then
EgtResetColor(m_MachiningList(nI).m_nNbrId)
ElseIf m_MachiningList(nI).m_bFree Then
EgtSetColor(m_MachiningList(nI).m_nNbrId, COL_MCH_FREE)
Else
EgtSetColor(m_MachiningList(nI).m_nNbrId, COL_MCH_INTERF)
End If
End Sub
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Remove(m_MainWindow.m_CadCutPageUC.m_SplitPage)
m_MainWindow.m_CadCutPageUC.CadCutPageGrid.Children.Add(m_MainWindow.m_CadCutPageUC.m_MoveRawPartPage)
m_MainWindow.m_CadCutPageUC.m_MovePartPage = CadCutPageUC.MovePartsPages.MoveRawPart
@@ -234,36 +375,51 @@ Public Class SplitPageUC
End Class
Public Class NameIdLsBxItem
Implements INotifyPropertyChanged
Private m_iID As Integer
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
Private m_nInd As Integer
Private m_sName As String
Public Property ID() As Integer
Public Property Ind As Integer
Get
Return m_iID
Return m_nInd
End Get
Set(value As Integer)
m_iID = value
m_nInd = value
End Set
End Property
Public Property Name() As String
Public Property Name As String
Get
Return m_sName
End Get
Set(value As String)
If value <> m_sName Then
m_sName = value
NotifyPropertyChanged("Name")
End If
End Set
End Property
'Sub New()
' Me.Name = String.Empty
' Me.ID = 0
'End Sub
Sub New(Name As String, ID As Integer)
Me.Name = Name
Me.ID = ID
Sub New(Name As String, Ind As Integer)
Me.m_sName = Name
Me.m_nInd = Ind
End Sub
Public Sub NotifyPropertyChanged(propName As String)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
End Sub
End Class
Public Class Machining
Public m_nId As Integer
Public m_vOthId As New List(Of Integer)
Public m_nType As Integer
Public m_sLay As String
Public m_nNbrId As Integer
Public m_bFree As Boolean
Public m_bEnabled As Boolean
End Class