OmagCUT :
- in inserimento pezzi aggiunto controllo compatibilità per pezzi da Trf - aggiunta possibilità di assegnare dati Trf ai componenti (se Trf import abilitato).
This commit is contained in:
@@ -758,7 +758,7 @@ Public Class AlarmsPageUC
|
||||
Return New ToolPos(m_MainWindow.m_CurrentMachine.sCurrSaw, "T100", True)
|
||||
Case CurrentMachine.MountedToolConfigs.SAWANDAUXTOOL, CurrentMachine.MountedToolConfigs.MANUALTOOLCHANGER, CurrentMachine.MountedToolConfigs.TOOLCHANGER
|
||||
Dim ChooseTool As New ChooseToolWD(m_MainWindow)
|
||||
If ChooseTool.ShowDialog = True Then
|
||||
If ChooseTool.ShowDialog Then
|
||||
Return ChooseTool.GetSelectedTool
|
||||
Else
|
||||
Return Nothing
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<Window x:Class="CompoTrfData"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib"
|
||||
FontFamily="./Resources/Fonts/#Century Gothic"
|
||||
ResizeMode="NoResize" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
|
||||
Title="ChooseMachining" Height="426.5" Width="426.5">
|
||||
|
||||
<!--Definizione della pagina di impostazione dati Trf su componenti-->
|
||||
<Border Style="{StaticResource OmagCut_Border}">
|
||||
|
||||
<Grid Name="CompoTrfDataGrid">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="0.1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="0.5*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Name="OrdCodeTxBl" Grid.Column="1" Grid.Row="1"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" HorizontalAlignment="Left"/>
|
||||
<EgtWPFLib:EgtTextBox Name="OrdCodeTxBx" Grid.Column="2" Grid.Row="1"
|
||||
Style="{StaticResource OmagCut_KeyboardTextBox}"/>
|
||||
|
||||
<TextBlock Name="OrdDescTxBl" Grid.Column="1" Grid.Row="2"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" HorizontalAlignment="Left"/>
|
||||
<EgtWPFLib:EgtTextBox Name="OrdDescTxBx" Grid.Column="2" Grid.Row="2"
|
||||
Style="{StaticResource OmagCut_KeyboardTextBox}"/>
|
||||
|
||||
<TextBlock Name="MatCodeTxBl" Grid.Column="1" Grid.Row="3"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" HorizontalAlignment="Left"/>
|
||||
<EgtWPFLib:EgtTextBox Name="MatCodeTxBx" Grid.Column="2" Grid.Row="3"
|
||||
Style="{StaticResource OmagCut_KeyboardTextBox}"/>
|
||||
|
||||
<TextBlock Name="SurfCodeTxBl" Grid.Column="1" Grid.Row="4"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" HorizontalAlignment="Left"/>
|
||||
<EgtWPFLib:EgtTextBox Name="SurfCodeTxBx" Grid.Column="2" Grid.Row="4"
|
||||
Style="{StaticResource OmagCut_KeyboardTextBox}"/>
|
||||
|
||||
<TextBlock Name="ThicknessTxBl" Grid.Column="1" Grid.Row="5"
|
||||
Style="{StaticResource OmagCut_CenteredLowerCaseCharacterTextBlock}" HorizontalAlignment="Left"/>
|
||||
<EgtWPFLib:EgtTextBox Name="ThicknessTxBx" Grid.Column="2" Grid.Row="5"
|
||||
Style="{StaticResource OmagCut_CalculatorTextBox}"/>
|
||||
|
||||
<Grid Name="ButtonsGrid" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Name="OkBtn" Grid.Column="1" Style="{StaticResource OmagCut_GradientBlueIconButton}"
|
||||
IsCancel="True">
|
||||
<Image Source="Resources/V.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="ExitBtn" Grid.Column="3" Style="{StaticResource OmagCut_GradientBlueIconButton}"
|
||||
IsCancel="True">
|
||||
<Image Source="Resources/X.png" Style="{StaticResource OmagCut_ButtonIcon}"/>
|
||||
</Button>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Window>
|
||||
@@ -0,0 +1,50 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class CompoTrfData
|
||||
|
||||
' Riferimento alla MainWindow
|
||||
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
||||
|
||||
Sub New(Owner As Window)
|
||||
Me.Owner = Owner
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
|
||||
Private Sub CompoTrfData_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||
Me.Top = Owner.Top + Owner.Height / 2 - Me.Height / 2
|
||||
Me.Left = Owner.Left + Owner.Width / 2 - Me.Width / 2
|
||||
OrdCodeTxBl.Text = EgtMsg(MSG_DRAWPAGEUC + 10) 'Order Code
|
||||
OrdDescTxBl.Text = EgtMsg(MSG_DRAWPAGEUC + 11) 'Order Description
|
||||
MatCodeTxBl.Text = EgtMsg(MSG_DRAWPAGEUC + 12) 'Material Code
|
||||
SurfCodeTxBl.Text = EgtMsg(MSG_DRAWPAGEUC + 13) 'Surface Code
|
||||
ThicknessTxBl.Text = EgtMsg(MSG_DRAWPAGEUC + 14) 'Thickness
|
||||
End Sub
|
||||
|
||||
Private Sub OkBtn_Click(sender As Object, e As RoutedEventArgs) Handles OkBtn.Click
|
||||
DialogResult = True
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Private Sub ExitBtn_Click(sender As Object, e As RoutedEventArgs) Handles ExitBtn.Click
|
||||
DialogResult = False
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Friend Sub SetData(sOrdCode As String, sOrdDesc As String, sMatCode As String, sSurfCode As String, dTh As Double)
|
||||
OrdCodeTxBx.Text = sOrdCode
|
||||
OrdDescTxBx.Text = sOrdDesc
|
||||
MatCodeTxBx.Text = sMatCode
|
||||
SurfCodeTxBx.Text = sSurfCode
|
||||
ThicknessTxBx.Text = LenToString(dTh, 2)
|
||||
End Sub
|
||||
|
||||
Friend Sub GetData(ByRef sOrdCode As String, ByRef sOrdDesc As String, ByRef sMatCode As String, ByRef sSurfCode As String, ByRef dTh As Double)
|
||||
sOrdCode = OrdCodeTxBx.Text
|
||||
sOrdDesc = OrdDescTxBx.Text
|
||||
sMatCode = MatCodeTxBx.Text
|
||||
sSurfCode = SurfCodeTxBx.Text
|
||||
StringToLen(ThicknessTxBx.Text, dTh)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -87,6 +87,7 @@ Module ConstIni
|
||||
Public Const K_TSSHOW As String = "Show"
|
||||
|
||||
Public Const S_COMPO As String = "Compo"
|
||||
Public Const K_TRFDATA As String = "TrfData"
|
||||
Public Const K_COMPODIR As String = "CompoDir"
|
||||
|
||||
Public Const S_FLATPARTS As String = "FlatParts"
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
TextAlignment="Right"/>
|
||||
<EgtWPFLib:EgtTextBox Name="PartNameTxBx" Grid.Column="1" Width="130"
|
||||
Style="{StaticResource OmagCut_KeyboardTextBox}"/>
|
||||
<Button Name="TrfDataBtn" Grid.Column="1"
|
||||
Style="{StaticResource OmagCut_YellowTextButton}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
+132
-64
@@ -39,6 +39,15 @@ Public Class DrawPageUC
|
||||
Friend m_bDrawOk As Boolean = False
|
||||
Private m_bFirst As Boolean = True
|
||||
|
||||
' Trf Data
|
||||
Private m_bTrfData As Boolean = False
|
||||
Private m_TrfOrderCode As String = ""
|
||||
Private m_TrfOrderDesc As String = ""
|
||||
Private m_TrfMatCode As String = ""
|
||||
Private m_TrfSurfCode As String = ""
|
||||
Private m_TrfThickness As Double = 0
|
||||
|
||||
|
||||
Friend ReadOnly Property sCompoName As String
|
||||
Get
|
||||
Return m_sCompoName
|
||||
@@ -107,16 +116,30 @@ Public Class DrawPageUC
|
||||
Me.DrawPageGrd.Children.Add(DrawSceneHost)
|
||||
|
||||
' Imposto i messaggi letti dal file dei messaggi
|
||||
PartNameTxBl.Text = "Nome"
|
||||
PartNumTxBl.Text = EgtMsg(MSG_DRAWPAGEUC + 1) 'Part Number - Numero pezzi
|
||||
DimensionBtn.Content = EgtMsg(MSG_DRAWPAGEUC + 2)
|
||||
SideAngleBtn.Content = EgtMsg(MSG_DRAWPAGEUC + 3)
|
||||
DripBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 8) 'Gocciolatoio
|
||||
TopTxBl.Text = EgtMsg(MSG_DRAWPAGEUC + 4)
|
||||
PartNameTxBl.Text = EgtMsg(MSG_DRAWPAGEUC + 8) ' Nome
|
||||
PartNumTxBl.Text = EgtMsg(MSG_DRAWPAGEUC + 1) ' Part Number - Numero pezzi
|
||||
DimensionBtn.Content = EgtMsg(MSG_DRAWPAGEUC + 2) ' Misure
|
||||
SideAngleBtn.Content = EgtMsg(MSG_DRAWPAGEUC + 3) ' Inclina lati
|
||||
DripBtn.Content = EgtMsg(MSG_IMPORTPAGEUC + 8) ' Gocciolatoio
|
||||
TopTxBl.Text = EgtMsg(MSG_DRAWPAGEUC + 4) ' Indica Lato Sopra
|
||||
TrfDataBtn.Content = EgtMsg(MSG_DRAWPAGEUC + 9) ' Dati Trf
|
||||
|
||||
' Abilitazione definizione gocciolatoio da chiave
|
||||
DripBtn.IsEnabled = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.UNDER_CUT)
|
||||
|
||||
' Abilitazione Nome/TrfData
|
||||
m_bTrfData = m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.TRF_IMPORT) And
|
||||
(GetPrivateProfileInt(S_COMPO, K_TRFDATA, 1, m_MainWindow.GetIniFile()) <> 0)
|
||||
If Not m_bTrfData Then
|
||||
PartNameTxBl.Visibility = Windows.Visibility.Visible
|
||||
PartNameTxBx.Visibility = Windows.Visibility.Visible
|
||||
TrfDataBtn.Visibility = Windows.Visibility.Hidden
|
||||
Else
|
||||
PartNameTxBl.Visibility = Windows.Visibility.Hidden
|
||||
PartNameTxBx.Visibility = Windows.Visibility.Hidden
|
||||
TrfDataBtn.Visibility = Windows.Visibility.Visible
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub DrawPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
@@ -194,6 +217,12 @@ Public Class DrawPageUC
|
||||
PartNameTxBx.Text = String.Empty
|
||||
PartNumTxBx.Text = "1"
|
||||
|
||||
' Reset dati TRF
|
||||
m_TrfOrderCode = ""
|
||||
m_TrfOrderDesc = ""
|
||||
m_TrfMatCode = ""
|
||||
m_TrfSurfCode = ""
|
||||
m_TrfThickness = 0
|
||||
End Sub
|
||||
|
||||
Private Sub OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles DrawScene.OnMouseDownScene
|
||||
@@ -581,8 +610,73 @@ Public Class DrawPageUC
|
||||
End While
|
||||
' Calcolo dimensione ingombro Pezzo tramite OutLoop
|
||||
Dim nOutLoopLayer = EgtGetFirstNameInGroup(Pz, NAME_OUTLOOP)
|
||||
Dim ptMin, ptMax As Point3d
|
||||
EgtGetBBoxGlob(nOutLoopLayer, GDB_BB.STANDARD, ptMin, ptMax)
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nOutLoopLayer, GDB_BB.STANDARD, b3Part)
|
||||
' Muovo la regione in Z per evitare problemi in visualizzazione
|
||||
EgtMove(nRegLayId, New Vector3d(0, 0, DELTAZ_REG), GDB_RT.GLOB)
|
||||
' Se pezzo con dati normali
|
||||
If Not m_bTrfData Then
|
||||
' Se definito nome lo inserisco nel testo
|
||||
If Not String.IsNullOrWhiteSpace(sName) Then
|
||||
Dim nTextId = EgtGetFirstInGroup(nRegLayId)
|
||||
While nTextId <> GDB_ID.NULL
|
||||
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
|
||||
Dim sText As String = String.Empty
|
||||
EgtTextGetContent(nTextId, sText)
|
||||
Dim sNewText = sName & " " & sText
|
||||
EgtModifyText(nTextId, sNewText)
|
||||
Exit While
|
||||
End If
|
||||
nTextId = EgtGetNext(nTextId)
|
||||
End While
|
||||
End If
|
||||
' altrimenti se pezzo con dati TRF
|
||||
Else
|
||||
' Nome da dati Trf
|
||||
Dim nTextId = EgtGetFirstInGroup(nRegLayId)
|
||||
While nTextId <> GDB_ID.NULL
|
||||
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
|
||||
Dim sText As String = m_TrfOrderCode & "-" & m_TrfOrderDesc
|
||||
Dim sText2 As String = m_TrfMatCode & "-" & m_TrfSurfCode
|
||||
Dim sText3 As String = LenToString(b3Part.DimX(), 0) & " x " & LenToString(b3Part.DimY(), 0) & " x " & LenToString(m_TrfThickness, 0)
|
||||
Dim dRatio As Double = Math.Max(b3Part.DimX(), b3Part.DimY()) / Math.Min(b3Part.DimX(), b3Part.DimY())
|
||||
If dRatio < 5 Then
|
||||
sText = sText & "<br/>" & sText2 & "<br/>" & sText3
|
||||
Else
|
||||
sText = sText & " " & sText2 & " " & sText3
|
||||
End If
|
||||
EgtModifyText(nTextId, sText)
|
||||
Dim ptCen As Point3d
|
||||
EgtCenterPoint(nTextId, ptCen)
|
||||
Dim b3Text As New BBox3d
|
||||
EgtGetBBoxGlob(nTextId, GDB_BB.STANDARD, b3Text)
|
||||
Dim dCoeff As Double = Math.Min(b3Part.DimX() / b3Text.DimX(), b3Part.DimY() / b3Text.DimY()) / 1.25
|
||||
If dCoeff < 1 Then
|
||||
EgtScale(nTextId, New Frame3d(ptCen), dCoeff, dCoeff, dCoeff)
|
||||
End If
|
||||
Exit While
|
||||
End If
|
||||
nTextId = EgtGetNext(nTextId)
|
||||
End While
|
||||
' Info di pezzo da dati Trf
|
||||
EgtSetInfo(Pz, "OC", m_TrfOrderCode)
|
||||
EgtSetInfo(Pz, "OD", m_TrfOrderDesc)
|
||||
EgtSetInfo(Pz, "MT", m_TrfMatCode)
|
||||
EgtSetInfo(Pz, "SRF", m_TrfSurfCode)
|
||||
EgtSetInfo(Pz, "L", DoubleToString(b3Part.DimX(), 1))
|
||||
EgtSetInfo(Pz, "W", DoubleToString(b3Part.DimY(), 1))
|
||||
EgtSetInfo(Pz, "T", m_TrfThickness)
|
||||
EgtSetInfo(Pz, "V1", DoubleToString(b3Part.DimX(), 1))
|
||||
EgtSetInfo(Pz, "V2", DoubleToString(b3Part.DimY(), 1))
|
||||
End If
|
||||
' Eventuale testo per indicare il sopra (solo nel caso di rettangolo)
|
||||
If TopChBx.IsVisible() And TopChBx.IsChecked() Then
|
||||
Dim dDimX As Double = b3Part.DimX()
|
||||
Dim dDimY As Double = b3Part.DimY()
|
||||
Dim dH As Double = Math.Min(0.1 * dDimY, 30)
|
||||
Dim nText As Integer = EgtCreateTextAdv(nRegLayId, New Point3d(dDimX / 2, dDimY - 0.6 * dH, 0), 0, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC)
|
||||
EgtSetColor(nText, New Color3d())
|
||||
End If
|
||||
' Scrivo testi per nesting
|
||||
m_SideAngleUC.WriteSideAngleForNest(DrawScene.GetCtx())
|
||||
' Esporto il pezzo in un file temporaneo
|
||||
@@ -603,33 +697,10 @@ Public Class DrawPageUC
|
||||
EgtInsertFile(sTmpFile)
|
||||
' Ne recupero l'Id
|
||||
Dim nId2 As Integer = EgtGetLastPart()
|
||||
' Muovo la regione in Z per evitare problemi in visualizzazione
|
||||
Dim nRegId = EgtGetFirstNameInGroup(nId2, NAME_REGION)
|
||||
EgtMove(nRegId, New Vector3d(0, 0, DELTAZ_REG), GDB_RT.GLOB)
|
||||
' Se definito nome lo inserisco nel testo
|
||||
If Not String.IsNullOrWhiteSpace(sName) Then
|
||||
Dim nTextId = EgtGetFirstInGroup(nRegId)
|
||||
While nTextId <> GDB_ID.NULL
|
||||
If EgtGetType(nTextId) = GDB_TY.EXT_TEXT Then
|
||||
Dim sText As String = String.Empty
|
||||
EgtTextGetContent(nTextId, sText)
|
||||
Dim sNewText = sName & " " & sText
|
||||
EgtModifyText(nTextId, sNewText)
|
||||
Exit While
|
||||
End If
|
||||
nTextId = EgtGetNext(nTextId)
|
||||
End While
|
||||
End If
|
||||
' Eventuale testo per indicare il sopra (solo nel caso di rettangolo)
|
||||
If TopChBx.IsVisible() And TopChBx.IsChecked() Then
|
||||
Dim dDimX As Double = ptMax.x - ptMin.x
|
||||
Dim dDimY As Double = ptMax.y - ptMin.y
|
||||
Dim dH As Double = Math.Min(0.1 * dDimY, 30)
|
||||
Dim nText As Integer = EgtCreateTextAdv(nRegId, New Point3d(dDimX / 2, dDimY - 0.6 * dH, 0), 0, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC)
|
||||
EgtSetColor(nText, New Color3d())
|
||||
End If
|
||||
' Aggiusto per lavorazioni
|
||||
AdjustFlatPart(nId2)
|
||||
' Se dati Trf assegno nome univoco
|
||||
If m_bTrfData Then EgtSetInfo(Pz, "CsvPart", m_TrfOrderCode & "-" & i.ToString())
|
||||
' Inserisco in parcheggio
|
||||
m_MainWindow.m_CadCutPageUC.m_NestPage.StoreOnePart(nId2, True)
|
||||
' Se richiesto posizionamento diretto, lo eseguo
|
||||
@@ -654,9 +725,9 @@ Public Class DrawPageUC
|
||||
If m_ActiveComponentPage = Pages.CompoDimension And m_bInternalCompo Then
|
||||
Return
|
||||
End If
|
||||
' se errore esco
|
||||
' Se errore esco
|
||||
If Not m_bDrawOk Then Return
|
||||
' Leggo nome da assegnare
|
||||
' Nome pezzo
|
||||
Dim sPartName As String = PartNameTxBx.Text
|
||||
' Leggo numero di pezzi da inserire
|
||||
Dim InsNbr As Integer = Int32.Parse(PartNumTxBx.Text)
|
||||
@@ -692,37 +763,14 @@ Public Class DrawPageUC
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.CadCut
|
||||
End Sub
|
||||
|
||||
Private Sub DrawPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
'Seleziono la Tab e la Page di apertura
|
||||
Select Case m_ActiveComponentPage
|
||||
Case Pages.MainComponent
|
||||
LeftButtonGrd.Children.Remove(m_MainComponentPage)
|
||||
Case Pages.SecondaryComponent
|
||||
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
|
||||
Case Pages.InternalComponent
|
||||
LeftButtonGrd.Children.Remove(m_MainWindow.m_DrawPageUC.m_CompoDimension.m_InternalCompoPage)
|
||||
Case Pages.CompoDimension
|
||||
VariablesGrd.Children.Remove(m_CompoDimension)
|
||||
Case Pages.SideAngle
|
||||
VariablesGrd.Children.Remove(m_SideAngleUC)
|
||||
End Select
|
||||
|
||||
' Pulisco l'ambiente lua
|
||||
ResetLuaVariables()
|
||||
|
||||
Private Sub TrfDataBtn_Click(sender As Object, e As RoutedEventArgs) Handles TrfDataBtn.Click
|
||||
Dim DlgTrfData As New CompoTrfData(m_MainWindow)
|
||||
DlgTrfData.SetData(m_TrfOrderCode, m_TrfOrderDesc, m_TrfMatCode, m_TrfSurfCode, m_TrfThickness)
|
||||
If DlgTrfData.ShowDialog() Then
|
||||
DlgTrfData.GetData(m_TrfOrderCode, m_TrfOrderDesc, m_TrfMatCode, m_TrfSurfCode, m_TrfThickness)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Private Sub DimensionBtn_Click(sender As Object, e As RoutedEventArgs) Handles DimensionBtn.Click
|
||||
' If DimensionBtn.IsChecked Then
|
||||
' VariablesGrd.Children.Remove(m_SideAngle)
|
||||
' VariablesGrd.Children.Add(m_CompoDimension)
|
||||
' SideAngleBtn.IsChecked = False
|
||||
' DripBtn.IsChecked = False
|
||||
' Else
|
||||
' DimensionBtn.IsChecked = True
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
Private Sub SideAngleBtn_Click(sender As Object, e As RoutedEventArgs) Handles SideAngleBtn.Click
|
||||
m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
If SideAngleBtn.IsChecked Then
|
||||
@@ -833,6 +881,26 @@ Public Class DrawPageUC
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub DrawPage_Unloaded(sender As Object, e As RoutedEventArgs)
|
||||
'Seleziono la Tab e la Page di apertura
|
||||
Select Case m_ActiveComponentPage
|
||||
Case Pages.MainComponent
|
||||
LeftButtonGrd.Children.Remove(m_MainComponentPage)
|
||||
Case Pages.SecondaryComponent
|
||||
LeftButtonGrd.Children.Remove(m_MainComponentPage.m_SecondaryComponentPage)
|
||||
Case Pages.InternalComponent
|
||||
LeftButtonGrd.Children.Remove(m_MainWindow.m_DrawPageUC.m_CompoDimension.m_InternalCompoPage)
|
||||
Case Pages.CompoDimension
|
||||
VariablesGrd.Children.Remove(m_CompoDimension)
|
||||
Case Pages.SideAngle
|
||||
VariablesGrd.Children.Remove(m_SideAngleUC)
|
||||
End Select
|
||||
|
||||
' Pulisco l'ambiente lua
|
||||
ResetLuaVariables()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Class CompoVar
|
||||
|
||||
' Public Members
|
||||
|
||||
@@ -733,11 +733,20 @@ Public Class NestPageUC
|
||||
|
||||
Private Sub InsertPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles InsertPartBtn.Click
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
Dim bWrongTrf As Boolean = False
|
||||
m_CurrProjPage.ClearMessage()
|
||||
' Ciclo di inserimento in tavola dei pezzi selezionati
|
||||
Dim nId As Integer = EgtGetFirstSelectedObj()
|
||||
While nId <> GDB_ID.NULL
|
||||
' Recupero successivo selezionato
|
||||
Dim nNextId = EgtGetNextSelectedObj()
|
||||
' Se pezzo da Trf, verifico compatibilità
|
||||
If Not VerifyTrfData(nId) Then
|
||||
bWrongTrf = True
|
||||
' Passo al successivo selezionato
|
||||
nId = nNextId
|
||||
Continue While
|
||||
End If
|
||||
' Lo metto in tavola, se possibile
|
||||
If InsertOnePart(nId) Then
|
||||
' Eventuale notifica al VeinMatching
|
||||
@@ -754,8 +763,39 @@ Public Class NestPageUC
|
||||
m_nPartPos = If(EgtGetSelectedObjCount() > 0, PART_POS.IN_TABLE, PART_POS.NONE_TABLE)
|
||||
' Aggiorno vista
|
||||
EgtZoom(ZM.ALL)
|
||||
' Eventuale segnalazione di pezzi Trf non adatti
|
||||
If bWrongTrf Then
|
||||
' Pezzi con spessore, materiale o finitura non compatibili
|
||||
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_NESTPAGEUC + 7))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function VerifyTrfData(nId As Integer) As Boolean
|
||||
' Verifico se pezzo da Trf
|
||||
If Not EgtExistsInfo(nId, "OC") Then Return True
|
||||
' Recupero e verifico lo spessore del pezzo
|
||||
Dim dTh As Double = 0
|
||||
EgtGetInfo(nId, "T", dTh)
|
||||
If Math.Abs(dTh - m_b3Raw.DimZ()) > EPS_SMALL Then Return False
|
||||
' Recupero il materiale e la finitura superficiale del pezzo
|
||||
Dim sMat As String = ""
|
||||
EgtGetInfo(nId, "MT", sMat)
|
||||
Dim sSurf As String = ""
|
||||
EgtGetInfo(nId, "SRF", sSurf)
|
||||
' Recupero materiale e finitura superficiale di pezzo già inserito (come dati di riferimento)
|
||||
Dim sRefMat As String = ""
|
||||
Dim sRefSurf As String = ""
|
||||
Dim nPartId As Integer = EgtGetFirstPartInRawPart(m_nRawId)
|
||||
While nPartId <> GDB_ID.NULL
|
||||
If EgtGetInfo(nPartId, "MT", sRefMat) And EgtGetInfo(nPartId, "SRF", sRefSurf) Then Exit While
|
||||
nPartId = EgtGetNextPartInRawPart(nPartId)
|
||||
End While
|
||||
If String.IsNullOrWhiteSpace(sRefMat) And String.IsNullOrWhiteSpace(sRefSurf) Then Return True
|
||||
' Verifico materiale e finitura superficiale
|
||||
If sMat <> sRefMat Or sSurf <> sRefSurf Then Return False
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Function InsertOnePart(ByVal nId As Integer) As Boolean
|
||||
' Se esiste grezzo e pezzo in parcheggio, lo metto nella tavola
|
||||
If m_nRawId <> GDB_ID.NULL AndAlso EgtIsPart(nId) Then
|
||||
@@ -793,7 +833,14 @@ Public Class NestPageUC
|
||||
UpdateSolidForDrip(nId)
|
||||
Return True
|
||||
Else
|
||||
' Rimuovo le lavorazioni
|
||||
EraseMachinings(nId)
|
||||
' Elimino eventuali modifiche per lati esterni inclinati e/o offsettati
|
||||
EgtCalcFlatPartUpRegion(nId, False)
|
||||
EgtCalcFlatPartDownRegion(nId, 0)
|
||||
' Eventuale cancellazione solido per taglio da sotto
|
||||
EraseSolidForDrip(nId)
|
||||
' Parcheggio
|
||||
EgtRemovePartFromRawPart(nId)
|
||||
EgtSetStatus(nId, GDB_ST.ON_)
|
||||
End If
|
||||
|
||||
@@ -181,6 +181,9 @@
|
||||
<Compile Include="CompoDimensionUC.xaml.vb">
|
||||
<DependentUpon>CompoDimensionUC.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CompoTrfData.xaml.vb">
|
||||
<DependentUpon>CompoTrfData.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ConstMachIni.vb" />
|
||||
<Compile Include="ConstMsg.vb" />
|
||||
<Compile Include="CopyTemplateUC.xaml.vb">
|
||||
@@ -344,6 +347,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="CompoTrfData.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="CopyTemplateUC.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
Reference in New Issue
Block a user